結果

問題 No.1643 Not Substring
ユーザー mmn15277198
提出日時 2021-08-22 12:38:05
言語 C++14
(gcc 13.3.0 + boost 1.87.0)
結果
AC  
実行時間 2 ms / 2,000 ms
コード長 551 bytes
コンパイル時間 876 ms
コンパイル使用メモリ 95,724 KB
実行使用メモリ 6,820 KB
最終ジャッジ日時 2024-11-06 08:51:26
合計ジャッジ時間 1,880 ms
ジャッジサーバーID
(参考情報)
judge3 / judge4
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2
other AC * 26
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <iostream>
#include <vector>
#include <algorithm>
#include <functional>
#include <queue>
#include <map>
#include <cmath>
#include <iomanip>

using namespace std;

int main() {

  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  //cout << fixed << setprecision(15);
  
  string s;
  cin >> s;
  sort(s.begin() , s.end());
  if (s[0] != 'a') {
    cout << 'a' << endl;
  } else {
    cout << 'a';
    for (int i = 0; i < (int) s.size(); i++) {
      if (s[i] == 'a') {
        cout << s[i];
      }
    }
    cout << endl;
  }
  return 0;
}
0