結果
問題 |
No.975 ミスターマックスバリュ
|
ユーザー |
|
提出日時 | 2020-04-04 18:00:13 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 18 ms / 2,000 ms |
コード長 | 1,751 bytes |
コンパイル時間 | 807 ms |
コンパイル使用メモリ | 96,072 KB |
実行使用メモリ | 6,944 KB |
最終ジャッジ日時 | 2024-07-03 07:33:42 |
合計ジャッジ時間 | 1,581 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 2 |
other | AC * 9 |
ソースコード
#include <iostream> #include <string> #include <algorithm> #include <vector> #include <iomanip> #include <cmath> #include <stdio.h> #include <queue> #include <deque> #include <cstdio> #include <set> #include <map> #include <bitset> #include <stack> #include <cctype> #define rep(i,N) for (int i = 0; i < (N); i++) using ll = long long; using lb = long double; using namespace std; const int mod = 1000000007; ll gcd(ll P, ll Q){ return Q ? gcd(Q,P % Q):P; } ll lcm(ll P, ll Q){ return P / gcd(P,Q) * Q; } string change_big(string str){ transform(str.begin(), str.end(), str.begin(), ::toupper); return str; } string change_small(string str){ transform(str.begin(), str.end(), str.begin(), ::tolower); return str; } bool is_prime(int x){ if(x<=1) return false; for(int i=2;i*i<=x;i++) if(x%i==0) return false; return true; } ll sum_of_num(ll num){ ll dig; ll sum = 0; while(num){ dig = num % 10; sum = sum + dig; num = num / 10; } return sum; } ll how_many_break(ll n, ll m){ ll counter = 0; while (n % m == 0){ n = n / m; counter++; } return counter; } /*------------------------------------------------------------------------------------*/ int main(){ ll N,M,S; cin >> S >> N >> M; ll P[N],Q[M]; for(ll i = 0; i < N; i++){ cin >> P[i]; } for(ll i = 0; i < M; i++){ cin >> Q[i]; } ll r = 0; ll x = 0; for(int i = 0; i < N; i++){ if(P[i] == S){ r++; } } for(int i = 0; i < M; i++){ if(Q[i] == S){ x++; } } if(r > 0 && x > 0){ cout << "MrMaxValu" << endl; } else if(r > 0){ cout << "MrMax" << endl; } else if(x > 0){ cout << "MaxValu" << endl; } else{ cout << "-1" << endl; } return 0; }