結果
| 問題 |
No.700 LOVE
|
| コンテスト | |
| ユーザー |
spihill
|
| 提出日時 | 2018-08-24 20:52:54 |
| 言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
AC
|
| 実行時間 | 2 ms / 2,000 ms |
| コード長 | 1,379 bytes |
| コンパイル時間 | 1,709 ms |
| コンパイル使用メモリ | 170,304 KB |
| 実行使用メモリ | 5,376 KB |
| 最終ジャッジ日時 | 2024-07-22 23:29:49 |
| 合計ジャッジ時間 | 2,500 ms |
|
ジャッジサーバーID (参考情報) |
judge5 / judge2 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 16 |
ソースコード
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
void init();
void solve();
#define rep(i, a) for (int i = 0; i < (int) (a); i++)
#define reps(i, a, b) for (int i = (int) (a); i < (int) (b); i++)
#define rrep(i, a) for (int i = (int) a-1; i >= 0; i--)
#define rreps(i, a, b) for (int i = (int) (a)-1; i >= (int) (b); i--)
#define MP(a, b) make_pair((a), (b))
#define PB(a) push_back((a))
#define all(v) (v).begin(), (v).end()
#define PRINT(f) if((f)){cout << (TRUE__) << endl;}else{cout << FALSE__ << endl;}
#define TRUE__ "YES"
#define FALSE__ "NO"
#define PERM(v) next_permutation(all(v))
#define UNIQUE(v) sort(all(v));(v).erase(unique(all(v)), v.end())
#define CIN(type, x) type x;cin >> x
#ifdef LOCAL
#define lcout(a) cout << a;
#define lcoutln(a) cout << a << endl;
#define lcerr(a) cerr << a;
#define lcerrln(a) cerr << a << endl;
#else
#define lcout(a)
#define lcoutln(a)
#define lcerr(a)
#define lcerrln(a)
#endif
#define MOD 1000000007
vector<string> v(50);
int h, w;
signed main()
{
init();
solve();
}
void init()
{
cin >> h >> w;
rep(i, h) cin >> v[i];
}
bool ch(int r, int c)
{
if (c + 3 > w - 1) return false;
string s = "LOVE";
reps(i, c, c+4) {
if (v[r][i] != s[i-c]) return false;
}
return true;
}
void solve()
{
rep(i, h) {
rep(j, w) {
if (ch(i, j)) {
PRINT(true);
return;
}
}
}
PRINT(false);
}
spihill