結果

問題 No.327 アルファベット列
ユーザー yuki2006yuki2006
提出日時 2015-12-18 03:39:25
言語 Go
(1.22.1)
結果
TLE  
実行時間 -
コード長 573 bytes
コンパイル時間 11,610 ms
コンパイル使用メモリ 237,224 KB
実行使用メモリ 10,624 KB
最終ジャッジ日時 2024-04-19 03:54:57
合計ジャッジ時間 15,296 ms
ジャッジサーバーID
(参考情報)
judge1 / judge3
このコードへのチャレンジ
(要ログイン)

テストケース

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

ソースコード

diff #

package main

import (

	"fmt"
)

func main() {
	var N int
	fmt.Scanf("%d", &N)
	fmt.Println(NumToChar(N))
}

// 愚直解
func NumToChar(N int) string {
	cur := make([]byte, 1)
	cur[0] = 'A' - 1
	for index := 0; index <= N; index++ {
		cur[len(cur) - 1] += 1
		for j := len(cur) - 1; j >= 0; j-- {
			if cur[j] == 'Z' + 1 {
				cur[j] = 'A'
				if j == 0 {
					tmp := make([]byte, len(cur) + 1)
					tmp[0] = 'A' - 1
					for k := 0; k < len(cur); k++ {
						tmp[1 + k] = cur[k]
					}
					cur = tmp
					j = 1
				}
				cur[j - 1]++
			}
		}
	}
	return string(cur)
}

0