답안 #33815

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
33815 2017-11-02T18:04:34 Z mohammad_kilani Simurgh (IOI17_simurgh) C++14
0 / 100
0 ms 2024 KB
#include "simurgh.h"
#include <bits/stdc++.h>
using namespace std;
vector<int> r , ans , u , v;
int n , m;
void calc(int i){
	if(r.size() >= n) return;
	if(i == m){
		if(r.size() < n -1) return;
		bool can[10] = {0};
		for(int i=0;i<r.size();i++){
			can[u[r[i]]] = 1;
			can[v[r[i]]] = 1;
		}
		for(int i=0;i<n;i++) if(can[i] == false) return;
		int cur = count_common_roads(r);
		if(cur == n-1){
			ans = r;
		}
		return ;
	}
	r.push_back(i);
	calc(i+1);
	r.pop_back();
	calc(i+1);
}

std::vector<int> find_roads(int N, std::vector<int> U, std::vector<int> V) {
	u = U;
	v = V;
	n = N;
	m = u.size();
	r.clear();
	calc(0);
	return ans;
}

Compilation message

simurgh.cpp: In function 'void calc(int)':
simurgh.cpp:7:14: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
  if(r.size() >= n) return;
              ^
simurgh.cpp:9:15: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
   if(r.size() < n -1) return;
               ^
simurgh.cpp:11:16: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
   for(int i=0;i<r.size();i++){
                ^
# 결과 실행 시간 메모리 Grader output
1 Incorrect 0 ms 2024 KB WA in grader: NO
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 0 ms 2024 KB WA in grader: NO
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 0 ms 2024 KB WA in grader: NO
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 2024 KB correct
2 Incorrect 0 ms 2024 KB WA in grader: NO
3 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 0 ms 2024 KB WA in grader: NO
2 Halted 0 ms 0 KB -