牛客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;
}
相关推荐
玖釉-2 小时前
下一个排列:从字典序到原地算法的完整推导
数据结构·c++·windows·算法
IronMurphy3 小时前
【算法五十】62. 不同路径
算法
影寂ldy3 小时前
C#一维数组
算法
过期动态3 小时前
【LeetCode 热题 100】移动零
java·数据结构·算法·leetcode·职场和发展·rabbitmq
计算机安禾4 小时前
【算法分析与设计】第10篇:下界理论与NP完全性初步
大数据·人工智能·算法
水木流年追梦5 小时前
大模型入门-大模型分布式训练2
开发语言·分布式·python·算法·正则表达式·prompt
sali-tec5 小时前
C# 基于OpenCv的视觉工作流-章78-KRT测量
图像处理·人工智能·数码相机·opencv·算法·计算机视觉
菜菜的顾清寒5 小时前
力扣HOT100(32)二叉树的中序遍历
数据结构·算法·leetcode
x2c5 小时前
数据结构:线性表中链表的建立和基本操作(C)
算法