답안 #1048612

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
1048612 2024-08-08T08:41:50 Z IUA_Hasin 슈퍼트리 잇기 (IOI20_supertrees) C++17
11 / 100
103 ms 24148 KB
#include "supertrees.h"
#include <bits/stdc++.h> 

#define ll				long long

using namespace std;


int construct(std::vector<std::vector<int>> p) {
	int n = p.size();
	if(n==1){
		vector<vector<int>> answer;
		answer.push_back({0});
		build(answer);
		return 1;
	}
	std::vector<std::vector<int>> answer;
	for (int i = 0; i < n; i++) {
		vector<int> row;
		if(i==0){
			for(int j=0; j<n; j++){
				if(j==1){
					row.push_back(1);
				} else {
					row.push_back(0);
				}
			}
		} else if(i!=n-1){
			for(int j=0; j<n; j++){
				if(j==i-1 || j==i+1){
					row.push_back(1);
				} else {
					row.push_back(0);
				}
			}
		} else {
			for(int j=0; j<n; j++){
				if(j==n-2){
					row.push_back(1);
				} else {
					row.push_back(0);
				}
			}
		}
		answer.push_back(row);
	}
	build(answer);
	return 1;
}



// int construct(std::vector<std::vector<int>> p) {
// 	int n = p.size();
// 	std::vector<std::vector<int>> answer;
// 	for (int i = 0; i < n; i++) {
// 		std::vector<int> row;
// 		row.resize(n);
// 		answer.push_back(row);
// 	}
// 	build(answer);
// 	return 1;
// }


# 결과 실행 시간 메모리 Grader output
1 Correct 0 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 344 KB Output is correct
5 Correct 0 ms 604 KB Output is correct
6 Correct 4 ms 1372 KB Output is correct
7 Correct 103 ms 24148 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 0 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 344 KB Output is correct
5 Correct 0 ms 604 KB Output is correct
6 Correct 4 ms 1372 KB Output is correct
7 Correct 103 ms 24148 KB Output is correct
8 Incorrect 1 ms 348 KB Too many ways to get from 0 to 1, should be 0 found no less than 1
9 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 0 ms 348 KB Too many ways to get from 0 to 1, should be 0 found no less than 1
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 0 ms 348 KB Too many ways to get from 0 to 1, should be 0 found no less than 1
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 0 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 344 KB Output is correct
5 Correct 0 ms 604 KB Output is correct
6 Correct 4 ms 1372 KB Output is correct
7 Correct 103 ms 24148 KB Output is correct
8 Incorrect 1 ms 348 KB Too many ways to get from 0 to 1, should be 0 found no less than 1
9 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 0 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 344 KB Output is correct
5 Correct 0 ms 604 KB Output is correct
6 Correct 4 ms 1372 KB Output is correct
7 Correct 103 ms 24148 KB Output is correct
8 Incorrect 1 ms 348 KB Too many ways to get from 0 to 1, should be 0 found no less than 1
9 Halted 0 ms 0 KB -