Back

Yacht Auction

NYPC CODE BATTLE · Online Round

Problem Description

After finishing their mushroom game, Yeti and Pink Bean have moved to Grandis. Reminiscing about the past when they threw dice using the Roll of the Dice skill, they play a board game called Yacht Auction.

Game Rules

Bidding Phase

The bidding phase proceeds as follows:

  1. Two sets of dice, Set AA (5 dice) and Set BB (5 dice), are rolled. Each die is independent and identically distributed integer between 11 and 66 inclusive.
  2. Each player submits the dice set they wish to take (AA or BB) and a bid score between 00 and 100000100\,000, inclusive.
  3. Each player take dice set based on following rules:
  1. Scores are then adjusted according to the following rules:

Scoring Phase

From the 1010 dice currently in hand (exception: only 55 dice are available in the final scoring phase), the player selects 55 dice. Then, the player chooses one of the following Scoring Rules to earn points. Each scoring rule can be used at most once per match.

Basic Scoring Rules

Additionally, if a player earns a total of 6300063\,000 points or more from the Basic Scoring Rules, they receive a Bonus Score of 35000\mathbf{35\,000} points.

Combination Scoring Rules

Final Score and Victory Condition

After all rounds are completed, the player with the higher total score wins. If the total scores are equal, the game ends with draw.

Input/Output Format

Your program must read input line by line and follow the protocol of each command. Commands requiring the output are denoted with red color with their time limit specified. If your program fails to output within specified time limit, you will receive Time Limit Exceeded (TLE) verdict and will result forfeiting the game.

CommandInput FormatDescription
READYREADYMust output OK within 3 seconds as a response.
ROLLROLL a₁a₂a₃a₄a₅ b₁b₂b₃b₄b₅Indicates dice in Group A are a1,,a5a_1, \cdots, a_5 and Group B are b1,,b5b_1, \cdots, b_5. Output BID g x within 0.5 seconds. This corresponds bidding xx points for group gg. gg must be A or B, and xx must be an integer between 00 and 100000100\,000.
GETGET g g₀ x₀Indicates you took group gg as a result of the bidding. The opponent bid x0x_0 points for group g0g_0.
SCORESCOREIndicates the start of the scoring phase. Output PUT c d₁d₂d₃d₄d₅ within 0.5 seconds. This corresponds using rule cc with dice d1,,d5d_1, \cdots, d_5 from your possession.
SETSET c d₁d₂d₃d₄d₅Indicates the opponent used rule cc with dice d1,,d5d_1, \cdots, d_5 during their scoring phase.
FINISHFINISHIndicates the end of the game. The program must terminate properly and immediately, regardless of the current status of the game. Output is not required.

All commands must be processed line by line. When you output, make sure you print a newline character and then flush the buffer. Please refer to the reference document or sample code of your programming language on how to flush the buffer.

Sample Code

The following are sample codes provided for each language:

The sample code uses following strategy:

Match Against Sample AIs

Once the submitted code compiles successfully, it will compete against a total of 10 sample AIs. One match is played against each sample AI. Points are awarded as follows:

Battle No.DescriptionCodedata.bin
1Performs the same actions as the provided sample code.Code
2Bidding: Bids (difference in group sums) ×1,000\times 1,000 on the group with the higher sum.
Scoring: Uses the rule and combination that yields the immediate highest possible score.
Code
3Bidding: Randomly picks A or B and bids 00 points.
Scoring: Uses the rule and combination that yields the immediate highest possible score.
Code
4Bidding: Randomly picks A or B and bids 00 points.
Scoring: Prioritizes combinations that are difficult to score.
Code
5Bidding: Randomly picks A or B and bids 00 points.
Scoring: Prioritizes Basic Scoring Rules.
Codedata
6Bidding: Bids defensively on better combinations.
Scoring: Prioritizes Basic Scoring Rules.
Codedata
7Bidding: Bids aggressively on better combinations.
Scoring: Prioritizes Basic Scoring Rules.
Codedata
8Bidding: Randomly picks A or B and bids 00 points.
Scoring: Prioritizes Combination Scoring Rules.
Codedata
9Bidding: Bids defensively on better combinations.
Scoring: Prioritizes Combination Scoring Rules.
Codedata
10Bidding: Bids aggressively on better combinations.
Scoring: Prioritizes Combination Scoring Rules.
Codedata

Note: Sample AI codes and data.bin files were not provided during the actual contest.

Testing Tool (GUI)

A testing tool, testing-tool-yacht, is provided to test the program. You can test your compiled executable or script locally, using python, java, node, or lua in your envinroment.

Testing Tool (CLI)

A CLI testing tool package, testing-tool-yacht-cli.zip (Download), is provided to test the program. For details, refer to the README.md inside the zip file.

You can freely modify the CLI testing tool and discuss its execution methods with others. However, you must not share modified tools or log files generated by the tool with anyone outside your team, nor discuss them.

You will receive log files having same format with testing tool, in the submission result dialogue. However, actual grading program is implemented differently from the testing tool, a successful execution in the testing tool does not always guarantee a successful execution in the actual grading.

Visualization Tools

You can download log files for each battle from the Sample AI matches. Use the Log Visualization Tool to examine how the game progressed and refine your strategy.

Example

Example Input (Used in Testing Tool)

35561 15336 0
31452 33164 0
21464 46146 0
51211 45446 1
62612 34411 1
12421 36431 0
54344 36225 1
13653 32122 0
53644 61453 0
64215 15142 1
35522 44162 1
54111 55424 1

Example Interaction

First Player InputFirst Player OutputSecond Player InputSecond Player OutputLog
READYOKREADYOK
ROLL 35561 15336ROLL 35561 15336

ROUND 1

ROLL 35561 15336

BID A 123BID A 456

BID FIRST A 123

BID SECOND A 456

GET B A 456GET A A 123

GET FIRST B

GET SECOND A

ROLL 31452 33164ROLL 31452 33164

ROUND 2

ROLL 31452 33164

BID A 99BID B 11

BID FIRST A 99

BID SECOND B 11

GET A B 11GET B A 99

GET FIRST A

GET SECOND B

SCORESCORE
PUT ONE 35561PUT THREE 13356

PUT FIRST ONE 35561

PUT SECOND THREE 13356

SET THREE 13356SET ONE 35561
(Rounds 3-12 omitted)
SCORESCORE

ROUND 13

PUT YACHT 12556PUT FULL_HOUSE 42533

PUT FIRST YACHT 12556

PUT SECOND FULL_HOUSE 42533

SET FULL_HOUSE 42533SET YACHT 12556
FINISH(Program ends)FINISH(Program ends)

FINISH

SCOREFIRST 19000

SCORESECOND 30372