結果

問題 No.3341 Making Beautiful Graphs
コンテスト
ユーザー n_bitand_n_per_3
提出日時 2025-11-13 22:29:31
言語 Python3
(3.13.1 + numpy 2.2.1 + scipy 1.14.1)
結果
AC  
実行時間 42 ms / 2,000 ms
コード長 389 bytes
コンパイル時間 489 ms
コンパイル使用メモリ 12,032 KB
実行使用メモリ 10,496 KB
最終ジャッジ日時 2025-11-13 22:29:39
合計ジャッジ時間 5,765 ms
ジャッジサーバーID
(参考情報)
judge5 / judge4
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 50
権限があれば一括ダウンロードができます

ソースコード

diff #

N = int(input())

if N <= 2:
    print(-1)
    exit()

def f(x):
    array = []
    array.append((x+1)%(N**2))
    array.append((x-1)%(N**2))
    array.append((x+N)%(N**2))
    array.append((x-N)%(N**2))
    return array


print(2*N**2)
for i in range(N**2):
    for j in f(i):
        i = i if i != 0 else N**2
        j = j if j != 0 else N**2
        if i < j:
            print(i,j)


0