Topcoder getting started-sqybi Full Edition

Source: Internet
Author: User
Tags floor function

This article is improved and adapted based on the classic TC tutorial.

Basic Rules
Topcoder has many types of competitions. The most common is the weekly SRM (single round match). In addition, tchs SRM (topcoder High School SRM) has the same subject as SRM and is only available for middle school students, low contestant level, it is said that it is easy to rating), Marathon matchs, and tcopen (two major competitions each year. Most people are engaged in SRM, so the TC competition described in this article is SRM.
The SRM rules are summarized as one sentence: three questions with increasing difficulty are completed in 75 minutes.
Each user (handle) of TC has its own point (rating), ranging from 0 to 3000 +. The better the score, the higher the score.
The point corresponds to the color: white-not participating (unrated); gray-0 ~ 899; green -- 900 ~ 1199; blue -- 1200 ~ 1499; yellow -- 1500 ~ 2199; red -- 2200 +. In addition, the most ranked people will become red targets in the TC client.
The competition is divided into two division, Div I and Div II. Participate in Div II in white gray and green, and participate in Div I in blue yellow and red. The question of Div I is much more difficult than that of Div II. Generally, the last question of divii is the same as that of the first or second question of Div I. Whether it is Div I or Div II. The scores for the three questions are generally 250,500 and 1000.
The scoring rules of TC are very strange. For details, refer to "distinct. However, the basic idea of TC points rules is simple.
The first is the scoring rules for each SRM question. Start timing a question. As time passes, you may receive fewer and fewer scores for this question. However, the rate of score reduction will gradually slow down (some people say it is fast first, slow, and slow again. I don't know which one is right, but the overall trend is getting slower and slower ), generally, when the number of questions with 1000 points is reduced to 300 points, it will not drop too much. Click Submit for each question to submit the question. If an error is found after submit, you can click submit again to modify and submit the question, but this will deduct a certain score for this question.
The second is the scoring rules of TC. Complex mathematical formulas are hard to understand, but the general scoring idea is: Calculate the rank of the competition based on the score of the competition, and then compare it with the previous rank to find an expected rank, then adjust rating according to the expected rank. Sometimes, the rating rate is still rising, but the scoring formula of TC is very stable in general.

Running Environment
The TC client is a JavaProgramSo JRE (Java Runtime Environment) or JDK (Java Development Kit) is required to run. If you do not write Java programs at ordinary times, you can install JRE. After all, JDK is an order of magnitude larger than JRE and downloads are slow. Follow the prompts to complete the installation. We recommend that you use Versions later than 1.4.1. Because Java Web Start is included, you can log on quickly. The next section describes the specific method.
JRE (Chinese):

The original Article is not described in detail at the place of registration, but many people seem to have doubts about registration. So here I will register a small account and explain how to register it through the entire process.
First open the (the topcoder home page after this article refer to this URL), and then click the register now in the upper right corner (do not see? You may see a login, and move your eyes down. The red and white "register now" is under ). Next, the page Because we want to participate in srm, we choose the first choice, competition registry. If you want to participate in tchs, you can select the second High School (secondary school) registry. You can change these settings later (if you do not select them later, you only need to update your personal settings and check them; if the selected option is to be revoked, You need to click an "unregister" link ). The number of items selected here is related to the number of items to be entered on the following page. This article takes the first item as an example.
The required project and corresponding Chinese translation are as follows:

* Given name: Name
* Surname: surname
* Address1: address 1
Address2: address 2
Address3: Address 3 (if one row cannot be written, write it in the other three rows)
* City: City
State (US only): Region (you do not need to select if you are not in the United States)
Postal code: Zip code
Province: Province
* Country: Country
* Country to represent: indicates the country. (If you do not know what it means, you can enter China for both Chinese users)
* Timezone: Time Zone (select Asia/Chongqing)
Phone number: phone number
* Email Address: Email
* Confirm email address: confirm the email address (that is, repeat the email address)
Email Notification: email notification (that is, it sends you an email to remind you of something)
-Algorithm Competitions Algorithm The competition is SRM and tcopen.
-Software Development Opportunities: You will be notified of software development projects.
-Employee opportunities job opportunities
-Topcoder News & Events News
* Enable member Contact: allows a Member to contact (it seems that someone else can find you on TC)
* Show/hide earnings)
* User name: User Name (The following is a reminder that you must not fill in the error because registering multiple users does not meet the requirements. It is said that someone else said hello to him on the TC client, "Why did you get the trumpet", and the number of the person was blocked)
* Password: Password
* Confirm Password: confirm the password
* Secret question, therefore, you may need to fill in the length with a few question marks at the end)
* Secret question response: password retrieval answer
Quote: The motto is something like a name document.
* Student/professional: students/professional programmers
* = Required for projects with required *

Enter "I agree" under "term of use", and then click "Submit" to complete the submission. It may be changed in the future except for the user name.
Next, go to the demographics page, which is roughly equivalent to a survey of registered users.

* Age: age
* Gender: Gender (male female)
* Ethnic Background: national background (it seems like you can select Asian or Pacific Islander ......)
* primary interest in topcoder ......
* shirt size: T-shirt size (in some competitions, T-shirt will be sent to the Top N contestants. here you need to select the proper size, if you choose the last one, it means you don't want t-shirt, and no one will send it to you. Tc t-shirt is pretty nice, better than astar)
* college major: Major of the university
* college major Description: I don't know what it means, just fill in something ......
* degree program: degree (from top to bottom: Prospective bachelor, bachelor, master, Doctor, middle school student)
* graduation year: graduation year
* graduation month: Graduation month
* clubs/organizations: Organization (generally none, you can press Ctrl to select multiple)
Other clubs/organizations: other organizations
* School: School (Click choose school to select a school, you can search for it, but why is shanghaijiaotong University registered by only two people ?!)
* Show/hide my school: Show/hide my school
GPA: Baidu, I don't know ......
GPA scale: Same as above
resume: Resume
* How did you hear about topcoder?: How do you know about Tc? If you select "member referral", you need to enter the user name of that person in TC (You are welcome to enter sqybi ~)
* = required

Click Submit to go to The confirm page and confirm the information. If any error occurs, click Edit. Otherwise, click the following confirm to submit.
Next, go to success and prompt that you have sent an email to your mailbox. You must click the link to activate the user. After activation, you can use this user.

Generally, Java Web Start is used for logon.
At the bottom of the topcoder homepage (, the first sentence is "load the arena as an applet or as a Java Web Start application ". Click "Java Web Start application" to automatically download the required files (a JNLP file, JRE/JDK is installed on the local machine ). The link in IE7 does not seem to work. It works normally in Firefox 3.
Then run the downloaded JNLP file to open the TC client. The installation program will be automatically downloaded during the first running and updating, and will be available soon.
In my case, "syntax error" is sometimes prompted, but there is no impact. Click "OK. The startup may be slow and patient.
Then, enter the username and password, select the appropriate logon method in the connection area (generally, direct is enough. If not, try another method or use autodetect to automatically detect it), and set the proxy at the proxy, click Go to log on. At this time, a syntax error may be prompted, and then you can confirm it. This has no effect.

The following figures are from the original article, which is classic and will not be changed. Use an equal-width font to browse.
Main Interface:

----------------------------------------------------------------------- | Advertisements ............. | keys | main | lobbies | options | Practice Rooms | active contests | help | clock | rating key | who's here | chat area |. |. |. |. |. | ------------ | messages | -------------- | leader board | ------------ | --------------------------- | | >>>___________________________________ | -----------------------------------------------------------------------

Menu item:
-You can view the online list and find someone in main.
-Lobbies is basically not needed because users are generally in chat room 1.
-Options contains some options and color settings.
-Practice Rooms has a large number of exercises, all of which are previous competition questions.
-Active contests is only useful when there is a competition. It displays the currently ongoing and upcoming competitions, game registration, and other things.
-In help, it is .... Needless to say.
Rating key: The color of handle changes with points. The relationship between points and colors is shown here.
Messages: Registration tips and clarification are provided during the competition.
Leader board: displays the highest score for each room.
Who's here: the person in the current room.
Chat area: chat.

Select a room in practice room to enter practice.
The interface is slightly different from the home page, but it is basically the same. The major change is that who's here is divided into two parts, with one more who's assigned. This shows who was allocated the room. Because it is an exercise area, all questions that have been opened here are assigned. In the formal competition, room is allocated by TC. The person assigned to the room is shown here. Another change on the interface is the addition of three on top of the chat area. The leftmost is a drop-down menu. There are three values in it. After selecting the value, you can open the corresponding question. The middle summary can be used to check the submission of each person in the room.
Only coding phase is available in practice room. After submission, You must select Run system test in practice options (multiple menu items.

For each competition (except for the two competitions in a year), you must log in and register between 3 hours and 5 minutes before the competition. The registration must be in the active contest menu, select the competition you want to participate in, and then select register. Note that the registration stops five minutes before the competition. If you do not register, you cannot enter the competition. If you do not open a question after registration, you will be deemed as not participating in the competition, and the rating will not change.
Then topcoder starts to allocate Room Based on everyone's rating. Generally, every room has a master and a cainiao, but if your rating is high, the probability of splitting with experts is higher (of course, this is not necessarily the case, for example, I was splitting with yuhch Daniel last time ......)
After the allocation is complete, the register entry in the active contest menu changes to enter. After selection, you can directly enter the room you are allocated. There is also a dark background room sub-menu at the bottom of the active contest menu, you can enter each room to slide.
When you enter your room, it generally takes about 3 minutes to start the competition. The coding phase process is basically the same as practice. Note that the score for each question is related to the time used (see the scoring rules above), and the time starts from when you open the question. After a question is completed, you can open the next question in a hurry and relax.
After 75 minutes of coding, It is 5 minutes of intermission, which is used for rest and chat.
Then there is the most exciting 15-minute challenge phase, which is generally referred to as the Cha. Open summary and double-click the program of other people's question scores to open the question. If you think there is an error, click challenge in the lower left and enter the data you think will be wrong, if the input data is valid, the system compares the output of the program with the output of the program. If the input data is different, the cha user succeeds. If it succeeds, you will get 50 points, and the score of the other party is 0. If it fails, you will be deducted 25 points. Each program can only be successfully Cha once. That is to say, if someone drops this program, you cannot re-cha it. However, a person can cha a program many times until the program is dropped by Cha or you give up.
After challenge is completed, it is system test. This process is generally slow. You can go away and do other things first, and then return to the results in 20 minutes. There are two types of test data in system test: one is the test data prepared by the problem maker, and the other is the data successfully obtained by others. Therefore, TC rarely shows that programs with bugs can pass system test.
After the results come out, we can see a series of messages, such as the rating update, the new practice room, and the data of this competition on the home page. The competition is now over.

1. You can see next SRM on the TC homepage (, which is the next SRM time. Note that our time is exactly 12 hours different from that of them. Therefore, if the time is on July 15, July 9, this is am on July 15, July 10. It should also be noted that when there is a license in the United States and when there is a non-license, an additional hour is required, that is, July 10 am.
2. the program written in practice rooms can be saved by clicking save. The next time login is displayed, however, during the game, the program must submit before it can be saved after the coding phase ends (only save before the coding phase ends ).
3. if you want to Cha others' programs, you must be a normal score (not 0 points), so if there is no correct program but good data, just hand in a program that looks right, and then you can get it in the challenge.
4. The editor provided by the client only has basic editing and compilation and testing functions. If you find it inconvenient, you can use parser and plugin. The Tc homepage has a plug-in connection at the bottom. Each plugin has a detailed instruction document, which is not described here.
5. tc faq: /? & T = Support & C = index
6. Do not cheat in the last line, which will cause serious consequences.

SRM Input and Output
SRM does not require standard or file input and output. You only need to write a member function of a class. That is to say, what you need to write is not a complete program, but a class.
Input is a parameter of the member function, and return is used for output. Therefore, vector and string in STL are often required.
The TC system does not test the standard output, so the standard output can be used for debugging.
The following describes how to write a program based on the 413-point question of SRM 1000 Div 2.
The question is as follows (select different languages and the description of the question will be slightly different. This article uses C ++ as an example ):

Problem Statement
Note: This problem statement contains subscripts that may not display properly if viewed outside of the applet.

Let's consider an infinite sequence a defined as follows:
A0 = 1;
Ai = A [I/P] + A [I/Q] for all I> = 1, where [x] denotes the floor function of X. (See notes)
You will be given n, p and q. Return the n-th element of a (index is 0-based ).

Long long, Int, int
Long long
Method signature:
Long long calc (long N, int P, int q)
(Be sure your method is public)

-[X] denotes the floor function of X which returns the highest integer less than or equal to X. For example, [3.4] = 3, [0.6] = 0.

-N will be between 0 and 10 ^ 12, inclusive.
-P and q will both be between 2 and 10 ^ 9, aggressive.

Returns: 1

A [0] = 1.

Returns: 7

A [0] = 1; A [1] = A [0] + A [0] = 2; A [2] = A [1] + A [0] = 2 + 1 = 3; A [3] = A [2] + A [1] = 3 + 2 = 5; A [7] = A [3] + A [2] = 5 + 3 = 8.

Returns: 32768

Returns: 89

Returns: 2

This problem statement is the exclusive and proprietary property of topcoder, Inc. any unauthorized use or reproduction of this information without the prior written consent of topcoder, Inc. is strictly prohibited. (c) 2003, topcoder, Inc. all rights reserved.

The following is a program of an error algorithm I wrote. It is only for reference formats:

View plaincopy to clipboardprint?
  1. # Include <string>
  2. # Include <vector>
  3. ClassInfinitesequence {
  4. Public:
  5. Long LongCalc (Long LongN,IntP,IntQ ){
  6. If(N = 0)
  7. Return1;
  8. Else
  9. ReturnCalc (N/P, p, q) + calc (N/Q, P, Q );
  10. }
  11. };
# Include <string> # include <vector> class infinitesequence {public: long calc (long N, int P, int q) {If (n = 0) return 1; else return calc (N/P, p, q) + calc (N/Q, p, q );}};


Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.