B. Bear and Strings time limit per test 1 second memory limit per test 256 megabytes input standard input output standard output The bear has a string s = s1s2... s|s| (record |s|
老规矩,抄一波QSC,自己的写在后面 E. Bear and Forgotten Tree 2 题目连接: http://www.codeforces.com/contest/653/problem/E Description A tree is a connected undirected graph consisting of n vertices and n - 1 edges.
题目链接:Codeforces 385C Bear and Prime Numbers 题目大意:给出一个长度为n的序列,然后有m次询问,每次询问给出a, b,然后计算[a,b]中所有素数的F(x)之和,F(x)为计算序列中有几个数为x的倍数。 解题思路:数论题,因为内存空间限制为512M,所以可以开的下10^7的数组,然后用筛选法求素数的同时计算个数。 #includ
题目链接:Codeforces 385E Bear in the Field 题目大意:有一片n*n的草莓地,每个位置的初始草莓量为横坐标和纵坐标的和,然后每过一秒增长一个草莓。然后给出熊的初始位置(sx,sy),以及移动的速度(dx,dy),每一秒发生的事:(1)速度增加k(k为该位置的草莓数);(2)熊的位置发生移动;(3)每个位置上草莓数+1 解题思路:矩阵快速幂,根据题目给
This is an interactive problem. In the output section below you will see the information about flushing the output. Bear Limak thinks of some hidden number — an integer from interval [2, 100]. Your t
题目链接:http://codeforces.com/problemset/problem/657/A Bear and Forgotten Tree 3 time limit per test: 2 seconds memory limit per test: 256 megabytes input: standard input output: sta
Bear and Up-Down time limit per test 2 seconds memory limit per test 256 megabytes input standard input output standard output The life goes up and down, just like nice sequences. S
Bear and Forgotten Tree 3 time limit per test 2 seconds memory limit per test 256 megabytes input standard input output standard output A tree is a connected undirected graph cons