結果
問題 | No.5017 Tool-assisted Shooting |
ユーザー | merom686 |
提出日時 | 2023-07-16 16:17:22 |
言語 | C++17 (gcc 12.3.0 + boost 1.83.0) |
結果 |
AC
|
実行時間 | 98 ms / 2,000 ms |
コード長 | 2,398 bytes |
コンパイル時間 | 2,121 ms |
コンパイル使用メモリ | 201,816 KB |
実行使用メモリ | 24,312 KB |
スコア | 2,802,461 |
平均クエリ数 | 3225.60 |
最終ジャッジ日時 | 2023-07-16 16:17:37 |
合計ジャッジ時間 | 14,096 ms |
ジャッジサーバーID (参考情報) |
judge12 / judge13 |
純コード判定しない問題か言語 |
(要ログイン)
テストケース
テストケース表示入力 | 結果 | 実行時間 実行使用メモリ |
---|---|---|
testcase_00 | AC | 39 ms
23,544 KB |
testcase_01 | AC | 84 ms
23,316 KB |
testcase_02 | AC | 77 ms
23,556 KB |
testcase_03 | AC | 28 ms
23,388 KB |
testcase_04 | AC | 78 ms
23,844 KB |
testcase_05 | AC | 98 ms
23,736 KB |
testcase_06 | AC | 83 ms
23,304 KB |
testcase_07 | AC | 82 ms
23,292 KB |
testcase_08 | AC | 81 ms
23,676 KB |
testcase_09 | AC | 81 ms
24,036 KB |
testcase_10 | AC | 83 ms
24,036 KB |
testcase_11 | AC | 80 ms
23,328 KB |
testcase_12 | AC | 81 ms
23,388 KB |
testcase_13 | AC | 83 ms
23,520 KB |
testcase_14 | AC | 29 ms
23,412 KB |
testcase_15 | AC | 27 ms
24,216 KB |
testcase_16 | AC | 84 ms
23,400 KB |
testcase_17 | AC | 83 ms
24,276 KB |
testcase_18 | AC | 83 ms
23,436 KB |
testcase_19 | AC | 87 ms
24,156 KB |
testcase_20 | AC | 33 ms
23,304 KB |
testcase_21 | AC | 87 ms
23,328 KB |
testcase_22 | AC | 80 ms
23,424 KB |
testcase_23 | AC | 80 ms
24,144 KB |
testcase_24 | AC | 83 ms
23,736 KB |
testcase_25 | AC | 28 ms
24,036 KB |
testcase_26 | AC | 26 ms
23,640 KB |
testcase_27 | AC | 86 ms
23,640 KB |
testcase_28 | AC | 84 ms
23,916 KB |
testcase_29 | AC | 79 ms
23,268 KB |
testcase_30 | AC | 79 ms
24,060 KB |
testcase_31 | AC | 80 ms
23,436 KB |
testcase_32 | AC | 83 ms
23,436 KB |
testcase_33 | AC | 86 ms
23,628 KB |
testcase_34 | AC | 81 ms
23,676 KB |
testcase_35 | AC | 82 ms
23,424 KB |
testcase_36 | AC | 77 ms
23,580 KB |
testcase_37 | AC | 28 ms
23,556 KB |
testcase_38 | AC | 88 ms
23,556 KB |
testcase_39 | AC | 83 ms
23,436 KB |
testcase_40 | AC | 79 ms
23,652 KB |
testcase_41 | AC | 82 ms
23,280 KB |
testcase_42 | AC | 84 ms
23,676 KB |
testcase_43 | AC | 79 ms
23,532 KB |
testcase_44 | AC | 83 ms
24,264 KB |
testcase_45 | AC | 82 ms
23,640 KB |
testcase_46 | AC | 83 ms
23,664 KB |
testcase_47 | AC | 80 ms
23,844 KB |
testcase_48 | AC | 84 ms
23,400 KB |
testcase_49 | AC | 82 ms
23,556 KB |
testcase_50 | AC | 82 ms
23,928 KB |
testcase_51 | AC | 30 ms
23,400 KB |
testcase_52 | AC | 32 ms
23,316 KB |
testcase_53 | AC | 81 ms
23,544 KB |
testcase_54 | AC | 29 ms
23,532 KB |
testcase_55 | AC | 78 ms
23,880 KB |
testcase_56 | AC | 82 ms
24,156 KB |
testcase_57 | AC | 81 ms
23,952 KB |
testcase_58 | AC | 85 ms
24,312 KB |
testcase_59 | AC | 86 ms
23,844 KB |
testcase_60 | AC | 87 ms
23,940 KB |
testcase_61 | AC | 37 ms
24,252 KB |
testcase_62 | AC | 80 ms
23,844 KB |
testcase_63 | AC | 82 ms
24,060 KB |
testcase_64 | AC | 32 ms
24,300 KB |
testcase_65 | AC | 94 ms
24,144 KB |
testcase_66 | AC | 34 ms
23,424 KB |
testcase_67 | AC | 83 ms
23,736 KB |
testcase_68 | AC | 82 ms
24,168 KB |
testcase_69 | AC | 29 ms
23,940 KB |
testcase_70 | AC | 87 ms
23,928 KB |
testcase_71 | AC | 84 ms
23,520 KB |
testcase_72 | AC | 85 ms
23,400 KB |
testcase_73 | AC | 81 ms
23,928 KB |
testcase_74 | AC | 79 ms
24,144 KB |
testcase_75 | AC | 83 ms
23,448 KB |
testcase_76 | AC | 85 ms
23,736 KB |
testcase_77 | AC | 86 ms
24,264 KB |
testcase_78 | AC | 82 ms
24,276 KB |
testcase_79 | AC | 80 ms
24,036 KB |
testcase_80 | AC | 28 ms
23,316 KB |
testcase_81 | AC | 30 ms
23,436 KB |
testcase_82 | AC | 82 ms
24,060 KB |
testcase_83 | AC | 82 ms
24,060 KB |
testcase_84 | AC | 84 ms
23,556 KB |
testcase_85 | AC | 29 ms
23,520 KB |
testcase_86 | AC | 83 ms
24,144 KB |
testcase_87 | AC | 86 ms
24,024 KB |
testcase_88 | AC | 84 ms
23,676 KB |
testcase_89 | AC | 79 ms
23,652 KB |
testcase_90 | AC | 32 ms
23,604 KB |
testcase_91 | AC | 87 ms
23,400 KB |
testcase_92 | AC | 81 ms
24,108 KB |
testcase_93 | AC | 27 ms
23,556 KB |
testcase_94 | AC | 79 ms
24,240 KB |
testcase_95 | AC | 83 ms
24,132 KB |
testcase_96 | AC | 27 ms
23,544 KB |
testcase_97 | AC | 82 ms
23,388 KB |
testcase_98 | AC | 80 ms
23,436 KB |
testcase_99 | AC | 84 ms
23,424 KB |
ソースコード
#include <bits/stdc++.h> using ll = long long; using namespace std; array<int, 2> b[25][1100]; int main() { int x = 12, y = 0, l = 100; for (int turn = 0; turn < 1000; turn++) { int n; cin >> n; if (n < 0) exit(0); for (int i = 0; i < n; i++) { int h, p, x; cin >> h >> p >> x; b[x][y + 60] = { h, p }; } y++; int m = l / 100; char c = 'S'; int r[25]; for (int i = 0; i < 25; i++) { int s = 100000; int d = abs(x - i); d = min(d, 25 - d); d = max(d - 1, 0); for (int j = 1 + d; j < 60; j++) { if (auto h = b[i][y + j][0]; h > 0) { int t = (h + m - 1) / m + d; int p = b[i][y + j][1]; if (t > j) s = 200000; else s = -100000 * pow(p, (999 - turn) / 1000) / t; break; } } r[i] = s; } int t[2] = {}; for (int i = 1; i <= 12; i++) { if (int x0 = (x + i + 25) % 25; t[0] |= b[x0][y - 1 + i][0] || r[x0] > 100000) r[x0] = 300000; if (int x1 = (x - i + 25) % 25; t[1] |= b[x1][y + 1 - i][0] || r[x1] > 100000) r[x1] = 300000; } if (int i = min_element(r, r + 25) - r; i != x) c = "LR"[i - x > 0 ^ abs(i - x) > 12]; cout << "#" << x << ' ' << y << ' ' << min_element(r, r + 25) - r << '\n'; //for (int i = 0; i < 25; i++) { // int d = abs(x - i); // d = min(d, 25 - d); // d = max(d - 1, 0); // for (int j = 1 + d; j < 60; j++) { // if (auto h = b[i][y + j][0]; h > 0) { // r[i] = j; // break; // } // } //} cout << '#'; for (int i = 0; i < 25; i++) { cout << r[i] << " \n"[i == 24]; } cout << c << endl; x += (c == 'R') - (c == 'L'); x = (x + 25) % 25; for (int j = 1; j < 60; j++) { if (auto &h = b[x][y + j][0]; h > 0) { h -= m; if (h <= 0) { h = 0; l += b[x][y + j][1]; } cout << "#" << l << ' ' << h << '\n'; break; } } } return 0; }