#include // cout, endl, cin #include // string, to_string, stoi #include // vector #include // min, max, swap, sort, reverse, lower_bound, upper_bound #include // pair, make_pair #include // tuple, make_tuple #include // int64_t, int*_t #include // printf #include // map #include // queue, priority_queue #include // set #include // stack #include // deque #include // unordered_map #include // unordered_set #include // bitset #include // isupper, islower, isdigit, toupper, tolower #include //fixed,setprecision //#include //INT_MAX //#include //M_PI #include #include // 正規表現 #include #include //#include using namespace std; #define ll long long #define rep(i, n) for (ll i = 0; i < (ll)(n); i++) constexpr int width = 25; // フィールドの幅 constexpr int height = 60; // フィールドの高さ constexpr int max_turn = 1000; // ゲームの最大ターン数 const char choice[3] = {'L', 'R', 'S'}; int masu[25][60]; int masu1[25][60]; int sx = 12; int power=0; int kogeki=1; int score=0; int sy=0; struct Data { int h; int p; int x; int y; Data(int h, int p, int x, int y) : h(h), p(p), x(x), y(y) {} }; bool compareByValue(const Data& a, const Data& b) { int valueA = a.y - std::abs(sx - a.x) - 1 - a.h; int valueB = b.y - std::abs(sx - b.x) - 1 - b.h; if (valueA != valueB) return valueA > valueB; else return std::abs(sx - a.x) < std::abs(sx - b.x); } int main() { #ifdef ONLINE_JUDGE #else //vectorP(25); //rep(i,25)cin>>P[i]; #endif vector enemy_state[25]; vector enemy_state_moto[25]; vectorlane(25,0); //rep(i,25)data[i].emplace_back(0,0,0,59); for (int turn = 1; turn <= max_turn; turn++) { //cerr<<"#turn"<> n; if (n == -1) return 0; for (int i = 0; i < n; i++) { int h1, p1, x1; cin >> h1 >> p1 >> x1; enemy_state[x1].emplace_back(h1, p1, x1, 59+turn); enemy_state_moto[x1].emplace_back(h1, p1, x1, 59+turn); //if(lane[x1]==-1)lane[x1]=0; } int min_i=-1; int sho=1000; int dai=0; int dai_power=0; //kogeki=1; rep(i,25){ if (enemy_state[i].empty())continue; if(lane[i]+1>enemy_state[i].size())continue; Data z=enemy_state[i][lane[i]]; if(z.p<=0)continue; kogeki=1+(power/100); if(kogeki<=0)kogeki=1; //cerr<<__LINE__<<"---"<1&&sho>abs(sx-z.x)+evaluated_score&&z.y!=-1&&z.x!=-1&&z.h>0){ if(tmp>1&&sho>abs(sx-z.x)&&z.y-sy>1&&z.x!=-1&&z.h>0){ //if(tmp>1&&((kogeki<2&&dai=2&&sho>abs(sx-z.x)))&&z.y!=-1&&z.x!=-1&&z.h>0){ min_i=z.x; sho=abs(sx-z.x); dai=z.p; dai_power=z.h; //sho=abs(sx-z.x)+evaluated_score; //cerr<<" turn:"< min_i&&sx>=1&&(enemy_state[sx-1].empty()||lane[sx-1]==-1||(lane[sx-1]+1<=enemy_state[sx-1].size()&&enemy_state[sx-1][lane[sx-1]].y>=2+turn)||lane[sx-1]+1>enemy_state[sx-1].size())) { r = 0;//L sx--; } else if (sx < min_i&&sx+1<25&&(enemy_state[sx+1].empty()||lane[sx+1]==-1||(lane[sx+1]+1<=enemy_state[sx+1].size()&&enemy_state[sx+1][lane[sx+1]].y>=2+turn)||lane[sx+1]+1>enemy_state[sx+1].size())) { r = 1;//R sx++; } else if(enemy_state[sx].empty()||lane[sx]==-1||(lane[sx]+1<=enemy_state[sx].size()&&enemy_state[sx][lane[sx]].y>=2+turn)||lane[sx]+1>enemy_state[sx].size()){ r = 2; }else if(sx>=1&&(enemy_state[sx-1].empty()||lane[sx-1]==-1||(lane[sx-1]+1<=enemy_state[sx-1].size()&&enemy_state[sx-1][lane[sx-1]].y>=2+turn)||lane[sx-1]+1>enemy_state[sx-1].size())){ r = 0;//L sx--; }else if(sx+1<25&&(enemy_state[sx+1].empty()||lane[sx+1]==-1||(lane[sx+1]+1<=enemy_state[sx+1].size()&&enemy_state[sx+1][lane[sx+1]].y>=2+turn))||lane[sx+1]+1>enemy_state[sx+1].size()){ r = 1;//R sx++; }else{ r=2; } char c = choice[r]; cout << c << endl; cout << "#" << c << " sx:" << sx <0)cout<<"#nerai x:"<1+data[i][lane[i]].y)lane[i]++; } } //cerr<<__LINE__<<"---"<0){ power+=z.p; score+=enemy_state_moto[sx][lane[sx]].h; z.p=0; kogeki=1+(power/100); lane[sx]++; } cout<<"#now x:"<