PC2 Configuration & Use
PC^2 Official website: http://www.ecs.csus.edu/pc2/or http://pc2.ecs.csus.edu
Author:yuansheng Xue
From:south China Normal University
Q q:1348066599
E-mail: [email protected]
e-mail: [Email protected]
If you are a game manager, please read from scratch;
If you are only the referee of the game, just read the seventh part (33 pages), the use of the referee's side;
If you are just the referee of the game, just read the sixth part (29 pages) and use the player side.
The following is a configuration method for the PC2 v9.1.5 version of the Win7 example (XP is also similar):
One Installation & configuration JDK
Since PC2 is a Java-based development, it is necessary to install the JDK or JRE.
JDK1.6:
Http://www.java.net/download/jdk6/6u10/promoted/b32/binaries/jdk-6u10-rc2-bin-b32-windows-i586-p-12_sep_2008.exe
Install it directly after downloading.
Then configure the Java environment variables, right click on my Computer à property à advanced system settings à environment variable (XP is right click on my computer à attribute à advanced à environment variable), in the following system variables found path variable, point edit, Add the absolute path to the bin directory in the JDK installation directory after the variable value, for example, my JDK's installation directory is D:\Java\jdk1.6.0_20, which has a bin directory, the path is D:\Java\jdk1.6.0_20\bin, Then the value of the variable after the JDK path is added is:
Then find the CLASSPATH variable (create a new one if not), add the JDK's lib path to the variable value, and don't forget the semicolon.
This way, the JDK is ready to be configured!
Two decompression installation PC2
This one...... Should not say more, attention not to extract the path to not have Chinese is OK.
Three edit Pc2v9.ini file
There is a Pc2v9.ini file in the root directory of the PC2, which is the IP and access port of the server, open it with WordPad (it may seem messy if you open it with a regular Notepad), and then we see that the content inside is like this:
The next thing we want to modify is the server address of site 1 and the following Remotesever address is the IP address of the server can be, the port does not change.
If you do not know the local IP address when configuring the server, you can start à run, input cmd, pop a black box, enter Ipconfig in the inside, you will see a lot of native network connection information
As shown, the IP address that line shows is the native IP addresses, fill in the Pc2v9.ini file, the modified Pc2v9.ini file content as follows:
In this way, the Pc2v9.ini file is configured, and the file is copied to the Bin folder in the pc^2 root directory (no missing operations).
The configuration is here and can be used by competitors. If it is a referee machine, continue to configure down.
Quad Configuration Compiler
The configuration compiler is actually configuring the compiler's environment variable path, and the configuration Java environment variable is the same, the following is configured codeblocks the GNU C + + as an example.
Locate the bin and Lib folders in the MinGW folder under the Codeblocks installation directory,
The absolute path of the two folders is added to the path variable and the CLASSPATH variable, as well as the environment variables of the configuration JDK, after adding:
In this way, the compiler is configured, and other compilers are configured similarly, the Bin folder and the Lib folder path is added separately to the path variable and the variable value of the CLASSPATH variable is OK.
After the compiler is configured, combined with PC2, you can make a referee machine.
Five configuration servers and tournaments
(1) Server:
After copying the Pc2v9.ini to the Bin folder, perform the Pc2reset.bat reset in the Bin folder (after resetting, all game configurations will be reset, then how to set the match configuration), and then open pc2server.bat, a box will pop up:
In name and password both enter the default account password site1, click Login, and then pop up a box enter contest password, this box seems to fill anything, I usually fill in site1 (if not reset, To fill in the same password as last completed).
In this way, the server is built.
(2) Set up the game with admin account
Open the Bin folder under the Pc2admin.bat, will pop up a similar to the previous landing box, we use the Administrator's account password Administrator1 login, you will see the following window:
You can then configure the match by following these steps:
① Configuring the Compiler
Select the Languages tab, such as:
Click Add, the following box will pop up:
To configure the GNU C + + compiler as an example, select GNU C + + in Auto Populate with the following information:
In the case of Linux, you can add this compiler by clicking Add, but if you are Windows, add ". exe" after the information in both executable filename and program execution Command lines, as shown in:
Then click Add, a GNU C + + compiler is added (Microsoft C + + configuration is the same, but the non-genuine VC comes with the MS C + + compiler after the configuration is often not compiled code in the game, the reason is unclear, so here use GNU C + + for example).
If the Java compiler is configured, the settings (in fact, the default settings, without modification)
② Setup Topics
Select the Problem tab:
Add the data to the topic:
In problem fill in the title name, in the run Timeout limit to fill in the title of the time, in seconds; if the problem is input data, tick problem requeres input Date, if you want the players to read the data in the form of file operation ( To add a freopen (...) to the beginning of the main function such as the function can be read into the data), in the team Reads from the file, if you want to standard input and output, select StdIn, and then click on the input Data file in the browse, choose to enter the file path (the path is best not Chinese, but PC2 V9 seems to support Chinese, V8 not), the same, whether there is no input, the vast majority of the output data, so there will be a standard output data file, used to compare with the player's output, tick judges have provided Answer file, Click Browse this is the output data file path, below to set A+b as an example:
Input file contents (a+b.in):
1 1
2 2
Output file contents (a+b.out):
2
4
Input mode is standard input and output, after configuration:
For the middle of the judging Type tab, is the choice of automatic machine or manual problem, the default is a manual problem, in general, is a manual problem, in order to avoid machine errors, so keep the default without modification.
Click on the Validator tab to:
This is the selection of the output data comparison method, will choose the use Pc^2 Validator, and then in the Validator option options, there are 5 kinds:
1-diff
Competitor output data and standard output data if there is a little bit different, the return result is No-wrong Answer, even if it is more a space or a carriage return, is not the same, only the exact same time is yes.
2-ignore whitespace at start of file
Ignores all whitespace at the beginning of the output file and compares it in 1.
3-ignore leading whitespace on lines
All spaces beginning with each line are ignored and compared in 1.
4-ignore all whitespace on lines
Ignore all spaces and compare them in 1.
5-ignore Empty Lines
The comparison is done in 1 by ignoring all empty rows.
In my configuration, the general choice is the 1th way, and then the sentence when the machine is the right to return, no, then manually compare the similarities and differences of the data (the specific operation will be explained in the seventh part).
Finally, point add, add a good question, so the topic is configured.
③ set up various accounts for the contest
Select the Account tab:
Click Add to add the account number:
Account type can choose the types of accounts, there are team,judge and scoreboard accounts, team is the player's account, judge is the referee's account, scoreboard is used to see the rankings of the account (but generally do not look at the rankings, Look at the way the rankings will be said later, the top account refers to the game's accounts, but this can not be filled out by themselves, PC2 will be based on the number you set to assign you an account, in the display name can be filled in the name of this account in the ranking display ( In general, the competitor's account needs to modify this, that is, the team name of the match team, password and password confirmation fill in the Password and confirm the password (must be the same), the right choice is the account permissions, no tube.
Add a Referee account example below:
Then add a referee account, which is displayed in the Accounts tab:
Select this account, click Edit, you can see:
There is no information displayed in the account before, now there is, that is the login with the accounts, if the definition of a referee account, accounts will be judge2, and so on.
Add a Match Team account:
Here set the team name is Super_star, then in the rank board will display this name, similarly, we add, after adding this account, then in the Account tab to select the accounts, click Edit, you will see:
This team login with the account is team1, the second set of team is team2, and so on.
Add scoreboard account is similar, there is not much to say.
What if you want to add accounts in bulk? Of course there is a way, we can in the Account tab, point generate, pop up such a box:
We see that there are administrators, judges, teams and scoreboards,4 types of account numbers are shown in parentheses are the number of such accounts, the figure shows that there are 1 administrator accounts, 1 referee accounts, 1 team accounts, no ranking board account, If we want to add 10 team accounts, you can fill in the box corresponding to the teams 10, point generate Accounts for Site 1, added 10 team accounts, in the Account tab can be seen,:
Select a different account, click Edit, you can see the login account name and modify display name.
However, all the names of the team to a change, the amount of the project is very large, there is no way can be modified at once? The answer is, there!
First of all to generate the way to set up the account to be modified, and then to have a TXT file, inside to have the account, password and display name information, the format is as follows:
Site unification is 1,account is to modify the account, password is the password, displayname is the display name, it is worth noting that the whole file after writing, in the end can not have empty line, take the above file as an example, in team Ten finally is the end of the document, Do not have a carriage return, otherwise the load will be wrong.
Back to the Account tab of PC2, click the load below, will pop-up window selection path, choose to write a TXT file containing the competitor information, select Good, will pop up a window, display is PC2 read out the file stored information, for the above file, read out the information as follows:
Click Accept, the Account tab will display:
This is configured, but it takes a little bit of time to write that file, and if the contestant submits the information in such a format, it will be much better.
OK, the account is configured here.
④ Set game time
Select the Time tab to see the timing information for the game:
Select Site1, click Edit, Pop up a small window with the setting time, as follows:
Contest length can set the total time of the game, Elapsed time can modify the past times, Remaining time can modify the remaining times, Elapsed and Remaining The time to fill up must be equal to the time of contest length, otherwise it will prompt an error. Tick stop clock at end of contest.
Click Update to complete the setup.
Click Start, the game starts, and the player can start submitting the code.
Six use of the player side
Open the Bin folder under the Pc2team.bat (open before you need to be configured by the administrator Pc2v9.ini files into the bin folder), pop-up login box, the participating teams fill in their own account password login, login after the interface as follows:
The upper-left corner shows the stopped, stating that the game has not yet started and cannot be submitted, and when stopped is converted to time, it is ready to submit the code.
When submitting the code, select the topic you want to submit, select it in the problem, then select the language in the language, then select the code file to submit in the main file, and note that the file suffix must be ". cpp" (Java is " . Java "), at the same time, the file name can not have spaces, otherwise the submitted files cannot be compiled, the referee will return no-compilation Error when the problem:
Code that itself has a syntax error will also return the above error.
If the following error occurs, an array subscript overflow or a recursive stack overflow:
The following error is obvious, and the result of your code output is wrong:
If you are returning no-time-limit exceeded, your algorithm may not be good enough, or there will be a dead loop.
If you get yes, congratulations, your code is correct:
The contestant can also send information to the referee, ask the referee some of their obligations to answer questions, such as test instructions not clear when the contestant can ask, the way is, choose request Clarification,:
If it is for a question, in the problem to choose the name of the topic, if not, select General, and then fill in the question inside the content of the inquiry, taking into account the PC2 on the compatibility of Chinese, suggest contestants to ask questions in English, and then click Submit Clarification, submitted to the referee, awaiting the reply of the referee. If the referee believes that the player has not understood or understood the wrong test instructions, the following answers will appear:
This is the way to ask the referee.
View runs can see your submission history.
View clarifications can see your own query history.
Options inside can display PC2 running log, that thing I also do not understand, contestants best also do not mess point.
The test function in the Submit run tab is rarely used, nor is there much to say here.
So much for the player's operation.
Seven use of the referee's side
Open the Bin folder under the Pc2judge.bat (before opening, you need to copy the administrator configuration Pc2v9.ini files into the bin folder), pop-up login box, enter the referee's respective account password login, login interface:
When a team commits the code, it will be:
As you can see, there is a team that submits the code, selects that commit, and then points to the request Run, which pops up the following box:
Click Execute, start compiling to execute this code, execution end or run time has reached the limit of the subject, will stop, pop up a box to show this code output data,:
At this point, click Close this box to see the results of the machine sentence:
If yes, the data is exactly the same as the standard output file, which can be returned to the player by the point accept validator.
If it is no-... , the point compare can be manually compared to the standard output file:
If the data is the same as the output file, just because the output of the code at the end is more than the standard output file a carriage return character, the referee can choose Yes to correct this code, and return to the player. The choice is to select the result to be judged at the place of the mark, click Accept selected confirm , and returned to the contestant.
If there are some accidents in the course of the problem, some of the submitted submissions need a heavy sentence, you can choose the All runs tab, select the submission to be sentenced to heavy sentences, point Rejudge to make a severe sentence:
The referee's verdict is like this.
The referee has another job to answer the contestants ' questions, and when someone sends a question, there will be a red word on it:
Click New Clars to see what you are asking:
The following white box shows the content of the inquiry, in the white box above the selection of the player's inquiry, point answer, in the following white box input text to answer:
Click OK, you can send to the contestants, if the referee think this problem may be the majority of players will have, you can tick send to all teams, and then click OK, you can send this inquiry and answer all the contestants, So that all the contestants can see. If the referee feels that the referee is not obligated to answer the question, or the title has been explained, the player does not understand, you can click the default Answer, you can automatically reply to this sentence: NO response, read problem statement, The contestants will see:
These are the actions of the referee. Other tabs are rarely used and can be ignored.
Eight View rankings
If the administrator set up the scoreboard account, you can open the Bin folder Pc2board.bat open the scoreboard login interface (before opening the administrator configuration of the Pc2v9.ini file to be copied into the Bin folder), Enter the appropriate account password to log in, log in to view the rankings,:
Where solved refers to the number of questions made, points is the penalty.
This ranking does not show the submission of each problem, in the administrator's PC2 Bin folder in the HTML folder, there is a summary.html HTML file, open can see the submission of the questions and the submission of the team,:
If you build an HTTP server with an administrator's machine, you can get all the players to see the rankings.
Specific operation:
(1) Using Server tools to establish an HTTP server (this tutorial is accompanied by a small HTTP Server tool, the tool used to change the IE homepage to http://www.haha111.com/, otherwise it will not be used). Double-click SimpleHttpSvr.exe to open the tool, there will be a small icon in the status bar, click Open, Display:
Modify the service path to the Bin\html folder in the PC2 directory:
Then click Start Service, if the service path becomes not modifiable, it means the server is set up:
Again, it is not possible to use this tool if you do not change the IE homepage to http://www.haha111.com/.
This way, if the administrator's IP is 192.168.1.100, you can pass this link http://192.168.1.100:8089/summary.html (be careful not to miss Port 8089)
Visit the summary.html in the administrator's machine to view the rankings.
The above is all the contents of this document, thank you for reading!
In case of doubt, you can send an email to my email or comment directly below, although my ability is limited, but still hope to help you.
Configuration and use of ACM PC^2