• 博客园logo
  • 会员
  • 周边
  • 新闻
  • 博问
  • 闪存
  • 众包
  • 赞助商
  • Chat2DB
    • 搜索
      所有博客
    • 搜索
      当前博客
  • 写随笔 我的博客 短消息 简洁模式
    用户头像
    我的博客 我的园子 账号设置 会员中心 简洁模式 ... 退出登录
    注册 登录
HaibaraAi
博客园    首页    新随笔    联系   管理    订阅  订阅
11 2013 档案
Codeforce Round #216 Div2 C

摘要:C. Valera and Electionstime limit per test1 secondmemory limit per test256 megabytesThe city Valera lives in is going to hold elections to the city Parliament.The city has n districts and n - 1 bidirectional roads. We know that from any district there is a path along the roads to any other district. 阅读全文
posted @ 2013-11-30 22:59 HaibaraAi 阅读(107) 评论(0) 推荐(0)
Codeforce Round #216 Div2 B

摘要:B. Valera and Contesttime limit per test1 secondmemory limit per test256 megabytesValera loves to participate in competitions. Especially in programming contests. Today he has participated in the contest with his team, consisting of n students (including Valera). This contest was an individual compe 阅读全文
posted @ 2013-11-30 12:26 HaibaraAi 阅读(124) 评论(0) 推荐(0)
Codeforce Round #216 Div2 A

摘要:A. Valera and Platestime limit per test1 secondmemory limit per test256 megabytesValera is a lazy student. He has m clean bowls and k clean plates.Valera has made an eating plan for the next n days. As Valera is lazy, he will eat exactly one dish per day. At that, in order to eat a dish, he needs ex 阅读全文
posted @ 2013-11-30 12:24 HaibaraAi 阅读(140) 评论(0) 推荐(0)
HNU 1447 最长上升路径

摘要:最长上升路径Time Limit: 3 SecMemory Limit: 128 MB Submissions: 103Solved: 15Description给定n个顶点m条边的有向图,每一条边上都有一个正整数权值。一条有向路径被称为上升路径当且仅当除了路径上第一条边外,每一条表上的权值都严格大于路径上前一条边的权值。路径长度定义为路径所包含的边数,求给定图中最长上升路径长度。Input第一行是测试数据组数k。接下来是k组测试数据。每组数据开始为n(n 2 #include 3 #include 4 #include 5 #include 6 #include 7 #includ... 阅读全文
posted @ 2013-11-27 18:33 HaibaraAi 阅读(348) 评论(0) 推荐(0)
Codeforce Round #215 Div2 C

摘要:C. Sereja and Algorithmtime limit per test1 secondmemory limit per test256 megabytes这道题没出来真的是自己,啊改了一点就没管了,结果xx也可以的哎- -,当时也用种情况交过,去掉特判后又忘记加t 2 #include 3 #include 4 #include 5 #include 6 #include 7 #include 8 #include 9 #include 10 #include 11 #include 12 13 using namespace std;14 #define INF ... 阅读全文
posted @ 2013-11-27 03:33 HaibaraAi 阅读(144) 评论(0) 推荐(0)
Codeforce Round #215 Div2 B

摘要:B. Sereja and Suffixestime limit per test1 secondmemory limit per test256 megabytesSereja has an array a, consisting of n integers a1, a2, ..., an. The boy cannot sit and do nothing, he decided to study an array. Sereja took a piece of paper and wrote out m integers l1, l2, ..., lm (1 ≤ li ≤ n). For 阅读全文
posted @ 2013-11-27 01:46 HaibaraAi 阅读(109) 评论(0) 推荐(0)
Codeforce Round #215 Div2 A

摘要:A. Sereja and Coat Racktime limit per test1 secondmemory limit per test256 megabytesSereja owns a restaurant for n people. The restaurant hall has a coat rack with n hooks. Each restaurant visitor can use a hook to hang his clothes on it. Using the i-th hook costs ai rubles. Only one person can hang 阅读全文
posted @ 2013-11-27 01:44 HaibaraAi 阅读(162) 评论(0) 推荐(0)
Codeforce Round #214 Div2 C

摘要:C. Dima and Saladtime limit per test1 secondmemory limit per test256 megabytes等效于一个背包问题,其实不难,可是。。。a[i]为价值a[i]-k*b[i]为容量!Dima, Inna and Seryozha have gathered in a room. That's right, someone's got to go. To cheer Seryozha up and inspire him to have a walk, Inna decided to cook something.Dima 阅读全文
posted @ 2013-11-26 21:03 HaibaraAi 阅读(165) 评论(0) 推荐(0)
HNUST 压缩编码

摘要:问题 D: Zeros and Ones时间限制: 1 Sec内存限制: 128 MB 提交: 43解决: 18 [提交][状态][讨论版]题目描述Consider strings of characters made up by concatenating any number of the strings 0, 01 or 11.For example 00011111 is one such string, as is 001011, but 1011 is not.Your job is simply to determine if a given string can be cons 阅读全文
posted @ 2013-11-25 11:52 HaibaraAi 阅读(152) 评论(0) 推荐(0)
HNUST 塔防游戏

摘要:问题 G: 塔防游戏时间限制: 1 Sec内存限制: 128 MB 提交: 37解决: 17 [提交][状态][讨论版]题目描述小明最近迷上了塔防游戏,塔防游戏的规则就是在地图上建炮塔,用于防御敌军的进攻。这里我们假设地图是一个n行m列的格子,每个炮塔只能建在格子里,这里的炮塔有点奇怪,因为它只能攻击它自己所在行和所在列的格子(包括自身),并且每两个塔既不能放在同一列也不能放在同一行;现在小明建好了cnt个塔,小明一看这cnt个塔的攻击范围刚好把地图割成了S个炮塔攻击不到的区域,因为区域太多了,小明没法数,小明想知道答案S是多少,你能帮助他吗?输入有多组测试数据;每组测试数据的格式如下:第一行 阅读全文
posted @ 2013-11-25 11:42 HaibaraAi 阅读(169) 评论(0) 推荐(0)
Codeforce Round #214 Div2 B

摘要:B. Dima and To-do Listtime limit per test 1 secondmemory limit per test256 megabytesYou helped Dima to have a great weekend, but it's time to work. Naturally, Dima, as all other men who have girlfriends, does everything wrong.Inna and Dima are now in one room. Inna tells Dima off for everything 阅读全文
posted @ 2013-11-25 11:23 HaibaraAi 阅读(111) 评论(0) 推荐(0)
Codeforce Round #214 Div2 A

摘要:A. Dima and Guardstime limit per test1 secondmemory limit per test256 megabytesNothing has changed since the last round. Dima and Inna still love each other and want to be together. They've made a deal with Seryozha and now they need to make a deal with the dorm guards...There are four guardpost 阅读全文
posted @ 2013-11-25 03:12 HaibaraAi 阅读(141) 评论(0) 推荐(0)
2013 Asia Changsha Regional Contest A

摘要:Alice's Print ServiceTime Limit: 2 Seconds Memory Limit: 65536 KBAlice is providing print service, while the pricing doesn't seem to be reasonable, so people using her print service found some tricks to save money.For example, the price when printing less than 100 pages is 20 cents per page, 阅读全文
posted @ 2013-11-24 14:28 HaibaraAi 阅读(80) 评论(0) 推荐(0)
尼玛,不知道啥板

摘要:1 /** Micro Mezzo Macro Flation -- Overheated Economy ., Last Update: Jan. 28th 2013 **/ //{ 2 3 /** Header .. **/ //{ 4 #define LOCAL 5 6 #include 7 #include 8 #include 9 #include 10 #include 11 #include 12 #include 13 #include 14 #include 15 #include 16 #inclu... 阅读全文
posted @ 2013-11-23 16:51 HaibaraAi 阅读(138) 评论(0) 推荐(0)
nbutoj 全名热身赛 F

摘要:[F] 分蛋糕 时间限制: 2000 ms 内存限制: 65535 K问题描述wcy, wsy, xth, zh, llz 和他们的朋友正在庆祝wcy的生日。他们一起买了一个非常大的生日蛋糕。他们把生日蛋糕分成了完全相同的m个部分,然后把他们放在了盘子(盘子是无差别的)里。Wcy很好奇,他想知道把m块蛋糕放在n个盘子里能有多少种方法。输入 输入数据第一行有两个整数n, m(1 ≤ n, m ≤ 4 500),分别表示盘子数和蛋糕块数。和输出 如果方案总数是K,仅输出K mod 1000000007之后的结果,因为可能会k很大。样例输入3 7样例输出8提示放7块蛋糕到3个盘子里共有8种方式,分别 阅读全文
posted @ 2013-11-23 02:04 HaibaraAi 阅读(246) 评论(0) 推荐(0)
Facebook 资格赛 A

摘要:Square Detector20 points Last valid submission at 12 minutes ago [details] Download Input File Time ExpiredYou want to write an image detection system that is able to recognize different geometric shapes. In the first version of the system you settled with just being able to detect filled squares .. 阅读全文
posted @ 2013-11-22 21:04 HaibaraAi 阅读(101) 评论(0) 推荐(0)
Topcoder SRM 597 div2 B

摘要:Problem Statement Little Elephant from the Zoo of Lviv likes strings. You are given a string A and a string B of the same length. In one turn Little Elephant can choose any character of A and move it t... 阅读全文
posted @ 2013-11-21 21:22 HaibaraAi 阅读(93) 评论(0) 推荐(0)
Topcoder SRM 597 div2 A

摘要:Problem Statement Little Elephant from the Zoo of Lviv likes integers. You are given an vector A. On a single turn, Little Elephant can double (i.e., multiply by 2) any element of A. He may double the ... 阅读全文
posted @ 2013-11-21 19:29 HaibaraAi 阅读(112) 评论(0) 推荐(0)
2013 Asia Chengdu Regional Contest F

摘要:Fibonacci TreeTime Limit: 4000/2000 MS (Java/Others)Memory Limit: 32768/32768 K (Java/Others) Total Submission(s): 266Accepted Submission(s): 82 Problem Description Coach Pang is interested in Fibonacci numbers while Uncle Yang wants him to do some research on Spanning Tree. So Coach Pang decides t. 阅读全文
posted @ 2013-11-21 14:08 HaibaraAi 阅读(160) 评论(0) 推荐(0)
2013 Asia Hangzhou Regional Contest I

摘要:Gems Fight!Time Limit: 20000/10000 MS (Java/Others)Memory Limit: 327680/327680 K (Java/Others) Total Submission(s): 555Accepted Submission(s): 233 Problem Description Alice and Bob are playing "Gems Fight!": There are Gems of G different colors , packed in B bags. Each bag has several Gems 阅读全文
posted @ 2013-11-20 17:21 HaibaraAi 阅读(108) 评论(0) 推荐(0)
Codeforce Round #213 Div2 C

摘要:C. Matrixtime limit per test 1 secondmemory limit per test 256 megabytesYou have a string of decimal digits s. Let's define bij = si·sj. Find in matrix b the number of such rectangles that the sum bij for all cells (i, j) that are the elements of the rectangle equals a in each rectangle.A r 阅读全文
posted @ 2013-11-20 12:09 HaibaraAi 阅读(165) 评论(0) 推荐(0)
Codeforce Round #213 Div2 B

摘要:B. The Fibonacci Segmenttime limit per test 1 secondmemory limit per test 256 megabytesYou have array a1, a2, ..., an. Segment [l, r] (1 ≤ l ≤ r ≤ n) is good if ai = ai - 1 + ai - 2, for all i (l + 2 ≤ i ≤ r).Let's define len([l, r]) = r - l + 1, len([l, r]) is the length of the segment [l, r]. 阅读全文
posted @ 2013-11-20 02:21 HaibaraAi 阅读(201) 评论(0) 推荐(0)
Codeforce Round #213 Div2 A

摘要:A. Good Numbertime limit per test 1 secondmemory limit per test 256 megabytesLet's call a number k-good if it contains all digits not exceeding k (0, ..., k). You've got a number k and an array a containing n numbers. Find out how many k-good numbers are in a (count each number every time it 阅读全文
posted @ 2013-11-20 02:19 HaibaraAi 阅读(205) 评论(0) 推荐(0)
FOJ 2013 11 月赛 F

摘要:Problem 2137 奇异字符串Accept: 33Submit: 149Time Limit: 1000 mSecMemory Limit : 32768 KB我就是个傻逼,虽然这题超时了,但我的时间真的向水一样的丢在上面!Problem Descriptionseen喜欢一种特殊的字符串,seen称这种字符串为奇异字符串。奇异字符串可以表示为AxA这种形式,A为一个任意非空字符串,只包含小写字母,x为一个不在A中出现过的小写字母。seen认为一个长度为d的奇异字符串的价值为d*d,不是奇异字符串的字符串没有价值。现给一个只包含小写字母的字符串,统计其所有子串的价值总和。一个字符串的子串 阅读全文
posted @ 2013-11-19 02:57 HaibaraAi 阅读(145) 评论(0) 推荐(0)
2013 Asia Chengdu Regional Contest J

摘要:Just RandomTime Limit: 2000/1000 MS (Java/Others)Memory Limit: 32768/32768 K (Java/Others) Total Submission(s): 0Accepted Submission(s): 0 Problem DescriptionCoach Pang and Uncle Yang both love numbers. Every morning they play a game with number together. In each game the following will be done: 1 阅读全文
posted @ 2013-11-16 22:14 HaibaraAi 阅读(116) 评论(0) 推荐(0)
2013 Asia Chengdu Regional Contest H

摘要:Hard Disk DriveTime Limit: 2000/1000 MS (Java/Others)Memory Limit: 32768/32768 K (Java/Others) Total Submission(s): 0Accepted Submission(s): 0 Problem DescriptionYesterday your dear cousin Coach Pang gave you a new 100MB hard disk drive (HDD) as a gift because you will get married next year. But y 阅读全文
posted @ 2013-11-16 17:23 HaibaraAi 阅读(116) 评论(0) 推荐(0)
Codeforce Round #212 Div2 C

摘要:C. Insertion Sorttime limit per test 2 secondsmemory limit per test 256 megabytesPetya is a beginner programmer. He has already mastered the basics of the C++ language and moved on to learning algorithms. The first algorithm he encountered was insertion sort. Petya has already written the code that 阅读全文
posted @ 2013-11-16 10:57 HaibaraAi 阅读(112) 评论(0) 推荐(0)
FOJ 2013 11 月赛 E

摘要:Problem E 取糖果Accept: 65Submit: 299 Time Limit: 1000 mSecMemory Limit : 32768 KBProblem Description有N个袋子放成一排,每个袋子里有一定数量的糖果,lzs会随机选择连续的几个袋子,然后拿走这些袋子中包含最多糖果的袋子。现问你,在选择x个袋子的情况下,lzs最坏情况下,也就是最少会拿到多少个糖果?对于x取值为1到n都分别输出答案。Input第一行一个整数T,表示有T组数据。每组数据先输入一行一个整数N(1 2 #include 3 using namespace std; 4 const int I. 阅读全文
posted @ 2013-11-15 12:13 HaibaraAi 阅读(127) 评论(0) 推荐(0)
Codeforce Round #212 Div2 B

摘要:B. Petya and Staircasestime limit per test 1 secondmemory limit per test 256 megabytesLittle boy Petya loves stairs very much. But he is bored from simple going up and down them — he loves jumping over several stairs at a time. As he stands on some stair, he can either jump to the next one or jump o 阅读全文
posted @ 2013-11-15 09:45 HaibaraAi 阅读(111) 评论(0) 推荐(0)
Codeforce Round #212 Div2 A

摘要:A. Two Semiknights Meettime limit per test 1 secondmemory limit per test 256 megabytes其实一个公式就可以了!A boy Petya loves chess very much. He even came up with a chess piece of his own, a semiknight. The semiknight can move in any of these four directions: 2 squares forward and 2 squares to the right, 2 sq 阅读全文
posted @ 2013-11-15 09:44 HaibaraAi 阅读(106) 评论(0) 推荐(0)
Codeforce Round #211 Div2 C

摘要:C. Fixing Typostime limit per test 1 secondmemory limit per test 256 megabytes妈蛋事后写,还只能写这么挫的代码!Many modern text editors automatically check the spelling of the user's text. Some editors even suggest how to correct typos.In this problem your task to implement a small functionality to correct two 阅读全文
posted @ 2013-11-13 15:38 HaibaraAi 阅读(166) 评论(0) 推荐(0)
Codeforce Round #210 Div2 C

摘要:C. Levko and Array Recoverytime limit per test 1 secondmemory limit per test 256 megabytesLevko loves array a1, a2, ... , an, consisting of integers, very much. That is why Levko is playing with array a, performing all sorts of operations with it. Each operation Levko performs is of one of two types 阅读全文
posted @ 2013-11-13 12:53 HaibaraAi 阅读(115) 评论(0) 推荐(0)
FOJ 2013 11 月赛 H

摘要:Problem 2139 久违的月赛之二Accept: 28Submit: 66 Time Limit: 1000 mSecMemory Limit : 32768 KBProblem Description好久没举办月赛了,这次lqw又给大家出了5道题,因为hsy学长宣传的很到位,吸引了n个DDMM们来做,另一位kk学长说,全做对的要给金奖,做对4题要给银奖,做对3题要给铜奖。统计数据的时候,发现每题分别在n个人中有n1、n2、n3、n4、n5个人通过,lqw问kk:“这次难度稍微提高了些,你再猜下,至少会有多少个人获奖?”Input第一行一个数字t,表示有多少组数据,每组数据如下所示(10 阅读全文
posted @ 2013-11-13 12:01 HaibaraAi 阅读(102) 评论(0) 推荐(0)
FOJ 2013 11 月赛 G

摘要:Problem 2138 久违的月赛之一Accept: 55Submit: 114 Time Limit: 1000 mSecMemory Limit : 32768 KBProblem Description好久没举月赛了,这次lqw给大家出了5道题,因为hsy学长宣传的很到位,吸引了n个DDMM们来做,另一位kk学长说,全做对的要给金奖,做对4题要给银奖,做对3题要给铜奖。统计数据的时候,发现每题分别在n个人中有n1、n2、n3、n4、n5个人通过,lqw灵机一动,问kk:“你猜,这次至少会有多少个人获奖?”由于题目太简单了,每题的通过人数一定大于等于最低获奖人数。Input第一行一个数字 阅读全文
posted @ 2013-11-13 12:00 HaibaraAi 阅读(114) 评论(0) 推荐(0)
Codeforce Round #211 Div2 B

摘要:B. Fencetime limit per test1 secondmemory limit per test256 megabytesinputstandard inputoutputstandard outputThere is a fence in front of Polycarpus's home. The fence consists of n planks of the same width which go one after another from left to right. The height of the i-th plank is hi meters, 阅读全文
posted @ 2013-11-11 18:35 HaibaraAi 阅读(177) 评论(0) 推荐(0)
Codeforce Round #211 Div2 A

摘要:A. Sorobantime limit per test 1 secondmemory limit per test 256 megabytesYou know that Japan is the country with almost the largest 'electronic devices per person' ratio. So you might be quite surprised to find out that the primary school in Japan teaches to count using a Soroban — an abacus 阅读全文
posted @ 2013-11-11 18:34 HaibaraAi 阅读(176) 评论(0) 推荐(0)
Codeforce Round #210 Div2 B

摘要:B. Levko and Permutationtime limit per test 1 secondmemory limit per test 256 megabytesLevko loves permutations very much. A permutation of length n is a sequence of distinct positive integers, each is at most n.Let’s assume that value gcd(a, b) shows the greatest common divisor of numbers a and b. 阅读全文
posted @ 2013-11-11 15:29 HaibaraAi 阅读(115) 评论(0) 推荐(0)
Codeforce Round #210 Div2 A

摘要:A. Levko and Tabletime limit per test 1 secondmemory limit per test 256 megabytesLevko loves tables that consist of n rows and n columns very much. He especially loves beautiful tables. A table is beautiful to Levko if the sum of elements in each row and column of the table equals k.Unfortunately, h 阅读全文
posted @ 2013-11-11 15:28 HaibaraAi 阅读(117) 评论(0) 推荐(0)
Warm up 17 A Millennium

摘要:MillenniumTime Limit: 30000ms, Special Time Limit:75000ms, Memory Limit:262144KBTotal submit users: 7, Accepted users: 7Problem 12787 : No special judgementProblem descriptionA wise king declared a new calendar. "Tomorrow shall be the first day of the calendar, that is, the day 1 of the month 1 阅读全文
posted @ 2013-11-11 15:26 HaibaraAi 阅读(167) 评论(0) 推荐(0)
Warm up 17 B Recurring Decimals

摘要:RecurringDecimalsTime Limit: 30000ms, Special Time Limit:75000ms, Memory Limit:262144KBTotal submit users: 7, Accepted users: 7Problem 12788 : No special judgementProblem descriptionA decimal representation of an integer can be transformed to another integer by rearranging the order of digits. Let . 阅读全文
posted @ 2013-11-11 15:25 HaibaraAi 阅读(178) 评论(0) 推荐(0)
2013 Asia Hangzhou Regional Contest B

摘要:Stealing Harry Potter's PreciousTime Limit: 2000/1000 MS (Java/Others)Memory Limit: 32768/32768 K (Java/Others) Total Submission(s): 135Accepted Submission(s): 72 Problem Description Harry Potter has some precious. For example, his invisible robe, his wand and his owl. When Hogwarts school is in 阅读全文
posted @ 2013-11-10 01:23 HaibaraAi 阅读(136) 评论(0) 推荐(0)
2013 Asia Hangzhou Regional Contest A

摘要:Lights Against DudelyTime Limit: 2000/1000 MS (Java/Others)Memory Limit: 32768/32768 K (Java/Others) Total Submission(s): 174Accepted Submission(s): 55 Problem DescriptionHarry: "But Hagrid. How am I going to pay for all of this? I haven't any money." Hagrid: "Well there's you 阅读全文
posted @ 2013-11-09 22:30 HaibaraAi 阅读(137) 评论(0) 推荐(0)
2013 Asia Hangzhou Regional Contest C

摘要:Zhuge Liang's PasswordTime Limit: 2000/1000 MS (Java/Others)Memory Limit: 32768/32768 K (Java/Others) Total Submission(s): 0Accepted Submission(s): 0 Problem Description In the ancient three kingdom period, Zhuge Liang was the most famous and smart military leader. His enemy was Sima Yi, the mil 阅读全文
posted @ 2013-11-09 17:17 HaibaraAi 阅读(88) 评论(0) 推荐(0)
C语言变长参数 转载

摘要:Tony Bai版权声明:转载时请以超链接形式标明文章原始出处和作者信息及本声明 http://www.blogbus.com/bigwhite-logs/20468193.html很多技术人员都有在"技术细节"上"钻牛角尖"的"癖好",对此很多人褒贬不一;无论怎样,我也是属于这类人。C语言的变长参数在平时做开发时很少会在自己设计的接口中用到,但我们最常用的接口printf就是使用的变长参数接口,在感受到printf强大的魅力的同时,是否想挖据一下到底printf是如何实现的呢?这里我们一起来挖掘一下C语言变长参数的奥秘。先考虑这样一 阅读全文
posted @ 2013-11-09 07:52 HaibaraAi 阅读(140) 评论(0) 推荐(0)
HNUST 压缩编码

摘要:问题 F: 压缩编码时间限制: 1 Sec内存限制: 2 MB 提交: 51解决: 22 [提交][状态][讨论版]题目描述 某工业监控设备不断发回采样数据。每个数据是一个整数(0到1000之间)。各个数据间用空白字符(空格,TAB或回车换行)分隔。 因为大多数时候,相邻的采样间隔数据是相同的,可以利用这个特征做数据的压缩存储。其方法是:对n(n>1)个连续相同的数字只记录n和该数字本身;对m(m>0)个连续不重复的数字,则记录 m*-1 和这些数字本身(之所以用负数,是为了与第一种情况区分,便于解压缩)。 例1: 假设采样数据为: 12 34 34 25 25 25 25 11 阅读全文
posted @ 2013-11-08 03:55 HaibaraAi 阅读(143) 评论(0) 推荐(0)
Warm up 16 Loopy transit

摘要:LoopytransitTime Limit: 10000ms, Special Time Limit:25000ms, Memory Limit:65536KBTotal submit users: 22, Accepted users: 20Problem 12781 : No special judgementProblem descriptionLuke likes to ride on public transit in different cities he visits, just for fun. He tries to find unique ways to travel in 阅读全文
posted @ 2013-11-07 17:18 HaibaraAi 阅读(116) 评论(0) 推荐(0)
Warm up 16 Texas Summers

摘要:TexasSummersTime Limit: 10000ms, Special Time Limit:25000ms, Memory Limit:65536KBTotal submit users: 17, Accepted users: 12Problem 12783 : No special judgementProblem description哎,算了这题就当自己对了吧,一直找不到错误,一直WA,真的很神奇!撸过的大牛你能找到?居然做这种事,当自己对了,我还有什么用额!Summer in Texas can be very hot. But Texans are tough, and 阅读全文
posted @ 2013-11-06 22:16 HaibaraAi 阅读(108) 评论(0) 推荐(0)
Codechef November Challenge 2013 Superpowers of 2

摘要:Superpowers of 2Problem code: SPOTWOSubmitMy SubmissionsAll SubmissionsRead problems statements in Mandarin Chinese and Russian.Cyael is a very gifted girl who loves Magic (she even reached the finals on a very famous tournament in Byteland ;) ) and Computer Science. As we know, CS is a very vast su 阅读全文
posted @ 2013-11-06 00:50 HaibaraAi 阅读(154) 评论(0) 推荐(0)
Codechef November Challenge 2013 Yet Another Cute Girl

摘要:Yet Another Cute GirlProblem code: PRETNUMSubmitMy SubmissionsAll SubmissionsRead problems statements in Mandarin Chinese and Russian.Chef doesn't love math anymore. He loves Sasha. Sashen'ka is cute.Chef goes on a date with her. Flowers are boring, while numbers are not. He knows that most 阅读全文
posted @ 2013-11-06 00:10 HaibaraAi 阅读(194) 评论(0) 推荐(0)
Warm up 16 Hitting the Targets

摘要:HittingtheTargetsTime Limit: 10000ms, Special Time Limit:25000ms, Memory Limit:65536KBTotal submit users: 38, Accepted users: 38Problem 12782 : No special judgementProblem description又是一道感人的输入方式的傻逼题啊!A fundamental operation in computational geometry is determining whether two objects touch. For exa. 阅读全文
posted @ 2013-11-04 03:12 HaibaraAi 阅读(231) 评论(0) 推荐(0)
Warm up 16 Ragged Right

摘要:RaggedRightTime Limit: 10000ms, Special Time Limit:25000ms, Memory Limit:65536KBTotal submit users: 38, Accepted users: 37Problem 12786 : No special judgementProblem description又是一道感人的出入方式的傻逼题啊!Word wrapping is the task of deciding how to break a paragraph of text into lines. For aesthetic reasons, 阅读全文
posted @ 2013-11-04 03:11 HaibaraAi 阅读(108) 评论(0) 推荐(0)
Warm up 16 Choosing Numbers

摘要:ChoosingNumbersTime Limit: 10000ms, Special Time Limit:25000ms, Memory Limit:65536KBTotal submit users: 43, Accepted users: 39Problem 12780 : No special judgementProblem description是这个argest,我TM左认右认都认不出来啊,你TM的去泰国做个手术看我能不能认出来!You regularly play a game with friends, and you’re tired of losing. The goa 阅读全文
posted @ 2013-11-04 03:05 HaibaraAi 阅读(215) 评论(0) 推荐(0)
Warm up 16 Quite a problem

摘要:QuiteaproblemTime Limit: 10000ms, Special Time Limit:25000ms, Memory Limit:65536KBTotal submit users: 45, Accepted users: 45Problem 12776 : No special judgementProblem description这个傻逼题,重判前就我一个人过真的是感人肺腑啊,居然可以是反的,出题人智商!It gets tiring, looking for all ways in which the word ‘problem’ can be used (and m 阅读全文
posted @ 2013-11-04 02:52 HaibaraAi 阅读(153) 评论(0) 推荐(0)
Warm up 16 Maze movement

摘要:MazemovementTime Limit: 10000ms, Special Time Limit:25000ms, Memory Limit:65536KBTotal submit users: 22, Accepted users: 22Problem 12785 : No special judgementProblem description谁能告诉我这么写init(),n这个全局变量为什么会自动变为0啊,真的是感人肺腑!Your boss gave you the task of creating a walking maze, and you are evaluating d. 阅读全文
posted @ 2013-11-04 02:49 HaibaraAi 阅读(134) 评论(0) 推荐(0)
Warm up 15 Innovative Business

摘要:InnovativeBusinessTime Limit: 10000ms, Special Time Limit:25000ms, Memory Limit:65536KBTotal submit users: 16, Accepted users: 12Problem 12774 : No special judgementProblem descriptionChip ’n’ Dale have started a new business in the forest: they produce tiles of fixed rectangular size and pave roads. 阅读全文
posted @ 2013-11-03 07:45 HaibaraAi 阅读(161) 评论(0) 推荐(0)
Warm up 15 Epic Fail of a Genie

摘要:EpicFailofaGenieTime Limit: 10000ms, Special Time Limit:25000ms, Memory Limit:65536KBTotal submit users: 44, Accepted users: 24Problem 12770 : Special judgeProblem descriptionAladdin had found a new shiny lamp and has started polishing it with his hands. Suddenly a mysterious genie appeared from wi. 阅读全文
posted @ 2013-11-02 18:46 HaibaraAi 阅读(221) 评论(0) 推荐(0)
Warm up 15 Cinderella

摘要:CinderellaTime Limit: 10000ms, Special Time Limit:25000ms, Memory Limit:65536KBTotal submit users: 56, Accepted users: 50Problem 12768 : No special judgementProblem descriptionCinderella is given a task by her Stepmother before she is allowed to go to the Ball. There are N (1 ≤ N ≤ 1000) bottles wi. 阅读全文
posted @ 2013-11-02 18:45 HaibaraAi 阅读(120) 评论(0) 推荐(0)
Codechef November Challenge 2013 Square Digit Squares

摘要:Square Digit SquaresProblem code: SDSQUARESubmitMy SubmissionsAll SubmissionsRead problems statements in Mandarin Chinese and Russian.Recently Chef become very much interested in perfect squares. We all know Chef and his weird interests. Anyways Chef will be soon writing his masters thesis on per... 阅读全文
posted @ 2013-11-02 11:50 HaibaraAi 阅读(160) 评论(0) 推荐(0)
Codechef November Challenge 2013 Missing some chairs

摘要:Missing some chairsProblem code: MCHAIRSSubmitMy SubmissionsAll SubmissionsRead problems statements in Mandarin Chinese and Russian.A new school in Byteland is now in the process of renewing some classrooms with new, stronger and better chairs, so that the students can stay still and pay attention t 阅读全文
posted @ 2013-11-01 22:59 HaibaraAi 阅读(111) 评论(0) 推荐(0)
Codechef November Challenge 2013 Uncle Johny

摘要:Uncle JohnyProblem code: JOHNYSubmitMy SubmissionsAll SubmissionsRead problems statements in Mandarin Chinese and Russian.Vlad enjoys listening to music. He lives in Sam's Town. A few days ago he had a birthday, so his parents gave him a gift: MP3-player! Vlad was the happiest man in the world! 阅读全文
posted @ 2013-11-01 22:51 HaibaraAi 阅读(483) 评论(0) 推荐(0)
SGU 109 Magic of David Copperfield II

摘要:109. Magic of David Copperfield IItime limit per test: 0.5 sec. memory limit per test: 4096 KBThe well-known magician David Copperfield loves lo show the following trick: a square with N rows and N columns of different pictures appears on a TV screen, Let us number all the pictures in the following 阅读全文
posted @ 2013-11-01 16:10 HaibaraAi 阅读(103) 评论(0) 推荐(0)
SGU 108 Self-numbers 2

摘要:108. Self-numbers 2time limit per test: 1 sec. memory limit per test: 4096 KBIn 1949 the Indian mathematician D.R. Kaprekar discovered a class of numbers called self-numbers. For any positive integer n, define d(n) to be n plus the sum of the digits of n. (The d stands for digitadition, a term coine 阅读全文
posted @ 2013-11-01 13:20 HaibaraAi 阅读(109) 评论(0) 推荐(0)
SGU 107 987654321 problem

摘要:107. 987654321 problemtime limit per test: 0.5 sec. memory limit per test: 4096 KBFor given number N you must output amount of N-digit numbers, such, that last digits of their square is equal to 987654321.InputInput contains integer number N (1 3 #include 4 #include 5 #include 6 #include 7 #incl... 阅读全文
posted @ 2013-11-01 07:42 HaibaraAi 阅读(163) 评论(0) 推荐(0)
SGU 106 The equation

摘要:106. The equationtime limit per test: 0.5 sec. memory limit per test: 4096 KB 对于等式ax+by=c,a,b,c皆为整数,c如果是gcd(a, b)的倍数,则方程有解,否则方程无解。(定理1)因为等式ax+by=gcd(a, b)必定有解(定理1),所以可以解出来,解法如下: 因为gcd(a, b) = gcd(b, a % b),所以有bx1+(a%b)y1=gcd(a,b),注意!此时x1并不等于x,y1也不等于y!这个过程可以循环(就想求最大公约数一样),将b视为新的a',a%b视为新的b',可 阅读全文
posted @ 2013-11-01 00:15 HaibaraAi 阅读(152) 评论(0) 推荐(0)

博客园  ©  2004-2026
浙公网安备 33010602011771号 浙ICP备2021040463号-3