結果

問題 No.1884 Sequence
ユーザー kaichou243kaichou243
提出日時 2022-03-25 23:34:48
言語 C++17
(gcc 13.2.0 + boost 1.83.0)
結果
WA  
実行時間 -
コード長 695 bytes
コンパイル時間 2,293 ms
コンパイル使用メモリ 202,260 KB
実行使用メモリ 7,272 KB
最終ジャッジ日時 2024-04-22 08:35:40
合計ジャッジ時間 6,851 ms
ジャッジサーバーID
(参考情報)
judge1 / judge2
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
5,248 KB
testcase_01 AC 2 ms
5,248 KB
testcase_02 AC 2 ms
5,248 KB
testcase_03 AC 2 ms
5,376 KB
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 WA -
testcase_08 AC 2 ms
5,376 KB
testcase_09 AC 2 ms
5,376 KB
testcase_10 AC 142 ms
7,020 KB
testcase_11 AC 142 ms
7,016 KB
testcase_12 WA -
testcase_13 WA -
testcase_14 AC 27 ms
5,376 KB
testcase_15 AC 88 ms
5,988 KB
testcase_16 WA -
testcase_17 WA -
testcase_18 AC 88 ms
5,996 KB
testcase_19 AC 69 ms
5,768 KB
testcase_20 AC 74 ms
6,116 KB
testcase_21 AC 56 ms
5,504 KB
testcase_22 AC 80 ms
6,120 KB
testcase_23 WA -
testcase_24 WA -
testcase_25 AC 135 ms
7,144 KB
testcase_26 AC 141 ms
7,020 KB
testcase_27 AC 33 ms
5,376 KB
testcase_28 AC 33 ms
5,376 KB
testcase_29 AC 32 ms
5,376 KB
testcase_30 AC 32 ms
5,376 KB
testcase_31 AC 73 ms
5,848 KB
testcase_32 AC 135 ms
7,012 KB
testcase_33 AC 131 ms
7,016 KB
testcase_34 AC 129 ms
7,012 KB
testcase_35 AC 39 ms
5,376 KB
testcase_36 AC 95 ms
5,996 KB
testcase_37 AC 129 ms
7,140 KB
testcase_38 AC 116 ms
7,016 KB
testcase_39 AC 53 ms
5,376 KB
testcase_40 AC 56 ms
5,504 KB
testcase_41 AC 115 ms
7,140 KB
testcase_42 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

#include<bits/stdc++.h>
using namespace std;
using ll=long long;
int main(){
    int n;
    cin>>n;
    vector<ll> a(n);
    ll mx=0,mn=1e18;
    vector<ll> t;
    ll cnt=0;
    for(int i=0;i<n;i++){
        cin>>a[i];
        if(a[i]!=0){
            mx=max(mx,a[i]);
            mn=min(mn,a[i]);
            t.push_back(a[i]);
        }else{
            cnt++;
        }
    }
    ll Mn=1e18;
    sort(t.begin(),t.end());
    for(int i=1;i<t.size();i++){
        Mn=min(Mn,t[i]-t[i-1]);
    }
    if(Mn==0){
        if(mx-mn==0) cout<<"Yes"<<endl;
        else cout<<"No"<<endl;
        return 0;
    }
    if((mx-mn)%Mn==0&&(mx-mn)/Mn-1ll<=cnt) cout<<"Yes"<<endl;
    else cout<<"No"<<endl;
}
0