結果

問題 No.5008 [Cherry Alpha] Discrete Pendulum with Air Resistance
ユーザー titia
提出日時 2022-10-15 01:17:48
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 1,931 ms / 2,000 ms
コード長 1,079 bytes
コンパイル時間 236 ms
実行使用メモリ 84,880 KB
スコア 1,350,776,934,424,640
最終ジャッジ日時 2022-10-15 01:19:35
合計ジャッジ時間 106,117 ms
ジャッジサーバーID
(参考情報)
judge14 / 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.85:
    B=[randint(1,6) for i in range(N)]
    B.sort()

    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