题解:HDU 6598 Description Now, Bob is playing an interesting game in which he is a general of a harmonious army. There are \(n\) soldiers in this army. Each soldier should be in one of the two occupations, Mage or Warrior. There are \(m\) pairs of sold…
Problem Description FatMouse prepared M pounds of cat food, ready to trade with the cats guarding the warehouse containing his favorite food, JavaBean. The warehouse has N rooms. The i-th room contains J[i] pounds of JavaBeans and requires F[i] pound…
http://acm.hdu.edu.cn/showproblem.php?pid=3698 Let the light guide us Time Limit: 5000/2000 MS (Java/Others) Memory Limit: 62768/32768 K (Java/Others) Total Submission(s): 759 Accepted Submission(s): 253 Problem Description Plain of despair was…
一道组合游戏的题目 SG函数的板子题 预处理出SG函数的值然后回答询问即可 代码 #include <cstdio> #include <algorithm> #include <cstring> #define int long long using namespace std; ],vis[],SG[],m,n,p; int init(int n){ f[]=; f[]=; ;i<=n;i++) f[i]=f[i-]+f[i-]; } int getSG(in…
参考博客https://blog.csdn.net/u013534123/article/details/97142191 #include<bits/stdc++.h> using namespace std; typedef long long ll; const int maxn=2e5+50; int S,T,From[maxn],Laxt[maxn],Next[maxn],To[maxn]; ll Cap[maxn],cnt; int vd[maxn],dis[maxn]; void…