#include<bits/stdc++.h> #define LL long long #define fi first #define se second #define mk make_pair #define PII pair<int, int> #define PLI pair<LL, int> #define PLL pair<LL, LL> #define y1 skldjfskldjg #define y2 skldfjsklejg usin…
Check Corners Time Limit: 2000/10000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others) Total Submission(s): 2513 Accepted Submission(s): 904 Problem Description Paul draw a big m*n matrix A last month, whose entries Ai,j are all intege…
Given an N*N matrix A, whose elements are either 0 or 1. A[i, j] means the number in the i-th row and j-th column. Initially we have A[i, j] = 0 (1 <= i, j <= N). We can change the matrix in the following way. Given a rectangle whose upper-left corn…
Prob.1 生活大爆炸版 石头剪刀布 模拟.代码: #include<cstdio> #include<cstring> #include<iostream> using namespace std; const int mp[5][5]={{0,0,1,1,0}, {1,0,0,1,0}, {0,1,0,0,1}, {0,0,1,0,1}, {1,1,0,0,0}}; int A[205],B[205]; int n,lA,lB,ansA,ansB; int mai…
累惹. B. Harvest of Apples 题目传送门:http://acm.hdu.edu.cn/showproblem.php?pid=6333 题意:求∑(i=0,m) C(n,m). 分析:定义S(n,m)=∑(i=0,m) C(n,m).可以知道: S(n,m)=S(n,m-1)+C(n,m),S(n-m)=S(n-1,m-1)+S(n-1,m)=2*S(n-1,m-1)+C(n-1,m). 由此可以推导出,由S(n,m)到S(n-1,m),S(n+1,m),S(n,m-1),S…
2015 Dhaka A - Automatic Cheater Detection solution 模拟计数. B - Counting Weekend Days solution 模拟计数. C - Toll Management IV 题目描述:有一个\(n\)个点\(m\)条边的图,每条边有权值,现在给出图中一棵合法的最小生成树,问每条边权值最多增加多少,最多减少多少,使得给出的最小生成树还是最小生成树. solution 对于给定的最小生成树,最多减少多少无界,对于其它的边,最多增加…
To my boyfriend Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 1246 Accepted Submission(s): 556 Problem Description Dear LiaoI never forget the moment I met with you. You carefully asked me:…