1.基本規(guī)則
2.運(yùn)行環(huán)境
3.注冊(cè)與登陸
4.界面簡(jiǎn)介
5.練習(xí)
6.比賽
7.注意事項(xiàng)
TopCoder(以下簡(jiǎn)寫tc) URL: http://www.topcoder.com
1.基本規(guī)則
tc的比賽規(guī)則歸結(jié)起來(lái)就是一句話:75分鐘做完3道難度遞增的題。
tc的每個(gè)用戶(handle)都有自己的積分,從0-3000+不等。成績(jī)?cè)胶茫謹(jǐn)?shù)越高
。比賽分為兩個(gè)division。Div I和Div II。積分<1200或者unrated(即注冊(cè)但還沒(méi)
參加過(guò)比賽的)參加Div II,>=1200的參加Div I。Div I的題要比Div II難許多。
一般DivII的最后一題和Div I的第一或第二題是一樣的。無(wú)論是Div I或Div II。三
道題目的Score一般為250, 500和1000左右,視每次的難度略有浮動(dòng)。個(gè)人積分
(rating)的增減是根據(jù)你和別人在比賽中的score以及你們?cè)瓉?lái)的rating決定的。tc
的提交結(jié)合了ICPC和IOI的特點(diǎn),即只能交一次,必須過(guò)所有數(shù)據(jù)并且得分與用時(shí)相
關(guān)。tc每周有一次Single Round Match(SRM),每年兩次大的比賽(有$)。
2.運(yùn)行環(huán)境
tc的客戶端是一個(gè)java程序,所以需要jre( java runtime environment) 或者
jdk( java development kit) 來(lái)運(yùn)行。如果平時(shí)不寫java程序的話,裝jre就可以了
。畢竟jdk比jre大一個(gè)數(shù)量級(jí),下載慢。安裝照著提示完成就行了。推薦使用1.4.1
以后的版本,因?yàn)閹Я薺ava web start,可以快速登陸。具體方法下一部分講。
sun公司主頁(yè)上的jre-6u1-windows-i586-p.exe
3.注冊(cè)與登陸。
點(diǎn)主頁(yè)右上角的register注冊(cè),過(guò)程沒(méi)什么好說(shuō)的。
注冊(cè)好后就可以登陸了。有兩種方法:
a.點(diǎn)左側(cè)的Launch Arena Applet
點(diǎn)后彈出一個(gè)窗口,等一會(huì)后就出現(xiàn)一個(gè)Load Competition Arena的按紐。
點(diǎn)擊就運(yùn)行了客戶端。注意不要把這個(gè)小窗口關(guān)掉,否則客戶端會(huì)一并關(guān)了
。這個(gè)方法在win2000下有時(shí)候會(huì)有問(wèn)題,但是在98下是正常的。不推薦。
b.通過(guò)java web start運(yùn)行
topcoder主頁(yè)底部有一欄如下:
---------------------------------------------------------------------
│ 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 ~~~~~~~~~~~~~~~~這里 │
---------------------------------------------------------------------
把那個(gè)"Java Application"拖到桌面上建立一個(gè)快捷方式,以后雙擊就可
以直接運(yùn)行了。客戶端啟動(dòng)后有一個(gè)窗口,填上申請(qǐng)的username和password
,如果是用代理的話,把HTTP Tunneling選上。登陸后就到了主頁(yè)面。
4.界面簡(jiǎn)介
-----------------------------------------------------------------------
│ Advertisements............. │
-----------------------------------------------------------------------
│ Main │ Lobbies │ Options │ Practice Rooms │ Active Contests │ Help ││
-----------------------------------------------------------------------
│ │ Clock │ │
-----------------------------------------------------------------------
│ Rating Key │ Who's here │ Chat Area │
│ . │ │ │
│ . │ │ │
│ . │ │ │
│ . │ │ │
│ . │ │ │
│------------│ │ │
│ MESSAGES │ │ │
│------------│ │ │
│LEADER BOARD│ │ │
│------------│ │ │
│ │ │ │
│ │ │-------------------------------------------│
│ │ │ >>_______________________________________ │
-----------------------------------------------------------------------
(寬度太小,縮放了一下
逐部分說(shuō)明一下:Advertisements: No comment.
Menus: Main里可以看在線名單和找人。
Lobbies基本用不著,因?yàn)橛脩粢话愣荚贑hat Room 1
Options里是一些選項(xiàng)和顏色設(shè)置。
Practice Rooms里有大量的練習(xí),都是以前比賽的題目
Active Contests只有有比賽的時(shí)候才有用。
Help里是....不用說(shuō)了吧。
Rating Key: handle的顏色是隨著積分而改變的,這里顯示了
積分與顏色的關(guān)系。
MESSAGES: 比賽的時(shí)候這里有注冊(cè)提示和clarification。
LEADER BOARD: 看每個(gè)room的最高分。
Who's here: 當(dāng)前room里的人。
Chat Area: 聊天。
5.練習(xí)
在Practice Rooms里隨便選擇一個(gè)room就可以進(jìn)入practice了。
界面與主頁(yè)面稍有變化,但基本相同,略去不畫。主要的變化就是Who's
here分成了兩塊,多了一塊Who's assigned。這塊顯示的是誰(shuí)被分到了這個(gè)room
。因?yàn)槭蔷毩?xí)區(qū),所以只要是在這里打開(kāi)過(guò)題的都算是assigned。而在正式比賽
中room是由tc分配的。這里顯示的是被分配到這個(gè)room的人。界面上還有一個(gè)變
化是Chat Area頂上多了三塊。最左邊的是一個(gè)下拉菜單。里面有三個(gè)分值,選擇
后就可以打開(kāi)相應(yīng)的題目。中間的summary可以看這個(gè)room里每個(gè)人的提交情況。
在practice room里只有coding phase。提交后要判的話需要自己選擇Practice
Options里的Run System Test。
6.比賽
每次比賽(除了1年兩次的大賽)都需要在賽前3小時(shí)-5分鐘之間登陸注冊(cè)方可
參加,注冊(cè)在Active Contest菜單的第一項(xiàng)。一般需要回答一道選擇題(多半是調(diào)
查)才能注冊(cè)。到剩下5分鐘的時(shí)候,注冊(cè)終止,tc開(kāi)始按照?qǐng)?bào)名者的rating分配
room。分配完成后,Active Contest菜單中Register一項(xiàng)變成Enter。選擇后可以
直接進(jìn)入你被分配到的room。Active Contest菜單最下面還有一項(xiàng)暗色背景的Room
子菜單,可以進(jìn)入各個(gè)room溜達(dá)。進(jìn)入自己room的時(shí)候一般離開(kāi)始只有3分鐘左右
,靜一下心就可以直接開(kāi)始比賽了。coding phase的過(guò)程與practice基本相同。
注意每題的得分是和用的時(shí)間相關(guān),而時(shí)間是從你打開(kāi)該題開(kāi)始算的。所以一題
做完后可以不急著打開(kāi)下一題,先放松一下。75分鐘的coding后是5分鐘的
intermission,這段時(shí)間是用來(lái)休息和聊天的。然后就是最刺激的15分鐘challenge
phase。打開(kāi)summary,雙擊別人的各題Score可以打開(kāi)那題的程序,如果覺(jué)得有錯(cuò)
誤就可以點(diǎn)左下的Challenge然后輸入你認(rèn)為他會(huì)錯(cuò)的數(shù)據(jù),成功的話能得到50分
,對(duì)方該題分?jǐn)?shù)為0;而如果失敗了,你會(huì)被減去50分。所以若不是考慮成熟或背
水一戰(zhàn)的話,最好不要隨便Challenge。Challenge結(jié)束后就是System Test。這個(gè)
過(guò)程一般比較慢,可以先走開(kāi)做其他事。過(guò)20分鐘再回來(lái)看結(jié)果。結(jié)果出來(lái)后再
過(guò)一段時(shí)間就可以看到一系列message比如rating更新了,新的practice room建
好了以及可以通過(guò)主頁(yè)查看這次比賽的數(shù)據(jù)了。
7.注意事項(xiàng)
a.主頁(yè)上有一份日歷,日歷下面的More 2003 Match Dates點(diǎn)進(jìn)去可以看到最近比
賽的時(shí)間安排。注意當(dāng)前我們的時(shí)間與他們剛好相差12小時(shí),因此若時(shí)間是7月
9日9:00 P.M.的話,這里是7月10日9:00 A.M. 還有要注意的是美國(guó)有夏令時(shí),
非夏令時(shí)的時(shí)候,還要再加1小時(shí),就是7月10日10:00 A.M.(現(xiàn)在是夏令時(shí))
b.Practice Rooms里寫的程序只要點(diǎn)SAVE就可以保存,下次login的時(shí)候還可以看
到,但是比賽時(shí)候的程序必須Submit才可以在coding phase結(jié)束后保存(coding
phase結(jié)束前還是只要SAVE就可以的)。
c.若想cha別人的程序,自己必須是正分(0分也不行),所以若沒(méi)有一題有正確的
程序但有很好的數(shù)據(jù)的話,隨便交一道看上去正確的程序,然后在challenge的
時(shí)候快下手,就可以賺到了。
d.客戶端自帶的編輯器只有基本的編輯功能和編譯及測(cè)試功能(連自動(dòng)縮進(jìn)都沒(méi)有
)。所以若覺(jué)得不方便的話可以使用parser和plugin,tc主頁(yè)最下面有plugin的
連接。因?yàn)槲覜](méi)有用過(guò),所以具體方法不詳。
e.tc的FAQ http://www.topcoder.com/?&t=support&c=index
f.最后一條,千萬(wàn)不要作弊,會(huì)有嚴(yán)重的后果。
--
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 //輸入?yún)?shù)
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;
}
?? 最暈的是提交的是時(shí)候要用C++的類或Java的類本人的C++或者Java還不行。。。。一直搞算法(雖然還很菜)
學(xué)習(xí)學(xué)習(xí)!!!
posted on 2009-01-06 21:16
KNIGHT 閱讀(6484)
評(píng)論(1) 編輯 收藏 引用