結果
問題 |
No.2707 Bag of Words Encryption
|
ユーザー |
|
提出日時 | 2024-05-11 21:06:09 |
言語 | Go (1.23.4) |
結果 |
AC
|
実行時間 | 106 ms / 2,000 ms |
コード長 | 411 bytes |
コンパイル時間 | 10,880 ms |
コンパイル使用メモリ | 220,072 KB |
実行使用メモリ | 6,820 KB |
最終ジャッジ日時 | 2024-12-20 08:48:57 |
合計ジャッジ時間 | 13,310 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge4 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 2 |
other | AC * 15 |
ソースコード
// No.2707 Bag of Words Encryption package main import ( "fmt" "strconv" "strings" ) func main() { var n int var s string fmt.Scan(&n, &s) m := map[rune]int{} for i := rune('A'); i <= rune('Z'); i++ { m[i] = 0 } for j := 0; j < n; j++ { r := rune(s[j]) m[r] += 1 } c := make([]string, len(m)) for k, v := range m { c[k-rune('A')] = strconv.Itoa(v) } fmt.Println(strings.Join(c, "")) }