結果
| 問題 |
No.5003 物理好きクリッカー
|
| コンテスト | |
| ユーザー |
ts_
|
| 提出日時 | 2018-12-02 19:11:36 |
| 言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
| 結果 |
AC
|
| 実行時間 | 312 ms / 10,000 ms |
| コード長 | 2,263 bytes |
| コンパイル時間 | 1,438 ms |
| 実行使用メモリ | 22,008 KB |
| スコア | 449,259 |
| 平均クエリ数 | 10000.00 |
| 最終ジャッジ日時 | 2021-07-19 07:55:23 |
| 合計ジャッジ時間 | 14,434 ms |
|
ジャッジサーバーID (参考情報) |
judge12 / judge11 |
| 純コード判定しない問題か言語 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 32 |
ソースコード
#include <bits/stdc++.h>
using namespace std;
#define FOR(i,a,b) for(int i=(a);i<(b);++i)
#define rep(i,n) FOR(i,0,n)
#define pb emplace_back
typedef long long ll;
typedef pair<int,int> pint;
const int N=10000;
string S;
ll tot=0;
vector<string> mov={"click","buy","sell","reinforce","enclick"};
vector<string> nam={"hand","lily","factory","casino","grimoire"};
ll bcost[5]={150,2000,30000,600000,10000000},rcost[6]={150,20000,300000,6000000,100000000,15};
ll base[5]={1,10,120,2000,25000};
int satu[5]={0,7,7,7,14};
int numfa[5],numref[6];
int feverend=0,pfac=1;
bool disc=false;
pint ans[N];
inline void nxphase(int turn){
if(S[turn]=='B') tot+=(tot+99)/100;
else if(S[turn]=='F') feverend=turn+20,pfac=7;
else if(S[turn]=='S') disc=true;
else disc=false;
if(feverend==turn) pfac=1;
return;
}
inline ll get_c(){
ll ret=0;
rep(i,5){
ret+=(base[i]<<numref[i])*numfa[i];
}
return ret*pfac;
}
void init(){
int turn=0;
ans[turn]={0,0};++tot;++turn;
while(numref[5]<3){
if(tot>=rcost[5]){
ll tcos=rcost[5];
if(disc) tcos=(tcos*9+9)/10;
tot-=tcos;
rcost[5]*=10;++numref[5];
ans[turn]={4,0};
}
else{
ans[turn]={0,0};tot+=(1ll<<numref[5]);
}
nxphase(turn);
++turn;
}
cerr<<turn<<" "<<tot<<endl;
FOR(i,1,5){
while(numfa[i]<satu[i]){
if(tot>=bcost[i]){
ll tcos=bcost[i];
if(disc) tcos=(tcos*9+9)/10;
tot-=tcos;
bcost[i]=(bcost[i]*6+4)/5;++numfa[i];
ans[turn]={1,i};
}
else{
ans[turn]={0,0};tot+=(1ll<<numref[5])*pfac;
}
tot+=get_c();
nxphase(turn);
++turn;
if(turn==N) break;
}
cerr<<turn<<" "<<tot<<endl;
if(turn==N) break;
}
int cnt=0;
while(turn<N){
if(turn<8900&&cnt<2&&tot>=rcost[4]){
ll tcos=rcost[4];
if(disc) tcos=(tcos*9+9)/10;
tot-=tcos;
rcost[4]*=10;++numref[4];
ans[turn]={3,4};
++cnt;
cerr<<turn<<endl;
}
else ans[turn]={0,0};tot+=(1ll<<numref[5])*pfac;
tot+=get_c();
nxphase(turn);
++turn;
}
cerr<<turn<<" "<<tot<<endl;
}
int main(){
int drop;
cin>>drop>>S;
init();
cerr<<tot<<endl;
string ds;
rep(i,N){
if(ans[i].first==0) cout<<"click"<<endl;
else if(ans[i].first==4) cout<<"enclick"<<endl;
else{
cout<<mov[ans[i].first]<<" "<<nam[ans[i].second]<<endl;
}
cin>>ds;
}
return 0;
}
ts_