結果
| 問題 |
No.198 キャンディー・ボックス2
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2016-07-06 08:51:23 |
| 言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 445 bytes |
| コンパイル時間 | 494 ms |
| コンパイル使用メモリ | 60,732 KB |
| 実行使用メモリ | 6,824 KB |
| 最終ジャッジ日時 | 2024-10-12 20:25:32 |
| 合計ジャッジ時間 | 1,426 ms |
|
ジャッジサーバーID (参考情報) |
judge2 / judge5 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 4 |
| other | AC * 11 WA * 15 |
ソースコード
#include <iostream>
#include <vector>
using namespace std;
typedef long long ll;
int main(){
ll b,n,c;
cin>>b;
cin>>n;
vector<ll> vc;
ll s,a;
s=0;
for(int i=0; i<n; ++i){
cin>>c;
vc.push_back(c);
s+=c;
}
a=s/n;
vector<ll> vd;
ll m;
m=n;
for(int i=0; i<n; ++i){
ll e;
e=abs(vc[i]-a);
vd.push_back(e);
}
ll x;
x=0;
for(int i=0; i<n; ++i){
x+=vd[i];
}
cout<<x<<endl;
return 0;
}