結果
問題 |
No.975 ミスターマックスバリュ
|
ユーザー |
![]() |
提出日時 | 2020-03-20 20:26:11 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 22 ms / 2,000 ms |
コード長 | 676 bytes |
コンパイル時間 | 1,666 ms |
コンパイル使用メモリ | 169,756 KB |
実行使用メモリ | 6,820 KB |
最終ジャッジ日時 | 2024-12-14 17:26:31 |
合計ジャッジ時間 | 2,260 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 2 |
other | AC * 9 |
ソースコード
#include <bits/stdc++.h> using namespace std; using ll = long long; using P = pair<int, int>; using PL = pair<ll, ll>; // Welcome to my source code! int main() { int x, n, m; cin >> x >> n >> m; int a[n], b[m]; for (int i = 0; i < n; i++) cin >> a[i]; for (int i = 0; i < m; i++) cin >> b[i]; sort(a, a+n); sort(b, b+m); bool flag_a = false, flag_b = false; if (x == *lower_bound(a, a+n, x)) flag_a = true; if (x == *lower_bound(b, b+m, x)) flag_b = true; if (flag_a && flag_b) cout << "MrMaxValu" << endl; else if (flag_a) cout << "MrMax" << endl; else if (flag_b) cout << "MaxValu" << endl; else cout << -1 << endl; }