码迷,mamicode.com
首页 >  
搜索关键字:pat    ( 13517个结果
1019. General Palindromic Number (20)
A number that will be the same when it is written forwards or backwards is known as a Palindromic Number. For example, 1234321 is a palindromic number. All single digit numbers are palindromic numbers...
分类:其他好文   时间:2015-02-25 21:11:47    阅读次数:126
1015. Reversible Primes (20)
A reversible prime in any number system is a prime whose "reverse" in that number system is also a prime. For example in the decimal system 73 is a reversible prime because its reverse 37 is also a pr...
分类:其他好文   时间:2015-02-25 21:10:58    阅读次数:151
PAT:1013. 数素数 (20) AC
#include#includebool isprime(int num){ int sqr=(int)sqrt(num*1.0); //【skill】判断素数只要判断到开平方就可以了 for(int i=2 ; i=l && cnt=r) break; ...
分类:其他好文   时间:2015-02-24 13:47:35    阅读次数:167
PAT:1007. 素数对猜想 (20) AC
#include#includebool isprime(int num) //判断素数的子函数{ int sqr=(int)sqrt(num*1.0); for(int i=2 ; i<sqr+1 ; ++i) if(num%i==0) return 0; re...
分类:其他好文   时间:2015-02-24 13:45:13    阅读次数:108
1006. Sign In and Sign Out (25)
At the beginning of every day, the first person who signs in the computer room will unlock the door, and the last one who signs out will lock the door. Given the records of signing in's and out's, you...
分类:其他好文   时间:2015-02-24 12:38:14    阅读次数:136
1011. World Cup Betting (20)
With the 2010 FIFA World Cup running, football fans the world over were becoming increasingly excited as the best players from the best teams doing battles for the World Cup trophy in South Africa. Si...
分类:其他好文   时间:2015-02-24 12:37:00    阅读次数:156
1008. Elevator (20)
The highest building in our city has only one elevator. A request list is made up with N positive numbers. The numbers denote at which floors the elevator will stop, in specified order. It costs 6 sec...
分类:其他好文   时间:2015-02-24 12:36:59    阅读次数:344
PAT 05-1 List Components (简单DFS与BFS)
刚一拿到这道题把他想的太复杂了 明明是长度最大为十的顺序结构就能解决的问题,竟然优先想到用链表。 BFS牵扯到一个队列的操作,在这种小规模数据里面 用顺序结构好很多 题目如下: For a given undirected graph with N vertices and E edges, please list all the connected...
分类:其他好文   时间:2015-02-24 09:09:25    阅读次数:242
PAT:1015. 德才论 (25) AC
#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
1001. A+B Format (20)
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
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!