2014年ACM-ICPC亚洲区域赛(牡丹江站)网络赛舞弊处理汇总表
2014年全国MPAcc案例大赛参考范例

评分批次:2014年中国MPAcc学生案例大赛MPACC大赛名称:初赛第一阶段团队编号:767标题:Krispy Kreme Doughnuts,Inc. 案例分析关键词与摘要:摘要:针对KKD公司上市后股价暴涨到2004年暴跌的现象,本报告通过对其经营和财务状况加以分析,解释KKD市值降低的表面原因。
在深层次问题上,通过对KKD公司激进的特许经营权会计处理过程的研究,推测其以“出售—回购”的方式进行盈余管理和报表粉饰。
同时,在公司的经营战略上以PEST 分析方法描述KKD所处宏观环境,并结合space分析方法确认其进攻型发展战略是正确的,但是实施存在问题,最后得出 KKD公司经营状况不佳的原因是盲目扩张、内部控制存在问题。
关键词:特许经营权,盈余管理,经营战略,内部控制正文:1 KKD公司市值降低原因分析根据华尔街日报的资料,KKD将特许经营商所付的利息记为利息收入,以此提高利润,将特许权回购的成本记为无形资产,并且不予摊销。
本文认为KKD公司特许经营权的激进会计处理被曝光只是一根导火索,人们被这一消息惊醒,开始思考KKD公司是不是值得这么高的股价。
对于KKD公司市值降低的原因本文将从经营状况入手分析。
如图1.1所示,KKD公司自上市以来业绩一直稳步增长。
公司净利润从1999年的600万美元上升到2003的5700万美元,但是在2004年,公司亏损却高达1.57亿美元,同时2005年也巨亏1.35亿,槽糕的财务业绩让投资者对公司的发展彻底丧失了信心,纷纷抛售股票,直接造成了股价的暴跌。
图 1.1 KKD公司销售收入与净利润变化图资料来源:公司年报公司为什么会在2004年和2005年发生如此大规模的亏损呢?首先,营业收入的下降是降低公司盈利的主要原因。
从图1.1我们可以看出,公司2004年会计年度营业收入只增加了6%,同比增速已经开始放缓,而2005年公司销售收入大降24%,2006年更是进一步降低。
ACMICPC竞赛常见问题解答

A:在系统中,为管理资源,对每个程序的输出数量是有限制的。出现这种情况,一般都是因为程序中错误地出现了死循环,不断输出一些错误结果。
Q:Wrong Answer(结果错)是什么含义?
A:这是一种最常见的错误,也就是说明你的程序的计算出的结果不对。如果你在本地测试正确,则要注意到判决时所使用的可能是各种符合要求的数据,需要考虑你的算法是否考虑到了所有情况。
A:这说明你的程序在服务器上出现编译错误,请查看详细信息确定错误的具体内容。并请检查提交时是否选择了正确的语言。
Q:Runtime Error(运行错)是什么含义?
A:这说明你的程序在运行期间出现了某些错误。常见的错误包括:除零错误,数组越界,指针指向的单元不存在等。还有一种可能就是在C/C++中,main函数的返回值不是0。
Q:Time Over(超时)是什么含义?
A:每一个题目都有一个最大运行时间的要求(在试题中明确标出),如果你的程序的运行时间超过这个要求,将被强制停止,并返回这个错误。这种情况可能是由于程序中错误地出现了死循环,也可能是因为你的算法不够优化,这就需要重新设计算法和数据结构。
Q:Output Too Much(输出过多)是什么含义?
int j;
for (j=0; j<10; j++){…}
j=10;
Q:C/C++中,如下的错误信息是什么含义?
the `gets' function is dangerous and should not be used
A:gets函数作为一个危险的函数,可以造成系统的漏洞,因此不建议使用。如果要读取一行字符,可以使用cin.getline();
ACM/ICPC亚洲区预选赛命题经验谈

ACM/ICPC亚洲区预选赛命题经验谈摘要:ACM国际大学生程序设计竞赛,是世界上规模和影响力最大的大学生程序设计竞赛。
从2008年至2010年,笔者依托北京大学,先后承担了国内4次亚洲区预选赛的命题工作,积累了一定经验,也有一些教训,写出来与大家分享,希望对兄弟院校今后的命题工作,以及ACM/ICPC选手和教练们有参考价值。
关键词:ACM/ICPC;亚洲区预选赛;题目;数据;算法1ACM/ICPC的题目形式、赛制及中国区命题的现状ACM国际大学生程序设计竞赛(ACM International Collegiate Programming Contest,简称ACM/ICPC)是全球规模最大,最有影响力的大学生程序设计竞赛,它始于1970年,到2010年为止已经举办了35届。
ACM/ICPC的形式是三名队员在5小时内用一台电脑编程解决8~12道题。
每道题由英文题目描述(题面)、标准输入数据和标准输出数据三部分组成。
英文题面中包含很小一部分输入数据及其对应的输出数据,以作为Sample(样例)。
参赛者须根据题目描述编写程序,该程序读入标准输入数据,其输出必须和标准输出数据完全一致,而且要在题目规定的时限内(通常是两三秒,超过10秒的极少)算出结果,才算通过该题。
完整的标准输入数据和标准输出数据选手们是看不到的,选手的程序提交到裁判的机器上,裁判以标准输入数据作为输入运行其程序,然后取得该程序输出结果和标准输出数据进行比对,以判断该程序是否通过。
必要时也会用人工来比对输出结果。
比赛最终以通过题目的数量多少来决定名次,过题数相同的,以做题速度区分高下。
例如,著名的“A+B Problem”,题目就是:输入两个数,请输出他们的和。
标准输入数据是成对的数,标准输出数据是每对数的和。
当然,真实的竞赛是不会有这么简单的题目,这里只是用它来说明题目的形式而已。
ACM/ICPC的竞赛题,都是需要编程解决的问题。
我校代表队荣获第38届国际大学生ACM-ICPC亚洲区域赛

我校代表队勇夺第38届国际大学生ACM-ICPC亚洲区域赛杭州邀请赛银奖6月2日,从第38届国际大学生ACM-ICPC程序设计竞赛亚洲区域赛杭州邀请赛组委会传来喜讯:我校派出的YQZ代表队取得队伍排名29名、学校排名21名的好成绩,并荣获本次大赛银奖。
本次比赛在浙江工业大学举行,共有来自浙江大学、复旦大学、南京大学、中南大学、吉林大学、国防科技大学等64所高校的133支队伍参赛。
我校ACM代表队在杨玉军老师带领指导下,由计算机工程系学生余威、朱家和、卿继权三位同学组成的YQZ代表队经过激烈拼搏,一路过关斩将,终于获得大赛银奖。
这是我校继2010年首次参加ACM-ICPC亚洲区域赛现场赛以来第4次获得亚洲区域赛奖项,也是自参赛以来取得的最好成绩,实现历史性突破。
ACM国际大学生程序设计竞赛(简称ACM-ICPC)是全球大学生计算机程序设计能力竞赛活动中最有影响的一项赛事。
该项竞赛创立于1970年,由美国计算机协会(ACM)主办,旨在展示大学生创新能力、团队精神和在压力下编写程序、分析和解决问题能力。
目前这一竞赛已发展成为每年一届、多国参加、全世界最具影响力的大学生计算机竞赛,被誉为计算机界的“奥林匹克”,是培养与选拔全球计算机科学顶尖学生的重要方式之一。
同时每届比赛时,选手们都会受到IT业知名企业的关注。
如果能在亚洲赛区获得铜奖以上,就业更有竞争力,以往很多选手去了Google、华为、百度、微软、腾讯等IT领军企业。
宝剑锋从磨砺出,梅花香自苦寒来。
参赛队员的优异成绩的获得是学校领导和老师高度重视和大力支持的结果,更是他们平时不畏艰苦、努力钻研的结果。
我校计算机工程系为了提高学生的实践与创新能力,以ACM大学生程序设计竞赛为平台,通过选用优秀教师组成教练队伍、以科学的方法组建参赛队伍、安排集训、参加网络和高校邀请赛、购置专用书籍及设备等有力措施,积极探索教学课程的改革。
2009年创建怀化学院ACM实训训练基地,为学生提供了较好的竞赛训练环境。
acm-icpc-neerc-southern-2014

Problem A.Nasta RabbaraSasha justfinished watching yet another season of the infamous TV series“Nasta Rabbara”,the best show in Berland.The action takes place in a city called Nasta Rabbara that has a population of n people.In the beginning of the season,all residents of the city were friendly to each other and lived in peace.But as the season developed,people would start getting angry at each other.Specifically,in each of m series, one pair of people quarreled.Note that a pair of people may have quarreled several times throughout the season.Obviously,Sasha is quite concerned about the situation in Nasta Rabbara.He picked q segments of the season and now wants to analyze them.For convenience,the segments are numbered with integers from 1to q.The i-th segment contains episodes from the l i-th to the r i-th,inclusively.Note that the different segments may overlap,i.e.have common episodes.When analyzing a given segment,Sasha watches all its episodes and decides which people are good and which are bad(only taking into account the episodes that belong to the segment).Sasha believes that during the segment,good guys should never quarrel with each other,as well as bad guys should never quarrel with each other.I.e.he would accept only a quarrel between a good and a bad guy.Though, sometimes the storyline of a segment can become very complicated,so it’s not even possible to classify all characters as either good or bad.Your task is to help Sasha understand the situation in Nasta Rabbara.For each segment of the season, Sasha needs to determine whether there exists a way to classify all its people as either good or bad,so that:•no two good guys quarreled over this segment of the season;•no two bad guys quarreled over this segment of the season.InputThefirst line contains three space-separated integers n,m and q(2≤n≤105;1≤m,q≤105), denoting the number of people,the number of episodes,and the number of segments Sasha is interested in correspondingly.The i-th of the next m lines contains a pair of space-separated integers x i,y i(1≤x i<y i≤n),denoting that in the i-th episode person x i and person y i quarrel with each other.Assume that all characters of the season are numbered by consecutive integers from1to n.The j-th of the next q lines contains a pair of space-separated integers l j,r j(1≤l j≤r j≤m),denoting the boundaries of the j-th segment.OutputPrint q lines.In the j-th line print the word“Possible”if there is a way to classify people as either good or bad considering only the episodes from the l j-th to the r j-th inclusive.If there is no such a way,print the word“Impossible”.All words should be printed without quotes.Examplesstandard input standard output436 12 23 13 11 22 33 12 23 13Possible Possible Possible Possible Possible Impossible456 12 23 13 14 12 11 12 13 24 25 15Possible Possible Impossible Possible Impossible ImpossibleNoteIn thefirst example the answer is“Possible”for all segments,except for the segment that forms a quarrel triangle between people1,2and3.Problem B.Colored BlanketsRecently Polycarp has opened a blankets store and he faced with many challenges.He has got k blankets.A blanket has two sides,each of k blankets has at most one colored side.So either both sides are uncolored or one side is colored and the other one is not.If a side is colored,one of n possible colors is used.It is known that k is divisible by n.Polycarp wants to color all uncolored sides in such a way that:•each blanket will have both sides colored(one color per side),the colors can be the same or different, all the used colors are from n possible colors;•it will be possible to compose n kits with kn blankets in each kit that blankets in each kit areidentically colored.It is allowed to turn over blankets to determine that they are identically colored:for example,red-blue and blue-red blankets are identically colored.Blankets in different kits can be identically colored.InputThefirst line contains two integer numbers k and n(1≤n≤k≤1000)—number of blankets and colors. It is guaranteed that k is divisible by n.The second line contains a sequence of integers c1,c2,...,c k (1≤c i≤n or c i=−1),where c i stands for the color of the colored side of the i-th blanket or−1if it is uncolored.OutputIf there is no solution for the problem,print“No”in thefirst line.Otherwise print a line containing“Yes”and k lines describing each blanket.The i-th line should contain a pair of colors(integers in the range 1,2,...,n)used for the i-th blanket.You may print colors in pairs in any order.If there are multiple solutions,print any of them.Examplesstandard input standard output621122-12Yes 12 21 22 22 21 22844-11-143-1-1Yes 41 21 21 31 14 31 41 41Problem ponent TreeThis problem is a little bit unusual.Here you are to write a program to process queries in online mode. That means that your program will be allowed to read a query only after writing answer for the previous query.Please be sure to use the streamflushing operation after each query’s output in order not to leave part of your output in some buffer.For example,inС++you’ve got to use the fflush(stdout)function, in Java—call System.out.flush(),and in Pascal—flush(output).Imagine a complex application that consists of n components(the application itself is not essential in this problem,so we omit its description).All components form a tree-like hierarchy:each component except one(let’s call this special component a main component)is contained in exactly one other component (let’s call it a parent component).For the sake of convenience,let’s assume that the components are numbered with integers from1to n with the main component having the number1.Each component has a set of properties associated with it.Each property is given in the form“KEY=VALUE”. All property keys within a single component are distinct.You are given the component tree together with all properties.Your task is to handle several queries for finding the property of a component.Each query is given as a pair(c,key),which means that you have tofind the value of the property key for the component number c.To answer the query,you have to follow this algorithm:1.If the value of the property is defined for the component c,report this value as an answer.Otherwise,go to step2.2.If the component number c is not main,continue search in the parent component(set c equal tothe number of parent component)and go to the step1.Otherwise,the value of the property is not defined and considered to be“N/A”.InputThefirst line of the input contains an integer n(1≤n≤3·105)—the number of components.Then the input contains the descriptions of components1,2,...,n.Each description starts with a line containing two space-separated integers p i and k i(0≤p i≤n,k i≥0)—the number of parent component and the number of properties.For thefirst component p i is equal to 0.Each of the following k i lines contains a single property in the form KEY=VALUE,where both KEY and VALUE are strings of Latin letters and digits with length between1and10characters each.All keys for a given component are distinct.The keys are case-sensitive,so,for example,properties with keys“Length”and“length”are considered distinct.The values are also case-sensitive.The next line contains an integer q(1≤q≤3·105)—the number of queries you have to answer.Each of the following q lines contains an integer c j(1≤c j≤n)and a string key j,separated by a single space, where key j is a string of Latin letters and digits with length between1and10characters.Note that for each query,starting from the second,you will be able to read it only when you print the answer for the previous query and make aflush operation.It is guaranteed that the total number of properties does not exceed3·105.OutputFor each query,print a line with the value of the required property.You should make aflush operation after each line.Examplesstandard input standard output402enabled=true foreground=white 12enabled=false fontSize=1223enabled=true foreground=black caption=OK21fontSize=1053enabled4enabled3fontSize4foreground2caption true false 12 white N/A102width=300 height=500 21width1Width 300 N/AProblem D.Data CenterThe startup“Booble”has shown explosive growth and now it needs a new data center with the capacity of m petabytes.Booble can buy servers,there are n servers available for purchase:they have equal price but different capacities.The i-th server can store a i petabytes of data.Also they have different energy consumption—some servers are low voltage and other servers are not.Booble wants to buy the minimum number of servers with the total capacity of at least m petabytes.If there are many ways to do it Booble wants to choose a way to maximize the number of low voltage servers. Booble doesn’t care about exact total capacity,the only requirement is to make it at least m petabytes. InputThefirst line contains two integer numbers n and m(1≤n≤2·105,1≤m≤2·1015)—the number of servers and the required total capacity.The following n lines describe the servers,one server per line.The i-th line contains two integers a i,l i (1≤a i≤1010,0≤l i≤1),where a i is the capacity,l i=1if server is low voltage and l i=0in the opposite case.It is guaranteed that the sum of all a i is at least m.OutputPrint two integers r and w on thefirst line—the minimum number of servers needed to satisfy the capacity requirement and maximum number of low voltage servers that can be bought in an optimal r servers set.Print on the second line r distinct integers between1and n—the indices of servers to buy.You may print the indices in any order.If there are many solutions,print any of them.Examplesstandard input standard output410 31 70 51 4121 42313 61 61 6133 123NoteIn thefirst example any pair of servers which includes the server2is a correct output.Problem E.Election of a MayorThe Berland capital is preparing for mayoral election.There are two candidates for the position:the current mayor and his rival.The rival is a serious competitor,and it’s not easy for current mayor to win the election.The candidate will be declared the winner if he wins at more than a half of all polling stations.The results of the polling stations are supplied independently.The station winner is the candidate who gets more than a half of the votes of this station.No candidate is declared a winner of a polling station if both candidates have got the same number of votes at this station.Similarly,no candidate is declared a winner of the election if both candidates won at the same number of polling stations.All eligible voters are going to take part in the election and have already decided whom to give their vote to.The campaign headquarters of the current mayor has collected data from all n stations of the city, and now for every station it is known how many people will vote for the current mayor and how many people will vote for his opponent.The results have been disappointing for the current mayor,but his staffcame up with a way to win the election.It was suggested to merge some pairs of polling stations in such a way that the current mayor will become the election winner.However,(for the sake of credibility),the proposed plan must comply with two conditions.Firstly,it is possible to merge only the pairs of stations with adjacent numbers(i.e., station j may be merged with either station j−1,or with station j+1).The resulting station cannot be merged again.Secondly,the number of such mergers for obvious reasons must be as few as possible. Your task is to help the current mayor’s campaign headquarters and produce such plan.InputThefirst line contains single integer n(2≤n≤2·105)—the number of the polling stations.Each of the following n lines contains two integers m j and r j(0≤m j,r j≤105)—the number of voters at station j who plan to vote for the current mayor and his rival correspondingly.OutputIf current mayor cannot win the election at any condition,print a single number−1to thefirst line. Otherwise,to thefirst line print an integer u—the minimum number of polling station mergers the current mayor needs to perform in order to win.To each of the next u lines print a pair of integers—the numbers of the merged stations.The pairs as well as the numbers within each pair can be printed in any order.If there are multiple solutions,print any of them.Examplesstandard input standard output7 158 810 1414 1213 1312 2110 20302 12 6721551-12109157Problem F.Ilya MurometsСилачомслывунедаром—семерыходнимударом!From the Russian cartoon on the Germanfairy tale. Ilya Muromets is a legendary bogatyr.Right now he is struggling against Zmej Gorynych,a dragon with n heads numbered from1to n from left to right.Making one sweep of sword Ilya Muromets can cut at most k contiguous heads of Zmej Gorynych. Thereafter heads collapse getting rid of empty space between heads.So in a moment before the second sweep all the heads form a contiguous sequence again.As we all know,dragons can breathefire.And so does Zmej Gorynych.Each his head has afirepower. Thefirepower of the i-th head is f i.Ilya Muromets has time for at most two sword sweeps.The bogatyr wants to reduce dragon’sfirepower as much as possible.What is the maximum totalfirepower of heads which Ilya can cut with at most two sword sweeps?InputThefirst line contains a pair of integer numbers n and k(1≤n,k≤2·105)—the number of Gorynych’s heads and the maximum number of heads Ilya can cut with a single sword sweep.The second line contains the sequence of integer numbers f1,f2,...,f n(1≤f i≤2000),where f i is thefirepower of the i-th head. OutputPrint the required maximum total headfirepower that Ilya can cut.Examplesstandard input standard output2082133123111100410010203040Problem G.FacePalm AccountingAn owner of a small company FacePalm has recently learned that the city authorities plan to offer to small businesses to participate in improving parks and garden squares.However,credible sources informed the FacePalm owner that the loss-making companies will not get such an offer.Moreover,the sources have also told how loss-making companies will be determined.A company will be considered loss-making if for every k contiguous days the total income of the company is negative.The FacePalm owner discussed the situation with his chief accountant,and they decided to change the report so that the company would look loss-making.The company report for n days can be represented as a sequence of integers a1,a2,...,a n,where a i is the company income in the day i(negative values correspond to losses).The accountant can change any values in this sequence,but no updated value can become less than the smallest value in the original report—otherwise the updated report will look absolutely implausible. Besides,the accountant wants the total change of the values to be as small as possible.We will assume that the total change of the values isn∑i=1|˜a i−a i|,where˜a i is the i-th value in the updatedreport.Your task is to calculate the minimum required total change of the values and provide the updated report. InputThefirst line contains integers n and k(1≤k≤n≤2·105)—the number of days in the report and the number of days in the definition of loss-making company.The second line contains n space-separated integers a1,a2,...,a n(−10000≤a i≤10000),where a i is the company income in day i.It is guaranteed that at least one value of a i is negative.OutputIn thefirst line print the required minimum total change.In the second line print the corresponding updated report.No value in the updated report can be less than the minimum value of the original report.If there are multiple solutions,print any of them.Examplesstandard input standard output543-3-11212-3-1128321-3-24-302311-3-22-30242-21-210-21-2133-561012-5-59Problem H.Minimal Agapov CodeTriangulation is a decomposition of a polygon into a set of triangles that the triangle vertices are in the vertices of the polygon.The triangles in a triangulation can’t have internal common points,and they should cover all the polygon.It is easy to see that triangulation of n-gon always consists of n−2triangles. You are given a regular polygon with n vertices.The vertices are labeled with integer numbers.Agapov code of its triangulation is constructed as follows:•write a code for each triangle:a sequence of labels of a triangle vertices in non-decreasing order;•concatenate all triangle codes in such order that the resulting sequence is lexicographically minimal.A sequence a=⟨a1,a2,...,a m⟩is lexicographically less than b=⟨b1,b2,...,b m⟩if there is such index i (1≤i≤m)that a i<b i and a j=b j for all j(1≤j<i).Triangle codes are written in triangles,the Agapov code is⟨4,4,5,4,4,8,4,5,5,4,5,6,4,5,8,5,6,8⟩.Given a labeled regular polygon write a program tofind the triangulation with lexicographically minimal Agapov code.InputThefirst line contains integer n(3≤n≤5·105).The second line contains n space-separated integers: c1,c2,...,c n(1≤c i≤n),where c i denotes the label on the i-th vertex.Vertices are indexed clockwise. OutputPrint n−2lines describing the required triangulation,one line per triangle.In each line print three integers:indices of triangle vertices in order of non-decreasing of their labels.Lines should be ordered in such a way that concatenation of triangle codes in order of output will give the required lexicographically minimal Agapov code.If there are multiple solutions,print any of them.Examplesstandard input standard output858648485461 645 681 413 687 132Problem I.Sale in GameStoreA well-known Berland online games store has announced a great sale!Buy any game today,and you can download more games for free!The only constraint is that the total price of the games downloaded for free can’t exceed the price of the bought game.When Polycarp found out about the sale,he remembered that his friends promised him to cover any single purchase in GameStore.They presented their promise as a gift for Polycarp’s birthday.There are n games in GameStore,the price of the i-th game is p i.What is the maximum number of games Polycarp can get today,if his friends agree to cover the expenses for any single purchase in GameStore?InputThefirst line of the input contains a single integer number n(1≤n≤2000)—the number of games in GameStore.The second line contains n integer numbers p1,p2,...,p n(1≤p i≤105),where p i is the price of the i-th game.OutputPrint the maximum number of games Polycarp can get today.Examplesstandard input standard output35531562277NoteIn thefirst example Polycarp can buy any game of price5or6and download games of prices1and3for free.So he can get at most3games.In the second example Polycarp can buy any game and download the other one for free.Problem J.Getting Ready for VIPCEulampius is preparing himself to the Very Important Programming Contest(VIPC).There is a lot of time before the contest,and Eulampius hopes to make headway in his problem solving skills.Eulampius decided to train by taking part in practice contests.He made a list of n contests that will take place before VIPC.Each contest in the list is characterized by three parameters:the day d i of the contest, the minimum skill l i required to take part in the contest and the maximum skill h i that the participant can reach after taking part in the contest.The participant skill becomes equal to h i if he starts taking part in the contest when he’s fully rested. If his fatigue equals t by the beginning of the contest,then the participant skill becomes equal to h i−t after the contest,even if h i−t is negative or less than his skill before the contest.Participating in a contest takes much energy,that’s why Eulampius can take part in at most one contest during a day.Participating in a contest increases Eulampius’fatigue by∆t(same for all contests). Each day Eulampius doesn’t participate in any contest,his fatigue t becomes equal to⌊t/2⌋(divided by two rounded down).Initially,Eulampius’skill is s,and his fatigue t equals zero.Your task is to determine the maximum skill Eulampius can reach before VIPC,no matter what his fatigue will be.InputThefirst line contains three integers n,s,∆t(1≤n≤2·105,0≤s≤106,0≤∆t≤104)—the number of contests,Eulampius’initial skill,the amount of fatigue added after a contest.Each of the next n lines contains three integers d i,l i,h i(1≤d i≤106,0≤l i<h i≤106)—the day of the i-th contest,the minimum skill needed to take part in the i-th contest and the maximum skill that can be reached after taking part in the i-th contest.The contests are ordered by their dates,so d i≤d i+1(i=1,2,...,n−1).OutputIn thefirst line print two integers c and m—the maximum skill Eulampius can reach and the number of contests he needs to take part in.In the second line print m space-separated integers—the indices of the contests in the order of participation.The contests are indexed starting from1in order of their appearance in the input.If there are multiple solutions,print any of them.Examplesstandard input standard output6123 5822 62243 74065 84065 1063100 116297964 1246453 1510 2515 31546 41042432 23456 1510 2515 31546 41042412 14NoteIn thefirst example the maximum skill that Eulampius can reach is96:1.Eulampius’initial skill is12and his fatigue is0.2.On the day5he participates in thefirst contest.Now his skill is22−0=22and his fatigue is0+3=3.3.On the day6he participates in the second contest.Now his skill is43−3=40and his fatigue is3+3=6.4.On the day7he does not participate in any contest.His skill is still40and his fatigue is⌊62⌋=3.5.On the day8he participates in the fourth contest.Now his skill is65−3=62and his fatigue is3+3=6.6.On the day9he does not participate in any contest.His skill is still62and his fatigue is⌊62⌋=3.7.On the day10he does not participate in any contest.His skill is still62and his fatigue is⌊32⌋=1.8.On the day11he participates in the sixth contest.Now his skill is97−1=96and his fatigue is1+3=4.Problem K.TreelandTreeland is an ancient country located on the territory of the modern Berland many many years ago.It is a well-known fact that Treeland consisted of n cities connected with n−1bidirectional roads.It was possible to travel from any city to any other one along the roads.The cities were numbered from1to n.Nowadays we do not know what cities were connected by roads directly,but recently archaeologists have found new information that can help to reconstruct the road network of Treeland.They found an ancient library with the diaries of a well-known traveler Biklouho-Baclay.The diaries contain interesting information:for each city i there is a list of all cities in the order of non-decreasing distance from i.The distances are calculated assuming that each road has length1,so a distance between cities is the minimum number of roads to travel between them.Formally,for each city i there is a list C i=⟨c i,1,c i,2,...,c i,n⟩containing a permutation of cities(numbers from1to n)in such order that d(i,c i,j)≤d(i,c i,j+1)for every j=1...n−1,where d(x,y)is a distance between cities x and y.Obviously,c i,1=i for each i.The cities that are equidistant from i can be listed in any order.Your task is to restore a possible road network consistent with the found lists.InputThe input consists of several test cases.Thefirst line contains integer number t(1≤t≤1000)—the number of test cases.Then t blocks follow,each describing a single test case.Thefirst line of a block contains integer number n(2≤n≤2000)—the number of cities.The following n lines contain lists C i,one list per line.It is guaranteed that the required road network exists for each test case.The sum of n over all test cases doesn’t exceed2000.OutputFor each test case print n−1lines describing roads.Each line should contain a pair of cities connected with a road.You may print the roads and cities in a pair in any order.Print a blank line after the output of a test case.If there are many solutions,print any of them.Examplesstandard input standard output321221514532 23415 34251 43152 54312 3132 213 3122123 34 54 4121 31Problem eful RoadsBerland capital contains n junctions and m roads connecting pairs of junctions.All roads are one-way. As you probably know Berland has two misfortunes:fools and roads.It is one month before mayoral election.So it is time for current government to make the city better. To show that they care both about the infrastructure and about the budget,the government decided to repair only useful roads.Current mayor thinks that a road from a junction u to a junction v is useful if there exists a simple path from City Hall to some junction containing the road(u,v).A path is called simple if it does not have any repeated junctions,i.e.contains each junction at most once.The City Hall is located at the junction1. Help Ministry of Road Transport and Highways tofind all useful roads in the city.InputThe input contains several test cases.Each test case starts with a line containing two integers n,m (2≤n≤2·105;1≤m≤2·105)—the number of junctions and the number of roads in the city.The following m lines contain road descriptions,one description per line.A description consists of a pair of space-separated integers u i,v i(1≤u i,v i≤n;u i=v i)meaning that the i-th road leads from the junction u i to the junction v i.The junctions are numbered from1to n.The City Hall is located at the junction1.It is guaranteed that there is at most one road between a pair of junctions in each direction.There is a blank line after each test case.The sum of n over all test cases in the input doesn’t exceed 2·105.The same is true for m:the sum of m over all test cases in the input doesn’t exceed2·105. OutputPrint two lines for each test case.On thefirst line print the number of useful roads.The second line should contain the indices of useful roads in ascending order.The roads are indexed from1to m in order of appearance in the input.Leave the second line empty if there are no useful roads in the city. Examplesstandard input standard output57 12 52 23 34 45 24 42 21 12513456 11Problem M.Variable ShadowingIn computer programming,variable shadowing occurs when a variable declared within a certain scope has the same name as a variable declared in an outer scope.The outer variable is said to be shadowed by the inner variable,and this can lead to a confusion.If multiple outer scopes contain variables with the same name,the variable in the nearest scope will be shadowed.Formally,a declared variable shadows another declared variable if the following conditions are met simultaneously:•the other variable is declared in outer scope and before(in terms of position in program source code)the declaration of thefirst variable,•the other variable is nearest among all variables satisfying the condition above.Here is an example containing exactly one variable shadowing:/*Prints a+max(b,c)*/int main(){int a,b,c;cin>>a>>b>>c;if(b>c){int a=b;//<--variable’a’shadows outer’a’int x=c;b=x;c=a;}int x=a+c;//<--no shadowing herecout<<x<<endl;}Variable shadowing is permitted in many modern programming languages including C++,but compilers can warn a programmer about variable shadowing to avoid possible mistakes in a code.Consider a trivial programming language that consists only of scopes and variable declarations.The program consists of lines,each line contains only characters‘{’,‘}’,‘a’...‘z’separated by one or more spaces.•Scopes.A scope(excluding global)is bounded with a pair of matching curly brackets‘{’and‘}’.A scope is an inner scope relative to another scope if brackets of thefirst scope are enclosed bybrackets of the second scope.•Variables.A variable declaration in this language is written just as a name of the variable.In addition all variables are lowercase Latin letters from‘a’to‘z’inclusive(so there are at most26 variable names).A variable is declared in each scope at most once.Given a syntactically correct program(i.e.curly brackets form a regular bracket sequence),write an analyzer to warn about each fact of variable shadowing.Warnings should include exact positions of shadowing and shadowed variables.Your output should follow the format shown in the examples below. InputThefirst line contains integer n(1≤n≤50)—the number of lines in the program.The following n lines contain the program.Each program line consists of tokens‘{’,‘}’,‘a’...‘z’separated by one or more spaces.The length of each line is between1and50characters.Each program line contains at least one non-space character.。
2014年国际赛交卷安排

time period(min)
left lane
interior lane
right lane
average speed
traffic flow
average speed
traffic flow
overtaking
average speed
traffic flow
2.各参赛队在发送论文后请将论文Pdf版和word版通过QQ上传,由指导老师按照组别安排光盘刻录,具体由闫龙和安芹力负责。
3.论文纸质版邮寄由王唯良和郑明发负责。
4.提交完论文后,各参赛队须协助教员做好善后工作方可离开,具体由赵学军、梁放驰和高大化负责。
5.请所有指导教员协助学员完成论文修改和提交工作,各参赛队在论文提交前必须经过指导教员同意。
2014年国际赛论文提交工作安排
组别
参赛队控制号
邮箱
负责人
第
一
组
30067,30068,30070,30072
liangfangchimcm@
梁放驰
30049,30065
libingjiemcm@
30074
yinzhonghaimcm@
第
二
组
30123,30125
1th
103.34
28
85.2
4
11
62.17
12
12
2th
111.72
8
93.92
22
13
60.75
11
9
3th
80.17
32
95.91
5
9
65.73
16
2014年ACM-ICPC亚洲区域赛(牡丹江站)网络赛舞弊处理汇总表

①: POJ 1724 BFS部分
队员A:/mypsq/article/details/38339749
(1)当时比赛的时候余老师自己在场监督;
(2) 代码相似队伍的队员曾经是共同合作很久的队员,代码风格原本就较为相似;
(3)代码并非完全雷同,以风格相似为主;
我觉得这次可以接受南京理工的申辩。
接受申述,正常排名。
黑龙江大学
我是黑龙江大学的教练徐辉,关于被查出的牡丹江赛区及西安赛区网络比赛代码相似问题十分抱歉,给我们的评判工作带来了很大的麻烦。我现在把具体情况和各位解释一下,希望大家谅解。
队员B: /u011483306?viewmode=contents
郑州轻工业学院 李晔
2014/9/16 15:36
驳回申述,执行2014版纪律第八条(一)款,全校队伍解题数减一。
南京理工大学
杨文君老师:
房鸣老师:
王灿老师:
您们好!您们辛苦了!
对于我校学生涉嫌舞弊,如果查实,我们也会进行严肃处理!
对于实验室队员的这种心理作为教练深表歉意,下次比赛我一定竭力避免类似情况的发生。毕竟acmicpc倡导的就是一个公平竞争的氛围,我们没一个参与这都会尽自己最大努力维护它的公正性!
主要是账号和密码没管理好,造成的,希望你们不要取消我们的名额。
东北林业大学 陈宇
2014/9/16 15:17
认错态度好,同意给予一次现场赛机会。但若后三场网络赛再现舞弊,则本机会自动失去。
中南大学ACM校队教练陈再良
CCF NOI2014获奖名单

674
徐先友
王鉴浩
浙江
男
绍兴市第一中学
高二
650
董烨华 陈合力
袁宇韬
湖南
男
长沙市南雅中学
初三
626
汪星明
陈牧歌
浙江
男
杭州第二中学
高二
604
裘鑫
陈思禹
浙江
男
杭州第二中学
高一
589
冯俊杰
刘剑成
湖南
男
长沙市雅礼中学
高二
576
屈运华
林锦坤
福建
男
福建省泉州市第七中学
高二
565
谢水英
余岳
江苏
男
南京师范大学附属中学
福建省厦门双十中学
高一
541
曾艺卿
银牌
姓名
省份
性别
学校
年级
总分
奖牌
钟惠兴
广东
男
佛山市南海区石门中学
高一
540
江涛
秋闻达
上海
男
上海市南洋模范中学
高二
539
王松赞
任路遥
浙江
男
浙江省杭州学军中学
高二
539
徐先友
郑桦
广东
男
中山市中山纪念中学
高二
533
宋新波
张蒲石
北京
男
北京师范大学附属实验中学
高二
532
韩冬兵
高二
465
查成林
余行江
湖南
男
湖南省长沙市长郡中学
高二
464
向期中
李佳蔚
山东
女
东营市胜利第一中学
- 1、下载文档前请自行甄别文档内容的完整性,平台不提供额外的编辑、内容补充、找答案等附加服务。
- 2、"仅部分预览"的文档,不可在线预览部分如存在完整性等问题,可反馈申请退款(可完整预览的文档不适用该条件!)。
- 3、如文档侵犯您的权益,请联系客服反馈,我们会尽快为您处理(人工客服工作时间:9:00-18:30)。
队员B:/u011483306/article/details/38367251
②:sgu176 BFS部分
队员A : /mypsq/article/details/38491301
队员B: /u011483306/article/details/38534427
队员B: /u011483306/article/details/38383151
以下是两位队员的博客链接,其中会有很多相似的代码和思路,所以在比赛中出现这种情况实属正常。
希望裁判组核查,谢谢
队员A: /mypsq?viewmode=contents
可以想象,我校参加牡丹江赛站的可能性比较大,因此绝对没有作弊的必要。此外,作为黑龙江省和东北地区的ACM/ICPC的主要参与高校和中国赛区的积极参与者,我也深知有责任维护ACM/ICPC的公平性,使这项活动能够持久健康地发展。
在赛前,我就告诉学生要认真对待比赛,在比赛期间,要严格遵守比赛纪律,尊敬出题学校与出题人,绝不允许拷贝或参考队友的代码,但还是出现一些问题。我会对学生加强管理,认真拜读“网络赛纪律条例-2014”,杜绝此类事情再次发生。
对于给各位教练带来的麻烦,再次表示歉意。
此致
黑龙江大学 徐辉
13704818254
2014/9/16 18:14
认错态度好,同意给予一次现场赛机会。但若后三场网络赛再现舞弊,则本机会自动失去。
北华大学
各位老师:
由于近段时间有病在医院住院,把竞赛管理交给了一个研究生学生,刚刚知道我校的学生给网络赛造成了一定的麻烦,而且找各种理由进行狡辩,作为一个老教练我对我校在这件事的表现深深的表示道歉。其实这次出现的问题我占主要错误,对账号疏于管理,下次我们学校保证不在出现这样的问题。再次表示道歉,希望各位老师能不取消我们西安赛区的参赛名额,谢谢各位。等小鲁病好后,到赛区给大家当面道歉。 北华大学 鲁静轩
4.值得一提的是,SauceCode的当事人之前学过一些Pascal,很喜欢使用Pascal的输入输出,所以所有的代码都会插入类Pascal输入输出的模板,在程序中也使用read(n)类似的语句进行输入输出,这个是个人偏好,应当足以成为此队员主写代码的证据吧(见SauceCode关于C题的所有提交)。
1.两条记录相隔如此长的时间,如果我们是要作弊一定不会如此耽误时间的,而且C题代码并不麻烦,我们两个队伍的队员也都准备了很多模板,像并查集这种简单模板也都是有的,写代码速度就算重新写一遍也不见得慢。
2.据SauceCode队伍的当事人描述,自己的代码完全是自己和队友所完成。因为之前两次WA的提交(见提交记录),当事人考虑到可能是自己的代码或者模板有什么难以发现的问题,于是使用队友的并查集模板和思路重新大改了一遍。后来当事人又尝试修改自己的代码,发现是出题人给出的数据不规范而自己没有考虑不规范数据的可能性而导致自己的多次WA(见4172之后SauceCode当事人关于C题的两次提交),这个我们后来询问比赛时的Admin,得到的答复竟然是“出题人故意而为”(见Clarification),当然我们并不认为比赛的时候需要这样来卡程序。如果不是这个问题,我们的队员也不会去重写代码,而这个代码却不知为何被认定为作弊嫌疑。
2014年ACM-ICPC亚洲区域赛(牡丹江站)网络赛舞弊处理汇总表
学校
教练申述意见
回复时间
出题方复合意见
最终处理意见
黑龙江科技大学
房老师您好:
我是黑龙江科技大学的教练,经过我与学生核实,得知,在牡丹江赛区网络赛中,我校一支队伍确实拷贝了另一支队伍的代码,学生因为想拿到好成绩,却忘记了公平,公正,诚实守信的比赛规则,我已经对相关学生进行了批评教育。在此,我们深感歉意!!
因为平常的做题训练,这两人基本都是一起学习,思路和代码会有相同,这点可以用之前的练习的记录说明,其中两人BFS部分的代码也都是基本一样的。以下附有两人博客题解的链接和截图。
①: POJ 1724 BFS部分
队员A:/mypsq/article/details/38339749
(1)当时比赛的时候余老师自己在场监督;
(2) 代码相似队伍的队员曾经是共同合作很久的队员,代码风格原本就较为相似;
(3)代码并非完全雷同,以风格相似为主;
我觉得这次可以接受南京理工的申辩。
接受申述,正常排名。
黑龙江大学
我是黑龙江大学的教练徐辉,关于被查出的牡丹江赛区及西安赛区网络比赛代码相似问题十分抱歉,给我们的评判工作带来了很大的麻烦。我现在把具体情况和各位解释一下,希望大家谅解。
2014/9/16 18:38
账号管理疏漏所致,认错态度好,同意给予一次现场赛机会。但若后三场网络赛再现舞弊,则本机会自动失去。
中南大学
您们好。
我校ACM校队接到作弊通告时,配合积极展开调查。调查发现,一名13级新晋队员私自利用公布在中南大学校队QQ群中的帐号和密码查看校内其他队的代码进行作弊。
作弊队员已经严肃处理。校内教练和队员们都非常重视这件事,经过校队负责人和教练开会最后决定,将该名作弊队员从中南大学ACM校队中开除。
我们学校ACM程序设计处于刚刚起步阶段,现在acm队里只有一只种子队伍能力还可以,在进行网络比赛的时候,该队队员为了争取出钱名额,就用了两个账号进行答题,其中一个账号多次提交有系统罚时,另外一个账号就是把自己a过的题目重新提交一下,这样该账号就没有罚时。
这样对于其他只用一个账号答题的队员来说确实不公平,但是这些题目都是出自一组队员的手里,并没有抄袭其他学校其他队员的代码,希望各位教练体谅一下我们这个小学校想参加比赛的难处,给予谅解,我们保证下次网络赛一个队伍只用一个账号进行答题。
③:poj1679
队员A: /mypsq/article/details/38562571
队员B: /u011483306/article/details/38563647
④:HDU 4862
队员A; /mypsq/article/details/38303535
因为他的作弊行为属于个人行为,并没有其他队员或者队伍参与,只是发放帐号密码的时候是在校队群里公布,所以才导致其有机可乘,之后会严格按照规则参加比赛,每支队伍的帐号密码也会单独发给各个队长。
因为该队作弊,复制的代码都是其他队伍提前通过的,其中H题的代码也是中南大学校内第一的队伍早在三个小时之前通过的,所以,中南大学校内排名第一的队伍的成绩还是没有水分的,希望组委会宽大处理。
对于实验室队员的这种心理作为教练深表歉意,下次比赛我一定竭力避免类似情况的发生。毕竟acmicpc倡导的就是一个公平竞争的氛围,我们没一个参与这都会尽自己最大努力维护它的公正性!
主要是账号和密码没管理好,造成的,希ቤተ መጻሕፍቲ ባይዱ你们不要取消我们的名额。
东北林业大学 陈宇
2014/9/16 15:17
认错态度好,同意给予一次现场赛机会。但若后三场网络赛再现舞弊,则本机会自动失去。
赛后表格显示牡丹江赛区J题代码有雷同嫌疑,为RunID1417 与 Run ID 2739 ,其中HEU1 为晋级号。而HEU8这个账号是大二新队员的练习账号,所以才会有多次的交题行为。网络赛当天,一名新队员正是用team392(HEU8)做题,Run ID 2739是她交的。在做J题的过程中,她与队友的思路不同,并希望找出她的代码问题。由于是在同一实验室做题,受到部分启发,导致代码相似嫌疑,但是绝对没有拷贝代码的行为。通过比较两者的代码,发现其差别还是比较明显的。
2014/9/16 9:21
认错态度好,同意给予一次现场赛机会。但若后三场网络赛再现舞弊,则本机会自动失去。
中国海洋大学
杨老师,您好!
作弊名单有关中国海洋大学和烟台大学校际作弊的问题,调查清楚,是我校账号管理不严,在QQ群粘贴,被烟台大学的同学看到,利用我们的账号密码查看了代码,并进行了提交,烟台大学已经承认相关事实。再说我们的成绩排名远远超过他们学校,没有必要抄他们的代码,他们学校排名很低帮他们做一个题目也不能晋级,从作案动机上也不存在。
中南大学ACM校队教练陈再良
2014/9/16 20:30
账号管理疏漏所致,认错态度好,但若后三场网络赛再现舞弊,则本机会自动失去。
哈尔滨工程大学
王老师、房老师、杨老师:
您们好!
首先,对此次网络赛中我校参赛队员被查出有作弊嫌疑而导致组委会工作量的增加,表示深深的歉意。其次,在看到网上的情况通报后,我向我校集训队的负责学生以及部分队员进行了了解,做说明如下。
我第一时间盘问了学生,他们应该没有作弊。
附件是有关我校涉嫌作弊的申诉,还希望能够明察,还我校以声誉!
望保持沟通! 在证据的认定上我们会全力协助。
希望在大家的共同努力下,使ACM/ICPC的竞赛风清气正。
南京理工大学 余立功
2014/9/16 17:29
房老师:
今天上午我和南京理工的余立功老师讨论了这个事情,我觉得基于以下几点考虑:
所以恳请组委会考虑以上事实,去除我校作弊嫌疑。
2014/9/16 12:37
账号管理疏漏所致,认错态度好,同意给予一次现场赛机会。但若后三场网络赛再现舞弊,则本机会自动失去。
南开大学
南开大学关于(2801,4172)涉嫌作弊嫌疑的申诉