結果
問題 |
No.954 Result
|
ユーザー |
👑 |
提出日時 | 2020-01-26 00:04:22 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 2 ms / 2,000 ms |
コード長 | 595 bytes |
コンパイル時間 | 641 ms |
コンパイル使用メモリ | 71,568 KB |
実行使用メモリ | 5,376 KB |
最終ジャッジ日時 | 2024-07-04 12:41:08 |
合計ジャッジ時間 | 1,534 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 7 |
other | AC * 29 |
ソースコード
#include <iostream> #include <vector> #include <algorithm> using namespace std; int main(){ vector<long long> a(5); for(int i = 0; 5 > i; i++){ cin>>a[i]; } reverse(a.begin(),a.end()); long long A = 1; long long B = 1; while(a[0] > A){ A = A+B; swap(A,B); } int ans = 0; if(a[0] == 1 && a[1] == 1){ ans = 2; A = 2; B = 3; }else if(a[0] == 1){ A = 1; B = 2; } while(ans != 5 && a[ans] == A){ ans++; A = A+B; swap(A,B); } cout << ans << endl; }