#include #include #include #include #include #include #include using namespace std; class State{ int money_; bool will_date_; int love_; int small_love_; int week_; public: //State()::State(0,0,0,false,0){} State(int money__=0,int love__=0,int small_love__=0,bool will_date__=false,\ int week__=1){ this->money_=money__; this->will_date_=will_date__; this->love_=love__; this->small_love_=small_love__; this->week_=week__; } State(const State &dst){ this->money_=dst.money(); this->love_=dst.love(); this->small_love_=dst.small_love(); this->will_date_=dst.will_date(); this->week_=dst.week(); } bool will_date()const{return this->will_date_;} int money()const{return this->money_;} int love() const{return this->love_;} int small_love() const{return this->small_love_;} int week()const{return this->week_;} std::string tostring(){ std::ostringstream osm; osm<<"money:"<money_<love_<small_love_<week_<will_date_?"True":"False")<> &data,\ std::map> &moves,int W){ using namespace std; vector frontier; int result=~0xffff; State now,next; int n; frontier.push_back(State()); while(!frontier.empty()){ now=frontier.back(); n=now.week(); frontier.pop_back(); //cout<<"__now__"<=0){ result=std::max(result,now.love()*100+now.small_love()); //else pass } } else for(int i=0;i> m; m[0]=([](const State &s,int a,int b,int c,int W){ if(s.will_date()) return State(s.money(),s.love()-100,s.small_love(),false,s.week()+1); if(s.week()==W){ return State(s.money(),s.love(),s.small_love(),false,s.week()+1); } return State(s.money(),s.love(),s.small_love(),true,s.week()+1); }); m[1]=[](const State &s,int a,int b,int c,int W){ if(s.will_date()) return State(s.money()+a,s.love()-100,s.small_love(),false,s.week()+1); return State(s.money()+a,s.love(),s.small_love(),false,s.week()+1); }; m[2]=[](const State &s,int a,int b,int c,int W){ if(s.will_date()) return State(s.money()-c,s.love(),s.small_love()+b,false,s.week()+1); return State(s.money(),s.love(),s.small_love(),false,s.week()+1); }; int W; cin>>W; vector> data; vector tmp; int x; for(int i=0;i>x; tmp.push_back(x); } data.push_back(tmp); } //cout<<"solve:"<