제출 #491945

#제출 시각아이디문제언어결과실행 시간메모리
491945davi_bart친구 (IOI14_friend)C++14
16 / 100
1 ms336 KiB
#include "friend.h"
#pragma GCC optimize("O3")
#include <bits/stdc++.h>
using namespace std;
#define ll long long
// #define int ll
#define fi first
#define se second
#define ld long double
#define pb push_back
mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());
// Find out best sample
int findSample(int N, int confidence[], int host[], int protocol[]) {
    if (protocol[1] == 1) {
        int tot = 0;
        for (int i = 0; i < N; i++) tot += confidence[i];
        return tot;
    }
    if (protocol[1] == 2) {
        int tot = 0;
        for (int i = 0; i < N; i++) tot = max(confidence[i], tot);
        return tot;
    }
}

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

friend.cpp: In function 'int findSample(int, int*, int*, int*)':
friend.cpp:24:1: warning: control reaches end of non-void function [-Wreturn-type]
   24 | }
      | ^
#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...