結果

問題 No.524 コインゲーム
ユーザー tcltktcltk
提出日時 2021-06-06 05:24:36
言語 PyPy3
(7.3.15)
結果
MLE  
実行時間 -
コード長 590 bytes
コンパイル時間 426 ms
コンパイル使用メモリ 82,432 KB
実行使用メモリ 86,912 KB
最終ジャッジ日時 2024-05-02 00:05:11
合計ジャッジ時間 5,511 ms
ジャッジサーバーID
(参考情報)
judge2 / judge5
このコードへのチャレンジ
(要ログイン)

テストケース

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

ソースコード

diff #

#!/usr/bin/env python3
# from typing import *

import sys
import io
import math
import collections
import decimal
import itertools
import bisect
import heapq


def input():
    return sys.stdin.readline()[:-1]


# sys.setrecursionlimit(1000000)

# _INPUT = """33554432
# """
# sys.stdin = io.StringIO(_INPUT)

def f(N):
    if N == 0:
        return 0

    N1 = N
    d = 0
    while N1 > 1:
        N1 >>= 1
        d += 1
    if N % 2 == 0:
        return (1<<d) + f(N-(1<<d))
    else:
        return f(N-(1<<d))

N = int(input())
g = f(N)
if g == 0:
    print('X')
else:
    print('O')
0