제출 #720426

#제출 시각아이디문제언어결과실행 시간메모리
720426yellowtoadCONSUL (info1cup19_consul)C++17
컴파일 에러
0 ms0 KiB
#include <bits/stdc++.h>
#include "grader.h"

void solve(int n) {
	int tmp, cnnt = 0;
    srand(time(NULL));
    while ((cnnt < 30) || ((n <= 50) && (cnt < 25))) {
    	tmp = kth(rand()%n+1);
    	if (cnt(tmp) > n/3) {
    		say_answer(tmp);
    		return;
		}
		cnnt++;
	}
	say_answer(-1);
}

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

consul.cpp: In function 'void solve(int)':
consul.cpp:7:46: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
    7 |     while ((cnnt < 30) || ((n <= 50) && (cnt < 25))) {
      |                                          ~~~~^~~~