結果

問題 No.1919 Many Monster Battles
ユーザー とりゐとりゐ
提出日時 2022-04-04 00:02:23
言語 PyPy3
(7.3.15)
結果
TLE  
実行時間 -
コード長 290 bytes
コンパイル時間 330 ms
コンパイル使用メモリ 87,132 KB
実行使用メモリ 137,768 KB
最終ジャッジ日時 2023-09-02 13:45:04
合計ジャッジ時間 8,872 ms
ジャッジサーバーID
(参考情報)
judge11 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 71 ms
75,540 KB
testcase_01 AC 72 ms
71,516 KB
testcase_02 AC 72 ms
71,456 KB
testcase_03 AC 163 ms
76,656 KB
testcase_04 AC 124 ms
76,872 KB
testcase_05 AC 124 ms
76,808 KB
testcase_06 AC 124 ms
76,964 KB
testcase_07 AC 125 ms
76,868 KB
testcase_08 AC 128 ms
76,904 KB
testcase_09 AC 125 ms
76,784 KB
testcase_10 AC 123 ms
76,752 KB
testcase_11 AC 123 ms
76,952 KB
testcase_12 AC 124 ms
76,808 KB
testcase_13 TLE -
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 -- -
testcase_27 -- -
testcase_28 -- -
testcase_29 -- -
testcase_30 -- -
testcase_31 -- -
testcase_32 -- -
testcase_33 -- -
testcase_34 -- -
権限があれば一括ダウンロードができます

ソースコード

diff #

n=int(input())
a=list(map(int,input().split()))
b=list(map(int,input().split()))

ans1,ans2=0,0
mod=10**9+7
for i in range(n):
  for j in range(n):
    A=abs(a[i]-a[j])
    B=abs(b[i]-b[j])
    if A>B:
      ans1+=A
      ans1%=mod
    if A<B:
      ans2+=B
      ans2%=mod
print(ans1,ans2)
0