結果

問題 No.700 LOVE
ユーザー suppy193
提出日時 2023-09-09 21:38:13
言語 C90
(gcc 12.3.0)
結果
AC  
実行時間 1 ms / 2,000 ms
コード長 350 bytes
コンパイル時間 762 ms
コンパイル使用メモリ 20,352 KB
実行使用メモリ 5,376 KB
最終ジャッジ日時 2024-06-27 14:08:32
合計ジャッジ時間 1,597 ms
ジャッジサーバーID
(参考情報)
judge5 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 16
権限があれば一括ダウンロードができます
コンパイルメッセージ
main.c: In function ‘main’:
main.c:9:9: warning: ignoring return value of ‘scanf’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
    9 |         scanf("%d%d", &n, &m);
      |         ^~~~~~~~~~~~~~~~~~~~~
main.c:13:25: warning: ignoring return value of ‘scanf’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
   13 |                         scanf("%s", s);
      |                         ^~~~~~~~~~~~~~

ソースコード

diff #

#include<stdio.h>

int main(void){
	
	int n, m;
	int i, j;
	char s[50];
	
	scanf("%d%d", &n, &m);
	
	if(m >= 4){
		for(j = 0;j < n;j++){
			scanf("%s", s);
			for(i = 0;i <= m - 4;i++){
				if(s[i] == 'L' && s[i + 1] == 'O' && s[i + 2] == 'V' && s[i + 3] == 'E'){
					printf("YES\n");
					return 0;
				}
			}

		}
	}
	printf("NO\n");

	return 0;
}
0