結果

問題 No.700 LOVE
ユーザー 37zigen
提出日時 2018-06-15 23:52:16
言語 Java
(openjdk 23)
結果
AC  
実行時間 138 ms / 2,000 ms
コード長 771 bytes
コンパイル時間 2,256 ms
コンパイル使用メモリ 75,104 KB
実行使用メモリ 54,388 KB
最終ジャッジ日時 2024-07-22 23:18:10
合計ジャッジ時間 5,509 ms
ジャッジサーバーID
(参考情報)
judge4 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 16
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.io.FileNotFoundException;
import java.util.Arrays;
import java.util.Comparator;
import java.util.Scanner;

public class Main {
	public static void main(String[] args) throws FileNotFoundException {
		new Main().run();
	}

	void run() throws FileNotFoundException {
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		int m = sc.nextInt();
		String[] map = new String[n];
		for (int i = 0; i < n; ++i) {
			map[i] = sc.next();
		}
		for (int i = 0; i < n; ++i) {
			for (int j = 0; j + 4 <= map[i].length(); ++j) {
				if (map[i].substring(j, j + 4).equals("LOVE")) {
					System.out.println("YES");
					return;
				}
			}
		}
		System.out.println("NO");
	}

	void tr(Object... objects) {
		System.out.println(Arrays.deepToString(objects));
	}
}
0