Run ID | 作者 | 问题 | 语言 | 测评结果 | Time | Memory | 代码长度 | 提交时间 |
---|---|---|---|---|---|---|---|---|
119772 | 罗子童 | 22第n项的数 | C++ | Wrong Answer | 1 MS | 280 KB | 543 | 2025-05-18 19:08:26 |
#include<iostream> // cin\cout\endl #include<cstdio> //scanf()\printf() #include<cstring> // strcpy()\strcat()\strcmp()\strlen()\memset() #include<cmath> //sqrt()\pow()\abs()\ceil()\floor()\max()\min() using namespace std; int main(){ int n,B1,B2,m; cin>>n; int a[4]; for(int i=0;i<4;i++){ cin>>a[i]; } B1=a[1]-a[0]; B2=a[2]-a[1]; if(B1==B2){ cout<<a[0]+(n-1)*(a[1]-a[0]); } else{ cout<<a[0]*pow(a[1]*1.0/a[0],n-1); } return 0; }
------Input------
10 1 5 25 125
------Answer-----
1953125
------Your output-----
1.95312e+06