답안 #456197

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
456197 2021-08-06T08:49:52 Z osmanallazov 슈퍼트리 잇기 (IOI20_supertrees) C++14
21 / 100
390 ms 22176 KB
#include "supertrees.h"
#include<bits/stdc++.h>
#include <vector>
using namespace std;
bool used[1001];
int construct(vector<vector<int>> p)
{
    vector<int>v;
	int n=p.size();
	int b=1;
	vector<vector<int>>answer;
	answer.resize(n);
	for (int i=0;i<n;i++)
	{
		answer[i].resize(n);
	}
	for(int i=0;i<n;i++){
		if(used[i]==false)
		{
			v.clear();
			for(int j=0;j<n;j++)
				if(p[i][j])
				{
					if(p[i]==p[j]){
                    v.push_back(j);
					}
					else{
                            b=0;
					}
				}
			for(int j=0;j<v.size()-1;j++)
				answer[v[j]][v[j+1]]=answer[v[j+1]][v[j]]=1;
		}
	}
	if(b==0){
    return 0;
	}
	build(answer);
	return 1;
}

Compilation message

supertrees.cpp: In function 'int construct(std::vector<std::vector<int> >)':
supertrees.cpp:31:17: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   31 |    for(int j=0;j<v.size()-1;j++)
      |                ~^~~~~~~~~~~
# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 204 KB Output is correct
2 Correct 0 ms 204 KB Output is correct
3 Correct 0 ms 204 KB Output is correct
4 Correct 0 ms 204 KB Output is correct
5 Correct 0 ms 204 KB Output is correct
6 Correct 12 ms 1136 KB Output is correct
7 Correct 390 ms 22012 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 204 KB Output is correct
2 Correct 0 ms 204 KB Output is correct
3 Correct 0 ms 204 KB Output is correct
4 Correct 0 ms 204 KB Output is correct
5 Correct 0 ms 204 KB Output is correct
6 Correct 12 ms 1136 KB Output is correct
7 Correct 390 ms 22012 KB Output is correct
8 Correct 0 ms 204 KB Output is correct
9 Correct 0 ms 204 KB Output is correct
10 Correct 0 ms 204 KB Output is correct
11 Correct 0 ms 204 KB Output is correct
12 Correct 10 ms 1116 KB Output is correct
13 Correct 226 ms 22040 KB Output is correct
14 Correct 0 ms 204 KB Output is correct
15 Correct 0 ms 204 KB Output is correct
16 Correct 7 ms 716 KB Output is correct
17 Correct 111 ms 12028 KB Output is correct
18 Correct 0 ms 204 KB Output is correct
19 Correct 0 ms 204 KB Output is correct
20 Correct 58 ms 5672 KB Output is correct
21 Correct 249 ms 21956 KB Output is correct
22 Correct 236 ms 22176 KB Output is correct
23 Correct 326 ms 22024 KB Output is correct
24 Correct 234 ms 21916 KB Output is correct
25 Correct 126 ms 12100 KB Output is correct
26 Correct 113 ms 12032 KB Output is correct
27 Correct 326 ms 22028 KB Output is correct
28 Correct 232 ms 22024 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 204 KB Output is correct
2 Correct 1 ms 204 KB Output is correct
3 Correct 0 ms 204 KB Output is correct
4 Correct 0 ms 204 KB Output is correct
5 Incorrect 0 ms 204 KB Answer gives possible 0 while actual possible 1
6 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 204 KB Output is correct
2 Incorrect 0 ms 204 KB Answer gives possible 0 while actual possible 1
3 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 204 KB Output is correct
2 Correct 0 ms 204 KB Output is correct
3 Correct 0 ms 204 KB Output is correct
4 Correct 0 ms 204 KB Output is correct
5 Correct 0 ms 204 KB Output is correct
6 Correct 12 ms 1136 KB Output is correct
7 Correct 390 ms 22012 KB Output is correct
8 Correct 0 ms 204 KB Output is correct
9 Correct 0 ms 204 KB Output is correct
10 Correct 0 ms 204 KB Output is correct
11 Correct 0 ms 204 KB Output is correct
12 Correct 10 ms 1116 KB Output is correct
13 Correct 226 ms 22040 KB Output is correct
14 Correct 0 ms 204 KB Output is correct
15 Correct 0 ms 204 KB Output is correct
16 Correct 7 ms 716 KB Output is correct
17 Correct 111 ms 12028 KB Output is correct
18 Correct 0 ms 204 KB Output is correct
19 Correct 0 ms 204 KB Output is correct
20 Correct 58 ms 5672 KB Output is correct
21 Correct 249 ms 21956 KB Output is correct
22 Correct 236 ms 22176 KB Output is correct
23 Correct 326 ms 22024 KB Output is correct
24 Correct 234 ms 21916 KB Output is correct
25 Correct 126 ms 12100 KB Output is correct
26 Correct 113 ms 12032 KB Output is correct
27 Correct 326 ms 22028 KB Output is correct
28 Correct 232 ms 22024 KB Output is correct
29 Correct 1 ms 204 KB Output is correct
30 Correct 1 ms 204 KB Output is correct
31 Correct 0 ms 204 KB Output is correct
32 Correct 0 ms 204 KB Output is correct
33 Incorrect 0 ms 204 KB Answer gives possible 0 while actual possible 1
34 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 204 KB Output is correct
2 Correct 0 ms 204 KB Output is correct
3 Correct 0 ms 204 KB Output is correct
4 Correct 0 ms 204 KB Output is correct
5 Correct 0 ms 204 KB Output is correct
6 Correct 12 ms 1136 KB Output is correct
7 Correct 390 ms 22012 KB Output is correct
8 Correct 0 ms 204 KB Output is correct
9 Correct 0 ms 204 KB Output is correct
10 Correct 0 ms 204 KB Output is correct
11 Correct 0 ms 204 KB Output is correct
12 Correct 10 ms 1116 KB Output is correct
13 Correct 226 ms 22040 KB Output is correct
14 Correct 0 ms 204 KB Output is correct
15 Correct 0 ms 204 KB Output is correct
16 Correct 7 ms 716 KB Output is correct
17 Correct 111 ms 12028 KB Output is correct
18 Correct 0 ms 204 KB Output is correct
19 Correct 0 ms 204 KB Output is correct
20 Correct 58 ms 5672 KB Output is correct
21 Correct 249 ms 21956 KB Output is correct
22 Correct 236 ms 22176 KB Output is correct
23 Correct 326 ms 22024 KB Output is correct
24 Correct 234 ms 21916 KB Output is correct
25 Correct 126 ms 12100 KB Output is correct
26 Correct 113 ms 12032 KB Output is correct
27 Correct 326 ms 22028 KB Output is correct
28 Correct 232 ms 22024 KB Output is correct
29 Correct 1 ms 204 KB Output is correct
30 Correct 1 ms 204 KB Output is correct
31 Correct 0 ms 204 KB Output is correct
32 Correct 0 ms 204 KB Output is correct
33 Incorrect 0 ms 204 KB Answer gives possible 0 while actual possible 1
34 Halted 0 ms 0 KB -