結果
問題 |
No.2856 Junk Market Game
|
ユーザー |
![]() |
提出日時 | 2024-09-04 16:01:11 |
言語 | PyPy3 (7.3.15) |
結果 |
AC
|
実行時間 | 60 ms / 2,000 ms |
コード長 | 359 bytes |
コンパイル時間 | 386 ms |
コンパイル使用メモリ | 82,400 KB |
実行使用メモリ | 63,448 KB |
最終ジャッジ日時 | 2024-09-04 16:01:16 |
合計ジャッジ時間 | 4,661 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 52 |
ソースコード
#N,M,K=map(int,input().split())\ # A=sorted(A,key=lambda x: x[1]) # A=sorted(A,key=lambda x: x[0]) N=int(input()) A=list(map(int, input().split())) B=list(map(int, input().split())) C=[] for i in range(2*N): C.append((A[i]+B[i],A[i],B[i],i)) C=sorted(C) ans=0 for i in range(2*N): p,q=C[i][1],C[i][2] if i%2==0: ans+=p else: ans-=q print(ans)