結果
| 問題 | No.700 LOVE | 
| コンテスト | |
| ユーザー |  f843nmfwisfeuw | 
| 提出日時 | 2020-08-15 13:21:24 | 
| 言語 | C++14 (gcc 13.3.0 + boost 1.87.0) | 
| 結果 | 
                                AC
                                 
                             | 
| 実行時間 | 2 ms / 2,000 ms | 
| コード長 | 737 bytes | 
| コンパイル時間 | 783 ms | 
| コンパイル使用メモリ | 94,064 KB | 
| 実行使用メモリ | 5,376 KB | 
| 最終ジャッジ日時 | 2024-07-22 23:49:05 | 
| 合計ジャッジ時間 | 1,500 ms | 
| ジャッジサーバーID (参考情報) | judge1 / judge2 | 
(要ログイン)
| ファイルパターン | 結果 | 
|---|---|
| sample | AC * 3 | 
| other | AC * 16 | 
ソースコード
#include <iostream>
#include <vector>
#include <algorithm>
#include <cmath>
#include <iomanip>
#include <stack>
#include <algorithm>
#include <string>
#include <map>
#include <iterator>
#include <set>
#include <queue>
#include <bitset>
#include <cassert>
using namespace std;
int main() {
    int n, m;
    cin >> n >> m;
    if (m < 4) {
        cout << "NO" << endl;
    } else {
        for (int i = 0; i < n; ++i) {
            string S;
            cin >> S;
            for (int j = 0; j < m - 4 + 1; ++j) {
                if (S.substr(j, 4) == "LOVE") {
                    cout << "YES" << endl;
                    return 0;
                }
            }
        }
        cout << "NO" << endl;
    }
    return 0;
}
            
            
            
        