結果

問題 No.715 集合と二人ゲーム
ユーザー square1001square1001
提出日時 2018-07-14 06:10:31
言語 C++14
(gcc 13.2.0 + boost 1.83.0)
結果
WA  
実行時間 -
コード長 518 bytes
コンパイル時間 671 ms
コンパイル使用メモリ 69,748 KB
実行使用メモリ 7,552 KB
最終ジャッジ日時 2024-04-17 11:52:59
合計ジャッジ時間 3,758 ms
ジャッジサーバーID
(参考情報)
judge3 / judge1
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 WA -
testcase_01 WA -
testcase_02 WA -
testcase_03 AC 3 ms
5,376 KB
testcase_04 AC 3 ms
5,376 KB
testcase_05 AC 4 ms
5,376 KB
testcase_06 WA -
testcase_07 AC 5 ms
5,376 KB
testcase_08 AC 5 ms
5,376 KB
testcase_09 WA -
testcase_10 WA -
testcase_11 AC 6 ms
5,376 KB
testcase_12 AC 6 ms
5,376 KB
testcase_13 WA -
testcase_14 WA -
testcase_15 AC 7 ms
5,376 KB
testcase_16 AC 8 ms
5,376 KB
testcase_17 AC 8 ms
5,376 KB
testcase_18 WA -
testcase_19 AC 9 ms
5,376 KB
testcase_20 AC 10 ms
5,376 KB
testcase_21 WA -
testcase_22 AC 11 ms
5,376 KB
testcase_23 WA -
testcase_24 WA -
testcase_25 AC 11 ms
5,376 KB
testcase_26 WA -
testcase_27 AC 13 ms
5,376 KB
testcase_28 WA -
testcase_29 AC 14 ms
5,376 KB
testcase_30 WA -
testcase_31 AC 10 ms
5,376 KB
testcase_32 AC 10 ms
5,376 KB
testcase_33 WA -
testcase_34 WA -
testcase_35 AC 2 ms
5,376 KB
testcase_36 AC 2 ms
5,376 KB
testcase_37 AC 2 ms
5,376 KB
testcase_38 AC 2 ms
5,376 KB
testcase_39 AC 2 ms
5,376 KB
testcase_40 WA -
testcase_41 AC 2 ms
5,376 KB
testcase_42 WA -
testcase_43 AC 2 ms
5,376 KB
testcase_44 WA -
testcase_45 AC 2 ms
5,376 KB
testcase_46 AC 2 ms
5,376 KB
testcase_47 AC 2 ms
5,376 KB
testcase_48 WA -
testcase_49 AC 2 ms
5,376 KB
testcase_50 AC 68 ms
7,296 KB
testcase_51 AC 68 ms
7,424 KB
testcase_52 WA -
testcase_53 AC 65 ms
7,424 KB
testcase_54 WA -
testcase_55 AC 67 ms
7,424 KB
testcase_56 AC 64 ms
7,040 KB
testcase_57 WA -
testcase_58 AC 67 ms
7,552 KB
testcase_59 AC 67 ms
7,424 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <iostream>
#include <algorithm>
using namespace std;
int n, a[500009], g[500009];
int main() {
	cin.tie(0);
	ios_base::sync_with_stdio(false);
	cin >> n;
	for (int i = 1; i <= n; ++i) {
		cin >> a[i - 1];
		g[i] = (i <= 2 ? 1 : (g[i - 2] + g[i - 3] == 1 ? 2 : (g[i - 2] * g[i - 3] == 0 ? 1 : 0)));
	}
	sort(a, a + n);
	int l = 0, s = 0;
	for (int i = 1; i <= n; ++i) {
		if (i == n || a[i] - a[i - 1] >= 2) {
			s ^= g[a[i - 1] - a[l] + 1];
			l = i;
		}
	}
	cout << (s ? "First\n" : "Second\n");
	return 0;
}
0