مسابقات جهاني برنامه نويسي دانشجويي (acm)فقط در اين تاپيك
سلام به نظرم حيفه يه همچين مسابقاتي رو تو اين انجمن ناديده بگيريم.
مسابقات بين المللي دانشجويي برنامه نويسي كه مركز ميزبانيش تو ايران دانشگاه شريف هست هر ساله تو يه جايي از جهان برگزار ميشه
براي اطلاع از برنامه اين مسابقات رجوع كنيد به:
کد:
http://sharif.edu/~acmicpc/acmicpc07/
و
کد:
http://icpc.baylor.edu/icpc/
دوستان علاقه مند به برنامه نويسي بيان كمك كنن اين تاپيك رو پر بار كنيم تا پي سي ورلد هم مطلبي از ACM International Collegiate Programming Contest تو آرشيوش داشته باشه.
براي شروع سوال A سي و دومين دوره مسابقات رو كه تو شريف برگزار شد رو خودم مي زارم:
يكي از مهمترين اتفاقات در برزيل ليگ Brasilerio است كه تو اون هر تيمي طي يه بازي رفت و برگشت با بقيه تيما مسابقه ميده.برد سه امتياز ، تساوي يك امتياز و باخت بدون امتيازه.
فرض كنيم كه n تيم در اين مسابقات شركت كرده باشن.بعد از اتمام مسابقات به هر تيم رتبه اي بين 1 تا n بر اساس امتياز اون تيم داده ميشه.رتبه هر تيم كه امتيازش p است برابره با تعداد تيمايي كه بيشتر از p امتياز آوردن بعلاوه يك.شايد بيش از يك تيم يك رتبه بيارن.
علاوه بر رتبه بندي به تيم حيرت آور هم در صورت وجود يه جايزه داده ميشه.
تيم حيرت آور تيميه كه :
- مطلقا بيشترين تعداد برد رو داشته باشه.(منظور از مطلقا اينه كه تيم ديگه اي اون تعداد برد نداشته باشه)
- مطلقا بيشترين تعداد گل زده رو داشته باشه.
- مطلقا كمترين تعداد گل خورده رو داشته باشه.
سوال:بدترين رتبه يه تيم حيرت آور چيه؟
صورت كامل سوال:
کد:
Problem A. WonderTeam
The Brasileiro League is the most important event in Brazil. There are n football teams participating in the competitions, each team plays twice (home and away) against each other team. Each team receives three points for a win and one point for a draw. No point is awarded for a loss.
When the games are finished, teams are ranked by numbers from 1 to n according to the total points. The rank of each team t having p points is one plus the number of teams having more than p points. It is possible that more than one team have the same ranks.
In addition to the Champion (the 1st ranked team or teams), the WonderTeam is also awarded, if there exists one. The team that has absolutely the highest number of wins (absolutely means no other teams has the same number of wins), absolutely the highest number of goals scored, and absolutely the lowest number of goals conceded, is called the WonderTeam. (WonderTeam should have all these properties.)
Your task is to find out the worst possible rank for the WonderTeam.
Input (Standard Input)
There are multiple test cases in the input. Each test case consists of only one line containing n (1 ≤ n ≤ 50), the number of teams in league. The input terminates with a line containing 0.
Output (Standard Output)
For each test case, write a single line containing the worst possible rank for the WonderTeam.
پي دي اف كامل سوالات اين دوره
32nd ACM International Collegiate Programming Contest 9th Asian Regional Contest in Iran
December 6-7 2007 (Azar 15-16, 1386)
کد:
http://sharif.edu/~acmicpc/07/Problems07.pdf