結果
問題 |
No.548 国士無双
|
ユーザー |
|
提出日時 | 2017-07-28 22:41:19 |
言語 | Ruby (3.4.1) |
結果 |
AC
|
実行時間 | 78 ms / 2,000 ms |
コード長 | 378 bytes |
コンパイル時間 | 56 ms |
コンパイル使用メモリ | 7,296 KB |
実行使用メモリ | 12,288 KB |
最終ジャッジ日時 | 2024-09-17 13:28:58 |
合計ジャッジ時間 | 2,507 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge6 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 24 |
コンパイルメッセージ
Syntax OK
ソースコード
def ascan; gets.split.map(&:to_i); end def scan; gets.to_i; end a = gets.chomp f = false "a".upto("m"){|c| b = (a+c).chars h = {} b.each{|e| h[e]||=0; h[e]+=1} j = {} h.values.each{|e| j[e]||=0; j[e]+=1} abort unless h.values.inject(:+) == 14 if j[1] == 12 && j[2] == 1 puts c f = true end } unless f puts "Impossible" end