摘要: #include using namespace std; inline int powerful(int n,int mi){ int s=1; while(mi){ if(mi&1) s*=x; //二进制最后一位是否为一 为一则乘 x*=x; //实现跳级运算 2 4 16 256 mi>>=1; 5=1001 //每次... 阅读全文
posted @ 2017-09-28 21:42 TimDucan 阅读(71) 评论(0) 推荐(0) 编辑
摘要: #include using namespace std; const int maxn=200000; int f[maxn][2],w[maxn],head[maxn]; int cnt; bool vis[maxn]; inline int read(){ int num=0,f=1; char c=getchar(); while(!isdigit(... 阅读全文
posted @ 2017-09-28 21:17 TimDucan 阅读(102) 评论(0) 推荐(0) 编辑
摘要: const int MAXV(100005),MAXE(10005); struct edge{ int y,next; }e[MAXE]; int head[MAXV],ecnt; void connect(int x,int y){ e[++ecnt].y=y; e[ecnt].next=head[x]; head[x]=ecnt; } for(int... 阅读全文
posted @ 2017-09-28 21:15 TimDucan 阅读(110) 评论(0) 推荐(0) 编辑
摘要: #include using namespace std; #define maxn 2000 const int maxm=5000; int f[maxn][maxn],a[maxm],sum[maxm],n; inline int read(){ int num=0,f=1; char c=getchar(); while(!isdigit(c)){if(c=='-') ... 阅读全文
posted @ 2017-09-28 21:14 TimDucan 阅读(121) 评论(0) 推荐(0) 编辑
摘要: //01背包 #include #include #include using namespace std; int W[30001]; int C[2001]; int R[2001][30001]; int main(){ int N,M; cin>>N>>M; for(int i=1;i>C[i]>>W[i]; for(int i=1;i=C[i]) ... 阅读全文
posted @ 2017-09-28 21:08 TimDucan 阅读(96) 评论(0) 推荐(0) 编辑
摘要: #include using namespace std; int main(){ for(int i=0;i<=128;i++) cout<<i<<" "<<(char)i<<endl; } 阅读全文
posted @ 2017-09-28 17:31 TimDucan 阅读(82) 评论(0) 推荐(0) 编辑