結果

問題 No.1367 文字列門松
ユーザー kobakoba_issa
提出日時 2021-01-30 00:13:25
言語 C++17(clang)
(17.0.6 + boost 1.87.0)
結果
AC  
実行時間 2 ms / 2,000 ms
コード長 1,083 bytes
コンパイル時間 6,905 ms
コンパイル使用メモリ 138,324 KB
実行使用メモリ 6,944 KB
最終ジャッジ日時 2024-06-27 10:29:11
合計ジャッジ時間 7,089 ms
ジャッジサーバーID
(参考情報)
judge5 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 27
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <iostream>
#include <string>
#include <vector>
#include <map>
#include <set>
#include <utility>
#include <algorithm>
#include <cmath>
#include <climits>
#include <iomanip>
#include <queue>
#include <stack>
#include <ctype.h>

using namespace std;

typedef long long ll;

const int INF = (1<<30)-1;
const ll LINF = 1e18;

#define rep(i, n) for (int i = 0; i < n; i++)

template<class T> 
bool chmax(T &a, T b) {if (a < b) {a = b;return true;}else return false;}

template<class T> 
bool chmin(T &a, T b) {if (a > b) {a = b;return true;}else return false;}

int main() {
    string s;   cin >> s;
    string t = "kadomatsu";
    int i = 0, k = 0;
    while (k < t.size()) {
        if (i < s.size()) {
            if (s[i] == t[k]) {
                i++;
                k++;
            }
            else 
                k++;
        }
        else if (i >= s.size())
            k++;
    }
    if (i < s.size())
        cout << "No" << endl;
    else 
        cout << "Yes" << endl;
    return 0;
}

//小数点精度
//cout << fixed << std::setprecision(15) << y << endl;
0