結果
問題 | No.327 アルファベット列 |
ユーザー |
![]() |
提出日時 | 2016-09-11 16:42:51 |
言語 | Go (1.23.4) |
結果 |
AC
|
実行時間 | 2 ms / 2,000 ms |
コード長 | 637 bytes |
コンパイル時間 | 11,527 ms |
コンパイル使用メモリ | 232,248 KB |
実行使用メモリ | 6,824 KB |
最終ジャッジ日時 | 2024-11-17 03:30:59 |
合計ジャッジ時間 | 13,285 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 50 |
ソースコード
package mainimport (_ "bufio""fmt"_ "os"_ "strconv"_ "strings"_ "math"_ "sort")func main() {N := 0fmt.Scan(&N)runes := []rune{}for true {runes = append(runes, rune(N%26 + 65) )N /= 26if N <= 0 { break }// このNを一個引く作業がすごく重要🌟 気付かずにわけわかんない試行錯誤することになったN--}res := string(runes)fmt.Println(Reverse(res))}func Reverse(s string) string {runes := []rune(s)for i, j := 0, len(runes)-1; i < j; i, j = i+1, j-1 {runes[i], runes[j] = runes[j], runes[i]}return string(runes)}