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…
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…
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…
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…
103. Traffic Lights Time limit per test: 0.25 second(s) Memory limit: 4096 kilobytes 题解: 1.其实就是求两点间的最短路,不过加了交通灯的限制,使得两点间的所需时间并不只是由路程决定. 2.只有一条路两个端点的交通灯颜色相同时,该路才可以通过.但是这有一种情况,当两个交通灯处于不同颜色时,经过t时间,交通灯又恰好处于不同颜色,由于最初有一个颜色预变时间riC以及蓝色tiB.紫色周期tiP ,那么就需要计算交通灯…
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…
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…
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…
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!…
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…
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 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 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…
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: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 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: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: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…
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>…
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…
101. Domino time limit per test: 0.25 sec. memory limit per test: 4096 KB 题解: 求多米诺骨牌按照一定方式放置能否使相邻的位置数字相同.其实就是求无向图的欧拉通路,dfs即可. 但需要注意以下几点: 1.注意是否是连通图. 2.注意自环. 3.注意有两个奇度顶点时深搜起点. 以下是代码: #include <iostream> #include <cstdio> #include <cstring>…
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; }…
目录 cf1199解题报告 A B C D E F cf1199解题报告 发一波水题. A 模拟 #include <bits/stdc++.h> #define ll long long using namespace std; const int _=1e6+7; int n,x,y,a[_]; int main() { scanf("%d%d%d",&n,&x,&y); for(int i=1;i<=n;++i) scanf("…
目录 cf1206解题报告 A B C D E,F cf1206解题报告 A 模拟 #include <bits/stdc++.h> using namespace std; int n,m,a[1010],b[12910]; int dsr[1111]; int main() { scanf("%d",&n); for(int i=1;i<=n;++i) scanf("%d",&a[i]),dsr[a[i]]=1; scanf(&…
ACM-ICPC 2017 Asia HongKong 解题报告 任意门:https://nanti.jisuanke.com/?kw=ACM-ICPC%202017%20Asia%20HongKong 按AC次序: D - Card collection In an online game, a player can collect different types of power cards. Each power card can enable a player to have a uni…