Vjudge
Sensente
满船清梦压星河
展开
-
UVA - 11991 Easy Problem from Rujia Liu?
Though Rujia Liu usually sets hard problems for contests (for example, regional contests like Xi’an 2006, Beijing 2007 and Wuhan 2009, or UVa OJ contests like Rujia Liu’s Presents 1 and 2), he occasi...原创 2019-12-09 10:02:13 · 206 阅读 · 0 评论 -
UVa11995 I Can Guess the Data Structure!
There is a bag-like data structure, supporting two operations: 1 x Throw an element x into the bag. 2 Take out an element from the bag.Given a sequence of operations with return values, you’re goin...原创 2019-12-08 22:31:42 · 154 阅读 · 0 评论 -
2014 ACM ICPC Mudanjiang Region(部分)
A.Average Scorehttps://vjudge.net/problem/ZOJ-3819题目大意:你持有一份成绩,如果你去另一个班,两个班的平均成绩都会比现在高。N —— 你所在班级的人数 M —— 隔壁班人数Sum1 —— 你所在班级的总分(除去你) Sum2 —— 隔壁班总分得到数学表达式:注意对于上界需要向下取整,对于下界需要向上取整,考虑到临界值,应...原创 2019-07-25 11:13:48 · 160 阅读 · 0 评论 -
POJ1035 Spell checker
POJ1035http://poj.org/problem?id=1035前:(噗...)题目大意:先给定一个字典,然后给出一些询问,都是单个单词,查询在字典中的1.一模一样的单词 , 输出"correct";2.差距在一个字母之内,且可删除的如mre= me;3.差距在一个字母之内,且可增添的如mre = more;思路:不用特定判断增添/删除操...原创 2019-07-26 20:05:14 · 176 阅读 · 0 评论 -
POJ1422 Air Raid(二分图)
POJ 1422http://poj.org/problem?id=1422Air RaidTime Limit: 1000MS Memory Limit: 10000KTotal Submissions: 9821 Accepted: 5872DescriptionConsider a town where all the streets are one-way and e...原创 2019-08-25 23:04:34 · 164 阅读 · 0 评论 -
POJ2771 Guardian of Decency(二分图)
POJ 2771http://poj.org/problem?id=2771Guardian of DecencyTime Limit: 3000MS Memory Limit: 65536KTotal Submissions: 6768 Accepted: 2784DescriptionFrank N. Stein is a very conservative high-s...原创 2019-08-25 23:45:02 · 277 阅读 · 0 评论 -
POJ1905 Expanding Rods(几何+二分)
POJ 1905https://vjudge.net/problem/POJ-1905题目大意:有一节绳子受热后会膨胀成弓形,问弓形与原绳子中心的距离。解题思路:数学分析如下:接下来就是比较两个式子的大小,从0到l/2(题目所说)二分逼近。注意:浮点数比较的时候需要设置esp而不能直接比较相等。AC代码:#include <...原创 2019-08-21 18:55:46 · 176 阅读 · 0 评论 -
POJ3122 Pie
POJ 3122http://poj.org/problem?id=3122题目大意:记得F++和精度。以及使用C++提交。AC代码:#include <iostream>#include <cmath>using namespace std;const double eps = 1e-6;const double PI = 3....原创 2019-08-21 23:17:38 · 143 阅读 · 0 评论 -
POJ3096 Surprising Strings
POJ3096http://poj.org/problem?id=3096题目大意:给定一串字符串,如果该字符串不论隔几个字符取两个字符都不会相等,则是“surprising" 否则就是"NOT surprising"思路:错位比较,将原字符串每次向后移动一个字符位形成的新串与原字符串错位比较,如果有两个字符恰好相同则符合”NOT“的要求。AC代码:#inc...原创 2019-07-24 15:41:15 · 177 阅读 · 0 评论 -
LOJ 1370 Bi-shoe and Phi-shoe
Vjudgehttps://vjudge.net/problem/LightOJ-1370#author=0题目大意:给定一组数据,欧拉函数数值刚好符合给定数据 或 刚好大于给定数据的数值的和。AC代码:#include <iostream>using namespace std;const int N = 1000005;//int euler(int...原创 2019-07-15 12:00:39 · 141 阅读 · 0 评论 -
杭电2161 Primes
HDU2161http://acm.hdu.edu.cn/showproblem.php?pid=2161AC代码:#include <iostream>using namespace std;bool prime(int x) { if(x == 1 || x == 2) return false; for(int i = 2; i * i ...原创 2019-07-15 10:50:35 · 188 阅读 · 0 评论 -
POJ2159 Ancient Cipher
POJ2159http://poj.org/problem?id=2159题目大意:有点凯撒密码的意思,但是是向后移动一定的字符之后乱序排列形成密文。向后加密顺序相对好确定,但是还要错乱排序就显得很无解了。。。思路:按照密码学的统计规律结合题意,既然是同时加密,只要求各字符出现的频率保持一致即可。所以,我们只需统计两个字符串中字符出现的频率,进行对比即可。AC代码...原创 2019-05-22 23:54:09 · 176 阅读 · 0 评论 -
POJ 2586 Y2K Accounting Bug(贪心)
POJ 2586http://poj.org/problem?id=2586题目大意:是说一家公司,每连续五个月都是亏损的。求这家公司最后可能的盈利最大值。思路:贪心。依次分类讨论,使得五个月中,亏损月的数目是最少的。如下://以下s代表盈利月份 d代表亏损月份1:ssssd ssssd ss d > 4s 10s - 2d2:sssd...原创 2019-05-30 17:21:47 · 226 阅读 · 0 评论 -
POJ3295 Tautology(栈+思路详解)
POJ3295http://poj.org/problem?id=3295题目大意:给定一个逻辑表达式,包含五个逻辑变量和五种运算,求问该表达式是否为重言式(永真)。解题思路:首先弄清楚题目给定的五种运算是什么:K ---- w&&xA ---- w||xN ---- !wC ---- (!w)||xE ---- w==x...原创 2019-05-30 18:25:33 · 933 阅读 · 0 评论 -
POJ 3006 Dirichlet's Theorem on Arithmetic Progressions
POJ 3006http://poj.org/problem?id=3006题目大意:找一个线性递增序列的第n个素数。解题思路:直接搜嘛,线性复杂度O(n)AC代码:#include <iostream>#include <stdio.h>#include <cstring>#include <algorithm&...原创 2019-05-23 23:25:59 · 131 阅读 · 0 评论 -
POJ 2109 Power of Cryptography
POJ 2109http://poj.org/problem?id=2109题目大意:求。。b的1/a次方?这个题目我也是没懂。。敲出来的代码也算是我做的题目里面最为。。稀少的一道题目了?AC代码:#include <iostream>#include <cmath>using namespace std;double...原创 2019-05-30 00:08:20 · 139 阅读 · 0 评论 -
POJ 1068 Parencodings
POJ 1068http://poj.org/problem?id=1068题目大意:题目主要看懂两个序列的意义P序列是指一个右括号的左边有p个左括号W序列是指与一个右括号相匹配的最近的左括号的序列(每次从1开始计数)思路:模拟。AC代码:#include<iostream>#include<cmath>#inc...原创 2019-06-12 00:10:22 · 114 阅读 · 0 评论 -
杭电1213 How Many Tables
HDU1213http://acm.hdu.edu.cn/showproblem.php?pid=1213题目大意:并查集,只要找到所有父亲节点的个数即可。AC代码:#include <iostream>using namespace std;const int maxn = 5005;int father[maxn];void init()...原创 2019-06-29 00:10:16 · 113 阅读 · 0 评论 -
POJ1611 The Suspects
POJ1611 http://poj.org/problem?id=1611题目大意:给定0~n-1个学生,m个小组。其中0号学生是 鸡你太美 病毒的感染者,和他在一个组的同学也会被他传染。问最后有多少个同学感染。解题思路:并查集,另外开一个数组用于储存在i号序列下挂载了多少个子个数。合并的时候将被合并的个数加到父亲节点的个数上即可。AC代码:#incl...原创 2019-06-29 11:18:45 · 124 阅读 · 0 评论 -
POJ1318 Is It A Tree?(不用并查集)
POJ1318http://poj.org/problem?id=1308题目大意:给定一些二元组表示一棵“树”中的点的关系,问这些关系能不能最后组成一棵树。即满足:1.只有一个根结点 2.每个点只有一个父亲节点。解题思路:凡是能组成树,即满足点的数量 = 边的数量 + 1那么用一个set除重,再记录输入的对数判断即可。WA提醒 : 空树也是树。即只输入 ...原创 2019-06-29 16:01:48 · 127 阅读 · 0 评论 -
POJ1083 Moving Tables(思维详解)
POJ 1083http://poj.org/problem?id=1083题目大意:题目很长,大致意思是有400个面对面的房间,现在要从一个房间到另一个房间移动物品 ,每次花费10分钟,但是移动过程中所有的经过的走廊都会被占用,也就是不能使用,问最少移动完所有的物品需要多久。解题思路:由于每次移动过程中都会占用相关的走廊,因此我们只需要枚举每个房间前的走廊需要被...原创 2019-05-22 23:48:22 · 377 阅读 · 0 评论