上一页 1 ··· 11 12 13 14 15 16 17 18 19 ··· 29 下一页
摘要: Find an n × n matrix with different numbers from 1 to n2, so the sum in each row, column and both main diagonals are odd. Input The only line contains 阅读全文
posted @ 2017-09-08 21:02 KingSann 阅读(143) 评论(0) 推荐(0) 编辑
摘要: Vasiliy is fond of solving different tasks. Today he found one he wasn't able to solve himself, so he asks you to help. Vasiliy is given n strings con 阅读全文
posted @ 2017-09-08 20:45 KingSann 阅读(149) 评论(0) 推荐(0) 编辑
摘要: 处于相邻的两个素数p和p + n之间的n - 1个连续的合数所组成的序列我们将其称为长度为n的素数槽。例如,‹24, 25, 26, 27, 28›是处于素数23和素数29之间的一个长度为6的素数槽。 你的任务就是写一个程序来计算包含整数k的素数槽的长度。如果k本身就是素数,那么认为包含k的素数槽的 阅读全文
posted @ 2017-09-08 19:21 KingSann 阅读(169) 评论(0) 推荐(0) 编辑
摘要: 题目描述 对于刚上大学的牛牛来说,他面临的第一个问题是如何根据实际情况申请合适的课程。 在可以选择的课程中,有 2n2n 节课程安排在 nn 个时间段上。在第 ii(1 \leq i \leq n1≤i≤n)个时间段上,两节内容相同的课程同时在不同的地点进行,其中,牛牛预先被安排在教室 c_ic​i 阅读全文
posted @ 2017-09-08 17:25 KingSann 阅读(223) 评论(0) 推荐(0) 编辑
摘要: On his trip to Luxor and Aswan, Sagheer went to a Nubian market to buy some souvenirs for his friends and relatives. The market has some strange rules 阅读全文
posted @ 2017-09-07 21:28 KingSann 阅读(168) 评论(0) 推荐(0) 编辑
摘要: ZS the Coder and Chris the Baboon has arrived at Udayland! They walked in the park where n trees grow. They decided to be naughty and color the trees 阅读全文
posted @ 2017-09-07 18:55 KingSann 阅读(231) 评论(0) 推荐(0) 编辑
摘要: zscoder wants to generate an input file for some programming competition problem. His input is a string consisting of n letters 'a'. He is too lazy to 阅读全文
posted @ 2017-09-07 17:09 KingSann 阅读(131) 评论(0) 推荐(0) 编辑
摘要: 题目描述 小A有N个糖果盒,第i个盒中有a[i]颗糖果。 小A每次可以从其中一盒糖果中吃掉一颗,他想知道,要让任意两个相邻的盒子中加起来都只有x颗或以下的糖果,至少得吃掉几颗糖。 输入输出格式 输入格式: 第一行输入N和x。 第二行N个整数,为a[i]。 输出格式: 至少要吃掉的糖果数量。 输入输出 阅读全文
posted @ 2017-09-06 17:43 KingSann 阅读(220) 评论(0) 推荐(0) 编辑
摘要: 题目描述 Caima王国中有一个奇怪的监狱,这个监狱一共有P个牢房,这些牢房一字排开,第i个紧挨着第i+1个(最后一个除外)。现在正好牢房时满的。 上 级下发了一个释放名单,要求每天释放名单上的一个人。这可把看守们吓得不轻,因为看守们知道,现在牢房中的P个人,可以相互之间传话。如果某个人离开了,那么 阅读全文
posted @ 2017-09-06 17:41 KingSann 阅读(289) 评论(0) 推荐(0) 编辑
摘要: 1589: 【分区联赛模拟试题1_2.Set】 题目描述 现在给你一些连续的整数,它们是从A到B的整数。一开始每个整数都属于各自的集合,然后你需要进行一下的操作: 每次选择两个属于不同集合的整数,如果这两个整数拥有大于等于P的公共质因数,那么把它们所在的集合合并。 反复如上操作,直到没有可以合并的集 阅读全文
posted @ 2017-09-06 17:07 KingSann 阅读(298) 评论(0) 推荐(0) 编辑
上一页 1 ··· 11 12 13 14 15 16 17 18 19 ··· 29 下一页