随笔分类 - ACM
1
摘要:time limit per test 1 second memory limit per test 256 megabytes input standard input output standard output You have nn stacks of blocks. The ii-th s
阅读全文
摘要:会下国际象棋的人都很清楚:皇后可以在横、竖、斜线上不限步数地吃掉其他棋子。如何将8个皇后放在棋盘上(有8 * 8个方格),使它们谁也不能被吃掉!这就是著名的八皇后问题。 对于某个满足要求的8皇后的摆放方法,定义一个皇后串a与之对应,即a=b 1b 2...b 8,其中b i为相应摆法中第i行皇后所处
阅读全文
摘要:time limit per test 2 seconds memory limit per test 512 megabytes input standard input output standard output The great hero guards the country where
阅读全文
摘要:B1. Painting the Array I time limit per test 2 seconds memory limit per test 512 megabytes input standard input output standard output The only differ
阅读全文
摘要:You are given an array of integers 𝑎1,𝑎2,…,𝑎𝑛. Find the maximum possible value of 𝑎𝑖𝑎𝑗𝑎𝑘𝑎𝑙𝑎𝑡 among all five indices (𝑖,𝑗,𝑘,𝑙,𝑡) (𝑖
阅读全文
摘要:time limit per test2 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard output Alice and Bob play a game. They have a binary s
阅读全文
摘要:Problem Description The GeoSurvComp geologic survey company is responsible for detecting underground oil deposits. GeoSurvComp works with one large re
阅读全文
摘要:在N*N的方格棋盘放置了N个皇后,使得它们不相互攻击(即任意2个皇后不允许处在同一排,同一列,也不允许处在与棋盘边框成45角的斜线上。你的任务是,对于给定的N,求出有多少种合法的放置方法。 Input 共有若干行,每行一个正整数N≤10,表示棋盘和皇后的数量;如果N=0,表示结束。 Output 共
阅读全文
摘要:在一个给定形状的棋盘(形状可能是不规则的)上面摆放棋子,棋子没有区别。要求摆放时任意的两个棋子不能放在棋盘中的同一行或者同一列,请编程求解对于给定形状和大小的棋盘,摆放k个棋子的所有可行的摆放方案C。 Input 输入含有多组测试数据。每组数据的第一行是两个正整数,n k,用一个空格隔开,表示了将在
阅读全文
摘要:Given a set of integers (it can contain equal elements). You have to split it into two subsets AA and BB (both of them can contain equal elements or b
阅读全文
摘要:You are playing a very popular game called Cubecraft. Initially, you have one stick and want to craft kk torches. One torch can be crafted using one s
阅读全文
摘要:Problem Description: Alexandra has an even-length array aa, consisting of 00s and 11s. The elements of the array are enumerated from 11 to nn. She wan
阅读全文
摘要:Problem Description You are given N baskets of gold coins. The baskets are numbered from 1 to N. In all except one of the baskets, each gold coin weig
阅读全文
摘要:Problem Description I have a very simple problem for you. Given two integers A and B, your job is to calculate the Sum of A + B. Input The first line
阅读全文
摘要:Problem Description HDOJ 上面已经有 10 来道 A+B 的题目了,相信这些题目曾经是大家的最爱,希望今天的这个 A+B 能给大家带来好运,也希望这个题目能唤起大家对ACM 曾经的热爱。这个题目的 A 和 B 不是简单的整数,而是两个时间,A 和 B 都是由 3 个整数组成,
阅读全文
摘要:Problem Description 有 n(n<=100) 个整数,已经按照从小到大顺序排列好,现在另外给一个整数x,请将该数插入到序列中,并使新的序列仍然有序。 Input 输入数据包含多个测试实例,每组数据由两行组成, 第一行是 n 和 m,第二行是已经有序的n 个数的数列。 n 和 m 同
阅读全文
摘要:Problem Description 输入 n(n<100) 个数,找出其中最小的数,将它与最前面的数交换后输出这些数。 Input 输入数据有多组, 每组占一行, 每行的开始是一个整数n,表示这个测试实例的数值的个数,跟着就是 n 个整数。 n=0 表示输入的结束,不做处理。 Output 对于
阅读全文
摘要:Problem Description 青年歌手大奖赛中, 评委会给参赛选手打分。 选手得分规则为去掉一个最高分和一个最低分,然后计算平均得分,请编程输出某选手的得分。 Input 输入数据有多组,每组占一行,每行的第一个数是n(2<n<100) ,表示评委的人数,然后是n个评委的打分。 Outpu
阅读全文
摘要:Problem Description 输入 n(n<=100) 个整数,按照绝对值从大到小排序后输出。题目保证对于每一个测试实例,所有的数的绝对值都不相等。 Input 输入数据有多组,每组占一行,每行的第一个数字为n,接着是 n 个整数, n=0 表示输入数据的结束,不做处理。 Output 对
阅读全文
摘要:Problem Description 对于给定的一个字符串,统计其中数字字符出现的次数。 Input 输入数据有多行,第一行是一个整数n,表示测试实例的个数,后面跟着n 行,每行包括一个由字母和数字组成的字符串。 Output 对于每个测试实例,输出该串中数值的个数,每个输出占一行。 Sample
阅读全文
1

浙公网安备 33010602011771号