Submission #1042656

#TimeUsernameProblemLanguageResultExecution timeMemory
1042656jer033Friend (IOI14_friend)C++17
0 / 100
1 ms448 KiB
#include "friend.h" #include <bits/stdc++.h> using namespace std; // Find out best sample int findSample(int n,int confidence[],int host[],int protocol[]){ if (protocol[0] == 1) { int ans = 0; for (int k=0; k<n; k++) ans+=confidence[k]; return ans; } int ans = 0; for (int k=0; k<n; k++) { if (confidence[k ]> ans); ans = confidence[k]; } return ans; }

Compilation message (stderr)

friend.cpp: In function 'int findSample(int, int*, int*, int*)':
friend.cpp:17:9: warning: this 'if' clause does not guard... [-Wmisleading-indentation]
   17 |         if (confidence[k ]> ans);
      |         ^~
friend.cpp:18:13: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the 'if'
   18 |             ans = confidence[k];
      |             ^~~
#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...