結果

問題 No.1613 Rush and Remove
ユーザー vwxyzvwxyz
提出日時 2023-12-15 23:13:08
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 48 ms / 2,000 ms
コード長 703 bytes
コンパイル時間 267 ms
コンパイル使用メモリ 11,904 KB
実行使用メモリ 10,112 KB
最終ジャッジ日時 2023-12-15 23:13:11
合計ジャッジ時間 2,933 ms
ジャッジサーバーID
(参考情報)
judge14 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 29 ms
10,112 KB
testcase_01 AC 27 ms
10,112 KB
testcase_02 AC 28 ms
10,112 KB
testcase_03 AC 28 ms
10,112 KB
testcase_04 AC 28 ms
10,112 KB
testcase_05 AC 28 ms
10,112 KB
testcase_06 AC 28 ms
10,112 KB
testcase_07 AC 27 ms
10,112 KB
testcase_08 AC 27 ms
10,112 KB
testcase_09 AC 44 ms
10,112 KB
testcase_10 AC 48 ms
10,112 KB
testcase_11 AC 43 ms
10,112 KB
testcase_12 AC 45 ms
10,112 KB
testcase_13 AC 45 ms
10,112 KB
testcase_14 AC 45 ms
10,112 KB
testcase_15 AC 45 ms
10,112 KB
testcase_16 AC 45 ms
10,112 KB
testcase_17 AC 46 ms
10,112 KB
testcase_18 AC 29 ms
10,112 KB
testcase_19 AC 30 ms
10,112 KB
testcase_20 AC 29 ms
10,112 KB
testcase_21 AC 28 ms
10,112 KB
testcase_22 AC 27 ms
10,112 KB
testcase_23 AC 27 ms
10,112 KB
testcase_24 AC 34 ms
10,112 KB
testcase_25 AC 30 ms
10,112 KB
testcase_26 AC 32 ms
10,112 KB
testcase_27 AC 29 ms
10,112 KB
testcase_28 AC 30 ms
10,112 KB
testcase_29 AC 30 ms
10,112 KB
testcase_30 AC 29 ms
10,112 KB
testcase_31 AC 30 ms
10,112 KB
testcase_32 AC 30 ms
10,112 KB
testcase_33 AC 29 ms
10,112 KB
testcase_34 AC 28 ms
10,112 KB
testcase_35 AC 27 ms
10,112 KB
testcase_36 AC 27 ms
10,112 KB
testcase_37 AC 27 ms
10,112 KB
testcase_38 AC 27 ms
10,112 KB
testcase_39 AC 27 ms
10,112 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys
readline=sys.stdin.readline
from functools import lru_cache

@lru_cache(maxsize=None)
def grundy(bit):
    if bit==0:
        return 0
    se=set()
    for i in range(bit.bit_length()):
        if bit&1<<i:
            for ii in range(i+1):
                if all(not bit&1<<j for j in range(ii,i)):
                    se.add(grundy((bit^1<<i)+sum(1<<j for j in range(ii,i))))
    g=0
    while g in se:
        g+=1
    return g

H,W=map(int,readline().split())
gr=[0]*W
for h in range(H):
    for w,b in enumerate(readline().rstrip()):
       if b=="o":
           gr[w]+=h%2+1
           gr[w]%=3
g=0
for w in range(W):
    g^=gr[w]
if g:
    ans="First"
else:
    ans="Second"
print(ans)
0