Submission #1868131


Source Code Expand

// C++11
#include <cmath>
#include <string>
#include <vector>
#include <queue>
#include <set>
#include <sstream>
#include <fstream>
#include <algorithm>
#include <iomanip>
#include <iostream>
#define SUBMIT
//#define BATCH
#ifndef SUBMIT

template < typename T > std::string to_string(const T& n)
{
	std::ostringstream stm;
	stm << n;
	return stm.str();
}

#endif // !SUBMIT

using namespace std;
#ifdef SUBMIT
const int64_t CYCLES_PER_SEC = 2800000000;
#else
const int64_t CYCLES_PER_SEC = 2500000000;
#endif
const double TIMELIMIT_SA = 29;
const double TIMELIMIT_GREEDY = 5;
struct Timer {
	int64_t start;
	Timer() { reset(); }
	void reset() { start = getCycle(); }
	void plus(double a) { start -= (a * CYCLES_PER_SEC); }
	inline double get() { return (double)(getCycle() - start) / CYCLES_PER_SEC; }
	inline int64_t getCycle() {
		uint32_t low, high;
		__asm__ volatile ("rdtsc" : "=a" (low), "=d" (high));
		return ((int64_t)low) | ((int64_t)high << 32);
	}
};
class XorShift {
public:
	unsigned int x, y, z, w;
	double nL[65536];

	XorShift()
	{
		init();
	}

	void init()
	{
		x = 314159265; y = 358979323; z = 846264338; w = 327950288;
		double n = 1 / (double)(2 * 65536);
		for (int i = 0; i < 65536; ++i) {
			nL[i] = log(((double)i / 65536) + n);
		}
	}

	inline unsigned int next()
	{
		unsigned int t = x ^ x << 11; x = y; y = z; z = w; return w = w ^ w >> 19 ^ t ^ t >> 8;
	}

	inline double nextLog() {
		return nL[next() & 0xFFFF];
	}

	inline int nextInt(int m)
	{
		return (int)(next() % m);
	}


	int nextInt(int min, int max)
	{
		return min + nextInt(max - min + 1);
	}


	double nextDouble()
	{
		return (double)next() / ((long long)1 << 32);
	}


};
XorShift rnd;
XorShift genrnd;
Timer timer;
vector<vector<int> > mat;
vector<vector<int> > ed;

int N, M;
int V;
int E;
int inputcnt = 0;
#ifdef SUBMIT
void input() {
	cin >> N >> M;
	E = M;
	mat.resize(N, vector<int>(N, 0));
	//ed.resize(N);
	//va.resize(N);
	int a, b, c;
	for (int i = 0; i < M; ++i) {
		cin >> a >> b;
		a--;
		b--;
		mat[a][b] = 1;
		mat[b][a] = 1;
		//ed[a].push_back(b);
		//va[a].push_back(c);
		//ed[b].push_back(a);
		//va[b].push_back(c);
	}
	int t;
	cin >> V >> t;
	V = (int)(sqrt(V) + 0.1);
	for (int i = 0; i < t; ++i) {
		cin >> a >> b;
	}
}
#else
void init() {
	mat.clear();
	timer.reset();
}
void input() {

	N = genrnd.nextInt(496) + 5;
	mat.resize(N, vector<int>(N, 0));
	int c;
	int nn = genrnd.nextInt(N, min(20000, (N - 1)*N / 2));
	int ii, jj;
	E = 0;
	for (int i = 1; i < N; i++) {
		ii = i;
		jj = genrnd.nextInt(i);
		if (mat[ii][jj] == 0 && ii != jj) {
			mat[ii][jj] = 1;
			mat[jj][ii] = 1;
			E++;
		}
	}
	while (E < nn) {
		ii = genrnd.nextInt(N);
		jj = genrnd.nextInt(N);
		if (mat[ii][jj] == 0 && ii != jj) {
			mat[ii][jj] = 1;
			mat[jj][ii] = 1;
			E++;
		}
	}



	while (true) {
		V = genrnd.nextInt(60) + 1;
		if (V*V >= N) break;
	}
	inputcnt++;
	//V = 5;
}
#endif
inline bool isvalid(int x, int y) {
	return x >= 0 && y >= 0 && x < V && y < V;
}
vector<vector<int> > ne;
void setps() {
	ed.clear();
	ed.resize(N);
	for (int i = 0; i < N; ++i) {
		for (int j = 0; j < N; ++j) {
			if (mat[i][j] > 0) {
				ed[i].push_back(j);
			}
		}
	}
	ne.clear();
	ne.resize(V*V);
	for (int i = 0; i < V; i++) {
		for (int j = 0; j < V; j++) {
			for (int ii = i - 1; ii <= i + 1; ii++) {
				for (int jj = j - 1; jj <= j + 1; jj++) {
					if (ii != i || jj != j) {
						if (isvalid(ii, jj)) {
							ne[i*V + j].push_back(ii*V + jj);
						}
					}
				}
			}
		}
	}
}


int getScore(vector<int> &od) {
	int score = 0;
	vector<vector<int> >mpe(N, vector<int>(N, 0));
	int a;
	for (int pos = 0; pos < V*V; ++pos) {
		a = od[pos];
		if (a != -1) {
			for (int i = 0; i < ne[pos].size(); i++) {
				if (od[ne[pos][i]] != -1) {
					if (mat[a][od[ne[pos][i]]] == 1) {
						if (a < od[ne[pos][i]]) {
							if (mpe[a][od[ne[pos][i]]] == 0) {
								score++;
							}
							mpe[a][od[ne[pos][i]]]++;
						}
						else if (a > od[ne[pos][i]]) {
							if (mpe[od[ne[pos][i]]][a] == 0) {
								score++;
							}
							mpe[od[ne[pos][i]]][a]++;
						}
					}
				}
			}
		}
	}
	return score;
}
//struct stateSA {
//
//};
vector<vector<int> > mp;
vector<int> od;
vector<int> edc;
vector<int> root;
vector<int> scp;
vector<int> wh;
vector<int> ud1;
vector<int> ud2;
vector<int> ud3;

vector<vector<int> > updated;
//vector<vector<int> > uval;
vector <vector<int> > res;
int upd;
inline void undo() {
	for (int i = (int)ud1.size() - 1; i >= 0; i--) {
		mp[ud1[i]][ud2[i]] = ud3[i];
		mp[ud2[i]][ud1[i]] = ud3[i];
	}	
}
inline int putdiff(int a, int pos) {
	int ret = -1;
	od[pos] = a;
	int g;
	for (int i = 0; i < ne[pos].size(); i++) {
		g = od[ne[pos][i]];
		if (g != -1) {
			if (mat[a][g] == 1) {
				if (mp[a][g] == 0) {
					ret += 100;
				}
				if (updated[a][g] != upd) {
					updated[a][g] = upd;
					ud1.push_back(a);
					ud2.push_back(g);
					ud3.push_back(mp[a][g]);
				}
				mp[a][g]++;
				mp[g][a]++;
				
			}
		}
	}
	return ret;
}
inline void put(int a, int pos, int rt) {

	od[pos] = a;
	root[pos] = rt;
	wh[pos] = res[a].size();
	res[a].push_back(pos);
	//pwh[pos] = posl.size();
	//posl.push_back(pos);
	if (rt != -1) {
		edc[rt]++;
		edc[pos] = 1;
	}
	else {
		edc[pos] = 0;
	}
}
inline int remdiff(int pos) {
	int ret = 1;
	int a = od[pos];
	od[pos] = -1;
	int g;
	for (int i = 0; i < ne[pos].size(); i++) {
		g = od[ne[pos][i]];
		if (g != -1) {
			if (mat[a][g] == 1) {
				if (mp[a][g] == 1) {
					ret -= 100;
				}
				if (updated[a][g] != upd) {
					updated[a][g] = upd;
					ud1.push_back(a);
					ud2.push_back(g);
					ud3.push_back(mp[a][g]);
				}
				mp[a][g]--;
				mp[g][a]--;
			}
		}
	}
	return ret;
}
inline void remove(int pos) {
	
	int a = od[pos];
	swap(res[a][wh[pos]], res[a].back());
	wh[res[a][wh[pos]]] = wh[pos];
	res[a].pop_back();
	wh[pos] = -1;
	/*swap(posl[pwh[pos]], posl.back());
	pwh[posl[pwh[pos]]] = pwh[pos];
	posl.pop_back();
	pwh[pos] = -1;*/
	if (root[pos] == -1) {
		if (edc[pos] == 1) {
			int k = -1;
			for (int i = 0; i < ne[pos].size(); i++) {
				if (root[ne[pos][i]] == pos) {
					k = ne[pos][i];
					break;
				}
			}
			/*if (k == -1) {
				cerr << "ERROR2" << endl;
			}*/
			root[k] = -1;
			edc[k]--;
		}
	}
	else {
		edc[root[pos]]--;
	}
	od[pos] = -1;
	edc[pos] = -1;
	root[pos] = -2;
}
void solveinit() {
	for (int i = 0; i < N; i++) {
		res[i].push_back(i);
	}
}
int SA() {
	mp.clear(); mp.resize(N, vector<int>(N, 0));
	updated.clear(); updated.resize(N, vector<int>(N, 0));
	//uval.clear(); uval.resize(N, vector<int>(N, 0));
	od.clear(); od.resize(V*V, -1);
	edc.clear(); edc.resize(V*V, 0);
	root.clear(); root.resize(V*V, -1);
	
	scp.clear(); scp.resize(N, 0);
	wh.clear(); wh.resize(V*V, -1);
	res.clear(); res.resize(N);
	upd = 0;
	//solveinit();
	vector<vector<int> > best;
	int bestscore = -1;
	double T;
	double T0 = 20;
	double ti;
	int t1, t2;
	int cnt = 0;
	int cnt2 = 0;
	int score = 5000 + N;
	int bf;
	double dtime = 0;
	int diff;
	int V2 = V*V;
	int kouho[10];
	int khsz = 0;
	{
		vector<int> list;
		int mn;
		int ss;
		for (int i = 0; i < V2; i++) {
			list.push_back(i);
		}
		for (int i = 0; i < N; i++) {
			mn = 100000000;
			for (int j = 0; j < list.size(); j++) {
				ss = abs((list[j] % V) - (V / 2)) + abs((list[j] / V) - (V / 2));
				if (mn > ss) {
					mn = ss;
					t1 = j;
				}
			}
			//t1 = rnd.nextInt(list.size());
			score += putdiff(i, list[t1]);
			put(i, list[t1], -1);
			swap(list[t1], list.back());
			list.pop_back();
		}
	}
	best = res;
	bestscore = score;
	cerr << score << endl;
	int posK;
	int posT;
	int val;
	double M = 0.0;
	
	//double Mdiff = 1e-6;
	//T = 25;
	T0 = 40;
	while (true) {
		if ((cnt & 0xFFF) == 0) {
			ti = timer.get();
			if (ti > TIMELIMIT_SA)break;
			T = (T0*(TIMELIMIT_SA - ti) / TIMELIMIT_SA) + 10;
			//T = 100 * pow(0.2, ti / TIMELIMIT_SA);
			//M = (ti / TIMELIMIT_SA) * 0.2;
			//M = 0.1 - M;
		}
	
#ifndef SUBMIT
		if (ti > dtime) {
			cerr << score << endl;
			dtime += 1;
		}
#endif
		//cerr << "ok" << endl;

		ud1.clear();
		ud2.clear();
		ud3.clear();
		//while (true)
		//{
			val = rnd.nextInt(N);
			posK = res[val][rnd.nextInt((int)res[val].size())];
			//if (edc[posK] <= 1)break;
		//}
		
		//posK = posl[rnd.nextInt(posl.size())];
		//val = od[posK];
		

	/*	if (edc[posK] == 1 && rnd.nextDouble() < M) {
		upd++;
			diff = remdiff(posK);
			od[posK] = val;
			if (diff >= 0 || diff > T*rnd.nextLog()) {
				cnt2++;
				score += diff;
				remove(posK);
			}
			else {
				undo();
			}

		}
		else*/ if (edc[posK] == 0 && rnd.nextInt(5) > 0) {
			t1 = ed[val][rnd.nextInt(ed[val].size())];
			t2 = res[t1][rnd.nextInt((int)res[t1].size())];
			
			khsz = 0;
			for (int i = 0; i < ne[t2].size(); i++) {
				if (od[ne[t2][i]] == -1 || edc[ne[t2][i]] <= 1) {
					kouho[khsz] = ne[t2][i];
					khsz++;
				}
			}
			if (khsz > 0) {
				posT = kouho[rnd.nextInt(khsz)];
				//posT = ne[t2][rnd.nextInt(ne[t2].size())];
				if (od[posT] == -1) {
					upd++;
					diff = remdiff(posK) + putdiff(val, posT);
					od[posT] = -1;
					od[posK] = val;
					if (diff >= 0 || diff > T*rnd.nextLog()) {
						cnt2++;
						score += diff;

						remove(posK);
						put(val, posT, -1);
						if (bestscore < score) {
							bestscore = score;
							best = res;
						}
					}
					else {
						undo();
					}
				}
				//else if (edc[posT] == 1 && rnd.nextDouble() < M) {
				else if (edc[posT] == 1) {
					if (od[posT] != od[posK]) {
						t1 = od[posT];
						upd++;
						diff = remdiff(posK) + remdiff(posT) + putdiff(val, posT);
						od[posK] = val;
						od[posT] = t1;
						if (diff >= 0 || diff > T*rnd.nextLog()) {
							cnt2++;
							score += diff;
							remove(posK);
							remove(posT);
							put(val, posT, -1);
							if (bestscore < score) {
								bestscore = score;
								best = res;
							}
						}
						else {
							undo();
						}
					}
				}
				else if (edc[posT] == 0) {
					if (od[posT] != od[posK]) {
						t1 = od[posT];
						upd++;
						diff = remdiff(posK) + remdiff(posT) + putdiff(val, posT) + putdiff(t1, posK);
						od[posK] = val;
						od[posT] = t1;
						if (diff >= 0 || diff > T*rnd.nextLog()) {
							/*if ((int)res[od[posT]].size() == 1) {
							cerr << "ERROR" << endl;
							}*/
							cnt2++;
							score += diff;

							remove(posK);
							remove(posT);
							put(val, posT, -1);
							put(t1, posK, -1);
							if (bestscore < score) {
								bestscore = score;
								best = res;
							}
						}
						else {
							undo();
						}
					}
				}
			}
		}
		else {
			khsz = 0;
			for (int i = 0; i < ne[posK].size(); i++) {
				if (od[ne[posK][i]] == -1 || edc[ne[posK][i]] <= 1) {
					kouho[khsz] = ne[posK][i];
					khsz++;
				}
			}
			if (khsz > 0) {
				posT = kouho[rnd.nextInt(khsz)];
			//posT = ne[posK][rnd.nextInt(ne[posK].size())];
				t1 = 0;
				for (int i = 0; i < ne[posT].size(); i++) {
					if (od[ne[posT][i]] == val)t1++;
				}
				if (t1 <= 1) {
					if (od[posT] == -1) {
						/*	t1 = 0;
							for (int i = 0; i < ne[posT].size(); i++) {
								if (od[ne[posT][i]] == val)t1++;
							}
							if (t1 <= 1) {*/
						upd++;
						diff = putdiff(val, posT);
						od[posT] = -1;
						if (diff >= 0 || diff > T*rnd.nextLog()) {
							score += diff;
							cnt2++;

							put(val, posT, posK);
							if (bestscore < score) {
								bestscore = score;
								best = res;
							}
						}
						else {
							undo();
						}
						//}
					}
					else if (edc[posT] == 1) {
						if (od[posT] != od[posK]) {
							t1 = od[posT];
							upd++;
							diff = remdiff(posT) + putdiff(val, posT);
							od[posT] = t1;
							if (diff >= 0 || diff > T*rnd.nextLog()) {
								score += diff;
								cnt2++;

								remove(posT);
								put(val, posT, posK);
								if (bestscore < score) {
									bestscore = score;
									best = res;
								}
							}
							else {
								undo();
							}
						}
					}
				}
			}

		}

		cnt++;

	}
	res = best;
	for (int i = 0; i < V2; i++) {
		od[i] = -1;
	}
	for (int i = 0; i < N; i++) {
		for (int j = 0; j < res[i].size(); j++) {
			if (od[res[i][j]] != -1) {
				cerr << "ERROR" << endl;
			}
			od[res[i][j]] = i;
		}
	}
#ifndef  SUBMIT



	queue<int> qu;
	vector<int> v(V2, 0);
	vector<int> ch(N, 0);
	for (int i = 0; i < V2; i++) {
		if (v[i] == 0) {
			if (od[i] == -1) {
				v[i] = 1;
			}
			else {
				if (ch[od[i]] != 0) {
					cerr << "ERROR2" << endl;
				}
				qu.push(i);
				while (!qu.empty()) {
					t1 = qu.front();
					qu.pop();
					for (int j = 0; j < ne[t1].size(); j++) {
						if (od[ne[t1][j]] == od[i]) {
							if (v[ne[t1][j]] == 0) {
								v[ne[t1][j]] = 1;
								qu.push(ne[t1][j]);
							}
						}
					}
				}
				ch[od[i]] = 1;
			}
		}
	}

	int rs = getScore(od);
	score = rs * 100 + 5000;
	if (rs == E) {
		score += 100000;
	}
	for (int i = 0; i < N; i++) {
		score -= (int)res[i].size() - 1;
	}
	cerr << "cnt=" << cnt << endl;
	cerr << "cnt2=" << cnt2 << endl;
	cerr << "rawscore=" << score << endl;
#endif // ! SUBMIT
	res.clear();
	res.resize(N);
	for (int i = 0; i < V*V; i++) {
		if (od[i] != -1) {
			res[od[i]].push_back(i);
		}
	}
#ifndef SUBMIT
#ifndef BATCH
	ofstream ofs("od.csv");
	for (int i = 0; i < V; i++) {
		for (int j = 0; j < V; j++) {
			ofs << od[i*V + j] << ",";
		}
		ofs << endl;
	}
#endif
#endif
	return score;
}
int solve() {
	rnd.init();
	input();
#ifndef SUBMIT
	timer.reset();
#endif
	setps();
	int score;

	cerr << N << " " << V << " " << E << endl;
	score = SA();

	cerr << "score" << score << endl;
#ifdef SUBMIT
	for (int i = 0; i < N; ++i) {
		cout << res[i].size();
		for (int j = 0; j < res[i].size(); j++) {
			cout << " " << (res[i][j] + 1);
		}
		cout << endl;
	}
#endif
	return score;
}
#ifdef SUBMIT
int main() {
	solve();
}
#else
#ifndef BATCH
int main() {
	for (int i = 0; i < 25; ++i) {
		input();
		init();
	}
	solve();
}
#else
int main() {
	int score;
	ofstream ofs("output.csv");
	for (int i = 0; i < 30; ++i) {
		init();
		score = solve();
		ofs << i << "," << N << "," << E << "," << score << endl;
	}
}
#endif
#endif

Submission Info

Submission Time
Task A - Problem 2
User ats5515
Language C++14 (GCC 5.4.1)
Score 18263948
Code Size 14792 Byte
Status AC
Exec Time 29082 ms
Memory 6784 KB

Judge Result

Set Name random_000 random_001 random_002 random_003 random_004 random_005 random_006 random_007 random_008 random_009 random_010 random_011 random_012 random_013 random_014 random_015 random_016 random_017 random_018 random_019 random_020 random_021 random_022 random_023 random_024 random_025 random_026 random_027 random_028 random_029 random_030 random_031 random_032 random_033 random_034 random_035 random_036 random_037 random_038 random_039 random_040 random_041 random_042 random_043 random_044 random_045 random_046 random_047 random_048 random_049 random_050 random_051 random_052 random_053 random_054 random_055 random_056 random_057 random_058 random_059 random_060 random_061 random_062 random_063 random_064 random_065 random_066 random_067 random_068 random_069 random_070 random_071 random_072 random_073 random_074 random_075 random_076 random_077 random_078 random_079 random_080 random_081 random_082 random_083 random_084 random_085 random_086 random_087 random_088 random_089 random_090 random_091 random_092 random_093 random_094 random_095 random_096 random_097 random_098 random_099 random_100 random_101 random_102 random_103 random_104 random_105 random_106 random_107 random_108 random_109 random_110 random_111 random_112 random_113 random_114 random_115 random_116 random_117 random_118 random_119 random_120 random_121 random_122 random_123 random_124 random_125 random_126 random_127 random_128 random_129 random_130 random_131 random_132 random_133 random_134 random_135 random_136 random_137 random_138 random_139 random_140 random_141 random_142 random_143 random_144 random_145 random_146 random_147 random_148 random_149
Score / Max Score 119616 / 1000000 64243 / 1000000 110991 / 1000000 129848 / 1000000 76556 / 1000000 131068 / 1000000 164083 / 1000000 192194 / 1000000 35865 / 1000000 25464 / 1000000 174535 / 1000000 187534 / 1000000 55260 / 1000000 17530 / 1000000 31043 / 1000000 161154 / 1000000 90070 / 1000000 149543 / 1000000 30347 / 1000000 130111 / 1000000 186151 / 1000000 101157 / 1000000 168701 / 1000000 97715 / 1000000 91679 / 1000000 48371 / 1000000 110455 / 1000000 129238 / 1000000 39421 / 1000000 122204 / 1000000 46525 / 1000000 236059 / 1000000 186019 / 1000000 182581 / 1000000 62842 / 1000000 200313 / 1000000 160254 / 1000000 147881 / 1000000 129618 / 1000000 224067 / 1000000 45932 / 1000000 67021 / 1000000 176878 / 1000000 58564 / 1000000 125549 / 1000000 234826 / 1000000 163558 / 1000000 161022 / 1000000 20743 / 1000000 80885 / 1000000 98908 / 1000000 67083 / 1000000 34719 / 1000000 77953 / 1000000 175246 / 1000000 113956 / 1000000 93316 / 1000000 227026 / 1000000 176983 / 1000000 162662 / 1000000 137104 / 1000000 94882 / 1000000 82141 / 1000000 128139 / 1000000 104952 / 1000000 200774 / 1000000 134041 / 1000000 128042 / 1000000 114823 / 1000000 158361 / 1000000 81811 / 1000000 67210 / 1000000 112728 / 1000000 177378 / 1000000 56438 / 1000000 121157 / 1000000 127095 / 1000000 191624 / 1000000 181657 / 1000000 174633 / 1000000 183940 / 1000000 85381 / 1000000 124166 / 1000000 159184 / 1000000 5599 / 1000000 112578 / 1000000 115876 / 1000000 144753 / 1000000 173662 / 1000000 30193 / 1000000 116924 / 1000000 96627 / 1000000 159279 / 1000000 221364 / 1000000 97129 / 1000000 78387 / 1000000 124164 / 1000000 180332 / 1000000 73377 / 1000000 129169 / 1000000 80321 / 1000000 210789 / 1000000 87963 / 1000000 35019 / 1000000 142197 / 1000000 88125 / 1000000 187334 / 1000000 175154 / 1000000 95010 / 1000000 148460 / 1000000 21019 / 1000000 187573 / 1000000 137625 / 1000000 193143 / 1000000 95341 / 1000000 118080 / 1000000 164316 / 1000000 201589 / 1000000 159621 / 1000000 27544 / 1000000 80107 / 1000000 60380 / 1000000 93562 / 1000000 193501 / 1000000 199436 / 1000000 59006 / 1000000 24571 / 1000000 61830 / 1000000 109988 / 1000000 203775 / 1000000 63878 / 1000000 84812 / 1000000 116426 / 1000000 117774 / 1000000 170215 / 1000000 155004 / 1000000 139818 / 1000000 150564 / 1000000 199353 / 1000000 101465 / 1000000 204522 / 1000000 34537 / 1000000 68803 / 1000000 18524 / 1000000 120376 / 1000000 164980 / 1000000 177567 / 1000000 35394 / 1000000 194690 / 1000000 204657 / 1000000
Status
AC × 1
AC × 1
AC × 1
AC × 1
AC × 1
AC × 1
AC × 1
AC × 1
AC × 1
AC × 1
AC × 1
AC × 1
AC × 1
AC × 1
AC × 1
AC × 1
AC × 1
AC × 1
AC × 1
AC × 1
AC × 1
AC × 1
AC × 1
AC × 1
AC × 1
AC × 1
AC × 1
AC × 1
AC × 1
AC × 1
AC × 1
AC × 1
AC × 1
AC × 1
AC × 1
AC × 1
AC × 1
AC × 1
AC × 1
AC × 1
AC × 1
AC × 1
AC × 1
AC × 1
AC × 1
AC × 1
AC × 1
AC × 1
AC × 1
AC × 1
AC × 1
AC × 1
AC × 1
AC × 1
AC × 1
AC × 1
AC × 1
AC × 1
AC × 1
AC × 1
AC × 1
AC × 1
AC × 1
AC × 1
AC × 1
AC × 1
AC × 1
AC × 1
AC × 1
AC × 1
AC × 1
AC × 1
AC × 1
AC × 1
AC × 1
AC × 1
AC × 1
AC × 1
AC × 1
AC × 1
AC × 1
AC × 1
AC × 1
AC × 1
AC × 1
AC × 1
AC × 1
AC × 1
AC × 1
AC × 1
AC × 1
AC × 1
AC × 1
AC × 1
AC × 1
AC × 1
AC × 1
AC × 1
AC × 1
AC × 1
AC × 1
AC × 1
AC × 1
AC × 1
AC × 1
AC × 1
AC × 1
AC × 1
AC × 1
AC × 1
AC × 1
AC × 1
AC × 1
AC × 1
AC × 1
AC × 1
AC × 1
AC × 1
AC × 1
AC × 1
AC × 1
AC × 1
AC × 1
AC × 1
AC × 1
AC × 1
AC × 1
AC × 1
AC × 1
AC × 1
AC × 1
AC × 1
AC × 1
AC × 1
AC × 1
AC × 1
AC × 1
AC × 1
AC × 1
AC × 1
AC × 1
AC × 1
AC × 1
AC × 1
AC × 1
AC × 1
AC × 1
AC × 1
AC × 1
AC × 1
Set Name Test Cases
random_000 10_random_000
random_001 10_random_001
random_002 10_random_002
random_003 10_random_003
random_004 10_random_004
random_005 10_random_005
random_006 10_random_006
random_007 10_random_007
random_008 10_random_008
random_009 10_random_009
random_010 10_random_010
random_011 10_random_011
random_012 10_random_012
random_013 10_random_013
random_014 10_random_014
random_015 10_random_015
random_016 10_random_016
random_017 10_random_017
random_018 10_random_018
random_019 10_random_019
random_020 10_random_020
random_021 10_random_021
random_022 10_random_022
random_023 10_random_023
random_024 10_random_024
random_025 10_random_025
random_026 10_random_026
random_027 10_random_027
random_028 10_random_028
random_029 10_random_029
random_030 10_random_030
random_031 10_random_031
random_032 10_random_032
random_033 10_random_033
random_034 10_random_034
random_035 10_random_035
random_036 10_random_036
random_037 10_random_037
random_038 10_random_038
random_039 10_random_039
random_040 10_random_040
random_041 10_random_041
random_042 10_random_042
random_043 10_random_043
random_044 10_random_044
random_045 10_random_045
random_046 10_random_046
random_047 10_random_047
random_048 10_random_048
random_049 10_random_049
random_050 10_random_050
random_051 10_random_051
random_052 10_random_052
random_053 10_random_053
random_054 10_random_054
random_055 10_random_055
random_056 10_random_056
random_057 10_random_057
random_058 10_random_058
random_059 10_random_059
random_060 10_random_060
random_061 10_random_061
random_062 10_random_062
random_063 10_random_063
random_064 10_random_064
random_065 10_random_065
random_066 10_random_066
random_067 10_random_067
random_068 10_random_068
random_069 10_random_069
random_070 10_random_070
random_071 10_random_071
random_072 10_random_072
random_073 10_random_073
random_074 10_random_074
random_075 10_random_075
random_076 10_random_076
random_077 10_random_077
random_078 10_random_078
random_079 10_random_079
random_080 10_random_080
random_081 10_random_081
random_082 10_random_082
random_083 10_random_083
random_084 10_random_084
random_085 10_random_085
random_086 10_random_086
random_087 10_random_087
random_088 10_random_088
random_089 10_random_089
random_090 10_random_090
random_091 10_random_091
random_092 10_random_092
random_093 10_random_093
random_094 10_random_094
random_095 10_random_095
random_096 10_random_096
random_097 10_random_097
random_098 10_random_098
random_099 10_random_099
random_100 10_random_100
random_101 10_random_101
random_102 10_random_102
random_103 10_random_103
random_104 10_random_104
random_105 10_random_105
random_106 10_random_106
random_107 10_random_107
random_108 10_random_108
random_109 10_random_109
random_110 10_random_110
random_111 10_random_111
random_112 10_random_112
random_113 10_random_113
random_114 10_random_114
random_115 10_random_115
random_116 10_random_116
random_117 10_random_117
random_118 10_random_118
random_119 10_random_119
random_120 10_random_120
random_121 10_random_121
random_122 10_random_122
random_123 10_random_123
random_124 10_random_124
random_125 10_random_125
random_126 10_random_126
random_127 10_random_127
random_128 10_random_128
random_129 10_random_129
random_130 10_random_130
random_131 10_random_131
random_132 10_random_132
random_133 10_random_133
random_134 10_random_134
random_135 10_random_135
random_136 10_random_136
random_137 10_random_137
random_138 10_random_138
random_139 10_random_139
random_140 10_random_140
random_141 10_random_141
random_142 10_random_142
random_143 10_random_143
random_144 10_random_144
random_145 10_random_145
random_146 10_random_146
random_147 10_random_147
random_148 10_random_148
random_149 10_random_149
Case Name Status Exec Time Memory
10_random_000 AC 29082 ms 3072 KB
10_random_001 AC 29076 ms 1920 KB
10_random_002 AC 29076 ms 1280 KB
10_random_003 AC 29077 ms 2816 KB
10_random_004 AC 29076 ms 1664 KB
10_random_005 AC 29077 ms 1792 KB
10_random_006 AC 29077 ms 5888 KB
10_random_007 AC 29077 ms 3200 KB
10_random_008 AC 29076 ms 1408 KB
10_random_009 AC 29076 ms 1408 KB
10_random_010 AC 29077 ms 2176 KB
10_random_011 AC 29077 ms 6528 KB
10_random_012 AC 29077 ms 3072 KB
10_random_013 AC 29076 ms 1536 KB
10_random_014 AC 29076 ms 1664 KB
10_random_015 AC 29077 ms 2560 KB
10_random_016 AC 29077 ms 2176 KB
10_random_017 AC 29077 ms 2560 KB
10_random_018 AC 29076 ms 1408 KB
10_random_019 AC 29077 ms 5760 KB
10_random_020 AC 29077 ms 2176 KB
10_random_021 AC 29078 ms 3328 KB
10_random_022 AC 29077 ms 2816 KB
10_random_023 AC 29078 ms 3968 KB
10_random_024 AC 29077 ms 3456 KB
10_random_025 AC 29076 ms 1664 KB
10_random_026 AC 29077 ms 6272 KB
10_random_027 AC 29076 ms 1792 KB
10_random_028 AC 29076 ms 1408 KB
10_random_029 AC 29076 ms 1792 KB
10_random_030 AC 29077 ms 2688 KB
10_random_031 AC 29078 ms 6784 KB
10_random_032 AC 29077 ms 2304 KB
10_random_033 AC 29077 ms 2560 KB
10_random_034 AC 29077 ms 2048 KB
10_random_035 AC 29077 ms 2944 KB
10_random_036 AC 29077 ms 3072 KB
10_random_037 AC 29077 ms 6016 KB
10_random_038 AC 29078 ms 3840 KB
10_random_039 AC 29077 ms 2688 KB
10_random_040 AC 29077 ms 1792 KB
10_random_041 AC 29076 ms 1536 KB
10_random_042 AC 29077 ms 5632 KB
10_random_043 AC 29077 ms 1920 KB
10_random_044 AC 29078 ms 4096 KB
10_random_045 AC 29077 ms 6656 KB
10_random_046 AC 29077 ms 2688 KB
10_random_047 AC 29077 ms 2944 KB
10_random_048 AC 29076 ms 1536 KB
10_random_049 AC 29077 ms 1792 KB
10_random_050 AC 29077 ms 1920 KB
10_random_051 AC 29076 ms 1792 KB
10_random_052 AC 29076 ms 1408 KB
10_random_053 AC 29076 ms 1664 KB
10_random_054 AC 29078 ms 3328 KB
10_random_055 AC 29078 ms 6016 KB
10_random_056 AC 29077 ms 1920 KB
10_random_057 AC 29077 ms 4096 KB
10_random_058 AC 29077 ms 4480 KB
10_random_059 AC 29078 ms 4480 KB
10_random_060 AC 29077 ms 2432 KB
10_random_061 AC 29077 ms 1792 KB
10_random_062 AC 29076 ms 1536 KB
10_random_063 AC 29076 ms 1920 KB
10_random_064 AC 29076 ms 1920 KB
10_random_065 AC 29078 ms 6144 KB
10_random_066 AC 29078 ms 4096 KB
10_random_067 AC 29077 ms 2816 KB
10_random_068 AC 29076 ms 2048 KB
10_random_069 AC 29077 ms 3072 KB
10_random_070 AC 29077 ms 1792 KB
10_random_071 AC 29077 ms 1536 KB
10_random_072 AC 29076 ms 1792 KB
10_random_073 AC 29077 ms 3584 KB
10_random_074 AC 29076 ms 1536 KB
10_random_075 AC 29078 ms 2688 KB
10_random_076 AC 29076 ms 2048 KB
10_random_077 AC 29077 ms 2816 KB
10_random_078 AC 29077 ms 3328 KB
10_random_079 AC 29077 ms 2816 KB
10_random_080 AC 29077 ms 3968 KB
10_random_081 AC 29076 ms 1664 KB
10_random_082 AC 29078 ms 3712 KB
10_random_083 AC 29077 ms 6528 KB
10_random_084 AC 29076 ms 1408 KB
10_random_085 AC 29077 ms 2688 KB
10_random_086 AC 29076 ms 2432 KB
10_random_087 AC 29077 ms 2048 KB
10_random_088 AC 29077 ms 2560 KB
10_random_089 AC 29076 ms 1408 KB
10_random_090 AC 29076 ms 2304 KB
10_random_091 AC 29077 ms 2432 KB
10_random_092 AC 29078 ms 3456 KB
10_random_093 AC 29077 ms 3200 KB
10_random_094 AC 29077 ms 1792 KB
10_random_095 AC 29077 ms 1536 KB
10_random_096 AC 29077 ms 2944 KB
10_random_097 AC 29077 ms 3200 KB
10_random_098 AC 29076 ms 2432 KB
10_random_099 AC 29077 ms 2944 KB
10_random_100 AC 29078 ms 3456 KB
10_random_101 AC 29077 ms 3584 KB
10_random_102 AC 29077 ms 2176 KB
10_random_103 AC 29076 ms 1536 KB
10_random_104 AC 29077 ms 1920 KB
10_random_105 AC 29076 ms 1664 KB
10_random_106 AC 29078 ms 3200 KB
10_random_107 AC 29077 ms 2944 KB
10_random_108 AC 29077 ms 2048 KB
10_random_109 AC 29078 ms 3328 KB
10_random_110 AC 29076 ms 1536 KB
10_random_111 AC 29077 ms 6528 KB
10_random_112 AC 29077 ms 2944 KB
10_random_113 AC 29077 ms 3200 KB
10_random_114 AC 29077 ms 2176 KB
10_random_115 AC 29077 ms 2688 KB
10_random_116 AC 29077 ms 1920 KB
10_random_117 AC 29077 ms 2816 KB
10_random_118 AC 29078 ms 3328 KB
10_random_119 AC 29076 ms 1664 KB
10_random_120 AC 29077 ms 1920 KB
10_random_121 AC 29076 ms 1408 KB
10_random_122 AC 29077 ms 3072 KB
10_random_123 AC 29077 ms 3072 KB
10_random_124 AC 29077 ms 2560 KB
10_random_125 AC 29078 ms 3968 KB
10_random_126 AC 29076 ms 1280 KB
10_random_127 AC 29076 ms 1536 KB
10_random_128 AC 29076 ms 1280 KB
10_random_129 AC 29077 ms 2304 KB
10_random_130 AC 29077 ms 2176 KB
10_random_131 AC 29077 ms 3456 KB
10_random_132 AC 29077 ms 2560 KB
10_random_133 AC 29077 ms 2304 KB
10_random_134 AC 29077 ms 6400 KB
10_random_135 AC 29077 ms 4352 KB
10_random_136 AC 29078 ms 5888 KB
10_random_137 AC 29078 ms 3456 KB
10_random_138 AC 29078 ms 3712 KB
10_random_139 AC 29076 ms 1792 KB
10_random_140 AC 29077 ms 2560 KB
10_random_141 AC 29076 ms 1408 KB
10_random_142 AC 29077 ms 2432 KB
10_random_143 AC 29076 ms 1536 KB
10_random_144 AC 29077 ms 3584 KB
10_random_145 AC 29077 ms 2304 KB
10_random_146 AC 29077 ms 2304 KB
10_random_147 AC 29076 ms 1408 KB
10_random_148 AC 29077 ms 2944 KB
10_random_149 AC 29078 ms 6784 KB