結果
問題 | No.1643 Not Substring |
ユーザー |
|
提出日時 | 2021-08-13 21:38:37 |
言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 2 ms / 2,000 ms |
コード長 | 1,144 bytes |
コンパイル時間 | 1,821 ms |
コンパイル使用メモリ | 193,276 KB |
最終ジャッジ日時 | 2025-01-23 18:30:50 |
ジャッジサーバーID (参考情報) |
judge2 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 2 |
other | AC * 26 |
ソースコード
#include <bits/stdc++.h> using namespace std; #include <math.h> #include <iomanip> #include <cstdint> #include <string> #include <sstream> template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return 1; } return 0; } template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return 1; } return 0; } #define rep(i,n) for (int i = 0; i < (n); ++i) typedef long long ll; typedef unsigned long long ull; using P=pair<ll,ll>; const ll INF=1001001001; const int mod=1e9+7; string s; void solve(){ cin>>s; auto check=[&](string x){ int j=0; rep(i,s.size()){ if(s[i]==x[j]){j++;} if(j>=x.size()){return true;} } return false; }; string t; rep(i,s.size()+1){ t+='a'; if(!check(t)){ cout<<t<<endl; return; } } } int main(){ ios_base::sync_with_stdio(false); cin.tie(NULL); solve(); return 0; }