题解:
3道水题。。
1。生活大爆炸版剪刀石头布
忘记怎么打f[5][5]={}这个了。。
然后发现里面啥都不加也可以 加的话要是{}
2.送礼物
双向搜 有点卡常数。。
我没写dfs 写了dp求多少(好智障啊。。 访问数组挺慢的所以应该速度差不多。。) lowbit加速
3.黑暗城堡
显然$\prod$每个点能有几条到它就可以了
不能联通的和起点特判为1(max(1))
想到一个策略。。。
先打一个模板,然后命名T11
然后每做一题的时候 另存为T12之类。。
发现完整的模板打一个
写+查差不多10min
mina maxa不要少写 &啊。。
#include <bits/stdc++.h> using namespace std; #define rg register #define rint register int #define IL inline #define rep(i,h,t) for (int i=h;i<=t;i++) #define dep(i,t,h) for (int i=t;i>=h;i--) #define me(x) memset(x,0,sizeof(x)) #define setit set<int>::iterator #define lowbit(x) (x&(-x)) #define fi first #define se second #define mp make_pair #define mid ((h+t)>>1) #define mid2 ((h+t+1)>>1) #define ll long long char ss[1<<24],*A=ss,*B=ss; IL char gc() {return A==B&&(B=(A=ss)+fread(ss,1,1<<24,stdin),A==B)?EOF:*A++; } template<class T>IL void read(T &x) {rint f=1,c; while (c=gc(),c<48||c>57) if (c=='-') f=-1; x=(c^48);while (c=gc(),c>47&&c<58) x=(x<<3)+(x<<1)+(c^48); x*=f; } char sr[1<<24],z[20]; int C=-1,Z; template<class T>IL void wer(T x) {if (x<0) sr[++C]='-',x=-x;while (z[++Z]=x%10+48,x/=10);while (sr[++C]=z[Z],--Z); } IL void wer1() {sr[++C]=' '; } IL void wer2() {sr[++C]='\n'; } template<class T> IL void maxa(rg T &x,rg T y) {if (x<y) x=y; } template<class T> IL void mina(rg T &x,rg T y) {if (x>y) x=y; } template<class T>IL T MAX(rg T x,rg T y) {return x>y?x:y; } template<class T>IL T MIN(rg T x,rg T y) {return x<y?x:y; } const int INF=1e9; int main() {freopen("1.in","r",stdin);freopen("1.out","w",stdout);fwrite(sr,1,C+1,stdout);return 0; }