找回密码
 立即注册
首页 业界区 安全 ABC396
列蜜瘘 2025-6-1 21:09:50
ABC396

A

按题意模拟即可
[code]#include using namespace std;const int N = 2e5 + 5;int n, a[N];int main() {        ios :: sync_with_stdio(0), cin.tie(0);        cin >> n;        for (int i = 1; i > a[i++]) {        }                for (int i = 1; i < n - 1; ++i) {                if (a == a[i + 1] && a[i + 1] == a[i + 2]) {                        cout  n;        for (int i = 100; i--; s.push_back(0)) {        }         for (int op, x; n--; ) {                cin >> op;                if (op == 1) {                        cin >> x;                        s.push_back(x);                } else {                        cout  n >> m;        for (int i = 1; i > a[i++]) {        }        for (int i = 1; i > b[i++]) {        }        sort (a + 1, a + n + 1, greater());        sort (b + 1, b + m + 1, greater());        for (int i = 1; i = 0 && i  0) {                                ans += a + b;                        } else {                                ans += a;                                ++sum;                        }                } else if (a + b > 0 && i  0) {                        ans += b, --sum;                } else {                        break;                }        }        return cout > 1;bool v[N];vector g[N];void s( int x, int Xor ) {  if (v[x])  {    return ;  }  if (x == n) {    ans = min(ans, Xor);    return ;  }  v[x] = 1;  for (auto to : g[x]) {    s(to.first, Xor ^ to.second);  }  v[x] = 0;}signed main() {        ios :: sync_with_stdio(0), cin.tie(0);        cin >> n >> m;  for (int i = 1, x, y, c; i > x >> y >> c;    g[x].push_back(make_pair(y, c)), g[y].push_back(make_pair(x, c));  }  s(1, 0);        return cout > n >> m;  for (int i = 1; i > a[i++]) {  }  for (int i = 1; i
您需要登录后才可以回帖 登录 | 立即注册