結果
| 問題 |
No.700 LOVE
|
| コンテスト | |
| ユーザー |
Maeda
|
| 提出日時 | 2025-03-11 09:55:55 |
| 言語 | C (gcc 13.3.0) |
| 結果 |
AC
|
| 実行時間 | 1 ms / 2,000 ms |
| コード長 | 420 bytes |
| コンパイル時間 | 292 ms |
| コンパイル使用メモリ | 24,960 KB |
| 実行使用メモリ | 7,328 KB |
| 最終ジャッジ日時 | 2025-03-11 09:55:57 |
| 合計ジャッジ時間 | 1,497 ms |
|
ジャッジサーバーID (参考情報) |
judge5 / judge3 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 16 |
コンパイルメッセージ
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;
}
char *result = strstr(str,"LOVE");
if(result != NULL) {
loveFlg = true;
}
}
if(loveFlg){
printf("YES");
}else{
printf("NO");
}
}
Maeda