Submission #1352390

#TimeUsernameProblemLanguageResultExecution timeMemory
1352390Trisanu_DasHack (APIO25_hack)C++20
Compilation error
0 ms0 KiB
#include <bits/stdc++.h>
#include "hack.h"
using namespace std;
#define ll long long
#define MAXN 1000000

int hack(){
	vector<int> x;
	for(int i = 1; i <= MAXN; i++) x.push_back(i);
	int final = collisions(x);
	for(int i = 1; i <= MAXN; i++){
		int grp = MAXN / i;
		int curr = (grp * (grp - 1) / 2) * i + (MAXN % i * grp);
		if(curr == final) return i;
	}
}

Compilation message (stderr)

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