#include #include #define rep(i,a,b) for(int i=a;i=a;i--) #define all(x) (x).begin(),(x).end() #define pb(x) push_back(x); templatebool chmax(T &a, const T &b) { if (abool chmin(T &a, const T &b) { if (b> p; } } int field[T+H+10][W]; vector h,p,x,t,point; deque 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 distance_w(W,0); // rep(j,0,W){ // distance_w[j] = min(abs(j-my_j),W-abs(j-my_j)); // } // vector 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]