#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;
}
RunID | User | Nick Name | Problem ID | Result | Memory | Time | Language | Code Length | Submit Time |
76469 | jzlb_xyx | 谢宇轩 | D | Wrong Answer | 2020 KiB | 0 ms | C++ | 226 bytes | 2023-03-25 15:39:32 |
76466 | jzlb_xyx | 谢宇轩 | D | Wrong Answer | 2020 KiB | 0 ms | C++ | 232 bytes | 2023-03-25 15:37:14 |
76465 | jzlb_xyx | 谢宇轩 | D | Wrong Answer | 2020 KiB | 0 ms | C++ | 232 bytes | 2023-03-25 15:36:55 |
76462 | jzlb_xyx | 谢宇轩 | D | Wrong Answer | 2020 KiB | 0 ms | C++ | 230 bytes | 2023-03-25 15:31:49 |
76461 | jzlb_xyx | 谢宇轩 | Wrong Answer | 2804 KiB | 0 ms | C++ | 431 bytes | 2023-03-25 15:27:39 | |
76460 | jzlb_chengyixuan | 程意轩 | C | Time Limit Exceed | 9792 KiB | 2076 ms | C++ | 291 bytes | 2023-03-25 15:27:00 |
76459 | jzlb_chengyixuan | 程意轩 | B | Accepted | 9792 KiB | 12 ms | C++ | 288 bytes | 2023-03-25 15:25:51 |
76458 | jzlb_chengyixuan | 程意轩 | B | Runtime Error | 2764 KiB | 0 ms | C++ | 274 bytes | 2023-03-25 15:24:48 |
76457 | jzlb_xyx | 谢宇轩 | B | Time Limit Exceed | 33932 KiB | 2004 ms | C++ | 401 bytes | 2023-03-25 15:21:37 |
76456 | jzlb_xyx | 谢宇轩 | B | Wrong Answer | 2024 KiB | 4 ms | C++ | 260 bytes | 2023-03-25 15:20:28 |
76455 | jzlb_xyx | 谢宇轩 | G | Accepted | 2024 KiB | 0 ms | C++ | 277 bytes | 2023-03-25 15:17:59 |
76454 | jzlb_chengyixuan | 程意轩 | C | Runtime Error | 9912 KiB | 120 ms | C++ | 323 bytes | 2023-03-25 14:59:11 |
76453 | jzlb_chengyixuan | 程意轩 | C | Wrong Answer | 9912 KiB | 680 ms | C++ | 291 bytes | 2023-03-25 14:55:47 |
76452 | jzlb_xyx | 谢宇轩 | D | Wrong Answer | 2020 KiB | 0 ms | C++ | 230 bytes | 2023-03-25 14:54:04 |
76451 | jzlb_xyx | 谢宇轩 | D | Wrong Answer | 2020 KiB | 0 ms | C++ | 230 bytes | 2023-03-25 14:53:28 |
76450 | jzlb_chengyixuan | 程意轩 | C | Runtime Error | 9912 KiB | 104 ms | C++ | 289 bytes | 2023-03-25 14:52:22 |
76449 | jzlb_chengyixuan | 程意轩 | C | Runtime Error | 9912 KiB | 100 ms | C++ | 289 bytes | 2023-03-25 14:49:16 |
76448 | jzlb_chengyixuan | 程意轩 | C | Runtime Error | 9912 KiB | 100 ms | C++ | 289 bytes | 2023-03-25 14:46:42 |
76447 | jzlb_xyx | 谢宇轩 | D | Runtime Error | 2020 KiB | 0 ms | C++ | 224 bytes | 2023-03-25 14:46:23 |
76446 | jzlb_xyx | 谢宇轩 | D | Runtime Error | 2020 KiB | 0 ms | C++ | 224 bytes | 2023-03-25 14:45:30 |
76445 | jzlb_chengyixuan | 程意轩 | C | Runtime Error | 9912 KiB | 104 ms | C++ | 283 bytes | 2023-03-25 14:45:28 |
76444 | jzlb_xyx | 谢宇轩 | D | Wrong Answer | 2020 KiB | 0 ms | C++ | 226 bytes | 2023-03-25 14:44:18 |
76443 | jzlb_xyx | 谢宇轩 | B | Time Limit Exceed | 33932 KiB | 2016 ms | C++ | 401 bytes | 2023-03-25 14:36:31 |
76442 | jzlb_xyx | 谢宇轩 | B | Time Limit Exceed | 33932 KiB | 2004 ms | C++ | 401 bytes | 2023-03-25 14:34:19 |
76438 | jzlb_chengyixuan | 程意轩 | D | Wrong Answer | 2056 KiB | 0 ms | C++ | 222 bytes | 2023-03-25 14:30:37 |
76428 | jzlb_chengyixuan | 程意轩 | D | Wrong Answer | 2176 KiB | 0 ms | C++ | 225 bytes | 2023-03-25 14:09:36 |
76425 | jzlb_chengyixuan | 程意轩 | D | Wrong Answer | 2052 KiB | 0 ms | C++ | 216 bytes | 2023-03-25 14:01:58 |
76424 | jzlb_chengyixuan | 程意轩 | D | Wrong Answer | 2056 KiB | 0 ms | C++ | 222 bytes | 2023-03-25 13:57:07 |
76423 | jzlb_chengyixuan | 程意轩 | Accepted | 2800 KiB | 0 ms | C++ | 237 bytes | 2023-03-25 13:44:52 | |
76422 | jzlb_chengyixuan | 程意轩 | Wrong Answer | 2800 KiB | 0 ms | C++ | 232 bytes | 2023-03-25 13:41:20 | |
76421 | jzlb_chengyixuan | 程意轩 | Wrong Answer | 2800 KiB | 0 ms | C++ | 237 bytes | 2023-03-25 13:37:47 | |
76420 | jzlb_chengyixuan | 程意轩 | Wrong Answer | 2800 KiB | 0 ms | C++ | 235 bytes | 2023-03-25 13:35:47 | |
76419 | jzlb_chengyixuan | 程意轩 | Wrong Answer | 2800 KiB | 0 ms | C++ | 237 bytes | 2023-03-25 13:26:17 | |
76418 | jzlb_chengyixuan | 程意轩 | Accepted | 2804 KiB | 0 ms | C++ | 244 bytes | 2023-03-25 13:17:23 | |
76417 | jzlb_chengyixuan | 程意轩 | Wrong Answer | 2804 KiB | 0 ms | C++ | 242 bytes | 2023-03-25 13:13:27 | |
76416 | jzlb_chengyixuan | 程意轩 | Wrong Answer | 2800 KiB | 0 ms | C++ | 233 bytes | 2023-03-25 13:11:43 | |
76415 | jzlb_xyx | 谢宇轩 | B | Time Limit Exceed | 33932 KiB | 2012 ms | C++ | 324 bytes | 2023-03-25 13:11:19 |
76394 | jzlb_txy | Coco is coo! | C | Time Limit Exceed | 2900 KiB | 1996 ms | C++ | 309 bytes | 2023-03-24 22:58:56 |
76393 | jzlb_txy | Coco is coo! | C | Compile Error | 0 KiB | 0 ms | C++ | 315 bytes | 2023-03-24 22:57:36 |
76392 | jzlb_txy | Coco is coo! | C | Compile Error | 0 KiB | 0 ms | C++ | 315 bytes | 2023-03-24 22:56:48 |
76389 | jzlb_chengyixuan | 程意轩 | C | Wrong Answer | 9912 KiB | 16 ms | C++ | 274 bytes | 2023-03-24 21:20:29 |
76387 | jzlb_chengyixuan | 程意轩 | C | Output Limit Exceed | 9912 KiB | 212 ms | C++ | 291 bytes | 2023-03-24 21:15:48 |
76386 | jzlb_chengyixuan | 程意轩 | C | Runtime Error | 9912 KiB | 116 ms | C++ | 289 bytes | 2023-03-24 21:11:53 |
76383 | jzlb_chengyixuan | 程意轩 | B | Wrong Answer | 9912 KiB | 16 ms | C++ | 288 bytes | 2023-03-24 20:58:56 |
76382 | jzlb_chengyixuan | 程意轩 | B | Output Limit Exceed | 9912 KiB | 12 ms | C++ | 286 bytes | 2023-03-24 20:57:23 |
76380 | jzlb_chengyixuan | 程意轩 | B | Wrong Answer | 9912 KiB | 12 ms | C++ | 290 bytes | 2023-03-24 20:55:01 |
76379 | jzlb_chengyixuan | 程意轩 | B | Time Limit Exceed | 9912 KiB | 2004 ms | C++ | 286 bytes | 2023-03-24 20:53:19 |
76378 | jzlb_chengyixuan | 程意轩 | B | Time Limit Exceed | 9912 KiB | 2004 ms | C++ | 288 bytes | 2023-03-24 20:48:52 |
76377 | jzlb_chengyixuan | 程意轩 | B | Time Limit Exceed | 9912 KiB | 2012 ms | C++ | 288 bytes | 2023-03-24 20:43:59 |
76376 | jzlb_chengyixuan | 程意轩 | B | Wrong Answer | 9912 KiB | 12 ms | C++ | 281 bytes | 2023-03-24 20:32:02 |