結果
問題 |
No.101 ぐるぐる!あみだくじ!
|
ユーザー |
![]() |
提出日時 | 2017-07-25 16:12:41 |
言語 | Python3 (3.13.1 + numpy 2.2.1 + scipy 1.14.1) |
結果 |
WA
|
実行時間 | - |
コード長 | 345 bytes |
コンパイル時間 | 115 ms |
コンパイル使用メモリ | 12,800 KB |
実行使用メモリ | 46,764 KB |
最終ジャッジ日時 | 2024-10-09 17:07:22 |
合計ジャッジ時間 | 28,290 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 11 WA * 26 |
ソースコード
# coding: utf-8 import numpy as np n=int(input()) a=[i for i in range(n+1)] for i in range(int(input())): tx,ty=map(int,input().split()) a[tx],a[ty]=a[ty],a[tx] ar=np.zeros((n,n)) for i in range(n): ar[i][a[i+1]-1]=1 I=p=np.identity(n) for i in range(1,1001): p=p@ar if np.allclose(p,I)==True: print(i) break;