結果
| 問題 | No.366 ロボットソート |
| コンテスト | |
| ユーザー |
37kt_
|
| 提出日時 | 2016-05-10 09:11:14 |
| 言語 | Python3 (3.15.0 + numpy 2.5.4 + scipy 1.18.1 + ACL) |
| 結果 |
AC
不安定
|
| 実行時間 | 253 ms / 2,000 ms |
| + 213µs | |
| コード長 | 238 bytes |
| 記録 | |
| コンパイル時間 | 55 ms |
| コンパイル使用メモリ | 15,104 KB |
| 実行使用メモリ | 11,008 KB |
| 最終ジャッジ日時 | 2026-10-09 10:03:42 |
| 合計ジャッジ時間 | 2,843 ms |
|
ジャッジサーバーID (参考情報) |
judge2_0 / judge1_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 23 |
ソースコード
n, k = map(int, input().split())
a = list(map(int, input().split()))
b = sorted(a)
c = 0
for i in range(1000):
for j in range(n - k):
if a[j] > a[j + k]:
a[j], a[j + k] = a[j + k], a[j]
c += 1
print(c if a == b else -1)
37kt_