#include using namespace std; int main(){ int n; string s; cin >> n >> s; bool check = 0;//404を一回でも発見したかどうかを管理しておくフラグ for(int j = 0;j < n - 2;j++){ if(s.substr(j,3) == "404"){//s.substr(j,3)でsのj文字目から3文字を持ってくることができる(stringは0-indexedである点に注意) check = 1;//404を一回でも発見したらcheckに1を入れる } } if(check)cout << "Found" << endl; else cout << "NotFound" << endl; return 0; }