結果

問題 No.524 コインゲーム
ユーザー RisenRisen
提出日時 2017-06-03 00:53:44
言語 C#(csc)
(csc 3.9.0)
結果
WA  
実行時間 -
コード長 495 bytes
コンパイル時間 2,574 ms
コンパイル使用メモリ 108,720 KB
実行使用メモリ 23,872 KB
最終ジャッジ日時 2023-10-22 02:14:07
合計ジャッジ時間 4,673 ms
ジャッジサーバーID
(参考情報)
judge15 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 WA -
testcase_01 AC 24 ms
23,872 KB
testcase_02 AC 23 ms
23,872 KB
testcase_03 WA -
testcase_04 AC 23 ms
23,872 KB
testcase_05 AC 23 ms
23,872 KB
testcase_06 AC 23 ms
23,872 KB
testcase_07 AC 23 ms
23,872 KB
testcase_08 WA -
testcase_09 WA -
testcase_10 WA -
testcase_11 AC 23 ms
23,872 KB
testcase_12 AC 23 ms
23,872 KB
testcase_13 AC 23 ms
23,872 KB
testcase_14 AC 24 ms
23,872 KB
testcase_15 AC 23 ms
23,872 KB
testcase_16 WA -
testcase_17 WA -
testcase_18 AC 23 ms
23,872 KB
testcase_19 AC 23 ms
23,872 KB
testcase_20 WA -
testcase_21 AC 23 ms
23,872 KB
testcase_22 AC 23 ms
23,872 KB
testcase_23 WA -
testcase_24 AC 23 ms
23,872 KB
testcase_25 AC 23 ms
23,872 KB
testcase_26 AC 23 ms
23,872 KB
testcase_27 WA -
testcase_28 AC 23 ms
23,872 KB
testcase_29 AC 23 ms
23,872 KB
testcase_30 AC 23 ms
23,872 KB
testcase_31 AC 24 ms
23,872 KB
testcase_32 AC 23 ms
23,872 KB
testcase_33 AC 23 ms
23,872 KB
testcase_34 AC 23 ms
23,872 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
Microsoft (R) Visual C# Compiler version 3.9.0-6.21124.20 (db94f4cc)
Copyright (C) Microsoft Corporation. All rights reserved.

ソースコード

diff #

using System;

public class Solution
{
    public static void Main()
    {
        var n = long.Parse(Console.ReadLine());

        // ニム和が0であればよい n+1が最上位ビットのみが立っているかチェック
        n++;
        while(n > 0)
        {
            if((n & 0x1) == 0)
            {
                n >>= 1;
            }
            else
            {
                break;
            }
        }

        Console.WriteLine((n  == 1) ? "X" : "O");
    }
}
0