yujingyan @ 2024-12-01 10:50:49
求助啊
by xxgirlxx @ 2024-12-01 10:56:55
@yujingyan你开 long long
了吗?
by sdjjdjdjdjd @ 2024-12-01 11:01:15
不开long long
见祖宗
by Raymond2014 @ 2024-12-01 11:04:32
long long要开一下。N≤2,000,000呢!
by yujingyan @ 2024-12-01 19:14:03
呃,真没开。谢谢,我试试。
by yujingyan @ 2024-12-01 19:17:12
怪不得超时了。谢谢
by caoen2014 @ 2024-12-10 12:34:01
小心别写成 long long long . @yujingyan
by caoen2014 @ 2024-12-10 12:37:42
我知道有个人代码: (这一题)
long long long ......
结果不用说:-------------编译失败。 哈哈哈!!!
by yujingyan @ 2024-12-21 17:40:01
@caoen2014我也想,高精度用long long long long long long long long不就是四倍吗?结果不用说:编译失败。呃
by caoen2014 @ 2024-12-23 11:48:10
@yujingyan哈哈
by caoen2014 @ 2024-12-23 12:23:10
@yujingyan (也是Unaccepted 100分) 我第一遍代码:
#include<bits/stdc++.h>
using namespace std;
int n;
int main() {
cin>>n;
while(n>1){
if(n%2==0){
cout<<n<<"/2="<<n/2<<endl;
if(n/2==1)break;
n/=2;
}
else{
cout<<n<<"*3+1="<<n*3+1<<endl;
n=n*3+1;
}
}
cout<<"End"<<endl;
return 0;
}