結果

問題 No.715 集合と二人ゲーム
ユーザー kimiyukikimiyuki
提出日時 2018-07-13 23:14:47
言語 C++17
(gcc 12.3.0 + boost 1.83.0)
結果
WA  
実行時間 -
コード長 861 bytes
コンパイル時間 2,264 ms
コンパイル使用メモリ 200,824 KB
実行使用メモリ 5,376 KB
最終ジャッジ日時 2024-04-17 11:28:46
合計ジャッジ時間 6,615 ms
ジャッジサーバーID
(参考情報)
judge1 / judge3
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 WA -
testcase_01 WA -
testcase_02 WA -
testcase_03 WA -
testcase_04 AC 6 ms
5,376 KB
testcase_05 AC 7 ms
5,376 KB
testcase_06 WA -
testcase_07 WA -
testcase_08 AC 11 ms
5,376 KB
testcase_09 WA -
testcase_10 WA -
testcase_11 AC 14 ms
5,376 KB
testcase_12 AC 14 ms
5,376 KB
testcase_13 WA -
testcase_14 AC 17 ms
5,376 KB
testcase_15 AC 18 ms
5,376 KB
testcase_16 WA -
testcase_17 WA -
testcase_18 AC 21 ms
5,376 KB
testcase_19 AC 21 ms
5,376 KB
testcase_20 AC 24 ms
5,376 KB
testcase_21 WA -
testcase_22 AC 26 ms
5,376 KB
testcase_23 AC 26 ms
5,376 KB
testcase_24 AC 29 ms
5,376 KB
testcase_25 WA -
testcase_26 AC 28 ms
5,376 KB
testcase_27 WA -
testcase_28 WA -
testcase_29 AC 33 ms
5,376 KB
testcase_30 WA -
testcase_31 WA -
testcase_32 AC 24 ms
5,376 KB
testcase_33 WA -
testcase_34 AC 25 ms
5,376 KB
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 1 ms
5,376 KB
testcase_39 WA -
testcase_40 AC 2 ms
5,376 KB
testcase_41 WA -
testcase_42 WA -
testcase_43 AC 2 ms
5,376 KB
testcase_44 WA -
testcase_45 WA -
testcase_46 WA -
testcase_47 WA -
testcase_48 WA -
testcase_49 AC 2 ms
5,376 KB
testcase_50 WA -
testcase_51 AC 185 ms
5,376 KB
testcase_52 AC 181 ms
5,376 KB
testcase_53 WA -
testcase_54 WA -
testcase_55 AC 186 ms
5,376 KB
testcase_56 WA -
testcase_57 AC 164 ms
5,376 KB
testcase_58 WA -
testcase_59 AC 186 ms
5,376 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
#define REP(i, n) for (int i = 0; (i) < int(n); ++ (i))
#define REP3(i, m, n) for (int i = (m); (i) < int(n); ++ (i))
#define REP_R(i, n) for (int i = int(n) - 1; (i) >= 0; -- (i))
#define REP3R(i, m, n) for (int i = int(n) - 1; (i) >= int(m); -- (i))
#define ALL(x) begin(x), end(x)
using namespace std;

int main() {
    // input
    int n; cin >> n;
    vector<int> a(n);
    REP (i, n) cin >> a[i];

    // solve
    sort(ALL(a));
    a.erase(unique(ALL(a)), a.end());
    n = a.size();
    vector<int> b;
    for (int l = 0; l < n; ) {
        int r = l + 1;
        while (r < n and a[r] == a[r - 1] + 1) {
            ++ r;
        }
        b.push_back(r - l);
        l = r;
    }
    int g = 0;
    for (int b_i : b) {
        g ^= (b_i % 2);
    }

    // output
    cout << (g ? "First" : "Second") << endl;
    return 0;
}
0