Submission #1205733

#TimeUsernameProblemLanguageResultExecution timeMemory
1205733batsukh2006Hack (APIO25_hack)C++17
Compilation error
0 ms0 KiB
#include "hack.h" #include <vector> #include<iostream> using namespace std; const int mxN=100000; int hack(){ vector<int> x; for(int i=0; i<mxN; i++) x.push_back(i); long long v=collisions(x); for(int i=1; i<=mxN; i++){ long long f=mxN/i; long long a=f*(f-1)/2*i; a+=mxN%i*f; if(a==v) return i; } }

Compilation message (stderr)

hack.cpp: In function 'int hack()':
hack.cpp:9:28: error: could not convert 'x' from 'vector<int>' to 'vector<long long int>'
    9 |     long long v=collisions(x);
      |                            ^
      |                            |
      |                            vector<int>
hack.cpp:16:1: warning: control reaches end of non-void function [-Wreturn-type]
   16 | }
      | ^