How Prompt Style Affects AI Accuracy and Speed in Competitive Programming
Organizations: Riyadh Schools Riyadh, Saudi Arabia · Department of Computer Science Northwestern University Evanston, IL, USA
Abstract
Large language models are increasingly used in competitive programming, and their outputs are sensitive to how a prompt is phrased. Prior work has compared prompt strategies for accuracy on competitive programming, but not for runtime speed, and has not situated the results against human performance. In an exploratory study of one prompt in each of nine styles on GPT-5.5 across three accuracy tasks from the International Olympiad in Informatics (IOI) and two NP-hard speed tasks, we found that no single prompt was best: the strongest prompt depended on the task type and on whether results were summarized by the mean or the median, suggesting that, at least for these tasks, prompt style should be matched to the objective rather than treated as universal. Many differences in mean scores came from a few outlier runs, showing that evaluating prompting by a single metric can obscure how much its effectiveness varies. Compared descriptively with human IOI contestants, who worked under different conditions, the AI was neither strictly better nor strictly worse, exceeding the average contestant on one task but falling short on the other two. By extending prompt comparison from accuracy to runtime speed and grounding it against human performance, this study gives a broader picture of how prompt style affects competitive programming performance.
Figures & tables
| Setting | Maximum Clique Size | Number Partitioning |
|---|---|---|
| Test input | Random graph on vertices; each edge included independently with probability | random integers between 1 and |
| Test generation | Deterministic from a fixed seed | Deterministic from a fixed seed |
| Baseline solution | MaxCliqueDyn exact algorithm [ 18 ] | Our own exact meet-in-the-middle solution |
| Baseline time limit | 10 s per test case | 10 s per test case |
| Ceiling (largest solved by baseline) | 220 | 49 |
| AI solution time limit | 1 s per test case | 1 s per test case |
| IOI contestants | AI solver (this study) | |
|---|---|---|
| Source of scores | Official IOI results [ 23 , 24 , 25 ] | oj.uz, official IOI scoring [ 17 ] |
| Scores averaged per task | Prisoner Challenge (2022): 353 contestants, 30 gold medalists Message (2024): 366 contestants, 34 gold medalists Migrations (2025): 334 contestants, 28 gold medalists | 81 runs (9 prompt styles 9 runs) |
| Time | 5 hours per contest day, shared across three tasks | One response per run |
| Submissions per task | Up to 50 | 1 per run |
| Feedback before resubmitting | Subtask results after each submission | None |
| Task score | Sum over subtasks of the best result across all submissions | Score of the single submission |
| Prompt | Prisoner Challenge | Message | Migrations | Average |
|---|---|---|---|---|
| Prompt 1 | 62.78 | 30.63 | 23.68 | 39.03 |
| Prompt 2 | 68.89 | 29.61 | 22.70 | 40.40 |
| Prompt 3 | 63.17 | 29.94 | 18.68 | 37.26 |
| Prompt 4 | 75.00 | 30.45 | 34.16 | 46.54 |
| Prompt 5 | 67.44 | 28.96 | 26.55 | 40.98 |
| Prompt 6 | 79.44 | 36.26 | 26.88 | 47.53 |
| Prompt | Prisoner Challenge | Message | Migrations | Average |
|---|---|---|---|---|
| Prompt 1 | 65.00 | 31.40 | 20.00 | 38.80 |
| Prompt 2 | 65.00 | 30.33 | 20.00 | 38.44 |
| Prompt 3 | 65.00 | 29.32 | 20.00 | 38.11 |
| Prompt 4 | 65.00 | 31.40 | 28.10 | 41.50 |
| Prompt 5 | 65.00 | 29.32 | 20.01 | 38.11 |
| Prompt 6 | 80.00 | 31.40 | 20.00 | 43.80 |
| Task | Type | H | Holm | ||
|---|---|---|---|---|---|
| Prisoner Challenge | Accuracy | 19.58 | 0.012 | 0.048 | 0.24 |
| Message | Accuracy | 17.16 | 0.029 | 0.086 | 0.21 |
| Migrations | Accuracy | 7.07 | 0.529 | 1.000 | 0.09 |
| Maximum Clique Size | Speed | 2.35 | 0.968 | 1.000 | 0.03 |
| Number Partitioning † | Speed | 20.77 | 0.008 | 0.039 | 0.26 |
| † Confounded with grading order; see Section V-C . | |||||
| Prompt | Maximum Clique Size | Number Partitioning | Average |
|---|---|---|---|
| Prompt 1 | 65.35 | 80.27 | 72.81 |
| Prompt 2 | 72.32 | 79.59 | 75.96 |
| Prompt 3 | 69.65 | 87.30 | 78.47 |
| Prompt 4 | 58.74 | 78.68 | 68.71 |
| Prompt 5 | 61.16 | 78.91 | 70.04 |
| Prompt 6 | 62.02 | 84.58 | 73.30 |
| Prompt | Maximum Clique Size | Number Partitioning | Average |
|---|---|---|---|
| Prompt 1 | 67.27 | 91.84 | 79.56 |
| Prompt 2 | 80.00 | 87.76 | 83.88 |
| Prompt 3 | 67.27 | 87.76 | 77.52 |
| Prompt 4 | 58.18 | 87.76 | 72.97 |
| Prompt 5 | 67.27 | 87.76 | 77.52 |
| Prompt 6 | 58.18 | 87.76 | 72.97 |
LLM Prompting
Large language model prompting studies how instructions, examples, context, and formats steer model behavior at inference time.
See all 429 papers