結果

問題 No.153 石の山
ユーザー ふーらくたるふーらくたる
提出日時 2018-01-05 15:28:32
言語 C++11
(gcc 11.4.0)
結果
WA  
実行時間 -
コード長 645 bytes
コンパイル時間 761 ms
コンパイル使用メモリ 54,504 KB
実行使用メモリ 4,388 KB
最終ジャッジ日時 2023-08-24 20:18:44
合計ジャッジ時間 1,990 ms
ジャッジサーバーID
(参考情報)
judge11 / judge15
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
4,380 KB
testcase_01 AC 2 ms
4,376 KB
testcase_02 AC 1 ms
4,376 KB
testcase_03 AC 1 ms
4,380 KB
testcase_04 AC 2 ms
4,384 KB
testcase_05 AC 2 ms
4,376 KB
testcase_06 AC 1 ms
4,380 KB
testcase_07 AC 2 ms
4,376 KB
testcase_08 AC 2 ms
4,380 KB
testcase_09 AC 1 ms
4,384 KB
testcase_10 WA -
testcase_11 AC 1 ms
4,376 KB
testcase_12 WA -
testcase_13 WA -
testcase_14 AC 1 ms
4,380 KB
testcase_15 AC 1 ms
4,376 KB
testcase_16 WA -
testcase_17 AC 2 ms
4,376 KB
testcase_18 AC 2 ms
4,376 KB
testcase_19 WA -
testcase_20 AC 2 ms
4,376 KB
testcase_21 WA -
testcase_22 AC 1 ms
4,376 KB
testcase_23 AC 1 ms
4,380 KB
testcase_24 AC 2 ms
4,380 KB
testcase_25 WA -
testcase_26 AC 2 ms
4,376 KB
testcase_27 AC 2 ms
4,376 KB
testcase_28 AC 2 ms
4,380 KB
testcase_29 WA -
testcase_30 AC 1 ms
4,380 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <iostream>
#include <set>
using namespace std;

int g[110];

int main() {
    int N;
    cin >> N;

    g[2] = 1;
    for (int x = 3; x <= N; x++) {
        bool used[110] = {};
        if (x % 2 == 0) used[0] = true;
        else used[g[x / 2] ^ g[x / 2 + 1]] = true;

        if (x % 3 == 0) used[g[x ^ 3]] = true;
        else if (x % 3 == 1) used[g[x / 3 + 1]] = true;
        else used[g[x / 3]] = true;

        for (int n = 0; ; n++) {
            if (!used[n]) {
                g[x] = n;
                break;
            }
        }
    }

    if (g[N]) cout << "A" << endl;
    else cout << "B" << endl;
    
    return 0;
}
0