Submission #1078180

#TimeUsernameProblemLanguageResultExecution timeMemory
1078180woodHighway Tolls (IOI18_highway)C++17
0 / 100
10 ms600 KiB
#include "highway.h" #include <bits/stdc++.h> using namespace std; typedef long long ll; typedef pair<int,int> p32; typedef pair<ll,ll> p64; #define pb push_back #define eb emplace_back #define fi first #define se second #define vi vector<int> #define vp32 vector<p32> #define fast_cin() ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL) #define MOD %1000000007 #include <ext/pb_ds/assoc_container.hpp> using namespace __gnu_pbds; template <class T> using Tree = tree<T, null_type, less<T>, rb_tree_tag, tree_order_statistics_node_update>; //never guess //never debug without reviewing code //never try adding ones or substracting them //only step by step debug when necessay void find_pair(int N, std::vector<int> U, std::vector<int> V, int A, int B) { int m = U.size(); ll curxor = 0, curs = 0; int x = 1, p = 0; while(x<N){ vi w(m,1); for(int i = 0; i<m; i++){ if((U[i]&x)^(V[i]&x)) w[i] = 0; } curxor+=(ask(w)&1)<<p; w = vi(m,1); for(int i = 0; i<m; i++) if(U[i]==curs||V[i]==curs) w[i]=0; if((ask(w)&1)==0){ curs+=x; } x<<=1; p++; } answer(curs,curs^curxor); }
#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...