結果
問題 |
No.2707 Bag of Words Encryption
|
ユーザー |
|
提出日時 | 2024-01-24 12:23:58 |
言語 | C++17(clang) (17.0.6 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 7 ms / 2,000 ms |
コード長 | 474 bytes |
コンパイル時間 | 754 ms |
コンパイル使用メモリ | 124,160 KB |
実行使用メモリ | 5,376 KB |
最終ジャッジ日時 | 2024-09-28 07:04:40 |
合計ジャッジ時間 | 1,499 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 2 |
other | AC * 15 |
ソースコード
#include <cassert> #include <iostream> #include <map> using namespace std; int main() { int n; string s; cin >> n >> s; assert(1 < n && n <= 100000); assert(s.length() == (size_t)n); for (int i = 0; i < n; ++i) { assert('A' <= s[i] && s[i] <= 'Z'); } map<char, int> count; for (char c : s) { count[c] += 1; } for (char c = 'A'; c <= 'Z'; ++c) { cout << count[c]; } cout << endl; return 0; }