結果

問題 No.241 出席番号(1)
ユーザー kazasikikazasiki
提出日時 2015-07-10 23:32:24
言語 Ruby
(3.3.0)
結果
WA  
実行時間 -
コード長 296 bytes
コンパイル時間 361 ms
コンパイル使用メモリ 11,320 KB
実行使用メモリ 15,368 KB
最終ジャッジ日時 2023-09-22 10:21:49
合計ジャッジ時間 6,845 ms
ジャッジサーバーID
(参考情報)
judge15 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 93 ms
15,308 KB
testcase_01 AC 94 ms
15,156 KB
testcase_02 AC 94 ms
15,256 KB
testcase_03 AC 94 ms
15,172 KB
testcase_04 AC 93 ms
15,172 KB
testcase_05 WA -
testcase_06 AC 93 ms
15,068 KB
testcase_07 WA -
testcase_08 WA -
testcase_09 AC 87 ms
15,336 KB
testcase_10 WA -
testcase_11 AC 92 ms
15,096 KB
testcase_12 AC 87 ms
15,296 KB
testcase_13 AC 91 ms
15,320 KB
testcase_14 AC 88 ms
15,148 KB
testcase_15 AC 87 ms
15,084 KB
testcase_16 AC 88 ms
15,116 KB
testcase_17 WA -
testcase_18 AC 92 ms
15,160 KB
testcase_19 AC 94 ms
15,160 KB
testcase_20 AC 93 ms
15,080 KB
testcase_21 AC 88 ms
15,024 KB
testcase_22 WA -
testcase_23 WA -
testcase_24 AC 88 ms
15,056 KB
testcase_25 WA -
testcase_26 WA -
testcase_27 AC 88 ms
15,312 KB
testcase_28 AC 92 ms
15,116 KB
testcase_29 AC 97 ms
15,140 KB
testcase_30 WA -
testcase_31 WA -
権限があれば一括ダウンロードができます
コンパイルメッセージ
Main.rb:9: warning: ambiguous first argument; put parentheses or a space even after `-' operator
Syntax OK

ソースコード

diff #

# input
N = gets.to_i
A = N.times.map{
      gets.to_i
    }

# solve
if A.uniq.size == 1
  print -1
else
  kouho = (0..N).to_a
  result =
    A.map{|num|
      tmp = kouho.first == num ? kouho[1] : kouho[0]
      kouho.delete(tmp)
      tmp
    }
  result.each{|num|
    print "#{num}\n"
  }
end
0