Submission #1352393

#TimeUsernameProblemLanguageResultExecution timeMemory
1352393Trisanu_DasHack (APIO25_hack)C++20
25 / 100
786 ms16472 KiB
#include <bits/stdc++.h>
#include "hack.h"
using namespace std;
#define ll long long
#define MAXN 1000000

int hack(){
    vector<ll> x;
    for(int i = 1; i <= MAXN; i++) x.push_back(i);
    ll final = collisions(x);
    for(int i = 1; i <= MAXN; i++){
        ll grp = MAXN / i;
        ll 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:16:1: warning: control reaches end of non-void function [-Wreturn-type]
   16 | }
      | ^
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...