結果

問題 No.1643 Not Substring
ユーザー kkkk97368086kkkk97368086
提出日時 2021-12-05 09:17:23
言語 C++14
(gcc 13.3.0 + boost 1.87.0)
結果
AC  
実行時間 2 ms / 2,000 ms
コード長 478 bytes
コンパイル時間 787 ms
コンパイル使用メモリ 83,936 KB
実行使用メモリ 5,376 KB
最終ジャッジ日時 2024-07-07 07:03:57
合計ジャッジ時間 1,849 ms
ジャッジサーバーID
(参考情報)
judge4 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2
other AC * 26
権限があれば一括ダウンロードができます

ソースコード

diff #

#include<iostream>
#include<vector>
#include<string>
#include<set>
#include<map>
#include <ios>
#include <iomanip> 
#include<algorithm>

using namespace std;

int main(){
    string s;
    cin >> s;
    int num = s.size();
    sort(s.begin(), s.end());
    string ans = "a";
    for(int i=0; i<num; i++){
        if(s[i] == 'a'){
            ans+='a';
        }else{
            cout << ans << endl;
            return 0;
        }
    }
    cout << ans << endl;
    return 0;
}
0