-
A. Exam time limit per test 1 second memory limit per test 256 megabytes input standard input output standard output An exam for n students will take place in a long and narrow room, so the students will sit in a line in some order. The teacher suspects that students with adjacent numbers (i and i + 1) always studied …
Read More -
http://codeforces.com/problemset/problem/479/D 题意是说有一把尺子,本身有一些刻度,然后需要测量x和y,问最少需要添加多少个刻度,如果需要,这些刻度分别添加在什么位置。 一开始没有看清题目,以为答案最多为4,但是发现,a[1]=0 a[n]=l这两个是确定的,所以答案最多为2, 而不会出现中间有两个刻度,无论是往前刻还是往后都会越界的情况。 先去看看已知的刻度里有没有直接满足的。 除此之外,如果在已知的刻度下无法测量x也无法测量y,我们还可以找找是否能有公用点使得只刻一个刻度就可以满足题意。公用点分两种情况,一种是在两个刻度之间,另一种是在两个刻度的同侧。 前一种没什么坑,后一种要判断是 …
Read More -
http://codeforces.com/problemset/problem/525/B 题意是说一个字符串,进行m次颠倒变换(从a[i]位置到a[l-i+1]位置),问得到的字符串。容易发现,对于越在里边(对称,也就是越靠近中间位置)的字符,调换的次数越多。我们可以把a[i]从小到大排序。然后经过分析发现,把两个相邻的a[i]分为一组,做处理,如果m为奇数,最后还剩下a[m]没有被分组,要单独处理a[m]细节上要注意st数组是从st[0]开始的...好吧的确不方便,适牛也说我了。。数组下标以后还是从0开始吧。。。主要是受高中OI用的pascal的影响。。。那个数组下标随便啊。代码: 1 2 3 /* …
Read More -
C - C **Time Limit:**1000MS **Memory Limit:**262144KB 64bit IO Format:%I64d & %I64u Submit Status Description Permutation_p_ is an ordered set of integers _p_1, p_2, ..., p__n, consisting of n distinct positive integers not larger than n. We'll denote as_n the length of permutation _p_1, _p_2, ..., p__n. Your task …
Read More -
http://codeforces.com/problemset/problem/479/C 1/************************************************ 2Author :111qqz 3Created Time :2016年02月22日 星期一 23时31分10秒 4File Name :code/cf/problem/479C.cpp 5************************************************ */ 6 7#include <iostream>8#include <algorithm>9#include …
Read More -
FatMouse's Speed Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others) Total Submission(s): 10172 Accepted Submission(s): 4521 Special Judge Problem Description FatMouse believes that the fatter a mouse is, the faster it runs. To disprove this, you want to take the data on a collection of …
Read More -
Tickets **Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others) Total Submission(s): 1408 Accepted Submission(s): 687 ** Problem Description Jesus, what a great movie! Thousands of people are rushing to the cinema. However, this is really a tuff time for Joe who sells the film tickets. He is …
Read More -
免费馅饼 **Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others) Total Submission(s): 29065 Accepted Submission(s): 9921 ** Problem Description 都说天上不会掉馅饼,但有一天gameboy正走在回家的小径上,忽然天上掉下大把大把的馅饼。说来gameboy的人品实在是太好了,这馅饼别处都不掉,就掉落在他身旁的10米范围内。馅饼如果掉在了地上当然就不能吃了,所以gameboy马上卸下身上的背包去接。但由于小径两侧都不能站人,所以他只能在小径上接。由 …
Read More -
F - Piggy-Bank **Time Limit:**1000MS **Memory Limit:**32768KB 64bit IO Format:%I64d & %I64u Submit Status Description Before ACM can do anything, a budget must be prepared and the necessary financial support obtained. The main income for this action comes from Irreversibly Bound Money (IBM). The idea behind is …
Read More -
E - Super Jumping! Jumping! Jumping! **Time Limit:**1000MS **Memory Limit:**32768KB 64bit IO Format:%I64d & %I64u Submit Status Description Nowadays, a kind of chess game called "Super Jumping! Jumping! Jumping!" is very popular in HDU. Maybe you are a good boy, and know little about this game, so I …
Read More