牛客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;
}
相关推荐
x_yeyue1 小时前
三角形数
笔记·算法·数论·组合数学
念何架构之路2 小时前
Go语言加密算法
数据结构·算法·哈希算法
AI科技星2 小时前
《数学公理体系·第三部·数术几何》(2026 年版)
c语言·开发语言·线性代数·算法·矩阵·量子计算·agi
失去的青春---夕阳下的奔跑2 小时前
560. 和为 K 的子数组
数据结构·算法·leetcode
黎阳之光3 小时前
黎阳之光:以视频孪生重构智慧医院信息化,打造高标项目核心竞争力
大数据·人工智能·物联网·算法·数字孪生
丷丩3 小时前
三级缓存下MVT地图瓦片服务性能优化策略
算法·缓存·性能优化·gis·geoai-up
m0_629494733 小时前
LeetCode 热题 100-----25.回文链表
数据结构·算法·leetcode·链表
ʚ希希ɞ ྀ4 小时前
单词拆分----dp
算法
智者知已应修善业5 小时前
【51单片机LED闪烁10次数码管显示0-9】2023-12-14
c++·经验分享·笔记·算法·51单片机
智者知已应修善业5 小时前
【51单片机2按键控制1个敞亮LED灯闪烁和熄灭】2023-11-3
c++·经验分享·笔记·算法·51单片机