結果
| 問題 |
No.5017 Tool-assisted Shooting
|
| ユーザー |
|
| 提出日時 | 2023-07-16 15:07:28 |
| 言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
TLE
|
| 実行時間 | - |
| コード長 | 1,274 bytes |
| コンパイル時間 | 695 ms |
| コンパイル使用メモリ | 73,008 KB |
| 実行使用メモリ | 35,108 KB |
| スコア | 0 |
| 最終ジャッジ日時 | 2023-07-16 15:07:36 |
| 合計ジャッジ時間 | 7,179 ms |
|
ジャッジサーバーID (参考情報) |
judge11 / judge13 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | TLE * 1 -- * 99 |
ソースコード
#include <iostream>
#include <vector>
#include <algorithm>
using namespace std;
int main() {
int P[25];
for (int i = 0; i < 25; i++) {
cin >> P[i];
}
int level = 1;
int score = 0;
for (int turn = 0; turn < 1000; turn++) {
int n;
cin >> n;
if (n == -1) {
break;
}
vector<int> h(n), p(n), x(n);
for (int i = 0; i < n; i++) {
cin >> h[i] >> p[i] >> x[i];
}
// Move the player to the column with the closest enemy
int closestEnemy = x[0];
for (int i = 1; i < n; i++) {
if (abs(x[i] - 12) < abs(closestEnemy - 12)) {
closestEnemy = x[i];
}
}
if (closestEnemy < 12) {
cout << "L" << endl;
} else if (closestEnemy > 12) {
cout << "R" << endl;
} else {
cout << "S" << endl;
}
cout.flush();
// Update the level and score
for (int i = 0; i < n; i++) {
if (h[i] <= level) {
score += h[i];
}
}
if (score >= 100) {
level = 1 + score / 100;
}
}
return 0;
}