Dataset Preview
Duplicate
The full dataset viewer is not available (click to read why). Only showing a preview of the rows.
The dataset generation failed
Error code:   DatasetGenerationError
Exception:    TypeError
Message:      Couldn't cast array of type
struct<id: string, target: string, setup_code: string, assertion: string, validation: struct<status: string>, input_legality_status: string, note: string>
to
{'id': Value('string'), 'target': Value('string'), 'setup_code': Value('string'), 'assertion': Value('string'), 'validation': {'status': Value('string')}, 'input_legality_status': Value('string')}
Traceback:    Traceback (most recent call last):
                File "/usr/local/lib/python3.14/site-packages/datasets/builder.py", line 1827, in _prepare_split_single
                  for key, table in generator:
                                    ^^^^^^^^^
                File "/src/services/worker/src/worker/job_runners/config/parquet_and_info.py", line 613, in wrapped
                  for item in generator(*args, **kwargs):
                              ~~~~~~~~~^^^^^^^^^^^^^^^^^
                File "/usr/local/lib/python3.14/site-packages/datasets/packaged_modules/json/json.py", line 343, in _generate_tables
                  self._cast_table(pa_table, json_field_paths=json_field_paths),
                  ~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
                File "/usr/local/lib/python3.14/site-packages/datasets/packaged_modules/json/json.py", line 132, in _cast_table
                  pa_table = table_cast(pa_table, self.info.features.arrow_schema)
                File "/usr/local/lib/python3.14/site-packages/datasets/table.py", line 2378, in table_cast
                  return cast_table_to_schema(table, schema)
                File "/usr/local/lib/python3.14/site-packages/datasets/table.py", line 2312, in cast_table_to_schema
                  cast_array_to_feature(
                  ~~~~~~~~~~~~~~~~~~~~~^
                      table[name] if name in table_column_names else pa.array([None] * len(table), type=schema.field(name).type),
                      ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
                      feature,
                      ^^^^^^^^
                  )
                  ^
                File "/usr/local/lib/python3.14/site-packages/datasets/table.py", line 1861, in wrapper
                  return pa.chunked_array([func(chunk, *args, **kwargs) for chunk in array.chunks])
                                           ~~~~^^^^^^^^^^^^^^^^^^^^^^^^
                File "/usr/local/lib/python3.14/site-packages/datasets/table.py", line 2118, in cast_array_to_feature
                  casted_array_values = _c(array.values, feature.feature)
                File "/usr/local/lib/python3.14/site-packages/datasets/table.py", line 1863, in wrapper
                  return func(array, *args, **kwargs)
                File "/usr/local/lib/python3.14/site-packages/datasets/table.py", line 2158, in cast_array_to_feature
                  raise TypeError(f"Couldn't cast array of type\n{_short_str(array.type)}\nto\n{_short_str(feature)}")
              TypeError: Couldn't cast array of type
              struct<id: string, target: string, setup_code: string, assertion: string, validation: struct<status: string>, input_legality_status: string, note: string>
              to
              {'id': Value('string'), 'target': Value('string'), 'setup_code': Value('string'), 'assertion': Value('string'), 'validation': {'status': Value('string')}, 'input_legality_status': Value('string')}
              
              The above exception was the direct cause of the following exception:
              
              Traceback (most recent call last):
                File "/src/services/worker/src/worker/job_runners/config/parquet_and_info.py", line 1369, in compute_config_parquet_and_info_response
                  parquet_operations, partial, estimated_dataset_info = stream_convert_to_parquet(
                                                                        ~~~~~~~~~~~~~~~~~~~~~~~~~^
                      builder, max_dataset_size_bytes=max_dataset_size_bytes
                      ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
                  )
                  ^
                File "/src/services/worker/src/worker/job_runners/config/parquet_and_info.py", line 948, in stream_convert_to_parquet
                  builder._prepare_split(split_generator=splits_generators[split], file_format="parquet")
                  ~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
                File "/usr/local/lib/python3.14/site-packages/datasets/builder.py", line 1694, in _prepare_split
                  for job_id, done, content in self._prepare_split_single(
                                               ~~~~~~~~~~~~~~~~~~~~~~~~~~^
                      gen_kwargs=gen_kwargs, job_id=job_id, **_prepare_split_args
                      ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
                  ):
                  ^
                File "/usr/local/lib/python3.14/site-packages/datasets/builder.py", line 1879, in _prepare_split_single
                  raise DatasetGenerationError("An error occurred while generating the dataset") from e
              datasets.exceptions.DatasetGenerationError: An error occurred while generating the dataset

Need help to make the dataset viewer work? Make sure to review how to configure the dataset viewer, and open a discussion for direct support.

id
int64
source_code
string
problem_description
string
function_tests
list
api_descriptions
list
api_tests
list
355
#include <bits/stdc++.h> using namespace std; #define ll long long #define nMax 100000 int a[2000][2000], rows[2000], cols[2000]; int main() { ios::sync_with_stdio(false); int n, m, k; scanf("%d%d%d", &n, &m, &k); for (int i = 0; i < 2000; i++) { rows[i] = i; cols[...
The Free Meteor Association (FMA) has got a problem: as meteors are moving, the Universal Cosmic Descriptive Humorous Program (UCDHP) needs to add a special module that would analyze this movement. UCDHP stores some secret information about meteors as an n × m table with integers in its cells. The order of meteors in t...
[ { "id": "f1", "target": "main", "setup_code": "", "assertion": "assert((run_program(\"2 2 1\\n1 2\\n3 4\\ng 1 1\\n\") == \"1\\n\"));", "validation": { "status": "not_checked" }, "input_legality_status": "not_checked" }, { "id": "f2", "target": "main", "setup_code": ...
[ { "id": "a1", "api": "std::swap", "source_usage": "swap(rows[x], rows[y])", "description": "Exchanges the values of two objects. Used here to swap row indices." }, { "id": "a2", "api": "std::swap", "source_usage": "swap(cols[x], cols[y])", "description": "Exchanges the values of ...
[ { "id": "a1t1", "api_id": "a1", "setup_code": "int a = 1, b = 2;", "assertion": "assert((std::swap(a, b), a == 2 && b == 1));", "validation": { "status": "not_checked" }, "input_legality_status": "not_checked" }, { "id": "a1t2", "api_id": "a1", "setup_code": "int a ...
356
#include<bits/stdc++.h> using namespace std; int main() { int n, m, k; scanf("%d %d %d", &n, &m, &k); int A[1005][1005] = {}; int x[1004] = {}; int y[1004] = {}; for(int i = 1; i <= n; i++) { x[i] = i; for(int j = 1; j <= m; j++) { y[j] = j; ...
The Free Meteor Association (FMA) has got a problem: as meteors are moving, the Universal Cosmic Descriptive Humorous Program (UCDHP) needs to add a special module that would analyze this movement. UCDHP stores some secret information about meteors as an n × m table with integers in its cells. The order of meteors in t...
[ { "id": "f1", "target": "main", "setup_code": "", "assertion": "assert((run_program(\"1 1 1\\n5\\nc 1 1\\n\") == \"5\\n\"));", "validation": { "status": "not_checked" }, "input_legality_status": "not_checked" }, { "id": "f2", "target": "main", "setup_code": "", ...
[ { "id": "a1", "api": "std::swap", "source_usage": "swap(x[a], x[b]);", "description": "Exchanges the values of two objects." }, { "id": "a2", "api": "std::array::operator[]", "source_usage": "A[x[a]][y[b]]", "description": "Accesses the element at the specified index in a two-dim...
[ { "id": "a1t1", "api_id": "a1", "setup_code": "int a = 5, b = 10;", "assertion": "assert((swap(a, b), a == 10 && b == 5));", "validation": { "status": "not_checked" }, "input_legality_status": "not_checked" }, { "id": "a1t2", "api_id": "a1", "setup_code": "int a = 3...
357
#include<bits/stdc++.h> using namespace std; void solve() { int n, m, k; scanf("%d %d %d", &n, &m, &k); int table[1005][1005] = {}; int row[n+5] = {}; int col[m+5] = {}; for(int i = 1; i <= n; i++) { for(int j = 1; j <= m; j++) { scanf("%d", &table[i][j]); } ...
The Free Meteor Association (FMA) has got a problem: as meteors are moving, the Universal Cosmic Descriptive Humorous Program (UCDHP) needs to add a special module that would analyze this movement. UCDHP stores some secret information about meteors as an n × m table with integers in its cells. The order of meteors in t...
[ { "id": "f1", "target": "main", "setup_code": "", "assertion": "assert((run_program(\"1 1 1\\n7\\nq 1 1\\n\") == \"7\\n\"));", "validation": { "status": "not_checked" }, "input_legality_status": "not_checked" }, { "id": "f2", "target": "main", "setup_code": "", ...
[ { "id": "a1", "api": "std::scanf", "source_usage": "scanf(\"%d %d %d\", &n, &m, &k)", "description": "Reads formatted input from stdin. Used here for integers and strings." }, { "id": "a2", "api": "std::printf", "source_usage": "printf(\"%d\\n\", table[a][b])", "description": "Wr...
[ { "id": "a1t1", "api_id": "a1", "setup_code": "int a=0, b=0, c=0;", "assertion": "assert((scanf(\"1 2 3\", &a, &b, &c) == 3 && a == 1 && b == 2 && c == 3));", "validation": { "status": "not_checked" }, "input_legality_status": "not_checked" }, { "id": "a1t2", "api_id": ...
358
#include<bits/stdc++.h> using namespace std; #define lli long long int //#define nl endl //#define fastio ios_base::sync_with_stdio(false); cin.tie(0); cout.tie(0) /*#define db double //#define mod 1e9 + 7 //#define lb lower_bound #define ub upper_bound #define vlli vector<lli> #define mslli multiset<lli> #define inf I...
The Free Meteor Association (FMA) has got a problem: as meteors are moving, the Universal Cosmic Descriptive Humorous Program (UCDHP) needs to add a special module that would analyze this movement. UCDHP stores some secret information about meteors as an n × m table with integers in its cells. The order of meteors in t...
[ { "id": "f1", "target": "main", "setup_code": "", "assertion": "assert((run_program(\"1 1 1\\n5\\nc 0 0\\n\") == \"5\\n\"));", "validation": { "status": "not_checked" }, "input_legality_status": "not_checked" }, { "id": "f2", "target": "main", "setup_code": "", ...
[ { "id": "a1", "api": "std::cin", "source_usage": "cin>>n>>m>>k;", "description": "Standard input stream. Used to read table dimensions, cell values, and query commands." }, { "id": "a2", "api": "std::cout", "source_usage": "cout<<a[mpr[x]][mpc[y]]<<\"\\n\";", "description": "Stan...
[ { "id": "a1t1", "api_id": "a1", "setup_code": "std::istringstream iss(\"3 4 2\");", "assertion": "assert((iss >> n >> m >> k, n == 3 && m == 4 && k == 2));", "validation": { "status": "not_checked" }, "input_legality_status": "not_checked" }, { "id": "a1t2", "api_id": "...
359
#include<bits/stdc++.h> using namespace std; #define ll long long int int main() { ios_base::sync_with_stdio(false); cin.tie(NULL); ll n,m,k; cin>>n>>m>>k; ll a[n][m]; for(int i=0;i<n;i++) { for(int j=0;j<m;j++) cin>>a[i][j]; } int b[n],c[m]; for(int i=0;i<n;i++) b[i]=i; for(int i=0;i<m;i++) c[i]=i; w...
The Free Meteor Association (FMA) has got a problem: as meteors are moving, the Universal Cosmic Descriptive Humorous Program (UCDHP) needs to add a special module that would analyze this movement. UCDHP stores some secret information about meteors as an n × m table with integers in its cells. The order of meteors in t...
[ { "id": "f1", "target": "main", "setup_code": "", "assertion": "assert((run_program(\"2 2 1\\n1 2\\n3 4\\ng 1 1\\n\") == \"1\\n\"));", "validation": { "status": "not_checked" }, "input_legality_status": "not_checked" }, { "id": "f2", "target": "main", "setup_code": ...
[ { "id": "a1", "api": "std::cin", "source_usage": "cin>>n>>m>>k;", "description": "Standard input stream for reading program data." }, { "id": "a2", "api": "std::cout", "source_usage": "cout<<a[b[x-1]][c[y-1]]<<\"\\n\";", "description": "Standard output stream for writing program ...
[ { "id": "a1t1", "api_id": "a1", "setup_code": "std::istringstream ss(\"42\"); int x = 0;", "assertion": "assert((ss >> x, x == 42));", "validation": { "status": "not_checked" }, "input_legality_status": "not_checked" }, { "id": "a1t2", "api_id": "a1", "setup_code": ...
360
#include<bits/stdc++.h> using namespace std; #define lli long long int #define nl endl #define fastio ios_base::sync_with_stdio(false); cin.tie(0); cout.tie(0) #define db double #define mod 1e9 + 7 #define lb lower_bound #define ub upper_bound #define vlli vector<lli> #define mslli multiset<lli> #define inf INT_MAX #de...
The Free Meteor Association (FMA) has got a problem: as meteors are moving, the Universal Cosmic Descriptive Humorous Program (UCDHP) needs to add a special module that would analyze this movement. UCDHP stores some secret information about meteors as an n × m table with integers in its cells. The order of meteors in t...
[ { "id": "f1", "target": "main", "setup_code": "", "assertion": "assert((run_program(\"1 1 1\\n7\\ng 1 1\\n\") == \"7\\n\"));", "validation": { "status": "not_checked" }, "input_legality_status": "not_checked" }, { "id": "f2", "target": "main", "setup_code": "", ...
[]
[]
361
//____________________________________Road_to_BVI_________________________________________// // // ///////// ////// /\ // // /\ ////// //// //// // // // //\\ ...
The Free Meteor Association (FMA) has got a problem: as meteors are moving, the Universal Cosmic Descriptive Humorous Program (UCDHP) needs to add a special module that would analyze this movement. UCDHP stores some secret information about meteors as an n × m table with integers in its cells. The order of meteors in t...
[ { "id": "f1", "target": "main", "setup_code": "", "assertion": "assert((run_program(\"1 1 1\\n5\\ng 1 1\\n\") == \"5\\n\"));", "validation": { "status": "not_checked" }, "input_legality_status": "not_checked" }, { "id": "f2", "target": "main", "setup_code": "", ...
[ { "id": "a1", "api": "std::map::operator[]", "source_usage": "r[i]=i;", "description": "Returns a reference to the mapped value for the given key, inserting a default-constructed value if the key does not exist." }, { "id": "a2", "api": "std::swap", "source_usage": "swap(c[y],c[x]);"...
[ { "id": "a1t1", "api_id": "a1", "setup_code": "std::map<int,int> m;", "assertion": "assert((m[5] == 0 && m.size() == 1));", "validation": { "status": "not_checked" }, "input_legality_status": "not_checked" }, { "id": "a1t2", "api_id": "a1", "setup_code": "std::map<i...
362
//------Anivia_kid---------- #include<bits/stdc++.h> using namespace std; #define fi first #define se second typedef long long ll; const int MOD = 1e9 + 7; ll fact(int n) { if(n == 0 || n == 1) return 1; ll res = 1; for(int i = 2; i <= n; i++) res *= i; return res; } ll comb(ll n, ll k) { if(n == k) retur...
The Free Meteor Association (FMA) has got a problem: as meteors are moving, the Universal Cosmic Descriptive Humorous Program (UCDHP) needs to add a special module that would analyze this movement. UCDHP stores some secret information about meteors as an n × m table with integers in its cells. The order of meteors in t...
[ { "id": "f1", "target": "main", "setup_code": "", "assertion": "assert((run_program(\"1 1 1\\n5\\ng 1 1\\n\") == \"5 \\n\"));", "validation": { "status": "not_checked" }, "input_legality_status": "not_checked" }, { "id": "f2", "target": "main", "setup_code": "", ...
[ { "id": "a1", "api": "std::swap", "source_usage": "swap(col[x - 1], col[y - 1]);", "description": "Exchanges the values of two objects. Used to swap table column indices." }, { "id": "a2", "api": "std::swap", "source_usage": "swap(row[x - 1], row[y - 1]);", "description": "Exchan...
[ { "id": "a1t1", "api_id": "a1", "setup_code": "int a = 1, b = 2;", "assertion": "assert((swap(a, b), a == 2 && b == 1));", "validation": { "status": "not_checked" }, "input_legality_status": "not_checked" }, { "id": "a1t2", "api_id": "a1", "setup_code": "std::string...
363
//------Anivia_kid---------- #include<bits/stdc++.h> using namespace std; #define fi first #define se second typedef long long ll; const int MOD = 1e9 + 7; ll fact(int n) { if(n == 0 || n == 1) return 1; ll res = 1; for(int i = 2; i <= n; i++) res *= i; return res; } ll comb(ll n, ll k) { if(n == k) retur...
The Free Meteor Association (FMA) has got a problem: as meteors are moving, the Universal Cosmic Descriptive Humorous Program (UCDHP) needs to add a special module that would analyze this movement. UCDHP stores some secret information about meteors as an n × m table with integers in its cells. The order of meteors in t...
[ { "id": "f1", "target": "main", "setup_code": "", "assertion": "assert((run_program(\"1 1 1\\n5\\ng 1 1\\n\") == \"5\\n\"));", "validation": { "status": "not_checked" }, "input_legality_status": "not_checked" }, { "id": "f2", "target": "main", "setup_code": "", ...
[]
[]
364
//------Anivia_kid---------- #include<bits/stdc++.h> using namespace std; #define fi first #define se second typedef long long ll; const int MOD = 1e9 + 7; ll fact(int n) { if(n == 0 || n == 1) return 1; ll res = 1; for(int i = 2; i <= n; i++) res *= i; return res; } ll comb(ll n, ll k) { if(n == k) retur...
The Free Meteor Association (FMA) has got a problem: as meteors are moving, the Universal Cosmic Descriptive Humorous Program (UCDHP) needs to add a special module that would analyze this movement. UCDHP stores some secret information about meteors as an n × m table with integers in its cells. The order of meteors in t...
[ { "id": "f1", "target": "main", "setup_code": "", "assertion": "assert((run_program(\"1 3 3\\n10 20 30\\ng 1 2\\nr 1 1\\ng 1 3\\n\") == \"20\\n30\\n\"));", "validation": { "status": "not_checked" }, "input_legality_status": "not_checked" }, { "id": "f2", "target": "main...
[]
[]
365
//------Anivia_kid---------- #include<bits/stdc++.h> using namespace std; #define fi first #define se second typedef long long ll; const int MOD = 1e9 + 7; ll fact(int n) { if(n == 0 || n == 1) return 1; ll res = 1; for(int i = 2; i <= n; i++) res *= i; return res; } ll comb(ll n, ll k) { if(n == k) retur...
The Free Meteor Association (FMA) has got a problem: as meteors are moving, the Universal Cosmic Descriptive Humorous Program (UCDHP) needs to add a special module that would analyze this movement. UCDHP stores some secret information about meteors as an n × m table with integers in its cells. The order of meteors in t...
[ { "id": "f1", "target": "main", "setup_code": "", "assertion": "assert((run_program(\"1 1 1\\n5\\ng 1 1\\n\") == \"5\\n\"));", "validation": { "status": "not_checked" }, "input_legality_status": "not_checked" }, { "id": "f2", "target": "main", "setup_code": "", ...
[ { "id": "a1", "api": "std::vector::push_back", "source_usage": "res.push_back(i);", "description": "Appends a copy of the given element to the end of the vector, increasing its size by one." }, { "id": "a2", "api": "std::vector::operator[]", "source_usage": "v[i][j]", "descriptio...
[ { "id": "a1t1", "api_id": "a1", "setup_code": "std::vector<int> v;", "assertion": "assert((v.push_back(5), v.size() == 1));", "validation": { "status": "not_checked" }, "input_legality_status": "not_checked" }, { "id": "a1t2", "api_id": "a1", "setup_code": "std::vec...
366
//------Anivia_kid---------- #include<bits/stdc++.h> using namespace std; #define fi first #define se second typedef long long ll; const int MOD = 1e9 + 7; int v[1000][1000]; int row[1000], col[1000]; void Anivia_kid(){ int n, m, k; cin>>n>>m>>k; for(int i = 0; i < n; i++){ for(int j = 0; j < m; j++) c...
The Free Meteor Association (FMA) has got a problem: as meteors are moving, the Universal Cosmic Descriptive Humorous Program (UCDHP) needs to add a special module that would analyze this movement. UCDHP stores some secret information about meteors as an n × m table with integers in its cells. The order of meteors in t...
[ { "id": "f1", "target": "main", "setup_code": "", "assertion": "assert((run_program(\"2 2 1\\n1 2\\n3 4\\ng 1 1\\n\") == \"1\\n\"));", "validation": { "status": "not_checked" }, "input_legality_status": "not_checked" }, { "id": "f2", "target": "main", "setup_code": ...
[ { "id": "a1", "api": "std::swap", "source_usage": "swap(col[x - 1], col[y - 1])", "description": "Exchanges the values of two objects. Used here to swap table row/column indices in the permutation arrays." }, { "id": "a2", "api": "std::cin", "source_usage": "cin>>n>>m>>k;", "desc...
[ { "id": "a1t1", "api_id": "a1", "setup_code": "int a = 1, b = 2;", "assertion": "assert((std::swap(a, b), a == 2 && b == 1));", "validation": { "status": "not_checked" }, "input_legality_status": "not_checked" }, { "id": "a1t2", "api_id": "a1", "setup_code": "int a ...
367
#include <cstdio> #include <string.h> #include <algorithm> using namespace std; #define N 500050 typedef long long ll; int n,a[N],K,b[N],c[N],d[N]; bool check1(int x) { int i,re=0; for(i=1;i<=n;i++) { if(a[i]>x) re+=a[i]-x; if(re>K) return 0; } return 1; } bool check2(int x) { int i,re=0; for(i=1;i<=n;i++) { ...
We all know the impressive story of Robin Hood. Robin Hood uses his archery skills and his wits to steal the money from rich, and return it to the poor.There are n citizens in Kekoland, each person has ci coins. Each day, Robin Hood will take exactly 1 coin from the richest person in the city and he will give it to the...
[ { "id": "f1", "target": "main", "setup_code": "", "assertion": "assert((run_program(\"1 5\\n10\\n\") == \"0\\n\"));", "validation": { "status": "not_checked" }, "input_legality_status": "not_checked" }, { "id": "f2", "target": "main", "setup_code": "", "assertio...
[]
[]
368
#include <cstdio> #include <string.h> #include <algorithm> using namespace std; #define N 500050 typedef long long ll; int n,a[N],K,b[N],c[N],d[N]; bool check1(int x) { int i,re=0; for(i=1;i<=n;i++) { if(a[i]>x) re+=a[i]-x; if(re>K) return 0; } return 1; } bool check2(int x) { int i,re=0; for(i=1;i<=n;i++) { ...
We all know the impressive story of Robin Hood. Robin Hood uses his archery skills and his wits to steal the money from rich, and return it to the poor.There are n citizens in Kekoland, each person has ci coins. Each day, Robin Hood will take exactly 1 coin from the richest person in the city and he will give it to the...
[ { "id": "f1", "target": "main", "setup_code": "", "assertion": "assert((run_program(\"5 0\\n1 2 3 4 5\\n\") == \"4\\n\"));", "validation": { "status": "not_checked" }, "input_legality_status": "not_checked" }, { "id": "f2", "target": "main", "setup_code": "", "a...
[]
[]
369
#include <iostream> #include <map> #include <algorithm> #include <vector> using namespace std; template<typename T> int Max(T begin, T end) { int ret = *begin; while (begin != end) { ret = max(ret, *begin); ++begin; } return ret; } template<typename T> int Min(T begin, T end) { in...
We all know the impressive story of Robin Hood. Robin Hood uses his archery skills and his wits to steal the money from rich, and return it to the poor.There are n citizens in Kekoland, each person has ci coins. Each day, Robin Hood will take exactly 1 coin from the richest person in the city and he will give it to the...
[ { "id": "f1", "target": "main", "setup_code": "", "assertion": "assert((run_program(\"4 1\\n1 5 6 7\\n\") == \"5\"));", "validation": { "status": "not_checked" }, "input_legality_status": "not_checked" }, { "id": "f2", "target": "main", "setup_code": "", "assert...
[]
[]
370
#include <iostream> #include <map> #include <algorithm> #include <vector> using namespace std; template<typename T> int Max(T begin, T end) { int ret = *begin; while (begin != end) { ret = max(ret, *begin); ++begin; } return ret; } template<typename T> int Min(T begin, T end) { in...
We all know the impressive story of Robin Hood. Robin Hood uses his archery skills and his wits to steal the money from rich, and return it to the poor.There are n citizens in Kekoland, each person has ci coins. Each day, Robin Hood will take exactly 1 coin from the richest person in the city and he will give it to the...
[ { "id": "f1", "target": "main", "setup_code": "", "assertion": "assert((run_program(\"2 1\\n1 3\\n\") == \"1\\n\"));", "validation": { "status": "not_checked" }, "input_legality_status": "not_checked" }, { "id": "f2", "target": "main", "setup_code": "", "asserti...
[ { "id": "a1", "api": "std::map", "source_usage": "#include <map>", "description": "Standard map container header; included but not used in the program." }, { "id": "a2", "api": "std::vector", "source_usage": "#include <vector>", "description": "Standard dynamic array container; u...
[ { "id": "a1t1", "api_id": "a1", "setup_code": "std::map<int,int> m; m[5]=10;", "assertion": "assert((m.find(5)->second == 10));", "validation": { "status": "not_checked" }, "input_legality_status": "not_checked" }, { "id": "a1t2", "api_id": "a1", "setup_code": "std:...
371
#include <iostream> #include <map> #include <algorithm> #include <vector> using namespace std; template<typename T> int Max(T begin, T end) { int ret = *begin; while (begin != end) { ret = max(ret, *begin); ++begin; } return ret; } template<typename T> int Min(T begin, T end) { in...
We all know the impressive story of Robin Hood. Robin Hood uses his archery skills and his wits to steal the money from rich, and return it to the poor.There are n citizens in Kekoland, each person has ci coins. Each day, Robin Hood will take exactly 1 coin from the richest person in the city and he will give it to the...
[ { "id": "f1", "target": "main", "setup_code": "", "assertion": "assert((run_program(\"3 0\\n3 3 3\\n\") == \"0\\n\"));", "validation": { "status": "not_checked" }, "input_legality_status": "not_checked" }, { "id": "f2", "target": "main", "setup_code": "", "asser...
[ { "id": "a1", "api": "std::vector<int>::size", "source_usage": "c.size()", "description": "Returns the number of elements in the vector." }, { "id": "a2", "api": "std::istream::operator>>", "source_usage": "cin >> c[i]", "description": "Extracts formatted data from an input strea...
[ { "id": "a1t1", "api_id": "a1", "setup_code": "std::vector<int> v;", "assertion": "assert((v.size() == 0));", "validation": { "status": "not_checked" }, "input_legality_status": "not_checked" }, { "id": "a1t2", "api_id": "a1", "setup_code": "std::vector<int> v(5);",...
372
#include <iostream> #include <map> #include <algorithm> #include <vector> using namespace std; template<typename T> int Max(T begin, T end) { int ret = *begin; while (begin != end) { ret = max(ret, *begin); ++begin; } return ret; } template<typename T> int Min(T begin, T end) { in...
We all know the impressive story of Robin Hood. Robin Hood uses his archery skills and his wits to steal the money from rich, and return it to the poor.There are n citizens in Kekoland, each person has ci coins. Each day, Robin Hood will take exactly 1 coin from the richest person in the city and he will give it to the...
[ { "id": "f1", "target": "Solve", "setup_code": "vector<int> c = {1, 2, 3}; int k = 1;", "assertion": "assert((Solve(c, k) == 1));", "validation": { "status": "not_checked" }, "input_legality_status": "not_checked" }, { "id": "f2", "target": "Solve", "setup_code": "v...
[ { "id": "a1", "api": "std::vector::size", "source_usage": "c.size()", "description": "Returns the number of elements in the vector." }, { "id": "a2", "api": "std::vector::push_back", "source_usage": "c.push_back", "description": "Appends a copy of the argument to the end of the v...
[ { "id": "a1t1", "api_id": "a1", "setup_code": "std::vector<int> v;", "assertion": "assert((v.size() == 0));", "validation": { "status": "not_checked" }, "input_legality_status": "not_checked" }, { "id": "a1t2", "api_id": "a1", "setup_code": "std::vector<int> v = {1,...
373
#define _CRT_SECURE_NO_WARNINGS #include <bits/stdc++.h> using namespace std; #define F first #define S second typedef unsigned long long ull; typedef long long ll; typedef pair<int, int> ii; typedef pair<int, ii> iii; typedef vector<ii> vii; typedef vector<int> vi; typedef vector<ull> vull; typedef vector<ll> vll...
We all know the impressive story of Robin Hood. Robin Hood uses his archery skills and his wits to steal the money from rich, and return it to the poor.There are n citizens in Kekoland, each person has ci coins. Each day, Robin Hood will take exactly 1 coin from the richest person in the city and he will give it to the...
[ { "id": "f1", "target": "main", "setup_code": "", "assertion": "assert((run_program(\"3 2\\n1 2 3\\n\") == \"1\\n\"));", "validation": { "status": "not_checked" }, "input_legality_status": "not_checked" }, { "id": "f2", "target": "main", "setup_code": "", "asser...
[ { "id": "a1", "api": "std::vector::resize", "source_usage": "people.resize(N);", "description": "Changes the size of the vector to N, default-initializing new elements." }, { "id": "a2", "api": "std::sort", "source_usage": "sort(people.begin(), people.end());", "description": "So...
[ { "id": "a1t1", "api_id": "a1", "setup_code": "std::vector<int> v{1,2,3};", "assertion": "assert((v.resize(5), v.size() == 5 && v[3] == 0 && v[4] == 0));", "validation": { "status": "not_checked" }, "input_legality_status": "not_checked" }, { "id": "a1t2", "api_id": "a1...
374
#define _CRT_SECURE_NO_WARNINGS #include <bits/stdc++.h> using namespace std; #define F first #define S second typedef unsigned long long ull; typedef long long ll; typedef pair<int, int> ii; typedef pair<int, ii> iii; typedef vector<ii> vii; typedef vector<int> vi; typedef vector<ull> vull; typedef vector<ll> vll...
We all know the impressive story of Robin Hood. Robin Hood uses his archery skills and his wits to steal the money from rich, and return it to the poor.There are n citizens in Kekoland, each person has ci coins. Each day, Robin Hood will take exactly 1 coin from the richest person in the city and he will give it to the...
[ { "id": "f1", "target": "main", "setup_code": "", "assertion": "assert((run_program(\"3 8\\n1 2 3\\n\") == \"1\\n\"));", "validation": { "status": "not_checked" }, "input_legality_status": "not_checked" }, { "id": "f2", "target": "main", "setup_code": "", "asser...
[ { "id": "a1", "api": "std::sort", "source_usage": "sort(people.begin(), people.end());", "description": "Sorts the elements in the range [first, last) into non-descending order." }, { "id": "a2", "api": "std::vector::resize", "source_usage": "people.resize(N);", "description": "R...
[ { "id": "a1t1", "api_id": "a1", "setup_code": "std::vector<int> v = {3, 1, 2};", "assertion": "assert((std::sort(v.begin(), v.end()), v == std::vector<int>{1, 2, 3}));", "validation": { "status": "not_checked" }, "input_legality_status": "not_checked" }, { "id": "a1t2", ...
375
#include<iostream> #include<cstdio> #include<cstring> #include<cmath> #include<algorithm> #define int long long #define MK 500050 using namespace std; int n,k; int a[MK]; bool checkl(int x) { int opt = 0; for(int i=1;i<=n;i++) if(a[i]<x) opt+=(x-a[i]); return opt<=k; } bool checkr(int x) { int opt = 0; for(...
We all know the impressive story of Robin Hood. Robin Hood uses his archery skills and his wits to steal the money from rich, and return it to the poor.There are n citizens in Kekoland, each person has ci coins. Each day, Robin Hood will take exactly 1 coin from the richest person in the city and he will give it to the...
[ { "id": "f1", "target": "main", "setup_code": "", "assertion": "assert((run_program(\"1 5\\n10\\n\") == \"0\"));", "validation": { "status": "not_checked" }, "input_legality_status": "not_checked" }, { "id": "f2", "target": "main", "setup_code": "", "assertion":...
[ { "id": "a1", "api": "scanf", "source_usage": "scanf(\"%lld%lld\",&n,&k);", "description": "Reads two long long integers n and k from standard input." }, { "id": "a2", "api": "printf", "source_usage": "printf(\"%lld\",ansr-ansl);", "description": "Prints a long long integer to st...
[ { "id": "a1t1", "api_id": "a1", "setup_code": "", "assertion": "assert(([](){ long long n=0,k=0; std::istringstream in(\"10 20\"); in >> n >> k; return n==10 && k==20; }()));", "validation": { "status": "not_checked" }, "input_legality_status": "not_checked" }, { "id": "a1t...
376
#include<bits/stdc++.h> using namespace std; #define ll long long int n,k,all,br,l=1e9; int a[500005]; ll sum,cnt,cnt2,g; bool check(int mid) { g=0; for(int i=1; i<=n; ++i) if(a[i]<mid)g+=mid-a[i]; return g<=k; } bool check2(int mid) { g=0; for(int i=1; i<=n; ++i) if(a[i]>mid)g+=a[i]...
We all know the impressive story of Robin Hood. Robin Hood uses his archery skills and his wits to steal the money from rich, and return it to the poor.There are n citizens in Kekoland, each person has ci coins. Each day, Robin Hood will take exactly 1 coin from the richest person in the city and he will give it to the...
[ { "id": "f1", "target": "main", "setup_code": "", "assertion": "assert((run_program(\"1 0\\n5\\n\") == \"0\"));", "validation": { "status": "not_checked" }, "input_legality_status": "not_checked" }, { "id": "f2", "target": "main", "setup_code": "", "assertion": ...
[ { "id": "a1", "api": "std::scanf", "source_usage": "scanf(\"%d\",&a[i]);", "description": "Reads an integer from standard input into the provided variable." }, { "id": "a2", "api": "std::printf", "source_usage": "printf(\"%d\",ans2-ans);", "description": "Writes a formatted integ...
[ { "id": "a1t1", "api_id": "a1", "setup_code": "std::istringstream iss(\"123\"); int x; iss >> x;", "assertion": "assert((x == 123));", "validation": { "status": "not_checked" }, "input_legality_status": "not_checked" }, { "id": "a1t2", "api_id": "a1", "setup_code": ...
377
#include<bits/stdc++.h> using namespace std; long long a[500010]; int main(){ long long n,k; cin>>n>>k; for(int i=1;i<=n;i++){ scanf("%lld",&a[i]); } sort(a+1,a+n+1); long long k1=k,k2=k; for(int i=2;i<=n;i++){ if((i-1)*(a[i]-a[i-1])<=k1){ k1-=(i-1)*(a[i]-a[i-1]); if(k1==0){ for(int j=1;j<=i;j++){...
We all know the impressive story of Robin Hood. Robin Hood uses his archery skills and his wits to steal the money from rich, and return it to the poor.There are n citizens in Kekoland, each person has ci coins. Each day, Robin Hood will take exactly 1 coin from the richest person in the city and he will give it to the...
[ { "id": "f1", "target": "main", "setup_code": "", "assertion": "assert((run_program(\"1 100\\n7\\n\") == \"0\"));", "validation": { "status": "not_checked" }, "input_legality_status": "not_checked" }, { "id": "f2", "target": "main", "setup_code": "", "assertion"...
[]
[]
378
#include <cstdio> #include <iostream> using namespace std; const int N=1e6+1; typedef long long ll; ll m,n,a[N],sum,l,r,mid,k,ave,t; bool flag; bool judge (ll x) { sum=0; if(!flag) { for(int i=1;i<=n;++i) { if(a[i]<x) sum+=x-a[i]; } //printf("#%I64d,%I64d\n",sum,x); if(sum<=k) return true; return false; ...
We all know the impressive story of Robin Hood. Robin Hood uses his archery skills and his wits to steal the money from rich, and return it to the poor.There are n citizens in Kekoland, each person has ci coins. Each day, Robin Hood will take exactly 1 coin from the richest person in the city and he will give it to the...
[ { "id": "f1", "target": "main", "setup_code": "", "assertion": "assert((run_program(\"1 0\\n5\\n\") == \"0\\n\"));", "validation": { "status": "not_checked" }, "input_legality_status": "not_checked" }, { "id": "f2", "target": "main", "setup_code": "", "assertion...
[]
[]
379
#include<bits/stdc++.h> using namespace std; typedef long long LL; const int mx=5e5+5; inline int read() { int n=0; char c=getchar(); while(c>57||c<48) c=getchar(); while(c>47&&c<58) n=(n<<1)+(n<<3)+(c^48),c=getchar(); return n; } LL tot; int a[mx],n,k; inline bool check(int x) { LL sum=0; f...
We all know the impressive story of Robin Hood. Robin Hood uses his archery skills and his wits to steal the money from rich, and return it to the poor.There are n citizens in Kekoland, each person has ci coins. Each day, Robin Hood will take exactly 1 coin from the richest person in the city and he will give it to the...
[ { "id": "f1", "target": "main", "setup_code": "", "assertion": "assert((run_program(\"1 0\\n5\\n\") == \"0\\n\"));", "validation": { "status": "not_checked" }, "input_legality_status": "not_checked" }, { "id": "f2", "target": "main", "setup_code": "", "assertion...
[ { "id": "a1", "api": "getchar", "source_usage": "char c=getchar();", "description": "Reads a single character from standard input. Returns int, EOF on failure." }, { "id": "a2", "api": "printf", "source_usage": "printf(\"%d\\n\",R-L);", "description": "Prints formatted output to ...
[ { "id": "a1t1", "api_id": "a1", "setup_code": "std::string s=\"A\";\nstd::istringstream iss(s);", "assertion": "assert(([&]{ std::streambuf* old=std::cin.rdbuf(iss.rdbuf()); int c=getchar(); std::cin.rdbuf(old); return c; }() == 'A'));", "validation": { "status": "not_checked" }, "...
380
#include<bits/stdc++.h> using namespace std; #define ALL(x) (x).begin(),(x).end() #define uniq(x) (x).erase(unique(ALL(x)),(x).end()) #define SORT(x) sort(ALL(x)) #define REV(x) reverse(ALL(x)) #define foreach(it,x) for(__typeof((x).begin()) it=(x).begin();it!=(x).end();it++) #define debug(x) cerr<<#x<<"="<<(x)<<endl #...
We all know the impressive story of Robin Hood. Robin Hood uses his archery skills and his wits to steal the money from rich, and return it to the poor.There are n citizens in Kekoland, each person has ci coins. Each day, Robin Hood will take exactly 1 coin from the richest person in the city and he will give it to the...
[ { "id": "f1", "target": "main", "setup_code": "", "assertion": "assert((run_program(\"2 0\\n1 2\\n\") == \"1\\n\"));", "validation": { "status": "not_checked" }, "input_legality_status": "not_checked" }, { "id": "f2", "target": "main", "setup_code": "", "asserti...
[ { "id": "a1", "api": "std::istream::operator>>", "source_usage": "cin>>n>>k", "description": "Extracts formatted integers from the input stream, reading values into n and k." }, { "id": "a2", "api": "std::ostream::operator<<", "source_usage": "cout<<getR()-getP()<<endl", "descrip...
[ { "id": "a1t1", "api_id": "a1", "setup_code": "std::istringstream iss(\"3 5\"); int n, k;", "assertion": "assert((iss >> n >> k, n == 3 && k == 5));", "validation": { "status": "not_checked" }, "input_legality_status": "not_checked" }, { "id": "a1t2", "api_id": "a1", ...
381
#include<bits/stdc++.h> using namespace std; #define ALL(x) (x).begin(),(x).end() #define uniq(x) (x).erase(unique(ALL(x)),(x).end()) #define SORT(x) sort(ALL(x)) #define REV(x) reverse(ALL(x)) #define foreach(it,x) for(__typeof((x).begin()) it=(x).begin();it!=(x).end();it++) #define debug(x) cerr<<#x<<"="<<(x)<<endl #...
We all know the impressive story of Robin Hood. Robin Hood uses his archery skills and his wits to steal the money from rich, and return it to the poor.There are n citizens in Kekoland, each person has ci coins. Each day, Robin Hood will take exactly 1 coin from the richest person in the city and he will give it to the...
[ { "id": "f1", "target": "main", "setup_code": "", "assertion": "assert((run_program(\"3 1\\n10 1 1\\n\") == \"8\"));", "validation": { "status": "not_checked" }, "input_legality_status": "not_checked" }, { "id": "f2", "target": "main", "setup_code": "", "asserti...
[ { "id": "a1", "api": "std::sort", "source_usage": "sort(a+1,a+n+1);", "description": "Sorts the range [first, last) in non-decreasing order." }, { "id": "a2", "api": "std::min", "source_usage": "min(mx,a[i-1])", "description": "Returns the smaller of two values." }, { "id...
[ { "id": "a1t1", "api_id": "a1", "setup_code": "long long arr[4] = {3, 1, 2, 2};", "assertion": "assert((std::sort(arr+1, arr+4), arr[1] == 1 && arr[2] == 2 && arr[3] == 2));", "validation": { "status": "not_checked" }, "input_legality_status": "not_checked" }, { "id": "a1t2...
382
#include<bits/stdc++.h> using namespace std; #define ALL(x) (x).begin(),(x).end() #define uniq(x) (x).erase(unique(ALL(x)),(x).end()) #define SORT(x) sort(ALL(x)) #define REV(x) reverse(ALL(x)) #define foreach(it,x) for(__typeof((x).begin()) it=(x).begin();it!=(x).end();it++) #define debug(x) cerr<<#x<<"="<<(x)<<endl #...
We all know the impressive story of Robin Hood. Robin Hood uses his archery skills and his wits to steal the money from rich, and return it to the poor.There are n citizens in Kekoland, each person has ci coins. Each day, Robin Hood will take exactly 1 coin from the richest person in the city and he will give it to the...
[ { "id": "f1", "target": "main", "setup_code": "", "assertion": "assert((run_program(\"5 1\\n1 2 3 4 5\\n\") == \"3\"));", "validation": { "status": "not_checked" }, "input_legality_status": "not_checked" }, { "id": "f2", "target": "main", "setup_code": "", "asse...
[]
[]
383
#include<bits/stdc++.h> using namespace std; #define ALL(x) (x).begin(),(x).end() #define uniq(x) (x).erase(unique(ALL(x)),(x).end()) #define SORT(x) sort(ALL(x)) #define REV(x) reverse(ALL(x)) #define foreach(it,x) for(__typeof((x).begin()) it=(x).begin();it!=(x).end();it++) #define debug(x) cerr<<#x<<"="<<(x)<<endl #...
We all know the impressive story of Robin Hood. Robin Hood uses his archery skills and his wits to steal the money from rich, and return it to the poor.There are n citizens in Kekoland, each person has ci coins. Each day, Robin Hood will take exactly 1 coin from the richest person in the city and he will give it to the...
[ { "id": "f1", "target": "main", "setup_code": "", "assertion": "assert((run_program(\"3 1\\n1 2 3\\n\") == \"1\"));", "validation": { "status": "not_checked" }, "input_legality_status": "not_checked" }, { "id": "f2", "target": "main", "setup_code": "", "assertio...
[ { "id": "a1", "api": "std::sort", "source_usage": "sort(c+1,c+n+1);", "description": "Sorts the range of n elements starting at c+1 in ascending order using default less comparison." }, { "id": "a2", "api": "std::min", "source_usage": "mx=min(mx,c[i-1]);", "description": "Returns...
[ { "id": "a1t1", "api_id": "a1", "setup_code": "long long c[5] = {0, 3, 1, 4, 2};", "assertion": "assert((sort(c+1, c+4), c[1] == 1 && c[2] == 3 && c[3] == 4));", "validation": { "status": "not_checked" }, "input_legality_status": "not_checked" }, { "id": "a1t2", "api_id...
End of preview.

No dataset card yet

Downloads last month
6