04 2017 档案
摘要:Channel Allocation Time Limit: 1000MS Memory Limit: 10000K Total Submissions: 15546 Accepted: 7871 Description When a radio station is broadcasting ov
阅读全文
摘要:Time Limit: 2000MS Memory Limit: 65536K Total Submissions: 20113 Accepted: 9628 Special Judge Description Sudoku is a very simple task. A square table
阅读全文
摘要:Shredding Company Time Limit: 1000MS Memory Limit: 10000K Total Submissions: 6173 Accepted: 3361 Description You have just been put in charge of devel
阅读全文
摘要:Time Limit: 2000MS Memory Limit: 65536K Total Submissions: 12886 Accepted: 6187 Description A university network is composed of N computers. System ad
阅读全文
摘要:动态内存:之前的程序使用对象有着严格定义的生存期,会自动销毁。C++支持动态分配对象,动态分配对象的生存期和他们在哪里创建是无关的,只有当显式的被释放,这些对象才会销毁。标准库定义了智能指针对象可以自动释放内存。new在动态内存中分配空间并且返回一个指向该对象的指针,delete接受一个动态对象的指
阅读全文
摘要:拷贝 赋值 销毁 拷贝构造函数 如果一个构造函数第一个参数是自身的引用,而且任何额外参数都有默认值,则此构造函数是拷贝构造函数拷贝构造函数的第一个类型必须是引用:如果参数不是引用类型,那么调用不会成功——为了调用拷贝构造函数我们必须拷贝他的实参,而拷贝实参又要调用拷贝构造函数 如果没有类定义拷贝构造
阅读全文
摘要:#include<stdio.h>#define M 1000000007int fp(int a,int b){ long long ret=1,pow=a;//ret:返回值;pow:基底 while(b!=0){ if(b&1) ret=(ret*pow)%M; pow=(pow*pow)%M
阅读全文
摘要:// // Name : POJ.cpp// Author : // Version :// Copyright : Your copyright notice// Description : Hello World in C++, Ansi-style// #include <iostream>#
阅读全文
摘要:After having drifted about in a small boat for a couple of days, Akira Crusoe Maeda was finally cast ashore on a foggy island. Though he was exhausted
阅读全文
摘要:递归求解, You are to determine the value of the leaf node in a given binary tree that is the terminal node of a path of least value from the root of the b
阅读全文
摘要:#include #include #include #include #include #include #include #include #include #include #include #include #include #include using namespace std; typedef long long LL; typedef unsigned long long ULL...
阅读全文
摘要:Problem Description As we all know the Train Problem I, the boss of the Ignatius Train Station want to know if all the trains come in strict-increasin
阅读全文
摘要:Problem Description As the new term comes, the Ignatius Train Station is very busy nowadays. A lot of student want to get back to school by train(beca
阅读全文
摘要:The famous ACM (Advanced Computer Maker) Company has rented a floor of a building whose shape is in the following figure. The floor has 200 rooms each
阅读全文
摘要:Have you ever heard the story of Blue.Mary, the great civil engineer? Unlike Mr. Wolowitz, Dr. Blue.Mary has accomplished many great projects, one of
阅读全文
摘要:Once upon a time, in the Kingdom of Loowater, a minor nuisance turned into a major problem. The shores of Rellau Creek in central Loowater had always
阅读全文
摘要:FatMouse prepared M pounds of cat food, ready to trade with the cats guarding the warehouse containing his favorite food, JavaBean. The warehouse has
阅读全文
摘要:Description Farmer John is an astounding accounting wizard and has realized he might run out of money to run the farm. He has already calculated and r
阅读全文
摘要:Every year the cows hold an event featuring a peculiar version of hopscotch that involves carefully jumping from rock to rock in a river. The exciteme
阅读全文
摘要:Farmer John has built a new long barn, with N (2 <= N <= 100,000) stalls. The stalls are located along a straight line at positions x1,...,xN (0 <= xi
阅读全文
摘要:The SUM problem can be formulated as follows: given four lists A, B, C, D of integer values, compute how many quadruplet (a, b, c, d ) ∈ A x B x C x D
阅读全文
摘要:Andy the smart computer science student was attending an algorithms class when the professor asked the students a simple question, "Can you propose an
阅读全文
摘要:吉哥又想出了一个新的完美队形游戏! 假设有n个人按顺序站在他的面前,他们的身高分别是h[1], h[2] ... h[n],吉哥希望从中挑出一些人,让这些人形成一个新的队形,新的队形若满足以下三点要求,则就是新的完美队形: 1、挑出的人保持原队形的相对顺序不变,且必须都是在原队形中连续的; 2、左右
阅读全文
摘要:After an uphill battle, General Li won a great victory. Now the head of state decide to reward him with honor and treasures for his great exploit. One
阅读全文
摘要:For each prefix with length P of a given string S,if S[i]=S[i+P] for i in [0..SIZE(S)-p-1], then the prefix is a “period” of S. We want to all the per
阅读全文
摘要:Give you n ( n < 10000) necklaces ,the length of necklace will not large than 100,tell me How many kinds of necklaces total have.(if two necklaces can
阅读全文
摘要:Give you a string with length N, you can generate N strings by left shifts. For example let consider the string “SKYLONG”, we can generate seven strin
阅读全文
摘要:Beside other services, ACM helps companies to clearly state their “corporate identity”, which includes company logo but also other signs, like tradema
阅读全文
摘要:You are given a number of case-sensitive strings of alphabetic characters, find the largest string X, such that either X, or its inverse can be found
阅读全文
摘要:It is well known that AekdyCoin is good at string problems as well as number theory problems. When given a string s, we can write down all the non-emp
阅读全文
摘要:Homer: Marge, I just figured out a way to discover some of the talents we weren’t aware we had. Marge: Yeah, what is it? Homer: Take me for example. I
阅读全文
摘要:The little cat is so famous, that many couples tramp over hill and dale to Byteland, and asked the little cat to give names to their newly-born babies
阅读全文
摘要:Given two strings a and b we define a*b to be their concatenation. For example, if a = "abc" and b = "def" then a*b = "abcdef". If we think of concate
阅读全文
摘要:There is a string A. The length of A is less than 1,000,000. I rewrite it again and again. Then I got a new string: AAAAAA...... Now I cut it from two
阅读全文
摘要:For each prefix of a given string S with N characters (each character has an ASCII code between 97 and 126, inclusive), we want to know whether the pr
阅读全文
摘要:CC always becomes very depressed at the end of this month, he has checked his credit card yesterday, without any surprise, there are only 99.9 yuan le
阅读全文
摘要:一块花布条,里面有些图案,另有一块直接可用的小饰条,里面也有一些图案。对于给定的花布条和小饰条,计算一下能从花布条中尽可能剪出几块小饰条来呢? Input输入中含有一些数据,分别是成对出现的花布条和小饰条,其布条都是用可见ASCII字符表示的,可见的ASCII字符有多少个,布条的花纹也有多少种花样。
阅读全文
摘要:The French author Georges Perec (1936�C1982) once wrote a book, La disparition, without the letter 'e'. He was a member of the Oulipo group. A quote f
阅读全文
摘要:Given two sequences of numbers : a11, a22, ...... , aNN, and b11, b22, ...... , bMM(1 <= M <= 10000, 1 <= N <= 1000000). Your task is to find a number
阅读全文
摘要:Language: Default All in All Time Limit: 1000MS Memory Limit: 30000K Total Submissions: 32980 Accepted: 13750 Description You have devised a new encry
阅读全文
摘要:Description The Genographic Project is a research partnership between IBM and The National Geographic Society that is analyzing DNA from hundreds of t
阅读全文
摘要:Spell checker Time Limit: 2000MS Memory Limit: 65536K Total Submissions: 25426 Accepted: 9300 Description You, as a member of a development team for a
阅读全文
摘要:Happy 2006 Time Limit: 3000MS Memory Limit: 65536K Total Submissions: 11956 Accepted: 4224 Description Two positive integers are said to be relatively
阅读全文
摘要:Description Ms. Iyo Kiffa-Australis has a balance and only two kinds of weights to measure a dose of medicine. For example, to measure 200mg of aspiri
阅读全文
摘要:拓展欧几里得定理主要用来求解同余线性方程,求逆元等,遇到题目给出形如ax+by==c,要求一组满足要求的x和y时,可以联系扩展欧几里得求解 拓展欧几里得由 gcd(a,b) = gcd(b,a%b) 推出 由于 a*x + b*y == gcd(a,b) 必定有解 所以 b*x + (a%b)*y
阅读全文
摘要:Description In a modernized warehouse, robots are used to fetch the goods. Careful planning is needed to ensure that the robots reach their destinatio
阅读全文
摘要:Description Assume the coasting is an infinite straight line. Land is in one side of coasting, sea in the other. Each small island is a point locating
阅读全文
摘要:Description The game “The Pilots Brothers: following the stripy elephant” has a quest where a player needs to open a refrigerator. There are 16 handle
阅读全文
摘要:Problem Description RSA is one of the most powerful methods to encrypt data. The RSA algorithm is described as follow:> choose two large prime integer
阅读全文
摘要:Problem Description 要求(A/B)%9973,但由于A很大,我们只给出n(n=A%9973)(我们给定的A必能被B整除,且gcd(B,9973) = 1)。 Input 数据的第一行是一个T,表示有T组数据。每组数据有两个数n(0 <= n < 9973)和B(1 <= B <=
阅读全文
摘要:欧几里得辗转相除法求最大公约数 int gcd(int a,int b) { if(b==0) return a; else return gcd(b,a%b); } 求组合数 int C(int n ,int m) { int i,a,fz=1,fm=1; for( i = 1; i #define M 1000000007 int fp(int a,int b,int c)...
阅读全文
摘要:国庆期间,省城HZ刚刚举行了一场盛大的集体婚礼,为了使婚礼进行的丰富一些,司仪临时想出了有一个有意思的节目,叫做"考新郎",具体的操作是这样的: 首先,给每位新娘打扮得几乎一模一样,并盖上大大的红盖头随机坐成一排; 然后,让各位新郎寻找自己的新娘.每人只准找一个,并且不允许多人找一个. 最后,揭开盖
阅读全文
摘要:人称“AC女之杀手”的超级偶像LELE最近忽然玩起了深沉,这可急坏了众多“Cole”(LELE的粉丝,即"可乐"),经过多方打探,某资深Cole终于知道了原因,原来,LELE最近研究起了著名的RPG难题: 有排成一行的n个方格,用红(Red)、粉(Pink)、绿(Green)三色涂每个格子,每格涂一
阅读全文