結果

問題 No.1687 What the Heck?
ユーザー mai
提出日時 2021-09-24 21:43:09
言語 Ruby
(3.4.1)
結果
WA  
実行時間 -
コード長 149 bytes
コンパイル時間 310 ms
コンパイル使用メモリ 7,296 KB
実行使用メモリ 30,080 KB
最終ジャッジ日時 2024-07-05 10:18:50
合計ジャッジ時間 3,785 ms
ジャッジサーバーID
(参考情報)
judge5 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2
other AC * 8 WA * 10
権限があれば一括ダウンロードができます
コンパイルメッセージ
Syntax OK

ソースコード

diff #

def lscan; gets.split.map(&:to_i); end
n = gets.to_i
aa = lscan.reverse
p [0, aa.each_with_index.map{|a,i| a == n ? -(n - i) : n - i}.reduce(:+)].max
0