結果
問題 | No.5017 Tool-assisted Shooting |
ユーザー |
|
提出日時 | 2023-07-16 15:34:42 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 116 ms / 2,000 ms |
コード長 | 1,861 bytes |
コンパイル時間 | 1,746 ms |
コンパイル使用メモリ | 172,360 KB |
実行使用メモリ | 64,728 KB |
スコア | 107,367 |
平均クエリ数 | 777.06 |
最終ジャッジ日時 | 2023-07-16 15:34:59 |
合計ジャッジ時間 | 16,653 ms |
ジャッジサーバーID (参考情報) |
judge14 / judge13 |
純コード判定しない問題か言語 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
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.14159265ll 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];}for (ll i = 1; i <= 59; i++){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 (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;}elsebreak;turn++;}}