Narek has to spend 2 hours with some 2-year-old kids at the kindergarten. He wants to teach them competitive programming, and their first lesson is about palindromes. Narek found out that the kids only know the vowels of the English alphabet (the letters $\mathtt{a}$, $\mathtt{e}$, $\mathtt{i}$, $\mathtt{o}$, and $\mathtt{u}$), so Narek needs to make a string that consists of vowels only. After making the string, he'll ask the kids to count the number of subsequences that are palindromes. Narek wants to keep it simple, so he's looking for a string such that the amount of palindrome subsequences is minimal. Help Narek find a string of length $n$, consisting of lowercase English vowels only (letters $\mathtt{a}$, $\mathtt{e}$, $\mathtt{i}$, $\mathtt{o}$, and $\mathtt{u}$), which minimizes the amount of palindrome$^{\dagger}$ subsequences$^{\ddagger}$ in it. $^{\dagger}$ A string is called a palindrome if it reads the same from left to right and from right to left. $^{\ddagger}$ String $t$ is a subsequence of string $s$ if $t$ can be obtained from $s$ by removing several (possibly, zero or all) characters from $s$ and concatenating the remaining ones, without changing their order. For example, $\mathtt{odocs}$ is a subsequence of $\texttt{c}{\color{red}{\texttt{od}}}\texttt{ef}{\color{red}{\texttt{o}}}\texttt{r}{\color{red}{\texttt{c}}}\texttt{e}{\color{red}{\texttt{s}}}$.

CodeElo: Benchmarking Competition-level Code Generation of LLMs with Human-comparable Elo Ratings

Logo
Great acknowledgment to Mike Mirzayanov for creating the remarkable Codeforces platform.

Introduction of CodeElo Benchmark

With the increasing code reasoning capabilities of existing large language models (LLMs) and breakthroughs in reasoning models like OpenAI o1 and o3, there is a growing need to develop more challenging and comprehensive benchmarks that effectively test their sophisticated competition-level coding abilities. Existing benchmarks, like LiveCodeBench and USACO, fall short due to the unavailability of private test cases, lack of support for special judges, and misaligned execution environments. To bridge this gap, we introduce CodeElo, a standardized competition-level code generation benchmark that effectively addresses all these challenges for the first time. CodeElo benchmark is mainly based on the official CodeForces platform and tries to align with the platform as much as possible. We compile the recent six months of contest problems on CodeForces with detailed information such as contest divisions, problem difficulty ratings, and problem algorithm tags. We introduce a unique judging method in which problems are submitted directly to the platform and develop a reliable Elo rating calculation system that aligns with the platform and is comparable with human participants but has lower variance. By testing on our CodeElo, we provide the Elo ratings of 30 existing popular open-source and 3 proprietary LLMs for the first time. The results show that o1-mini and QwQ-32B-Preview stand out significantly, achieving Elo ratings of 1578 and 1261, respectively, while other models struggle even with the easiest problems, placing in the lowest 20 percent among all human participants. Detailed analysis experiments are also conducted to provide insights into performance across algorithms and comparisons between using C++ and Python, which can suggest directions for further studies.


🏆 Leaderboard

Model Size Elo Rating Pass Rate Pass@n Tags
Rating Percentile Div. 1 + 2 Div. 2 Div. 3 Div. 4 Easy Medium Hard 1 2 4 8 greedy math implementation brute force dp data structures constructive algorithms binary search sortings graphs dfs and similar number theory trees combinatorics two pointers bitmasks

🔍 Data Explorer