摘要:
经典NIM游戏。 取XOR和即可。 注意输出方案时,找到大于异或和sum的,变为a[i] ^ sum即可。 1 #include <cstdio> 2 const int N = 500010; 3 int a[N]; 4 int main() { 5 int n, sum = 0; 6 scanf 阅读全文
摘要:
经典水题....... 断环为链长度乘二,求前缀和区间DP。 1 #include <cstdio> 2 #include <cstring> 3 #include <algorithm> 4 #define int long long 5 const int N = 210; 6 7 int f[ 阅读全文