#include #define rep(i, n) for (int i = 0; i < (int)(n); i++) #define rep3(i, n, m) for (int i = m; i < (int)(n); i++) #define repr(i, n) for (int i = n-1; i >= 0; i--) #define all(v) v.begin(), v.end() #define SP << " " #define ll long long #define N_SIZE 100 #define M_SIZE 8 #define ALPHA 5 using namespace std; //定数周り int imax=2147483647; ll lmax=9223372036854775807; //焼きなましの定数 double TIME_LIMIT=985; double start_temp=400000.0; double end_temp=1000.0; //乱数の準備 // int seed=1; auto seed=(unsigned)time(NULL); mt19937_64 mt(seed); struct Pos{ int x; int y; Pos(){} Pos(int ix, int iy){ x=ix; y=iy; } bool operator<(const Pos &in) const{ return x!=in.x ? x wp; vector tour; int score(){ ll s=0; rep(i, wp.size()-1){ s+=wp[i].dist(wp[i+1]); } double base=1000000000.0; base/=1000+sqrt(s); base=round(base); return base; } void print(){ rep3(i, N_SIZE+M_SIZE, N_SIZE) cout<< wp[i].pos.x SP << wp[i].pos.y <> n >> m; rep(i, N_SIZE){ cin>> planets[i].x >> planets[i].y; // a[i]=mt()%1001; // b[i]=mt()%1001; // cout<< a[i] SP << b[i] <(current - start).count() > TIME_LIMIT) break; } //if(lp==20000) break; int type=mt()%4+1; //cout<< "type:" << type <(current - start).count() / TIME_LIMIT; // 遷移確率関数(最大化の場合) double prob = exp((n_sco-b_sco)/temp); if (prob > (mt()%imax)/(double)imax) { // 確率probで遷移する //if (nsco(current - start).count() <