gym/101873/GCPC2017】的更多相关文章

题目链接:https://codeforces.com/gym/101873 C. Joyride 记忆化搜索形式的dp #include <algorithm> #include <iterator> #include <iostream> #include <cstring> #include <cstdlib> #include <iomanip> #include <bitset> #include <cct…
题还没补完 以下是牢骚:删了 现在只有六个...太恐怖了,我发现四星场我连300人的题都不会啊. C:最短路加一维状态就好了叭..嗯,一开始没看到输出的那句话 那个  "."也要输出,然后n,m看反了,这反人类啊这nm. #include <bits/stdc++.h> #define mk(a,b) make_pair(a,b) #define pii pair<int,int> using namespace std; typedef long long l…
题目链接:http://codeforces.com/gym/101873/problem/F 题意:有n个插孔,m个机器,和一个插板,一个插孔可以连接一个机器,插板可以使一个插孔连接三个机器,找到最大的连接数 当时第一眼觉得是网络流的题目,因为看过类似的题目,他是有k个插板,但是一个插板可以使插孔多连接一个机器.这题特殊在于只有一个插板,那我们先只考虑没有插板的情况下,找到最大匹配,然后再对n个插孔寻找增广路,找到最大的匹配值 #include <bits/stdc++.h> #define…
题目链接:http://codeforces.com/gym/101873/problem/C 题意: 这是七月的又一个阳光灿烂的日子,你决定和你的小女儿一起度过快乐的一天.因为她真的很喜欢隔壁镇上的仙女公园,所以你决定到那儿去玩一天. 你妻子同意开车送你去公园接你.她非常准时,所以她确切地告诉你她什么时候会到公园的前门来接你,而你必须恰好在那个时间到那里.因为你显然也不想在外面等,这样会让你的小女儿伤心——她本可以在公园里多待些时间. 现在你必须考虑游玩计划.你知道你什么时候到达,什么时候离开…
题目链接:http://codeforces.com/gym/101873/problem/D 题意: 给出 $n$ 个事实,表述为 "XXX are worse than YYY".再给出 $m$ 个某人说的话,也是表述为 "XXX are worse than YYY",对于每句话都要判断是否正确: 如果正确,输出 "Fact":如果错误,输出 "Alternative Fact":如果无法判断,输出 "Pant…
题目链接:http://codeforces.com/gym/101873/problem/G 题意: 在点阵上,给出 $N$ 个点的坐标(全部都是在格点上),将它们按顺序连接可以构成一个多边形,求该多边形内包含的格点的数目. 题解: 首先,根据皮克定理 $S = a + \frac{b}{2} - 1$,其中 $S$ 是多边形面积,$a$ 是多边形内部格点数目,$b$ 是多边形边界上的格点数目. 那么,我们只要求出 $S$ 和 $b$,就很好求得 $a$ 了: 1.对于两端点 $(x_1,y_…
题目链接:http://codeforces.com/gym/101873/problem/I 题意: 给出 $n(1 \le n \le 300000)$ 个单位时间,每个单位时间给出一个 $x_i(0 \le x_i \le 32)$ 代表该单位时间内视野内的敌人数目. 现在你有一个终极武器,每次使用可以消灭视野内所有敌人,但是需要 $m$ 个单位时间进行充能,且刚开始该武器是没有充能的. 这意味着,第一次可以使用该武器是在第 $m+1$ 个单位时间内,而往后若在第 $i$ 个单位时间使用则…
题目链接:http://codeforces.com/gym/101873/problem/K 题意: 现在给出 $n(1 \le n \le 1e4)$ 个员工,最多可以裁员 $k$ 人,名字为 $s_i$ 的员工的薪资为 $c_i(1 \le c_i \le 1e5)$. 已知必须节省下 $d(1 \le d \le 1e9)$ 元才能拯救公司,问要裁员哪些人. 题解: 薪资越高的人越要裁掉. (这么个大水题,居然没人发现,交的人不多.可能是这套题英语阅读量有点烦人吧……) AC代码: #i…
参考博客: https://blog.csdn.net/liangzhaoyang1/article/details/72639208 题目链接: https://codeforces.com/gym/101873/problem/B 题意: 给出$C$种颜色,涂在每面墙大小为$n\cdot n$的正$m$角楼上,求本质不同的染色方法种数 数据范围: $1\leq n\leq 500$ $3\leq m\leq 500$ $1\leq c\leq 500$ 分析: 题目可以转化为$C^{n\cd…
题目链接:https://codeforces.com/gym/101873/problem/C spaf的复杂度有点迷,按道理来说,一个简单的spaf在这题的复杂度是1e9,所以不敢写,然后用优先队列ac,发现居然比spaf要慢 现在列出以下总结: 1.对于稀疏图,spaf的复杂度不高于n*m,而且不会有很多的放缩 2.输出少了个.    It is a trap. (including the period) 3.邻接表的大小错了,带来超时,而不是越界,所以不要以为超时就是因为代码太慢 4.…
http://codeforces.com/gym/101873 C 多开一维状态记录时间,d[i][t] = 经过时间t走到节点i的最小花费 每一个状态分别向"原地等待"与"前往下一个节点"转移 代码: #include <iostream> #include <algorithm> #include <queue> #include <cstring> #include <vector> using n…
http://codeforces.com/gym/101873 F 先对原图跑一遍匈牙利得到原始最大匹配,再遍历每个出度>1的点,考虑若新加入点,能否找到增广路,若可行则答案对应增加 代码: #include <iostream> #include <cstdio> #include <vector> #include <cstring> #include <algorithm> #include <queue> using…
 Gym 101047M Removing coins in Kem Kadrãn Time Limit:2000MS     Memory Limit:65536KB     64bit IO Format:%I64d & %I64u Practice Description standard input/output Andréh and his friend Andréas are board-game aficionados. They know many of their friend…
 Gym 101047K Training with Phuket's larvae Time Limit:2000MS     Memory Limit:65536KB     64bit IO Format:%I64d & %I64u Practice Description standard input/output Thai cuisine is known for combining seasonings so that every dish has flavors that are…
Gym 101047E Escape from Ayutthaya Time Limit:2000MS     Memory Limit:65536KB     64bit IO Format:%I64d & %I64u  Practice  Description standard input/output Ayutthaya was one of the first kingdoms in Thailand, spanning since its foundation in 1350 to…
 Gym 101047B  Renzo and the palindromic decoration Time Limit:2000MS     Memory Limit:65536KB     64bit IO Format:%I64d & %I64u Practice Description standard input/output At the ruins of Wat Phra Si Sanphet (วดพระศรสรรเพชญ), one can find famous inscr…
题目链接 http://codeforces.com/gym/101102/problem/J Description standard input/output You are given an array A of integers of size N, and Q queries. For each query, you will be given a set of distinct integers S and two integers L and R that represent a…
题目链接 http://codeforces.com/gym/100917/problem/J Description standard input/outputStatements The jury of Berland regional olympiad in informatics does not trust to contest management systems, so the Berland regional programming contest is judged by th…
题目链接 http://codeforces.com/gym/100917/problem/D problem description Famous Berland coder and IT manager Linus Gates announced his next proprietary open-source system "Winux 10.04 LTS" In this system command "dir -C" prints list of all…
题目链接 http://codeforces.com/gym/101102/problem/D problem  description Given an R×C grid with each cell containing an integer, find the number of subrectangles in this grid that contain only one distinct integer; this means every cell in a subrectangle…
题目链接 http://codeforces.com/gym/101102/problem/C problem description Judge Bahosain was bored at ACM AmrahCPC 2016 as the winner of the contest had the first rank from the second hour until the end of the contest. Bahosain is studying the results of t…
Gym Class  Accepts: 849  Submissions: 4247  Time Limit: 6000/1000 MS (Java/Others)  Memory Limit: 65536/65536 K (Java/Others) Problem Description 众所周知,度度熊喜欢各类体育活动. 今天,它终于当上了梦寐以求的体育课老师.第一次课上,它发现一个有趣的事情.在上课之前,所有同学要排成一列, 假设最开始每个人有一个唯一的ID,从1到NN,在排好队之后,每个…
Weird Cryptography Time Limit:2000MS     Memory Limit:65536KB     64bit IO Format:%I64d & %I64u  Gym 100935B Description standard input/output Khaled was sitting in the garden under an apple tree, suddenly! , well... you should guess what happened, a…
Board Game Time Limit:2000MS     Memory Limit:65536KB     64bit IO Format:%I64d & %I64u  Gym 100935G Description standard input/outputStatements Feras bought to his nephew Saleem a new game to help him learning calculating. The game consists of a boa…
Gym 100935F A Poet Computer Time Limit:2000MS     Memory Limit:65536KB     64bit IO Format:%I64d & %I64u Description standard input/output The ACM team is working on an AI project called (Eih Eye Three) that allows computers to write poems. One of th…
Evil Time Limit: 5 Sec Memory Limit: 256 MB 题目连接 http://codeforces.com/gym/100463/attachments Description Richard is evil. He wants to give another geometry problem to the participants of this contest and I’m afraid I have no choice but to comply. Wh…
Crossings Time Limit: 20 Sec Memory Limit: 256 MB 题目连接 http://codeforces.com/gym/100463 Description Given a permutation P of {0, 1, ..., n − 1}, we define the crossing number of it as follows. Write the sequence 0, 1, 2, . . . , n − 1 from left to ri…
J. Deck Shuffling Time Limit: 2   Sec Memory Limit: 256 MB 题目连接 http://codeforces.com/gym/100187/problem/J Description The world famous scientist Innokentiy continues his innovative experiments with decks of cards. Now he has a deck of n cards and k…
K. Perpetuum Mobile Time Limit: 2 Sec Memory Limit: 256 MB 题目连接 http://codeforces.com/gym/100187/problem/K Description The world famous scientist Innokentiy almost finished the creation of perpetuum mobile. Its main part is the energy generator which…
Problem J. Triatrip Time Limit: 20 Sec Memory Limit: 256 MB 题目连接 http://codeforces.com/gym/100342/attachments Description The travel agency “Four Russians” is offering the new service for their clients. Unlike other agencies that only suggest one-way…