还是A-D的题解,因为我不会EFG。不会还这么理直气壮???
老规矩,比赛链接:ABC336
签到题耶。
#include <bits/stdc++.h>
using namespace std;
int main(){
int n;
cin>>n;
cout<<'L';
for(int i=0;i<n;i++)
cout<<'o';
cout<<'ng'<<endl;
return 0;
}
就是问n的二进制末尾有几个0。根据短除法倒取余数,直接一直除2,直到有余数就停。最后数一下一共除了几次就OK了。
#include <bits/stdc++.h>
using namespace std;
int ctz(int n){
while(n%2==0){
res++;
n/=2;
}
return res;
}
int main(){
int n;
cin>>n;
cout<<ctz(n)<<

本文介绍了AtcoderABC336编程比赛中的四道题目,涉及基础C++编程、二进制计算、模拟方法、字符串处理和最长金字塔数列,强调了解决问题时的细节把握
最低0.47元/天 解锁文章
2520

被折叠的 条评论
为什么被折叠?



