书上具体所有题目:http://pan.baidu.com/s/1hssH0KO 代码:(Accepted,0 ms) //UVa1590 - IP Networks #include<iostream> unsigned i, m, num, ip[4], ipmax[4], ipmin[4], mask[4]; int cmp(unsigned *a, unsigned *b) {//compare for (int i = 0;i < 4;++i) { if (a[i] <…
书上具体所有题目:http://pan.baidu.com/s/1hssH0KO 代码:(Accepted,0 ms) //UVa815 - Flooded! #include<iostream> #include<algorithm> int M, N, W, S[1000], T = 0; int main() { //freopen("in.txt", "r", stdin); while (scanf("%d%d"…
书上具体所有题目:http://pan.baidu.com/s/1hssH0KO 代码:(Accepted,0 ms) #include<iostream> unsigned N, A, B, Sp, Sq, ansA, ansB; unsigned long long Pofs, K, nowK; int main() { //freopen("in.txt", "r", stdin); while (scanf("%u%u%u",…
题意:N张地图,查找某地点在不在某些地图上,若在,使用细节多的地图.使用哪个地图的破要求挺多,细心一点就好. 代码:(Accepted,0.000s) //UVa511 - Do You Know the Way to San Jose? //Accepted 0.000s //#define _XIENAOBAN_ #include<iostream> #include<algorithm> #include<cstring> #include<string&g…
题意:一堆文件但只有一个打印机,按优先级与排队顺序进行打印.也就是在一个可以插队的的队列里,问你何时可以打印到.至于这个插队啊,题目说"Of course, those annoying term papers that others are printing may have to wait for quite some time to get printed, but that's life."嗯,这就是生活. 代码:(Accepted, 0ms) //UVa12100 - Pri…
题意:有若干交换生.若干学校,有人希望从A校到B校,有的想从B到C.C到A等等等等.如果有人想从A到B也刚好有人想从B到A,那么可以交换(不允许一对多.多对一).看作后如果有人找不到人交换,那么整个交换计划失败. 代码:(Accepted, 50ms) //UVa10763 - Foreign Exchange #include<cstdio> #include<cstring> int N, a, b,all[1003][1003]; int main() { //freopen…