ural 1113,jeep problem】的更多相关文章

题目链接:http://acm.timus.ru/problem.aspx?space=1&num=1113 网上的解答铺天盖地.我硬是花了两天才懂了点. wiki上的解释:https://en.wikipedia.org/wiki/Jeep_problem 解答:每个点的油量是500,500*2,500*3... ... 每次的距离是500,500/3,500/5,... ...,500/2n-1; #include <bits/stdc++.h> using namespace s…
1881. Long problem statement Time limit: 0.5 secondMemory limit: 64 MB While Fedya was writing the statement of the problem GOV Chronicles, he realized that there might be not enough paper to print the statements. He also discovered that his text edi…
题意:让你构造一个n个点的简单多边形,使得所有点是整点,并且所有边长是整数,并且没有边平行于坐标轴. 就利用勾股数,如下图这样构造即可,n为偶数时,只需矩形拼成,n为奇数时,封上虚线边即可. #include<cstdio> using namespace std; struct Point{ int x,y; Point(const int &x,const int &y){ this->x=x; this->y=y; } Point(){} }p[1005];…
题意:有n群人,每个人有喜欢的汉堡配方:有m家店,给出每家店的每个汉堡的配方,如果存在某个汉堡,其配料表包含某个人喜欢的配方,则这个人喜欢这个汉堡所在的店家.问你对每群人,输出被喜欢的人数最多的店面是哪家. 直接把每家店所能满足的口味表全塞到哈希表里面,暴力枚举统计即可. 这里用了双关键字哈希表,比较巧妙,是绝对的O(1). #include<cstdio> #include<cstring> #include<vector> using namespace std;…
题意:有n杯盐溶液,给定每杯里面盐的质量以及盐溶液的质量.问你有多少种方案选择一个子集,使得集合里面的盐溶液倒到一个被子里面以后,浓度为A/B. 折半枚举,暴力搜索分界线一侧的答案数,跨越分界线的答案,一侧用map存下来,枚举另一侧去统计. #include<cstdio> #include<map> using namespace std; typedef long long ll; ll ans; int n,a,b,m[39],t[39]; map<ll,int>…
http://poj.org/problem?id=1113 夏令营讲课时的求凸包例题,据说是PKUSC2015的一道题 我WA两次错在四舍五入上了(=゚ω゚)ノ #include<cmath> #include<cstdio> #include<cstring> #include<algorithm> using namespace std; double Pi = acos(-1); const int N = 1003; struct Point {…
题目链接:http://acm.csu.edu.cn/OnlineJudge/problem.php?id=1113 解题报告:输入两个字符串,第一个是原来的字典,第二个是新字典,字典中的元素的格式为一个关键字对应一个值,输入格式如下: {a:3,b:4,c:10,f:6} {a:3,c:5,d:10,ee:4}冒号前面的表示关键字,冒号后面的数字表示值,关键字由小写字母组成.现在让你判断,如果新的字典相对于原来的字典有新增的关键字以以下格式输出 :+key1,key2,....如果新的字典相对…
2071. Juice Cocktails Time limit: 1.0 secondMemory limit: 64 MB Once n Denchiks come to the bar and each orders a juice cocktail. It could be from 1 to 3 different juices in each cocktail. There are three juices in the bar: apple, banana and pineappl…
2073. Log Files Time limit: 1.0 secondMemory limit: 64 MB Nikolay has decided to become the best programmer in the world! Now he regularly takes part in various programming contests, attentively listens to problems analysis and upsolves problems. But…
2070. Interesting Numbers Time limit: 2.0 secondMemory limit: 64 MB Nikolay and Asya investigate integers together in their spare time. Nikolay thinks an integer is interesting if it is a prime number. However, Asya thinks an integer is interesting i…