結果
| 問題 | 
                            No.1519 Diversity
                             | 
                    
| コンテスト | |
| ユーザー | 
                             | 
                    
| 提出日時 | 2021-05-28 21:46:25 | 
| 言語 | PyPy3  (7.3.15)  | 
                    
| 結果 | 
                             
                                WA
                                 
                             
                            
                         | 
                    
| 実行時間 | - | 
| コード長 | 331 bytes | 
| コンパイル時間 | 588 ms | 
| コンパイル使用メモリ | 82,152 KB | 
| 実行使用メモリ | 80,452 KB | 
| 最終ジャッジ日時 | 2024-11-07 09:18:08 | 
| 合計ジャッジ時間 | 4,829 ms | 
| 
                            ジャッジサーバーID (参考情報)  | 
                        judge5 / judge1 | 
(要ログイン)
| ファイルパターン | 結果 | 
|---|---|
| sample | AC * 1 | 
| other | AC * 2 WA * 13 | 
ソースコード
from itertools import count
n = int(input())
count = [0]*(n+1)
ans = []
for i in range(1,n):
    ans.append((i,n))
    count[i] += 1
    count[n] += 1
    for j in range(1,i):
        if count[j] < j:
            ans.append((j,i))
            count[j] += 1
            count[i] += 1
print(len(ans))
for a,b in ans:
    print(a,b)