結果
問題 | No.5017 Tool-assisted Shooting |
ユーザー | とろちゃ |
提出日時 | 2023-07-16 15:22:39 |
言語 | PyPy3 (7.3.15) |
結果 |
AC
|
実行時間 | 220 ms / 2,000 ms |
コード長 | 2,534 bytes |
コンパイル時間 | 607 ms |
コンパイル使用メモリ | 87,232 KB |
実行使用メモリ | 94,880 KB |
スコア | 162,490 |
平均クエリ数 | 727.33 |
最終ジャッジ日時 | 2023-07-16 15:23:04 |
合計ジャッジ時間 | 22,867 ms |
ジャッジサーバーID (参考情報) |
judge13 / judge15 |
純コード判定しない問題か言語 |
(要ログイン)
テストケース
テストケース表示入力 | 結果 | 実行時間 実行使用メモリ |
---|---|---|
testcase_00 | AC | 196 ms
93,376 KB |
testcase_01 | AC | 199 ms
93,400 KB |
testcase_02 | AC | 196 ms
93,616 KB |
testcase_03 | AC | 198 ms
93,896 KB |
testcase_04 | AC | 138 ms
92,528 KB |
testcase_05 | AC | 141 ms
93,056 KB |
testcase_06 | AC | 113 ms
92,740 KB |
testcase_07 | AC | 143 ms
92,912 KB |
testcase_08 | AC | 197 ms
93,460 KB |
testcase_09 | AC | 128 ms
92,632 KB |
testcase_10 | AC | 138 ms
93,092 KB |
testcase_11 | AC | 118 ms
92,292 KB |
testcase_12 | AC | 158 ms
93,564 KB |
testcase_13 | AC | 196 ms
93,584 KB |
testcase_14 | AC | 204 ms
93,880 KB |
testcase_15 | AC | 194 ms
93,512 KB |
testcase_16 | AC | 189 ms
93,264 KB |
testcase_17 | AC | 204 ms
94,532 KB |
testcase_18 | AC | 187 ms
93,700 KB |
testcase_19 | AC | 138 ms
92,356 KB |
testcase_20 | AC | 195 ms
94,036 KB |
testcase_21 | AC | 196 ms
93,776 KB |
testcase_22 | AC | 139 ms
93,104 KB |
testcase_23 | AC | 205 ms
93,548 KB |
testcase_24 | AC | 140 ms
92,780 KB |
testcase_25 | AC | 134 ms
92,692 KB |
testcase_26 | AC | 139 ms
92,556 KB |
testcase_27 | AC | 192 ms
93,676 KB |
testcase_28 | AC | 210 ms
94,240 KB |
testcase_29 | AC | 193 ms
93,348 KB |
testcase_30 | AC | 139 ms
92,892 KB |
testcase_31 | AC | 205 ms
93,364 KB |
testcase_32 | AC | 202 ms
93,804 KB |
testcase_33 | AC | 122 ms
92,176 KB |
testcase_34 | AC | 188 ms
93,328 KB |
testcase_35 | AC | 192 ms
93,504 KB |
testcase_36 | AC | 145 ms
92,980 KB |
testcase_37 | AC | 208 ms
93,024 KB |
testcase_38 | AC | 113 ms
92,156 KB |
testcase_39 | AC | 190 ms
93,560 KB |
testcase_40 | AC | 195 ms
93,224 KB |
testcase_41 | AC | 195 ms
93,112 KB |
testcase_42 | AC | 163 ms
93,528 KB |
testcase_43 | AC | 164 ms
93,140 KB |
testcase_44 | AC | 210 ms
94,780 KB |
testcase_45 | AC | 193 ms
93,376 KB |
testcase_46 | AC | 194 ms
93,856 KB |
testcase_47 | AC | 203 ms
93,472 KB |
testcase_48 | AC | 207 ms
93,608 KB |
testcase_49 | AC | 186 ms
93,324 KB |
testcase_50 | AC | 198 ms
93,528 KB |
testcase_51 | AC | 192 ms
93,964 KB |
testcase_52 | AC | 189 ms
93,228 KB |
testcase_53 | AC | 127 ms
92,236 KB |
testcase_54 | AC | 220 ms
93,992 KB |
testcase_55 | AC | 150 ms
93,332 KB |
testcase_56 | AC | 113 ms
92,516 KB |
testcase_57 | AC | 187 ms
93,572 KB |
testcase_58 | AC | 166 ms
93,220 KB |
testcase_59 | AC | 207 ms
94,252 KB |
testcase_60 | AC | 160 ms
92,932 KB |
testcase_61 | AC | 192 ms
92,968 KB |
testcase_62 | AC | 189 ms
93,252 KB |
testcase_63 | AC | 123 ms
92,012 KB |
testcase_64 | AC | 118 ms
92,072 KB |
testcase_65 | AC | 207 ms
94,880 KB |
testcase_66 | AC | 135 ms
92,596 KB |
testcase_67 | AC | 200 ms
93,784 KB |
testcase_68 | AC | 196 ms
93,820 KB |
testcase_69 | AC | 127 ms
92,400 KB |
testcase_70 | AC | 112 ms
92,816 KB |
testcase_71 | AC | 190 ms
93,856 KB |
testcase_72 | AC | 124 ms
92,832 KB |
testcase_73 | AC | 187 ms
93,528 KB |
testcase_74 | AC | 142 ms
92,484 KB |
testcase_75 | AC | 187 ms
93,332 KB |
testcase_76 | AC | 193 ms
93,748 KB |
testcase_77 | AC | 123 ms
92,684 KB |
testcase_78 | AC | 138 ms
92,100 KB |
testcase_79 | AC | 167 ms
93,676 KB |
testcase_80 | AC | 122 ms
92,832 KB |
testcase_81 | AC | 194 ms
93,288 KB |
testcase_82 | AC | 197 ms
93,288 KB |
testcase_83 | AC | 192 ms
94,060 KB |
testcase_84 | AC | 216 ms
93,988 KB |
testcase_85 | AC | 194 ms
93,980 KB |
testcase_86 | AC | 195 ms
93,232 KB |
testcase_87 | AC | 123 ms
92,384 KB |
testcase_88 | AC | 208 ms
93,696 KB |
testcase_89 | AC | 125 ms
92,436 KB |
testcase_90 | AC | 147 ms
92,652 KB |
testcase_91 | AC | 210 ms
94,632 KB |
testcase_92 | AC | 189 ms
93,624 KB |
testcase_93 | AC | 193 ms
93,504 KB |
testcase_94 | AC | 119 ms
92,624 KB |
testcase_95 | AC | 188 ms
93,820 KB |
testcase_96 | AC | 209 ms
93,624 KB |
testcase_97 | AC | 191 ms
93,520 KB |
testcase_98 | AC | 194 ms
93,580 KB |
testcase_99 | AC | 120 ms
92,156 KB |
ソースコード
# import pypyjit;pypyjit.set_param("max_unroll_recursion=-1") # from bisect import * # from collections import * # from heapq import * # from itertools import * # from math import * # from datetime import * # from decimal import * # PyPyだと遅い # from string import ascii_lowercase, ascii_uppercase # import numpy as np import sys import os # sys.setrecursionlimit(10**6) # PyPyだと遅い INF = 10**18 MOD = 998244353 # MOD = 10**9 + 7 isTest = os.path.exists("input.txt") File = open("input.txt", "r") if isTest else sys.stdin def input(): return File.readline()[:-1] # /////////////////////////////////////////////////////////////////////////// if isTest: P = list(map(int, input().split())) outFile = open("output.txt", "w") # 盤面を動かす関数 def moveGrid(grid): for i in range(1, 60): for j in range(25): grid[i - 1][j] = grid[i][j] if i == 59: grid[i][j] = (0, 0, 0) # 敵までの距離を求める関数 def distance(grid, now): for i in range(60): if grid[i][now][0]: return i return -1 me = 12 move = ["S", "R", "L"] score = 0 turn = 0 total_power = 0 grid = [[(0, 0, 0) for _ in range(25)] for _ in range(60)] while True: n = int(input()) if n == -1: break enemy = [list(map(int, input().split())) for _ in range(n)] moveGrid(grid) for h, p, x in enemy: grid[59][x] = (h, p, h) ans = 0 dist = distance(grid, me) if dist != -1: if grid[dist][me][0] > dist * (total_power // 100 + 1): if me == 0: ans = 1 elif me == 24: ans = -1 else: distL = distance(grid, me - 1) - 1 distR = distance(grid, me + 1) - 1 if grid[distL][me - 1][0] > distL * (total_power // 100 + 1): ans = 1 else: ans = -1 else: grid[dist][me] = ( grid[dist][me][0] - (total_power // 100 + 1), grid[dist][me][1], grid[dist][me][2], ) if grid[dist][me][0] <= 0: score += grid[dist][me][2] total_power += grid[dist][me][1] grid[dist][me] = (0, 0, 0) me = me + ans # print(me) if isTest: outFile.write(move[ans] + "\n") else: print(move[ans], flush=True) turn += 1 if turn == 1000: break if isTest: outFile.close()