Manuscript Offprint

arXiv:2610.30223

How Prompt Style Affects AI Accuracy and Speed in Competitive Programming

Saad B. Alarifi, Mohammed A. Alam

Saad B. Alarifi

Riyadh Schools

Riyadh, Saudi Arabia

saadalarifi2009@gmail.com

Mohammed A. Alam

Department of Computer Science

Northwestern University

Evanston, IL, USA

mohammed.alam@northwestern.edu

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.

I. INTRODUCTION

Large language models have become increasingly capable at code generation and competitive programming. At the same time, their outputs are known to be sensitive to how a prompt is phrased; prior work has found that even meaning-preserving changes in prompt formatting can shift model performance substantially [1]. This raises a natural question: does the way a competitive programming task is phrased to an AI change how well it solves the task?

Prior work has examined how prompting techniques affect performance on software engineering tasks [2], and has separately measured AI problem-solving ability in competitive programming without comparing prompt styles [3], [4]. Prompt strategies have been compared for accuracy on competitive programming problems [5], but not for runtime speed. We address this gap by comparing nine prompt styles across both accuracy and speed. To ground these results, we also situate the AI's accuracy against human contestants at the International Olympiad in Informatics (IOI), an annual competitive programming olympiad for secondary-school students [6].

In this exploratory study, we evaluated nine prompt styles on five competitive programming tasks: three IOI tasks measuring accuracy and two NP-hard tasks measuring speed [6]–[10]. To account for run-to-run variability, each prompt style was run nine times per task. This paper makes three contributions.

First, it compares prompt styles on speed, measured as the largest input a solution can handle within a time limit, as well as on accuracy. No single prompt style performed best across all tasks: the strongest style depended both on the task type (accuracy versus speed) and on the metric used to summarize it (mean versus median). The “best prompt” is therefore not a stable property but one that depends on how performance is measured.

Second, it examines how much of the difference between prompt styles is consistent and how much comes from individual runs. After correcting for testing five tasks, prompt style had a statistically significant effect on only two of them, and many differences in mean scores were driven by a minority of outlier runs rather than consistent effects. Comparisons of prompts based on a single summary score can therefore be misleading.

Third, it situates the AI’s accuracy against human IOI contestants as descriptive context. The AI was neither strictly better nor strictly worse: it exceeded the average contestant on one task while falling short on the other two, and remained below gold-medalist level throughout. How the AI compares to humans therefore depends heavily on which task is used.

All prompts, generated solutions, grading scripts, and speed test cases are publicly released, so the study can be re-analyzed or extended with more prompts, runs, and models.

References (26)