100.A+B time limit per test: 0.25 sec. memory limit per test: 65536 KB 题解:上手题,不解释. 直接上代码: #include <iostream> using namespace std; int main(){ int a, b; cin >> a >> b; cout << a + b << endl; return 0; }…
104. Little shop of flowers time limit per test: 0.25 sec. memory limit per test: 4096 KB 问题: 你想要将你的花窗安排得最具美感.有F束花,每一束花都不一样,至少有F个按顺序排成一行的花瓶.花瓶从左到右,依次编号1-V.而花放置的位置是可以改变的,花依次编号1到F.花的序号有一个特征,即是序号决定了花束出现在花瓶里的顺序.例如,有两束花编号i和j,满足i<j,那么i所在的花瓶一定要在j所在花瓶的左边,即是i…
102. Coprimes time limit per test: 0.25 sec. memory limit per test: 4096 KB 题解: 求一个1-10000之间的数 N 的互质数个数.题目很简单,有两种方法: 1.复杂度是O(n^2),依次判断从1到N-1的数是否与N互质. 2.复杂度是O(n),换一种想法,先求与N不互质的数的个数,然后用N减去即可.例如9,从2开始循环,3与9不互质,那么3的倍数也与9不互质,所以6也与9不互质.因为N很小,所以可以开一个数组a[10…
Array Diversity Time Limit:404MS Memory Limit:0KB 64bit IO Format:%lld & %llu Description Here we go! Let's define the diversity of a list of numbers to be the difference between the largest and smallest number in the list. For example, the…
Time Limit:2000MS Memory Limit:65536KB Description Given a string consisting of brackets of two types find its longest substring that is a regular brackets sequence. Input There are mutiple cases in the input file. Each case contains a string con…
Save the Students Time Limit:134MS Memory Limit:0KB 64bit IO Format:%lld & %llu Description Hogwarts is under attack by the Dark Lord, He-Who-Must-Not-Be-Named. To protect the students, Harry Potter must cast protective spells so that those…
Time Limit:3000MS Memory Limit:0KB Description Most crossword puzzle fans are used to anagrams--groups of words with the same letters in different orders--for example OPTS, SPOT, STOP, POTS and POST. Some words however do not have this attribute…
Time Limit:3000MS Memory Limit:0KB Description Queues and Priority Queues are data structures which are known to most computer scientists. The Team Queue, however, is not so well known, though it occurs often in everyday life. At lunch time the q…
Time Limit:3000MS Memory Limit:0KB Description Background Many areas of Computer Science use simple, abstract domains for both analytical and empirical studies. For example, an early AI study of planning and robotics (STRIPS) used a block world i…
Time Limit:2000MS Memory Limit:65536KB Description A data stream is a real-time, continuous, ordered sequence of items. Some examples include sensor data, Internet traffic, financial tickers, on-line auctions, and transaction logs such as Web usa…
Time Limit:1000MS Memory Limit:32768KB Description A number sequence is defined as follows:f(1) = 1, f(2) = 1, f(n) = (A * f(n - 1) + B * f(n - 2)) mod 7.Given A, B, and n, you are to calculate the value of f(n). Input The input consists of mult…
Time Limit:1000MS Memory Limit:32768KB Description Contest time again! How excited it is to see balloons floating around. But to tell you a secret, the judges' favorite time is guessing the most popular problem. When the contest is over, they wil…
Time Limit:500MS Memory Limit:32768KB Description Hey, welcome to HDOJ(Hangzhou Dianzi University Online Judge).In this problem, your task is to calculate SUM(n) = 1 + 2 + 3 + ... + n. Input The input will consist of a series of integers n, one inte…
作者: 负雪明烛 id: fuxuemingzhu 个人博客: http://fuxuemingzhu.cn/ 目录 题目描述 题目大意 解题方法 日期 [LeetCode] 题目地址:https://leetcode.com/problems/same-tree/ Total Accepted: 126017 Total Submissions: 291619 Difficulty: Easy 题目描述 Given two binary trees, write a function to c…
Goblin Wars Time Limit:432MS Memory Limit:0KB 64bit IO Format:%lld & %llu Description The wizards and witches of Hogwarts School of Witchcraft found Prof. Binn's History of Magic lesson to be no less boring than you found your own history cla…
Magic Grid Time Limit:336MS Memory Limit:0KB 64bit IO Format:%lld & %llu Description Thanks a lot for helping Harry Potter in finding the Sorcerer's Stone of Immortality in October. Did we not tell you that it was just an online game ? uhhh!…
233 Matrix Time Limit:5000MS Memory Limit:65536KB 64bit IO Format:%I64d & %I64u Description In our daily life we often use 233 to express our feelings. Actually, we may say 2333, 23333, or 233333 ... in the same meaning. And here is the quest…
Number Sequence Time Limit:2000MS Memory Limit:65536KB 64bit IO Format:%I64d & %I64u Problem Description There is a special number sequence which has n+1 integers. For each number in sequence, we have two rules: ● a i ∈ [0,n] ● a i ≠ a j ( i…
Dice Time Limit:1000MS Memory Limit:65536KB Description There are 2 special dices on the table. On each face of the dice, a distinct number was written. Consider a 1.a 2,a 3,a 4,a 5,a 6 to be numbers written on top face, bottom face, left face, r…
Game Time Limit:1000MS Memory Limit:65536KB Description Here is a game for two players. The rule of the game is described below: ● In the beginning of the game, there are a lot of piles of beads. ● Players take turns to play. Each turn, player ch…
Post Robot Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/65536 K Problem Description DT is a big fan of digital products. He writes posts about technological products almost everyday in his blog. But there is such few comments of his…
use stringstream Time Limit:3000MS Memory Limit:0KB Description Andy, 8, has a dream - he wants to produce his very own dictionary. This is not an easy task for him, as the number of words that he knows is, well, not quite enough. Instead of thin…
Time Limit:3000MS Memory Limit:0KB Description Download as PDF Raju and Meena love to play with Marbles. They have got a lot of marbles with numbers written on them. At the beginning, Raju would place the marbles one after another in ascending or…
Time Limit:1000MS Memory Limit:32768KB Description Given a sequence a[1],a[2],a[3]......a[n], your job is to calculate the max sum of a sub-sequence. For example, given (6,-1,5,4,-7), the max sum in this sequence is 6 + (-1) + 5 + 4 = 14. Input The f…
Time Limit:1000MS Memory Limit:32768KB Description I have a very simple problem for you. Given two integers A and B, your job is to calculate the Sum of A + B. Input The first line of the input contains an integer T(1<=T<=20) which means the number…
Time Limit:1000MS Memory Limit:32768KB Description Calculate A + B. Input Each line will contain two integers A and B. Process to end of file. Output For each case, output A + B in one line. Sample Input 1 1 Sample Output 2 以下是代码: #include <cstdio>…