牛客2024年除夕娱乐赛(题解)

比赛地址 :

牛客竞赛_ACM/NOI/CSP/CCPC/ICPC算法编程高难度练习赛_牛客竞赛OJ

A

看题面然后猜!!!

复制代码
#include<bits/stdc++.h>
using namespace std;
int main(){
    cout << "原神启动" << endl;
}

B

也是看题面然后猜 :

复制代码
#include<bits/stdc++.h>
using namespace std;
int main(){
    cout << "除夕快乐万事如意" << endl;
}

C

看题面和赛时提示,然后看比赛简介,然后猜出是出题人的id;

复制代码
#include<bits/stdc++.h>
using namespace std;
int main(){
    cout << "神崎兰子" << endl;
}

D

// ai ^ aj <= min(ai,aj);

// lcm(ai,aj) >= max(ai,aj);

// 若 ai==aj , 那么ai ^ aj = 0 , lcm() = ai ;

// 又因为lcm(0,x) == 0, ,恒成立 , 那么只有ai = aj = 0 的情况满足题目要求 ;

// 所以求 0 的个数的2次方就行了

复制代码
#include<bits/stdc++.h>
using namespace std;
int main(){
    // cout << "除夕快乐万事如意" << endl;
    int n ; cin >> n ;
    int ans = 0 ;
    // ai ^ aj <= min(ai,aj);
    // lcm(ai,aj) >= max(ai,aj);
    // 若 ai==aj , 那么ai ^ aj = 0 , lcm() = ai ;
    // 又因为lcm(0,x) == 0, ,恒成立 , 那么只有ai = aj = 0 的情况满足题目要求 ;
    // 所以求 0 的个数的2次方就行了
    while(n--){
        int x ; cin >> x ;
        if(x==0) ans ++;
    }
    cout << 1LL * ans * ans << endl;
}

E

今晚除夕,然后写出题目拼音,将xi去掉,组合其它就能够得到答案;

复制代码
/*
xi e xi ng xi a ge
engage
*/
#include<bits/stdc++.h>
using namespace std;
int main(){
    cout << "engage" << endl;
}
相关推荐
椰羊~王小美14 小时前
随机数概念及算法
算法
阿Y加油吧15 小时前
算法实战笔记:LeetCode 169 多数元素 & 75 颜色分类
笔记·算法·leetcode
不要秃头的小孩15 小时前
力扣刷题——509. 斐波那契数
python·算法·leetcode·动态规划
We་ct15 小时前
LeetCode 120. 三角形最小路径和:动态规划详解
前端·javascript·算法·leetcode·typescript·动态规划
py有趣16 小时前
力扣热门100题之和为K的子数组
数据结构·算法·leetcode
hipolymers16 小时前
C语言怎么样?难学吗?
c语言·数据结构·学习·算法·编程
workflower18 小时前
机器人应用-楼宇室内巡逻
大数据·人工智能·算法·microsoft·机器人·动态规划·享元模式
ZPC821018 小时前
fanuc 机器人通过PR寄存器实现轨迹控制
人工智能·算法·计算机视觉·机器人
py有趣18 小时前
力扣热门100题之编辑距离
数据结构·算法·leetcode