Submission #1353420

#TimeUsernameProblemLanguageResultExecution timeMemory
1353420MunkhErdeneHack (APIO25_hack)C++17
Compilation error
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;
    }
}

Compilation message (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 | }
      | ^