#include "hack.h"
#include <bits/stdc++.h>
using namespace std;
int hack(){
int n = 0;
int l = 0, h = 5e8;
while(h - l > 1) {
int m = (l + h) / 2;
long long squirt = 1;
while(squirt * squirt < (m - l))
squirt++;
vector<long long> v = {1};
for(int j=0;j<squirt-1;j++)
v.push_back(1LL << 30);
v.push_back((2LL * l + 1) << 29);
for(int j=0;j<((m-l)-1)/squirt;j++)
v.push_back(squirt << 30);
for(int j=1;j<int(v.size());j++)
v[j] += v[j-1];
end(v)[-1] = 1 + ((2LL * m - 1) << 29);
(collisions(v)?h:l) = m;
}
n = 2 * l + 1;
while(!collisions({1,n+1}))
n <<= 1;
return n;
}
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |