結果
問題 | No.786 京都大学の過去問 |
ユーザー |
|
提出日時 | 2019-02-08 21:49:40 |
言語 | C++14 (gcc 11.2.0 + boost 1.78.0) |
結果 |
AC
|
実行時間 | 2 ms / 2,000 ms |
コード長 | 716 bytes |
コンパイル時間 | 1,768 ms |
使用メモリ | 3,528 KB |
最終ジャッジ日時 | 2023-01-28 15:16:10 |
合計ジャッジ時間 | 1,633 ms |
ジャッジサーバーID (参考情報) |
judge13 / judge11 |
テストケース
テストケース表示入力 | 結果 | 実行時間 使用メモリ |
---|---|---|
testcase_00 | AC | 2 ms
3,524 KB |
testcase_01 | AC | 2 ms
3,372 KB |
testcase_02 | AC | 2 ms
3,368 KB |
testcase_03 | AC | 2 ms
3,528 KB |
testcase_04 | AC | 1 ms
3,452 KB |
ソースコード
#define _USE_MATH_DEFINES #include <cstdio> #include <iostream> #include <sstream> #include <fstream> #include <iomanip> #include <algorithm> #include <cmath> #include <complex> #include <string> #include <vector> #include <array> #include <list> #include <queue> #include <stack> #include <set> #include <map> #include <bitset> #include <numeric> #include <limits> #include <climits> #include <cfloat> #include <functional> #include <iterator> #include <memory> #include <regex> using namespace std; int main() { int n; cin >> n; long long a = 1; long long b = 1; for(int i=0; i<n; ++i){ long long c = a + b; a = b; b = c; } cout << a << endl; return 0; }