結果

問題 No.11 カードマッチ
ユーザー finefine
提出日時 2016-03-23 01:12:02
言語 Ruby
(3.3.0)
結果
AC  
実行時間 201 ms / 5,000 ms
コード長 295 bytes
コンパイル時間 176 ms
コンパイル使用メモリ 11,508 KB
実行使用メモリ 38,772 KB
最終ジャッジ日時 2023-08-02 00:21:17
合計ジャッジ時間 3,617 ms
ジャッジサーバーID
(参考情報)
judge12 / judge15
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 86 ms
15,056 KB
testcase_01 AC 85 ms
15,072 KB
testcase_02 AC 85 ms
15,064 KB
testcase_03 AC 84 ms
15,352 KB
testcase_04 AC 151 ms
27,716 KB
testcase_05 AC 84 ms
15,300 KB
testcase_06 AC 198 ms
38,552 KB
testcase_07 AC 100 ms
20,840 KB
testcase_08 AC 139 ms
26,984 KB
testcase_09 AC 201 ms
38,772 KB
testcase_10 AC 175 ms
33,524 KB
testcase_11 AC 163 ms
31,324 KB
testcase_12 AC 166 ms
32,084 KB
testcase_13 AC 149 ms
29,924 KB
testcase_14 AC 137 ms
25,300 KB
testcase_15 AC 86 ms
15,216 KB
testcase_16 AC 89 ms
15,756 KB
testcase_17 AC 86 ms
15,860 KB
testcase_18 AC 89 ms
15,848 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
Syntax OK

ソースコード

diff #

w = gets.to_i
h = gets.to_i
ans = Array.new(w,-1)
memo = Array.new(h,false)
gets.to_i.times{
    s,k = gets.split.map(&:to_i)
    if ans[s - 1] == -1
        ans[s - 1] = h
    end
    ans[s - 1] -= 1
    memo[k - 1] = true
    }
tmp = memo.count(true)
p ans.map{|x|x == -1 ? tmp : x}.inject(:+)
0