結果
問題 | No.401 数字の渦巻き |
ユーザー |
![]() |
提出日時 | 2025-01-25 23:28:48 |
言語 | Nim (2.2.0) |
結果 |
AC
|
実行時間 | 2 ms / 2,000 ms |
コード長 | 690 bytes |
コンパイル時間 | 4,536 ms |
コンパイル使用メモリ | 66,972 KB |
実行使用メモリ | 5,248 KB |
最終ジャッジ日時 | 2025-01-25 23:28:59 |
合計ジャッジ時間 | 5,513 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge10 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 30 |
ソースコード
import sequtils, strutilsletn = parseInt stdin.readLinevart = newSeq[string](n).repeat nyTop = 1xRight, yBottom = n.predxLeft = 0direction = 0cnt = 1x, y = 0while cnt <= n * n:t[y][x] = intToStr(cnt, 3)case directionof 0:if x < xRight:x.incelse:direction.incy.incxRight.decof 1:if y < yBottom:y.incelse:direction.incx.decyBottom.decof 2:if x > xLeft:x.decelse:direction.incy.decxLeft.incelse:if y > yTop:y.decelse:direction = 0x.incyTop.inccnt.incfor seq1 in t:echo seq1.join " "