2015年8月2日
摘要: Description 给你一个高为n ,宽为m列的网格,计算出这个网格中有多少个矩形,下图为高为2,宽为4的网格. Input 第一行输入一个t, 表示有t组数据,然后每行输入n,m,分别表示网格的高和宽 ( n < 100 , m < 100). Output 每行输出网格中有多少个矩形. Sa 阅读全文
posted @ 2015-08-02 16:31 xx-sisley 阅读(136) 评论(0) 推荐(0) 编辑
摘要: Description Today on a lecture about strings Gerald learned a new definition of string equivalency. Two strings a and b of equal length are calledequi 阅读全文
posted @ 2015-08-02 16:15 xx-sisley 阅读(223) 评论(0) 推荐(0) 编辑
摘要: 题意: 输入正整数n,把整数1,2,3,……,n组成一个环,使得相邻的两个整数之和均为素数。输出时从整数1 开始逆时针排列。同一个环应恰好输出一次。n<=16。 Sample Input Sample Output 分析: 应用DFS和回溯法。 代码: 阅读全文
posted @ 2015-08-02 15:49 xx-sisley 阅读(344) 评论(0) 推荐(0) 编辑
摘要: 题意简概: 输入n个元素组成的序列S,你需要找一个乘积最大的连续子序列。如果这个最大的乘积不是正数,应输出0,表示无解。1<=n<=18,-10<=Si<=10。 Sample Input32 4 -352 5 -1 2 -1Sample OutputCase #1: The maximum pro 阅读全文
posted @ 2015-08-02 15:13 xx-sisley 阅读(156) 评论(0) 推荐(0) 编辑
摘要: Description: Write a program that finds and displays all pairs of 5-digit numbers that between them use the digits 0 through 9 once each, such that th 阅读全文
posted @ 2015-08-02 14:58 xx-sisley 阅读(414) 评论(0) 推荐(0) 编辑