Run ID | 作者 | 问题 | 语言 | 测评结果 | Time | Memory | 代码长度 | 提交时间 |
---|---|---|---|---|---|---|---|---|
92534 | 只因你太美(Ikun 真爱粉) | 22第n项的数 | C++ | Wrong Answer | 1 MS | 280 KB | 581 | 2024-10-05 16:46:54 |
#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(){ double a,b,c,d; int n; cin>>n>>a>>b>>c>>d; if(b-a==c-b&&b-a==d-c){ if(c-b!=0){ cout<<a+(n-1)*(c-b); return 0; } else{ cout<<a; return 0; } } if(b/a==c/b&&b/a==d/c){ cout<<a*pow(c/b,n-1); } return 0; }
------Input------
10 1 5 25 125
------Answer-----
1953125
------Your output-----
1.95312e+06