結果
問題 |
No.558 575検出するやつ
|
ユーザー |
![]() |
提出日時 | 2017-08-25 22:31:56 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 851 bytes |
コンパイル時間 | 1,761 ms |
コンパイル使用メモリ | 168,324 KB |
実行使用メモリ | 6,820 KB |
最終ジャッジ日時 | 2024-10-15 16:00:36 |
合計ジャッジ時間 | 2,255 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 5 |
other | AC * 11 WA * 4 |
ソースコード
#include <bits/stdc++.h> using namespace std; struct Solution { void solve(std::istream& in, std::ostream& out) { string S; string C = "575"; in >> S; bool ans = false; for (int i = 0; i < S.size() - 3; i++) { int j = 0; for (; j < 3; j++) { if (S[i + j] != C[j]) { break; } } ans = j == 3; if (ans) break; } out << (ans ? "YES" : "NO") << '\n'; } }; void solve(std::istream& in, std::ostream& out) { out << std::setprecision(12); Solution solution; solution.solve(in, out); } #include <fstream> #include <iostream> int main() { ios_base::sync_with_stdio(0); cin.tie(0); istream& in = cin; ostream& out = cout; solve(in, out); return 0; }