結果
問題 | No.2619 Sorted Nim |
ユーザー |
![]() |
提出日時 | 2022-02-05 19:34:25 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 72 ms / 2,000 ms |
コード長 | 367 bytes |
コンパイル時間 | 465 ms |
コンパイル使用メモリ | 69,504 KB |
実行使用メモリ | 5,376 KB |
最終ジャッジ日時 | 2024-06-28 22:28:41 |
合計ジャッジ時間 | 7,241 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 62 |
ソースコード
#include <iostream> #include <vector> using namespace std; int main() { int n; cin >> n; vector<int> a(n), b(n); for (int i = 0; i < n; i++) cin >> a[i]; b[0] = a[0]; for (int i = 1; i < n; i++) b[i] = a[i] - a[i - 1]; int B = 0; for (int i = n - 1; i >= 0; i -= 2) B ^= b[i]; if (B == 0) cout << "Second" << endl; else cout << "First" << endl; return 0; }