結果

問題 No.1367 文字列門松
ユーザー yansi819yansi819
提出日時 2024-05-03 09:38:44
言語 C++17(gcc12)
(gcc 12.3.0 + boost 1.87.0)
結果
AC  
実行時間 2 ms / 2,000 ms
コード長 538 bytes
コンパイル時間 3,734 ms
コンパイル使用メモリ 262,024 KB
実行使用メモリ 5,248 KB
最終ジャッジ日時 2024-11-24 08:33:29
合計ジャッジ時間 4,687 ms
ジャッジサーバーID
(参考情報)
judge1 / 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