Submission #1205104

#TimeUsernameProblemLanguageResultExecution timeMemory
1205104tamzidHack (APIO25_hack)C++20
Compilation error
0 ms0 KiB
#include "hack.h"
#include <vector>
#include <map>
using ll = long long;

int hack(){
    // std::vector<long long> x = {3333,2565454,21223,898997,9999,4,8,100,2340040,222,44,2222211};
    // long long a = collisions(x);


    // std::map<ll,ll> mp;
    // ll cnt = 0;
    // int i;
    // for(i=1;i<=500000;++i)
    // {
    //     for(int j=0;j<x.size();++j)
    //     {
    //         ++mp[x[j] % i];
    //         cnt+=mp[x[j] % i]-1;
    //     }
    //     if(cnt == a)
    //         break;

    //     mp.clear();
    // }

    std::vector<ll> x;
    ll i;
    for(i=1;i<=500001;++i)
    {
        x.pb(i);
        ll a = collisions(x);
        if(a == 1)
            break;
    }

    

    return i;
}

Compilation message (stderr)

hack.cpp: In function 'int hack()':
hack.cpp:31:11: error: 'class std::vector<long long int>' has no member named 'pb'
   31 |         x.pb(i);
      |           ^~