結果
問題 | No.5017 Tool-assisted Shooting |
ユーザー |
![]() |
提出日時 | 2023-07-16 14:47:51 |
言語 | C++17(gcc12) (gcc 12.3.0 + boost 1.87.0) |
結果 |
RE
|
実行時間 | - |
コード長 | 1,299 bytes |
コンパイル時間 | 2,174 ms |
コンパイル使用メモリ | 204,624 KB |
実行使用メモリ | 34,760 KB |
スコア | 77 |
平均クエリ数 | 1.19 |
最終ジャッジ日時 | 2023-07-16 14:47:58 |
合計ジャッジ時間 | 5,943 ms |
ジャッジサーバーID (参考情報) |
judge11 / judge12 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | RE * 1 TLE * 1 -- * 98 |
ソースコード
#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(nh,V(nw)),f1(nh,V(nw)),f2(nh,V(nw)); while(true){ rep(i,nh-1){ f[i]=f[i+1]; f1[i]=f1[i+1]; f2[i]=f2[i+1]; } rep(j,nw) f[nh-1][j]=f1[nh-1][j]=f2[nh-1][j]=0; int n; cin >> n; if(n==-1) break; rep(i,n){ int h,p,x; cin >> h >> p >> x; x--; f[nh-1][x]=f1[nh-1][x]=h; f2[nh-1][x]=p; } cout << "S" << endl; int c=1; rep(i,nh) if(c==1&&f[i][now]>0){ cerr << f[i][now] << endl; c=0; f[i][now]-=l/100; if(f[i][now]<=0){ l+=f2[i][now]; score+=f1[i][now]; f[i][now]=f1[i][now]=f2[i][now]=0; } } /* for(int i=nh-1;0<=i;i--){ rep(j,nw) cerr << f[i][j] << " "; cerr << endl; } */ } //cerr << "score : " << score << endl; }