結果
問題 |
No.609 Noelちゃんと星々
|
ユーザー |
|
提出日時 | 2019-08-19 02:20:50 |
言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 262 bytes |
コンパイル時間 | 2,308 ms |
コンパイル使用メモリ | 195,880 KB |
最終ジャッジ日時 | 2025-01-07 14:15:17 |
ジャッジサーバーID (参考情報) |
judge1 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | WA * 25 |
ソースコード
#include <bits/stdc++.h> using namespace std; typedef long long ll; int main() { int n; cin>>n; int a[n]; for (int i=0;i<n;i++) cin>>a[i]; sort(a,a+n); int ans=0; for (int x:a) ans+=abs(x-a[n/2]); cout<<ans<<endl; return 0; }