제출 #1299979

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

using namespace std;
using ll = long long;

int hack(){
	int l = 1, r = 1e6;
	while(l <= r) {
		int mid = (l+r)/2;
		vi v;
		for(int i=l; i<=mid; ++i) v.push_back(i);
		int x = collisions(v);
		if(x) r = mid;
		else l = mid + 1;
	}

    return r;
}

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

hack.cpp: In function 'int hack()':
hack.cpp:11:17: error: 'vi' was not declared in this scope
   11 |                 vi v;
      |                 ^~
hack.cpp:12:43: error: 'v' was not declared in this scope
   12 |                 for(int i=l; i<=mid; ++i) v.push_back(i);
      |                                           ^
hack.cpp:13:36: error: 'v' was not declared in this scope
   13 |                 int x = collisions(v);
      |                                    ^