結果
問題 |
No.1519 Diversity
|
ユーザー |
![]() |
提出日時 | 2021-05-28 23:14:37 |
言語 | Python3 (3.13.1 + numpy 2.2.1 + scipy 1.14.1) |
結果 |
WA
|
実行時間 | - |
コード長 | 418 bytes |
コンパイル時間 | 1,592 ms |
コンパイル使用メモリ | 12,672 KB |
実行使用メモリ | 16,128 KB |
最終ジャッジ日時 | 2024-11-07 10:27:55 |
合計ジャッジ時間 | 4,746 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge4 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 1 |
other | AC * 1 WA * 14 |
ソースコード
n = int(input()) c = [0]*(n+1) cnt = n*(n-1)//2 cur = n res = [] s = set() while cnt > 0: tmp = cur-1-c[cur] for i in range(tmp): res.append((cur, cur-1-i)) c[cur] += 1 c[cur-1-i] += 1 cnt -= 1 for i in range(n, 0, -1): s.add(c[i]) if len(s) == n-1: break cur -= 1 # print(c) print(len(s)) for i in range(len(res)): a, b = res[i] print(b, a)