結果

問題 No.5017 Tool-assisted Shooting
ユーザー netyo715netyo715
提出日時 2023-07-16 15:48:17
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 398 ms / 2,000 ms
コード長 2,179 bytes
コンパイル時間 425 ms
コンパイル使用メモリ 87,108 KB
実行使用メモリ 100,400 KB
スコア 3,123,827
平均クエリ数 959.91
最終ジャッジ日時 2023-07-16 15:49:00
合計ジャッジ時間 42,850 ms
ジャッジサーバーID
(参考情報)
judge11 / judge12
純コード判定しない問題か言語
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 373 ms
97,392 KB
testcase_01 AC 231 ms
97,240 KB
testcase_02 AC 349 ms
97,960 KB
testcase_03 AC 390 ms
97,924 KB
testcase_04 AC 355 ms
98,732 KB
testcase_05 AC 361 ms
98,316 KB
testcase_06 AC 368 ms
97,880 KB
testcase_07 AC 371 ms
98,408 KB
testcase_08 AC 353 ms
98,812 KB
testcase_09 AC 358 ms
98,052 KB
testcase_10 AC 374 ms
97,844 KB
testcase_11 AC 347 ms
98,640 KB
testcase_12 AC 377 ms
98,656 KB
testcase_13 AC 377 ms
99,664 KB
testcase_14 AC 373 ms
97,700 KB
testcase_15 AC 354 ms
98,368 KB
testcase_16 AC 347 ms
98,344 KB
testcase_17 AC 358 ms
97,980 KB
testcase_18 AC 357 ms
98,472 KB
testcase_19 AC 362 ms
98,232 KB
testcase_20 AC 378 ms
98,996 KB
testcase_21 AC 359 ms
98,448 KB
testcase_22 AC 364 ms
97,492 KB
testcase_23 AC 363 ms
98,096 KB
testcase_24 AC 341 ms
97,608 KB
testcase_25 AC 361 ms
98,548 KB
testcase_26 AC 355 ms
97,884 KB
testcase_27 AC 348 ms
98,152 KB
testcase_28 AC 349 ms
97,960 KB
testcase_29 AC 351 ms
98,324 KB
testcase_30 AC 357 ms
98,816 KB
testcase_31 AC 188 ms
96,344 KB
testcase_32 AC 362 ms
99,044 KB
testcase_33 AC 346 ms
98,312 KB
testcase_34 AC 343 ms
98,032 KB
testcase_35 AC 364 ms
98,280 KB
testcase_36 AC 391 ms
97,820 KB
testcase_37 AC 178 ms
95,668 KB
testcase_38 AC 376 ms
97,388 KB
testcase_39 AC 351 ms
97,852 KB
testcase_40 AC 372 ms
98,136 KB
testcase_41 AC 360 ms
97,500 KB
testcase_42 AC 374 ms
97,488 KB
testcase_43 AC 357 ms
98,392 KB
testcase_44 AC 398 ms
98,316 KB
testcase_45 AC 359 ms
98,340 KB
testcase_46 AC 365 ms
99,084 KB
testcase_47 AC 376 ms
97,724 KB
testcase_48 AC 344 ms
97,620 KB
testcase_49 AC 352 ms
98,476 KB
testcase_50 AC 355 ms
98,280 KB
testcase_51 AC 366 ms
98,112 KB
testcase_52 AC 361 ms
98,588 KB
testcase_53 AC 363 ms
98,484 KB
testcase_54 AC 357 ms
99,324 KB
testcase_55 AC 184 ms
95,692 KB
testcase_56 AC 364 ms
98,864 KB
testcase_57 AC 371 ms
98,280 KB
testcase_58 AC 361 ms
98,516 KB
testcase_59 AC 354 ms
98,160 KB
testcase_60 AC 347 ms
98,892 KB
testcase_61 AC 348 ms
98,012 KB
testcase_62 AC 375 ms
98,512 KB
testcase_63 AC 382 ms
97,592 KB
testcase_64 AC 344 ms
98,132 KB
testcase_65 AC 227 ms
96,900 KB
testcase_66 AC 362 ms
97,896 KB
testcase_67 AC 379 ms
98,120 KB
testcase_68 AC 359 ms
98,124 KB
testcase_69 AC 362 ms
98,476 KB
testcase_70 AC 367 ms
98,544 KB
testcase_71 AC 357 ms
98,220 KB
testcase_72 AC 346 ms
98,344 KB
testcase_73 AC 347 ms
97,800 KB
testcase_74 AC 353 ms
98,120 KB
testcase_75 AC 350 ms
97,784 KB
testcase_76 AC 361 ms
98,852 KB
testcase_77 AC 377 ms
97,916 KB
testcase_78 AC 360 ms
98,336 KB
testcase_79 AC 363 ms
97,736 KB
testcase_80 AC 367 ms
98,744 KB
testcase_81 AC 346 ms
97,984 KB
testcase_82 AC 374 ms
98,580 KB
testcase_83 AC 373 ms
98,728 KB
testcase_84 AC 374 ms
100,400 KB
testcase_85 AC 359 ms
98,624 KB
testcase_86 AC 368 ms
98,216 KB
testcase_87 AC 363 ms
97,992 KB
testcase_88 AC 363 ms
98,656 KB
testcase_89 AC 339 ms
98,340 KB
testcase_90 AC 361 ms
97,864 KB
testcase_91 AC 374 ms
98,256 KB
testcase_92 AC 374 ms
98,608 KB
testcase_93 AC 356 ms
99,028 KB
testcase_94 AC 343 ms
98,600 KB
testcase_95 AC 377 ms
98,288 KB
testcase_96 AC 375 ms
98,396 KB
testcase_97 AC 348 ms
97,688 KB
testcase_98 AC 356 ms
97,176 KB
testcase_99 AC 362 ms
97,828 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

from collections import deque
from random import randint
H = 60
W = 25
board = deque([[[-1, -1] for _ in range(W)] for _ in range(H)])
level = 1
power = 0
jiki_w = 12
def min_dist(w1, w2):
    if w1 == w2:
        return 0, 0
    if w1 < w2:
        if w2-w1 <= 12:
            return w2-w1, 1
        else:
            return 25-(w2-w1), 2
    if w1 > w2:
        if w1-w2 <= 12:
            return w1-w2, 2
        else:
            return 25-(w1-w2), 1
    return -1, -1
for turn in range(1000):
    board.popleft()
    board.append([[-1, -1] for _ in range(W)])
    
    N = int(input())
    if N==-1:
        exit()
    for _ in range(N):
        h, p, x = map(int, input().split())
        board[59][x] = [h, p]
    
    next_w_dif = 30
    next_w = randint(0, W-1)
    for w in range(W):
        for h in range(H):
            hp, pow = board[h][w]
            if hp == -1:
                continue
            dist, d = min_dist(jiki_w, w)
            a_turn = h-dist
            if a_turn <= 0:
                continue
            if a_turn*level < hp:
                continue
            if dist < next_w_dif:
                next_w_dif = dist
                next_w = w
            break

    dist, d = min_dist(jiki_w, next_w)
    if d==1 and board[0][(jiki_w+1)%W][0] == board[1][(jiki_w+1)%W][0] == -1:
        print("R")
        jiki_w += 1
    elif d==2 and board[0][(jiki_w-1)%W][0] == board[1][(jiki_w-1)%W][0] == -1:
        print("L")
        jiki_w -= 1
    else:
        if board[1][jiki_w][0] > level:
            if board[0][(jiki_w-1)%W][0] == board[1][(jiki_w-1)%W][0] == -1:
                print("L")
                jiki_w -= 1
            elif board[0][(jiki_w+1)%W][0] == board[1][(jiki_w+1)%W][0] == -1:
                print("R")
                jiki_w += 1
            else:
                print("S")
        else:
            print("S")
    
    jiki_w %= W
    for h in range(H):
        if board[h][jiki_w][0] == -1:
            continue
        board[h][jiki_w][0] -= level
        if board[h][jiki_w][0] <= 0:
            power += board[h][jiki_w][1]
            level = 1+power//100
            board[h][jiki_w] = [-1, -1]
        break
0