結果

問題 No.256 桁の数字を入れ替え (2)
ユーザー Goryudyuma
提出日時 2015-08-13 00:42:13
言語 Go
(1.23.4)
結果
WA  
実行時間 -
コード長 1,120 bytes
コンパイル時間 10,528 ms
コンパイル使用メモリ 231,116 KB
実行使用メモリ 6,820 KB
最終ジャッジ日時 2024-10-10 19:57:07
合計ジャッジ時間 11,125 ms
ジャッジサーバーID
(参考情報)
judge5 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 2 WA * 2
権限があれば一括ダウンロードができます

ソースコード

diff #

package main

import (
        "bufio"
        "fmt"
        "os"
        "sort"
        "strconv"
        "strings"
)

var sc = bufio.NewScanner(os.Stdin)

func nextInt() int {
        i, e := strconv.Atoi(nextString())
        if e != nil {
                panic(e)
        }
        return i
}

func nextInt64() int64 {
        i, e := strconv.ParseInt(nextString(), 10, 64)
        if e != nil {
                panic(e)
        }
        return i

}

func nextFloat() float64 {
        f, e := strconv.ParseFloat(nextString(), 64)
        if e != nil {
                panic(e)
        }
        return f
}

func nextString() string {
        sc.Split(bufio.ScanWords)
        sc.Scan()
        return sc.Text()
}
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)
}

func main() {
        N := nextString()
        X := strings.Split(N, "")
        sort.Strings(X)
        Y := strings.Join(X[:], "")
        Z := Reverse(Y)
        fmt.Println(Z)
}
0