結果

問題 No.700 LOVE
ユーザー YamaKasaYamaKasa
提出日時 2018-07-15 22:19:10
言語 Java21
(openjdk 21)
結果
AC  
実行時間 137 ms / 2,000 ms
コード長 487 bytes
コンパイル時間 2,004 ms
コンパイル使用メモリ 71,488 KB
実行使用メモリ 56,296 KB
最終ジャッジ日時 2023-09-30 05:28:39
合計ジャッジ時間 5,458 ms
ジャッジサーバーID
(参考情報)
judge13 / judge15
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 126 ms
55,456 KB
testcase_01 AC 124 ms
55,668 KB
testcase_02 AC 126 ms
55,696 KB
testcase_03 AC 126 ms
55,948 KB
testcase_04 AC 125 ms
55,604 KB
testcase_05 AC 124 ms
56,208 KB
testcase_06 AC 124 ms
55,724 KB
testcase_07 AC 126 ms
56,296 KB
testcase_08 AC 125 ms
55,528 KB
testcase_09 AC 123 ms
56,188 KB
testcase_10 AC 137 ms
55,996 KB
testcase_11 AC 134 ms
55,416 KB
testcase_12 AC 135 ms
55,616 KB
testcase_13 AC 134 ms
55,588 KB
testcase_14 AC 137 ms
55,964 KB
testcase_15 AC 134 ms
55,580 KB
testcase_16 AC 136 ms
56,176 KB
testcase_17 AC 134 ms
55,384 KB
testcase_18 AC 132 ms
55,384 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.Scanner;

public class Main {
	public static void main(String[] args) {
		Scanner scan = new Scanner(System.in);
		int n = scan.nextInt();
		int m = scan.nextInt();
		String []s = new String[n];
		for(int i = 0; i < n; i++) {
			s[i] = scan.next();
			if(s[i].length() != m) {
				break;
			}
		}
		scan.close();
		for(int i = 0; i < n; i++) {
			if(s[i].matches(".*LOVE.*")) {
				System.out.println("YES");
				System.exit(0);
			}
		}
		System.out.println("NO");
	}
}
0