題解:
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; }
?