牛客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;
}
相关推荐
北顾笙9804 分钟前
day38-数据结构力扣
数据结构·算法·leetcode
m0_629494736 分钟前
LeetCode 热题 100-----14.合并区间
数据结构·算法·leetcode
xin_nai10 分钟前
LeetCode热题100(Java)(5)普通数组
算法·leetcode·职场和发展
旖-旎20 分钟前
深搜练习(组合)(5)
c++·算法·深度优先·力扣
@小码农37 分钟前
2026年3月Scratch图形化编程等级考试一级真题试卷
开发语言·数据结构·c++·算法
Wect1 小时前
LeetCode 5. 最长回文子串:DP + 中心扩展
前端·算法·typescript
糖果店的幽灵1 小时前
决策树详解与sklearn实战
算法·决策树·sklearn
Lewiis1 小时前
趣谈排序算法
算法·排序算法
ComputerInBook2 小时前
数字图像处理(4版)——第 8 章——图像压缩与水印(上)(Rafael C.Gonzalez&Richard E. Woods)
人工智能·算法·计算机视觉·图像压缩·图像水印
刀法如飞2 小时前
Python列表去重:从新手三连到高阶特技,20种解法全收录
python·算法·编程语言