Submission #874061

#TimeUsernameProblemLanguageResultExecution timeMemory
874061WongYiKaiFriend (IOI14_friend)C++17
8 / 100
1 ms600 KiB
#include <bits/stdc++.h> using namespace std; int findSample(int n, int confidence[], int host[], int protocol[]){ int temp,temp2,test = 0,high = 0; for (int i=0;i<n;i++){ temp = confidence[i]; high = max(high,temp); } for (int i=1;i<n;i++){ if (protocol[i] != 2) test = 1; } if (test == 0){ return high; } }

Compilation message (stderr)

friend.cpp: In function 'int findSample(int, int*, int*, int*)':
friend.cpp:5:13: warning: unused variable 'temp2' [-Wunused-variable]
    5 |    int temp,temp2,test = 0,high = 0;
      |             ^~~~~
friend.cpp:16:1: warning: control reaches end of non-void function [-Wreturn-type]
   16 | }
      | ^
#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...