結果

問題 No.2315 Flying Camera
ユーザー YwestbuilderkYwestbuilderk
提出日時 2024-01-24 19:54:51
言語 C++17
(gcc 12.3.0 + boost 1.83.0)
結果
TLE  
実行時間 -
コード長 360 bytes
コンパイル時間 2,301 ms
コンパイル使用メモリ 200,748 KB
実行使用メモリ 16,808 KB
最終ジャッジ日時 2024-01-24 19:55:00
合計ジャッジ時間 9,245 ms
ジャッジサーバーID
(参考情報)
judge14 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 TLE -
testcase_01 -- -
testcase_02 -- -
testcase_03 -- -
testcase_04 -- -
testcase_05 -- -
testcase_06 -- -
testcase_07 -- -
testcase_08 -- -
testcase_09 -- -
testcase_10 -- -
testcase_11 -- -
testcase_12 -- -
testcase_13 -- -
testcase_14 -- -
testcase_15 -- -
testcase_16 -- -
testcase_17 -- -
testcase_18 -- -
testcase_19 -- -
testcase_20 -- -
testcase_21 -- -
testcase_22 -- -
testcase_23 -- -
testcase_24 -- -
testcase_25 -- -
testcase_26 -- -
権限があれば一括ダウンロードができます

ソースコード

diff #

#include<bits/stdc++.h>
using namespace std;

int main(){
	int n;
	cin >> n;
	int x[n],y[n];
	for(int i = 0;i < n;i++) cin >> x[i] >> y[i];
	int ans = pow(10,9);
	for(int i = -300;i <= 600;i++){
		for(int j = -300;j <= 600;j++){
			int t = 0;
			for(int k = 0;k < n;i++){
				t += abs(x[i] - i) + abs(y[i] - j);
			}
			ans = min(ans,t);
		}
	}
	cout << ans;
}
0