제출 #797558

#제출 시각아이디문제언어결과실행 시간메모리
797558XJP12수천개의 섬 (IOI22_islands)C++17
컴파일 에러
0 ms0 KiB
bool find_journey(int n, int m, int[] u, int[] v){
	bool ban=true;
	int ban1=0;
	for(int i=0; i<m; i++){
		if(u[i]==0){
			ban1++;
		}else{
			ban=false;
		}
	}
	int a[7];
	if(ban==false && ban1>1){
		a[7]={0,1,0,1,0,1,0};
		return make_pair(true,a);
	}else{
		return make_pair(false,a);
	}
}

컴파일 시 표준 에러 (stderr) 메시지

islands.cpp:1:39: error: expected ',' or '...' before 'u'
    1 | bool find_journey(int n, int m, int[] u, int[] v){
      |                                       ^
islands.cpp: In function 'bool find_journey(int, int, int*)':
islands.cpp:5:6: error: 'u' was not declared in this scope
    5 |   if(u[i]==0){
      |      ^
islands.cpp:13:22: error: cannot convert '<brace-enclosed initializer list>' to 'int' in assignment
   13 |   a[7]={0,1,0,1,0,1,0};
      |                      ^
islands.cpp:14:10: error: 'make_pair' was not declared in this scope
   14 |   return make_pair(true,a);
      |          ^~~~~~~~~
islands.cpp:16:10: error: 'make_pair' was not declared in this scope
   16 |   return make_pair(false,a);
      |          ^~~~~~~~~