group_id stringlengths 12 18 | problem_description stringlengths 85 3.02k | candidates listlengths 3 20 |
|---|---|---|
aoj_ALDS1_1_B_cpp | Greatest Common Divisor
Write a program which finds the greatest common divisor of two natural numbers
a
and
b
Input
a
and
b
are given in a line sparated by a single space.
Output
Output the greatest common divisor of
a
and
b
.
Constrants
1 ≤
a
,
b
≤ 10
9
Hint
You can use the following observation:
For integers
x
and
y... | [
{
"submission_id": "aoj_ALDS1_1_B_10915851",
"code_snippet": "#include <iostream>\nusing namespace std;\n\nint main(){\n int x, y; cin >> x >> y;\n int d = 2;\n int gcd = 1;\n\n while(d <= x && d <= y){\n if (x % d == 0 && y % d == 0){\n x = x / d;\n y = y / d;\n ... |
aoj_ALDS1_2_D_cpp | Shell Sort
Shell Sort is a generalization of Insertion Sort (ALDS1_1_A) to arrange a list of $n$ elements $A$.
1 insertionSort(A, n, g)
2 for i = g to n-1
3 v = A[i]
4 j = i - g
5 while j >= 0 && A[j] > v
6 A[j+g] = A[j]
7 j = j - g
8 cnt++
9 ... | [
{
"submission_id": "aoj_ALDS1_2_D_11015424",
"code_snippet": "#include <iostream>\n#include <bits/stdc++.h>\n\nusing namespace std;\n\nclass my_vector\n{\nprivate: // 隠すもの。外から見えない\n int *a; // 可変長配列\n int n; // 要素数\n int capacity; // 確保する容量\n\npublic: // 公開するもの\n my... |
aoj_ALDS1_1_D_cpp | Maximum Profit
You can obtain profits from foreign exchange margin transactions. For example, if you buy 1000 dollar at a rate of 100 yen per dollar, and sell them at a rate of 108 yen per dollar, you can obtain (108 - 100) × 1000 = 8000 yen.
Write a program which reads values of a currency $R_t$ at a certain time $t$... | [
{
"submission_id": "aoj_ALDS1_1_D_11066075",
"code_snippet": "#include<iostream>\nusing namespace std;\nint main ( ) {\n\tint n = 0, min = 0, result = -1000000000, temp = 0;\n\tcin >> n;\n\tcin >> min;\n\tfor (int i = 0; i < n-1; i++) {\n\t\tcin >> temp;\n\t\tif (temp - min > result) {\n\t\t\tresult = temp ... |
aoj_ALDS1_1_C_cpp | Prime Numbers
A prime number is a natural number which has exactly two distinct natural number divisors: 1 and itself. For example, the first four prime numbers are: 2, 3, 5 and 7.
Write a program which reads a list of
N
integers and prints the number of prime numbers in the list.
Input
The first line contains an integ... | [
{
"submission_id": "aoj_ALDS1_1_C_11063301",
"code_snippet": "#include<bits/stdc++.h> \nusing namespace std;\nint gcd(int a, int b) {\n while (b != 0) {\n int temp = b;\n b = a % b;\n a = temp;\n }\n return a;\n}\nint lcm(int a, int b) {\n return a / gcd(a, b) * b;\n}\nint m... |
aoj_ALDS1_4_C_cpp | Search III
Your task is to write a program of a simple
dictionary
which implements the following instructions:
insert
str
: insert a string
str
in to the dictionary
find
str
: if the distionary contains
str
, then print '
yes
', otherwise print '
no
'
Input
In the first line
n
, the number of instructions is given. In ... | [
{
"submission_id": "aoj_ALDS1_4_C_11057022",
"code_snippet": "// ██████████████████╗█████╗███╗ ██╗ ██████╗ █████╗████╗ ██╗█████╗███╗ ██╗\n// ╚══██╔══██╚══██╔══██╔══██████╗ ██║ ██╔══████╔══████╚██╗ ██╔██╔══██████╗ ██║\n// ██║ ██║ ██║ █████████╔██╗ ██║ ██████╔█████████║╚████╔╝█████████╔... |
aoj_ALDS1_4_B_cpp | Search II
You are given a sequence of
n
integers S and a sequence of different
q
integers T. Write a program which outputs C, the number of integers in T which are also in the set S.
Input
In the first line
n
is given. In the second line,
n
integers are given. In the third line
q
is given. Then, in the fourth line,
q
i... | [
{
"submission_id": "aoj_ALDS1_4_B_11066403",
"code_snippet": "#include <bits/stdc++.h>\nusing namespace std;\n#define ll long long\n\nint main() {\n int n,q; cin>>n;\n int s[n+5], t;\n int count=0;\n\n for(int i =1; i<=n;i++){\n cin>>s[i];\n }\n cin>>q;\n for(int i=1;i<=q;i++){\n... |
aoj_ALDS1_3_C_cpp | Doubly Linked List
Your task is to implement a double linked list.
Write a program which performs the following operations:
insert x: insert an element with key x into the front of the list.
delete x: delete the first element which has the key of x from the list. If there is not such element, you need not do anything.
... | [
{
"submission_id": "aoj_ALDS1_3_C_11042443",
"code_snippet": "#include <bits/stdc++.h>\n\nusing namespace std;\n\nint n, x;\nstring s;\nlist<int> l;\n\nint main() {\n ios::sync_with_stdio(false);\n cin.tie(0); cout.tie(0);\n\n cin >> n;\n while(n--) {\n cin >> s;\n if(s == \"insert... |
aoj_ALDS1_4_D_cpp | "Allocation\nYou are given $n$ packages of $w_i$ kg from a belt conveyor in order ($i = 0, 1, ... n-(...TRUNCATED) | [{"submission_id":"aoj_ALDS1_4_D_10995248","code_snippet":"#include<iostream>\n#include<vector>\n#in(...TRUNCATED) |
aoj_ALDS1_3_B_cpp | "There are\nn\nprocesses in a queue. Each process has name\ni\nand time\ni\n. The round-robin sched(...TRUNCATED) | [{"submission_id":"aoj_ALDS1_3_B_11064149","code_snippet":"#include <bits/stdc++.h>\nusing namespace(...TRUNCATED) |
aoj_ALDS1_5_A_cpp | "Exhaustive Search\nWrite a program which reads a sequence\nA\nof\nn\nelements and an integer\nM\n, (...TRUNCATED) | [{"submission_id":"aoj_ALDS1_5_A_11061393","code_snippet":"# include <stdio.h>\n\nstatic int N, A[50(...TRUNCATED) |
AOJ-CodeRank-Benchmark: Hybrid Efficiency Ranking Benchmark Dataset
1. Overview
This dataset (AOJ-CodeRank-Benchmark) was created to evaluate the capability of Large Language Models (LLMs) in code efficiency ranking tasks using a high-quality, structured benchmark.
The dataset is built entirely on code submission records from Aizu Online Judge (AOJ), strictly adhering to the principle of correctness first, efficiency second.
- Problem Scope: ALDS1 (Fundamental Algorithms), DSL/GRL/CGL (Advanced Data Structures/Graphs), and Volume 0000-3299 (Classic Contest Problems).
- Core Feature: Eliminates 0ms submissions and low-quality/non-unique submissions, ensuring true time differentiation across all data groups.
2. Data Structure
The dataset uses the JSON Lines (.jsonl) format. Each line represents a single Task Group object.
Structure Preview (Candidates):
| Field Name | Type | Description |
|---|---|---|
submission_id |
string | Unique Submission ID. |
code_snippet |
string | The complete C++ source code. |
accuracy |
float | Accuracy Score (0.0 to 1.0). |
time_ms |
integer | Actual Execution Time (in milliseconds). |
score_of_the_acc |
float | Normalized Efficiency Score (Range -2.0 to 0.0). |
final_rank |
integer | Final Competition Rank (1, 2, 3...). |
3. Ground Truth (GT) Scoring and Ranking Logic 🏆
The LLM's objective is to predict the final_rank. This ranking is derived from a unique two-tiered system:
Phase I: Efficiency Score (score_of_the_acc)
This score is a purely performance-based metric, calculating the normalized inverse sum of Time and Memory costs within the task group.
(Note: Score is between -2.0 and 0.0. A score closer to 0.0 is better.)
Phase II: Final Ranking (final_rank) Mechanism
The final rank is determined by a lexicographical sort (Standard Competition Ranking) using the following priority:
- Primary Sort Key (Accuracy):
accuracy(Descending). - Secondary Sort Key (Efficiency):
score_of_the_acc(Descending).
Tie-Breaking: Submissions with identical Accuracy and Efficiency Score receive the same rank (1-2-2-4 rule).
4. Usage Example
from datasets import load_dataset
# Load the dataset and access the candidates list
dataset = load_dataset("Slime/AOJ-CodeRank-Benchmark", data_files="train.jsonl", split="train")
# The LLM sorting algorithm will receive task['candidates'] for ranking
for task in dataset:
candidates = task['candidates']
# Algorithm generates predicted_rank for candidates
# Evaluation compares predicted_rank against ground_truth['final_rank']
5. Acknowledgments
Original submission records and problem context are sourced from Aizu Online Judge (AOJ).
- Downloads last month
- 13