結果
| 問題 |
No.1519 Diversity
|
| コンテスト | |
| ユーザー |
paruf4
|
| 提出日時 | 2021-05-28 23:03:59 |
| 言語 | Python3 (3.13.1 + numpy 2.2.1 + scipy 1.14.1) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 404 bytes |
| コンパイル時間 | 110 ms |
| コンパイル使用メモリ | 12,544 KB |
| 実行使用メモリ | 16,384 KB |
| 最終ジャッジ日時 | 2024-11-07 10:20:31 |
| 合計ジャッジ時間 | 4,816 ms |
|
ジャッジサーバーID (参考情報) |
judge2 / judge3 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| 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(n-1)
for i in range(len(res)):
a, b = res[i]
print(a, b)
paruf4