답안 #977438

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
977438 2024-05-08T02:00:34 Z Amaarsaa 슈퍼트리 잇기 (IOI20_supertrees) C++14
11 / 100
162 ms 27352 KB
#include<bits/stdc++.h>
#include "supertrees.h"
using namespace std;
vector < int > adj[1002];
int used[1002];
vector < int > v;
void Go(int x) {
	used[x] = 1;
	v.push_back(x);
	for ( int X : adj[x]) {
		if (!used[X]) {
			Go(X);
		}
	}
}
int construct(std::vector<std::vector<int>> a) {
	int n = a.size(), i, j;
	vector < vector < int > > ans(n, vector<int>(n, 0));
	for ( i = 0; i < n; i++) {
		for ( j = 0; j < n; j ++) {
			if ( a[i][j] != 0 && i != j) adj[i].push_back(j);
		}
	}
	for ( i = 0; i < n; i ++) {
		if ( used[i] == 0) {
			v.clear();
			Go(i);
			for ( j = 1; j < v.size(); j ++) ans[v[j]][v[j - 1]] = ans[v[j - 1]][v[j]] = 1;
		}
	}
	
	build(ans);
	return 1;
}

Compilation message

supertrees.cpp: In function 'int construct(std::vector<std::vector<int> >)':
supertrees.cpp:28:19: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   28 |    for ( j = 1; j < v.size(); j ++) ans[v[j]][v[j - 1]] = ans[v[j - 1]][v[j]] = 1;
      |                 ~~^~~~~~~~~~
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 348 KB Output is correct
2 Correct 0 ms 348 KB Output is correct
3 Correct 0 ms 348 KB Output is correct
4 Correct 0 ms 348 KB Output is correct
5 Correct 0 ms 464 KB Output is correct
6 Correct 7 ms 1628 KB Output is correct
7 Correct 162 ms 27352 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 348 KB Output is correct
2 Correct 0 ms 348 KB Output is correct
3 Correct 0 ms 348 KB Output is correct
4 Correct 0 ms 348 KB Output is correct
5 Correct 0 ms 464 KB Output is correct
6 Correct 7 ms 1628 KB Output is correct
7 Correct 162 ms 27352 KB Output is correct
8 Correct 0 ms 348 KB Output is correct
9 Correct 0 ms 348 KB Output is correct
10 Correct 0 ms 348 KB Output is correct
11 Correct 1 ms 344 KB Output is correct
12 Correct 7 ms 1368 KB Output is correct
13 Correct 162 ms 23324 KB Output is correct
14 Incorrect 1 ms 344 KB Answer gives possible 1 while actual possible 0
15 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 348 KB Output is correct
2 Correct 0 ms 348 KB Output is correct
3 Correct 0 ms 464 KB Output is correct
4 Incorrect 0 ms 348 KB Answer gives possible 1 while actual possible 0
5 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 2 found 1
3 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 348 KB Output is correct
2 Correct 0 ms 348 KB Output is correct
3 Correct 0 ms 348 KB Output is correct
4 Correct 0 ms 348 KB Output is correct
5 Correct 0 ms 464 KB Output is correct
6 Correct 7 ms 1628 KB Output is correct
7 Correct 162 ms 27352 KB Output is correct
8 Correct 0 ms 348 KB Output is correct
9 Correct 0 ms 348 KB Output is correct
10 Correct 0 ms 348 KB Output is correct
11 Correct 1 ms 344 KB Output is correct
12 Correct 7 ms 1368 KB Output is correct
13 Correct 162 ms 23324 KB Output is correct
14 Incorrect 1 ms 344 KB Answer gives possible 1 while actual possible 0
15 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 348 KB Output is correct
2 Correct 0 ms 348 KB Output is correct
3 Correct 0 ms 348 KB Output is correct
4 Correct 0 ms 348 KB Output is correct
5 Correct 0 ms 464 KB Output is correct
6 Correct 7 ms 1628 KB Output is correct
7 Correct 162 ms 27352 KB Output is correct
8 Correct 0 ms 348 KB Output is correct
9 Correct 0 ms 348 KB Output is correct
10 Correct 0 ms 348 KB Output is correct
11 Correct 1 ms 344 KB Output is correct
12 Correct 7 ms 1368 KB Output is correct
13 Correct 162 ms 23324 KB Output is correct
14 Incorrect 1 ms 344 KB Answer gives possible 1 while actual possible 0
15 Halted 0 ms 0 KB -