摘要:
问题描述 给定n个数,请找出其中相差(差的绝对值)最小的两个数,输出它们的差值的绝对值。 输入格式 输入第一行包含一个整数n。 第二行包含n个正整数,相邻整数之间使用一个空格分隔。 输出格式 输出一个整数,表示答案。 样例输入 51 5 4 8 20 样例输出 1 样例说明 相差最小的两个数是5和4 阅读全文
摘要:
问题描述 输入的第一行包含一个正整数n,表示时间段的数量。 接下来n行每行两个数ai,bi,描述小H的各个装车的时间段。 接下来n行每行两个数ci,di,描述小W的各个装车的时间段。 输出格式 输出一行,一个正整数,表示两人可以聊多长时间。 样例输入 41 35 69 1314 152 45 710 阅读全文
摘要:
问题描述 在一条街上有n个卖菜的商店,按1至n的顺序排成一排,这些商店都卖一种蔬菜。 第一天,每个商店都自己定了一个价格。店主们希望自己的菜价和其他商店的一致,第二天,每一家商店都会根据他自己和相邻商店的价格调整自己的价格。具体的,每家商店都会将第二天的菜价设置为自己和相邻商店第一天菜价的平均值(用 阅读全文
摘要:
2792. Grammar Lessons Petya got interested in grammar on his third year in school. He invented his own language called Petya's. Petya wanted to create 阅读全文
摘要:
2756. Lucky Transformation Petya loves lucky numbers. Everybody knows that lucky numbers are positive integers whose decimal representation contains o 阅读全文
摘要:
2776. String Task Petya started to attend programming lessons. On the first lesson his task was to write a simple program. The program was supposed to 阅读全文
摘要:
2794. Petya and Strings Little Petya loves presents. His mum bought him two strings of the same size for his birthday. The strings consist of uppercas 阅读全文
摘要:
2810. Palindromic Times Tattah is asleep if and only if Tattah is attending a lecture. This is a well-known formula among Tattah's colleagues. On a We 阅读全文
摘要:
14. Football Petya loves football very much. One day, as he was watching a football match, he was writing the players' current positions on a piece of 阅读全文
摘要:
Sum of Digits Having watched the last Harry Potter film, little Gerald also decided to practice magic. He found in his father's magical book a spell t 阅读全文