摘要: 1 <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> 2 <html> 3 <head> 4 <meta http-equiv="Content 阅读全文
posted @ 2017-06-05 21:25 Wally的博客 阅读(181) 评论(0) 推荐(0) 编辑
摘要: Terrorists are around everywhere, they always make troubles by detonating bombs. The terrorist have some gunpowder to make bombs, different gunpowder 阅读全文
posted @ 2017-05-30 17:57 Wally的博客 阅读(213) 评论(0) 推荐(0) 编辑
摘要: Vitaly works at the warehouse. The warehouse can be represented as a grid of n × mcells, each of which either is free or is occupied by a container. F 阅读全文
posted @ 2017-05-23 17:04 Wally的博客 阅读(181) 评论(0) 推荐(0) 编辑
摘要: Description The cows have revised their game of leapcow. They now play in the middle of a huge pasture upon which they have marked a grid that bears a 阅读全文
posted @ 2017-05-23 16:42 Wally的博客 阅读(237) 评论(0) 推荐(0) 编辑
摘要: Although Inzane successfully found his beloved bone, Zane, his owner, has yet to return. To search for Zane, he would need a lot of money, of which he 阅读全文
posted @ 2017-05-03 14:47 Wally的博客 阅读(290) 评论(0) 推荐(0) 编辑
摘要: https://vjudge.net/contest/160830#problem/I 题意:给你一堆不同颜色的不同长度的棍,问你是否这些棍是否能够组成三角形且所有三角形的每个边的颜色都不相同。 思路:在添加三角形的边时,如果颜色相同就取最大的边,如果找的了三条边,就去比较第一以及第三条边和是否能够 阅读全文
posted @ 2017-04-29 14:55 Wally的博客 阅读(193) 评论(0) 推荐(0) 编辑
摘要: https://vjudge.net/contest/160830#problem/B 题意:给你n个参赛团队,m个问题,每个问题要r分钟,比赛的总时间是t,总的团队数量k。输出要解决的问题数量以及花费的总时间,然后输出解决问题的人和解决的问题号以及解决问题的开始时间。 1 #include <io 阅读全文
posted @ 2017-04-29 14:38 Wally的博客 阅读(203) 评论(0) 推荐(0) 编辑
摘要: ACM (ACMers' Chatting Messenger) is a famous instant messaging software developed by Marjar Technology Company. To attract more users, Edward, the bos 阅读全文
posted @ 2017-04-22 20:38 Wally的博客 阅读(203) 评论(0) 推荐(0) 编辑
摘要: Japari Park is a large zoo home to extant species, endangered species, extinct species, cryptids and some legendary creatures. Due to a mysterious sub 阅读全文
posted @ 2017-04-22 20:26 Wally的博客 阅读(226) 评论(0) 推荐(0) 编辑
摘要: Sasha and Kolya decided to get drunk with Coke, again. This time they have k types of Coke. i-th type is characterised by its carbon dioxide concentra 阅读全文
posted @ 2017-04-09 21:10 Wally的博客 阅读(254) 评论(0) 推荐(0) 编辑
摘要: Something happened in Uzhlyandia again... There are riots on the streets... Famous Uzhlyandian superheroes Shean the Sheep and Stas the Giraffe were c 阅读全文
posted @ 2017-04-09 19:57 Wally的博客 阅读(231) 评论(0) 推荐(0) 编辑
摘要: http://codeforces.com/gym/100623/attachments A题 题意:有n个球(0~n-1)先放在A个盒子(0~A-1)里面,然后将(0~n-1)放在B个盒子(0~B-1),问abs(A盒子所在位置-B盒子所在位置)的和是多少? 思路:现将小球分成两部分(1.k个A与 阅读全文
posted @ 2017-04-09 19:02 Wally的博客 阅读(143) 评论(0) 推荐(0) 编辑
摘要: https://vjudge.net/contest/156696 这是2014年多校5的比赛重新开了一遍 A题 题意:给你长度为n的序列,问让你进行最多k次相邻的数之间交换之后序列的最小逆序数是多少 思路:先求当前数的最小逆序数num,然后num-k即为最后的结果。由于n挺大的直接进行计算的话时间 阅读全文
posted @ 2017-04-04 12:00 Wally的博客 阅读(149) 评论(0) 推荐(0) 编辑
摘要: Anton likes permutations, especially he likes to permute their elements. Note that a permutation of n elements is a sequence of numbers {a1, a2, ...,  阅读全文
posted @ 2017-04-03 18:00 Wally的博客 阅读(255) 评论(0) 推荐(0) 编辑
摘要: As you probably know, Anton goes to school. One of the school subjects that Anton studies is Bracketology. On the Bracketology lessons students usuall 阅读全文
posted @ 2017-04-03 15:16 Wally的博客 阅读(156) 评论(0) 推荐(1) 编辑
摘要: http://codeforces.com/gym/100623/attachments A题 B题 题意:给你一个长度为w有h个单位宽的广告牌,然后给你长度为 wi 的一个单位宽的广告,问第 i 个最低能放在哪个单位上,如果不存在打印-1. 思路:一道线段树的问题,套用线段树模板就能很简单的解答了 阅读全文
posted @ 2017-04-02 19:46 Wally的博客 阅读(204) 评论(0) 推荐(0) 编辑
摘要: C. Anton and Fairy Tale time limit per test 1 second memory limit per test 256 megabytes input standard input output standard output Anton likes to li 阅读全文
posted @ 2017-03-30 17:20 Wally的博客 阅读(127) 评论(0) 推荐(0) 编辑
摘要: http://codeforces.com/gym/101196/attachments A题 B题 题意:一群人玩桌上足球(>4人),分成黑白两队,每队有进攻和防守两名玩家,如果有一方失败则失败方的防守坐到等候席的结尾、进攻被流放到防守区再上来一个人作为进攻方。而胜利方则是攻防对换。问上场时间最长 阅读全文
posted @ 2017-03-30 17:09 Wally的博客 阅读(146) 评论(0) 推荐(0) 编辑
摘要: http://codeforces.com/contest/785/problem/A 一个简单的加法题,但是当你是用的是cin输入时时间是483ms而scanf时间被压缩到62ms cin版 scanf版 阅读全文
posted @ 2017-03-26 20:48 Wally的博客 阅读(473) 评论(0) 推荐(0) 编辑
摘要: https://vjudge.net/contest/154390#problem A题 题意:给你27个字符分别有I L E三种组成,问你是否能组组成3*3*3的一整块? 思路:可以发现当字符为 I 和 L时它的下一个块的位置固定,当字符是 L 时他有四个方向,所以利用深搜去搜索出是否可能组成。 阅读全文
posted @ 2017-03-23 17:33 Wally的博客 阅读(129) 评论(0) 推荐(0) 编辑
摘要: http://codeforces.com/gym/101246 A题 B题 思路:简单模拟,对每一块砖判断它的前后左右是否比它高,如果比他高,它本身为0,否则它是他们的差值和。如果这块砖存在,就加上它的上下两个面。 1 #include <iostream> 2 #include<cstdio> 阅读全文
posted @ 2017-03-15 20:42 Wally的博客 阅读(105) 评论(0) 推荐(0) 编辑
摘要: http://codeforces.com/gym/101243 A题 思路:一条鱼有两面,所以当N<=K时间是2倍的单位时间。否则的话应该是N*2/k向上取整。 1 #include <iostream> 2 #include <cstdio> 3 #include <cstring> 4 usi 阅读全文
posted @ 2017-03-11 19:35 Wally的博客 阅读(236) 评论(0) 推荐(0) 编辑
摘要: Little Nastya has a hobby, she likes to remove some letters from word, to obtain another word. But it turns out to be pretty hard for her, because she 阅读全文
posted @ 2017-03-06 20:35 Wally的博客 阅读(234) 评论(0) 推荐(0) 编辑
摘要: Problem Description M斐波那契数列F[n]是一种整数数列,它的定义如下:F[0] = aF[1] = bF[n] = F[n-1] * F[n-2] ( n > 1 )现在给出a, b, n,你能求出F[n]的值吗? Input 输入包含多组测试数据;每组数据占一行,包含3个整数 阅读全文
posted @ 2017-03-06 20:22 Wally的博客 阅读(182) 评论(0) 推荐(0) 编辑
摘要: Description The cows play the child's game of hopscotch in a non-traditional way. Instead of a linear set of numbered boxes into which to hop, the cow 阅读全文
posted @ 2016-12-22 21:10 Wally的博客 阅读(228) 评论(0) 推荐(0) 编辑
摘要: Description FJ and his cows enjoy playing a mental game. They write down the numbers from 1 to N (1 <= N <= 10) in a certain order and then sum adjace 阅读全文
posted @ 2016-12-22 21:01 Wally的博客 阅读(154) 评论(0) 推荐(0) 编辑
摘要: Description Given a number of distinct decimal digits, you can form one integer by choosing a non-empty subset of these digits and writing them in som 阅读全文
posted @ 2016-12-22 20:55 Wally的博客 阅读(181) 评论(0) 推荐(0) 编辑
摘要: There is a rectangular room, covered with square tiles. Each tile is colored either red or black. A man is standing on a black tile. From a tile, he c 阅读全文
posted @ 2016-12-22 20:41 Wally的博客 阅读(112) 评论(0) 推荐(0) 编辑
摘要: There are n employees in Alternative Cake Manufacturing (ACM). They are now voting on some very important question and the leading world media are try 阅读全文
posted @ 2016-12-22 20:32 Wally的博客 阅读(199) 评论(0) 推荐(0) 编辑
摘要: Kim is a college student who love computer games, but unfortunately his school just published a rule that Games should disappear in the campus , that  阅读全文
posted @ 2016-12-14 11:18 Wally的博客 阅读(166) 评论(0) 推荐(0) 编辑