제출 #1315247

#제출 시각아이디문제언어결과실행 시간메모리
1315247jfioashfn333CONSUL (info1cup19_consul)C++20
컴파일 에러
0 ms0 KiB
//#include "grader.h"
#include <cstdio>
#include <iostream>
#include <algorithm>
#include <vector>
#include <math.h>
#include <set>
//#define int long long
#define ff first
#define ss second
#define pb push_back
#define pp pop_back
#define all(x) x.begin(),x.end()
#define pii pair<int,int>
#define r0 return 0
using namespace std;
const int N = 5 * 1e5 + 5, M = 55, MOD = 998244353;
int x,y,xx,yy,n,m,k,l,ans,tm;
vector <int> g[N],rd,v;
int fix[N],tc[N];
int kth(int i);
int cnt(int x);
void say_answer(int a);
void solve(int N){
    n = N;
    srand(time(0) ^ clock());
    
    for (int i = 1; i <= 30; i++) {
        int ind = rand() % n + 1;
        v.pb(kth(ind));
    }
    
    int gambling = v[rand() % v.size()];
    for (auto to : v) {
        if (cnt(to) > n / 3) {
            say_answer(to);
            break; return 0;
        }
    }
    say_answer(-1);
}

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

consul.cpp: In function 'void solve(int)':
consul.cpp:37:27: error: return-statement with a value, in function returning 'void' [-fpermissive]
   37 |             break; return 0;
      |                           ^