結果
問題 |
No.74 貯金箱の退屈
|
ユーザー |
![]() |
提出日時 | 2014-11-21 00:09:40 |
言語 | Python3 (3.13.1 + numpy 2.2.1 + scipy 1.14.1) |
結果 |
TLE
|
実行時間 | - |
コード長 | 491 bytes |
コンパイル時間 | 240 ms |
コンパイル使用メモリ | 12,032 KB |
実行使用メモリ | 23,880 KB |
最終ジャッジ日時 | 2025-01-02 19:37:26 |
合計ジャッジ時間 | 175,877 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 1 TLE * 29 |
ソースコード
import itertools N = int(input()) D = list(map(int, input().split(' '))) W_ = list(map(int, input().split(' '))) W = W_ turned = [0]*N def turn(n): if W[n] == 1: W[n] = 0 else: W[n] = 1 def select(n): turn((n+D[n])%N) turn((n-D[n])%N) if ((n+D[n])%N) == ((n-D[n])%N): turn((n+D[n])%N) T = [0,1] for x in itertools.product(T,repeat=N): W = W_ for i in range(0,N): if x[i] == 1: select(i) if 0 not in W: print("Yes") exit() print("No")