Run ID 作者 问题 语言 测评结果 Time Memory 代码长度 提交时间
149277 郑羽辰 22第n项的数 C++ Wrong Answer 0 MS 280 KB 505 2026-03-08 17:29:29

Tests(4/5):


Code:

#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(){ long long n,a[5],i,m,s; cin>>n; for(i=1;i<=4;i++){ cin>>a[i]; } if(a[2]-a[1]==a[4]-a[3]){ cout<<a[1]+(a[2]-a[1])*(n-1); } else{ cout<<a[1]*pow((a[2]/a[1]),(n-1)); } return 0; }


Run Info:

------Input------
10 1 5 25 125
------Answer-----
1953125
------Your output-----
1.95312e+06