Submission #902822

# Submission time Handle Problem Language Result Execution time Memory
902822 2024-01-11T03:22:34 Z ByeWorld Connecting Supertrees (IOI20_supertrees) C++14
0 / 100
1 ms 604 KB
#include "supertrees.h"
#include <bits/stdc++.h>
#define ll long long
#define fi first
#define se second
#define pb push_back
#define lb lower_bound
using namespace std;
const int MAXN = 1e3+10;
const double SMALL = 1e-6;
typedef pair<int,int> pii;
typedef pair<pii,int> ipii;

int n;
bool done[MAXN];
int use[MAXN];
vector <vector<int>> adj;

void bd(int x, int y){
	adj[x][y] = 1; adj[y][x] = 1;
}

int construct(vector<vector<int>> p) {
	n = p.size();
	vector <int> te(n);
	for(int i=0; i<n; i++) adj.pb(te);

	for(int i = 0; i < n; i++) {
		for(int j=i+1; j < n; j++){
			vector <int> vec; vec.pb(i);
			if(p[i][j] == 1) vec.pb(j);
			
			for(auto x : vec){
				for(auto y : vec){
					if(x==y) continue;
					if(p[x][y] != 1) return 0;
					bd(x, y);
				}
			}
		}
	}

	for(int i=0; i<n; i++) adj[i][i] = 0;
	build(adj);
	return 1;
}
# Verdict Execution time Memory Grader output
1 Correct 0 ms 344 KB Output is correct
2 Correct 1 ms 348 KB Output is correct
3 Incorrect 1 ms 604 KB Too many ways to get from 0 to 2, should be 1 found no less than 2
4 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 0 ms 344 KB Output is correct
2 Correct 1 ms 348 KB Output is correct
3 Incorrect 1 ms 604 KB Too many ways to get from 0 to 2, should be 1 found no less than 2
4 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 1 ms 348 KB Output is correct
2 Correct 0 ms 348 KB Output is correct
3 Correct 1 ms 600 KB Output is correct
4 Incorrect 1 ms 348 KB Answer gives possible 1 while actual possible 0
5 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 1 ms 348 KB Output is correct
2 Incorrect 1 ms 344 KB Too few ways to get from 0 to 1, should be 2 found 0
3 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 0 ms 344 KB Output is correct
2 Correct 1 ms 348 KB Output is correct
3 Incorrect 1 ms 604 KB Too many ways to get from 0 to 2, should be 1 found no less than 2
4 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 0 ms 344 KB Output is correct
2 Correct 1 ms 348 KB Output is correct
3 Incorrect 1 ms 604 KB Too many ways to get from 0 to 2, should be 1 found no less than 2
4 Halted 0 ms 0 KB -