結果

問題 No.5008 [Cherry Alpha] Discrete Pendulum with Air Resistance
ユーザー titia
提出日時 2022-10-15 01:06:39
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 1,988 ms / 2,000 ms
コード長 1,066 bytes
コンパイル時間 249 ms
実行使用メモリ 85,480 KB
スコア 318,680,103,667,950
最終ジャッジ日時 2022-10-15 01:08:29
合計ジャッジ時間 109,443 ms
ジャッジサーバーID
(参考情報)
judge13 / judge10
純コード判定しない問題か言語
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 50
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys
input = sys.stdin.readline
import time
time0=time.time()

N,K=map(int,input().split())
T=list(map(int,input().split()))
U=list(map(int,input().split()))

def location(b,t):
    u=t%(4*b)

    if u<=b:
        return u
    u-=b

    if u<=b<=3*b:
        return b-u

    u-=2*b

    return -b+u

def score_t(A):
    sc=0
    
    for i in range(N):
        for j in range(i+1,N):

            sc+=abs(A[i]-A[j])/(B[i]+B[j])

    return round(20000000*sc/50/49)

def score_u(A):
    MAX=0

    for i in range(N):
        for j in range(i+1,N):
            MAX=max(MAX,A[i]-A[j])

    return 10000000/((MAX/20+1)**(1/2))
            

from random import randint

maxscore=0
LA=[]

while time.time()-time0<1.9:
    B=[randint(1,500) for i in range(N)]

    sct=0
    scu=0

    for t in T:
        A=[location(B[i],t) for i in range(N)]

        sct+=score_t(A)

    for u in U:
        A=[location(B[i],t) for i in range(N)]

        scu+=score_u(A)

    if maxscore<sct*scu:
        maxscore=sct*scu
        LA=B

for la in LA:
    print(la,la,la)
        
0