随笔分类 - 水题
摘要:#include#include#include#include#includeusing namespace std;int a[300000];int main(){ int n,m; int i,j,k; int op,num; scanf("%d%d",&n,&m);...
阅读全文
摘要:#include#include#include#include#includeusing namespace std;int a[200],b[200];int vis[200];int main(){ int n; int i,j,k; while(scanf("%d",&n)!=EOF)...
阅读全文
摘要:题意:有一个数列 seed[x+1]=(seed(x)+step)%mod 给出 step 和 mod 如果求出的是以 1。。。mod-1 为循环节的数列 则为 good choice 否则 则是 bad choice思路:1.用标记法 如果 形成循环节时 每个数都被标记到 则good choice...
阅读全文
摘要:#include#include#include#include#include#include#includeusing namespace std;vector a[100000+100];map temp;int h[100000+100];int shoot[100000+100];int...
阅读全文
摘要:题意:思路:#include #include #include #include using namespace std;int fa[150];int fin(int x){ return fa[x]==x?x:fin(fa[x]);}void unionn(int x,int y){ ...
阅读全文
摘要:#include#include#include#include#include#include#include#include#includeusing namespace std;int dir4[][2]={{0,1},{1,0},{0,-1},{-1,0}};int dir8[][2]={{...
阅读全文
摘要:题意:有一个排n个建筑 每个高不定 现在要消去全部建筑 方法有两种 1 消去高度为某值的全部方块 2 消去一整个建筑 问 如何通过最少步骤消去思路:首先将数组从大到小排序 if(i+a[i]#include#includeusing namespace ...
阅读全文
摘要:#include#include#include#include#include#include#include#include#include#define LL long longusing namespace std;const int MAXN=10;const int INF=0x3f3f...
阅读全文
摘要:#include#include#include#include#include#includeusing namespace std;map a;int main(){ a['I']=1; a['V']=5; a['X']=10; a['L']=50; a['C']...
阅读全文
摘要:#include#include#include#include#include#include#includeusing namespace std;int t,n;int main(){ int i,j,k; cin>>t; char op[10],io[10]; whi...
阅读全文
摘要:http://acm.neu.edu.cn/hustoj/problem.php?id=1492题意: 有n个盒子 现在有两种操作: 1 在序号为x的倍数的盒子里放y个球 2 查询序号x到y的盒子里的球的总数思路: 当时以为线段数 而且没...
阅读全文
摘要:http://acm.hdu.edu.cn/showproblem.php?pid=2602题意 : n个骨头 m的容量 给出n个骨头的 value 和 volume 求m能容纳的最大价值思路 : dp[j]=max(dp[j],dp[j-w[i]]+v[i]);#include#i...
阅读全文
摘要:#include#include#include#includeusing namespace std;int mat[120][120];int main(){ int c,n; int i,j,k; scanf("%d",&c); while(c--) { ...
阅读全文
摘要:不明白为什么要放在dp里#include#include#include#includeusing namespace std;int main(){ char add[10]="(max)"; char str[200]; while(scanf("%s",str)!=EOF) ...
阅读全文
摘要:http://acm.hdu.edu.cn/showproblem.php?pid=5142#include#include#include#include#includeusing namespace std;int bin[100];int main(){ int t,n,i,j,k; ...
阅读全文
摘要:#include#include#include#include#includeusing namespace std;int main(){ double r,x,y,x1,y1; while(scanf("%lf%lf%lf%lf%lf",&r,&x,&y,&x1,&y1)!=EOF...
阅读全文
摘要:http://acm.zju.edu.cn/onlinejudge/showProblem.do?problemCode=3519题意 :caocao能够战胜每一个人 战胜智商比他高的加2点智商 否则加1点 问经过辩论后能得到的最高智商值为多少思路:在辩论中一直和智商比自己高的比 把比自己低的...
阅读全文
摘要:http://codeforces.com/problemset/problem/494/A题意 有一串字符串由 ( ) # 组成 #代表若干个 ) 问#具体为多少时可以使每个( 都对应一个 )思路 由于可以有多种方式组合 可以默认前 cnt-1 个 #号 与它前一个 ( 匹配 之后...
阅读全文
摘要:http://acm.hdu.edu.cn/showproblem.php?pid=5104#include#include#include#include#includeusing namespace std;int isp[10000+100];int prime[10000];int coun...
阅读全文
摘要:#include#include#include#includeusing namespace std;int num[1100];int main(){ int n,k,l,r,sa,sk; int ver,yu,add,sla; int i,j; while(scanf(...
阅读全文

浙公网安备 33010602011771号