CF #673(Div.3)
A - Odd Divisor
一直除以 2 ,如果最后不是 1 ,就含有Odd Divisor
顺便吐槽一下这奇妙的机翻,真就直译
(原文:Check if n has an odd divisor, )
复制代码
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21#include<iostream> using namespace std; bool have(unsigned long long int n){ if(n==1) return false; else if(n % 2 == 0) return have(n / 2); else return true; } int main(){ int t; cin>>t; while(t--){ unsigned long long n; cin>>n; if(have(n)) cout<<"YES"<<endl; else cout<<"NO"<<endl; } return 0; }
B - New Year’s Number
~
复制代码
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18#include<iostream> using namespace std; int main(){ int t; cin>>t; while(t--){ long long n; cin>>n; int a,b; a=n/2020; b=n%2020; if(a>=b) cout<<"YES"<<endl; else cout<<"NO"<<endl; } return 0; }
E - Advertising Agency
这道RE了 QAQ
复制代码
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33#include<iostream> #include<queue> using namespace std; priority_queue<int,vector<int>,less<int> > pq; int main(){ int t; cin>>t; while(t--){ int n,k; cin>>n>>k; for(int i=0;i<n;i++){ int x;cin>>x; pq.push(x); } unsigned long long ans=1; while(k--){ int m,cnt=0; do{ ++cnt; m=pq.top(); pq.pop(); }while (pq.top()==m); ans*=cnt; } cout<<ans<<endl; } return 0; }
其他的不会做了
最后
以上就是标致眼睛最近收集整理的关于2021.1.25寒假打卡Day18CF #673(Div.3)的全部内容,更多相关2021.1.25寒假打卡Day18CF内容请搜索靠谱客的其他文章。
本图文内容来源于网友提供,作为学习参考使用,或来自网络收集整理,版权属于原作者所有。
发表评论 取消回复