結果
| 問題 | No.3527 Minimum Abs Sum |
| コンテスト | |
| ユーザー |
titia
|
| 提出日時 | 2026-05-06 06:11:45 |
| 言語 | Python3 (3.14.7 + numpy 2.5.2 + scipy 1.18.0 + ACL) |
| 結果 |
WA
不安定
|
| 実行時間 | - |
| コード長 | 479 bytes |
| 記録 | |
| コンパイル時間 | 384 ms |
| コンパイル使用メモリ | 15,232 KB |
| 実行使用メモリ | 65,240 KB |
| 最終ジャッジ日時 | 2026-09-19 11:29:58 |
| 合計ジャッジ時間 | 8,450 ms |
|
ジャッジサーバーID (参考情報) |
judge1_0 / judge3_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | WA * 31 |
ソースコード
import sys
input = sys.stdin.readline
from collections import Counter
mod=10**9+7
N=int(input())
A=list(map(int,input().split()))
B=list(map(int,input().split()))
C=Counter()
for i in range(N):
a,b=A[i],B[i]
if a==0:
continue
if a<0:
a=-a
b=-b
C[a,b]+=a
MAX=max(C.values())
LIST=[]
for c in C:
if C[c]==MAX:
LIST.append(c)
ANS=min(LIST,key=lambda x:x[1]/x[0])
LANS=ANS[1]*pow(ANS[0],mod-2,mod)%mod
print(LANS)
titia