結果

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

ソースコード

diff #

#include <bits/stdc++.h>

using std::cin;
using std::cout;
using std::min;
using std::string;
using std::vector;
using P = std::pair<char, int>;

int main() {
	string s;
	cin >> s;
	int n = s.size();
	
	char t = s[0];
	for (int i = 1; i < n; ++i) t = min(t, s[i]);
	int p = s.find(t);
	
	int k = p + 1;
	while (s[k] == s[p]) ++k;
	
	string ans = s.substr(p, k) + "a";
	cout << ans << '\n';
	
	return 0;
}
0