結果
| 問題 |
No.602 隠されていたゲーム2
|
| コンテスト | |
| ユーザー |
pin
|
| 提出日時 | 2017-12-02 02:35:49 |
| 言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 720 bytes |
| コンパイル時間 | 1,286 ms |
| コンパイル使用メモリ | 81,680 KB |
| 実行使用メモリ | 5,248 KB |
| 最終ジャッジ日時 | 2024-11-28 02:28:23 |
| 合計ジャッジ時間 | 2,177 ms |
|
ジャッジサーバーID (参考情報) |
judge3 / judge4 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 12 WA * 9 |
ソースコード
#include <iostream>
#include <iomanip>
#include <cstring>
#include <algorithm>
#include <math.h>
#include <queue>
#include <functional>
#include <map>
#include <vector>
#include <string>
using namespace std;
typedef long long ll;
ll n, x, y,d[100005];
int main(void){
cin >> n;
ll Min = 1000000005, Max = -1;
for (int i = 0; i < n; i++){
cin >> d[i];
Min = min(Min, d[i]); Max = max(Max, d[i]);
}
cin >> x >> y;
x = max(x, -x);
y = max(y, -y);
for (int i = 0; i < n; i++){
if (x + y == d[i]){
cout << 1 << endl;
return 0;
}
}
if (x + y < Min * 2 || x + y > Max * 2) cout << -1 << endl;
else cout << 2 << endl;
}
pin