Lang:G++
Edit12345678910111213141516171819202122232425262728293031#include <bits/stdc++.h>#define IO \ios::sync_with_stdio(false); \cin.tie(0); \cout.tie(0);using namespace std;typedef long long LL;const int maxn = 1e6 + 10;const int mod = 65535;int n, m;int maxx = 0;int minn = INT_MAX;vector<int> a[maxn];unordered_set<int> sk;unordered_set<int> ed;unordered_set<int> kkk[maxn];int find_now(int idx, int now){int f = lower_bound(a[idx].begin(), a[idx].end(), now) - a[idx].begin();if(f==m)return a[idx][f-1];int cha = a[idx][f];if (f > 0 && abs(now - cha) > abs(now - a[idx][f - 1]))cha = a[idx][f - 1];return cha;}void solve(){int ans = INT_MAX;