結果
問題 | No.1389 Clumsy Calculation |
ユーザー |
|
提出日時 | 2021-02-12 22:29:36 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 90 ms / 2,000 ms |
コード長 | 857 bytes |
コンパイル時間 | 983 ms |
コンパイル使用メモリ | 92,592 KB |
実行使用メモリ | 6,528 KB |
最終ジャッジ日時 | 2024-07-19 23:04:50 |
合計ジャッジ時間 | 3,563 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 26 |
ソースコード
#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;}