結果

問題 No.5017 Tool-assisted Shooting
ユーザー ゆい
提出日時 2023-07-16 15:08:29
言語 C++17(gcc12)
(gcc 12.3.0 + boost 1.87.0)
結果
AC  
実行時間 64 ms / 2,000 ms
コード長 1,106 bytes
コンパイル時間 2,629 ms
コンパイル使用メモリ 203,640 KB
実行使用メモリ 24,408 KB
スコア 74,830
平均クエリ数 399.74
最終ジャッジ日時 2023-07-16 15:08:40
合計ジャッジ時間 11,061 ms
ジャッジサーバーID
(参考情報)
judge13 / judge14
純コード判定しない問題か言語
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 100
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
using namespace std;
using ll=long long;
using ld= long double;
using P=pair<ll,ll>;
using V=vector<ll>;
#define rep(i,n) for(ll i=0;i<n;i++)
#define REP(i,n) for(ll i=1;i<=n;i++)

int nh=60,nw=26;
//int nh=6,nw=3;

int main(){
    int now=12,l=100;
    ll score=0;
    vector<V> f(2000,V(nw)),f1(2000,V(nw)),f2(2000,V(nw));
    rep(t,1000){
        int n;
        cin >> n;
        if(n==-1) break;

        rep(i,n){
            int h,p,x;
            cin >> h >> p >> x;
            f[nh-1+t][x]=f1[nh-1+t][x]=h;
            f2[nh-1+t][x]=p;
        }

        cout << "S" << endl;

        int c=1;
        rep(i,nh) if(c==1&&f[i+t][now]>0){
            c=0;
            f[i+t][now]-=l/100;
            if(f[i+t][now]<=0){
                l+=f2[i+t][now];
                score+=f1[i+t][now];
                f[i+t][now]=f1[i+t][now]=f2[i+t][now]=0;
            }
        }
        
        /*
        for(int i=nh-1;0<=i;i--){
            rep(j,nw) cerr << f[i+t][j] << " ";
            cerr << endl;
        }
        */

    }

    //cerr << "score : " << score << endl;

}
0