暴力
纯纯的心儿
每天都在赚事业。。
展开
-
hdu 1269 迷宫城堡
hdu 1269 迷宫城堡 Problem Description 为了训练小希的方向感,Gardon建立了一座大城堡,里面有N个房间(N Input 输入包含多组数据,输入的第一行有两个数:N和M,接下来的M行每行有两个数a和b,表示了一条通道可以从A房间来到B房间。文件最后以两个0结束。 Output 对于输入的每组数据,如果任意两个房间都是相互连接的,输出"Yes",否则原创 2015-03-23 21:46:02 · 668 阅读 · 0 评论 -
UVA146 ID Codes
ID Codes It is 2084 and the year of Big Brother has finally arrived, albeit a century late. In order to exercise greater control over its citizens and thereby to counter a chronic breakdown in law an原创 2015-03-23 21:56:05 · 475 阅读 · 0 评论 -
uva 307 Sticks
Sticks George took sticks of the same length and cut them randomly until all parts became at most 50 units long. Now he wants to return sticks to the original state, but he forgot how many sticks he原创 2015-03-23 22:02:23 · 570 阅读 · 0 评论 -
UVA 10474 Where is the Marble?(
UVA 10474 Where is the Marble? 这题的题意就是找到第几小的,注意数组的范围; #include #include int com(const void *a1,const void *a2) { return *(int *)a1-*(int *)a2; } int main() { int n,m; int i,j,k=1; int s[20000];原创 2015-03-23 22:13:02 · 381 阅读 · 0 评论 -
uva216 Getting in Line
此题主要是把电脑连起来,但是其中还得加16,求最短的缆线长 直接暴力求解 #include #include #include #include using namespace std; double changdu(double x1,double y1,double x2,double y2) { double l=sqrt((x1-x2)*(x1-x2)+(y1-y2)*(y1-y2)原创 2015-03-23 22:27:38 · 404 阅读 · 0 评论 -
UVA 639 Don't Get Rooked
#include #include int n; int max; int i,j; char s[5][5];//定义城市地图; int youwu(int x,int y)//查看是否有无碉堡; { int i,j; for(i=x-1;i>=0;i--) { if(s[i][y]=='X') break; else if(s[i][y]=='O') return fal原创 2015-03-23 22:31:41 · 501 阅读 · 0 评论 -
Sort it hdu 2689
Problem Description You want to processe a sequence of n distinct integers by swapping two adjacent sequence elements until the sequence is sorted in ascending order. Then how many times it need.原创 2015-06-03 13:05:29 · 387 阅读 · 0 评论