結果
| 問題 | No.1425 Yet Another Cyclic Shifts Sorting |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2021-03-13 09:41:54 |
| 言語 | PyPy3 (7.3.17) |
| 結果 |
AC
|
| 実行時間 | 92 ms / 2,000 ms |
| コード長 | 408 bytes |
| 記録 | |
| コンパイル時間 | 219 ms |
| コンパイル使用メモリ | 85,248 KB |
| 実行使用メモリ | 119,424 KB |
| 最終ジャッジ日時 | 2026-05-02 19:10:01 |
| 合計ジャッジ時間 | 5,937 ms |
|
ジャッジサーバーID (参考情報) |
judge3_0 / judge2_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| 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)