結果

問題 No.1389 Clumsy Calculation
ユーザー masashi0217masashi0217
提出日時 2021-03-22 07:29:52
言語 Ruby
(3.3.0)
結果
AC  
実行時間 156 ms / 2,000 ms
コード長 135 bytes
コンパイル時間 391 ms
コンパイル使用メモリ 11,472 KB
実行使用メモリ 30,812 KB
最終ジャッジ日時 2023-08-15 10:01:03
合計ジャッジ時間 6,766 ms
ジャッジサーバーID
(参考情報)
judge14 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 67 ms
15,100 KB
testcase_01 AC 70 ms
15,256 KB
testcase_02 AC 73 ms
15,088 KB
testcase_03 AC 75 ms
15,168 KB
testcase_04 AC 75 ms
15,248 KB
testcase_05 AC 73 ms
15,044 KB
testcase_06 AC 72 ms
15,128 KB
testcase_07 AC 73 ms
15,272 KB
testcase_08 AC 70 ms
14,992 KB
testcase_09 AC 151 ms
30,812 KB
testcase_10 AC 138 ms
27,468 KB
testcase_11 AC 87 ms
15,156 KB
testcase_12 AC 72 ms
15,100 KB
testcase_13 AC 72 ms
15,144 KB
testcase_14 AC 148 ms
29,520 KB
testcase_15 AC 146 ms
29,616 KB
testcase_16 AC 147 ms
29,804 KB
testcase_17 AC 149 ms
30,088 KB
testcase_18 AC 148 ms
29,912 KB
testcase_19 AC 153 ms
29,952 KB
testcase_20 AC 155 ms
30,180 KB
testcase_21 AC 155 ms
29,920 KB
testcase_22 AC 155 ms
30,088 KB
testcase_23 AC 153 ms
30,140 KB
testcase_24 AC 156 ms
29,932 KB
testcase_25 AC 151 ms
30,008 KB
testcase_26 AC 145 ms
29,476 KB
testcase_27 AC 143 ms
29,704 KB
testcase_28 AC 148 ms
30,016 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
Main.rb:1: warning: assigned but unused variable - n
Syntax OK

ソースコード

diff #

n, x = gets.chomp.split(" ").map(&:to_i)
s = gets.chomp.split(" ").map(&:to_i)
ans = 0
s.each do |i|
    ans += (x-i)
end
puts x - ans
0