Croc Champ 2013 - Round 2 C. Cube Problem】的更多相关文章

问满足a^3 + b^3 + c^3 + n = (a+b+c)^3 的 (a,b,c)的个数 可化简为 n = 3*(a + b) (a + c) (b + c) 于是 n / 3 = (a + b)(a + c) (b + c) 令x = a + b,y = a + c,z = b + c,s = n / 3 s = xyz 并且令x <= y <= z,于是我们解s = xyz这个方程,可以枚举x,y得到z. 得到(x,y,z)后便可以得到a,b,c但可能有不符合条件的三元组,化简系数矩…
E. Copying Data time limit per test 2 seconds memory limit per test 256 megabytes input standard input output standard output We often have to copy large volumes of information. Such operation can take up many computer resources. Therefore, in this p…
题目链接: http://codeforces.com/problemset/problem/292/E E. Copying Data time limit per test2 secondsmemory limit per test256 megabytes 问题描述 We often have to copy large volumes of information. Such operation can take up many computer resources. Therefore…
292D - Connected Components D. Connected Components time limit per test 2 seconds memory limit per test 256 megabytes input standard input output standard output We already know of the large corporation where Polycarpus works as a system administrato…
Cube Problem Time Limit:2000MS Memory Limit:262144KB 64bit IO Format:%I64d & %I64u Submit   Status   Practice CodeForces 299E Description Yaroslav, Andrey and Roman love playing cubes. Sometimes they get together and play cubes for hours and hours! T…
地址:http://codeforces.com/contest/807/problem/D 题目: D. Dynamic Problem Scoring time limit per test 2 seconds memory limit per test 256 megabytes input standard input output standard output Vasya and Petya take part in a Codeforces round. The round las…
C. Commentator problem 题目连接: http://www.codeforces.com/contest/2/problem/C Description The Olympic Games in Bercouver are in full swing now. Here everyone has their own objectives: sportsmen compete for medals, and sport commentators compete for more…
& -- 位运算之一,有0则0 原题链接 Problem - 1514B - Codeforces 题目 Example input 2 2 2 100000 20 output 4 226732710 题意 t个测试样例,在每个样例中 数组有n个数,数字范围[ 0, 2k - 1] 使得数组每个数&后,结果=0,并且这n个数的和要尽量大 输出有多少个这样的数组 解析 数组每个数&后,结果=0  -->每一位至少一个0 数要尽量大  -->只要这一位可以 != 0, 就…
A - Noldbach problem 题面链接 http://codeforces.com/contest/17/problem/A 题面 Nick is interested in prime numbers. Once he read about Goldbach problem. It states that every even integer greater than 2 can be expressed as the sum of two primes. That got Nic…
C. Binary Table 题目连接: http://codeforces.com/problemset/problem/662/C Description You are given a table consisting of n rows and m columns. Each cell of the table contains either 0 or 1. In one move, you are allowed to pick any row or any column and i…
题目链接: http://www.codeforces.com/contest/655/problem/D 题意: 题目是要求前k个场次就能确定唯一的拓扑序,求满足条件的最小k. 题解: 二分k的取值,做拓扑排序的时候只要每次只有一个元素没有前驱就可以唯一了. #include<iostream> #include<cstring> #include<cstdio> #include<vector> #include<queue> #includ…
A. DZY Loves Hash time limit per test 1 second memory limit per test 256 megabytes input standard input output standard output DZY has a hash table with p buckets, numbered from 0 to p - 1. He wants to insert n numbers, in the order they are given, i…
有为杯  Problem I DAG  有向无环图 A direct acylic graph(DAG),is a directed graph with no directed cycles . That is ,it is formed by a collection of  vertion  of  vertices  and  directed  edges ,  each     edge connecting   one vertex to another,such that the…
http://codeforces.com/contest/426/problem/B 对称标题的意思大概是.应当指出的,当线数为奇数时,答案是线路本身的数 #include<iostream> #include<cstdio> #include<cstring> #include<algorithm> #define maxn 1005 using namespace std; char a[maxn][maxn]; int ans; void solve…
题目链接:http://codeforces.com/contest/655/problem/D 大意是给若干对偏序,问最少需要前多少对关系,可以确定所有的大小关系. 解法是二分答案,利用拓扑排序看是否所有关系被唯一确定.即任意一次只能有1个元素入度为0入队. #include <iostream> #include <vector> #include <algorithm> #include <string> #include <string.h&g…
Adieu l'ami. Koyomi is helping Oshino, an acquaintance of his, to take care of an open space around the abandoned Eikou Cram School building, Oshino's makeshift residence. The space is represented by a rectangular grid of n × m cells, arranged into n…
— This is not playing but duty as allies of justice, Nii-chan! — Not allies but justice itself, Onii-chan! With hands joined, go everywhere at a speed faster than our thoughts! This time, the Fire Sisters — Karen and Tsukihi — is heading for somewher…
Even if the world is full of counterfeits, I still regard it as wonderful. Pile up herbs and incense, and arise again from the flames and ashes of its predecessor — as is known to many, the phoenix does it like this. The phoenix has a rather long lif…
Rock... Paper! After Karen have found the deterministic winning (losing?) strategy for rock-paper-scissors, her brother, Koyomi, comes up with a new game as a substitute. The game works as follows. A positive integer n is decided first. Both Koyomi a…
Palindromic characteristics of string s with length |s| is a sequence of |s| integers, where k-th number is the total number of non-empty substrings of s which are k-palindromes. A string is 1-palindrome if and only if it reads the same backward as f…
The Cartesian coordinate system is set in the sky. There you can see n stars, the i-th has coordinates (xi, yi), a maximum brightness c, equal for all stars, and an initial brightness si (0 ≤ si ≤ c). Over time the stars twinkle. At moment 0 the i-th…
Some natural number was written on the board. Its sum of digits was not less than k. But you were distracted a bit, and someone changed this number to n, replacing some digits with others. It's known that the length of the number didn't change. You h…
Two boys decided to compete in text typing on the site "Key races". During the competition, they have to type a text consisting of s characters. The first participant types one character in v1 milliseconds and has ping t1 milliseconds. The secon…
Misha and Grisha are funny boys, so they like to use new underground. The underground has n stations connected with n - 1 routes so that each route connects two stations, and it is possible to reach every station from any other. The boys decided to h…
n people are standing on a coordinate axis in points with positive integer coordinates strictly less than 106. For each person we know in which direction (left or right) he is facing, and his maximum speed. You can put a bomb in some point with non-n…
It's hard times now. Today Petya needs to score 100 points on Informatics exam. The tasks seem easy to Petya, but he thinks he lacks time to finish them all, so he asks you to help with one.. There is a glob pattern in the statements (a string consis…
It's one more school day now. Sasha doesn't like classes and is always bored at them. So, each day he invents some game and plays in it alone or with friends. Today he invented one simple game to play with Lena, with whom he shares a desk. The rules…
E. Intellectual Inquiry 题目连接: http://www.codeforces.com/contest/655/problem/E Description After getting kicked out of her reporting job for not knowing the alphabet, Bessie has decided to attend school at the Fillet and Eggs Eater Academy. She has be…
D. Robot Rapping Results Report 题目连接: http://www.codeforces.com/contest/655/problem/D Description While Farmer John rebuilds his farm in an unfamiliar portion of Bovinia, Bessie is out trying some alternative jobs. In her new gig as a reporter, Bessi…
C. Enduring Exodus 题目连接: http://www.codeforces.com/contest/655/problem/C Description In an attempt to escape the Mischievous Mess Makers' antics, Farmer John has abandoned his farm and is traveling to the other side of Bovinia. During the journey, he…