Run ID 作者 问题 语言 测评结果 Time Memory 代码长度 提交时间
158919 张蔚林 22第n项的数 C++ Wrong Answer 1 MS 288 KB 267 2026-08-23 13:29:52

Tests(0/5):


Code:

#include<bits/stdc++.h> using namespace std; int main() { long long n,s[10001]; cin>>n; for(int i=0;i<4;i++){ cin>>s[i]; } int d=s[1]-s[0]; if((s[2]-s[n])==d){ cout<<s[0]+(n-1)*d; } else { cout<<s[0]*pow(s[2]/s[1],n-1); } return 0; }


Run Info:

------Input------
6 1 6 11 16
------Answer-----
26
------Your output-----
1