Smallest DifferenceTime Limit: 1000MS Memory Limit: 65536KTotal Submissions: 2679 Accepted: 766DescriptionGiven a number of distinct decimal digits, you can form one integer by choosing a non-empty subset of these digits and writing them in some
HopscotchTime Limit: 1000MS Memory Limit: 65536KTotal Submissions: 1462 Accepted: 1043DescriptionThe cows play the child's game of hopscotch in a non-traditional way. Instead of a linear set of numbered boxes into which to hop, the cows create a 5x5
B. Ilya and Queriestime limit per test2 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputIlya the Lion wants to help all his friends with passing exams. They need to solve the following problem to pass the IT exam.You'
Shuffle'm UpTime Limit: 1000MS Memory Limit: 65536KTotal Submissions: 4557 Accepted: 2167DescriptionA common pastime for poker players at a poker table is to shuffle stacks of chips. Shuffling chips is performed by starting with two stacks of poker
Window PainsTime Limit: 2 Seconds Memory Limit: 65536 KBBoudreaux likes to multitask, especially when it comes to using his computer. Never satisfied with just running one application at a time, he usually runs nine applications, each in its
PotsTime Limit: 1000MS Memory Limit: 65536KTotal Submissions: 8211 Accepted: 3481 Special JudgeDescriptionYou are given two pots, having the volume of A and B liters respectively. The following operations can be performed:FILL(i) fill the pot
因為沒有權值,所以不用使用Floyd演算法求最短路。直接用bfs做。。。#include<cstdio>#include<cstring>using namespace std;const int maxn = 21;int G[maxn][maxn];int vis[maxn][maxn];struct node{ int level; int u;} q[maxn*maxn];int bfs(int s,int e){ int front = 1;
/*The analysis of this problem What is a Carmichael number? First it is not a prime; Second it must meet the contition that a^p mod p=a.*/#include<iostream>#include<cstdio>#include<cstdlib>//get a random
MatrixTime Limit: 6000MS Memory Limit: 65536KTotal Submissions: 4150 Accepted: 1007DescriptionGiven a N × N matrix A, whose element in the i-th row andj-th columnAij is an number that equals i2 + 100000 ×i +j2 - 100000 × j + i × j, you are to find
文章目錄 Sample InputPossible Output for Sample Input Problem E: WeddingUp to thirty couples will attend a wedding feast, at which they will be seated on either side of a long table. The bride and groom sit at one end,