【奇怪的題】Phigros by eafoo #二分
我一個蒟蒻肯定是不會打二分的 我根本不會二分的說
所以就有了$XIN隊$,然後這個是$XIN隊$的代碼
雖然WA了一個點剩下的全T掉()
應該是我寫掛了吧,,求調$qAq$
XIN
#include <iostream>
#include <iomanip>
#include <map>
// #include <unistd.h>
#define GMY (520&1314)
#define char_phi signed
#define re register int
#define MARK cout << "###"
#define Endl cout << endl
#define _ " "
#define _MARK "@@@"
#define LMARK "~~~&&&"
using namespace std;
double N, S;
struct phigros{
double P, G, mxc;
bool operator<(const phigros &phi) const{
if(phi.P != P) return phi.P < P;
else if(phi.G != G) return phi.G < G;
// else if(phi.mis != mis) return phi.mis < mis;
else return phi.mxc < mxc;
// if(phi.P != P) return P < phi.P;
// else if(phi.G != G) return G < phi.G;
// else if(phi.mis != mis) return mis < phi.mis;
// else return mxc < phi.mxc;
}
};
map<phigros, bool>mp;
void Fastio_setup(){
ios::sync_with_stdio(false);
cin.tie(NULL), cout.tie(NULL);
}
void XIN_team(double sc, double P, double G, double mis, double mxc, double combo){
// MARK;
// cout << sc << _ << P << _ << G << _ << mis << _ << mxc << _ << combo << endl;
// sleep(1);
if(sc == S){
if(mp[(phigros){P, G, mxc}] == true) return ;
cout << P << _ << G << _ << mxc << endl;
// cout << P << _ << G << _ << mis << _ << mxc << endl;
mp[(phigros){P, G, mxc}] = true;
return ;
}
if(sc > S){
return ;
}
if(mis > N){
return ;
}
// if(combo == mxc){
// 選擇打一個perfect(延續maxcombo)
mxc ++;
// XIN_team((mxc*100000.0 + ((P+1)+G*0.65)*900000.0)/N, P+1, G, mis, mxc, combo+1);
XIN_team(sc + 1000000.0/N, P+1, G, mis, mxc, combo+1);
mxc --;
// 選擇打一個good(中斷maxcombo)
// XIN_team((mxc*100000.0 + (P+(G+1)*0.65)*900000.0)/N, P, G+1, mis, mxc, 0);
XIN_team(sc + 0.65*900000.0/N, P, G+1, mis, mxc, 0);
// 選擇打一個miss(中斷maxcombo)
XIN_team(sc, P, G, mis+1, mxc, 0);
return ;
// }
// 選擇打一個perfect(累積combo而不是max)
// XIN_team((mxc*100000.0 + ((P+1)+G*0.65)*900000.0)/N, P+1, G, mis, mxc, combo+1);
XIN_team(sc + 900000.0/N, P+1, G, mis, mxc, combo+1);
// 選擇打一個good(中斷combo而達不到maxcombo)
// XIN_team((mxc*100000.0 + (P+(G+1)*0.65)*900000.0)/N, P, G+1, mis)
XIN_team(sc + 0.65*900000.0/N, P, G+1, mis, mxc, 0);
// 選擇打一個miss(中斷combo而達不到maxcombo)
XIN_team(sc, P, G, mis+1, mxc, 0);
}
void work(){
// eafooのphigros
// 算法標籤二分查找啥東西誒..
cin >> N >> S;
XIN_team(0, 0, 0, 0, 0, 0);// 經典XIN隊
}
// #define IXINGMY
char_phi main(){
Fastio_setup();
#ifdef IXINGMY
freopen("a.in", "r", stdin);
freopen("a.out", "w", stdout);
#endif
work();
return GMY;
}
$$\huge{\mathcal{Here\ We\ Are,\ Nick\ Of\ Time\ !}}$$

浙公网安备 33010602011771号