結果

問題 No.5017 Tool-assisted Shooting
ユーザー gucci0512gucci0512
提出日時 2024-02-25 01:11:16
言語 C++17
(gcc 12.3.0 + boost 1.83.0)
結果
RE  
実行時間 -
コード長 3,799 bytes
コンパイル時間 5,457 ms
コンパイル使用メモリ 266,692 KB
実行使用メモリ 24,384 KB
スコア 124,702
平均クエリ数 762.99
最終ジャッジ日時 2024-02-25 01:11:40
合計ジャッジ時間 23,607 ms
ジャッジサーバーID
(参考情報)
judge11 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 64 ms
24,000 KB
testcase_01 AC 62 ms
24,000 KB
testcase_02 AC 59 ms
24,000 KB
testcase_03 AC 60 ms
24,000 KB
testcase_04 AC 58 ms
24,000 KB
testcase_05 RE -
testcase_06 RE -
testcase_07 RE -
testcase_08 RE -
testcase_09 AC 62 ms
24,000 KB
testcase_10 AC 60 ms
24,000 KB
testcase_11 RE -
testcase_12 RE -
testcase_13 AC 60 ms
24,000 KB
testcase_14 AC 61 ms
24,000 KB
testcase_15 AC 60 ms
24,000 KB
testcase_16 AC 65 ms
24,000 KB
testcase_17 AC 62 ms
24,000 KB
testcase_18 AC 62 ms
24,000 KB
testcase_19 RE -
testcase_20 RE -
testcase_21 AC 86 ms
24,000 KB
testcase_22 RE -
testcase_23 RE -
testcase_24 RE -
testcase_25 RE -
testcase_26 RE -
testcase_27 AC 59 ms
24,000 KB
testcase_28 RE -
testcase_29 AC 60 ms
24,000 KB
testcase_30 RE -
testcase_31 AC 61 ms
24,000 KB
testcase_32 RE -
testcase_33 RE -
testcase_34 AC 59 ms
24,000 KB
testcase_35 AC 59 ms
24,000 KB
testcase_36 RE -
testcase_37 AC 61 ms
24,000 KB
testcase_38 RE -
testcase_39 AC 62 ms
24,000 KB
testcase_40 RE -
testcase_41 RE -
testcase_42 RE -
testcase_43 RE -
testcase_44 RE -
testcase_45 RE -
testcase_46 AC 60 ms
24,000 KB
testcase_47 RE -
testcase_48 AC 62 ms
24,000 KB
testcase_49 AC 59 ms
24,000 KB
testcase_50 RE -
testcase_51 AC 60 ms
24,000 KB
testcase_52 AC 60 ms
24,000 KB
testcase_53 RE -
testcase_54 RE -
testcase_55 RE -
testcase_56 AC 66 ms
24,000 KB
testcase_57 AC 59 ms
24,000 KB
testcase_58 AC 64 ms
24,000 KB
testcase_59 RE -
testcase_60 RE -
testcase_61 AC 61 ms
24,000 KB
testcase_62 AC 59 ms
24,000 KB
testcase_63 AC 60 ms
24,000 KB
testcase_64 AC 60 ms
24,000 KB
testcase_65 AC 61 ms
24,000 KB
testcase_66 RE -
testcase_67 AC 60 ms
24,000 KB
testcase_68 RE -
testcase_69 RE -
testcase_70 AC 64 ms
24,000 KB
testcase_71 AC 61 ms
24,000 KB
testcase_72 RE -
testcase_73 AC 59 ms
24,000 KB
testcase_74 RE -
testcase_75 RE -
testcase_76 AC 60 ms
24,000 KB
testcase_77 RE -
testcase_78 RE -
testcase_79 RE -
testcase_80 AC 59 ms
24,000 KB
testcase_81 AC 59 ms
24,000 KB
testcase_82 AC 62 ms
24,000 KB
testcase_83 RE -
testcase_84 AC 59 ms
24,000 KB
testcase_85 AC 59 ms
24,000 KB
testcase_86 AC 62 ms
24,000 KB
testcase_87 AC 60 ms
24,000 KB
testcase_88 AC 79 ms
24,000 KB
testcase_89 RE -
testcase_90 AC 61 ms
24,000 KB
testcase_91 RE -
testcase_92 AC 57 ms
24,000 KB
testcase_93 AC 64 ms
24,000 KB
testcase_94 RE -
testcase_95 AC 60 ms
24,000 KB
testcase_96 RE -
testcase_97 RE -
testcase_98 RE -
testcase_99 RE -
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
#include <atcoder/all>
#define rep(i,a,b) for(int i=a;i<b;i++)
#define rrep(i,a,b) for(int i=b-1;i>=a;i--)
#define all(x) (x).begin(),(x).end()
#define pb(x) push_back(x);
template<class T>bool chmax(T &a, const T &b) { if (a<b) { a = b; return 1; } return 0; }
template<class T>bool chmin(T &a, const T &b) { if (b<a) { a = b; return 1; } return 0; }
typedef long long ll;
typedef long double lld;
using namespace std;
using namespace atcoder;
clock_t start=clock();
clock_t process=clock();
// random_device seed_gen;
// mt19937 engine(seed_gen());
mt19937 engine(0);

const bool LOCAL_JUDGE = false;
const int W = 25;
const int H = 60;
const int T = 1000;
const int OFFSET = 59;
const int INF = (1<<30);

void LocalInput(){
    rep(i,0,W){
        int p;cin >> p;
    }
}

int field[T+H+10][W];
vector<int> h,p,x,t,point;
deque<int> enemies[W];

void Init(){
    rep(i,0,T+H+10)rep(j,0,W) field[i][j] = -1;
}

void Input(int turn){
    int n;cin >> n;
    rep(i,0,n){
        int _h,_p,_x;cin >> _h >> _p >> _x;
        int idx=h.size();
        h.push_back(_h);
        p.push_back(_p);
        x.push_back(_x);
        point.push_back(_h);
        field[OFFSET+turn][x[idx]] = idx;
        t.push_back(OFFSET+turn);
        enemies[x[idx]].push_back(idx);
    }
}

int my_i = 0;
int my_j = 12;

void Output(char action){
    cout << action << endl;
    field[my_i][my_j] = -1;
    if(action=='L'){
        my_j--;
    }
    if(action=='R'){
        my_j++;
    }
    my_j = (my_j+W)%W;
    field[my_i][my_j] = -2;
}

int S = 0;
int level = 1;
int score = 0;

void MoveEnemy(int turn){
    field[my_i][my_j] = -1;
    my_i++;
    field[my_i][my_j] = -2;
    return;
}

void AppearenceEnemy(int turn){
    Input(turn);
}

void MoveMine(int turn){
    if(field[my_i+1][my_j] == -1){
        Output('S');
        return;
    }
    else{
        if(field[my_i][(my_j+1)%W] == -1&&field[my_i+1][(my_j+1)%W] == -1){
            Output('R');
            return;
        }
        else{
            Output('L');
            return;
        }
    }
    // if(enemies[my_j].size()!=0){
    //     int dist=t[enemies[my_j].front()]-my_i;
    //     if(dist*level>=h[enemies[my_j].front()]){
    //         Output('S');
    //         return;
    //     }
    // }
    // vector<int> distance_w(W,0);
    // rep(j,0,W){
    //     distance_w[j] = min(abs(j-my_j),W-abs(j-my_j));
    // }
    // vector<int> need_turn(W,INF);
    // rep(j,0,W){
    //     if(enemies[j].size()==0) continue;
    //     int enemy_idx = enemies[j].front();
    //     int ex_turn = t[enemy_idx]-my_i-distance_w[j];
    //     need_turn[j] = h[enemy_idx]/ex_turn;
    // }
    // int target_j = 0;
    // rep(j,0,W){
    //     if(need_turn[j]==INF) continue;
    //     if(need_turn[j]<need_turn[target_j]){
    //         target_j = j;
    //     }
    // }
    // if(target_j==my_j){
    //     Output('S');
    //     return;
    // }
    // if((my_j-target_j+W)%W < (target_j-my_j+W)%W){
    //     Output('L');
    // }
    // else{
    //     Output('R');
    // }
    return;
}

void AtackMine(int turn){
    if(enemies[my_j].size()==0){
        return;
    }
    int enemy_idx = enemies[my_j].front();
    h[enemy_idx] -= level;
    if(h[enemy_idx]<=0){
        enemies[my_j].pop_front();
        field[t[enemy_idx]][x[enemy_idx]] = -1;
        score += point[enemy_idx];
        S += p[enemy_idx];
        level = (1+S/100);
    }
    return;
}

void Solve(){
    field[0][12] = -2;
    rep(turn,0,T){
        MoveEnemy(turn);
        AppearenceEnemy(turn);
        MoveMine(turn);
        AtackMine(turn);
    }
}   

int main(void){
    ios::sync_with_stdio(false);
    cin.tie(nullptr);
    if(LOCAL_JUDGE) LocalInput();
    Init();
    Solve();
    cerr << "# Score : " << score << endl;
}
0