結果
| 問題 |
No.701 ひとりしりとり
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2019-01-17 16:15:30 |
| 言語 | Nim (2.2.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 748 bytes |
| コンパイル時間 | 3,265 ms |
| コンパイル使用メモリ | 64,828 KB |
| 実行使用メモリ | 6,948 KB |
| 最終ジャッジ日時 | 2024-07-01 10:05:42 |
| 合計ジャッジ時間 | 5,733 ms |
|
ジャッジサーバーID (参考情報) |
judge5 / judge3 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | WA * 12 |
ソースコード
import strutils
proc putchar_unlocked(c:char){.header: "<stdio.h>" .}
const bound = 'z'.ord - 'a'.ord + 1# [0,bound] まで使える
proc getAsciis(a:int): string =
if a == 0: return "a"
result = ""
var n = a
while n > 0:
result &= chr('a'.ord + (n mod bound))
n = n div bound
let n = stdin.readLine().parseInt()
for i in 0..<n div 2:
let S = i.getAsciis()
putchar_unlocked('a')
for s in S: putchar_unlocked(s)
putchar_unlocked('b')
putchar_unlocked('\n')
putchar_unlocked('b')
for s in S: putchar_unlocked(s)
putchar_unlocked('a')
putchar_unlocked('\n')
if n mod 2 == 1:
let S = (n div 2).getAsciis()
putchar_unlocked('a')
for s in S: putchar_unlocked(s)
putchar_unlocked('b')
putchar_unlocked('\n')