結果
問題 | No.488 四角関係 |
ユーザー |
|
提出日時 | 2021-04-05 22:59:21 |
言語 | Kuin (KuinC++ v.2021.9.17) |
結果 |
AC
|
実行時間 | 89 ms / 5,000 ms |
コード長 | 858 bytes |
コンパイル時間 | 2,446 ms |
コンパイル使用メモリ | 146,020 KB |
実行使用メモリ | 6,944 KB |
最終ジャッジ日時 | 2024-09-16 12:25:25 |
合計ジャッジ時間 | 3,640 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge6 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 22 |
ソースコード
func main()var n: int :: cui@inputInt()var m: int :: cui@inputInt()var a: []int :: #[m]intvar b: []int :: #[m]intvar map: dict<int, bool> :: #dict<int, bool>for i(0, m - 1)do a[i] :: cui@inputInt()do b[i] :: cui@inputInt()do map.add(a[i] * n + b[i], true)do map.add(b[i] * n + a[i], true)end forvar ans: int :: 0for i(0, m - 1)for j(i + 1, m - 1)if(a[j] = a[i] | a[j] = b[i] | b[j] = a[i] | b[j] = b[i])skip jend ifvar straight1: bool :: map.get(a[i] * n + a[j], &)var straight2: bool :: map.get(b[i] * n + b[j], &)var cross1: bool :: map.get(a[i] * n + b[j], &)var cross2: bool :: map.get(b[i] * n + a[j], &)if(straight1 & straight2 & !cross1 & !cross2 | !straight1 & !straight2 & cross1 & cross2)do ans :+ 1end ifend forend fordo ans :/ 2do cui@print("\{ans}\n")end func