結果

問題 No.2551 2, 3, 5, 7 Game
ユーザー hato336hato336
提出日時 2023-11-25 13:59:35
言語 PyPy3
(7.3.15)
結果
TLE  
実行時間 -
コード長 1,113 bytes
コンパイル時間 252 ms
コンパイル使用メモリ 81,700 KB
実行使用メモリ 114,528 KB
最終ジャッジ日時 2023-11-25 13:59:42
合計ジャッジ時間 7,603 ms
ジャッジサーバーID
(参考情報)
judge11 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 TLE -
testcase_01 -- -
testcase_02 -- -
testcase_03 -- -
testcase_04 -- -
testcase_05 -- -
testcase_06 -- -
testcase_07 -- -
testcase_08 -- -
testcase_09 -- -
権限があれば一括ダウンロードができます

ソースコード

diff #

import collections,sys,math,functools,operator,itertools,bisect,heapq,decimal,string,time,random
sys.setrecursionlimit(10**9)
#sys.set_int_max_str_digits(0)
t = int(input())
#alist = list(map(int,input().split()))
#alist = []
#s = input()
#n,m = map(int,input().split())
#for i in range(n):
#    alist.append(list(map(int,input().split())))
input = sys.stdin.readline

def calc(x,n,turn):
    if x >= n:
        return turn
    else:
        a = []
        for i in range(2):
            if i == 0:
                a.append(calc(x*2,n,turn^1))
            if i == 1:
                a.append(calc(x*7,n,turn^1))
        if a[0] == turn or a[1] == turn:
            return turn
        else:
            return turn^1
for i in range(t):
    n = int(input())
    print('sepa' if calc(1,n,0) == 0 else 'ryota')
    continue
    n = i+1
    
    c = 0
    a = ""
    b = ""
    for j in range(20):
        if 14**j < n <= 2*14**j:
            a = 'ryota'
            c = 1
            break
    if c == 0:
        a = 'sepa'
    b = 'sepa' if calc(1,n,0) == 0 else 'ryota'
    if a != b:
        print(n,a==b,end='')
0