結果

問題 No.1643 Not Substring
ユーザー V_Melville
提出日時 2021-08-13 21:52:04
言語 C++17
(gcc 13.3.0 + boost 1.87.0)
結果
WA  
実行時間 -
コード長 275 bytes
コンパイル時間 2,052 ms
コンパイル使用メモリ 196,232 KB
最終ジャッジ日時 2025-01-23 18:53:33
ジャッジサーバーID
(参考情報)
judge3 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2
other AC * 24 WA * 2
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>

using std::cin;
using std::cout;
using std::string;

int main() {
	string s;
	cin >> s;
	int n = s.size();
	sort(s.begin(), s.end());
	
	int k = 0;
	while (s[k] == s[0]) ++k;
	
	string ans = s.substr(0, k) + "a";
	cout << ans << '\n';
	
	return 0;
}
0