#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 |
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 |
76374 | jzlb_chengyixuan | 程意轩 | B | Wrong Answer | 9912 KiB | 12 ms | C++ | 290 bytes | 2023-03-24 20:29:53 |
76373 | jzlb_chengyixuan | 程意轩 | B | Wrong Answer | 9912 KiB | 8 ms | C++ | 289 bytes | 2023-03-24 20:28:54 |
76369 | jzlb_trz | 诗剑行 | G | Accepted | 2024 KiB | 0 ms | C++ | 333 bytes | 2023-03-24 20:21:05 |
76366 | jzlb_chengyixuan | 程意轩 | B | Wrong Answer | 2096 KiB | 0 ms | C++ | 214 bytes | 2023-03-24 20:14:25 |
76365 | jzlb_chengyixuan | 程意轩 | B | Wrong Answer | 9832 KiB | 0 ms | C++ | 216 bytes | 2023-03-24 20:13:05 |
76364 | jzlb_trz | 诗剑行 | Accepted | 2412 KiB | 0 ms | C++ | 254 bytes | 2023-03-24 19:52:03 | |
76363 | jzlb_trz | 诗剑行 | Time Limit Exceed | 2412 KiB | 1984 ms | C++ | 303 bytes | 2023-03-24 19:42:45 | |
76360 | jzlb_chengyixuan | 程意轩 | D | Wrong Answer | 2020 KiB | 0 ms | C++ | 223 bytes | 2023-03-24 19:25:57 |
76358 | jzlb_chengyixuan | 程意轩 | D | Wrong Answer | 2020 KiB | 0 ms | C++ | 215 bytes | 2023-03-24 19:22:16 |
76357 | jzlb_chengyixuan | 程意轩 | D | Wrong Answer | 2056 KiB | 0 ms | C++ | 218 bytes | 2023-03-24 19:17:40 |
76356 | jzlb_chengyixuan | 程意轩 | D | Wrong Answer | 2216 KiB | 0 ms | C++ | 221 bytes | 2023-03-24 19:15:23 |
76355 | jzlb_chengyixuan | 程意轩 | D | Wrong Answer | 2056 KiB | 0 ms | C++ | 216 bytes | 2023-03-24 19:11:15 |
76349 | jzlb_chengyixuan | 程意轩 | D | Wrong Answer | 2056 KiB | 0 ms | C++ | 200 bytes | 2023-03-24 19:01:04 |
76345 | jzlb_chengyixuan | 程意轩 | D | Wrong Answer | 3460 KiB | 0 ms | C++ | 199 bytes | 2023-03-24 18:53:14 |
76344 | jzlb_chengyixuan | 程意轩 | D | Runtime Error | 2020 KiB | 0 ms | C++ | 191 bytes | 2023-03-24 18:51:47 |
76305 | jzlb_gcx | 顾辰曦 | G | Wrong Answer | 2024 KiB | 0 ms | C++ | 331 bytes | 2023-03-23 20:44:09 |
76296 | jzlb_gcx | 顾辰曦 | G | Wrong Answer | 2024 KiB | 0 ms | C++ | 333 bytes | 2023-03-23 20:22:50 |
76291 | jzlb_gcx | 顾辰曦 | G | Wrong Answer | 2024 KiB | 0 ms | C++ | 337 bytes | 2023-03-23 19:56:25 |
76289 | jzlb_gcx | 顾辰曦 | G | Runtime Error | 2028 KiB | 0 ms | C++ | 519 bytes | 2023-03-23 19:31:55 |
76288 | jzlb_lxb | 罗刹怒海 | D | Wrong Answer | 2256 KiB | 0 ms | C++ | 297 bytes | 2023-03-23 19:31:18 |
76287 | jzlb_gcx | 顾辰曦 | G | Runtime Error | 2028 KiB | 0 ms | C++ | 519 bytes | 2023-03-23 19:29:08 |
76286 | jzlb_gcx | 顾辰曦 | G | Runtime Error | 2028 KiB | 0 ms | C++ | 401 bytes | 2023-03-23 19:24:52 |
76280 | jzlb_gcx | 顾辰曦 | G | Runtime Error | 2028 KiB | 0 ms | C++ | 262 bytes | 2023-03-23 18:27:51 |
76279 | jzlb_gcx | 顾辰曦 | G | Runtime Error | 2028 KiB | 0 ms | C++ | 262 bytes | 2023-03-23 18:25:51 |
76228 | jzlb_txy | Coco is coo! | A | Accepted | 2024 KiB | 0 ms | C++ | 234 bytes | 2023-03-22 22:45:45 |
76227 | jzlb_txy | Coco is coo! | Time Limit Exceed | 5020 KiB | 2004 ms | C++ | 312 bytes | 2023-03-22 22:21:29 | |
76226 | jzlb_txy | Coco is coo! | A | Wrong Answer | 2024 KiB | 0 ms | C++ | 252 bytes | 2023-03-22 22:20:06 |
76224 | jzlb_gcx | 顾辰曦 | C | Accepted | 10496 KiB | 592 ms | C++ | 319 bytes | 2023-03-22 21:45:10 |
76218 | jzlb_gcx | 顾辰曦 | C | Time Limit Exceed | 10496 KiB | 2084 ms | C++ | 487 bytes | 2023-03-22 21:36:09 |
76214 | jzlb_gcx | 顾辰曦 | B | Accepted | 9716 KiB | 8 ms | C++ | 415 bytes | 2023-03-22 21:30:13 |
76213 | jzlb_gcx | 顾辰曦 | B | Runtime Error | 2684 KiB | 0 ms | C++ | 414 bytes | 2023-03-22 21:29:29 |
76212 | jzlb_gcx | 顾辰曦 | B | Wrong Answer | 9796 KiB | 0 ms | C++ | 362 bytes | 2023-03-22 21:22:48 |
76211 | jzlb_gcx | 顾辰曦 | Accepted | 2684 KiB | 0 ms | C++ | 289 bytes | 2023-03-22 21:15:47 | |
76210 | jzlb_gcx | 顾辰曦 | Accepted | 2684 KiB | 0 ms | C++ | 450 bytes | 2023-03-22 21:14:32 | |
76209 | jzlb_gcx | 顾辰曦 | Wrong Answer | 2684 KiB | 0 ms | C++ | 287 bytes | 2023-03-22 21:06:42 | |
76208 | jzlb_gcx | 顾辰曦 | Wrong Answer | 2684 KiB | 0 ms | C++ | 280 bytes | 2023-03-22 21:05:32 | |
76207 | jzlb_xyx | 谢宇轩 | B | Time Limit Exceed | 33192 KiB | 2000 ms | C++ | 317 bytes | 2023-03-22 21:04:45 |
76206 | jzlb_xyx | 谢宇轩 | B | Time Limit Exceed | 33192 KiB | 1992 ms | C++ | 317 bytes | 2023-03-22 20:49:50 |
76205 | jzlb_xyx | 谢宇轩 | B | Time Limit Exceed | 33188 KiB | 1996 ms | C++ | 317 bytes | 2023-03-22 20:47:32 |
76202 | jzlb_xyx | 谢宇轩 | A | Accepted | 2024 KiB | 0 ms | C++ | 248 bytes | 2023-03-22 19:42:40 |
76201 | jzlb_lxb | 罗刹怒海 | D | Runtime Error | 2020 KiB | 0 ms | C++ | 198 bytes | 2023-03-22 19:39:56 |
76200 | jzlb_xyx | 谢宇轩 | Accepted | 2804 KiB | 0 ms | C++ | 431 bytes | 2023-03-22 19:37:07 | |
76199 | jzlb_lxb | 罗刹怒海 | C | Accepted | 5928 KiB | 648 ms | C++ | 551 bytes | 2023-03-22 19:28:58 |
76198 | jzlb_lxb | 罗刹怒海 | C | Time Limit Exceed | 2904 KiB | 1996 ms | C++ | 289 bytes | 2023-03-22 19:26:23 |
76079 | jzlb_gcx | 顾辰曦 | D | Wrong Answer | 2060 KiB | 0 ms | C++ | 319 bytes | 2023-03-21 22:16:54 |
76077 | jzlb_gcx | 顾辰曦 | Wrong Answer | 2684 KiB | 0 ms | C++ | 448 bytes | 2023-03-21 21:48:50 | |
76076 | jzlb_gcx | 顾辰曦 | Wrong Answer | 2684 KiB | 0 ms | C++ | 448 bytes | 2023-03-21 21:45:11 |