제출 #1205054

#제출 시각아이디문제언어결과실행 시간메모리
1205054bronze_coderHack (APIO25_hack)C++20
컴파일 에러
0 ms0 KiB
#include <bits/stdc++.h> using namespace std; int squareroot(int n){ int x = sqrt(n); while(x*x<n){ x++; } while(x*x>n){ x--; } return x; } int hack(){ int low = 1; int high = 1000000000; while(low<high){ int mid = (low+high)/2; int s = sqrt(high-low); vector<long long> query; for(int i=0;i<s;i++){ query.push_back(i+1); } for(int i=0;low+s*(i+1)<=mid;i++){ query.push_back(low+s*(i+1)); } query.push_back(mid+1); if(collisions(query)){ high = mid; } else{ low = mid+1; } } return low; }

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

hack.cpp: In function 'int hack()':
hack.cpp:29:12: error: 'collisions' was not declared in this scope
   29 |         if(collisions(query)){
      |            ^~~~~~~~~~