結果

問題 No.1679 マスゲーム
ユーザー simansiman
提出日時 2022-03-06 01:41:11
言語 Ruby
(3.3.0)
結果
WA  
実行時間 -
コード長 271 bytes
コンパイル時間 53 ms
コンパイル使用メモリ 11,272 KB
実行使用メモリ 23,272 KB
最終ジャッジ日時 2023-09-27 15:12:18
合計ジャッジ時間 10,387 ms
ジャッジサーバーID
(参考情報)
judge11 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 73 ms
15,168 KB
testcase_01 AC 68 ms
15,132 KB
testcase_02 AC 71 ms
15,256 KB
testcase_03 WA -
testcase_04 WA -
testcase_05 WA -
testcase_06 WA -
testcase_07 WA -
testcase_08 WA -
testcase_09 WA -
testcase_10 WA -
testcase_11 WA -
testcase_12 WA -
testcase_13 WA -
testcase_14 WA -
testcase_15 WA -
testcase_16 WA -
testcase_17 AC 69 ms
15,040 KB
testcase_18 AC 349 ms
15,392 KB
testcase_19 WA -
testcase_20 WA -
testcase_21 WA -
testcase_22 WA -
testcase_23 AC 67 ms
15,216 KB
testcase_24 WA -
testcase_25 AC 71 ms
15,196 KB
testcase_26 WA -
testcase_27 WA -
権限があれば一括ダウンロードができます
コンパイルメッセージ
Syntax OK

ソースコード

diff #

N = gets.to_i

v_counter = Hash.new(0)
h_counter = Hash.new(0)

N.times do
  a, b, t = gets.split.map(&:to_i)

  if a == 0
    v_counter[b + t] += 1
  else
    h_counter[b + t] += 1
  end
end

ans = 0

v_counter.each do |t, cnt|
  ans += h_counter[t] * cnt
end

puts ans
0