結果
| 問題 |
No.975 ミスターマックスバリュ
|
| ユーザー |
|
| 提出日時 | 2020-03-06 02:27:16 |
| 言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
| 結果 |
AC
|
| 実行時間 | 7 ms / 2,000 ms |
| コード長 | 410 bytes |
| コンパイル時間 | 152 ms |
| コンパイル使用メモリ | 23,168 KB |
| 実行使用メモリ | 5,248 KB |
| 最終ジャッジ日時 | 2024-10-14 02:32:08 |
| 合計ジャッジ時間 | 770 ms |
|
ジャッジサーバーID (参考情報) |
judge2 / judge4 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 2 |
| other | AC * 9 |
コンパイルメッセージ
main.cpp: In function ‘int main()’:
main.cpp:4:10: warning: ignoring return value of ‘int scanf(const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
4 | scanf("%d%d%d",&X,&N,&M);
| ~~~~~^~~~~~~~~~~~~~~~~~~
main.cpp:7:14: warning: ignoring return value of ‘int scanf(const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
7 | scanf("%d",&a);
| ~~~~~^~~~~~~~~
main.cpp:11:14: warning: ignoring return value of ‘int scanf(const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
11 | scanf("%d",&a);
| ~~~~~^~~~~~~~~
ソースコード
#include <cstdio>
int main(){
int X,N,M,a;
scanf("%d%d%d",&X,&N,&M);
bool A=false,B=false;
for(int i=0;i<N;i++){
scanf("%d",&a);
if(a==X)A=true;
}
for(int i=0;i<M;i++){
scanf("%d",&a);
if(a==X)B=true;
}
if(A&&B)printf("MrMaxValu\n");
if(A&&!B)printf("MrMax\n");
if(!A&&B)printf("MaxValu\n");
if(!A&&!B)printf("-1\n");
return 0;
}