結果

問題 No.1519 Diversity
ユーザー ThetaTheta
提出日時 2024-04-16 16:25:25
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 107 ms / 2,000 ms
コード長 328 bytes
コンパイル時間 366 ms
コンパイル使用メモリ 82,432 KB
実行使用メモリ 81,152 KB
最終ジャッジ日時 2024-04-16 16:25:28
合計ジャッジ時間 2,876 ms
ジャッジサーバーID
(参考情報)
judge5 / judge4
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 40 ms
52,096 KB
testcase_01 AC 41 ms
51,840 KB
testcase_02 AC 39 ms
51,840 KB
testcase_03 AC 85 ms
77,568 KB
testcase_04 AC 97 ms
80,000 KB
testcase_05 AC 41 ms
51,840 KB
testcase_06 AC 107 ms
81,084 KB
testcase_07 AC 44 ms
52,608 KB
testcase_08 AC 77 ms
76,160 KB
testcase_09 AC 85 ms
77,568 KB
testcase_10 AC 96 ms
79,744 KB
testcase_11 AC 41 ms
52,352 KB
testcase_12 AC 105 ms
81,112 KB
testcase_13 AC 107 ms
81,024 KB
testcase_14 AC 105 ms
80,896 KB
testcase_15 AC 104 ms
81,152 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

from itertools import combinations


def main():
    N = int(input())

    edges = []
    for i, j in combinations(range(N), 2):
        if abs(i - j) > 0 and i + j < N:
            edges.append((i, j))
    print(len(edges))
    for edge in edges:
        print(edge[0] + 1, edge[1] + 1)


if __name__ == "__main__":
    main()
0