Submission #1285780

#TimeUsernameProblemLanguageResultExecution timeMemory
1285780SmuggingSpunHack (APIO25_hack)C++20
0 / 100
59 ms1272 KiB
#include "hack.h"
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
const int LIM = 1e9;
int hack(){
	int low = 2, high = LIM, ans = 1;
	while(low <= high){
		int mid = (low + high) >> 1, sqr = sqrt(mid - low + 1);
		vector<ll>p;
		for(int i = 1; i <= sqr; i++){
			p.push_back(i);
		}
		for(int i = 0; low + sqr * i <= mid; i++){
			p.push_back(low + sqr * i);
		}
		sort(p.begin(), p.end());
		p.resize(unique(p.begin(), p.end()) - p.begin());
		if(collisions(p) == 0){
			low = (ans = mid) + 1;
		}
		else{
			high = mid - 1;
		}
	}
	return ans;
}
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...