题意简述 给定一个由A C G T四个字母组成的密码锁(每拨动一次 A变C C变G G变T T变A) 密码锁有n位 规定每次操作可以选取连续的一段拨动1~3次 问最少几次操作可以将初始状态变到末状态 并且把每次操作输出 (此题有spj) --------------------------------------------------------------------------------------------------------- 为了方便叙述 所有没有明确说明的位置均是在$mod…
原题链接:http://codeforces.com/gym/100431/attachments/download/2421/20092010-winter-petrozavodsk-camp-andrew-stankevich-contest-37-asc-37-en.pdf 题意 神奇的电路可以通过比较器来实现冒泡. 题解 倒着往回考虑,搞搞就好. 代码 #include<iostream> #include<cstdio> #include<cstring> #…
Space Golf 题目连接: http://codeforces.com/gym/100803/attachments Description You surely have never heard of this new planet surface exploration scheme, as it is being carried out in a project with utmost secrecy. The scheme is expected to cut costs of c…
C. CinderellaTime Limit: 20 Sec Memory Limit: 256 MB 题目连接 http://codeforces.com/gym/100685/problem/C Description Cinderella is given a task by her Stepmother before she is allowed to go to the Ball. There are N (1 ≤ N ≤ 1000) bottles with water in th…
B. Island Time Limit: 1 Sec Memory Limit: 256 MB 题目连接 http://codeforces.com/gym/100114 Description On February 30th this year astronauts from the International Space Station flew over the Pacific Ocean and took a picture, on which was discovered a pr…
题目链接: http://codeforces.com/problemset/problem/657/C -------------------------------------------------------------------------------------------------------- 题目的特别之处在于只有 $+1$ $+5$ 这两种操作 我们要考虑如何利用这个条件 多想一下后可以发现 如果最优解的目标值为$x($将至少$k$个人的值增加到$x)$ 那么一定存在一个…
Problem G.Giant ScreenTime Limit: 20 Sec Memory Limit: 256 MB 题目连接 http://acm.hust.edu.cn/vjudge/contest/view.action?cid=86821#problem/G Description You are working in Advanced Computer Monitors (ACM), Inc. The company is building and selling giant c…
题意:有1~N,n(1e5)个嫌疑人,有m个人说真话,每个人的陈述都形如X是凶手,或X不是凶手.现在给出n,m及n个陈述(以+x/-X表示)要求输出每个人说的话是true ,false or notdefine. 题解:模拟,依次假设每个人是犯人,统计说真话的有几个,如果 ==m 就符合. 现在考虑notdefine:当符合的情况数大于1时,就说明有notdefine. 因为枚举时,某一对-y-x,x是凶手时,-x是假话-y是真话,y是凶手时,-x真话-y假话.而其他人的陈述都与xy无关 所以模…
题意:给你两个数列a,b,你要输出k个下标,使得这些下标对应的a的和大于整个a数列的和的1/2.同时这些下标对应的b //题解:首先将条件换一种说法,就是要取floor(n/2)+1个数使得这些数大于剩下的数.然后想到两种取法,一种是排好序选前半段.令一种取法是两个两个分组,每组取大的那个.//然后就可以(很困难地)想到一种巧妙的取法,先用一个结构体保存a,b,idx,按照a从大到小排序,先取第一个,再对剩下的每两个一组取其中b更大的.这样保证了被选出//的b一定大于剩下的b,也就满足了条件.然…
http://codeforces.com/problemset/problem/55/C 题意:一个博弈. 题解:瞎猜,目前不清楚原理 #include<iostream> #include<stdio.h> #include<algorithm> using namespace std; typedef long long ll; int main(){ int n,m,k; cin>>n>>m>>k; ; ;i<=k;i+…