CTU Open Contest 2017】的更多相关文章

这场题很水.水题我就懒得贴了. B - Pond Cascade 优先队列维护这个水池需要多少时间 或者 直接扫一遍. #include <cstdio> #include <cstring> #include <algorithm> using namespace std; typedef long long LL; const int maxn = 100000 + 10; const int INF = 2e9; LL a[maxn], sum[maxn]; in…
题目&题意: 倒着找处于最后位置的等差数列的开头的位置. 例: 1 5 3 4 5 6 3 4 5 6是等差数列,它的开头的位置是3 PS: 读题真的很重要!!!!多组输入,上来就读错了!! 代码: #include <bits/stdc++.h> #define inf 0x3f3f3f3f #define FRE() freopen("in.txt","r",stdin) using namespace std; typedef long l…
题目&题意:(有点难读...) 给出一个数字序列,找出一个区间,当删除这个区间中的两个相同的数字后,只保留这两个数字之间的序列,然后继续删除相同的数字,问最多可以实行多少次删除操作. 例如: 所以执行两次删除操作. 思路: 区间dp,关键在于确定大的区间是由哪些小的区间转化来的. 当a[l] == a[r]的时候,dp[l][r] = dp[l+1][r-1]+1(因为要得到最多的删除次数,大的区间的次数在相等的情况下肯定是由内部小的区间加一得来的): 当a[l] != a[r]的时候,dp[l…
题目: To encourage visitors active movement among the attractions, a circular path with ice cream stands was built in the park some time ago. A discount system common for all stands was also introduced. When a customer buys ice cream at some stand, he…
题目: https://cn.vjudge.net/problem/1451310/origin 题意&思路: 纯粹模拟. 大体题意是这样的: 1.有人要在一个10-9<=x<=109,10-9<=y<=109,这么大的一张纸上去画图,而我们只需要打印输出最大为0<=x<=100,0<=y<=100范围内的图案就ok了. 2.如果s==0的话就在给出的坐标处画一个“_o_”( ASCII codes 95, 111, 95)的图案,表示a tree…
题目: Go Northwest! is a game usually played in the park main hall when occasional rainy weather discourages the visitors from enjoying outdoor attractions. The game is played by a pair of players and it is based entirely on luck, the players can hardl…
题目: A narrow gauge train drives the visitors through the sequence of chambers in the Dark Ride attraction. The chambers are occupied by IT monsters which are specially programmed to scare the visitors in various wicked ways. There is one monster in e…
题目:链接 思路: 多画出几个情况就可以找出规律来了 Knight (当大于2的时候只要两种颜色相间出现就可以了) King(当大于等于3的时候,总可以用四种形式来补色,具体如下)  Bishop(斜率为一的斜着的一行要不能相同,那只能是一列一个颜色了) Rook(要想水平竖直的颜色不一样,那只能是斜着的一行的颜色是一样的) 代码: #include <bits/stdc++.h> #define inf 0x3f3f3f3f using namespace std; typedef long…
题目: The cascade of water slides has been installed in the park recently and it has to be tested. The cascade consists of some number of reservoirs, or “ponds” for short, which are linked into a single sequence connected by water slides. Visitors are…
题目: The park management finally decided to install some popular boxing machines at various strategic places in the park. In fact, to compensate for the previous lack of machines, they decided to install as many machines as possible. Surprisingly enou…
NAIPC 2017 Yin and Yang Stones 75.39% 1000ms 262144K   A mysterious circular arrangement of black stones and white stones has appeared. Ming has been tasked with balancing the stones so that only one black and one white stone remain. Ming has two ope…
1065 Beihang Collegiate Pronunciation Contest 2017 思路 在字符串中不断做匹配 找到一个匹配就输出 时间复杂度\(O(n)\) ps.模式串是定长的,因此看做常数 代码 #include<string> #include<iostream> using namespace std; int main() { int n; cin >> n; string ch; cin >> ch; for (auto i…
ACM International Collegiate Programming Contest, Tishreen Collegiate Programming Contest (2017)- K. Poor Ramzi -dp+记忆化搜索 [Problem Description] 给你一串\(01\)字符串,将其划分,使得划分后,分别求出每组\(01\)之和后是回文的,求划分的方案数, [Solution] 定义\(dp[l][r]\)表示,区间\([l,r]\)中满足条件的方案数是多少.…
A. Numbers Joke time limit per test:2 seconds memory limit per test:64 megabytes input:standard input output:standard output   Input The input contains a single integer a (1 ≤ a ≤ 30). Output Output a single integer. Example Input 3 Output 27 题目链接:ht…
小菜鸡飘过 A: Beer Barrels 题意:给出四个整数:A,B,K,C,:A,B,C都是大于0的个位数,问在所有仅有A或者B组成的K位数中,数字C的个数是多少 思路: 1.先考虑特殊情况: (1) 如果C不是A或者B 则输出0 (2) 如果K = 0 则输出0 (3) 如果A==B 则输出K 2.再考虑一般情况: 共K位,每位都可能有C,求出共有多少种可能,排列组合问题. 多个 C(i,k)*I 相加 阶乘可以用数组模拟:用快速幂求逆元 AC代码: #include<bits/stdc+…
Problem A : Electric Bill 题目大意:进行电量分级制收费,1000kwh及以下一档收费,1000kwh以上按另一档收费,给出每个人的电量总额,问每人应支付多少钱. 思路:基础if else题,对于每个电量判断是否大于1000,再分别计算≤1000的价格和>1000的价格,最后相加并输出. #include<algorithm> #include<iostream> #include<cstring> #include<cstdio&g…
都是神题,我一题都不会,全程听学长题解打代码,我代码巨丑就不贴了 题解见巨神博客 假装自己没有做过这套…
来自FallDream的博客,未经允许,请勿转载,谢谢, 第一次在cf上打acm...和同校大佬组队打 总共15题,比较鬼畜,最后勉强过了10题. AB一样的题目,不同数据范围,一起讲吧 你有一个背包,最多装k本书,你在第i天需要拥有一本编号ai的书,但是你可以去商店购买并加入背包. 问你至少要买多少本书?n,k<=400000 显然可以贪心,留下下一次需要的时间最早的书就行了. #include<iostream> #include<cstdio> #include<…
传送门:Problem D https://www.cnblogs.com/violet-acmer/p/9677435.html 题意: 研究人员需要使用某种细菌进行实验,给定一个序列代表接下来每个小时所用的细菌数目,已知初始时细菌的数目为 1 ,其数目每小时会翻倍增长,并且等到第一个小时以后开始实验,问最后残余的细菌数目. 题解: 因为细菌的数目可能会呈指数级上升,所以首先要想到大数. 然后用 java 模拟一下即可,最后别忘了 mod 1e9+7 . AC代码: import java.i…
趁着上课无聊,来补一补-- A. Numbers Joke 直接oeis就好了:http://oeis.org/search?q=numbers+joke&language=english&go=Search #include<bits/stdc++.h> using namespace std; long long p[]={ 4, 22, 27, 58, 85, 94, 121, 166, 202, 265, 274, 319, 346, 355, 378, 382, 39…
H. Split Game time limit per test 1.0 s memory limit per test 256 MB input standard input output standard output For a long time, rich clientele of Binary Casino has been requesting a new way to gamble their money. To fulfill their wishes, the direct…
任意门:http://codeforces.com/gym/101954/problem/E E. Locker Room time limit per test 2.0 s memory limit per test 256 MB input standard input output standard output There are several strange rooms in Binary Casino and one of them is a locker room. You ha…
第一次打ACM赛制的团队赛,感觉还行: 好吧主要是切水题: 开场先挑着做五道EASY,他们分给我D题,woc什么玩意,还泊松分布,我连题都读不懂好吗! 果断弃掉了,换了M和J,然后切掉了,看N题: loser大佬切了A,G: 然后翔哥在攻H题: N题好像是费用流,(看了一会才发现的我果断被同在机房打比赛的别的队的大佬D了233) 然后写出了之后,那个大佬说费用流T了,交都没交就弃掉了: (事后才知道大概是图建的不好) loser大佬B题写的差不多了,交上去WA... 翔哥在攻H题: 我开始看K题…
G. Fake News (easy) time limit per test 1 second memory limit per test 256 megabytes input standard input output standard output As it's the first of April, Heidi is suspecting that the news she reads today are fake, and she does not want to look sil…
Description Heidi's friend Jenny is asking Heidi to deliver an important letter to one of their common friends. Since Jenny is Irish, Heidi thinks that this might be a prank. More precisely, she suspects that the message she is asked to deliver state…
Description The marmots have prepared a very easy problem for this year's HC2 – this one. It involves numbers n, k and a sequence of n positive integersa1, a2, ..., an. They also came up with a beautiful and riveting story for the problem statement.…
Description Your search for Heidi is over – you finally found her at a library, dressed up as a human. In fact, she has spent so much time there that she now runs the place! Her job is to buy books and keep them at the library so that people can borr…
Description You are developing a new feature for the website which sells airline tickets: being able to sort tickets by price! You have already extracted the tickets' prices, so there's just the last step to be done... You are given an array of integ…
Description Input The input consists of four lines, each line containing a single digit 0 or 1. Output Output a single digit, 0 or 1. Example input 0110 output 0 一个数字电路,不过或门和异或门是反的,所以..注意下 #include<bits/stdc++.h> using namespace std; #define ll long…
Description Input The only line of the input contains a string of digits. The length of the string is between 1 and 10, inclusive. Output Output "Yes" or "No". Examples input 373 output Yes input 121 output No input 436 output Yes看是不是回…