結果
| 問題 |
No.488 四角関係
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2017-02-27 11:52:45 |
| 言語 | Ruby (3.4.1) |
| 結果 |
TLE
|
| 実行時間 | - |
| コード長 | 357 bytes |
| コンパイル時間 | 61 ms |
| コンパイル使用メモリ | 7,424 KB |
| 実行使用メモリ | 19,360 KB |
| 最終ジャッジ日時 | 2024-06-11 19:20:07 |
| 合計ジャッジ時間 | 19,895 ms |
|
ジャッジサーバーID (参考情報) |
judge5 / judge2 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | -- * 3 |
| other | AC * 8 TLE * 1 -- * 13 |
コンパイルメッセージ
Syntax OK
ソースコード
#!/usr/bin/ruby
h=Hash.new{|h,k|h[k]=[]}
n,m=gets.split.map(&:to_i)
m.times{
x,y=gets.split.map(&:to_i)
h[x]<<y
h[y]<<x
}
p [*0..n].combination(4).count{|a0|
a0.permutation.any?{|a|
h[a[0]].include?(a[1]) &&
h[a[1]].include?(a[2]) &&
h[a[2]].include?(a[3]) &&
h[a[3]].include?(a[0]) &&
!h[a[0]].include?(a[2]) &&
!h[a[1]].include?(a[3])
}
}