摘要: Consider a town where all the streets are one-way and each street leads from one intersection to another. It is also known that starting from an inter 阅读全文
posted @ 2017-07-06 17:45 阿波罗2003 阅读(163) 评论(0) 推荐(0) 编辑
摘要: A palindrome is a symmetrical string, that is, a string read identically from left to right as well as from right to left. You are to write a program 阅读全文
posted @ 2017-07-06 14:41 阿波罗2003 阅读(244) 评论(0) 推荐(0) 编辑
摘要: 记忆化搜索,完事。。。 Code 阅读全文
posted @ 2017-07-06 14:31 阿波罗2003 阅读(196) 评论(0) 推荐(0) 编辑
摘要: 给你一个无向带权连通图,每条边是黑色或白色。让你求一棵最小权的恰好有need条白色边的生成树。 题目保证有解。 Input 第一行V,E,need分别表示点数,边数和需要的白色边数。 接下来E行,每行s,t,c,col表示这边的端点(点从0开始标号),边权,颜色(0白色1黑色)。 Output 一行 阅读全文
posted @ 2017-07-06 11:38 阿波罗2003 阅读(310) 评论(0) 推荐(0) 编辑
摘要: 给定一个nxm的网格,请计算三点都在格点上的三角形共有多少个。下图为4x4的网格上的一个三角形。 注意三角形的三点不能共线。 Input 输入一行,包含两个空格分隔的正整数m和n。 Output 输出一个正整数,为所求三角形数量。 Sample Input Sample Output Hint 不难 阅读全文
posted @ 2017-07-06 09:53 阿波罗2003 阅读(228) 评论(0) 推荐(0) 编辑