結果

問題 No.5017 Tool-assisted Shooting
ユーザー netyo715netyo715
提出日時 2023-07-16 15:27:53
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 318 ms / 2,000 ms
コード長 1,731 bytes
コンパイル時間 470 ms
コンパイル使用メモリ 87,200 KB
実行使用メモリ 98,068 KB
スコア 26,993
平均クエリ数 151.93
最終ジャッジ日時 2023-07-16 15:28:19
合計ジャッジ時間 24,883 ms
ジャッジサーバーID
(参考情報)
judge12 / judge13
純コード判定しない問題か言語
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 182 ms
96,096 KB
testcase_01 AC 232 ms
95,744 KB
testcase_02 AC 183 ms
95,976 KB
testcase_03 AC 179 ms
95,884 KB
testcase_04 AC 174 ms
95,984 KB
testcase_05 AC 179 ms
96,032 KB
testcase_06 AC 286 ms
97,016 KB
testcase_07 AC 191 ms
95,828 KB
testcase_08 AC 160 ms
95,796 KB
testcase_09 AC 191 ms
96,120 KB
testcase_10 AC 180 ms
96,096 KB
testcase_11 AC 185 ms
96,224 KB
testcase_12 AC 229 ms
96,560 KB
testcase_13 AC 169 ms
95,828 KB
testcase_14 AC 178 ms
96,332 KB
testcase_15 AC 176 ms
95,840 KB
testcase_16 AC 173 ms
96,160 KB
testcase_17 AC 218 ms
96,144 KB
testcase_18 AC 218 ms
96,544 KB
testcase_19 AC 183 ms
95,588 KB
testcase_20 AC 178 ms
96,736 KB
testcase_21 AC 170 ms
96,108 KB
testcase_22 AC 186 ms
96,084 KB
testcase_23 AC 215 ms
96,992 KB
testcase_24 AC 207 ms
96,752 KB
testcase_25 AC 221 ms
96,172 KB
testcase_26 AC 190 ms
95,920 KB
testcase_27 AC 213 ms
96,076 KB
testcase_28 AC 214 ms
96,020 KB
testcase_29 AC 230 ms
96,964 KB
testcase_30 AC 177 ms
96,020 KB
testcase_31 AC 163 ms
95,672 KB
testcase_32 AC 190 ms
96,244 KB
testcase_33 AC 163 ms
95,544 KB
testcase_34 AC 176 ms
95,576 KB
testcase_35 AC 165 ms
95,996 KB
testcase_36 AC 182 ms
96,328 KB
testcase_37 AC 176 ms
95,588 KB
testcase_38 AC 185 ms
96,056 KB
testcase_39 AC 219 ms
98,068 KB
testcase_40 AC 177 ms
96,472 KB
testcase_41 AC 167 ms
95,840 KB
testcase_42 AC 175 ms
96,044 KB
testcase_43 AC 192 ms
96,312 KB
testcase_44 AC 191 ms
95,908 KB
testcase_45 AC 184 ms
96,296 KB
testcase_46 AC 180 ms
96,536 KB
testcase_47 AC 178 ms
96,288 KB
testcase_48 AC 246 ms
96,536 KB
testcase_49 AC 197 ms
95,968 KB
testcase_50 AC 198 ms
95,416 KB
testcase_51 AC 192 ms
96,384 KB
testcase_52 AC 205 ms
96,232 KB
testcase_53 AC 175 ms
96,020 KB
testcase_54 AC 198 ms
95,772 KB
testcase_55 AC 189 ms
95,548 KB
testcase_56 AC 201 ms
96,580 KB
testcase_57 AC 184 ms
95,860 KB
testcase_58 AC 208 ms
96,140 KB
testcase_59 AC 184 ms
96,424 KB
testcase_60 AC 168 ms
96,312 KB
testcase_61 AC 182 ms
95,688 KB
testcase_62 AC 186 ms
96,144 KB
testcase_63 AC 199 ms
96,084 KB
testcase_64 AC 215 ms
95,892 KB
testcase_65 AC 187 ms
95,744 KB
testcase_66 AC 178 ms
96,040 KB
testcase_67 AC 183 ms
95,892 KB
testcase_68 AC 192 ms
96,220 KB
testcase_69 AC 183 ms
96,148 KB
testcase_70 AC 186 ms
96,016 KB
testcase_71 AC 218 ms
96,328 KB
testcase_72 AC 217 ms
96,336 KB
testcase_73 AC 184 ms
96,112 KB
testcase_74 AC 164 ms
96,196 KB
testcase_75 AC 170 ms
96,172 KB
testcase_76 AC 186 ms
95,920 KB
testcase_77 AC 216 ms
96,440 KB
testcase_78 AC 173 ms
96,076 KB
testcase_79 AC 239 ms
96,692 KB
testcase_80 AC 224 ms
95,984 KB
testcase_81 AC 193 ms
95,884 KB
testcase_82 AC 162 ms
95,888 KB
testcase_83 AC 174 ms
96,588 KB
testcase_84 AC 198 ms
97,524 KB
testcase_85 AC 183 ms
95,832 KB
testcase_86 AC 175 ms
95,876 KB
testcase_87 AC 178 ms
95,804 KB
testcase_88 AC 198 ms
95,548 KB
testcase_89 AC 242 ms
97,032 KB
testcase_90 AC 167 ms
96,160 KB
testcase_91 AC 177 ms
96,144 KB
testcase_92 AC 201 ms
96,644 KB
testcase_93 AC 209 ms
96,176 KB
testcase_94 AC 191 ms
95,984 KB
testcase_95 AC 318 ms
97,404 KB
testcase_96 AC 174 ms
95,896 KB
testcase_97 AC 176 ms
96,004 KB
testcase_98 AC 173 ms
95,292 KB
testcase_99 AC 183 ms
96,312 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

    dist, d = min_dist(jiki_w, next_w)
    if d==1 and board[0][(jiki_w+1)%W][0] == -1:
        print("R")
        jiki_w += 1
    elif d==2 and board[0][(jiki_w-1)%W][0] == -1:
        print("L")
        jiki_w -= 1
    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