結果
問題 | No.1367 文字列門松 |
ユーザー |
![]() |
提出日時 | 2021-01-29 21:23:37 |
言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 3 ms / 2,000 ms |
コード長 | 504 bytes |
コンパイル時間 | 2,370 ms |
コンパイル使用メモリ | 192,116 KB |
最終ジャッジ日時 | 2025-01-18 08:46:42 |
ジャッジサーバーID (参考情報) |
judge3 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 27 |
ソースコード
#include <stdio.h>#include <bits/stdc++.h>using namespace std;#define rep(i,n) for (int i = 0; i < (n); ++i)#define Inf 1000000000bool is_kadomatsu(int a,int b,int c){if(a==b||b==c||c==a)return false;if(b>a&&b>c)return true;if(b<a&&b<c)return true;return false;}int main(){string s = "kadomatsu";string S;cin>>S;int cur = 0;rep(i,s.size()){if(cur==S.size())break;if(s[i]==S[cur])cur++;}if(cur==S.size())cout<<"Yes"<<endl;else cout<<"No"<<endl;return 0;}