結果
問題 |
No.2428 Returning Shuffle
|
ユーザー |
![]() |
提出日時 | 2023-08-18 23:39:18 |
言語 | Python3 (3.13.1 + numpy 2.2.1 + scipy 1.14.1) |
結果 |
TLE
|
実行時間 | - |
コード長 | 611 bytes |
コンパイル時間 | 302 ms |
コンパイル使用メモリ | 12,416 KB |
実行使用メモリ | 164,200 KB |
最終ジャッジ日時 | 2024-11-28 11:14:27 |
合計ジャッジ時間 | 83,373 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | TLE * 3 |
other | TLE * 23 |
ソースコード
import sys input = lambda :sys.stdin.readline()[:-1] def main(): N, M = map(int, input().split()) P = list(range(1, N + 1)) T, S = [], [] for _ in range(M): l = list(map(int, input().split())) T.append(l[0]) S.append(l[1:]) print(T,S) count = 0 while True: for i in range(M): for j in range(T[i]): if j == 0: P[P.index(S[i][j])] = S[i][-1] else: P[P.index(S[i][j])] = S[i][j-1] if __name__ == '__main__': main()