Submission #1064198

#TimeUsernameProblemLanguageResultExecution timeMemory
1064198woodFriend (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]); }

Compilation message (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...