// made by Tima
// 2025 will be a golden year...
//BREAK YOUR LIMITS!!!!
#include "bits/stdc++.h"
#define pii pair <int,int>
using namespace std;
const int N = 3e5 + 5;
const int mod = 1e9 + 7;
const int INF = 1e9;
int n,d,a[N],b[N],h[N],u;
set <int> st[N];
map <pii,int> mp;
void init(int nn , int D , int H[]){
n = nn , d = D;
for(int i = 0 ; i < nn ; i++){
h[i] = H[i];
}
}
void curseChanges(int U, int A[], int B[]){
u = U;
mp.clear();
for(int i = 0 ; i < U ; i++){
a[i] = A[i] , b[i] = B[i];
}
for(int i = 0 ; i < U ; i++){
mp[{min(a[i] , b[i]) , max(a[i] , b[i])}] ^= 1;
if(mp[{min(a[i] , b[i]) , max(a[i] , b[i])}]){
st[a[i]].insert(b[i]);
st[b[i]].insert(a[i]);
}
else{
st[a[i]].erase(b[i]);
st[b[i]].erase(a[i]);
}
}
}
int question(int X, int Y, int V){
int x = X , y = Y;
int ans = 1e9;
vector <int> q1 , q2;
for(auto it : st[x]){
auto ti = st[y].lower_bound(it);
if(ti != st[y].end()){
ans = min(ans , abs(it - (*ti)));
}
}
for(auto it : st[y]){
auto ti = st[x].lower_bound(it);
if(ti != st[x].end()){
ans = min(ans , abs(it - (*ti)));
}
}
return ans;
}
// signed main() {
// int N, D, U, Q;
// std::ios::sync_with_stdio(false); std::cin.tie(NULL);
// std::cin >> N >> D >> U >> Q;
//
// int *F = new int[N];
// for (int i=0; i<N; i++)
// std::cin >> F[i];
// init(N, D, F);
//
// int *A = new int[U], *B = new int[U];
// for (int i=0; i<U; i++) {
// std::cin >> A[i] >> B[i];
// }
// curseChanges(U, A, B);
//
// bool correct = true;
// for (int i=0; i<Q; i++) {
// int X,Y,V,CorrectAnswer;
// std::cin >> X >> Y >> V >> CorrectAnswer;
// int YourAnswer = question(X,Y,V);
// // cout << X << ' ' << Y << ' ' << V << '\n';
// if (YourAnswer != CorrectAnswer) {
// std::cout << "WA! Question: " << i << '\n'
// << "(X=" << X << ", Y=" << Y << ", V=" << V << ") \n"
// << "Your ans: " << YourAnswer << '\n'
// << "Correct Ans: " << CorrectAnswer << std::endl;
// correct = false;
// } else {
// std::cerr << YourAnswer << " - OK" << std::endl;
// }
// }
//
// if (correct) {
// std::cout << "Correct." << std::endl;
// } else std::cout << "Incorrect." << std::endl;
// return 0;
// }
# | 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... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |