結果
問題 | No.2315 Flying Camera |
ユーザー |
|
提出日時 | 2023-06-01 15:08:18 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 3 ms / 2,000 ms |
コード長 | 369 bytes |
コンパイル時間 | 2,264 ms |
コンパイル使用メモリ | 170,636 KB |
実行使用メモリ | 5,248 KB |
最終ジャッジ日時 | 2024-12-28 14:58:29 |
合計ジャッジ時間 | 2,888 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 24 |
ソースコード
#include <bits/stdc++.h>using namespace std;int main(){int n;cin >> n;vector<int> x(n), y(n);for (int i = 0; i < n; i++)cin >> x[i] >> y[i];sort(x.begin(), x.end());sort(y.begin(), y.end());int ans = 0;for (int i = 0; i < n; i++)ans += abs(x[i] - x[n / 2]) + abs(y[i] - y[n / 2]);cout << ans << endl;}