結果

問題 No.2315 Flying Camera
ユーザー GlinTFrauleinGlinTFraulein
提出日時 2023-05-26 21:25:55
言語 C++17
(gcc 12.3.0 + boost 1.83.0)
結果
AC  
実行時間 154 ms / 2,000 ms
コード長 771 bytes
コンパイル時間 4,217 ms
コンパイル使用メモリ 259,280 KB
実行使用メモリ 4,384 KB
最終ジャッジ日時 2023-08-26 10:05:00
合計ジャッジ時間 6,797 ms
ジャッジサーバーID
(参考情報)
judge11 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 3 ms
4,380 KB
testcase_01 AC 3 ms
4,380 KB
testcase_02 AC 6 ms
4,380 KB
testcase_03 AC 96 ms
4,380 KB
testcase_04 AC 134 ms
4,380 KB
testcase_05 AC 112 ms
4,380 KB
testcase_06 AC 66 ms
4,376 KB
testcase_07 AC 131 ms
4,380 KB
testcase_08 AC 52 ms
4,380 KB
testcase_09 AC 15 ms
4,380 KB
testcase_10 AC 55 ms
4,380 KB
testcase_11 AC 136 ms
4,380 KB
testcase_12 AC 25 ms
4,376 KB
testcase_13 AC 12 ms
4,380 KB
testcase_14 AC 141 ms
4,376 KB
testcase_15 AC 98 ms
4,384 KB
testcase_16 AC 80 ms
4,380 KB
testcase_17 AC 47 ms
4,376 KB
testcase_18 AC 138 ms
4,384 KB
testcase_19 AC 106 ms
4,380 KB
testcase_20 AC 40 ms
4,384 KB
testcase_21 AC 74 ms
4,376 KB
testcase_22 AC 32 ms
4,380 KB
testcase_23 AC 2 ms
4,380 KB
testcase_24 AC 150 ms
4,380 KB
testcase_25 AC 4 ms
4,380 KB
testcase_26 AC 154 ms
4,376 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
#include <atcoder/all>
 
#define elif else if
#define ll long long
#define vll vector<long long>
#define vec vector
#define embk emplace_back
#define rep(i, n) for (ll i = 0; i < n; i++)
#define rep3(i, n, k) for (ll i = k; i < n; i++)
#define all(a) a.begin(), a.end()
#define YNeos(bool) (bool ? "Yes" : "No")
 
using namespace std;
using namespace atcoder;
const ll INF = 1LL << 60;
const ll mod = 998244353;
const double pi = acos(-1);

int main() {
  ll n; cin >> n;
  vll x(n), y(n); rep(i, n) cin >> x[i] >> y[i];
  ll ans = INF;

  rep3(i, 310, -310) {
    rep3(j, 310, -310) {
      ll anskamo = 0;
      rep(k, n) {
        anskamo += (abs(x[k]-i)+abs(y[k]-j));
      }
      ans = min(anskamo, ans);
    }
  }

  cout << ans << endl;
}
0