結果

問題 No.2551 2, 3, 5, 7 Game
ユーザー rlangevinrlangevin
提出日時 2023-12-15 12:35:57
言語 PyPy3
(7.3.15)
結果
TLE  
実行時間 -
コード長 550 bytes
コンパイル時間 198 ms
コンパイル使用メモリ 81,700 KB
実行使用メモリ 266,804 KB
最終ジャッジ日時 2023-12-15 12:36:11
合計ジャッジ時間 13,226 ms
ジャッジサーバーID
(参考情報)
judge12 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 1,434 ms
173,756 KB
testcase_01 AC 1,595 ms
178,468 KB
testcase_02 AC 1,388 ms
166,028 KB
testcase_03 AC 1,322 ms
165,512 KB
testcase_04 AC 1,455 ms
169,056 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
import pypyjit
pypyjit.set_param('max_unroll_recursion=-1')

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