数学
文章平均质量分 78
Liao_Jingyi
这个作者很懒,什么都没留下…
展开
-
URAL 1876 Centipede's Morning
Description A centipede has 40 left feet and 40 right feet. It keeps a left slippers and b right slippers under its bed. Every morning the centipede puts on the slippers. It pokes its first left原创 2014-07-20 17:29:23 · 818 阅读 · 0 评论 -
cdoj 1017 王之困惑
众所周知,绩点王(以下简称王)是集训队中的学神,因为他的绩点总是满的。 一天晚上,王做了一个奇奇怪怪的梦。在这个奇奇怪怪的梦里,绩点是以一串01串表示的。而王则拥有两种神奇的魔法可以改变自己的绩点。 魔法1:使用此魔法时,王可以去掉当前绩点的最左边的第一个数。 魔法2:使用此魔法时,王可以在当前绩点的最右边增加一个数x。其中,若当前绩点的01串中,1的个数为奇数,那么x=1;若1的个数为偶数原创 2014-12-06 20:20:32 · 736 阅读 · 0 评论 -
cdoj 1017 The King and King boss
王和王老板总是在向大家传授什么是美。今天,王老板要为趣味赛出题,他想出了一个很美的问题:“给你一个包含n个元素的整数集合a1⋯an,问你是否可以找到它的一个子集,使得这个子集的和可以被n整除” 听到了这个问题后,王暗想“这是个非常简单的问题,我可以设计一个动态规划算法在线性时间复杂度内轻松解决”,但他口头上依然称赞这是个非常好的问题。当然,王不打算亲自解决(这题太水啦!),他用不容拒绝的口吻命令原创 2014-12-06 18:31:16 · 565 阅读 · 0 评论 -
uva 11401 Triangle Counting
Problem G Triangle Counting Input: Standard Input Output: Standard Output You are given n rods of length 1, 2…, n. You have to pick any 3 of them & build a triangle. How many distinct tria原创 2014-12-09 00:21:46 · 354 阅读 · 0 评论 -
uva11806 Cheerleaders
Inmost professional sporting events, cheerleaders play a major role inentertaining the spectators. Their roles are substantial during breaks andprior to start of play. The world cup soccer is no excep原创 2014-12-11 15:47:24 · 490 阅读 · 0 评论 -
CF 282B Modular Equations
B. Modular Equations time limit per test 1 second memory limit per test 256 megabytes input standard input output standard output Last week, Hamed learned about a new type of equa原创 2015-01-15 19:40:35 · 439 阅读 · 0 评论 -
CF 2014 ACM-ICPC Vietnam National Second Round C. ATM withdrawal
C. ATM withdrawal time limit per test 2 seconds memory limit per test 256 megabytes input standard input output standard output Vinh works for an ATM machine manufacturing company原创 2015-03-15 20:53:07 · 839 阅读 · 0 评论 -
CF 2014 ACM-ICPC Vietnam National Second Round D. Treasure Box
D. Treasure Box time limit per test 2 seconds memory limit per test 256 megabytes input standard input output standard output Your team was exploring an ancient city. Suddenly you原创 2015-03-15 20:09:07 · 665 阅读 · 0 评论 -
POJ 1723 SOLDIERS
POJ - 1723 SOLDIERS Time Limit:1000MS Memory Limit:10000KB 64bit IO Format:%I64d & %I64u SubmitStatus Description N soldiers of the land Gridland are randomly scat原创 2015-03-29 16:28:57 · 531 阅读 · 0 评论 -
CF 526C Om Nom and Candies
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原创 2015-04-06 01:54:25 · 1145 阅读 · 0 评论 -
UVA 11538 Chess Queen
问题描述 解析 1.两个皇后在一列的情况m*n*(m-1) 2.两个皇后在一行的情况m*n*(n-1) 3.两个皇后在斜线上 假设m>n 对角线上的长度是L,那么L一定是这样的数列1,2...n-1,n...n,n-1...2,1(n有m-n+1) 每条斜线上的情况是L*(L-1)种 #include #include using namespace std; ty原创 2014-12-06 16:43:00 · 312 阅读 · 0 评论 -
HDU 4165 Pills
Pills Time Limit:1000MS Memory Limit:32768KB 64bit IO Format:%I64d & %I64u SubmitStatus Description Aunt Lizzie takes half a pill of a certain medicine every day. S原创 2015-01-27 21:20:54 · 477 阅读 · 0 评论 -
UVAlive 5971 Permutation Counting
Problem J Permutation Counting Input: Standard Input Output: Standard Output Dexter considers a permutation of first N natural numbers good if it doesn't have x原创 2014-07-23 09:44:12 · 740 阅读 · 0 评论 -
LA 6657 GCD XOR
//发现了规律 //对于满足条件gcd(a,b)=a^b的数对a,b(a>b) 有gcd(a,b)=a^b=a-b; //于是我假设 只要满足a^b=a-b就一定有gcd(a,b)=a^b //但是写成如下代码,会超时 //for(int i=1;i<maxn;i++) // for(int j=i+1;j<=maxn;j++) // if(i^j=j-i) f[j]++; //因为i,j之间原创 2014-08-19 18:32:13 · 427 阅读 · 0 评论 -
CF 460B Little Dima and Equation
Little Dima misbehaved during a math lesson a lot and the nasty teacher Mr. Pickles gave him the following problem as a punishment. Find all integer solutions x (0 x 9) of the equation: x = b·s(原创 2014-08-21 02:39:11 · 545 阅读 · 0 评论 -
TC SRM 632-500 Potential Geometric Sequence
Problem Statement We have a sequence of N positive integers: a[0] through a[N-1].You do not know these integers.All you know is the number of trailing zeros in their binary representations.You are原创 2014-09-06 21:05:46 · 669 阅读 · 0 评论 -
CF 273B Random Teams
n participants of the competition were split into m teams in some manner so that each team has at least one participant. After the competition each pair of participants from the same team became frie原创 2014-10-23 00:12:16 · 518 阅读 · 0 评论 -
CF 66D Petya and His Friends
I - Petya and His Friends Time Limit:2000MS Memory Limit:262144KB 64bit IO Format:%I64d & %I64u SubmitStatusPracticeCodeForces 66D Description Little Petya has a birthday soon. Due t原创 2014-10-06 15:46:26 · 514 阅读 · 0 评论 -
CF 2014 Nordic Collegiate Programming Contest E Opening Ceremony
NCPC 2014 Problem E Opening Ceremony Problem ID: ceremony From Wikipedia under Creative Commons licence, by G Laird For the grand opening of the algorithmic games in NlogNsglow, a ro原创 2014-10-25 19:07:16 · 912 阅读 · 0 评论 -
CF 271D Flowers
D. Flowers time limit per test 1.5 seconds memory limit per test 256 megabytes input standard input output standard output We saw the little game Marmot made for Mole's lunch. Now原创 2014-10-07 11:32:23 · 408 阅读 · 0 评论 -
ZOJ 3798 Abs Problem
A - Abs Problem Time Limit:2000MS Memory Limit:65536KB 64bit IO Format:%lld & %llu SubmitStatus Description Alice and Bob is playing a game, and this time the game is all about the a原创 2014-10-12 15:32:40 · 342 阅读 · 0 评论 -
CF 276 Div2 C Bits
C. Bits time limit per test 1 second memory limit per test 256 megabytes input standard input output standard output Let's denote as the number of bits set ('1' bits) in the bina原创 2014-11-06 17:06:03 · 420 阅读 · 0 评论