結果

問題 No.1192 半部分列
ユーザー Forested
提出日時 2020-08-06 09:40:33
言語 C++14
(gcc 13.3.0 + boost 1.87.0)
結果
WA  
実行時間 -
コード長 379 bytes
コンパイル時間 446 ms
コンパイル使用メモリ 64,000 KB
実行使用メモリ 5,376 KB
最終ジャッジ日時 2024-09-19 07:51:06
合計ジャッジ時間 1,300 ms
ジャッジサーバーID
(参考情報)
judge3 / judge4
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 8 WA * 17
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <iostream>
#include <string>
using namespace std;

int main() {
    string s, t;
    cin >> s >> t;
    
    size_t k = 0;
    for (char c : s) {
        while (k < t.size()) {
            if (c == t[k]) break;
            ++k;
        }
        ++k;
    }
    
    if (k >= t.size())
        cout << s << endl;
    else
        cout << -1 << endl;
    
    return 0;
}
0