結果
問題 |
No.1425 Yet Another Cyclic Shifts Sorting
|
ユーザー |
|
提出日時 | 2021-03-13 09:41:54 |
言語 | PyPy3 (7.3.15) |
結果 |
AC
|
実行時間 | 148 ms / 2,000 ms |
コード長 | 408 bytes |
コンパイル時間 | 163 ms |
コンパイル使用メモリ | 82,304 KB |
実行使用メモリ | 109,320 KB |
最終ジャッジ日時 | 2024-10-15 02:58:47 |
合計ジャッジ時間 | 7,022 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 48 |
ソースコード
n = int(input()) A = list(map(int,input().split())) sA = sorted(A) mi = sA[0] cand = [] for i,a in enumerate(A): if a == mi: cand.append(i) for i in range(n)[::-1]: if A[i] != sA[i]: base = sA[:i+1] A = A[:i+1] for j in cand: c = A[j:]+A[:j] if c == base: print(1) exit() print(2) exit() print(0)