結果

問題 No.401 数字の渦巻き
ユーザー hanorver
提出日時 2016-09-02 20:31:46
言語 Python3
(3.13.1 + numpy 2.2.1 + scipy 1.14.1)
結果
AC  
実行時間 33 ms / 2,000 ms
コード長 206 bytes
コンパイル時間 95 ms
コンパイル使用メモリ 12,544 KB
実行使用メモリ 10,880 KB
最終ジャッジ日時 2024-11-15 18:04:05
合計ジャッジ時間 1,980 ms
ジャッジサーバーID
(参考情報)
judge1 / judge5
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 30
権限があれば一括ダウンロードができます

ソースコード

diff #

c=n=int(input())
s=range(1,n*n+1)
l=[i for i in s]
d=[1,n,-1,-n]*99
p=1
m=q=n-1
while m:
 f=m
 while f:q+=d[p];c+=1;l[q]=c;f-=1
 p+=1
 if p%2:m-=1
for i in s:print(("%03d"+["\n"," "][i%n!=0])%l[i-1],end="")
0