結果
| 問題 | No.700 LOVE | 
| コンテスト | |
| ユーザー |  sk3388607083 | 
| 提出日時 | 2018-06-24 13:23:52 | 
| 言語 | C++11(廃止可能性あり) (gcc 13.3.0) | 
| 結果 | 
                                WA
                                 
                            (最新) 
                                AC
                                 
                            (最初) | 
| 実行時間 | - | 
| コード長 | 449 bytes | 
| コンパイル時間 | 123 ms | 
| コンパイル使用メモリ | 23,552 KB | 
| 実行使用メモリ | 6,944 KB | 
| 最終ジャッジ日時 | 2024-06-30 22:26:22 | 
| 合計ジャッジ時間 | 928 ms | 
| ジャッジサーバーID (参考情報) | judge1 / judge5 | 
(要ログイン)
| ファイルパターン | 結果 | 
|---|---|
| sample | AC * 3 | 
| other | AC * 14 WA * 2 | 
コンパイルメッセージ
main.cpp: In function ‘int main()’:
main.cpp:9:8: warning: ignoring return value of ‘int scanf(const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
    9 |   scanf("%d %d", &n, &m);
      |   ~~~~~^~~~~~~~~~~~~~~~~
main.cpp:11:10: warning: ignoring return value of ‘int scanf(const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
   11 |     scanf("%s", s);
      |     ~~~~~^~~~~~~~~
            
            ソースコード
#include<stdio.h>
#include<string.h>
int main(void){
  int i, j;
  int n, m;
  char s[51], s1[5];
  int flag = 0;
  scanf("%d %d", &n, &m);
  for(i = 0; i < n; i++){
    scanf("%s", s);
    for(j = 0; j < m - 4; j++){
      s1[0] = s[j];
      s1[1] = s[j+1];
      s1[2] = s[j+2];
      s1[3] = s[j+3];
      s1[4] = '\0';
      if(strcmp(s1, "LOVE") == 0) flag = 1;
    }
  }
  if(flag == 1) printf("YES\n");
  else printf("NO\n");
  return 0;
}
            
            
            
        