結果

問題 No.327 アルファベット列
ユーザー むらためむらため
提出日時 2019-01-19 20:09:11
言語 Nim
(2.0.2)
結果
WA  
実行時間 -
コード長 857 bytes
コンパイル時間 1,811 ms
コンパイル使用メモリ 66,168 KB
実行使用メモリ 4,500 KB
最終ジャッジ日時 2023-09-14 02:20:07
合計ジャッジ時間 3,420 ms
ジャッジサーバーID
(参考情報)
judge13 / judge15
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 1 ms
4,376 KB
testcase_01 AC 1 ms
4,376 KB
testcase_02 WA -
testcase_03 WA -
testcase_04 WA -
testcase_05 WA -
testcase_06 WA -
testcase_07 WA -
testcase_08 WA -
testcase_09 WA -
testcase_10 WA -
testcase_11 WA -
testcase_12 WA -
testcase_13 WA -
testcase_14 WA -
testcase_15 WA -
testcase_16 WA -
testcase_17 WA -
testcase_18 WA -
testcase_19 WA -
testcase_20 WA -
testcase_21 WA -
testcase_22 WA -
testcase_23 WA -
testcase_24 WA -
testcase_25 WA -
testcase_26 WA -
testcase_27 WA -
testcase_28 WA -
testcase_29 WA -
testcase_30 WA -
testcase_31 WA -
testcase_32 WA -
testcase_33 WA -
testcase_34 WA -
testcase_35 WA -
testcase_36 WA -
testcase_37 WA -
testcase_38 WA -
testcase_39 WA -
testcase_40 WA -
testcase_41 WA -
testcase_42 WA -
testcase_43 WA -
testcase_44 WA -
testcase_45 WA -
testcase_46 WA -
testcase_47 WA -
testcase_48 WA -
testcase_49 WA -
testcase_50 WA -
testcase_51 WA -
testcase_52 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

proc getchar_unlocked():char {. importc:"getchar_unlocked",header: "<stdio.h>" .}
proc scan(): int =
  while true:
    var k = getchar_unlocked()
    if k < '0': break
    result = 10 * result + k.ord - '0'.ord
proc putchar_unlocked(c:char){. importc:"putchar_unlocked",header: "<stdio.h>" .}
proc printAscii(a:int) =
  if a == 0:
    putchar_unlocked('A')
    return
  template div26(a:int) : int = a div 26
  template mod26(a:int) : int = a mod 26
  var n = a
  var rev = a
  var cnt = 0
  while rev.mod26 == 0:
    cnt += 1
    rev = rev.div26
  rev = 0
  while n != 0:
    rev = rev * 26 + n.mod26
    n = n.div26
  while rev != 0:
    putchar_unlocked((rev.mod26 + 'A'.ord).chr)
    rev = rev.div26
  while cnt != 0:
    putchar_unlocked('A')
    cnt -= 1
# 0 1 2 3 10 11 12 13 20 21 22 23
# A G H Z BA BB ..

scan().printAscii()
putchar_unlocked('\n')
0