#include "hack.h"
#pragma GCC optimize("O3")
#pragma GCC optimize("unroll-loops")
#include<bits/stdc++.h>
#include<ext/pb_ds/assoc_container.hpp>
typedef long long ll;
typedef long double ld;
#define endl "\n"
#define vll vector<ll>
#define sd second
#define ft first
#define all(x) x.begin(),x.end()
#define allr(x) x.rbegin(),x.rend()
#define pll pair<ll, ll>
#define mod 1000000007
#define _set tree<ll, null_type, less<ll>, rb_tree_tag, tree_order_statistics_node_update>
#define inf (ll)1e15
#define sz(x) (int)x.size()
#define db(x) cout<<#x<<" : "<<x<<endl;
#define PRESICION(x) cout.setf(ios::fixed,ios::floatfield); cout.precision(x);
using namespace std;
using namespace __gnu_pbds;
int hack(){
vector<bool> visited(1000001, 0);
vector<ll> p(1000001, LLONG_MAX);
p[1]=1;
for(int i=2; i<=1000000; i++){
for(int j=i; j<=1000000; j+=j){
p[j]=min(p[j], i*1LL);
}
}
ll res=-1;
for(int i=1000000; i>=1; i--){
if(visited[i]==1 || (res!=-1 && res%i!=0))continue;
ll o=collisions({i, i*2});
//cout<<i<<" "<<o<<endl;
if(o==0){
ll o1=i;
while(o1!=1){
visited[o1]=1;
o1/=p[o1];
}
}else res=i;
}
return res;
}
# | 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... |