結果

問題 No.1687 What the Heck?
ユーザー simansiman
提出日時 2021-09-26 03:25:38
言語 Ruby
(3.3.0)
結果
WA  
実行時間 -
コード長 128 bytes
コンパイル時間 1,101 ms
コンパイル使用メモリ 11,180 KB
実行使用メモリ 28,008 KB
最終ジャッジ日時 2023-09-19 02:48:40
合計ジャッジ時間 3,734 ms
ジャッジサーバーID
(参考情報)
judge15 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 83 ms
15,240 KB
testcase_01 AC 82 ms
15,280 KB
testcase_02 AC 88 ms
15,140 KB
testcase_03 AC 83 ms
15,128 KB
testcase_04 AC 83 ms
15,296 KB
testcase_05 WA -
testcase_06 WA -
testcase_07 WA -
testcase_08 WA -
testcase_09 AC 109 ms
19,684 KB
testcase_10 AC 102 ms
18,028 KB
testcase_11 AC 104 ms
18,392 KB
testcase_12 AC 159 ms
27,704 KB
testcase_13 AC 160 ms
27,776 KB
testcase_14 WA -
testcase_15 WA -
testcase_16 WA -
testcase_17 WA -
testcase_18 WA -
testcase_19 WA -
権限があれば一括ダウンロードができます
コンパイルメッセージ
Syntax OK

ソースコード

diff #

N = gets.to_i
P = gets.split.map(&:to_i)
idx = P.index(N) + 1

if N == 1
  puts 0
else
  puts [0, (1..N).sum - 2 * idx].max
end
0