結果

問題 No.975 ミスターマックスバリュ
ユーザー fura
提出日時 2020-02-04 23:26:27
言語 C++17
(gcc 13.3.0 + boost 1.87.0)
結果
AC  
実行時間 8 ms / 2,000 ms
コード長 441 bytes
コンパイル時間 1,759 ms
コンパイル使用メモリ 195,232 KB
最終ジャッジ日時 2025-01-08 22:08:04
ジャッジサーバーID
(参考情報)
judge5 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2
other AC * 9
権限があれば一括ダウンロードができます
コンパイルメッセージ
main.cpp: In function ‘int main()’:
main.cpp:8:25: warning: ignoring return value of ‘int scanf(const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
    8 |         int x,n,m; scanf("%d%d%d",&x,&n,&m);
      |                    ~~~~~^~~~~~~~~~~~~~~~~~~
main.cpp:10:23: warning: ignoring return value of ‘int scanf(const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
   10 |         rep(i,n) scanf("%d",&a[i]);
      |                  ~~~~~^~~~~~~~~~~~
main.cpp:11:23: warning: ignoring return value of ‘int scanf(const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
   11 |         rep(i,m) scanf("%d",&b[i]);
      |                  ~~~~~^~~~~~~~~~~~

ソースコード

diff #

#include <bits/stdc++.h>

#define rep(i,n) for(int i=0;i<(n);i++)

using namespace std;

int main(){
	int x,n,m; scanf("%d%d%d",&x,&n,&m);
	vector<int> a(n),b(m);
	rep(i,n) scanf("%d",&a[i]);
	rep(i,m) scanf("%d",&b[i]);

	bool ok1=find(a.begin(),a.end(),x)!=a.end();
	bool ok2=find(b.begin(),b.end(),x)!=b.end();
	if(ok1 && ok2) puts("MrMaxValu");
	else if(ok1) puts("MrMax");
	else if(ok2) puts("MaxValu");
	else puts("-1");

	return 0;
}
0