Run ID | 作者 | 问题 | 语言 | 测评结果 | Time | Memory | 代码长度 | 提交时间 |
---|---|---|---|---|---|---|---|---|
1116 | 曾浩森 | 角谷猜想 | C++ | Wrong Answer | 1 MS | 260 KB | 358 | 2023-07-10 15:28:49 |
#include<iostream> using namespace std; int a(int x){ if(x==1){ return 1; } else if(x%2==0){ cout<<x<<"/2="<<x/2<<endl; return a(x/2); } else { cout<<x<<"*3+1="<<x*3+1<<endl; return a(x*3+1); } } int main(){ int b; cin>>b; a(b); cout<<"End"; }
------Input------
199999999
------Answer-----
199999999*3+1=599999998 599999998/2=299999999 299999999*3+1=899999998 899999998/2=449999999 449999999*3+1=1349999998 1349999998/2=674999999 674999999*3+1=2024999998 2024999998/2=1012499999 1012499999*3+1=3037499998 3037499998/2=1518749999 1518749999*3+1=4556249998 4556249998/2=2278124999 2278124999*3+1=6834374998 6834374998/2=3417187499 3417187499*3+1=10251562498 10251562498/2=5125781249 5125781249*3+1=15377343748 15377343748/2=7688671874 7688671874/2=3844335937 3844335937*3+1=11533007812 115330
------Your output-----
199999999*3+1=599999998 599999998/2=299999999 299999999*3+1=899999998 899999998/2=449999999 449999999*3+1=1349999998 1349999998/2=674999999 674999999*3+1=2024999998 2024999998/2=1012499999 1012499999*3+1=-1257467298 -1257467298/2=-628733649 -628733649*3+1=-1886200946 -1886200946/2=-943100473 -943100473*3+1=1465665878 1465665878/2=732832939 732832939*3+1=-2096468478 -2096468478/2=-1048234239 -1048234239*3+1=1150264580 1150264580/2=575132290 575132290/2=287566145 287566145*3+1=862698436 862698436/