結果

問題 No.2619 Sorted Nim
ユーザー startcpp
提出日時 2022-10-02 10:29:20
言語 C++14
(gcc 13.3.0 + boost 1.87.0)
結果
AC  
実行時間 80 ms / 2,000 ms
コード長 359 bytes
コンパイル時間 526 ms
コンパイル使用メモリ 64,128 KB
実行使用メモリ 5,248 KB
最終ジャッジ日時 2024-12-24 20:51:14
合計ジャッジ時間 6,757 ms
ジャッジサーバーID
(参考情報)
judge4 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 62
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <iostream>
using namespace std;

int n;
int a[200000];
int b[200000];

int main() {
	cin >> 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 x = 0;
	for (int i = n - 1; i >= 0; i -= 2) x ^= b[i];
	if (x == 0) cout << "Second" << endl;
	else cout << "First" << endl;
	return 0;
}
0