結果
問題 | No.327 アルファベット列 |
ユーザー |
|
提出日時 | 2019-01-19 20:32:56 |
言語 | Nim (2.2.0) |
結果 |
AC
|
実行時間 | 2 ms / 2,000 ms |
コード長 | 542 bytes |
コンパイル時間 | 2,261 ms |
コンパイル使用メモリ | 61,612 KB |
実行使用メモリ | 5,376 KB |
最終ジャッジ日時 | 2024-07-01 10:23:10 |
合計ジャッジ時間 | 3,840 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 50 |
ソースコード
proc getchar_unlocked():char {. importc:"getchar_unlocked",header: "<stdio.h>" .}proc scan(): int =while true:var k = getchar_unlocked()if k < '0': breakresult = 10 * result + k.ord - '0'.ordproc putchar_unlocked(c:char){. importc:"putchar_unlocked",header: "<stdio.h>" .}proc asAlphabet(a:int) : string =proc impl(a:int) : seq[char] =let c = a mod 26let s = ('A'.ord + c).chrif a < 26: return @[s]result = impl(a div 26 - 1)result &= sreturn cast[string](impl(a))echo scan().asAlphabet()