結果
問題 |
No.101 ぐるぐる!あみだくじ!
|
ユーザー |
![]() |
提出日時 | 2017-07-25 16:18:07 |
言語 | Python3 (3.13.1 + numpy 2.2.1 + scipy 1.14.1) |
結果 |
TLE
|
実行時間 | - |
コード長 | 351 bytes |
コンパイル時間 | 96 ms |
コンパイル使用メモリ | 12,544 KB |
実行使用メモリ | 51,280 KB |
最終ジャッジ日時 | 2024-10-09 17:08:13 |
合計ジャッジ時間 | 13,037 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | -- * 3 |
other | AC * 11 TLE * 1 -- * 25 |
ソースコード
# 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,1000000000): p=p@ar if np.allclose(p,I)==True: print(i) break;