#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 |
76558 | jzlb_chengyixuan | 程意轩 | C | Accepted | 9836 KiB | 640 ms | C++ | 264 bytes | 2023-03-26 13:13:28 |
76554 | jzlb_chengyixuan | 程意轩 | C | Runtime Error | 9912 KiB | 88 ms | C++ | 290 bytes | 2023-03-26 13:07:05 |
76552 | jzlb_chengyixuan | 程意轩 | C | Wrong Answer | 9912 KiB | 560 ms | C++ | 292 bytes | 2023-03-26 13:05:39 |
76551 | jzlb_chengyixuan | 程意轩 | C | Wrong Answer | 9912 KiB | 628 ms | C++ | 306 bytes | 2023-03-26 13:03:29 |
76550 | jzlb_chengyixuan | 程意轩 | C | Runtime Error | 9912 KiB | 92 ms | C++ | 321 bytes | 2023-03-26 12:51:05 |
76514 | jzlb_txy | Coco is coo! | B | Output Limit Exceed | 2060 KiB | 4 ms | C++ | 272 bytes | 2023-03-25 23:58:04 |
76513 | jzlb_txy | Coco is coo! | B | Output Limit Exceed | 2060 KiB | 0 ms | C++ | 272 bytes | 2023-03-25 23:54:59 |
76512 | jzlb_txy | Coco is coo! | D | Wrong Answer | 2056 KiB | 0 ms | C++ | 259 bytes | 2023-03-25 23:15:57 |
76511 | jzlb_txy | Coco is coo! | D | Wrong Answer | 2052 KiB | 0 ms | C++ | 259 bytes | 2023-03-25 23:08:20 |
76510 | jzlb_txy | Coco is coo! | D | Wrong Answer | 2020 KiB | 0 ms | C++ | 259 bytes | 2023-03-25 23:04:20 |
76509 | jzlb_txy | Coco is coo! | D | Time Limit Exceed | 2024 KiB | 1988 ms | C++ | 215 bytes | 2023-03-25 22:56:12 |
76508 | jzlb_txy | Coco is coo! | D | Wrong Answer | 2020 KiB | 0 ms | C++ | 225 bytes | 2023-03-25 22:33:53 |
76507 | jzlb_txy | Coco is coo! | D | Wrong Answer | 2020 KiB | 0 ms | C++ | 227 bytes | 2023-03-25 22:07:16 |
76506 | jzlb_txy | Coco is coo! | C | Accepted | 5808 KiB | 664 ms | C++ | 291 bytes | 2023-03-25 21:54:45 |
76505 | jzlb_txy | Coco is coo! | C | Wrong Answer | 5808 KiB | 648 ms | C++ | 283 bytes | 2023-03-25 21:50:11 |
76504 | jzlb_gzj | 耿老师 | C | Accepted | 5808 KiB | 688 ms | C++ | 255 bytes | 2023-03-25 21:36:46 |
76503 | jzlb_gzj | 耿老师 | C | Runtime Error | 5808 KiB | 4 ms | C++ | 255 bytes | 2023-03-25 21:34:18 |
76502 | jzlb_txy | Coco is coo! | Time Limit Exceed | 5020 KiB | 2024 ms | C++ | 315 bytes | 2023-03-25 21:23:31 | |
76500 | jzlb_txy | Coco is coo! | D | Time Limit Exceed | 2024 KiB | 2004 ms | C++ | 252 bytes | 2023-03-25 21:16:50 |
76499 | jzlb_txy | Coco is coo! | D | Time Limit Exceed | 2024 KiB | 1992 ms | C++ | 252 bytes | 2023-03-25 21:05:14 |
76498 | jzlb_gcx | 顾辰曦 | G | Wrong Answer | 2024 KiB | 0 ms | C++ | 328 bytes | 2023-03-25 20:20:37 |
76494 | jzlb_txy | Coco is coo! | D | Time Limit Exceed | 2024 KiB | 1992 ms | C++ | 252 bytes | 2023-03-25 19:11:15 |
76493 | jzlb_txy | Coco is coo! | C | Time Limit Exceed | 2896 KiB | 2064 ms | C++ | 320 bytes | 2023-03-25 19:08:00 |
76490 | jzlb_xyx | 谢宇轩 | D | Wrong Answer | 2060 KiB | 0 ms | C++ | 242 bytes | 2023-03-25 16:15:23 |
76489 | jzlb_xyx | 谢宇轩 | D | Runtime Error | 2024 KiB | 0 ms | C++ | 236 bytes | 2023-03-25 16:14:02 |
76487 | jzlb_xyx | 谢宇轩 | D | Wrong Answer | 3460 KiB | 0 ms | C++ | 238 bytes | 2023-03-25 16:11:12 |
76479 | jzlb_xyx | 谢宇轩 | D | Time Limit Exceed | 2024 KiB | 2012 ms | C++ | 248 bytes | 2023-03-25 15:56:27 |
76477 | jzlb_xyx | 谢宇轩 | D | Runtime Error | 2020 KiB | 0 ms | C++ | 265 bytes | 2023-03-25 15:55:51 |
76476 | jzlb_xyx | 谢宇轩 | D | Runtime Error | 2020 KiB | 0 ms | C++ | 265 bytes | 2023-03-25 15:55:32 |
76475 | jzlb_xyx | 谢宇轩 | D | Wrong Answer | 3460 KiB | 0 ms | C++ | 272 bytes | 2023-03-25 15:53:42 |
76474 | jzlb_xyx | 谢宇轩 | D | Wrong Answer | 3460 KiB | 0 ms | C++ | 272 bytes | 2023-03-25 15:52:52 |
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 |