- 博客(60)
- 问答 (1)
- 收藏
- 关注
原创 蓝桥杯 三羊献瑞
题目:三羊献瑞观察下面的加法算式: 祥 瑞 生 辉 + 三 羊 献 瑞------------------- 三 羊 生 瑞 气其中,相同的汉字代表相同的数字,不同的汉字代表不同的数字。请你填写“三羊献瑞”所代表的4位数字(答案唯一),不要填写任何多余内容。代码:#include #includeusing
2016-02-29 21:41:14 619
原创 蓝桥杯 李白打酒
题目:标题:李白打酒 话说大诗人李白,一生好饮。幸好他从不开车。 一天,他提着酒壶,从家里出来,酒壶中有酒2斗。他边走边唱: 无事街上走,提壶去打酒。 逢店加一倍,遇花喝一斗。 这一路上,他一共遇到店5次,遇到花10次,已知最后一次遇到的是花,他正好把酒喝光了。 请你计算李白遇到店和花
2016-02-29 21:03:44 246
原创 蓝桥杯 打印图形(分型法)
题目:标题:打印图形 小明在X星球的城堡中发现了如下图形和文字:rank=1*rank=2 ** *rank=3 * * * * * * * * *rank=4 * * * * * * * * * * * * * * *
2016-02-29 20:41:51 600
原创 蓝桥杯 奖券数目(数位dp)
题目:奖券数目有些人很迷信数字,比如带“4”的数字,认为和“死”谐音,就觉得不吉利。虽然这些说法纯属无稽之谈,但有时还要迎合大众的需求。某抽奖活动的奖券号码是5位数(10000-99999),要求其中不要出现带“4”的号码,主办单位请你计算一下,如果任何两张奖券不重号,最多可发出奖券多少张。请提交该数字(一个整数),不要写任何多余的内容或说明性文字。代码:#in
2016-02-23 11:05:48 728 1
原创 蓝桥杯 奖券数目 (暴力)
题目:奖券数目有些人很迷信数字,比如带“4”的数字,认为和“死”谐音,就觉得不吉利。虽然这些说法纯属无稽之谈,但有时还要迎合大众的需求。某抽奖活动的奖券号码是5位数(10000-99999),要求其中不要出现带“4”的号码,主办单位请你计算一下,如果任何两张奖券不重号,最多可发出奖券多少张。请提交该数字(一个整数),不要写任何多余的内容或说明性文字。// 52488
2016-02-22 23:10:19 1185
原创 蓝桥杯 找单词
题目:输入一个字符串,求它包含多少个单词。单词间以一个或者多个空格分开。第一个单词前,最后一个单词后也可能有0到多个空格。比如:" abc xyz" 包含两个单词,"ab c xyz " 包含3个单词。如下的程序解决了这个问题,请填写划线部分缺失的代码。注意:只填写划线部分的代码,不要填写任何多余的内容。比如已经存在的小括号,注释或说明文字
2016-02-22 17:10:02 625
原创 蓝桥杯 操作格子 (线段树)
题目:有n个格子,从左到右放成一排,编号为1-n。共有m次操作,有3种操作类型:1.修改一个格子的权值,2.求连续一段格子权值和,3.求连续一段格子的最大值。对于每个2、3操作输出你所求出的结果。输入格式第一行2个整数n,m。接下来一行n个整数表示n个格子的初始权值。接下来m行,每行3个整数p,x,y,p表示操作类型,p=1时表示修改格子
2016-02-22 14:40:29 379
原创 蓝桥杯 第39阶台阶(dfs)
题目标题: 第39级台阶 小明刚刚看完电影《第39级台阶》,离开电影院的时候,他数了数礼堂前的台阶数,恰好是39级! 站在台阶前,他突然又想着一个问题: 如果我每一步只能迈上1个或2个台阶。先迈左脚,然后左右交替,最后一步是迈右脚,也就是说一共要走偶数步。那么,上完39级台阶,有多少种不同的上法呢? 请你利用计算机的优势,帮助小明寻找答案。要求提交的
2016-02-21 21:58:11 419
原创 HDU 2602 Bone Collector(01背包)
题目:http://acm.hdu.edu.cn/showproblem.php?pid=2602代码:#include#include#include#includeusing namespace std;int n[1111],v[1111];int dp[1111];int Max(int x,int y){ return x>y?x:y;}int m
2016-02-21 18:26:29 212
原创 HDU 2955 Robberies(01背包)
题目:http://acm.hdu.edu.cn/showproblem.php?pid=2955代码:#include#include#includeusing namespace std;float prob[105],dp[10005];int money[105];int main(){ int t; scanf("%d",&t); wh
2016-02-21 17:06:33 200
原创 HDU 1284 钱币兑换问题(递归)
题目:http://acm.hdu.edu.cn/showproblem.php?pid=1284代码:#define MaxSize 32768 int cnt[MaxSize][4]; int partition(int n, int m){ if (cnt[n][m] > 0) { return cnt[n][m]; } if
2016-02-21 15:55:16 682
原创 HDU 1284 钱币兑换问题(母函数)
题目:http://acm.hdu.edu.cn/showproblem.php?pid=1284代码:#include #include #include using namespace std;const int Max=32769;int ans[Max];int tans[Max];int main(){ int i,j,n; for(int i=0
2016-02-21 15:49:49 292
原创 HDU 1284 钱币兑换问题 (完全背包)
题目:http://acm.hdu.edu.cn/showproblem.php?pid=1284代码:#includeint dp[35000];int main(){ int i,j; dp[0]=1; for(i=1;i<=3;i++) for(j=i;j<=35000;j++) dp[j]+=dp[j-i];
2016-02-21 15:47:30 295
原创 Codeforces 629A Far Relative’s Birthday Cake
题目:http://codeforces.com/contest/629代码:#include#includeusing namespace std;char maps[105][105];long long C(int a,int b){ long long ans=1; for(int i=0;i<b;++i) { ans*=a-
2016-02-21 08:21:21 304
原创 HDU 5631 Rikka with Graph (并查集)
题目:http://acm.hdu.edu.cn/showproblem.php?pid=5631代码:#include#includeusing namespace std;int u[121];int v[121];int f[121];int n;int output;int find(int x){ return f[x] == x ? x : (f[x]
2016-02-20 23:44:33 313
原创 HDU 5630 Rikka with Chess
题目:http://acm.hdu.edu.cn/showproblem.php?pid=5630代码:#include#includeusing namespace std;int main(){ int t; scanf("%d",&t); while(t--) { int a,b; scanf("%d%d",
2016-02-20 21:28:55 232
原创 Codeforces 630F Selection of Personnel ( C(a,b) )
题目:http://codeforces.com/problemset/problem/630/F代码:#includeusing namespace std;long long C(int a,int b) //新姿势GET{ long long ans=1; for(int i=0;i<b;++i) {
2016-02-20 15:22:28 341
原创 COdeforces 630D Hexagons!
题目:http://codeforces.com/contest/630/problem/D代码:#include#include#includeusing namespace std;int main(){ __int64 t; scanf("%I64d",&t); __int64 sum=1; __int64 n=1; // for(i
2016-02-20 14:37:47 89
原创 Codeforces 630C Lucky Numbers
题目:http://codeforces.com/contest/630/problem/C代码:#include#include#includeusing namespace std;int main(){ int t; scanf("%d",&t); __int64 sum=1; for(int i=1;i<=t+1;i++) {
2016-02-20 14:35:40 340
原创 Codeforces 630B Moore's Law
题目:http://codeforces.com/contest/630/problem/B代码:#include#include#includeusing namespace std;int main(){ __int64 a,b; scanf("%I64d%I64d",&a,&b); printf("%llf",a*pow(1.000000011,b
2016-02-20 14:34:11 377
原创 Codeforces 630A Again Twenty Five!
题目:http://codeforces.com/contest/630/problem/A代码:#include#includeusing namespace std;int main(){ int t; scanf("%d",&t); printf("25");}
2016-02-20 14:32:34 317
原创 Codeforces 630R Game
题目:http://codeforces.com/contest/630/problem/R代码:#include#include#includeusing namespace std;int main(){ char a[100]; scanf("%s",a); int t=strlen(a)-1; // printf("%c",a[t]);
2016-02-20 14:29:37 347
原创 Codeforces 628B New Skateboard (数学)
题目:http://codeforces.com/contest/628/problem/B代码:#include#include#include#includeusing namespace std;int main(){ string a; cin>>a; __int64 ans=0; for(int i=0;i<a.length();i
2016-02-20 12:39:46 260
原创 Codeforces 628A Tennis Tournament
题目:http://codeforces.com/contest/628/problem/A代码:#includeint a,b,c;int main(){ while(~scanf("%d%d%d",&a,&b,&c)) { printf("%d %d\n",(a-1)*(2*b+1),a*c); }}只要翻译。
2016-02-20 12:37:09 330
原创 HDU 1284 钱币兑换问题 (数学)
题目:http://acm.hdu.edu.cn/showproblem.php?pid=1284代码:#include using namespace std;int main(){ int n,sum,i; while (cin>>n) { for (i=0,sum=0;i<=n/3;i++) sum+=(n-3*i)/2+1; cout<<sum<<endl
2016-02-19 16:13:51 143
原创 HDU 1003 Max Sum (动态规划)
题目:http://acm.hdu.edu.cn/showproblem.php?pid=1003分析:动态规划方程: sum[i] = max ( sum[i-1] + a[i] , a[i] ) s[i]中 s[i]是起点的值,i是终点的值计算出的ans是终点的值。代码:#include#includeusing namespace std;int
2016-02-19 13:18:08 219
原创 Codeforces 25C Roads in Berland(floyed)
题目:http://codeforces.com/problemset/problem/25/C代码:#include#include#includeusing namespace std;long long maps[305][305];int n,m;int main(){ scanf("%d",&n); for(int i=1;i<=n;i++)
2016-02-18 14:34:16 447
原创 Codeforces 25B Phone numbers(此题有毒可以忽略)
题目:http://codeforces.com/problemset/problem/25/B代码:#include#include#includeusing namespace std;int main(){ int n; string a; cin>>n; cin>>a; if(n%3==0) { cout<<a[0]<<a[1]<<a[2];
2016-02-18 14:30:03 373
原创 Codeforces 25A IQ test
题目:http://codeforces.com/problemset/problem/25/A代码:#include#include //还真是IQ测试using namespace std;int main(){ int t; scanf("%d",&t); int a[105]; int n,m,j=0,k=0; f
2016-02-18 14:24:27 331
原创 HDU 3361 Assignments(贪心)
题目:http://acm.hdu.edu.cn/showproblem.php?pid=3661代码:#include#include#includeusing namespace std;int cmp(int x,int y){ return x>y;}int main(){ int n,m; while(~scanf("%d%d",&n,
2016-02-17 11:04:51 222
原创 HDU 5366 The mook jong
题目:http://acm.hdu.edu.cn/showproblem.php?pid=5366代码:#include#includeusing namespace std;int main(){ int a; __int64 b[100]={0,1,2,3,5,8,13}; while(~scanf("%d",&a)) { f
2016-02-17 10:51:33 219
原创 HDU 5158 Have meal
题目:http://acm.hdu.edu.cn/showproblem.php?pid=5158代码:#includeusing namespace std;int main(){ int a,b; while(cin>>a>>b) { int x=b%a; if(x==0)cout<<a-1<<endl; e
2016-02-17 10:47:27 61
原创 HDU 1873 看病要排队(优先队列)
题目:http://acm.hust.edu.cn/vjudge/problem/viewProblem.action?id=32590代码:#include#include#includeusing namespace std;struct node{ int num; int a,b; friend bool operator <(node x,n
2016-02-16 18:16:08 287
原创 HDU 1509 Windows Message Queue(优先队列)
题目:http://acm.hust.edu.cn/vjudge/problem/viewProblem.action?id=40702代码:#include#include#include#includeusing namespace std;struct node{ char name[33]; int mes; int val; int
2016-02-16 17:35:46 232
原创 HDU 4544 湫湫系列故事――消灭兔子(优先队列)
题目:http://acm.hust.edu.cn/vjudge/problem/viewProblem.action?id=37957代码:#include#include#include#include#includeusing namespace std;#define N 100005struct node{ int d,p; friend bo
2016-02-16 11:43:20 263
转载 STL容器之优先队列
转载地址:http://www.cnblogs.com/summerRQ/articles/2470130.html优先级队列,以前刷题的时候用的比较熟,现在竟然我只能记得它的关键字是priority_queue(太伤了)。在一些定义了权重的地方这个数据结构是很有用的。先回顾队列的定义:队列(queue)维护了一组对象,进入队列的对象被放置在尾部,下一个被取出的元素则取自队列的
2016-02-16 11:19:25 170
原创 HRBUST 2189 节点的连接 (并查集)
题目:http://acm.hrbust.edu.cn/index.php?m=ProblemSet&a=showProblem&problem_id=2189代码:#include int pre[1010];int Find(int x){ int r = x; while (pre[r] != r) { r = pre[r];
2016-02-16 10:35:27 296
转载 HDU 1878 欧拉回路
算法思想:判断一个图中是否存在欧拉回路(每条边恰好只走一次,并能回到出发点的路径),在以下三种情况中有三种不同的算法:一、无向图每个顶点的度数都是偶数,则存在欧拉回路。 二、有向图(所有边都是单向的)每个节顶点的入度都等于出度,则存在欧拉回路。以上两种情况都很好理解。其原理就是每个顶点都要能进去多少次就能出来多少次。 三、混合图(有的
2016-02-14 11:33:00 237
原创 Codeforces 626A Robot Sequence
题目:http://codeforces.com/problemset/problem/626/A代码:#include#include#includeusing namespace std;int main(){ int a; while(~scanf("%d",&a)) { char b[205]; scanf("%
2016-02-14 10:33:31 351
原创 HDU 2952 Counting Sheep(bfs)
题目:http://acm.hdu.edu.cn/showproblem.php?pid=2952代码:#include#include#includeusing namespace std;char maps[105][105];int fx[4]={1,0,-1,0};int fy[4]={0,-1,0,1};int dis[105][105];int a,b;
2016-02-13 17:25:59 292
空空如也
小白求助!!!opencv 怎样将一张图片上蓝色点的坐标输出出来???
2016-12-07
TA创建的收藏夹 TA关注的收藏夹
TA关注的人