結果
| 問題 | No.5017 Tool-assisted Shooting |
| コンテスト | |
| ユーザー |
ゆい
|
| 提出日時 | 2023-07-16 14:53:19 |
| 言語 | C++17(gcc12) (gcc 12.3.0 + boost 1.87.0) |
| 結果 |
TLE
|
| 実行時間 | - |
| コード長 | 1,243 bytes |
| コンパイル時間 | 2,130 ms |
| コンパイル使用メモリ | 204,916 KB |
| 実行使用メモリ | 35,240 KB |
| スコア | 77 |
| 平均クエリ数 | 1.19 |
| 最終ジャッジ日時 | 2023-07-16 14:53:25 |
| 合計ジャッジ時間 | 5,870 ms |
|
ジャッジサーバーID (参考情報) |
judge12 / judge13 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 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;
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){
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;
}
ゆい