CONTEST ID : 1546 - 3.19递推练习

#include<bits/stdc++.h>
using namespace std;
int a[20005],b[20005],c[20005];
int main(){
//a[i]=a[i-1]+a[i-2];
int n;
cin>>n;
a[0]=1;//加数1 
b[0]=2;//加数2
int A=1;//数位长度
int jw=0;//进位
for(int i=3;i<=n;i++){//从第3个开始算 
jw=0;
for(int j=0;j<A;j++){//做加法 
c[j]=a[j]+b[j]+jw;
jw=c[j]/10;//大于等于10有进位 
c[j]=c[j]%10;//保留个位 
}
if(jw==1){//数位变多了 
c[A]=1;
A++;//记录数位增加了 
}
for(int k=0;k<A;k++){
a[k]=b[k];
b[k]=c[k];

}
if(n==1)
cout<<1;
else if(n==2)
cout<<2;
else {
for(int i=A-1;i>=0;i--)
cout<<c[i];
}
return 0; 
}


SERVER TIME : 2024-11-24 05:55:08
Finished

STATUS : End    OPEN : Public
Start Time : 2023-03-19 12:00:00
End Time : 2023-04-02 16:00:00


Problem ID    User    Language    Result   

RunID User Nick Name Problem ID Result Memory Time Language Code Length Submit Time
76614jzlb_chengyixuan程意轩
D
Accepted
2256 KiB
0 ms
C++628 bytes2023-03-26 14:36:00
76584jzlb_chengyixuan程意轩
D
Wrong Answer
2176 KiB
0 ms
C++217 bytes2023-03-26 14:01:21
76575jzlb_chengyixuan程意轩
D
Wrong Answer
2176 KiB
0 ms
C++217 bytes2023-03-26 13:43:38
76573jzlb_chengyixuan程意轩
D
Wrong Answer
2176 KiB
0 ms
C++217 bytes2023-03-26 13:41:20
76570jzlb_chengyixuan程意轩
D
Wrong Answer
2056 KiB
0 ms
C++222 bytes2023-03-26 13:33:37
76558jzlb_chengyixuan程意轩
C
Accepted
9836 KiB
640 ms
C++264 bytes2023-03-26 13:13:28
76554jzlb_chengyixuan程意轩
C
Runtime Error
9912 KiB
88 ms
C++290 bytes2023-03-26 13:07:05
76552jzlb_chengyixuan程意轩
C
Wrong Answer
9912 KiB
560 ms
C++292 bytes2023-03-26 13:05:39
76551jzlb_chengyixuan程意轩
C
Wrong Answer
9912 KiB
628 ms
C++306 bytes2023-03-26 13:03:29
76550jzlb_chengyixuan程意轩
C
Runtime Error
9912 KiB
92 ms
C++321 bytes2023-03-26 12:51:05
76460jzlb_chengyixuan程意轩
C
Time Limit Exceed
9792 KiB
2076 ms
C++291 bytes2023-03-25 15:27:00
76459jzlb_chengyixuan程意轩
B
Accepted
9792 KiB
12 ms
C++288 bytes2023-03-25 15:25:51
76458jzlb_chengyixuan程意轩
B
Runtime Error
2764 KiB
0 ms
C++274 bytes2023-03-25 15:24:48
76454jzlb_chengyixuan程意轩
C
Runtime Error
9912 KiB
120 ms
C++323 bytes2023-03-25 14:59:11
76453jzlb_chengyixuan程意轩
C
Wrong Answer
9912 KiB
680 ms
C++291 bytes2023-03-25 14:55:47
76450jzlb_chengyixuan程意轩
C
Runtime Error
9912 KiB
104 ms
C++289 bytes2023-03-25 14:52:22
76449jzlb_chengyixuan程意轩
C
Runtime Error
9912 KiB
100 ms
C++289 bytes2023-03-25 14:49:16
76448jzlb_chengyixuan程意轩
C
Runtime Error
9912 KiB
100 ms
C++289 bytes2023-03-25 14:46:42
76445jzlb_chengyixuan程意轩
C
Runtime Error
9912 KiB
104 ms
C++283 bytes2023-03-25 14:45:28
76438jzlb_chengyixuan程意轩
D
Wrong Answer
2056 KiB
0 ms
C++222 bytes2023-03-25 14:30:37
76428jzlb_chengyixuan程意轩
D
Wrong Answer
2176 KiB
0 ms
C++225 bytes2023-03-25 14:09:36
76425jzlb_chengyixuan程意轩
D
Wrong Answer
2052 KiB
0 ms
C++216 bytes2023-03-25 14:01:58
76424jzlb_chengyixuan程意轩
D
Wrong Answer
2056 KiB
0 ms
C++222 bytes2023-03-25 13:57:07
76423jzlb_chengyixuan程意轩Accepted
2800 KiB
0 ms
C++237 bytes2023-03-25 13:44:52
76422jzlb_chengyixuan程意轩Wrong Answer
2800 KiB
0 ms
C++232 bytes2023-03-25 13:41:20
76421jzlb_chengyixuan程意轩Wrong Answer
2800 KiB
0 ms
C++237 bytes2023-03-25 13:37:47
76420jzlb_chengyixuan程意轩Wrong Answer
2800 KiB
0 ms
C++235 bytes2023-03-25 13:35:47
76419jzlb_chengyixuan程意轩Wrong Answer
2800 KiB
0 ms
C++237 bytes2023-03-25 13:26:17
76418jzlb_chengyixuan程意轩Accepted
2804 KiB
0 ms
C++244 bytes2023-03-25 13:17:23
76417jzlb_chengyixuan程意轩Wrong Answer
2804 KiB
0 ms
C++242 bytes2023-03-25 13:13:27
76416jzlb_chengyixuan程意轩Wrong Answer
2800 KiB
0 ms
C++233 bytes2023-03-25 13:11:43
76389jzlb_chengyixuan程意轩
C
Wrong Answer
9912 KiB
16 ms
C++274 bytes2023-03-24 21:20:29
76387jzlb_chengyixuan程意轩
C
Output Limit Exceed
9912 KiB
212 ms
C++291 bytes2023-03-24 21:15:48
76386jzlb_chengyixuan程意轩
C
Runtime Error
9912 KiB
116 ms
C++289 bytes2023-03-24 21:11:53
76383jzlb_chengyixuan程意轩
B
Wrong Answer
9912 KiB
16 ms
C++288 bytes2023-03-24 20:58:56
76382jzlb_chengyixuan程意轩
B
Output Limit Exceed
9912 KiB
12 ms
C++286 bytes2023-03-24 20:57:23
76380jzlb_chengyixuan程意轩
B
Wrong Answer
9912 KiB
12 ms
C++290 bytes2023-03-24 20:55:01
76379jzlb_chengyixuan程意轩
B
Time Limit Exceed
9912 KiB
2004 ms
C++286 bytes2023-03-24 20:53:19
76378jzlb_chengyixuan程意轩
B
Time Limit Exceed
9912 KiB
2004 ms
C++288 bytes2023-03-24 20:48:52
76377jzlb_chengyixuan程意轩
B
Time Limit Exceed
9912 KiB
2012 ms
C++288 bytes2023-03-24 20:43:59
76376jzlb_chengyixuan程意轩
B
Wrong Answer
9912 KiB
12 ms
C++281 bytes2023-03-24 20:32:02
76374jzlb_chengyixuan程意轩
B
Wrong Answer
9912 KiB
12 ms
C++290 bytes2023-03-24 20:29:53
76373jzlb_chengyixuan程意轩
B
Wrong Answer
9912 KiB
8 ms
C++289 bytes2023-03-24 20:28:54
76366jzlb_chengyixuan程意轩
B
Wrong Answer
2096 KiB
0 ms
C++214 bytes2023-03-24 20:14:25
76365jzlb_chengyixuan程意轩
B
Wrong Answer
9832 KiB
0 ms
C++216 bytes2023-03-24 20:13:05
76360jzlb_chengyixuan程意轩
D
Wrong Answer
2020 KiB
0 ms
C++223 bytes2023-03-24 19:25:57
76358jzlb_chengyixuan程意轩
D
Wrong Answer
2020 KiB
0 ms
C++215 bytes2023-03-24 19:22:16
76357jzlb_chengyixuan程意轩
D
Wrong Answer
2056 KiB
0 ms
C++218 bytes2023-03-24 19:17:40
76356jzlb_chengyixuan程意轩
D
Wrong Answer
2216 KiB
0 ms
C++221 bytes2023-03-24 19:15:23
76355jzlb_chengyixuan程意轩
D
Wrong Answer
2056 KiB
0 ms
C++216 bytes2023-03-24 19:11:15