제출 #1253296

#제출 시각아이디문제언어결과실행 시간메모리
1253296aren_dance커다란 상품 (IOI17_prize)C++20
컴파일 에러
0 ms0 KiB
#include "prize.h"
#include <bits/stdc++.h>
using namespace std;
int find_best(int n) {
	for(int i = 0; i < min(n,100); i++) {
		std::vector<int> res = ask(i);
		if(res[0]==0 && res[1]==0){
		    return i;
		}
	}
	while(true){
	    int x=rng()%(n-100)+100;
	    vector<int> res=ask(x);
	    if(res[0]==0 && res[1]==0){
	        return x;
	    }
	}
	return 0;
}

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

prize.cpp: In function 'int find_best(int)':
prize.cpp:12:19: error: 'rng' was not declared in this scope
   12 |             int x=rng()%(n-100)+100;
      |                   ^~~