結果

問題 No.3341 Making Beautiful Graphs
コンテスト
ユーザー titia
提出日時 2025-11-14 01:53:53
言語 Python3
(3.13.1 + numpy 2.2.1 + scipy 1.14.1)
結果
WA  
実行時間 -
コード長 395 bytes
コンパイル時間 143 ms
コンパイル使用メモリ 12,032 KB
実行使用メモリ 10,880 KB
最終ジャッジ日時 2025-11-14 01:53:59
合計ジャッジ時間 5,578 ms
ジャッジサーバーID
(参考情報)
judge2 / judge5
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 26 WA * 24
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys
input = sys.stdin.readline

N=int(input())

if N%2==0 or N==1:
    print(-1)
else:
    ANS=set()

    for i in range(1,N*N+1):
        for j in [i-1,i-N,i+1,i+N]:
            if j>N*N:
                j-=N*N
            if j<=0:
                j+=N*N
            X=[i,j]
            X.sort()
            ANS.add(tuple(X))

    print(len(ANS))

    for x,y in ANS:
        print(x,y)
0