답안 #1083962

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
1083962 2024-09-04T16:11:46 Z nickolasarapidis 슈퍼트리 잇기 (IOI20_supertrees) C++17
0 / 100
1 ms 360 KB
#include "supertrees.h"
#include <bits/stdc++.h>
using namespace std;

int construct(vector<vector<int>> p){
	int N = p.size(), cnt = 0;

	vector<vector<int>> b(N, vector<int>(N, 0));

	vector<vector<int>> curPaths(N, vector<int>(N, 0));
	vector<vector<bool>> satisfied(N, vector<bool>(N, false));

	vector<int> adj[N];

	for(int i = 0; i < N; i++){
		for(int j = 0; j < N; j++){
			if(i == j){
				curPaths[i][j] = 1;
				satisfied[i][j] = true;
				cnt++;
			}

			if(p[i][j] == 0){
				satisfied[i][j] = true;
				cnt++;
			}
		}
	}

	if(cnt == N*N){
		build(b);
		return 1;
	}

	for(int i = 0; i < N; i++){
		for(int j = 0; j < N; j++){
			if(satisfied[i][j]) continue;

			for(int k = 0; k < N; k++){
				if(satisfied[i][k] = true) continue;
				if(p[j][k] == p[i][k]){
					b[i][k] = 1;
				}
			}
		}
	}

	build(b);

	return 1;
}
# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 348 KB Output is correct
2 Incorrect 0 ms 348 KB Too few ways to get from 0 to 1, should be 1 found 0
3 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 348 KB Output is correct
2 Incorrect 0 ms 348 KB Too few ways to get from 0 to 1, should be 1 found 0
3 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 344 KB Output is correct
2 Correct 0 ms 348 KB Output is correct
3 Correct 0 ms 348 KB Output is correct
4 Incorrect 0 ms 344 KB Answer gives possible 1 while actual possible 0
5 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 360 KB Output is correct
2 Incorrect 0 ms 348 KB Too few ways to get from 0 to 1, should be 2 found 0
3 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 348 KB Output is correct
2 Incorrect 0 ms 348 KB Too few ways to get from 0 to 1, should be 1 found 0
3 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 348 KB Output is correct
2 Incorrect 0 ms 348 KB Too few ways to get from 0 to 1, should be 1 found 0
3 Halted 0 ms 0 KB -