結果

問題 No.1389 Clumsy Calculation
ユーザー mtmtmtmtmtmtmtmtmtmt
提出日時 2021-02-12 22:29:36
言語 C++14
(gcc 13.2.0 + boost 1.83.0)
結果
AC  
実行時間 78 ms / 2,000 ms
コード長 857 bytes
コンパイル時間 642 ms
コンパイル使用メモリ 92,388 KB
実行使用メモリ 6,488 KB
最終ジャッジ日時 2023-09-27 05:07:01
合計ジャッジ時間 3,308 ms
ジャッジサーバーID
(参考情報)
judge15 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
4,376 KB
testcase_01 AC 1 ms
4,376 KB
testcase_02 AC 1 ms
4,380 KB
testcase_03 AC 2 ms
4,376 KB
testcase_04 AC 2 ms
4,376 KB
testcase_05 AC 2 ms
4,376 KB
testcase_06 AC 2 ms
4,376 KB
testcase_07 AC 2 ms
4,380 KB
testcase_08 AC 2 ms
4,380 KB
testcase_09 AC 78 ms
6,276 KB
testcase_10 AC 29 ms
6,332 KB
testcase_11 AC 2 ms
4,376 KB
testcase_12 AC 2 ms
4,376 KB
testcase_13 AC 2 ms
4,376 KB
testcase_14 AC 62 ms
6,152 KB
testcase_15 AC 63 ms
6,200 KB
testcase_16 AC 62 ms
6,320 KB
testcase_17 AC 65 ms
6,224 KB
testcase_18 AC 67 ms
6,292 KB
testcase_19 AC 69 ms
6,168 KB
testcase_20 AC 67 ms
6,212 KB
testcase_21 AC 68 ms
6,172 KB
testcase_22 AC 69 ms
6,212 KB
testcase_23 AC 68 ms
6,220 KB
testcase_24 AC 69 ms
6,164 KB
testcase_25 AC 70 ms
6,488 KB
testcase_26 AC 57 ms
6,160 KB
testcase_27 AC 64 ms
6,176 KB
testcase_28 AC 69 ms
6,272 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <iostream>
#include <stdlib.h>
#include <stdio.h>
#include <vector>
#include <unordered_set>
#include <map>
#include <utility>
#include <list>
#include <math.h>
#include <algorithm>
#include <numeric>
#include <bitset>

typedef long long ll;
const int INF=10000;
using namespace std;
/*
int binary(int a){
    for (int i=0;a>0;i++)
    {
        ans=ans+(a%2)*pow(10,i);
        a=a/2;
    }
    return ans;
}*/
ll dx[4]={0,1,0,1};
ll dy[4]={0,0,1,1};

int main(){
    ll n;
    ll x;
    cin>>n>>x;
    vector<ll> S(n);
    vector<ll> ans(n);
    ll aaa=0;
    for(int i=0;i<n;i++)
    {
        cin>>S[i];
        ans[i]=x-S[i];
        aaa+=S[i];
//        aaa[i]=(x-ans[i])/2;
    }
    for(int i=0;i<n;i++)
    {
        if(aaa-S[i]/2==x*(n-1))
        {
            cout<<S[i]/2<<endl;
            return 0;
        }
    }
 //   return 0;

}
0