結果
問題 |
No.479 頂点は要らない
|
ユーザー |
![]() |
提出日時 | 2017-02-06 19:00:22 |
言語 | Ruby (3.4.1) |
結果 |
TLE
|
実行時間 | - |
コード長 | 361 bytes |
コンパイル時間 | 50 ms |
コンパイル使用メモリ | 7,424 KB |
実行使用メモリ | 141,056 KB |
最終ジャッジ日時 | 2024-12-24 08:18:16 |
合計ジャッジ時間 | 51,656 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge4 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 19 TLE * 19 |
コンパイルメッセージ
Syntax OK
ソースコード
n,m=gets.split.map &:to_i @lines=(1..m).map{gets.split.map &:to_i} @a=0 def loop max tmp_lines = @lines.select{|l| l.include? max} tops=tmp_lines.flatten.delete_if{|e| e==max} @a+=tops.reduce(0){|a, e| a+=2**e} @lines.delete_if{|l| !(l & (tops << max)).empty?} return if @lines.empty? max=@lines.flatten.max loop max end loop n-1 puts @a.to_s(2)