Submission #1205736

#TimeUsernameProblemLanguageResultExecution timeMemory
1205736batsukh2006Hack (APIO25_hack)C++17
25 / 100
966 ms16452 KiB
#include "hack.h"
#include <vector>
#include<iostream>
using namespace std;
const int mxN=1000000;
int hack(){
    vector<long long> x;
    for(int i=1; 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: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...