結果
問題 |
No.2862 NOT FOUND 404
|
ユーザー |
![]() |
提出日時 | 2024-09-03 16:01:34 |
言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 1 ms / 2,000 ms |
コード長 | 493 bytes |
コンパイル時間 | 390 ms |
コンパイル使用メモリ | 39,912 KB |
最終ジャッジ日時 | 2025-02-24 03:46:49 |
ジャッジサーバーID (参考情報) |
judge2 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 12 |
コンパイルメッセージ
main.cpp: In function ‘int main()’: main.cpp:27:8: warning: ignoring return value of ‘int scanf(const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result] 27 | scanf("%d%s", &n, s); | ~~~~~^~~~~~~~~~~~~~~
ソースコード
/* -*- coding: utf-8 -*- * * 2862.cc: No.2862 NOT FOUND 404 - yukicoder */ #include<cstdio> #include<algorithm> using namespace std; /* constant */ const int MAX_N = 100000; /* typedef */ /* global variables */ char s[MAX_N + 4]; /* subroutines */ /* main */ int main() { int n; scanf("%d%s", &n, s); for (int i = 0; i + 2 < n; i++) if (s[i] == '4' && s[i + 1] == '0' && s[i + 2] == '4') { puts("Found"); return 0; } puts("NotFound"); return 0; }