Datasets:
inst_id stringlengths 3 46 | split stringclasses 1
value | description stringlengths 224 7.95k | time_limit_ms int64 500 10k | memory_limit_mb int64 16 1.07k | solution_a dict | solution_b dict | selection dict | judgement dict | source_batch stringclasses 2
values |
|---|---|---|---|---|---|---|---|---|---|
1003_A | train | Polycarp has n coins, the value of the i-th coin is a_i. Polycarp wants to distribute all the coins between his pockets, but he cannot put two coins with the same value into the same pocket.
For example, if Polycarp has got six coins represented as an array a = [1, 2, 4, 3, 3, 2], he can distribute the coins into two ... | 1,000 | 256 | {
"solution_idx": 109,
"prog_id": 713,
"provenance": "E",
"code": "#include <bits/stdc++.h>\nint p[100];\nint main() {\n int n, a[100], cnt = 1, max = 0;\n scanf(\"%d\", &n);\n for (int i = 0; i < n; i++) scanf(\"%d\", &a[i]);\n for (int i = 1; i < n; i++) {\n for (int j = 0; j < n - i; j++) {\n if ... | {
"solution_idx": 232,
"prog_id": 1619,
"provenance": "P",
"code": "#include <bits/stdc++.h>\nusing namespace std;\nusing ll = long long;\nconst int MOD = 1000000007;\nvoid scan(int& a) { scanf(\"%d\", &a); }\nvoid scan(long long& a) { scanf(\"%lld\", &a); }\ntemplate <class T>\nvoid scan(T& a) {\n cin >> a;\n... | {
"funnel_score": 0.9449760765550239,
"n_pool": 233,
"pair_rank": 0
} | {
"outcome": "unanimous",
"n_judges": 2,
"n_different": 2,
"unanimous": true,
"votes": [
{
"judge": "flash_lite",
"rating": "distinct",
"different": true
},
{
"judge": "gpt54mini",
"rating": "very_distinct",
"different": true
}
]
} | build-10k |
1003_C | train | The heat during the last few days has been really intense. Scientists from all over the Berland study how the temperatures and weather change, and they claim that this summer is abnormally hot. But any scientific claim sounds a lot more reasonable if there are some numbers involved, so they have decided to actually cal... | 4,000 | 256 | {
"solution_idx": 58,
"prog_id": 178,
"provenance": "PE",
"code": "#include <bits/stdc++.h>\nusing namespace std;\nconst int INF = 1e9;\nconst int MAXN = 5000;\nstruct Point {\n int x, y;\n Point operator-(const Point &p) const { return {x - p.x, y - p.y}; }\n long long cross(const Point &p) const {\n ret... | {
"solution_idx": 144,
"prog_id": 388,
"provenance": "P",
"code": "#include <bits/stdc++.h>\nusing namespace std;\nusing namespace std::chrono;\nvoid solve() {\n long long int n, i, m = 0, q = 0, mx = -20000000000000000,\n mn = 20000000000000000, k = 0, j = 0, c = 0, d = 0, t = 0,\n ... | {
"funnel_score": 0.9555555555555556,
"n_pool": 176,
"pair_rank": 0
} | {
"outcome": "unanimous",
"n_judges": 2,
"n_different": 2,
"unanimous": true,
"votes": [
{
"judge": "flash_lite",
"rating": "very_distinct",
"different": true
},
{
"judge": "gpt54mini",
"rating": "very_distinct",
"different": true
}
]
} | build-10k |
1003_D | train | Polycarp has n coins, the value of the i-th coin is a_i. It is guaranteed that all the values are integer powers of 2 (i.e. a_i = 2^d for some non-negative integer number d).
Polycarp wants to know answers on q queries. The j-th query is described as integer number b_j. The answer to the query is the minimum number of... | 2,000 | 256 | {
"solution_idx": 22,
"prog_id": 38,
"provenance": "PE",
"code": "#include <bits/stdc++.h>\nusing namespace std;\nvoid __print(int x) { cerr << x; }\nvoid __print(long x) { cerr << x; }\nvoid __print(long long x) { cerr << x; }\nvoid __print(unsigned x) { cerr << x; }\nvoid __print(unsigned long x) { cerr << x;... | {
"solution_idx": 64,
"prog_id": 120,
"provenance": "R",
"code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n int n, k;\n cin >> n >> k;\n vector<int> v, u;\n unordered_map<int, int> m;\n for (int i = 0; i < n; i++) {\n int a;\n cin >> a;\n if (m.find(a) == m.end()) {\n v.p... | {
"funnel_score": 0.9676470588235294,
"n_pool": 184,
"pair_rank": 0
} | {
"outcome": "majority",
"n_judges": 3,
"n_different": 2,
"unanimous": false,
"votes": [
{
"judge": "flash_lite",
"rating": "distinct",
"different": true
},
{
"judge": "gpt54mini",
"rating": "identical",
"different": false
},
{
"judge": "haiku",
... | build-10k |
1003_E | train | You are given three integers n, d and k.
Your task is to construct an undirected tree on n vertices with diameter d and degree of each vertex at most k, or say that it is impossible.
An undirected tree is a connected undirected graph with n - 1 edges.
Diameter of a tree is the maximum length of a simple path (a path... | 4,000 | 256 | {
"solution_idx": 6,
"prog_id": 7,
"provenance": "E",
"code": "#include <bits/stdc++.h>\nusing namespace std;\nint n, d, k;\nint tot, cnt;\nvoid dfs(int u, int lev, int ch) {\n if (!lev) return;\n for (int i = (1); i <= (ch); i += (1)) {\n int v = ++cnt;\n printf(\"%d %d\\n\", u, v);\n if (cnt == tot... | {
"solution_idx": 23,
"prog_id": 37,
"provenance": "PE",
"code": "#include <bits/stdc++.h>\nusing namespace std;\nusing lint = long long;\nconst int inf = 1000000007;\nconst int MOD = 1000000007;\nstruct Node {\n int no;\n int par;\n int dist;\n bool flag;\n vector<Node*> child;\n void build(int i) {\n ... | {
"funnel_score": 0.9823529411764707,
"n_pool": 178,
"pair_rank": 0
} | {
"outcome": "unanimous",
"n_judges": 2,
"n_different": 2,
"unanimous": true,
"votes": [
{
"judge": "flash_lite",
"rating": "distinct",
"different": true
},
{
"judge": "gpt54mini",
"rating": "very_distinct",
"different": true
}
]
} | build-10k |
1003_F | train | You are given a text consisting of n space-separated words. There is exactly one space character between any pair of adjacent words. There are no spaces before the first word and no spaces after the last word. The length of text is the number of letters and spaces in it. w_i is the i-th word of text. All words consist ... | 1,000 | 256 | {
"solution_idx": 37,
"prog_id": 49,
"provenance": "E",
"code": "#include <bits/stdc++.h>\nusing namespace std;\nconst long long BASE1 = 123456789;\nconst long long BASE2 = 987654321;\nconst long long MOD = 998244353;\nconst int INF = 1000000;\nlong long modpow(long long a, long long b) {\n long long ans = 1;\... | {
"solution_idx": 100,
"prog_id": 134,
"provenance": "PE",
"code": "#include <bits/stdc++.h>\nusing namespace std;\nclass Solution {\n public:\n Solution() : _idx(), _a(), _c(), _len(), _total(-1) {}\n void add_word(const string& s) {\n _total += s.size() + 1;\n int i = get_idx(s);\n _a.push_back(i);... | {
"funnel_score": 0.9747899159663865,
"n_pool": 159,
"pair_rank": 0
} | {
"outcome": "unanimous",
"n_judges": 2,
"n_different": 2,
"unanimous": true,
"votes": [
{
"judge": "flash_lite",
"rating": "distinct",
"different": true
},
{
"judge": "gpt54mini",
"rating": "distinct",
"different": true
}
]
} | build-10k |
1004_A | train | Sonya decided that having her own hotel business is the best way of earning money because she can profit and rest wherever she wants.
The country where Sonya lives is an endless line. There is a city in each integer coordinate on this line. She has n hotels, where the i-th hotel is located in the city with coordinate ... | 1,000 | 256 | {
"solution_idx": 32,
"prog_id": 131,
"provenance": "P",
"code": "#include <bits/stdc++.h>\nusing namespace std;\ntemplate <typename A, typename B>\nstring to_string(pair<A, B> p);\ntemplate <typename A, typename B, typename C>\nstring to_string(tuple<A, B, C> p);\ntemplate <typename A, typename B, typename C, ... | {
"solution_idx": 185,
"prog_id": 698,
"provenance": "E",
"code": "#include <bits/stdc++.h>\nusing namespace std;\nlong long dx[4] = {-1, 0, 1, 0};\nlong long dy[4] = {0, 1, 0, -1};\nint main() {\n long long a[100005], t, i = 0, j, k, p, q, n, m, count = 0, flag = 0, ans = 0,\n sum = 0... | {
"funnel_score": 0.9555555555555555,
"n_pool": 230,
"pair_rank": 0
} | {
"outcome": "unanimous",
"n_judges": 2,
"n_different": 2,
"unanimous": true,
"votes": [
{
"judge": "flash_lite",
"rating": "distinct",
"different": true
},
{
"judge": "gpt54mini",
"rating": "very_distinct",
"different": true
}
]
} | build-10k |
1004_B | train | Sonya decided to organize an exhibition of flowers. Since the girl likes only roses and lilies, she decided that only these two kinds of flowers should be in this exhibition.
There are n flowers in a row in the exhibition. Sonya can put either a rose or a lily in the i-th position. Thus each of n positions should cont... | 1,000 | 256 | {
"solution_idx": 205,
"prog_id": 594,
"provenance": "E",
"code": "#include <bits/stdc++.h>\nusing namespace std;\nint main(int argc, char const *argv[]) {\n ios_base::sync_with_stdio(false);\n cin.tie(NULL);\n int n, m;\n cin >> n >> m;\n vector<vector<int> > G(n + 5, vector<int>(0));\n int c[m + 5][2];\... | {
"solution_idx": 223,
"prog_id": 660,
"provenance": "P",
"code": "#include <bits/stdc++.h>\nlong long dx[4] = {0, -1, 0, 1};\nlong long dy[4] = {1, 0, -1, 0};\nusing namespace std;\nclass pa3 {\n public:\n long long x, y, z;\n pa3(long long x = 0, long long y = 0, long long z = 0) : x(x), y(y), z(z) {}\n bo... | {
"funnel_score": 0.95,
"n_pool": 228,
"pair_rank": 0
} | {
"outcome": "unanimous",
"n_judges": 2,
"n_different": 2,
"unanimous": true,
"votes": [
{
"judge": "flash_lite",
"rating": "very_distinct",
"different": true
},
{
"judge": "gpt54mini",
"rating": "distinct",
"different": true
}
]
} | build-10k |
1004_C | train | Since Sonya is interested in robotics too, she decided to construct robots that will read and recognize numbers.
Sonya has drawn n numbers in a row, a_i is located in the i-th position. She also has put a robot at each end of the row (to the left of the first number and to the right of the last number). Sonya will giv... | 1,000 | 256 | {
"solution_idx": 83,
"prog_id": 183,
"provenance": "P",
"code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n int n, temp;\n long long cou = 0;\n cin >> n;\n multiset<int> b;\n set<int> a;\n set<int> d;\n map<int, int> t;\n vector<int> r;\n for (int i = 0; i < n; i++) {\n cin >> t... | {
"solution_idx": 189,
"prog_id": 445,
"provenance": "PE",
"code": "#include <bits/stdc++.h>\nusing namespace std;\nlong long Set(long long n, long long pos) { return n | (1LL << pos); }\nbool Check(long long n, long long pos) { return (bool)(n & (1LL << pos)); }\nlong long ar[100010];\nlong long tree[400010];\... | {
"funnel_score": 0.9539473684210527,
"n_pool": 223,
"pair_rank": 0
} | {
"outcome": "unanimous",
"n_judges": 2,
"n_different": 2,
"unanimous": true,
"votes": [
{
"judge": "flash_lite",
"rating": "distinct",
"different": true
},
{
"judge": "gpt54mini",
"rating": "distinct",
"different": true
}
]
} | build-10k |
1004_D | train | Since Sonya has just learned the basics of matrices, she decided to play with them a little bit.
Sonya imagined a new type of matrices that she called rhombic matrices. These matrices have exactly one zero, while all other cells have the Manhattan distance to the cell containing the zero. The cells with equal numbers ... | 2,000 | 256 | {
"solution_idx": 83,
"prog_id": 99,
"provenance": "P",
"code": "#include <bits/stdc++.h>\nusing namespace std;\nint a[1000000];\nint main() {\n int i, f, m;\n bool z;\n int x, y, lx, ly, rx, ry;\n int t;\n scanf(\"%i\", &t);\n memset(a, 0, sizeof(int) * 1000000);\n m = 0;\n for (i = 0; i < t; i++) {\n ... | {
"solution_idx": 155,
"prog_id": 185,
"provenance": "E",
"code": "#include <bits/stdc++.h>\nusing namespace std;\nvector<long long> v;\nlong long t;\nvoid test(long long up, long long lf, long long dn, long long rg) {\n long long w, h;\n if (dn == -1) {\n w = lf + rg + 1;\n if (t % w != 0) return;\n ... | {
"funnel_score": 0.8492063492063492,
"n_pool": 175,
"pair_rank": 0
} | {
"outcome": "unanimous",
"n_judges": 2,
"n_different": 2,
"unanimous": true,
"votes": [
{
"judge": "flash_lite",
"rating": "distinct",
"different": true
},
{
"judge": "gpt54mini",
"rating": "distinct",
"different": true
}
]
} | build-10k |
1004_E | train | Sonya likes ice cream very much. She eats it even during programming competitions. That is why the girl decided that she wants to open her own ice cream shops.
Sonya lives in a city with n junctions and n-1 streets between them. All streets are two-way and connect two junctions. It is possible to travel from any junct... | 2,000 | 256 | {
"solution_idx": 71,
"prog_id": 86,
"provenance": "E",
"code": "#include <bits/stdc++.h>\nusing namespace std;\nlong long N, K;\nlong long sz[100010], U[100010], D[100010];\nvector<pair<int, int>> adjlist[100010];\nbool check_diam(int x) {\n queue<int> q;\n long long s = 0, counter = N;\n for (int i = 1; i ... | {
"solution_idx": 157,
"prog_id": 182,
"provenance": "PE",
"code": "#include <bits/stdc++.h>\nusing namespace std;\nint n, m, first[100100], bb, mx[100100], m2[100100], up[100100], son[100100],\n fa[100100], need[100100], gen, t, t2, l, r, lx, rx, lt, rt, ans;\nbool use[100100];\npair<int, int> tmp;\nstruct ... | {
"funnel_score": 0.9323529411764706,
"n_pool": 169,
"pair_rank": 0
} | {
"outcome": "unanimous",
"n_judges": 2,
"n_different": 2,
"unanimous": true,
"votes": [
{
"judge": "flash_lite",
"rating": "distinct",
"different": true
},
{
"judge": "gpt54mini",
"rating": "very_distinct",
"different": true
}
]
} | build-10k |
1004_F | train | Sonya has an array a_1, a_2, …, a_n consisting of n integers and also one non-negative integer x. She has to perform m queries of two types:
* 1 i y: replace i-th element by value y, i.e. to perform an operation a_{i} := y;
* 2 l r: find the number of pairs (L, R) that l≤ L≤ R≤ r and bitwise OR of all integers in... | 4,000 | 512 | {
"solution_idx": 117,
"prog_id": 122,
"provenance": "P",
"code": "#include <bits/stdc++.h>\nusing namespace std;\nlong long N, M, X;\ntemplate <typename T, typename F>\nstruct SEGMENT_TREE {\n long long Li, Ri;\n long long pt = 0;\n vector<T> ST;\n vector<long long> L;\n vector<long long> R;\n vector<boo... | {
"solution_idx": 141,
"prog_id": 147,
"provenance": "P",
"code": "#include <bits/stdc++.h>\nusing namespace std;\nconst long long N = 1e6 + 5;\nlong long n, m, val, a[N], tree[N * 4], tree2[N * 4], lazy[N * 4];\ninline long long read() {\n long long res = 0, f = 1;\n char c = getchar();\n while (!isdigit(c)... | {
"funnel_score": 0.9769736842105263,
"n_pool": 151,
"pair_rank": 0
} | {
"outcome": "unanimous",
"n_judges": 2,
"n_different": 2,
"unanimous": true,
"votes": [
{
"judge": "flash_lite",
"rating": "distinct",
"different": true
},
{
"judge": "gpt54mini",
"rating": "distinct",
"different": true
}
]
} | build-10k |
1005_A | train | Little girl Tanya climbs the stairs inside a multi-storey building. Every time Tanya climbs a stairway, she starts counting steps from 1 to the number of steps in this stairway. She speaks every number aloud. For example, if she climbs two stairways, the first of which contains 3 steps, and the second contains 4 steps,... | 1,000 | 256 | {
"solution_idx": 69,
"prog_id": 400,
"provenance": "P",
"code": "#include <bits/stdc++.h>\nint main() {\n int num, i, j, c = 0, d = 0, e;\n scanf(\"%d\", &num);\n int a[num];\n for (i = 0; i < num; i++) {\n scanf(\"%d\", &a[i]);\n if (a[i] == 1) {\n c++;\n }\n }\n int b[c];\n for (i = 0; i... | {
"solution_idx": 86,
"prog_id": 469,
"provenance": "E",
"code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n ios_base::sync_with_stdio(false);\n cin.tie(0);\n cout.tie(0);\n int TESTS = 1;\n while (TESTS--) {\n long long n;\n cin >> n;\n vector<long long int> a(n);\n for (lo... | {
"funnel_score": 0.861764705882353,
"n_pool": 254,
"pair_rank": 1
} | {
"outcome": "majority",
"n_judges": 3,
"n_different": 2,
"unanimous": false,
"votes": [
{
"judge": "flash_lite",
"rating": "distinct",
"different": true
},
{
"judge": "gpt54mini",
"rating": "variation",
"different": false
},
{
"judge": "haiku",
... | build-10k |
1005_D | train | Polycarp likes numbers that are divisible by 3.
He has a huge number s. Polycarp wants to cut from it the maximum number of numbers that are divisible by 3. To do this, he makes an arbitrary number of vertical cuts between pairs of adjacent digits. As a result, after m such cuts, there will be m+1 parts in total. Poly... | 3,000 | 256 | {
"solution_idx": 55,
"prog_id": 140,
"provenance": "P",
"code": "#include <bits/stdc++.h>\nusing namespace std;\nint sif(char c) { return c - '0'; }\nchar s[200005];\nint c[200005];\nbool zauz[200005];\nint main() {\n int i, n, br = 0;\n scanf(\"%s\", s);\n n = strlen(s);\n for (i = 0; i < n; i++) {\n c... | {
"solution_idx": 180,
"prog_id": 531,
"provenance": "E",
"code": "#include <bits/stdc++.h>\nusing namespace std;\nvoid Fast() { ios_base::sync_with_stdio(0), cin.tie(0), cout.tie(0); }\nvoid File() {}\nint gcd(int a, int b) {\n if (b == 0) return a;\n return gcd(b, a % b);\n}\nint lcm(int a, int b) { return ... | {
"funnel_score": 0.9576719576719577,
"n_pool": 185,
"pair_rank": 0
} | {
"outcome": "unanimous",
"n_judges": 2,
"n_different": 2,
"unanimous": true,
"votes": [
{
"judge": "flash_lite",
"rating": "very_distinct",
"different": true
},
{
"judge": "gpt54mini",
"rating": "very_distinct",
"different": true
}
]
} | build-10k |
1005_E1 | train | You are given a permutation p_1, p_2, ..., p_n. A permutation of length n is a sequence such that each integer between 1 and n occurs exactly once in the sequence.
Find the number of pairs of indices (l, r) (1 ≤ l ≤ r ≤ n) such that the value of the median of p_l, p_{l+1}, ..., p_r is exactly the given number m.
The ... | 3,000 | 256 | {
"solution_idx": 111,
"prog_id": 170,
"provenance": "P",
"code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n ios::sync_with_stdio(false);\n cin.tie(0);\n long long int n, m, ind = -1;\n cin >> n >> m;\n map<long long int, long long int> premp, sufmp;\n vector<long long int> a(n);\n v... | {
"solution_idx": 279,
"prog_id": 460,
"provenance": "PE",
"code": "#include <bits/stdc++.h>\nusing namespace std::chrono;\nusing namespace std;\nbool IOerror = 0;\ninline char nc() {\n static char buf[1000000], *p1 = buf + 1000000, *pend = buf + 1000000;\n if (p1 == pend) {\n p1 = buf;\n pend = buf + f... | {
"funnel_score": 0.9481481481481482,
"n_pool": 282,
"pair_rank": 0
} | {
"outcome": "unanimous",
"n_judges": 2,
"n_different": 2,
"unanimous": true,
"votes": [
{
"judge": "flash_lite",
"rating": "very_distinct",
"different": true
},
{
"judge": "gpt54mini",
"rating": "very_distinct",
"different": true
}
]
} | build-10k |
1005_E2 | train | You are given an integer sequence a_1, a_2, ..., a_n.
Find the number of pairs of indices (l, r) (1 ≤ l ≤ r ≤ n) such that the value of median of a_l, a_{l+1}, ..., a_r is exactly the given number m.
The median of a sequence is the value of an element which is in the middle of the sequence after sorting it in non-dec... | 3,000 | 256 | {
"solution_idx": 110,
"prog_id": 137,
"provenance": "P",
"code": "#include <bits/stdc++.h>\nusing namespace std;\nvoid toFile(string name) {\n freopen((name + \".inp\").c_str(), \"r\", stdin);\n freopen((name + \".out\").c_str(), \"w\", stdout);\n}\nlong long ceil(long long a, long long x) {\n return (a % x... | {
"solution_idx": 114,
"prog_id": 141,
"provenance": "PE",
"code": "#include <bits/stdc++.h>\nusing namespace std::chrono;\nusing namespace std;\nbool IOerror = 0;\ninline char nc() {\n static char buf[1000000], *p1 = buf + 1000000, *pend = buf + 1000000;\n if (p1 == pend) {\n p1 = buf;\n pend = buf + f... | {
"funnel_score": 0.7962962962962963,
"n_pool": 137,
"pair_rank": 1
} | {
"outcome": "unanimous",
"n_judges": 2,
"n_different": 2,
"unanimous": true,
"votes": [
{
"judge": "flash_lite",
"rating": "distinct",
"different": true
},
{
"judge": "gpt54mini",
"rating": "distinct",
"different": true
}
]
} | build-10k |
1005_F | train | There are n cities in Berland. Some pairs of cities are connected by roads. All roads are bidirectional. Each road connects two different cities. There is at most one road between a pair of cities. The cities are numbered from 1 to n.
It is known that, from the capital (the city with the number 1), you can reach any o... | 5,000 | 256 | {
"solution_idx": 66,
"prog_id": 76,
"provenance": "P",
"code": "#include <bits/stdc++.h>\nusing namespace std;\nint n, m, k;\nstruct Edge {\n int a, b;\n};\nEdge edges[200010];\nstruct Node {\n std::vector<int> connectEdges;\n std::vector<int> connectNodes;\n int depth;\n std::vector<int> parentEdges;\n ... | {
"solution_idx": 89,
"prog_id": 110,
"provenance": "E",
"code": "#include <bits/stdc++.h>\nusing namespace std;\nusing ll = long long;\nusing pii = pair<int, int>;\nusing vi = vector<int>;\nusing vll = vector<ll>;\nint N, M, K;\nvector<string> ans;\nvoid f(int u, vector<vi> &cand, string &re, vi &U, vi &V) {\n... | {
"funnel_score": 0.9603174603174602,
"n_pool": 176,
"pair_rank": 0
} | {
"outcome": "unanimous",
"n_judges": 2,
"n_different": 2,
"unanimous": true,
"votes": [
{
"judge": "flash_lite",
"rating": "distinct",
"different": true
},
{
"judge": "gpt54mini",
"rating": "distinct",
"different": true
}
]
} | build-10k |
1006_A | train | Mishka got an integer array a of length n as a birthday present (what a surprise!).
Mishka doesn't like this present and wants to change it somehow. He has invented an algorithm and called it "Mishka's Adjacent Replacements Algorithm". This algorithm can be represented as a sequence of steps:
* Replace each occurre... | 1,000 | 256 | {
"solution_idx": 35,
"prog_id": 203,
"provenance": "E",
"code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n int tc;\n cin >> tc;\n while (tc--) {\n int n;\n cin >> n;\n if (n % 2 == 0)\n cout << n - 1 << \" \";\n else\n cout << n << \" \";\n }\n return 0;\n}\n",
... | {
"solution_idx": 262,
"prog_id": 1399,
"provenance": "P",
"code": "#include <bits/stdc++.h>\nusing namespace std;\nvector<int> rep(vector<int>& y) {\n int x, yy, firstdec, firstdig, removed;\n for (int i = 0; i < y.size(); i++) {\n x = y[i] % 10;\n yy = (y[i] - x) / 10;\n if (yy == 0) {\n if (y... | {
"funnel_score": 0.9814814814814814,
"n_pool": 267,
"pair_rank": 0
} | {
"outcome": "unanimous",
"n_judges": 2,
"n_different": 2,
"unanimous": true,
"votes": [
{
"judge": "flash_lite",
"rating": "distinct",
"different": true
},
{
"judge": "gpt54mini",
"rating": "very_distinct",
"different": true
}
]
} | build-10k |
1006_B | train | Polycarp is practicing his problem solving skill. He has a list of n problems with difficulties a_1, a_2, ..., a_n, respectively. His plan is to practice for exactly k days. Each day he has to solve at least one problem from his list. Polycarp solves the problems in the order they are given in his list, he cannot skip ... | 2,000 | 256 | {
"solution_idx": 11,
"prog_id": 59,
"provenance": "P",
"code": "#include <bits/stdc++.h>\nusing namespace std;\nvector<int> resp;\nvector<int> der_2;\nvector<int> izq_2;\nvector<int> vec;\nvector<int> der;\nvector<int> izq;\nvector<int> sol;\nvoid Merge(int p, int q, int r) {\n der.resize(q - p + 1);\n izq.r... | {
"solution_idx": 40,
"prog_id": 163,
"provenance": "P",
"code": "#include <bits/stdc++.h>\nusing namespace std;\nint N, K;\nint arr[2000][2] = {0};\nint profit[2000][2] = {0};\nint minInfo[2] = {0};\nvoid getMin() {\n int temp;\n int idx;\n for (int i = 0; i < K; i++) {\n if (i == 0) {\n temp = prof... | {
"funnel_score": 0.9206349206349207,
"n_pool": 201,
"pair_rank": 1
} | {
"outcome": "majority",
"n_judges": 3,
"n_different": 2,
"unanimous": false,
"votes": [
{
"judge": "flash_lite",
"rating": "identical",
"different": false
},
{
"judge": "gpt54mini",
"rating": "distinct",
"different": true
},
{
"judge": "haiku",
... | build-10k |
1006_C | train | You are given an array d_1, d_2, ..., d_n consisting of n integer numbers.
Your task is to split this array into three parts (some of which may be empty) in such a way that each element of the array belongs to exactly one of the three parts, and each of the parts forms a consecutive contiguous subsegment (possibly, em... | 1,000 | 256 | {
"solution_idx": 32,
"prog_id": 164,
"provenance": "E",
"code": "#include <bits/stdc++.h>\nconst int M = 1e9 + 7;\nusing namespace std;\nlong long power(long long a, long long b) {\n int result = 1;\n while (b > 0) {\n if (b % 2 == 1) {\n result *= a;\n }\n a *= a;\n b /= 2;\n }\n return r... | {
"solution_idx": 86,
"prog_id": 374,
"provenance": "P",
"code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n int n;\n deque<long> dq;\n long a;\n long long s1 = 0, s2 = 0, s3 = 0;\n cin >> n;\n for (int i = 0; i < n; i++) {\n cin >> a;\n dq.push_back(a);\n }\n int l = dq.size()... | {
"funnel_score": 0.9391534391534391,
"n_pool": 198,
"pair_rank": 0
} | {
"outcome": "unanimous",
"n_judges": 2,
"n_different": 2,
"unanimous": true,
"votes": [
{
"judge": "flash_lite",
"rating": "distinct",
"different": true
},
{
"judge": "gpt54mini",
"rating": "very_distinct",
"different": true
}
]
} | build-10k |
1006_E | train | In this problem you will have to help Berland army with organizing their command delivery system.
There are n officers in Berland army. The first officer is the commander of the army, and he does not have any superiors. Every other officer has exactly one direct superior. If officer a is the direct superior of officer... | 3,000 | 256 | {
"solution_idx": 127,
"prog_id": 246,
"provenance": "P",
"code": "#include <bits/stdc++.h>\nusing namespace std;\nint main() {\n map<int, set<int> > mymap;\n stack<int> s;\n map<int, int> visit;\n vector<int> ans;\n map<int, int> index;\n map<int, int> co;\n int n, q;\n scanf(\"%d %d\", &n, &q);\n int... | {
"solution_idx": 202,
"prog_id": 413,
"provenance": "E",
"code": "#include <bits/stdc++.h>\nusing namespace std;\nusing pi = pair<long long, long long>;\nusing vi = vector<long long>;\nusing vvi = vector<vector<long long> >;\nconst long long NUM = 1000030;\nconst long long N = 10000000;\nvector<long long> lp, ... | {
"funnel_score": 0.9312169312169312,
"n_pool": 206,
"pair_rank": 0
} | {
"outcome": "unanimous",
"n_judges": 2,
"n_different": 2,
"unanimous": true,
"votes": [
{
"judge": "flash_lite",
"rating": "distinct",
"different": true
},
{
"judge": "gpt54mini",
"rating": "distinct",
"different": true
}
]
} | build-10k |
1006_F | train | There is a rectangular grid of size n × m. Each cell has a number written on it; the number on the cell (i, j) is a_{i, j}. Your task is to calculate the number of paths from the upper-left cell (1, 1) to the bottom-right cell (n, m) meeting the following constraints:
* You can move to the right or to the bottom onl... | 3,000 | 256 | {
"solution_idx": 107,
"prog_id": 153,
"provenance": "PR",
"code": "#include <bits/stdc++.h>\nusing namespace std;\n#pragma comment(linker, \"/stack:200000000\")\n#pragma GCC optimize(\"Ofast\")\n#pragma GCC target(\"sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native\")\ntemplate <typename T>\nbool mmax(T ... | {
"solution_idx": 169,
"prog_id": 249,
"provenance": "PE",
"code": "#include <bits/stdc++.h>\nusing namespace std;\nusing ll = long long;\nusing ld = double;\nusing pll = pair<ll, ll>;\nusing vll = vector<ll>;\nusing vpll = vector<pll>;\nusing vvll = vector<vll>;\nset<ll> mtx[21][21];\nmap<ll, ll> cnts[21][21];... | {
"funnel_score": 0.8111111111111111,
"n_pool": 185,
"pair_rank": 2
} | {
"outcome": "majority",
"n_judges": 3,
"n_different": 2,
"unanimous": false,
"votes": [
{
"judge": "flash_lite",
"rating": "identical",
"different": false
},
{
"judge": "gpt54mini",
"rating": "distinct",
"different": true
},
{
"judge": "haiku",
... | build-10k |
DivAlgo
7,623 competitive-programming problems, each paired with two human C++ solutions that solve it with algorithmically distinct approaches. Both solutions pass all sampled test cases, the pair was confirmed distinct by an LLM judge panel, and each solution carries a three-layer ontology label (paradigm, technique, data structures). Splits: 5,623 train / 1,000 validation / 1,000 test, grouped by contest so no round straddles a split; the paper evaluates on test.
Paper: DivAlgo: A systematic evaluation of algorithmic diversity for code generation models. Code: https://github.com/anubhav-jangra/divalgo.
Record
| field | description |
|---|---|
inst_id, split, description, time_limit_ms, memory_limit_mb |
problem id, split, full statement, limits |
solution_a, solution_b |
code, prog_id, provenance (candidate selector: P pdg, E embedding, R random), exec (test-case record), ontology_label (paradigm, technique, data_structures, notes) |
selection |
funnel_score, n_pool (submissions the pair was drawn from), pair_rank |
judgement |
vote counts and per-judge four-way ratings (identical / variation / distinct / very_distinct) |
from datasets import load_dataset
ds = load_dataset("jangraanubhav/DivAlgo")
Companions: DivAlgo-human-pools (the wider human solution pools), DivAlgo-generations
(model outputs), codex-sft (the similarity model).
Licence
CC BY 4.0. Problems and solutions originate from Code-Contests-Plus (CC BY 4.0).
@article{jangra2026divalgo,
title = {DivAlgo: A systematic evaluation of algorithmic diversity for code generation models},
author = {Jangra, Anubhav and Muresan, Smaranda},
journal = {arXiv preprint arXiv:2610.19157},
year = {2026}
}
- Downloads last month
- 1