結果

問題 No.11 カードマッチ
ユーザー finefine
提出日時 2016-03-23 01:12:02
言語 Ruby
(3.3.0)
結果
AC  
実行時間 192 ms / 5,000 ms
コード長 295 bytes
コンパイル時間 86 ms
コンパイル使用メモリ 7,552 KB
実行使用メモリ 35,712 KB
最終ジャッジ日時 2024-04-20 01:14:48
合計ジャッジ時間 2,928 ms
ジャッジサーバーID
(参考情報)
judge1 / judge4
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 76 ms
12,160 KB
testcase_01 AC 77 ms
12,288 KB
testcase_02 AC 76 ms
12,160 KB
testcase_03 AC 75 ms
12,160 KB
testcase_04 AC 144 ms
24,320 KB
testcase_05 AC 78 ms
12,416 KB
testcase_06 AC 192 ms
35,712 KB
testcase_07 AC 91 ms
17,408 KB
testcase_08 AC 126 ms
23,680 KB
testcase_09 AC 186 ms
35,584 KB
testcase_10 AC 162 ms
30,592 KB
testcase_11 AC 153 ms
28,416 KB
testcase_12 AC 148 ms
28,928 KB
testcase_13 AC 135 ms
27,008 KB
testcase_14 AC 124 ms
22,400 KB
testcase_15 AC 79 ms
12,160 KB
testcase_16 AC 81 ms
12,544 KB
testcase_17 AC 78 ms
12,800 KB
testcase_18 AC 80 ms
12,800 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