| Run ID | 作者 | 问题 | 语言 | 测评结果 | Time | Memory | 代码长度 | 提交时间 |
|---|---|---|---|---|---|---|---|---|
| 68498 | 鞠润东 | 角谷猜想 | C++ | Wrong Answer | 1 MS | 268 KB | 256 | 2024-03-23 15:47:50 |
#include <iostream> #include <cmath> #include <cstdio> #include <iomanip> using namespace std; int main() { long long a; cin>>a; while(a != 1){ if(a % 2 == 0){ a = a/2; }else{ a = (3*a+1)/2; } cout<<a<<" "; } return 0; }
------Input------
100
------Answer-----
100/2=50 50/2=25 25*3+1=76 76/2=38 38/2=19 19*3+1=58 58/2=29 29*3+1=88 88/2=44 44/2=22 22/2=11 11*3+1=34 34/2=17 17*3+1=52 52/2=26 26/2=13 13*3+1=40 40/2=20 20/2=10 10/2=5 5*3+1=16 16/2=8 8/2=4 4/2=2 2/2=1 End
------Your output-----
50 25 38 19 29 44 22 11 17 26 13 20 10 5 8 4 2 1