-
Notifications
You must be signed in to change notification settings - Fork 91
Expand file tree
/
Copy pathconfig.yaml
More file actions
73 lines (72 loc) · 7.14 KB
/
Copy pathconfig.yaml
File metadata and controls
73 lines (72 loc) · 7.14 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
# ALE-Bench ahc024 — AtCoder Heuristic Contest
# Usage: skydiscover-run initial_program.cpp eval -c config.yaml -s <strategy>
language: cpp
diff_based_generation: true
max_iterations: 100
checkpoint_interval: 10
max_solution_length: 60000
llm:
api_base: https://api.openai.com/v1
models:
- name: "gpt-5"
weight: 1.0
max_tokens: 32000
timeout: 600
prompt:
system_message: "You are a world-class algorithm engineer, and you are very good at programming. Now, you are participating\
\ in a programming contest. You are asked to solve a heuristic problem, known as an NP-hard problem.\n\nStory\n--------\n\
Mr. Takahashi, the mayor of Takahashi City, decided to draw a map of Takahashi City on the floor of the city hall lobby\
\ using colored square tiles.\nTakahashi City is divided into several wards, and in this map, each ward should be represented\
\ as a set of connected tiles of the same color.\nHe commissioned a contractor to create a draft of an accurate map, but\
\ the number of tiles to be used was too large, and the budget was exceeded.\nMayor Takahashi, who loves graphs, is only\
\ interested in the adjacencies between the wards and thinks that the map could be drawn with fewer tiles if information\
\ other than adjacencies, such as the shape and size of each ward, is ignored.\nPlease create a map using as few tiles\
\ as possible.\n\n<div style=\"display: flex; width: 100%;\">\n <div style=\"flex-basis: 40%; text-align: center; margin-right:\
\ 10%;\">\n <img src=\"./images/input.png\" style=\"max-width: 100%; max-height: 100%; vertical-align: middle;\">\n\
\ <p>Accurate map</p>\n </div>\n <div style=\"flex-basis: 50%; text-align: center;\">\n <img src=\"./images/output.png\"\
\ style=\"max-width: 100%; max-height: 100%; vertical-align: middle;\">\n <p>Small map correctly representing adjacencies</p>\n\
\ </div>\n</div>\n\nProblem Statement\n--------\nGiven a map of Takahashi City represented on a grid of $n\\times n$\
\ squares.\nLet $(0,0)$ be the coordinates of the top-left square, and $(i,j)$ be the coordinates of the square located\
\ $i$ squares down and $j$ squares to the right from there.\nThe city consists of $m$ wards, and the square of color $c$\
\ ($1\\leq c\\leq m$) corresponds to the $c$-th ward.\nThe outside of the $n\\times n$ squares correspond to the outside\
\ of the city and is colored $0$.\n\nTwo squares are defined as \"adjacent\" if they share an edge, and a set of squares\
\ is defined as \"connected\" if any two squares can reach each other via adjacent squares.\nIn the given map, for each\
\ color c, the set of squares of color c is guaranteed to be connected.\n\nYour task is to create a map represented on\
\ a grid of $n\\times n$ squares that satisfies all of the following conditions.\n\n- For every color $c$ ($0\\leq c\\\
leq m$), squares of color $c$ must be connected. Note that since the outside of the $n\\times n$ squares is colored $0$,\
\ squares of color $0$ can be connected through the outside squares.\n- For every pair of colors $c$ and $d$ ($0\\leq\
\ c<d\\leq m$), the adjacency of a set of squares of color $c$ and a set of squares of color $d$ in the original map and\
\ the created map must be identical. That is, if and only if there exist adjacent squares of color $c$ and $d$ in the\
\ original map, there exist adjacent squares of color $c$ and $d$ in the created map. Note that since the outside of the\
\ $n\\times n$ squares is colored $0$, the squares on the boundary are considered to be adjacent to squares of color $0$.\n\
\n\nScoring\n--------\nLet $E$ be the total number of squares of color $0$ in the created map.\nThen you will obtain a\
\ score of $E+1$.\n\nThere are 150 test cases, and the score of a submission is the total score for each test case.\n\
If your submission produces an illegal output or exceeds the time limit for some test cases, the submission itself will\
\ be judged as <span class='label label-warning' data-toggle='tooltip' data-placement='top' title=\"Wrong Answer\">WA</span>\
\ or <span class='label label-warning' data-toggle='tooltip' data-placement='top' title=\"Time Limit Exceeded\">TLE</span>\
\ , and the score of the submission will be zero.\nThe highest score obtained during the contest will determine the final\
\ ranking, and there will be no system test after the contest.\nIf more than one participant gets the same score, they\
\ will be ranked in the same place regardless of the submission time.\n\n\n\nInput\n--------\nInput is given from Standard\
\ Input in the following format.\n\n~~~\n$n$ $m$\n$c_{0,0}$ $c_{0,1}$ $\\cdots$ $c_{0,n-1}$\n$\\vdots$\n$c_{n-1,0}$ $c_{n-1,1}$\
\ $\\cdots$ $c_{n-1,n-1}$\n~~~\n\nFor all test cases, we fix $n = 50$ and $m = 100$.\n$c_{i,j}$ is an integer value representing\
\ the color of the square at coordinates $(i,j)$ and satisfies $1\\leq c_{i,j}\\leq m$.\nFor every $k=1,2,\\cdots,m$,\
\ there exists at least one $(i,j)$ with $c_{i,j}=k$.\n\n\nOutput\n--------\nLet $d_{i,j}$ ($0\\leq d_{i,j}\\leq m$) be\
\ the color of the square at coordinates $(i,j)$ in the created map.\nThen, output to Standard Output in the following\
\ format.\n\n~~~\n$d_{0,0}$ $d_{0,1}$ $\\cdots$ $d_{0,n-1}$\n$\\vdots$\n$d_{n-1,0}$ $d_{n-1,1}$ $\\cdots$ $d_{n-1,n-1}$\n\
~~~\n\nIf the output map does not satisfy the conditions specified in the problem statement, the submission will be judged\
\ as <span class='label label-warning' data-toggle='tooltip' data-placement='top' title=\"Wrong Answer\">WA</span>.\n\n\
Your program may output multiple solutions.\nIf multiple solutions are output, only the last one is used for scoring.\n\
You can compare multiple solutions using the web version of the visualizer.\n\n<a href=\"https://img.atcoder.jp/ahc024/AU5KcDyn.html?lang=en&seed=0&output=sample\"\
>Show example</a>\n\n\nInput Generation\n--------\n<details>\nFirst, we initialize with $c_{i,j}=0$ for all $(i,j)$.\n\
Next, for each $k=1,2,\\cdots,m$, we randomly select a square with $c_{i,j}=0$ and set $c_{i,j}=k$.\nFinally, we repeat\
\ the following process while squares with $c_{i,j}=0$ remain.\n\nRandomly select a square with $c_{i,j}=0$ and randomly\
\ select its adjacent square $(i',j')$.\nWe set $c_{i,j}=c_{i',j'}$.\n</details>\n\nTools (Input generator and visualizer)\n\
--------\n- <a href=\"https://img.atcoder.jp/ahc024/AU5KcDyn.html?lang=en\">Web version</a>: This is more powerful than\
\ the local version providing animations and manual play.\n- <a href=\"https://img.atcoder.jp/ahc024/AU5KcDyn.zip\">Local\
\ version</a>: You need a compilation environment of <a href=\"https://www.rust-lang.org/\">Rust language</a>.\n - <a\
\ href=\"https://img.atcoder.jp/ahc024/AU5KcDyn_windows.zip\">Pre-compiled binary for Windows</a>: If you are not familiar\
\ with the Rust language environment, please use this instead.\n\nPlease be aware that sharing visualization results or\
\ discussing solutions/ideas during the contest is prohibited.\n\n\n Problem constraints:\n time_limit=2.0 memory_limit=1073741824\n"
evaluator:
timeout: 10000
cascade_evaluation: false