結果
| 問題 |
No.700 LOVE
|
| コンテスト | |
| ユーザー |
Maeda
|
| 提出日時 | 2025-03-11 09:50:07 |
| 言語 | C (gcc 13.3.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 516 bytes |
| コンパイル時間 | 331 ms |
| コンパイル使用メモリ | 25,344 KB |
| 実行使用メモリ | 7,324 KB |
| 最終ジャッジ日時 | 2025-03-11 09:50:09 |
| 合計ジャッジ時間 | 1,531 ms |
|
ジャッジサーバーID (参考情報) |
judge1 / judge4 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 14 WA * 2 |
コンパイルメッセージ
main.c: In function ‘main’:
main.c:6:9: warning: ignoring return value of ‘scanf’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
6 | scanf("%d %d",&n,&m);
| ^~~~~~~~~~~~~~~~~~~~
main.c:11:13: warning: ignoring return value of ‘scanf’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
11 | scanf("%s",str);
| ^~~~~~~~~~~~~~~
ソースコード
#include <stdio.h>
#include <string.h>
#include <stdbool.h>
int main(void){
int n,m;
scanf("%d %d",&n,&m);
char str[1000] = "a";
char decision[100] = "a";
bool loveFlg = false;
for(int i = 0 ; i < n ; i ++){
scanf("%s",str);
if(loveFlg){
continue;
}
int j = 0;
while(str[j+4] != '\0'){
strncpy(decision, str+j, 4);
decision[4] = '\0';
if(strcmp(decision,"LOVE") == 0){
loveFlg = true;
break;
}
j++;
}
}
if(loveFlg){
printf("YES");
}else{
printf("NO");
}
}
Maeda