結果

問題 No.2315 Flying Camera
ユーザー iwasikun8iwasikun8
提出日時 2023-05-26 21:27:50
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 351 bytes
コンパイル時間 294 ms
コンパイル使用メモリ 87,292 KB
実行使用メモリ 76,708 KB
最終ジャッジ日時 2023-08-26 10:15:00
合計ジャッジ時間 7,192 ms
ジャッジサーバーID
(参考情報)
judge14 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 72 ms
71,252 KB
testcase_01 AC 79 ms
76,112 KB
testcase_02 AC 82 ms
76,240 KB
testcase_03 WA -
testcase_04 WA -
testcase_05 WA -
testcase_06 WA -
testcase_07 WA -
testcase_08 WA -
testcase_09 WA -
testcase_10 WA -
testcase_11 WA -
testcase_12 AC 132 ms
76,340 KB
testcase_13 WA -
testcase_14 AC 348 ms
75,944 KB
testcase_15 AC 272 ms
76,380 KB
testcase_16 WA -
testcase_17 WA -
testcase_18 WA -
testcase_19 WA -
testcase_20 WA -
testcase_21 AC 210 ms
76,508 KB
testcase_22 WA -
testcase_23 AC 79 ms
76,300 KB
testcase_24 AC 369 ms
76,340 KB
testcase_25 AC 91 ms
76,056 KB
testcase_26 AC 381 ms
76,244 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

N = int(input())
X, Y = [], []
for i in range(N):
    x, y = map(int, input().split())
    X.append(x)
    Y.append(y)

Mx = max(X)
My = max(Y)
ans = float("inf")
for j in range(Mx+1):
    for k in range(My+1):
        tmp = 0
        for l in range(N):
            tmp += abs(X[l] - j) + abs(Y[l] - j)
        
        ans = min(ans, tmp)

print(ans)
0