結果

問題 No.1367 文字列門松
ユーザー yansi819
提出日時 2024-05-03 09:38:44
言語 C++17
(gcc 13.3.0 + boost 1.87.0)
結果
AC  
実行時間 35 ms / 2,000 ms
コード長 538 bytes
コンパイル時間 3,648 ms
コンパイル使用メモリ 251,884 KB
最終ジャッジ日時 2025-02-21 10:44:51
ジャッジサーバーID
(参考情報)
judge4 / judge5
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 27
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
#include <atcoder/all>
using namespace std;
using namespace atcoder;
using ll = long long;
using ld = long double;
using mint = modint998244353;

int main() {
  string S; cin >> S;
  string T = "kadomatsu";
  int i = 0, j = 0;
  while (j < 9) {
    if (S[i] == T[j]) {
      i++; j++;
    } else {
      S.insert(i, 1, T[j]);
      i++; j++;
      if (S.size() > 9) {
        cout << "No" << endl;
        return 0;
      }
    }
  }
  if (S == T) cout << "Yes" << endl;
  else cout << "No" << endl;
  return 0;
}
0