結果
問題 | No.975 ミスターマックスバリュ |
ユーザー |
![]() |
提出日時 | 2025-03-11 13:28:44 |
言語 | C (gcc 13.3.0) |
結果 |
AC
|
実行時間 | 7 ms / 2,000 ms |
コード長 | 486 bytes |
コンパイル時間 | 371 ms |
コンパイル使用メモリ | 25,088 KB |
実行使用メモリ | 7,328 KB |
最終ジャッジ日時 | 2025-03-11 13:28:46 |
合計ジャッジ時間 | 1,483 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 2 |
other | AC * 9 |
コンパイルメッセージ
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 %d",&x,&n,&m); | ^~~~~~~~~~~~~~~~~~~~~~~~~~ main.c:11:17: warning: ignoring return value of ‘scanf’ declared with attribute ‘warn_unused_result’ [-Wunused-result] 11 | scanf("%d",&num); | ^~~~~~~~~~~~~~~~ main.c:17:17: warning: ignoring return value of ‘scanf’ declared with attribute ‘warn_unused_result’ [-Wunused-result] 17 | scanf("%d",&num); | ^~~~~~~~~~~~~~~~
ソースコード
#include <stdio.h> #include <stdbool.h> int main(void){ int x,n,m; scanf("%d %d %d",&x,&n,&m); int num = 0; bool max = false; bool value = false; for(int i = 0;i < n;i++){ scanf("%d",&num); if(num == x){ max = true; } } for(int i = 0;i < m;i++){ scanf("%d",&num); if(num == x){ value = true; } } if(max && value){ printf("MrMaxValu"); }else if(max && !value){ printf("MrMax"); }else if(!max && value){ printf("MaxValu"); }else{ printf("-1"); } }