結果

問題 No.2315 Flying Camera
ユーザー ryohei22ryohei22
提出日時 2023-06-02 12:02:25
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 489 ms / 2,000 ms
コード長 233 bytes
コンパイル時間 684 ms
コンパイル使用メモリ 87,100 KB
実行使用メモリ 76,664 KB
最終ジャッジ日時 2023-08-28 02:19:14
合計ジャッジ時間 9,039 ms
ジャッジサーバーID
(参考情報)
judge11 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 89 ms
76,416 KB
testcase_01 AC 93 ms
76,412 KB
testcase_02 AC 96 ms
76,640 KB
testcase_03 AC 328 ms
76,444 KB
testcase_04 AC 428 ms
76,552 KB
testcase_05 AC 371 ms
76,432 KB
testcase_06 AC 240 ms
76,508 KB
testcase_07 AC 428 ms
76,416 KB
testcase_08 AC 200 ms
76,484 KB
testcase_09 AC 115 ms
76,416 KB
testcase_10 AC 206 ms
76,596 KB
testcase_11 AC 429 ms
76,376 KB
testcase_12 AC 144 ms
76,504 KB
testcase_13 AC 114 ms
76,488 KB
testcase_14 AC 449 ms
76,200 KB
testcase_15 AC 332 ms
76,212 KB
testcase_16 AC 279 ms
76,504 KB
testcase_17 AC 189 ms
76,236 KB
testcase_18 AC 435 ms
76,484 KB
testcase_19 AC 347 ms
76,344 KB
testcase_20 AC 164 ms
76,664 KB
testcase_21 AC 247 ms
76,464 KB
testcase_22 AC 152 ms
76,212 KB
testcase_23 AC 89 ms
76,448 KB
testcase_24 AC 489 ms
76,580 KB
testcase_25 AC 85 ms
76,412 KB
testcase_26 AC 458 ms
76,304 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

N = int(input())
XY = [tuple(map(int, input().split())) for _ in range(N)]

ans = float('inf')
for x in range(1, 301):
	for y in range(1, 301):
		s = 0
		for X, Y in XY:
			s += abs(x - X) + abs(y - Y)
		ans = min(ans, s)
print(ans)
0