結果

問題 No.205 マージして辞書順最小
ユーザー kuisiba
提出日時 2016-11-01 09:41:14
言語 C++11(廃止可能性あり)
(gcc 13.3.0)
結果
WA  
実行時間 -
コード長 516 bytes
コンパイル時間 463 ms
コンパイル使用メモリ 61,556 KB
実行使用メモリ 6,824 KB
最終ジャッジ日時 2024-11-25 00:38:44
合計ジャッジ時間 1,288 ms
ジャッジサーバーID
(参考情報)
judge4 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2 WA * 2
other AC * 5 WA * 10
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <iostream>
#include <cstdint>
#include <string>
#include <vector>

using namespace std;

int main() {

  ios::sync_with_stdio(false);
  cin.tie(0);

  int n;
  cin >> n;
  vector<int> v(26);
  string s;
  for (int i = 0; i < n; i++) {
    cin >> s;
    for (size_t j = 0; j < s.size(); j++) {
      v.at(s.at(j) - 97)++;
    }
  }
  string ans;
  for (size_t i = 0; i < v.size(); i++) {
    int m = v.at(i);
    for (int j = 0; j < m; j++) {
      ans += (char)(i + 97);
    }
  }
  cout << ans << endl;
}

0