Submission #771923

#TimeUsernameProblemLanguageResultExecution timeMemory
771923Valters07Minerals (JOI19_minerals)C++14
40 / 100
18 ms2500 KiB
#include <bits/stdc++.h> #include "minerals.h" #pragma GCC optimize("O3,unroll-loops") #pragma GCC target("avx2,bmi,bmi2,popcnt,lzcnt") #define fio ios_base::sync_with_stdio(0);cin.tie(0); #define ll long long #define en cin.close();return 0; #define pb push_back #define fi first//printf("%lli\n",cur); #define se second//scanf("%lli",&n); using namespace std; mt19937 rng(chrono::steady_clock::now().time_since_epoch().count()); int n1; void go(vector<int> &a, vector<int> &b) { assert(a.size()==b.size()); int n = a.size(); if(n==1) Answer(a[0],b[0]), Query(a[0]); else { int mid = n/2; vector<int> la, ra, lb, rb; for(int i = 0;i<n;i++) if(i<mid) la.pb(a[i]); else ra.pb(a[i]), Query(a[i]); for(int i = 0;i<n;i++) { int t = Query(b[i]); if(t==n1) lb.pb(b[i]); else rb.pb(b[i]); Query(b[i]); } for(auto x:ra) Query(x); go(la,lb); go(ra,rb); } } void Solve(int n) { n1=n; vector<int> a, b; for(int i = 1, lst = 0;i<=2*n;i++) { int t = Query(i); if(t==lst) b.pb(i); else a.pb(i); lst=t; } go(a,b); }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...