제출 #1353420

#제출 시각아이디문제언어결과실행 시간메모리
1353420MunkhErdeneHack (APIO25_hack)C++17
컴파일 에러
0 ms0 KiB
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
int hack(){
    ll n = 1e6;
    vector<ll> x;
    for(ll i=1; i<=n; i++) x.push_back(i);
    ll v=collisions(x);
    for(ll i=1; i<=n; i++){
        ll f=n/i;
        ll a=f*(f-1)/2*i;
        a+=n%i*f;
        if(a==v) return i;
    }
}

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

hack.cpp: In function 'int hack()':
hack.cpp:8:10: error: 'collisions' was not declared in this scope
    8 |     ll v=collisions(x);
      |          ^~~~~~~~~~
hack.cpp:15:1: warning: control reaches end of non-void function [-Wreturn-type]
   15 | }
      | ^