Run ID 作者 问题 语言 测评结果 Time Memory 代码长度 提交时间
765 曾浩森 22第n项的数 C++ Wrong Answer 0 MS 264 KB 505 2023-04-01 14:34:46

Tests(4/5):


Code:

#include<iostream> using namespace std; int c,r; int num(int a){ int k; if(a==1) k=1; else k=num(a-1)*2; return k; } int dc(int a){ if(a==1) r=1; else r=dc(a-1)+c; return r;} int main(){ int x,y,z,o,b; cin>>b; cin>>x>>y>>z>>o; if(y/x==2&&z/y==2&&o/z==2){ cout<<num(b); } else{ c=y-x; if(x%2==0) cout<<dc(b)+1; else cout<<dc(b); } }


Run Info:

------Input------
10 1 5 25 125
------Answer-----
1953125
------Your output-----
37