Description
Samball is going to travel in the coming vacation. Now it's time to make a plan. After choosing the destination city, the next step is to determine the travel route. As this poor guy has ...
分类:
其他好文 时间:
2014-08-18 10:50:54
阅读次数:
334
Smith数的定义是各位数字之和与它的各个质因数(可以重复)的各位数字之和的总和相同的数,且不是素数。题目本身是一道水题,数据尤其水。下面的代码中加了一个优化:先将所有询问按询问的数字升序排序,处理某个询问A时,如果结果是B,那么对其后询问值小于B的所有询问,都直接给出答案为B。例如:2324252...
分类:
其他好文 时间:
2014-08-17 21:16:52
阅读次数:
296
典型的Joseph问题……由于数据范围小,直接暴力就可以解决了……用到了链表的数据结构……时间:90毫秒。#include "stdio.h"#include "string.h"struct lianbiao{ int prev,next;}p[152];const int INF=2147483...
分类:
其他好文 时间:
2014-08-17 21:15:32
阅读次数:
158
水题一道- -暴力做法、打表都可以0ms AC。时间:0毫秒。#include#includeusing namespace std;int main(){ double ans=1, temp=1; int i=0; cout<<"n e"<<endl; cout<<...
分类:
其他好文 时间:
2014-08-17 21:11:22
阅读次数:
189
Desert KingTime Limit:3000MSMemory Limit:65536KTotal Submissions:20586Accepted:5777DescriptionDavid the Great has just become the king of a desert cou...
分类:
其他好文 时间:
2014-08-17 18:18:43
阅读次数:
284
题目链接:http://acm.zju.edu.cn/onlinejudge/showProblem.do?problemId=654
AC一百道水题,不如AC一道难题来的舒服!
题意:一个n*m地图,*代表草地,#代表墙,o代表空地,要再图中的o处放机器人,机器人可以攻击(上下左右)4个方向,攻击范围无限长,而且机器人不能相互攻击,草地不能放置机器人,且机器人的攻击可以穿...
分类:
其他好文 时间:
2014-08-17 17:07:12
阅读次数:
167
ZOJ Problem Set - 1456
Minimum Transport Cost
Time Limit: 2 Seconds
Memory Limit: 65536 KB
These are N cities in Spring country. Between each pair of cities there may be one transportat...
分类:
其他好文 时间:
2014-08-17 15:36:22
阅读次数:
193
Mission ImpossibleTime Limit: 2 Seconds Memory Limit: 65536 KB Now a spy is besieged in a maze. He knows that there is a telegraph transmitter in t...
分类:
其他好文 时间:
2014-08-17 12:53:52
阅读次数:
299
// poj 1458 zoj 1733 最长公共子序列 DP #include #include #define N 1005using namespace std ;char s1[N],s2[N]; int dp[N][N];int max(int a,int b) { return a>b ...
分类:
其他好文 时间:
2014-08-17 11:44:02
阅读次数:
160
Bus PassTime Limit:5 Seconds Memory Limit:32768 KBYou travel a lot by bus and the costs of all the seperate tickets are starting to add up.Therefore y...
分类:
其他好文 时间:
2014-08-17 08:07:21
阅读次数:
296