Run ID | 作者 | 问题 | 语言 | 测评结果 | Time | Memory | 代码长度 | 提交时间 |
---|---|---|---|---|---|---|---|---|
103235 | 廖宸睿 | 22第n项的数 | C++ | Accepted | 1 MS | 272 KB | 522 | 2024-12-28 14:49:16 |
#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 x,n,t,y,e,q,w; cin>>x; cin>>t>>y>>e>>n; if(y-t==n-e){ q=y-t; cout<<q*(x-1)+t; } else{ q=y/t; w=t; for(int i=1;i<=x-1;i++){ w*=q; } cout<<w; } return 0; }