結果
| 問題 |
No.558 575検出するやつ
|
| コンテスト | |
| ユーザー |
Ichimiya
|
| 提出日時 | 2020-05-02 02:52:33 |
| 言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
AC
|
| 実行時間 | 2 ms / 2,000 ms |
| コード長 | 359 bytes |
| コンパイル時間 | 1,474 ms |
| コンパイル使用メモリ | 166,672 KB |
| 実行使用メモリ | 5,248 KB |
| 最終ジャッジ日時 | 2024-12-26 00:45:33 |
| 合計ジャッジ時間 | 2,242 ms |
|
ジャッジサーバーID (参考情報) |
judge3 / judge4 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 5 |
| other | AC * 15 |
ソースコード
#include <bits/stdc++.h>
using namespace std;
int main() {
string s;
cin >> s;
if (s.size() < 3) {
cout << "NO" << endl;
return 0;
}
int f = 0;
for (int i = 0; i < s.size() - 2; i++) {
if (s.at(i) == '5') {
string x = s.substr(i, 3);
if (x == "575") f = 1;
}
}
if (f) {
cout << "YES" << endl;
}
else {
cout << "NO" << endl;
}
}
Ichimiya