답안 #530682

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
530682 2022-02-26T12:24:42 Z Icebear16 분수 공원 (IOI21_parks) C++17
0 / 100
1 ms 204 KB
#include "parks.h"

int construct_roads(std::vector<int> x, std::vector<int> y) {
    if (x.size() == 1) {
	build({}, {}, {}, {});
        return 1;
    }else{
	    std::vector<int> u, v, a, b;
	    bool flag=true;
	    for(int i=1;i<x.size();i++){
	    	if(y[i]%2==1){
	    		flag=false;
	    		break;
			}
		}
		if(flag==true){
			for(int i=0;i<x.size()-1;i++){
		    	u.push_back(i);
		    	v.push_back(i+1);
			    a.push_back(x[i]+1);
		    	b.push_back(y[i]+1);
			}
		    build(u, v, a, b);
		    return 1;
		}else{
			return 0;
		}
	}
}

Compilation message

parks.cpp: In function 'int construct_roads(std::vector<int>, std::vector<int>)':
parks.cpp:10:19: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   10 |      for(int i=1;i<x.size();i++){
      |                  ~^~~~~~~~~
parks.cpp:17:17: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   17 |    for(int i=0;i<x.size()-1;i++){
      |                ~^~~~~~~~~~~
# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 204 KB Output is correct
2 Correct 1 ms 204 KB Output is correct
3 Incorrect 0 ms 204 KB Pair u[0]=0 @(2, 2) and v[0]=1 @(2, 6) does not form a valid edge (distance != 2)
4 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 204 KB Output is correct
2 Correct 1 ms 204 KB Output is correct
3 Incorrect 0 ms 204 KB Pair u[0]=0 @(2, 2) and v[0]=1 @(2, 6) does not form a valid edge (distance != 2)
4 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 204 KB Output is correct
2 Correct 1 ms 204 KB Output is correct
3 Incorrect 0 ms 204 KB Pair u[0]=0 @(2, 2) and v[0]=1 @(2, 6) does not form a valid edge (distance != 2)
4 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 204 KB Output is correct
2 Correct 1 ms 204 KB Output is correct
3 Incorrect 0 ms 204 KB Pair u[0]=0 @(2, 2) and v[0]=1 @(2, 6) does not form a valid edge (distance != 2)
4 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 204 KB Output is correct
2 Correct 1 ms 204 KB Output is correct
3 Incorrect 0 ms 204 KB Pair u[0]=0 @(2, 2) and v[0]=1 @(2, 6) does not form a valid edge (distance != 2)
4 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 204 KB Output is correct
2 Correct 1 ms 204 KB Output is correct
3 Incorrect 0 ms 204 KB Pair u[0]=0 @(2, 2) and v[0]=1 @(2, 6) does not form a valid edge (distance != 2)
4 Halted 0 ms 0 KB -