제출 #1300066

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

using namespace std;
using ll = long long;
using vi = vector<ll>;

int hack(){
	int l = 1, r = 1e6;
	while(l < r) {
		cout << l << " " << r << endl;
		int mid = (l+r)/2;
		if(r-l == 1) ++mid;
		vi v;
		v.push_back(1);
		ll cnt = 1;
		for(int i=l; i<mid; ++i) {
			if(cnt >= RNG) {
				v.push_back(cnt+1);
				cnt = i;
			} else cnt *= i;
		}
		v.push_back(cnt+1);
		int x = collisions(v);
		if(x) {
			r = mid - 1;
		} else l = mid;
	}

    return r;
}

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

hack.cpp: In function 'int hack()':
hack.cpp:18:35: error: 'RNG' was not declared in this scope
   18 |                         if(cnt >= RNG) {
      |                                   ^~~