CodeForces ZeptoLab Code Rush 2015】的更多相关文章

拖了好久的题解,想想还是补一下吧. A. King of Thieves 直接枚举起点和5个点之间的间距,进行判断即可. #include <bits/stdc++.h> using namespace std; ]; int main() { //freopen("in.txt", "r", stdin); int n; bool ans = false; scanf("%d%s", &n, s); ; q < n &…
D. Om Nom and Necklace time limit per test 1 second memory limit per test 256 megabytes input standard input output standard output One day Om Nom found a thread with n beads of different colors. He decided to cut the first several beads from this th…
题目描述: 有一天,欧姆诺姆发现了一串长度为n的宝石串,上面有五颜六色的宝石.他决定摘取前面若干个宝石来做成一个漂亮的项链. 他对漂亮的项链是这样定义的,现在有一条项链S,当S=A+B+A+B+A+...+A+B+A的时候是漂亮的,这儿A,B是一些宝石串,“+”表示连接操作.S中有k+1个A和k个B组成.A和B可能是空串. 现在给出宝石串,问怎么切前几个才能得到一个漂亮的宝石项链.他切下来之后不会改变宝石的顺序. 样例解释: 在这个样例中前6个可以组成漂亮的串( A="", B=&qu…
A. King of Thieves Time Limit: 1 Sec  Memory Limit: 256 MB 题目连接 http://codeforces.com/contest/526/problem/A Description In this problem you will meet the simplified model of game King of Thieves. In a new ZeptoLab game called "King of Thieves" y…
C. Om Nom and Candies Time Limit: 1 Sec  Memory Limit: 256 MB 题目连接 http://codeforces.com/contest/526/problem/C Description A sweet little monster Om Nom loves candies very much. One day he found himself in a rather tricky situation that required him…
B. Om Nom and Dark Park Time Limit: 1 Sec  Memory Limit: 256 MB 题目连接 http://codeforces.com/contest/526/problem/B Description Om Nom is the main character of a game "Cut the Rope". He is a bright little monster who likes visiting friends living a…
A 题意:给出一串由.*组成的字符串,如果有等间距的五个及五个以上的*存在,则输出yes 直接枚举就可以了 看题一定要仔细啊,做的时候看成必须有五个等间距的".*"才可以跳跃= = 然后就这样写居然过了预测= =后来果然被hack了 #include<iostream> #include<cstdio> #include<cstring> #include <cmath> #include<stack> #include<…
传送门 C. Om Nom and Candies time limit per test 1 second memory limit per test 256 megabytes input standard input output standard output A sweet little monster Om Nom loves candies very much. One day he found himself in a rather tricky situation that r…
Om Nom is the main character of a game "Cut the Rope". He is a bright little monster who likes visiting friends living at the other side of the park. However the dark old parks can scare even somebody as fearless as Om Nom, so he asks you to hel…
这题给的一个教训:Codeforces没有超时这个概念.本来以为1000*(1000+1)/2*10*10要超时的.结果我想多了. 这题由于k层都可能有关系,所以建一个图,每两个点之间连边,边权为n*m和他们之间的差值*w的最小值,然后求一个最小生成树就可以得出结果.且可以证明不会存在环.由于边比较稠密,用Prim算法求最小生成树. 代码: #include <iostream> #include <cstdio> #include <cstring> #include…