ABC396
ABC396A
按题意模拟即可
#include using namespace std;const int N = 2e5 + 5;int n, a;int main() { ios :: sync_with_stdio(0), cin.tie(0); cin >> n; for (int i = 1; i > a) { } for (int i = 1; i < n - 1; ++i) { if (a == a && a == a) { coutn; 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 { coutn >> m; for (int i = 1; i > a) { } for (int i = 1; i > b) { } sort (a + 1, a + n + 1, greater()); sort (b + 1, b + m + 1, greater()); for (int i = 1; i = 0 && i0) { ans += a + b; } else { ans += a; ++sum; } } else if (a + b > 0 && i0) { ans += b, --sum; } else { break; } } return cout > 1;bool v;vector g;void s( int x, int Xor ) {if (v){ return ;}if (x == n) { ans = min(ans, Xor); return ;}v = 1;for (auto to : g) { s(to.first, Xor ^ to.second);}v = 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.push_back(make_pair(y, c)), g.push_back(make_pair(x, c));}s(1, 0); return cout > n >> m;for (int i = 1; i > a) {}for (int i = 1; i 懂技术并乐意极积无私分享的人越来越少。珍惜 收藏一下 不知道什么时候能用到 这个好,看起来很实用 这个有用。 感谢分享,下载保存了,貌似很强大 东西不错很实用谢谢分享 过来提前占个楼 收藏一下 不知道什么时候能用到 感谢,下载保存了 yyds。多谢分享 yyds。多谢分享 喜欢鼓捣这些软件,现在用得少,谢谢分享! 这个有用。 用心讨论,共获提升! 前排留名,哈哈哈 这个好,看起来很实用 感谢发布原创作品,程序园因你更精彩 热心回复! 感谢分享,下载保存了,貌似很强大
页:
[1]
2