結果

問題 No.100 直列あみだくじ
ユーザー gigurururugigurururu
提出日時 2014-12-12 00:52:58
言語 Ruby
(3.3.0)
結果
WA  
実行時間 -
コード長 178 bytes
コンパイル時間 56 ms
コンパイル使用メモリ 11,560 KB
実行使用メモリ 15,372 KB
最終ジャッジ日時 2023-09-02 14:16:11
合計ジャッジ時間 5,734 ms
ジャッジサーバーID
(参考情報)
judge13 / judge12
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 88 ms
15,016 KB
testcase_01 AC 85 ms
15,248 KB
testcase_02 AC 83 ms
15,020 KB
testcase_03 AC 83 ms
15,084 KB
testcase_04 WA -
testcase_05 AC 80 ms
15,244 KB
testcase_06 AC 79 ms
15,264 KB
testcase_07 AC 81 ms
15,304 KB
testcase_08 AC 80 ms
15,004 KB
testcase_09 AC 80 ms
15,244 KB
testcase_10 AC 79 ms
15,132 KB
testcase_11 AC 79 ms
15,076 KB
testcase_12 AC 81 ms
15,180 KB
testcase_13 AC 81 ms
15,296 KB
testcase_14 AC 80 ms
15,132 KB
testcase_15 AC 80 ms
15,048 KB
testcase_16 AC 80 ms
15,008 KB
testcase_17 AC 81 ms
15,016 KB
testcase_18 AC 79 ms
15,184 KB
testcase_19 AC 80 ms
15,300 KB
testcase_20 AC 80 ms
15,312 KB
testcase_21 AC 80 ms
15,220 KB
testcase_22 WA -
testcase_23 AC 80 ms
15,228 KB
testcase_24 AC 80 ms
15,124 KB
testcase_25 AC 81 ms
15,220 KB
testcase_26 AC 81 ms
15,304 KB
testcase_27 AC 80 ms
15,268 KB
testcase_28 AC 80 ms
15,000 KB
testcase_29 AC 79 ms
15,272 KB
testcase_30 AC 80 ms
15,128 KB
testcase_31 AC 81 ms
15,100 KB
testcase_32 WA -
testcase_33 AC 81 ms
15,104 KB
testcase_34 AC 82 ms
15,220 KB
testcase_35 AC 82 ms
15,008 KB
testcase_36 AC 82 ms
15,300 KB
testcase_37 AC 82 ms
15,248 KB
testcase_38 AC 83 ms
15,008 KB
testcase_39 AC 81 ms
15,280 KB
testcase_40 AC 81 ms
15,080 KB
testcase_41 AC 81 ms
15,264 KB
testcase_42 AC 79 ms
15,280 KB
testcase_43 AC 79 ms
15,080 KB
testcase_44 WA -
testcase_45 AC 82 ms
15,100 KB
testcase_46 AC 84 ms
15,304 KB
testcase_47 AC 84 ms
15,256 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
Syntax OK

ソースコード

diff #

N=gets.to_i
A=[0]+gets.split.map(&:to_i)
puts (1..N).map{|i|
  t=[i]
  j=A[i]
  until j==i
    t<< j
    j=A[j]
  end
  t.sort
}.uniq.count{|a|a.size%2<1}%2<1?:Yes:"No"
0