摘要: Bob is preparing to pass IQ test. The most frequent task in this test is to find out which one of the given n numbers differs from the others. Bob obs 阅读全文
posted @ 2017-07-30 15:46 wydxry 阅读(249) 评论(0) 推荐(0) 编辑
摘要: Kirito is stuck on a level of the MMORPG he is playing now. To move on in the game, he's got to defeat all n dragons that live on this level. Kirito a 阅读全文
posted @ 2017-07-30 11:33 wydxry 阅读(428) 评论(0) 推荐(0) 编辑
摘要: Duff is addicted to meat! Malek wants to keep her happy for n days. In order to be happy in i-th day, she needs to eat exactly ai kilograms of meat. T 阅读全文
posted @ 2017-07-30 11:07 wydxry 阅读(276) 评论(0) 推荐(0) 编辑
摘要: A - ABCxxx Time limit : 2sec / Memory limit : 256MB Score : 100 points Problem Statement This contest, AtCoder Beginner Contest, is abbreviated as ABC 阅读全文
posted @ 2017-07-30 10:25 wydxry 阅读(511) 评论(0) 推荐(0) 编辑
摘要: 给出一个整数N,将N表示为2个整数i j的平方和(i <= j),如果有多种表示,按照i的递增序输出。 例如:N = 130,130 = 3^2 + 11^2 = 7^2 + 9^2 (注:3 11同11 3算1种) 给出一个整数N,将N表示为2个整数i j的平方和(i <= j),如果有多种表示, 阅读全文
posted @ 2017-07-29 18:31 wydxry 阅读(359) 评论(0) 推荐(0) 编辑
摘要: 一个N*N矩阵中有不同的正整数,经过这个格子,就能获得相应价值的奖励,从左上走到右下,只能向下向右走,求能够获得的最大价值。 例如:3 * 3的方格。 1 3 3 2 1 3 2 2 1 能够获得的最大价值为:11。 一个N*N矩阵中有不同的正整数,经过这个格子,就能获得相应价值的奖励,从左上走到右 阅读全文
posted @ 2017-07-29 17:09 wydxry 阅读(222) 评论(0) 推荐(0) 编辑
摘要: 有一堆石子共有N个。A B两个人轮流拿,A先拿。每次拿的数量只能是2的正整数次幂,比如(1,2,4,8,16....),拿到最后1颗石子的人获胜。假设A B都非常聪明,拿石子的过程中不会出现失误。给出N,问最后谁能赢得比赛。 例如N = 3。A只能拿1颗或2颗,所以B可以拿到最后1颗石子。(输入的N 阅读全文
posted @ 2017-07-29 16:52 wydxry 阅读(309) 评论(0) 推荐(0) 编辑
摘要: 有一堆石子共有N个。A B两个人轮流拿,A先拿。每次最少拿1颗,最多拿K颗,拿到最后1颗石子的人获胜。假设A B都非常聪明,拿石子的过程中不会出现失误。给出N和K,问最后谁能赢得比赛。 例如N = 3,K = 2。无论A如何拿,B都可以拿到最后1颗石子。 有一堆石子共有N个。A B两个人轮流拿,A先 阅读全文
posted @ 2017-07-29 16:30 wydxry 阅读(224) 评论(0) 推荐(0) 编辑
摘要: 一个高度为N的由正整数组成的三角形,从上走到下,求经过的数字和的最大值。 每次只能走到下一层相邻的数上,例如从第3层的6向下走,只能走到第4层的2或9上。 5 8 4 3 6 9 7 2 9 5 例子中的最优方案是:5 + 8 + 6 + 9 = 28 一个高度为N的由正整数组成的三角形,从上走到下 阅读全文
posted @ 2017-07-29 16:20 wydxry 阅读(204) 评论(0) 推荐(0) 编辑
摘要: X轴上有N条线段,每条线段包括1个起点和终点。线段的重叠是这样来算的,[10 20]和[12 25]的重叠部分为[12 20]。 给出N条线段的起点和终点,从中选出2条线段,这两条线段的重叠部分是最长的。输出这个最长的距离。如果没有重叠,输出0。 X轴上有N条线段,每条线段包括1个起点和终点。线段的 阅读全文
posted @ 2017-07-29 10:52 wydxry 阅读(230) 评论(0) 推荐(0) 编辑
摘要: 有编号1-n的n个格子,机器人从1号格子顺序向后走,一直走到n号格子,并需要从n号格子走出去。机器人有一个初始能量,每个格子对应一个整数A[i],表示这个格子的能量值。如果A[i] > 0,机器人走到这个格子能够获取A[i]个能量,如果A[i] < 0,走到这个格子需要消耗相应的能量,如果机器人的能 阅读全文
posted @ 2017-07-29 10:22 wydxry 阅读(274) 评论(0) 推荐(0) 编辑
摘要: 约翰认为字符串的完美度等于它里面所有字母的完美度之和。每个字母的完美度可以由你来分配,不同字母的完美度不同,分别对应一个1-26之间的整数。 约翰不在乎字母大小写。(也就是说字母F和f)的完美度相同。给定一个字符串,输出它的最大可能的完美度。例如:dad,你可以将26分配给d,25分配给a,这样整个 阅读全文
posted @ 2017-07-29 10:10 wydxry 阅读(412) 评论(0) 推荐(0) 编辑
摘要: Olesya loves numbers consisting of n digits, and Rodion only likes numbers that are divisible by t. Find some number that satisfies both of them. Your 阅读全文
posted @ 2017-07-29 09:30 wydxry 阅读(439) 评论(0) 推荐(0) 编辑
摘要: All cities of Lineland are located on the Ox coordinate axis. Thus, each city is associated with its position xi — a coordinate on the Ox axis. No two 阅读全文
posted @ 2017-07-28 15:30 wydxry 阅读(291) 评论(0) 推荐(0) 编辑
摘要: n个人,已知每个人体重。独木舟承重固定,每只独木舟最多坐两个人,可以坐一个人或者两个人。显然要求总重量不超过独木舟承重,假设每个人体重也不超过独木舟承重,问最少需要几只独木舟? n个人,已知每个人体重。独木舟承重固定,每只独木舟最多坐两个人,可以坐一个人或者两个人。显然要求总重量不超过独木舟承重,假 阅读全文
posted @ 2017-07-28 13:38 wydxry 阅读(238) 评论(0) 推荐(0) 编辑
摘要: A and B are preparing themselves for programming contests. B loves to debug his code. But before he runs the solution and starts debugging, he has to 阅读全文
posted @ 2017-07-28 13:16 wydxry 阅读(330) 评论(0) 推荐(0) 编辑
摘要: The well-known Fibonacci sequence is defined as following: F(0) = F(1) = 1 F(n) = F(n − 1) + F(n − 2) ∀n ≥ 2 Here we regard n as the index of the Fibo 阅读全文
posted @ 2017-07-28 10:46 wydxry 阅读(313) 评论(0) 推荐(0) 编辑
摘要: 在2*N的一个长方形方格中,用一个1*2的骨牌排满方格。 问有多少种不同的排列方法。 例如:2 * 3的方格,共有3种不同的排法。(由于方案的数量巨大,只输出 Mod 10^9 + 7 的结果) 在2*N的一个长方形方格中,用一个1*2的骨牌排满方格。 问有多少种不同的排列方法。 例如:2 * 3的 阅读全文
posted @ 2017-07-27 18:13 wydxry 阅读(308) 评论(0) 推荐(0) 编辑
摘要: There are n pictures delivered for the new exhibition. The i-th painting has beauty ai. We know that a visitor becomes happy every time he passes from 阅读全文
posted @ 2017-07-27 16:33 wydxry 阅读(335) 评论(0) 推荐(0) 编辑
摘要: A square number is an integer number whose square root is also an integer. For example 1, 4, 81 are some square numbers. Given two numbers a and b you 阅读全文
posted @ 2017-07-27 16:26 wydxry 阅读(250) 评论(0) 推荐(0) 编辑
摘要: Solve the equation: p ∗ e −x + q ∗ sin(x) + r ∗ cos(x) + s ∗ tan(x) + t ∗ x 2 + u = 0 where 0 ≤ x ≤ 1. Input Input consists of multiple test cases and 阅读全文
posted @ 2017-07-27 16:18 wydxry 阅读(221) 评论(0) 推荐(0) 编辑
摘要: A palindrome is a word, number, or phrase that reads the same forwards as backwards. For example, the name “anna” is a palindrome. Numbers can also be 阅读全文
posted @ 2017-07-27 16:08 wydxry 阅读(220) 评论(0) 推荐(0) 编辑
摘要: It has been said that a watch that is stopped keeps better time than one that loses 1 second per day. The one that is stopped reads the correct time t 阅读全文
posted @ 2017-07-27 15:55 wydxry 阅读(283) 评论(0) 推荐(0) 编辑
摘要: Watchmen are in a danger and Doctor Manhattan together with his friend Daniel Dreiberg should warn them as soon as possible. There are n watchmen on a 阅读全文
posted @ 2017-07-27 15:43 wydxry 阅读(252) 评论(0) 推荐(0) 编辑
摘要: The Robot Moving Institute is using a robot in their local store to transport different items. Of course the robot should spend only the minimum time 阅读全文
posted @ 2017-07-27 10:45 wydxry 阅读(371) 评论(0) 推荐(0) 编辑
摘要: There is an old stone game.At the beginning of the game the player picks n(1<=n<=50000) piles of stones in a line. The goal is to merge the stones in 阅读全文
posted @ 2017-07-27 10:05 wydxry 阅读(290) 评论(0) 推荐(0) 编辑
摘要: Ivan is fond of collecting. Unlike other people who collect post stamps, coins or other material stuff, he collects software bugs. When Ivan gets a ne 阅读全文
posted @ 2017-07-27 09:42 wydxry 阅读(287) 评论(0) 推荐(0) 编辑
摘要: 湫湫减肥 越减越肥! 最近,减肥失败的湫湫为发泄心中郁闷,在玩一个消灭免子的游戏。 游戏规则很简单,用箭杀死免子即可。 箭是一种消耗品,已知有M种不同类型的箭可以选择,并且每种箭都会对兔子造成伤害,对应的伤害值分别为Di(1 <= i <= M),每种箭需要一定的QQ币购买。 假设每种箭只能使用一次 阅读全文
posted @ 2017-07-27 09:30 wydxry 阅读(219) 评论(0) 推荐(0) 编辑
摘要: Each New Year Timofey and his friends cut down a tree of n vertices and bring it home. After that they paint all the n its vertices, so that the i-th 阅读全文
posted @ 2017-07-27 09:26 wydxry 阅读(288) 评论(0) 推荐(0) 编辑
摘要: It is lunch time for Mole. His friend, Marmot, prepared him a nice game for lunch. Marmot brought Mole n ordered piles of worms such that i-th pile co 阅读全文
posted @ 2017-07-26 19:50 wydxry 阅读(300) 评论(0) 推荐(0) 编辑
摘要: Let's consider a table consisting of n rows and n columns. The cell located at the intersection of i-th row and j-th column contains numberi × j. The 阅读全文
posted @ 2017-07-26 19:01 wydxry 阅读(396) 评论(0) 推荐(0) 编辑
摘要: Alex doesn't like boredom. That's why whenever he gets bored, he comes up with games. One long winter evening he came up with a game and decided to pl 阅读全文
posted @ 2017-07-26 18:38 wydxry 阅读(364) 评论(0) 推荐(0) 编辑
摘要: Scrooge McDuck keeps his most treasured savings in a home safe with a combination lock. Each time he wants to put there the treasures that he's earned 阅读全文
posted @ 2017-07-26 18:08 wydxry 阅读(399) 评论(0) 推荐(0) 编辑
摘要: It's one more school day now. Sasha doesn't like classes and is always bored at them. So, each day he invents some game and plays in it alone or with 阅读全文
posted @ 2017-07-26 16:47 wydxry 阅读(339) 评论(0) 推荐(0) 编辑
摘要: 给出2个N * N的矩阵M1和M2,输出2个矩阵相乘后的结果。 给出2个N * N的矩阵M1和M2,输出2个矩阵相乘后的结果。 Input 第1行:1个数N,表示矩阵的大小(2 <= N <= 100) 第2 - N + 1行,每行N个数,对应M1的1行(0 <= M1[i] <= 1000) 第N 阅读全文
posted @ 2017-07-26 14:56 wydxry 阅读(239) 评论(0) 推荐(0) 编辑
摘要: M * N的方格,一个机器人从左上走到右下,只能向右或向下走。有多少种不同的走法?由于方法数量可能很大,只需要输出Mod 10^9 + 7的结果。 M * N的方格,一个机器人从左上走到右下,只能向右或向下走。有多少种不同的走法?由于方法数量可能很大,只需要输出Mod 10^9 + 7的结果。 M 阅读全文
posted @ 2017-07-26 14:33 wydxry 阅读(204) 评论(0) 推荐(0) 编辑
摘要: 一个正整数,如果它能被7整除,或者它的十进制表示法中某个位数上的数字为7,则称其为与7相关的数。求所有小于等于N的与7无关的正整数的平方和。 例如:N = 8,<= 8与7无关的数包括:1 2 3 4 5 6 8,平方和为:155。 一个正整数,如果它能被7整除,或者它的十进制表示法中某个位数上的数 阅读全文
posted @ 2017-07-26 13:59 wydxry 阅读(235) 评论(0) 推荐(0) 编辑
摘要: 水仙花数是指一个 n 位数 ( n >= 3 ),它的每个位上的数字的 n 次幂之和等于它本身。(例如:1^3 + 5^3 + 3^3 = 153) 给出一个整数M,求 >= M的最小的水仙花数。 水仙花数是指一个 n 位数 ( n >= 3 ),它的每个位上的数字的 n 次幂之和等于它本身。(例如 阅读全文
posted @ 2017-07-26 13:37 wydxry 阅读(241) 评论(0) 推荐(0) 编辑
摘要: 一个矩形的面积为S,已知该矩形的边长都是整数,求所有满足条件的矩形中,周长的最小值。例如:S = 24,那么有{1 24} {2 12} {3 8} {4 6}这4种矩形,其中{4 6}的周长最小,为20。 一个矩形的面积为S,已知该矩形的边长都是整数,求所有满足条件的矩形中,周长的最小值。例如:S 阅读全文
posted @ 2017-07-26 13:25 wydxry 阅读(223) 评论(0) 推荐(0) 编辑
摘要: 1,10,100,1000...组成序列1101001000...,求这个序列的第N位是0还是1。 1,10,100,1000...组成序列1101001000...,求这个序列的第N位是0还是1。 Input 第1行:一个数T,表示后面用作输入测试的数的数量。(1 <= T <= 10000) 第 阅读全文
posted @ 2017-07-26 11:35 wydxry 阅读(247) 评论(0) 推荐(0) 编辑
Live2D