結果
| 問題 | No.2590 100000 Days of Christmas | 
| コンテスト | |
| ユーザー |  | 
| 提出日時 | 2023-11-23 14:41:38 | 
| 言語 | Ruby (3.4.1) | 
| 結果 | 
                                AC
                                 
                             | 
| 実行時間 | 975 ms / 2,000 ms | 
| コード長 | 227 bytes | 
| コンパイル時間 | 229 ms | 
| コンパイル使用メモリ | 7,424 KB | 
| 実行使用メモリ | 32,180 KB | 
| 最終ジャッジ日時 | 2024-09-27 08:10:21 | 
| 合計ジャッジ時間 | 9,134 ms | 
| ジャッジサーバーID (参考情報) | judge4 / judge2 | 
(要ログイン)
| ファイルパターン | 結果 | 
|---|---|
| sample | AC * 2 | 
| other | AC * 22 | 
コンパイルメッセージ
Syntax OK
ソースコード
presents = Hash.new(0)
N = gets.to_i
(0 ... N).each do |i|
    present = gets
    present.chop! if present[-1] == "\n"
    presents[present] += (i + 1) * (N - i)
end
presents.to_a.sort.each do |p, c|
    puts "#{c} #{p}"
end
            
            
            
        