結果

問題 No.1389 Clumsy Calculation
ユーザー auauaauaua
提出日時 2021-02-12 21:23:24
言語 C++14
(gcc 13.2.0 + boost 1.83.0)
結果
AC  
実行時間 84 ms / 2,000 ms
コード長 906 bytes
コンパイル時間 1,750 ms
コンパイル使用メモリ 166,756 KB
実行使用メモリ 4,856 KB
最終ジャッジ日時 2023-09-27 02:38:15
合計ジャッジ時間 4,287 ms
ジャッジサーバーID
(参考情報)
judge14 / judge11
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
4,380 KB
testcase_01 AC 2 ms
4,380 KB
testcase_02 AC 2 ms
4,380 KB
testcase_03 AC 2 ms
4,380 KB
testcase_04 AC 2 ms
4,380 KB
testcase_05 AC 3 ms
4,380 KB
testcase_06 AC 3 ms
4,376 KB
testcase_07 AC 3 ms
4,384 KB
testcase_08 AC 1 ms
4,376 KB
testcase_09 AC 84 ms
4,708 KB
testcase_10 AC 30 ms
4,524 KB
testcase_11 AC 3 ms
4,380 KB
testcase_12 AC 3 ms
4,380 KB
testcase_13 AC 2 ms
4,376 KB
testcase_14 AC 67 ms
4,672 KB
testcase_15 AC 67 ms
4,620 KB
testcase_16 AC 67 ms
4,604 KB
testcase_17 AC 72 ms
4,528 KB
testcase_18 AC 72 ms
4,652 KB
testcase_19 AC 72 ms
4,600 KB
testcase_20 AC 73 ms
4,736 KB
testcase_21 AC 72 ms
4,576 KB
testcase_22 AC 72 ms
4,612 KB
testcase_23 AC 72 ms
4,552 KB
testcase_24 AC 72 ms
4,856 KB
testcase_25 AC 72 ms
4,552 KB
testcase_26 AC 61 ms
4,604 KB
testcase_27 AC 67 ms
4,520 KB
testcase_28 AC 72 ms
4,656 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include<bits/stdc++.h>
using namespace std;
#define int long long
#define REP(i,m,n) for(int i=(m);i<(n);i++)
#define rep(i,n) REP(i,0,n)
#define pb push_back
#define all(a) a.begin(),a.end()
#define rall(c) (c).rbegin(),(c).rend()
#define mp make_pair
#define endl '\n'
#define vec vector<ll>
#define mat vector<vector<ll> >
#define fi first
#define se second
#define double long double
typedef long long ll;
typedef unsigned long long ull;
typedef pair<ll,ll> pll;
//typedef long double ld;
typedef complex<double> Complex;
const ll INF=1e9+7;
const ll inf=INF*INF;
const ll mod=998244353;
const ll MAX=140010;


signed main(){
    ll n;cin>>n;
    ll x;cin>>x;
    vector<ll>s(n);
    ll sum=0;
    rep(i,n){
        cin>>s[i];
        sum+=s[i];
    }
    rep(i,n){
        if(s[i]%2!=0)continue;
        if(sum-s[i]/2==x*(n-1)){
            cout<<s[i]/2<<endl;
            return 0;
        }
    }
}
0