結果

問題 No.1425 Yet Another Cyclic Shifts Sorting
ユーザー simansiman
提出日時 2021-03-18 05:40:07
言語 Ruby
(3.3.0)
結果
WA  
実行時間 -
コード長 140 bytes
コンパイル時間 105 ms
コンパイル使用メモリ 7,296 KB
実行使用メモリ 26,112 KB
最終ジャッジ日時 2024-04-27 18:45:04
合計ジャッジ時間 8,240 ms
ジャッジサーバーID
(参考情報)
judge5 / judge1
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 WA -
testcase_01 AC 97 ms
12,160 KB
testcase_02 WA -
testcase_03 AC 91 ms
12,288 KB
testcase_04 AC 90 ms
12,032 KB
testcase_05 AC 90 ms
12,160 KB
testcase_06 AC 90 ms
12,160 KB
testcase_07 AC 90 ms
12,288 KB
testcase_08 AC 90 ms
12,288 KB
testcase_09 WA -
testcase_10 AC 90 ms
12,288 KB
testcase_11 AC 91 ms
12,288 KB
testcase_12 AC 90 ms
12,032 KB
testcase_13 AC 90 ms
12,160 KB
testcase_14 AC 89 ms
12,032 KB
testcase_15 AC 90 ms
12,160 KB
testcase_16 AC 89 ms
12,288 KB
testcase_17 AC 91 ms
12,288 KB
testcase_18 WA -
testcase_19 AC 91 ms
12,032 KB
testcase_20 WA -
testcase_21 WA -
testcase_22 WA -
testcase_23 WA -
testcase_24 WA -
testcase_25 WA -
testcase_26 WA -
testcase_27 WA -
testcase_28 WA -
testcase_29 WA -
testcase_30 WA -
testcase_31 WA -
testcase_32 WA -
testcase_33 WA -
testcase_34 WA -
testcase_35 WA -
testcase_36 AC 165 ms
21,504 KB
testcase_37 AC 113 ms
13,696 KB
testcase_38 AC 195 ms
25,728 KB
testcase_39 AC 97 ms
12,288 KB
testcase_40 AC 176 ms
23,296 KB
testcase_41 AC 127 ms
16,512 KB
testcase_42 AC 127 ms
17,280 KB
testcase_43 AC 91 ms
12,288 KB
testcase_44 AC 102 ms
13,312 KB
testcase_45 AC 188 ms
26,112 KB
testcase_46 AC 195 ms
25,984 KB
testcase_47 AC 188 ms
25,984 KB
testcase_48 AC 194 ms
26,112 KB
testcase_49 AC 189 ms
25,856 KB
testcase_50 AC 86 ms
12,288 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
Syntax OK

ソースコード

diff #

N = gets.to_i
A = gets.split.map(&:to_i)
cnt = 0

N.times do |i|
  a = A[i]
  b = A[(i + 1) % N]
  cnt += 1 if a > b
end

puts [2, cnt].min
0