1.基本規則
2.運行環境
3.注冊與登陸
4.界面簡介
5.練習
6.比賽
7.注意事項
TopCoder(以下簡寫tc) URL: http://www.topcoder.com
1.基本規則
tc的比賽規則歸結起來就是一句話:75分鐘做完3道難度遞增的題。
tc的每個用戶(handle)都有自己的積分,從0-3000+不等。成績越好,分數越高
。比賽分為兩個division。Div I和Div II。積分<1200或者unrated(即注冊但還沒
參加過比賽的)參加Div II,>=1200的參加Div I。Div I的題要比Div II難許多。
一般DivII的最后一題和Div I的第一或第二題是一樣的。無論是Div I或Div II。三
道題目的Score一般為250, 500和1000左右,視每次的難度略有浮動。個人積分
(rating)的增減是根據你和別人在比賽中的score以及你們原來的rating決定的。tc
的提交結合了ICPC和IOI的特點,即只能交一次,必須過所有數據并且得分與用時相
關。tc每周有一次Single Round Match(SRM),每年兩次大的比賽(有$)。
2.運行環境
tc的客戶端是一個java程序,所以需要jre( java runtime environment) 或者
jdk( java development kit) 來運行。如果平時不寫java程序的話,裝jre就可以了
。畢竟jdk比jre大一個數量級,下載慢。安裝照著提示完成就行了。推薦使用1.4.1
以后的版本,因為帶了java web start,可以快速登陸。具體方法下一部分講。
sun公司主頁上的jre-6u1-windows-i586-p.exe
3.注冊與登陸。
點主頁右上角的register注冊,過程沒什么好說的。
注冊好后就可以登陸了。有兩種方法:
a.點左側的Launch Arena Applet
點后彈出一個窗口,等一會后就出現一個Load Competition Arena的按紐。
點擊就運行了客戶端。注意不要把這個小窗口關掉,否則客戶端會一并關了
。這個方法在win2000下有時候會有問題,但是在98下是正常的。不推薦。
b.通過java web start運行
topcoder主頁底部有一欄如下:
---------------------------------------------------------------------
│ Java Web Start │
│ Run the Arena as a Java Web Start Application │
│ JWS already installed? Load the Arena as a Java Application │
│ Arena Plugins—Information and Downloads ~~~~~~~~~~~~~~~~這里 │
---------------------------------------------------------------------
把那個"Java Application"拖到桌面上建立一個快捷方式,以后雙擊就可
以直接運行了??蛻舳藛雍笥幸粋€窗口,填上申請的username和password
,如果是用代理的話,把HTTP Tunneling選上。登陸后就到了主頁面。
4.界面簡介
-----------------------------------------------------------------------
│ Advertisements............. │
-----------------------------------------------------------------------
│ Main │ Lobbies │ Options │ Practice Rooms │ Active Contests │ Help ││
-----------------------------------------------------------------------
│ │ Clock │ │
-----------------------------------------------------------------------
│ Rating Key │ Who's here │ Chat Area │
│ . │ │ │
│ . │ │ │
│ . │ │ │
│ . │ │ │
│ . │ │ │
│------------│ │ │
│ MESSAGES │ │ │
│------------│ │ │
│LEADER BOARD│ │ │
│------------│ │ │
│ │ │ │
│ │ │-------------------------------------------│
│ │ │ >>_______________________________________ │
-----------------------------------------------------------------------
(寬度太小,縮放了一下
逐部分說明一下:Advertisements: No comment.
Menus: Main里可以看在線名單和找人。
Lobbies基本用不著,因為用戶一般都在Chat Room 1
Options里是一些選項和顏色設置。
Practice Rooms里有大量的練習,都是以前比賽的題目
Active Contests只有有比賽的時候才有用。
Help里是....不用說了吧。
Rating Key: handle的顏色是隨著積分而改變的,這里顯示了
積分與顏色的關系。
MESSAGES: 比賽的時候這里有注冊提示和clarification。
LEADER BOARD: 看每個room的最高分。
Who's here: 當前room里的人。
Chat Area: 聊天。
5.練習
在Practice Rooms里隨便選擇一個room就可以進入practice了。
界面與主頁面稍有變化,但基本相同,略去不畫。主要的變化就是Who's
here分成了兩塊,多了一塊Who's assigned。這塊顯示的是誰被分到了這個room
。因為是練習區,所以只要是在這里打開過題的都算是assigned。而在正式比賽
中room是由tc分配的。這里顯示的是被分配到這個room的人。界面上還有一個變
化是Chat Area頂上多了三塊。最左邊的是一個下拉菜單。里面有三個分值,選擇
后就可以打開相應的題目。中間的summary可以看這個room里每個人的提交情況。
在practice room里只有coding phase。提交后要判的話需要自己選擇Practice
Options里的Run System Test。
6.比賽
每次比賽(除了1年兩次的大賽)都需要在賽前3小時-5分鐘之間登陸注冊方可
參加,注冊在Active Contest菜單的第一項。一般需要回答一道選擇題(多半是調
查)才能注冊。到剩下5分鐘的時候,注冊終止,tc開始按照報名者的rating分配
room。分配完成后,Active Contest菜單中Register一項變成Enter。選擇后可以
直接進入你被分配到的room。Active Contest菜單最下面還有一項暗色背景的Room
子菜單,可以進入各個room溜達。進入自己room的時候一般離開始只有3分鐘左右
,靜一下心就可以直接開始比賽了。coding phase的過程與practice基本相同。
注意每題的得分是和用的時間相關,而時間是從你打開該題開始算的。所以一題
做完后可以不急著打開下一題,先放松一下。75分鐘的coding后是5分鐘的
intermission,這段時間是用來休息和聊天的。然后就是最刺激的15分鐘challenge
phase。打開summary,雙擊別人的各題Score可以打開那題的程序,如果覺得有錯
誤就可以點左下的Challenge然后輸入你認為他會錯的數據,成功的話能得到50分
,對方該題分數為0;而如果失敗了,你會被減去50分。所以若不是考慮成熟或背
水一戰的話,最好不要隨便Challenge。Challenge結束后就是System Test。這個
過程一般比較慢,可以先走開做其他事。過20分鐘再回來看結果。結果出來后再
過一段時間就可以看到一系列message比如rating更新了,新的practice room建
好了以及可以通過主頁查看這次比賽的數據了。
7.注意事項
a.主頁上有一份日歷,日歷下面的More 2003 Match Dates點進去可以看到最近比
賽的時間安排。注意當前我們的時間與他們剛好相差12小時,因此若時間是7月
9日9:00 P.M.的話,這里是7月10日9:00 A.M. 還有要注意的是美國有夏令時,
非夏令時的時候,還要再加1小時,就是7月10日10:00 A.M.(現在是夏令時)
b.Practice Rooms里寫的程序只要點SAVE就可以保存,下次login的時候還可以看
到,但是比賽時候的程序必須Submit才可以在coding phase結束后保存(coding
phase結束前還是只要SAVE就可以的)。
c.若想cha別人的程序,自己必須是正分(0分也不行),所以若沒有一題有正確的
程序但有很好的數據的話,隨便交一道看上去正確的程序,然后在challenge的
時候快下手,就可以賺到了。
d.客戶端自帶的編輯器只有基本的編輯功能和編譯及測試功能(連自動縮進都沒有
)。所以若覺得不方便的話可以使用parser和plugin,tc主頁最下面有plugin的
連接。因為我沒有用過,所以具體方法不詳。
e.tc的FAQ http://www.topcoder.com/?&t=support&c=index
f.最后一條,千萬不要作弊,會有嚴重的后果。
--
int SummerVocationDietPlan(int weight){
while(Day++<=VocationEnd){
Sleep(EARLY);GetUp(EARLY);
Have(short int SaltyFood,short int SweetFood,int Water,long Exercise);
}return weight-15-random(6);
}
比如這題:
SRM 152 div 2 , 250
Problem Statement for LeaguePicks
Problem Statement
You and your friends are setting up a fantasy TopCoder league, where
you choose coders to be on your team and score points in the league when
any one of your coders wins their room or successfully challenges somebody,
etc. To be fair, a system has been developed to choose the order in which
picks are distributed. It works like this: first, lots are drawn to choose
your position in the league. Then the player with the first position gets
first pick, the second player gets second pick, all the way until the last
player picks. Then the order reverses: the last player chooses again, then
the next to last player, and so on, until you reach the first player again.
Then the cycle repeats: the first position chooses again, then the second,
and so on.
For example: say you were in the third position on a 6 player league. You
would get the 3rd pick, then you'd wait until the 10th pick (the order
would be 1,2,you,4,5,6,6,5,4,you), and then the 15th pick, and so on until
there were no more coders to choose. If there were 20 total picks, then you
would get pick numbers 3,10,15.
Not wanting to miss your chance at a pick, your goal is to write a program
that tells you what pick numbers you have in the order that you have them.
You will receive three ints indicating your position in the league(1 being
the first position), the number of friends that are in the league with you,
and the number of picks that are being divvied up among the league. You will
return an int[] that indicates the picks that you receive in ascending order.
Definition
Class:?LeaguePicks //要寫的Class名
Method: returnPicks //要寫的Method名
Parameters: int, int, int //輸入參數
Returns: vector <int> //返回
Method signature: vector <int> returnPicks(int position, int friends, int
picks)
(be sure your method is public)
Notes
- Note that your position in the league and the pick numbers start at 1 and
not 0. This should be clear from the examples.
Constraints
- position will be between 1 and friends inclusive.
- friends will be between 1 and 40 inclusive.
- picks will be between 1 and 40 * friends inclusive.
Examples
#include
<
vector
>
using
?
namespace
?std;

class
?LeaguePicks?


{
public
:
????vector?
<
int
>
?returnPicks(
int
?position,?
int
?friends,?
int
?picks);

}
;

vector?
<
int
>
?LeaguePicks::returnPicks(
int
?position,?
int
?friends,?
int
?picks)


{
????vector?
<
int
>
?receive_picks;
????
int
?times
=
picks
/
(
2
*
friends);
????
int
?remainder
=
picks
-
times
*
2
*
friends;????
????
int
?i;
????
for
(i
=
0
;?i
<
times;i
++
)

????
{
????????receive_picks.push_back(position
+
(
2
*
friends)
*
i);
????????receive_picks.push_back((
2
*
friends)
*
i
+
(
2
*
friends
-
position
+
1
));
????}
????
if
(remainder
>=
position)

????
{
????????receive_picks.push_back(position
+
(
2
*
friends)
*
i);
????????
if
(remainder
>=
(
2
*
friends
-
position
+
1
))
????????????receive_picks.push_back((
2
*
friends)
*
i
+
(
2
*
friends
-
position
+
1
));
????}
????
return
?receive_picks;
}
?? 最暈的是提交的是時候要用C++的類或Java的類本人的C++或者Java還不行。。。。一直搞算法(雖然還很菜)
學習學習!!!
posted on 2009-01-06 21:16
KNIGHT 閱讀(6475)
評論(1) 編輯 收藏 引用