結果

問題 No.700 LOVE
ユーザー Mr.Fuku
提出日時 2018-07-31 15:33:53
言語 C++14
(gcc 13.3.0 + boost 1.87.0)
結果
WA  
実行時間 -
コード長 386 bytes
コンパイル時間 512 ms
コンパイル使用メモリ 67,984 KB
実行使用メモリ 6,944 KB
最終ジャッジ日時 2024-09-19 16:32:59
合計ジャッジ時間 1,379 ms
ジャッジサーバーID
(参考情報)
judge5 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 13 WA * 3
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <iostream>
#define FOR(i,x,y) for(int i=x;i<y;i++)
using namespace std;
int main(){
    int n,m;
    char c;
    string s;
    cin>>n>>m;
    
    FOR(i,0,4){
        cin>>c;
        s+=c;
    }
    
    FOR(i,0,n*m-4){
        if(s=="LOVE"){
            cout<<"YES";
            exit(0);
        }
        cin>>c;
        s=s.substr(1,3)+c;
    }
    cout<<"NO"<<endl;
    
}
0