結果
問題 | No.558 575検出するやつ |
ユーザー | ふう |
提出日時 | 2017-09-08 23:58:02 |
言語 | C++11 (gcc 13.3.0) |
結果 |
AC
|
実行時間 | 2 ms / 2,000 ms |
コード長 | 748 bytes |
コンパイル時間 | 831 ms |
コンパイル使用メモリ | 82,172 KB |
実行使用メモリ | 5,248 KB |
最終ジャッジ日時 | 2024-11-07 12:24:07 |
合計ジャッジ時間 | 1,565 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 5 |
other | AC * 15 |
ソースコード
#define _CRT_SECURE_NO_WARNINGS #define _USE_MATH_DEFINES #include <iostream> #include <iomanip> #include <string> #include <cmath> #include <vector> #include <algorithm> #include <queue> #include <functional> #include <map> using namespace std; #define MOD 1000000007 #define INF 2147483647 #define ll long long int main() { string s; cin >> s; int cnt = 0; for (int i = 0; i < s.size(); i++) { if (cnt == 0 && s[i] == '5') { cnt++; } else if (cnt == 1) { if (s[i] == '7') { cnt++; } else { cnt = 0; } } else if (cnt == 2) { if (s[i] == '5') { cnt++; break; } else { cnt = 0; } } } if (cnt == 3) { cout << "YES" << endl; } else { cout << "NO" << endl; } return (0); }