結果

問題 No.2551 2, 3, 5, 7 Game
ユーザー rlangevinrlangevin
提出日時 2023-12-15 12:34:33
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
TLE  
実行時間 -
コード長 490 bytes
コンパイル時間 186 ms
コンパイル使用メモリ 11,904 KB
実行使用メモリ 14,836 KB
最終ジャッジ日時 2023-12-15 12:34:47
合計ジャッジ時間 12,734 ms
ジャッジサーバーID
(参考情報)
judge14 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 1,199 ms
14,712 KB
testcase_01 AC 1,378 ms
14,748 KB
testcase_02 AC 1,174 ms
14,776 KB
testcase_03 AC 1,139 ms
14,692 KB
testcase_04 AC 1,241 ms
14,836 KB
testcase_05 TLE -
testcase_06 -- -
testcase_07 -- -
testcase_08 -- -
testcase_09 -- -
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys
input = sys.stdin.readline
sys.setrecursionlimit(10**7)
from functools import lru_cache

T = int(input())
for _ in range(T):
    N = int(input())

    @lru_cache(maxsize=None)
    def f(x):
        v = 0
        if 2 * x < N:
            v |= 1 - f(2 * x)
        if 3 * x < N:
            v |= 1 - f(3 * x)
        if 5 * x < N:
            v |= 1 - f(5 * x)
        if 7 * x < N:
            v |= 1 - f(7 * x)
        return v
    
    print("sepa") if f(1) else print("ryota")
0