제출 #1064198

#제출 시각아이디문제언어결과실행 시간메모리
1064198wood친구 (IOI14_friend)C++17
0 / 100
1 ms604 KiB
#include "friend.h"
#include <bits/stdc++.h>
#define pb push_back
#define ll long long
using namespace std;

// Find out best sample



int findSample(int n,int confidence[],int host[],int protocol[]){
	int res[n][3]; res[0][0] = res[0][1] = 0; res[0][2] = 1;
	for(int i = 1; i<n; i++){
		if(protocol[i]==0){
			res[i][0] = res[host[i]][1];
			res[i][1] = res[host[i]][2];
			res[i][2] = res[host[i]][1]+1;
		}
		else{
			res[i][0] = res[host[i]][0];
			res[i][1] = res[host[i]][2];
			res[i][2] = res[host[i]][0]+1;
		}
		
	}
	cout<<max(max(res[n-1][0],res[n-1][1]),res[n-1][2]);
}

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

friend.cpp: In function 'int findSample(int, int*, int*, int*)':
friend.cpp:27:1: warning: no return statement in function returning non-void [-Wreturn-type]
   27 | }
      | ^
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...