Submission #131596

# Submission time Handle Problem Language Result Execution time Memory
131596 2019-07-17T10:11:56 Z Kewo Meetings (JOI19_meetings) C++17
0 / 100
4 ms 888 KB
#include "meetings.h"
#include <bits/stdc++.h>
#define fi first
#define se second
#define pb push_back
#define ppb pop_back
#define mid ((x + y) / 2)
#define left (ind * 2)
#define right (ind * 2 + 1)
#define spc " "
#define endl "\n"
#define fast_io() cin.tie(0);cout.tie(0);ios_base::sync_with_stdio(false)
using namespace std;

typedef pair<int, int> ii;
typedef long long int lli;

const int N = (305);
const int LOG = (20);

int mark[N];
set<int> below[N];

void Solve(int N) {
	for(int i = 1; i < N; i++)
		for(int j = i + 1; j < N; j++) {
			int node = Query(0, i, j);
			below[node].insert(i);
			below[node].insert(j);
		}
	for(int i = 0; i < N; i++)
		below[i].erase(i);
	assert(0);
	for(int i = 0; i < N; i++)
		if(below[i].size() == 0)
			mark[i] = 1;
	while(!mark[0])
		for(int i = 0; i < N; i++) {
			if(mark[i])
				continue;
			bool ok = true;
			for(auto j : below[i])
				if(!mark[j])
					ok = false;
			if(ok) {
				mark[i] = 1;
				for(auto j : below[i])
					if(mark[j] == 1) {
						if(i < j)
							Bridge(i, j);
						else
							Bridge(j, i);
						mark[j] = 2;
					}
			}
		}
}
# Verdict Execution time Memory Grader output
1 Runtime error 2 ms 632 KB Execution killed with signal 11 (could be triggered by violating memory limits)
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Runtime error 2 ms 632 KB Execution killed with signal 11 (could be triggered by violating memory limits)
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Runtime error 2 ms 632 KB Execution killed with signal 11 (could be triggered by violating memory limits)
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Runtime error 4 ms 888 KB Execution killed with signal 11 (could be triggered by violating memory limits)
2 Halted 0 ms 0 KB -