結果

問題 No.700 LOVE
ユーザー 37zigen37zigen
提出日時 2018-06-15 23:52:16
言語 Java19
(openjdk 21)
結果
AC  
実行時間 131 ms / 2,000 ms
コード長 771 bytes
コンパイル時間 2,051 ms
コンパイル使用メモリ 72,076 KB
実行使用メモリ 56,196 KB
最終ジャッジ日時 2023-09-30 05:21:21
合計ジャッジ時間 5,522 ms
ジャッジサーバーID
(参考情報)
judge13 / judge15
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 120 ms
56,020 KB
testcase_01 AC 121 ms
56,196 KB
testcase_02 AC 123 ms
55,912 KB
testcase_03 AC 120 ms
55,564 KB
testcase_04 AC 124 ms
55,604 KB
testcase_05 AC 120 ms
55,848 KB
testcase_06 AC 122 ms
55,852 KB
testcase_07 AC 122 ms
55,568 KB
testcase_08 AC 123 ms
55,632 KB
testcase_09 AC 122 ms
55,628 KB
testcase_10 AC 126 ms
55,692 KB
testcase_11 AC 128 ms
55,744 KB
testcase_12 AC 127 ms
55,836 KB
testcase_13 AC 129 ms
55,500 KB
testcase_14 AC 131 ms
55,864 KB
testcase_15 AC 129 ms
55,844 KB
testcase_16 AC 128 ms
55,764 KB
testcase_17 AC 128 ms
55,572 KB
testcase_18 AC 126 ms
55,904 KB
権限があれば一括ダウンロードができます

ソースコード

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