結果

問題 No.2315 Flying Camera
ユーザー 田中太郎田中太郎
提出日時 2023-07-19 00:46:57
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 451 bytes
コンパイル時間 174 ms
コンパイル使用メモリ 81,812 KB
実行使用メモリ 53,536 KB
最終ジャッジ日時 2023-10-19 03:51:49
合計ジャッジ時間 2,671 ms
ジャッジサーバーID
(参考情報)
judge15 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

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

ソースコード

diff #

n = int(input())

x = []
y = []        
for i in range(n):
    xi,yi = map(int,input().split())
    x.append(xi)
    y.append(yi)
    
x.sort()
y.sort()

if n%2 == 1:
    cx = x[n//2]
    cy = y[n//2]
    ans = 0
    for i in range(n):
        ans += abs(x[i]-cx)+abs(y[i]-cy)
    print(ans)

else:
    cx = (x[n//2-1]+x[n//2])/2
    cy = (y[n//2-1]+y[n//2])/2
    ans = 0
    for i in range(n):
        ans += abs(x[i]-cx)+abs(y[i]-cy)
    print(ans)
0