結果

問題 No.723 2つの数の和
ユーザー simansiman
提出日時 2020-11-10 11:17:56
言語 Ruby
(3.3.0)
結果
AC  
実行時間 130 ms / 2,000 ms
コード長 116 bytes
コンパイル時間 203 ms
コンパイル使用メモリ 11,296 KB
実行使用メモリ 26,576 KB
最終ジャッジ日時 2023-09-29 23:26:00
合計ジャッジ時間 4,006 ms
ジャッジサーバーID
(参考情報)
judge12 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 72 ms
15,232 KB
testcase_01 AC 73 ms
15,148 KB
testcase_02 AC 75 ms
15,052 KB
testcase_03 AC 106 ms
21,624 KB
testcase_04 AC 130 ms
23,660 KB
testcase_05 AC 116 ms
22,652 KB
testcase_06 AC 116 ms
22,936 KB
testcase_07 AC 89 ms
18,944 KB
testcase_08 AC 94 ms
20,236 KB
testcase_09 AC 124 ms
23,816 KB
testcase_10 AC 92 ms
18,488 KB
testcase_11 AC 75 ms
15,616 KB
testcase_12 AC 98 ms
20,568 KB
testcase_13 AC 125 ms
24,644 KB
testcase_14 AC 84 ms
17,744 KB
testcase_15 AC 96 ms
19,952 KB
testcase_16 AC 106 ms
21,052 KB
testcase_17 AC 112 ms
22,364 KB
testcase_18 AC 114 ms
22,172 KB
testcase_19 AC 120 ms
22,540 KB
testcase_20 AC 77 ms
15,152 KB
testcase_21 AC 68 ms
15,152 KB
testcase_22 AC 68 ms
15,128 KB
testcase_23 AC 126 ms
26,576 KB
testcase_24 AC 85 ms
17,756 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
Syntax OK

ソースコード

diff #

N, X = gets.split.map(&:to_i)
A = gets.split.map(&:to_i)
C = A.tally
C.default = 0

puts A.map { |a| C[X - a] }.sum
0