結果
問題 | No.5017 Tool-assisted Shooting |
ユーザー | ks2m |
提出日時 | 2023-07-16 14:40:18 |
言語 | Java21 (openjdk 21) |
結果 |
AC
|
実行時間 | 294 ms / 2,000 ms |
コード長 | 3,585 bytes |
コンパイル時間 | 3,335 ms |
コンパイル使用メモリ | 76,612 KB |
実行使用メモリ | 73,448 KB |
スコア | 74,830 |
平均クエリ数 | 399.74 |
最終ジャッジ日時 | 2023-07-16 14:40:45 |
合計ジャッジ時間 | 25,948 ms |
ジャッジサーバーID (参考情報) |
judge12 / judge13 |
純コード判定しない問題か言語 |
(要ログイン)
テストケース
テストケース表示入力 | 結果 | 実行時間 実行使用メモリ |
---|---|---|
testcase_00 | AC | 120 ms
69,320 KB |
testcase_01 | AC | 255 ms
73,172 KB |
testcase_02 | AC | 156 ms
69,728 KB |
testcase_03 | AC | 123 ms
69,192 KB |
testcase_04 | AC | 183 ms
72,060 KB |
testcase_05 | AC | 168 ms
71,480 KB |
testcase_06 | AC | 122 ms
69,392 KB |
testcase_07 | AC | 185 ms
72,132 KB |
testcase_08 | AC | 165 ms
69,212 KB |
testcase_09 | AC | 153 ms
70,204 KB |
testcase_10 | AC | 185 ms
71,364 KB |
testcase_11 | AC | 142 ms
69,244 KB |
testcase_12 | AC | 118 ms
69,252 KB |
testcase_13 | AC | 153 ms
71,028 KB |
testcase_14 | AC | 150 ms
70,236 KB |
testcase_15 | AC | 131 ms
70,200 KB |
testcase_16 | AC | 123 ms
69,240 KB |
testcase_17 | AC | 248 ms
71,960 KB |
testcase_18 | AC | 277 ms
72,908 KB |
testcase_19 | AC | 145 ms
69,852 KB |
testcase_20 | AC | 172 ms
71,952 KB |
testcase_21 | AC | 162 ms
72,072 KB |
testcase_22 | AC | 197 ms
72,348 KB |
testcase_23 | AC | 123 ms
69,560 KB |
testcase_24 | AC | 184 ms
71,772 KB |
testcase_25 | AC | 148 ms
70,160 KB |
testcase_26 | AC | 201 ms
72,236 KB |
testcase_27 | AC | 256 ms
72,884 KB |
testcase_28 | AC | 154 ms
71,892 KB |
testcase_29 | AC | 157 ms
71,480 KB |
testcase_30 | AC | 182 ms
71,812 KB |
testcase_31 | AC | 120 ms
69,120 KB |
testcase_32 | AC | 151 ms
69,772 KB |
testcase_33 | AC | 145 ms
70,288 KB |
testcase_34 | AC | 284 ms
72,396 KB |
testcase_35 | AC | 133 ms
70,188 KB |
testcase_36 | AC | 199 ms
71,304 KB |
testcase_37 | AC | 152 ms
71,588 KB |
testcase_38 | AC | 120 ms
69,416 KB |
testcase_39 | AC | 253 ms
72,792 KB |
testcase_40 | AC | 175 ms
72,068 KB |
testcase_41 | AC | 118 ms
69,408 KB |
testcase_42 | AC | 216 ms
71,992 KB |
testcase_43 | AC | 226 ms
72,364 KB |
testcase_44 | AC | 120 ms
69,184 KB |
testcase_45 | AC | 145 ms
69,688 KB |
testcase_46 | AC | 280 ms
73,088 KB |
testcase_47 | AC | 157 ms
71,752 KB |
testcase_48 | AC | 285 ms
72,620 KB |
testcase_49 | AC | 245 ms
72,548 KB |
testcase_50 | AC | 150 ms
68,296 KB |
testcase_51 | AC | 256 ms
72,564 KB |
testcase_52 | AC | 294 ms
71,264 KB |
testcase_53 | AC | 162 ms
71,688 KB |
testcase_54 | AC | 134 ms
69,424 KB |
testcase_55 | AC | 202 ms
72,184 KB |
testcase_56 | AC | 131 ms
69,008 KB |
testcase_57 | AC | 262 ms
72,236 KB |
testcase_58 | AC | 253 ms
71,804 KB |
testcase_59 | AC | 136 ms
70,048 KB |
testcase_60 | AC | 221 ms
72,100 KB |
testcase_61 | AC | 268 ms
72,712 KB |
testcase_62 | AC | 285 ms
73,448 KB |
testcase_63 | AC | 143 ms
70,472 KB |
testcase_64 | AC | 125 ms
69,760 KB |
testcase_65 | AC | 258 ms
72,452 KB |
testcase_66 | AC | 145 ms
70,092 KB |
testcase_67 | AC | 137 ms
70,136 KB |
testcase_68 | AC | 187 ms
71,856 KB |
testcase_69 | AC | 162 ms
70,516 KB |
testcase_70 | AC | 128 ms
69,216 KB |
testcase_71 | AC | 183 ms
72,032 KB |
testcase_72 | AC | 133 ms
69,184 KB |
testcase_73 | AC | 250 ms
72,328 KB |
testcase_74 | AC | 161 ms
72,136 KB |
testcase_75 | AC | 143 ms
69,992 KB |
testcase_76 | AC | 159 ms
70,792 KB |
testcase_77 | AC | 151 ms
70,500 KB |
testcase_78 | AC | 162 ms
71,176 KB |
testcase_79 | AC | 206 ms
72,788 KB |
testcase_80 | AC | 152 ms
70,788 KB |
testcase_81 | AC | 168 ms
72,140 KB |
testcase_82 | AC | 164 ms
71,844 KB |
testcase_83 | AC | 147 ms
69,924 KB |
testcase_84 | AC | 130 ms
69,556 KB |
testcase_85 | AC | 112 ms
69,020 KB |
testcase_86 | AC | 166 ms
71,900 KB |
testcase_87 | AC | 140 ms
69,680 KB |
testcase_88 | AC | 123 ms
69,412 KB |
testcase_89 | AC | 154 ms
70,440 KB |
testcase_90 | AC | 144 ms
70,240 KB |
testcase_91 | AC | 122 ms
69,392 KB |
testcase_92 | AC | 254 ms
72,132 KB |
testcase_93 | AC | 129 ms
69,440 KB |
testcase_94 | AC | 153 ms
70,132 KB |
testcase_95 | AC | 259 ms
73,316 KB |
testcase_96 | AC | 228 ms
72,168 KB |
testcase_97 | AC | 126 ms
69,352 KB |
testcase_98 | AC | 121 ms
67,976 KB |
testcase_99 | AC | 145 ms
70,116 KB |
ソースコード
import java.io.BufferedReader; import java.io.File; import java.io.FileReader; import java.io.InputStreamReader; public class Main { static boolean batch = false; static boolean readFile = false; static int num = 0; static int H = 60; static int H1; static int W = 25; static int T = 1000; static int[][] hp0, hp, pw; static int[] ap; public static void main(String[] args) throws Exception { if (batch) { readFile = true; } if (readFile) { if (batch) { long tl = 2000; // TODO long tw = tl - 200; long total = 0; int bidx = 0; int best = 0; int widx = 0; int worst = 1000000000; int re = 0; int tle = 0; for (int z = 0; z < 100; z++) { try { long st = System.currentTimeMillis(); int score = solve(z); long time = System.currentTimeMillis() - st; if (time > tw) { System.out.println(z + ":\t" + score + "\t" + time + "ms"); if (time > tl) { tle++; } } else { System.out.println(z + ":\t" + score); } total += score; if (score > best) { best = score; bidx = z; } if (score < worst) { worst = score; widx = z; } } catch (Exception e) { System.out.println(z + ":\t" + e.getMessage()); re++; } } System.out.println("total: " + total); System.out.println("best: " + bidx + ": " + best); System.out.println("worst: " + widx + ": " + worst); System.out.println("RE: " + re); System.out.println("TLE: " + tle); } else { int score = solve(num); System.out.println(score); } } else { BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); init(br); solve(br); } } static int solve(int z) throws Exception { StringBuilder sb = new StringBuilder(); sb.append(z); while (sb.length() < 4) { sb.insert(0, '0'); } File file = new File("G:\\AHC\\xxx\\in\\" + sb.toString() + ".txt"); BufferedReader br = new BufferedReader(new FileReader(file)); init(br); return solve(br); } static void init(BufferedReader br) throws Exception { H1 = H - 1; hp0 = new int[W][H]; hp = new int[W][H]; pw = new int[W][H]; ap = new int[W]; } static int solve(BufferedReader br) throws Exception { int score = 0; int cx = 12; int lv = 1; int sum = 0; for (int t = 0; t < T; t++) { int n = Integer.parseInt(br.readLine()); if (n == -1) { return score; } // 1マス下がる for (int y = 0; y < H1; y++) { for (int x = 0; x < W; x++) { hp0[x][y] = hp0[x][y + 1]; hp[x][y] = hp[x][y + 1]; pw[x][y] = pw[x][y + 1]; } } for (int x = 0; x < W; x++) { hp0[x][H1] = 0; hp[x][H1] = 0; pw[x][H1] = 0; } // 敵機出現 for (int i = 0; i < n; i++) { String[] sa = br.readLine().split(" "); int h = Integer.parseInt(sa[0]); int p = Integer.parseInt(sa[1]); int x = Integer.parseInt(sa[2]); hp0[x][H1] = h; hp[x][H1] = h; pw[x][H1] = p; } // 自機移動 char dir = getMoveDir(); if (dir == 'L') { cx--; if (cx == -1) { cx = W - 1; } } else if (dir == 'R') { cx++; if (cx == W) { cx = 0; } } System.out.println(dir); // 攻撃 for (int y = 1; y < H; y++) { if (hp[cx][y] > 0) { hp[cx][y] -= lv; if (hp[cx][y] <= 0) { hp[cx][y] = 0; score += hp0[cx][y]; sum += pw[cx][y]; lv = 1 + sum / 100; } break; } } } return score; } static char getMoveDir() { return 'S'; } }