結果

問題 No.2285 Make A Unit Square
コンテスト
ユーザー detteiuu
提出日時 2026-08-03 23:16:36
言語 PyPy3
(7.3.17)
コンパイル:
pypy3 -mpy_compile _filename_
実行:
pypy3 _filename_
結果
AC  
実行時間 118 ms / 2,000 ms
+ 667µs
コード長 642 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 226 ms
コンパイル使用メモリ 96,496 KB
実行使用メモリ 84,864 KB
最終ジャッジ日時 2026-08-03 23:17:03
合計ジャッジ時間 1,835 ms
ジャッジサーバーID
(参考情報)
judge2_1 / judge3_0
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 1
other AC * 4
権限があれば一括ダウンロードができます

ソースコード

diff #
raw source code

from sys import stdin
input = stdin.readline

grundy = [0, 1, 1, 2, 0, 3, 1, 1, 0, 3, 3, 2, 2, 4, 0, 5, 2, 2, 3, 3, 0, 1, 1, 3, 0, 2, 1, 1, 0, 4, 5, 2, 7, 4,
          0, 1, 1, 2, 0, 3, 1, 1, 0, 3, 3, 2, 2, 4, 4, 5, 5, 2, 3, 3, 0, 1, 1, 3, 0, 2, 1, 1, 0, 4, 5, 3, 7, 4]
grundy2 = [8, 1, 1, 2, 0, 3, 1, 1, 0, 3, 3, 2, 2, 4, 4, 5, 5, 9, 3, 3, 0, 1, 1, 3, 0, 2, 1, 1, 0, 4, 5, 3, 7, 4]

# 2 <= n
def func(n):
    if n == 2: return 0
    if 3 <= n < 3+len(grundy):
        return grundy[n-3]
    return grundy2[(n-3)%34]

for _ in range(int(input())):
    A, B = map(int, input().split())

    print("First" if func(A)^func(B) != 0 else "Second")
0