結果
問題 |
No.5017 Tool-assisted Shooting
|
ユーザー |
|
提出日時 | 2023-07-16 18:56:23 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 128 ms / 2,000 ms |
コード長 | 2,301 bytes |
コンパイル時間 | 1,815 ms |
コンパイル使用メモリ | 171,316 KB |
実行使用メモリ | 64,760 KB |
スコア | 61,573 |
平均クエリ数 | 430.67 |
最終ジャッジ日時 | 2023-07-16 18:58:52 |
合計ジャッジ時間 | 17,397 ms |
ジャッジサーバーID (参考情報) |
judge17 / judge15 |
純コード判定しない問題か言語 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 100 |
ソースコード
#include <bits/stdc++.h> #include <stdlib.h> #include <time.h> using namespace std; #define ll long long #define all(x) (x).begin(), (x).end() #define yes "Yes" #define no "No" #define ret return #define xin cin #define cpit cout #define farg frag #define fix(x) fixed << setprecision(x) #define fore(p, v) for (auto &p : v) #define mp(a, b) make_pair(a, b) #define mt(a, b, c) make_tuple(a, b, c) #define rep(i, l, r) for (ll i = (l); i < (r); i++) #define inf ((1LL << 62) - (1LL << 31)) #define built(bit) __builtin_popcount(bit) #define Pi 3.14159265 ll mod = 1e9 + 7; int main() { ll turn = 0; ll level = 1; ll EXP = 0; ll T = 1000; ll Now_X = 12; vector<vector<ll>> Board(1e5, vector<ll>(25, 0)); vector<vector<ll>> Point(1e5, vector<ll>(25, 0)); while (T--) { ll N; cin >> N; if (N == -1) break; vector<ll> H(N), P(N), X(N); for (ll i = 0; i < N; i++) { cin >> H[i] >> P[i] >> X[i]; Board[turn + 59][X[i]] += H[i]; Point[turn + 59][X[i]] += P[i]; } bool frag = 0; for (ll i = 1; i <= 59; i++) { if (Board[turn + i][Now_X] > i * ((EXP / 100) + 1)) { Now_X = (Now_X + 1) % 25; cout << 'R' << endl; frag = 1; Board[turn + i][Now_X] -= (EXP / 100) + 1; if (Board[turn + i][Now_X] == 0) EXP += Point[turn + i][Now_X]; break; } if (Board[turn + i][Now_X] != 0) { Board[turn + i][Now_X] -= (EXP / 100) + 1; if (Board[turn + i][Now_X] == 0) EXP += Point[turn + i][Now_X]; break; } } if (frag) continue; if (Board[turn + 1][Now_X] == 0) { cout << 'S' << endl; } else if (Board[turn + 1][(Now_X + 1) % 25] == 0) { cout << 'R' << endl; Now_X = (Now_X + 1) % 25; } else if (Board[turn + 1][(Now_X + 24) % 25] == 0) { cout << 'L' << endl; Now_X = (Now_X + 24) % 25; } else break; turn++; } }