結果
| 問題 |
No.1519 Diversity
|
| コンテスト | |
| ユーザー |
wolgnik
|
| 提出日時 | 2021-05-28 21:58:59 |
| 言語 | PyPy3 (7.3.15) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 262 bytes |
| コンパイル時間 | 419 ms |
| コンパイル使用メモリ | 82,048 KB |
| 実行使用メモリ | 81,408 KB |
| 最終ジャッジ日時 | 2024-11-07 09:29:59 |
| 合計ジャッジ時間 | 4,652 ms |
|
ジャッジサーバーID (参考情報) |
judge1 / judge5 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 1 |
| other | AC * 2 WA * 13 |
ソースコード
import sys
input = sys.stdin.readline
N = int(input())
res = []
d = [0] * (N + 1)
s = {0}
for x in range(2, N + 1):
y = x + 1
while y <= N and d[x] in s:
res.append((x, y))
d[x] += 1
d[y] += 1
s.add(d[x])
print(len(res))
for r in res: print(*r)
wolgnik