結果

問題 No.700 LOVE
ユーザー pracodepracode
提出日時 2018-09-21 18:20:10
言語 C
(gcc 12.3.0)
結果
WA  
実行時間 -
コード長 627 bytes
コンパイル時間 119 ms
コンパイル使用メモリ 28,440 KB
実行使用メモリ 4,384 KB
最終ジャッジ日時 2023-09-25 10:46:49
合計ジャッジ時間 958 ms
ジャッジサーバーID
(参考情報)
judge12 / judge13
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 1 ms
4,380 KB
testcase_01 AC 0 ms
4,376 KB
testcase_02 AC 1 ms
4,376 KB
testcase_03 AC 0 ms
4,376 KB
testcase_04 WA -
testcase_05 WA -
testcase_06 AC 1 ms
4,376 KB
testcase_07 AC 0 ms
4,380 KB
testcase_08 WA -
testcase_09 AC 0 ms
4,380 KB
testcase_10 AC 1 ms
4,376 KB
testcase_11 WA -
testcase_12 WA -
testcase_13 WA -
testcase_14 AC 1 ms
4,376 KB
testcase_15 AC 1 ms
4,380 KB
testcase_16 AC 0 ms
4,380 KB
testcase_17 WA -
testcase_18 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <stdio.h>
#include <string.h>

int search(char s[],int sizeofs,char tg[],int sizeoftg);

int main()
{
    char s[2501],str[50];
    int n,m,i,res;
    scanf("%d%d",&n,&m);
    
    scanf("%s",s);
    for(i=1;i<n;i++){
        scanf("%s",str);
        strcat(s,str);
    }
    res=search(s,n*m,"LOVE",4);
    printf("%s\n",(res==0?"YES":"NO"));
    return 0;
}

int search(char s[],int sizeofs,char tg[],int sizeoftg)
{
    int ans;
    int i,j;
    char str[sizeoftg];
    
    for(i=0;i<sizeofs-4;i++){
        for(j=0;j<4;j++){
            str[j]=s[i+j];
        }
        ans=strcmp(str,tg);
    }
    return ans;
}
0