Submission #00074


ソースコード

1
2
3
4
5
6
7
8
9
10
11
12
13
14
#include <bits/stdc++.h>
using namespace std;
int main(){
long long n , sum = 0;
cin>>n;
long long a[n] = {};
a[0] = 1;
a[1] = 1;
for(int i = 2;i < n;i++){
a[i] = a[i - 1] + a[i - 2];
}
cout<<a[n - 1]<<endl;
return(0);
}

ステータス

項目 データ
問題 0002 - ハローキティーのあずきバー工場
ユーザー名 ei2215
投稿日時 2022-08-20 10:20:29
言語 C++17
状態 Accepted
得点 30
ソースコード長 277 Byte
最大実行時間 31 ms
最大メモリ使用量 604 KB

セット

セット 得点 Cases
1 ALL 30 / 30 *

テストケース

ファイル名 状態 実行時間 メモリ使用量 #
test01.txt AC 23 ms 604 KB
1
test02.txt AC 18 ms 568 KB
1
test03.txt AC 31 ms 540 KB
1
test04.txt AC 23 ms 384 KB
1
test05.txt AC 21 ms 484 KB
1
test06.txt AC 26 ms 452 KB
1
test07.txt AC 20 ms 552 KB
1
test08.txt AC 19 ms 528 KB
1