結果

問題 No.602 隠されていたゲーム2
ユーザー chocoruskchocorusk
提出日時 2019-07-07 18:55:12
言語 C++11
(gcc 11.4.0)
結果
WA  
実行時間 -
コード長 860 bytes
コンパイル時間 910 ms
コンパイル使用メモリ 98,276 KB
実行使用メモリ 6,948 KB
最終ジャッジ日時 2024-04-15 10:37:59
合計ジャッジ時間 2,864 ms
ジャッジサーバーID
(参考情報)
judge3 / judge5
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
5,248 KB
testcase_01 AC 2 ms
5,376 KB
testcase_02 AC 2 ms
5,376 KB
testcase_03 WA -
testcase_04 AC 2 ms
5,376 KB
testcase_05 AC 2 ms
5,376 KB
testcase_06 AC 2 ms
5,376 KB
testcase_07 AC 2 ms
5,376 KB
testcase_08 AC 2 ms
5,376 KB
testcase_09 AC 2 ms
5,376 KB
testcase_10 AC 3 ms
5,376 KB
testcase_11 AC 2 ms
5,376 KB
testcase_12 AC 2 ms
5,376 KB
testcase_13 AC 2 ms
5,376 KB
testcase_14 AC 2 ms
5,376 KB
testcase_15 WA -
testcase_16 WA -
testcase_17 AC 15 ms
5,376 KB
testcase_18 AC 34 ms
5,376 KB
testcase_19 AC 42 ms
5,376 KB
testcase_20 WA -
testcase_21 WA -
testcase_22 AC 42 ms
5,376 KB
testcase_23 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <cstdio>
#include <cstring>
#include <iostream>
#include <string>
#include <cmath>
#include <bitset>
#include <vector>
#include <map>
#include <set>
#include <queue>
#include <deque>
#include <algorithm>
#include <complex>
#include <unordered_map>
#include <unordered_set>
#include <random>
#include <cassert>
#include <fstream>
#define popcount __builtin_popcount
using namespace std;
typedef long long int ll;
typedef pair<int, int> P;

int main()
{
    int n, x, y;
    cin>>n;
    int d[100010];
    for(int i=0; i<n; i++) cin>>d[i];
    cin>>x>>y;
    if(x==0 && y==0){
        cout<<0<<endl;
        return 0;
    }
    for(int i=0; i<n; i++){
        if(abs(x)+abs(y)==d[i]){
            cout<<1<<endl;
            return 0;
        }
    }
    if(abs(x)+abs(y)<=2*(*max_element(d, d+n))) cout<<2<<endl;
    else cout<<-1<<endl;
    return 0;
}
0