제출 #797554

#제출 시각아이디문제언어결과실행 시간메모리
797554XJP12수천개의 섬 (IOI22_islands)C++17
컴파일 에러
0 ms0 KiB
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;
		}
	}
	if(ban==false && ban1>1){
		int a[7]={0,1,0,1,0,1,0};
		return {true,a};
	}else{
		return false;
	}
}

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

islands.cpp:1:34: error: expected ',' or '...' before 'u'
    1 | find_journey(int n, int m, int[] u, int[] v){
      |                                  ^
islands.cpp:1:1: error: ISO C++ forbids declaration of 'find_journey' with no type [-fpermissive]
    1 | find_journey(int n, int m, int[] u, int[] v){
      | ^~~~~~~~~~~~
islands.cpp: In function 'int 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:17: error: cannot convert '<brace-enclosed initializer list>' to 'int' in return
   13 |   return {true,a};
      |                 ^