刚一拿到这道题把他想的太复杂了
明明是长度最大为十的顺序结构就能解决的问题,竟然优先想到用链表。
BFS牵扯到一个队列的操作,在这种小规模数据里面 用顺序结构好很多
题目如下:
For a given undirected graph with N vertices and E edges, please list all the connected...
分类:
其他好文 时间:
2015-02-24 09:09:25
阅读次数:
242
#include#include#includeusing namespace std;struct Student{ char mID[10]; int de,cai,sum; int tag; //标明是第几类:1德才都们组,2德胜才,3}STU[100010];bool c...
分类:
其他好文 时间:
2015-02-23 15:27:44
阅读次数:
163
Calculate a + b and output the sum in standard format -- that is, the digits must be separated into groups of three by commas (unless there are less than four digits).
Input
Each input file cont...
分类:
其他好文 时间:
2015-02-23 14:20:06
阅读次数:
146
#include#includechar in[100][260];int main() { int n,lenMIN=260; scanf("%d",&n); getchar(); //【skill】吸收换行符 for(int i=0 ; i=0 ; --i) ...
分类:
其他好文 时间:
2015-02-22 15:46:15
阅读次数:
149
题目名称:PAT (Basic Level) Practise (中文)1008. 数组元素循环右移问题 (20) 1 #include 2 3 int main() 4 { 5 int n,m; 6 scanf("%d%d",&n,&m); 7 ...
分类:
编程语言 时间:
2015-02-22 12:12:14
阅读次数:
155
#include#includetypedef struct STU{ char mID[15]; char mpass[15]; bool tag;}STU;STU arr[1010];int main(){ memset(arr,0,sizeof(arr)); int n,change...
分类:
其他好文 时间:
2015-02-21 16:37:26
阅读次数:
137
#include#includechar alp[10][10]={"zero","one","two","three","four","five","six","seven","eight","nine"};char str[1200];int main(){ scanf("%s",str); ....
分类:
其他好文 时间:
2015-02-21 15:28:26
阅读次数:
209
#includeint main(){ int a,b; scanf("%d%d",&a,&b); int sum=a+b; if(sum=0 ; --j) { printf("%d",arr[j]); if(j!=0 && j%3==0) //【思维】用取余的方法逢...
分类:
编程语言 时间:
2015-02-21 15:26:37
阅读次数:
172
#includeint main(){ int a,b; scanf("%d%d",&a,&b); int sum=a+b; if(sum1000000) //【思维】,两个数字在:-1000000 1000) printf("%d,%d",sum/1000,sum%...
分类:
其他好文 时间:
2015-02-21 14:20:06
阅读次数:
162
#include#include#include#include#includeusing namespace std;char g1[99],g2[99],g3[99],g4[99];char alp[7][5]={"MON","TUE","WED","THU","FRI","SAT","SUN"...
分类:
其他好文 时间:
2015-02-21 13:11:24
阅读次数:
122