結果

問題 No.558 575検出するやつ
ユーザー Toshihiko Yanase
提出日時 2018-05-01 13:36:00
言語 C++11(廃止可能性あり)
(gcc 13.3.0)
結果
WA  
実行時間 -
コード長 475 bytes
コンパイル時間 1,767 ms
コンパイル使用メモリ 60,380 KB
実行使用メモリ 6,944 KB
最終ジャッジ日時 2024-06-28 00:08:58
合計ジャッジ時間 1,432 ms
ジャッジサーバーID
(参考情報)
judge2 / judge5
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 5
other AC * 13 WA * 2
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <iostream>
#include <vector>
#include <algorithm>

using namespace std;


int main() {
  std::cin.tie(0);
  std::ios::sync_with_stdio(false);

  string S;
  string sub = "575";
  cin >> S;

  for(int i=0;i<S.size()-sub.size()+1;i++){
    bool flag = true;
    for(int j=0;j<sub.size();j++){
      if(S[i+j] != sub[j]){
	flag = false;
	break;
      }
    }
    if(flag){
      cout << "YES" << endl;;
      return 0;
    }
  }

  cout << "NO" << endl;

  return 0;
}
0