牛客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;
}
相关推荐
故事和你9144 分钟前
洛谷-数据结构1-4-图的基本应用1
开发语言·数据结构·算法·深度优先·动态规划·图论
我叫黑大帅1 小时前
为什么map查找时间复杂度是O(1)?
后端·算法·面试
炽烈小老头1 小时前
【每天学习一点算法 2026/04/20】除自身以外数组的乘积
学习·算法
skilllite作者2 小时前
AI agent 的 Assistant Auto LLM Routing 规划的思考
网络·人工智能·算法·rust·openclaw·agentskills
py有趣3 小时前
力扣热门100题之不同路径
算法·leetcode
_日拱一卒4 小时前
LeetCode:25K个一组翻转链表
算法·leetcode·链表
啊哦呃咦唔鱼4 小时前
LeetCodehot100-394 字符串解码
算法
小欣加油4 小时前
leetcode2078 两栋颜色不同且距离最远的房子
数据结构·c++·算法·leetcode·职场和发展
我真不是小鱼4 小时前
cpp刷题打卡记录30——轮转数组 & 螺旋矩阵 & 搜索二维矩阵II
数据结构·c++·算法·leetcode
逻辑驱动的ken5 小时前
Java高频面试考点场景题09
java·开发语言·数据库·算法·oracle·哈希算法·散列表