Dataset Viewer
Auto-converted to Parquet Duplicate
problem_id
int64
0
1.52k
problem_name
stringlengths
5
112
description
stringlengths
209
6.47k
lang
stringclasses
4 values
code
stringlengths
7
95.5k
status
stringclasses
3 values
passed
int64
0
24
total
int64
0
25
error
stringclasses
567 values
failures
stringlengths
2
2k
source
stringclasses
5 values
difficulty
stringclasses
13 values
6
1012_E. Cycle sort
You are given an array of n positive integers a_1, a_2, ..., a_n. You can perform the following operation any number of times: select several distinct indices i_1, i_2, ..., i_k (1 ≤ i_j ≤ n) and move the number standing at the position i_1 to the position i_2, the number at the position i_2 to the position i_3, ..., t...
cpp
#include <bits/stdc++.h> using namespace std; const int MAXN = 300000; map<int, int> mapa; map<pair<int, int>, vector<int>> pos; vector<int> g[MAXN]; int ptr[MAXN]; int used[MAXN]; void euler(int v, vector<int> &res) { used[v] = true; for (; ptr[v] < (int)(g[v]).size();) { ++ptr[v]; int u = g[v][ptr[v] - 1]...
partial
11
23
[{"idx": 0, "reason": "wrong_answer", "expected": "1\n5\n1 4 2 3 5", "got": "1\n5\n5 2 3 4 1"}, {"idx": 6, "reason": "wrong_answer", "expected": "1\n2\n2 5", "got": "1\n2\n5 2"}, {"idx": 9, "reason": "wrong_answer", "expected": "1\n5\n1 3 5 2 4", "got": "1\n5\n3 5 2 4 1"}, {"idx": 10, "reason": "wrong_answer", "expecte...
codeforces
E
6
1012_E. Cycle sort
You are given an array of n positive integers a_1, a_2, ..., a_n. You can perform the following operation any number of times: select several distinct indices i_1, i_2, ..., i_k (1 ≤ i_j ≤ n) and move the number standing at the position i_1 to the position i_2, the number at the position i_2 to the position i_3, ..., t...
cpp
#include <bits/stdc++.h> using namespace std; template <class BidirIt> BidirIt prev(BidirIt it, typename iterator_traits<BidirIt>::difference_type n = 1) { advance(it, -n); return it; } template <class ForwardIt> ForwardIt next(ForwardIt it, typename iterator_traits<ForwardIt>::differenc...
compile_error
0
0
COMPILE_ERROR:/tmp/sbx_vr7yfsbp/tmpq4pans1q.cpp: In function ‘void dfs(int)’: /tmp/sbx_vr7yfsbp/tmpq4pans1q.cpp:31:3: error: reference to ‘visit’ is ambiguous 31 | visit[u] = true; | ^~~~~ In file included from /usr/include/x86_64-linux-gnu/c++/11/bits/stdc++.h:133, from /tmp/sbx_vr7yfsbp/...
[]
codeforces
E
6
1012_E. Cycle sort
You are given an array of n positive integers a_1, a_2, ..., a_n. You can perform the following operation any number of times: select several distinct indices i_1, i_2, ..., i_k (1 ≤ i_j ≤ n) and move the number standing at the position i_1 to the position i_2, the number at the position i_2 to the position i_3, ..., t...
java
import java.io.OutputStream; import java.io.IOException; import java.io.InputStream; import java.io.OutputStream; import java.util.Arrays; import java.io.IOException; import java.util.Random; import java.util.ArrayList; import java.io.UncheckedIOException; import java.util.List; import java.io.Closeable; import java.io...
partial
11
23
[{"idx": 0, "reason": "wrong_answer", "expected": "1\n5\n1 4 2 3 5", "got": "1\n5\n5 2 3 4 1"}, {"idx": 6, "reason": "wrong_answer", "expected": "1\n2\n2 5", "got": "1\n2\n5 2"}, {"idx": 9, "reason": "wrong_answer", "expected": "1\n5\n1 3 5 2 4", "got": "1\n5\n3 5 2 4 1"}, {"idx": 10, "reason": "wrong_answer", "expecte...
codeforces
E
6
1012_E. Cycle sort
You are given an array of n positive integers a_1, a_2, ..., a_n. You can perform the following operation any number of times: select several distinct indices i_1, i_2, ..., i_k (1 ≤ i_j ≤ n) and move the number standing at the position i_1 to the position i_2, the number at the position i_2 to the position i_3, ..., t...
java
import java.io.*; import java.math.*; import java.util.*; import java.util.stream.*; public class E { int[] sorted(int[] a) { a = a.clone(); for (int i = 0; i < a.length; i++) { int j = rand(0, i); int tmp = a[i]; a[i] = a[j]; a[j] = tmp; } return a; } void solve(int[] a, int s) { int n = a....
partial
19
23
[{"idx": 13, "reason": "wrong_answer", "expected": "2\n2\n1 5\n3\n2 3 4", "got": "2\n3\n2 3 4\n2\n1 5"}, {"idx": 15, "reason": "wrong_answer", "expected": "2\n3\n1 5 2\n2\n3 4", "got": "2\n2\n3 4\n3\n1 5 2"}, {"idx": 21, "reason": "wrong_answer", "expected": "2\n2\n1 2\n2\n3 5", "got": "2\n2\n3 5\n2\n1 2"}, {"idx": 22,...
codeforces
E
6
1012_E. Cycle sort
You are given an array of n positive integers a_1, a_2, ..., a_n. You can perform the following operation any number of times: select several distinct indices i_1, i_2, ..., i_k (1 ≤ i_j ≤ n) and move the number standing at the position i_1 to the position i_2, the number at the position i_2 to the position i_3, ..., t...
java
import java.io.OutputStream; import java.io.IOException; import java.io.InputStream; import java.util.Arrays; import java.util.Random; import java.util.ArrayList; import java.io.OutputStreamWriter; import java.io.PrintStream; import java.io.OutputStream; import java.io.IOException; import java.io.UncheckedIOException; ...
partial
11
23
[{"idx": 0, "reason": "wrong_answer", "expected": "1\n5\n1 4 2 3 5", "got": "1\n5\n5 2 3 4 1"}, {"idx": 6, "reason": "wrong_answer", "expected": "1\n2\n2 5", "got": "1\n2\n5 2"}, {"idx": 9, "reason": "wrong_answer", "expected": "1\n5\n1 3 5 2 4", "got": "1\n5\n3 5 2 4 1"}, {"idx": 10, "reason": "wrong_answer", "expecte...
codeforces
E
7
1037_E. Trips
There are n persons who initially don't know each other. On each morning, two of them, who were not friends before, become friends. We want to plan a trip for every evening of m days. On each trip, you have to select a group of people that will go on the trip. For every person, one of the following should hold: * ...
python2
import os import sys from atexit import register from io import BytesIO sys.stdin = BytesIO(os.read(0, os.fstat(0).st_size)) sys.stdout = BytesIO() register(lambda: os.write(1, sys.stdout.getvalue())) input = lambda: sys.stdin.readline().rstrip('\r\n') raw_input = lambda: sys.stdin.readline().rstrip('\r\n') n,m,k = m...
all_fail
0
5
[{"idx": 0, "reason": "runtime_error", "rc": 1, "stderr": "Traceback (most recent call last):\n File \"/tmp/sbx_6cms73fv/tmp5pnk0jzx.py\", line 12, in <module>\n n,m,k = map(int,raw_input().split(\" \"))\nValueError: invalid literal for int() with base 10: ''\n", "stdout_tail": ""}, {"idx": 1, "reason": "runtime_er...
codeforces
E
11
1149_E. Election Promises
In Byteland, there are two political parties fighting for seats in the Parliament in the upcoming elections: Wrong Answer Party and Time Limit Exceeded Party. As they want to convince as many citizens as possible to cast their votes on them, they keep promising lower and lower taxes. There are n cities in Byteland, co...
java
import java.io.FileInputStream; import java.io.IOException; import java.io.InputStream; import java.io.OutputStream; import java.nio.charset.Charset; import java.util.ArrayList; import java.util.Arrays; import java.util.List; public class CF1149E { public static void main(String[] args) throws Exception { ...
all_fail
0
18
[{"idx": 0, "reason": "runtime_error", "rc": 1, "stderr": "Exception in thread \"main\" java.io.FileNotFoundException: D:\\DATABASE\\TESTCASE\\Code.in (No such file or directory)\n\tat java.base/java.io.FileInputStream.open0(Native Method)\n\tat java.base/java.io.File", "stdout_tail": ""}, {"idx": 1, "reason": "runtime...
codeforces
E
16
1311_F. Moving Points
There are n points on a coordinate axis OX. The i-th point is located at the integer point x_i and has a speed v_i. It is guaranteed that no two points occupy the same coordinate. All n points move with the constant speed, the coordinate of the i-th point at the moment t (t can be non-integer) is calculated as x_i + t ...
python3
import io import os from collections import Counter, defaultdict, deque, namedtuple # From: https://github.com/cheran-senthil/PyRival/blob/master/pyrival/data_structures/SegmentTree.py class SegmentTree: def __init__(self, data, default=0, func=max): """initialize the segment tree with data""" sel...
all_fail
0
3
[{"idx": 0, "reason": "runtime_error", "rc": 1, "stderr": "Traceback (most recent call last):\n File \"/tmp/sbx_xvqmjrsz/tmpji01jh19.py\", line 129, in <module>\n (N,) = [int(x) for x in input().split()]\n ^^^^\nValueError: not enough values to unpack (expec", "stdout_tail": ""}, {"idx": 1, "reason": "runtime_er...
codeforces
F
18
1354_F. Summoning Minions
Polycarp plays a computer game. In this game, the players summon armies of magical minions, which then fight each other. Polycarp can summon n different minions. The initial power level of the i-th minion is a_i, and when it is summoned, all previously summoned minions' power levels are increased by b_i. The minions c...
cpp
#include <bits/stdc++.h> using namespace std; struct Edge { long long to, dis, next, cost; } edge[24050]; long long num = -1; bool vis[10010]; long long mincost; long long pre[10010], head[10010], cost[10010], last[10010], flow[10010], n, k, a[110], b[110], s, t, maxflow; long long to[110]; void add(long long f, ...
all_fail
0
2
[{"idx": 0, "reason": "wrong_answer", "expected": "8\n2 3 -3 4 -4 1 -1 5\n3\n1 -1 2\n5\n5 4 3 2 1", "got": "8\n5 3 -3 4 -4 1 -1 2\n3\n1 -1 2\n5\n5 4 3 2 1"}, {"idx": 1, "reason": "wrong_answer", "expected": "8\n2 3 -3 4 -4 1 -1 5\n3\n1 -1 2\n5\n5 4 3 2 1", "got": "8\n5 3 -3 4 -4 1 -1 2\n3\n1 -1 2\n5\n5 4 3 2 1"}]
codeforces
F
18
1354_F. Summoning Minions
Polycarp plays a computer game. In this game, the players summon armies of magical minions, which then fight each other. Polycarp can summon n different minions. The initial power level of the i-th minion is a_i, and when it is summoned, all previously summoned minions' power levels are increased by b_i. The minions c...
cpp
#include <bits/stdc++.h> using namespace std; const int INF = 0x3f3f3f3f; void read(int &val) { int x = 0; int bz = 1; char c; for (c = getchar(); (c < '0' || c > '9') && c != '-'; c = getchar()) ; if (c == '-') { bz = -1; c = getchar(); } for (; c >= '0' && c <= '9'; c = getchar()) x = x * 10...
all_fail
0
2
[{"idx": 0, "reason": "wrong_answer", "expected": "8\n2 3 -3 4 -4 1 -1 5\n3\n1 -1 2\n5\n5 4 3 2 1", "got": "8\n5 1 -1 3 -3 4 -4 2\n1\n2\n5\n5 4 3 2 1"}, {"idx": 1, "reason": "wrong_answer", "expected": "8\n2 3 -3 4 -4 1 -1 5\n3\n1 -1 2\n5\n5 4 3 2 1", "got": "8\n5 1 -1 3 -3 4 -4 2\n1\n2\n5\n5 4 3 2 1"}]
codeforces
F
18
1354_F. Summoning Minions
Polycarp plays a computer game. In this game, the players summon armies of magical minions, which then fight each other. Polycarp can summon n different minions. The initial power level of the i-th minion is a_i, and when it is summoned, all previously summoned minions' power levels are increased by b_i. The minions c...
cpp
#include <bits/stdc++.h> using namespace std; const int INF = 2e9; int solve() { int n, k; cin >> n >> k; vector<pair<pair<int, int>, int>> arr(n); for (int i = 0; i < n; i++) cin >> arr[i].first.second >> arr[i].first.first, arr[i].second = i + 1; sort(arr.begin(), arr.end()); vector<int> a(n), b(n); ...
all_fail
0
2
[{"idx": 0, "reason": "wrong_answer", "expected": "8\n2 3 -3 4 -4 1 -1 5\n3\n1 -1 2\n5\n5 4 3 2 1", "got": "8\n2 1 -1 3 -3 4 -4 5\n3\n1 -1 2\n5\n5 4 3 2 1"}, {"idx": 1, "reason": "wrong_answer", "expected": "8\n2 3 -3 4 -4 1 -1 5\n3\n1 -1 2\n5\n5 4 3 2 1", "got": "8\n2 1 -1 3 -3 4 -4 5\n3\n1 -1 2\n5\n5 4 3 2 1"}]
codeforces
F
18
1354_F. Summoning Minions
Polycarp plays a computer game. In this game, the players summon armies of magical minions, which then fight each other. Polycarp can summon n different minions. The initial power level of the i-th minion is a_i, and when it is summoned, all previously summoned minions' power levels are increased by b_i. The minions c...
java
import java.io.OutputStream; import java.io.IOException; import java.io.InputStream; import java.util.stream.IntStream; import java.io.OutputStream; import java.io.PrintWriter; import java.util.Arrays; import java.io.BufferedWriter; import java.util.InputMismatchException; import java.io.IOException; import java.util.s...
all_fail
0
2
[{"idx": 0, "reason": "wrong_answer", "expected": "8\n2 3 -3 4 -4 1 -1 5\n3\n1 -1 2\n5\n5 4 3 2 1", "got": "8\n2 1 -1 3 -3 4 -4 5\n3\n1 -1 2\n5\n5 4 3 2 1"}, {"idx": 1, "reason": "wrong_answer", "expected": "8\n2 3 -3 4 -4 1 -1 5\n3\n1 -1 2\n5\n5 4 3 2 1", "got": "8\n2 1 -1 3 -3 4 -4 5\n3\n1 -1 2\n5\n5 4 3 2 1"}]
codeforces
F
18
1354_F. Summoning Minions
Polycarp plays a computer game. In this game, the players summon armies of magical minions, which then fight each other. Polycarp can summon n different minions. The initial power level of the i-th minion is a_i, and when it is summoned, all previously summoned minions' power levels are increased by b_i. The minions c...
python3
from sys import stdin, gettrace from heapq import nlargest if not gettrace(): def input(): return next(stdin)[:-1] # def input(): # return stdin.buffer.readline() INF = int(10E10) def main(): def solve(): n, k = map(int, input().split()) mm = [] for i in range(1,n+1): ...
all_fail
0
2
[{"idx": 0, "reason": "wrong_answer", "expected": "8\n2 3 -3 4 -4 1 -1 5\n3\n1 -1 2\n5\n5 4 3 2 1", "got": "8\n2 1 -1 3 -3 4 -4 5\n3\n1 -1 2\n5\n5 4 3 2 1"}, {"idx": 1, "reason": "wrong_answer", "expected": "8\n2 3 -3 4 -4 1 -1 5\n3\n1 -1 2\n5\n5 4 3 2 1", "got": "8\n2 1 -1 3 -3 4 -4 5\n3\n1 -1 2\n5\n5 4 3 2 1"}]
codeforces
F
18
1354_F. Summoning Minions
Polycarp plays a computer game. In this game, the players summon armies of magical minions, which then fight each other. Polycarp can summon n different minions. The initial power level of the i-th minion is a_i, and when it is summoned, all previously summoned minions' power levels are increased by b_i. The minions c...
java
/** * @author egaeus * @mail sebegaeusprogram@gmail.com * @veredict * @url * @category * @date **/ import java.io.BufferedReader; import java.io.InputStreamReader; import java.util.*; import java.util.stream.Collectors; import java.util.stream.IntStream; import static java.lang.Integer.parseInt; public class ...
all_fail
0
2
[{"idx": 0, "reason": "wrong_answer", "expected": "8\n2 3 -3 4 -4 1 -1 5\n3\n1 -1 2\n5\n5 4 3 2 1", "got": "8\n5 4 -4 3 -3 1 -1 2\n3\n1 -1 2\n5\n5 4 3 2 1"}, {"idx": 1, "reason": "wrong_answer", "expected": "8\n2 3 -3 4 -4 1 -1 5\n3\n1 -1 2\n5\n5 4 3 2 1", "got": "8\n5 4 -4 3 -3 1 -1 2\n3\n1 -1 2\n5\n5 4 3 2 1"}]
codeforces
F
18
1354_F. Summoning Minions
Polycarp plays a computer game. In this game, the players summon armies of magical minions, which then fight each other. Polycarp can summon n different minions. The initial power level of the i-th minion is a_i, and when it is summoned, all previously summoned minions' power levels are increased by b_i. The minions c...
python3
from operator import itemgetter import sys int1 = lambda x: int(x) - 1 p2D = lambda x: print(*x, sep="\n") def II(): return int(sys.stdin.readline()) def MI(): return map(int, sys.stdin.readline().split()) def LI(): return list(map(int, sys.stdin.readline().split())) def LLI(rows_number): return [LI() for _ in range(r...
all_fail
0
2
[{"idx": 0, "reason": "wrong_answer", "expected": "8\n2 3 -3 4 -4 1 -1 5\n3\n1 -1 2\n5\n5 4 3 2 1", "got": "8\n5 1 -1 3 -3 4 -4 2\n3\n1 -1 2\n5\n5 4 3 2 1"}, {"idx": 1, "reason": "wrong_answer", "expected": "8\n2 3 -3 4 -4 1 -1 5\n3\n1 -1 2\n5\n5 4 3 2 1", "got": "8\n5 1 -1 3 -3 4 -4 2\n3\n1 -1 2\n5\n5 4 3 2 1"}]
codeforces
F
18
1354_F. Summoning Minions
Polycarp plays a computer game. In this game, the players summon armies of magical minions, which then fight each other. Polycarp can summon n different minions. The initial power level of the i-th minion is a_i, and when it is summoned, all previously summoned minions' power levels are increased by b_i. The minions c...
python3
def read_int(): return int(input()) def read_ints(): return map(int, input().split(' ')) t = read_int() for case_num in range(t): n, k = read_ints() p = [] for i in range(n): ai, bi = read_ints() p.append((bi, ai, i + 1)) p.sort() dp = [[0 for j in range(k + 1)] for i in ...
all_fail
0
2
[{"idx": 0, "reason": "wrong_answer", "expected": "8\n2 3 -3 4 -4 1 -1 5\n3\n1 -1 2\n5\n5 4 3 2 1", "got": "8\n2 1 -1 3 -3 4 -4 5\n3\n1 -1 2\n5\n5 4 3 2 1"}, {"idx": 1, "reason": "wrong_answer", "expected": "8\n2 3 -3 4 -4 1 -1 5\n3\n1 -1 2\n5\n5 4 3 2 1", "got": "8\n2 1 -1 3 -3 4 -4 5\n3\n1 -1 2\n5\n5 4 3 2 1"}]
codeforces
F
19
1374_E1. Reading Books (easy version)
Easy and hard versions are actually different problems, so read statements of both problems completely and carefully. Summer vacation has started so Alice and Bob want to play and joy, but... Their mom doesn't think so. She says that they have to read some amount of books before all entertainments. Alice and Bob will ...
cpp
#include <bits/stdc++.h> using namespace std; template <typename T> using minpq = priority_queue<T, vector<T>, greater<T>>; int n, k, a, b; long long t; vector<long long> ve[2][2]; int main() { ios::sync_with_stdio(false); cin.tie(0); cin >> n >> k; for (int i = (0); i < (n); i++) { cin >> t >> a >> b; ...
partial
15
18
[{"idx": 12, "reason": "runtime_error", "rc": -11, "stderr": "", "stdout_tail": ""}, {"idx": 14, "reason": "runtime_error", "rc": -11, "stderr": "", "stdout_tail": ""}, {"idx": 16, "reason": "runtime_error", "rc": -11, "stderr": "", "stdout_tail": ""}]
codeforces
E
19
1374_E1. Reading Books (easy version)
Easy and hard versions are actually different problems, so read statements of both problems completely and carefully. Summer vacation has started so Alice and Bob want to play and joy, but... Their mom doesn't think so. She says that they have to read some amount of books before all entertainments. Alice and Bob will ...
python3
import sys input=sys.stdin.readline f=lambda :list(map(int, input().strip('\n').split())) n, k=f() _11=[] _01=[] _10=[] for _ in range(n): t, a, b=f() if a and b: _11.append(t) elif a: _10.append(t) elif b: _01.append(t) _01.sort(); _10.sort(); _11.sort() for i in range(1, len(_01)): _01[i]+=_01[i-1] for i ...
partial
8
18
[{"idx": 8, "reason": "runtime_error", "rc": 1, "stderr": "Traceback (most recent call last):\n File \"/tmp/sbx_mw2w0qth/tmpc2xg5tth.py\", line 5, in <module>\n n, k=f()\n ^^^^\nValueError: too many values to unpack (expected 2)\n", "stdout_tail": ""}, {"idx": 9, "reason": "runtime_error", "rc": 1, "stderr": "Tr...
codeforces
E
19
1374_E1. Reading Books (easy version)
Easy and hard versions are actually different problems, so read statements of both problems completely and carefully. Summer vacation has started so Alice and Bob want to play and joy, but... Their mom doesn't think so. She says that they have to read some amount of books before all entertainments. Alice and Bob will ...
cpp
#include <bits/stdc++.h> using namespace std; const int INF = 1e9; const long long INFLL = 0x3f3f3f3f3f3f3f3f; const int MOD = 1e9 + 7; int main() { ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0); int n, k; cin >> n >> k; vector<int> alice, bobo, osdois; for (int i = 0; i < n; i++) { bool a, b;...
partial
13
18
[{"idx": 8, "reason": "wrong_answer", "expected": "-1", "got": "4"}, {"idx": 10, "reason": "wrong_answer", "expected": "-1", "got": "3"}, {"idx": 12, "reason": "wrong_answer", "expected": "-1", "got": "5"}, {"idx": 15, "reason": "wrong_answer", "expected": "-1", "got": "2"}, {"idx": 16, "reason": "wrong_answer", "expec...
codeforces
E
19
1374_E1. Reading Books (easy version)
Easy and hard versions are actually different problems, so read statements of both problems completely and carefully. Summer vacation has started so Alice and Bob want to play and joy, but... Their mom doesn't think so. She says that they have to read some amount of books before all entertainments. Alice and Bob will ...
java
import java.io.*; import java.util.*; public class Codeforces { public static void main(String args[])throws Exception { BufferedReader bu=new BufferedReader(new InputStreamReader(System.in)); StringBuilder sb=new StringBuilder(); String s[]=bu.readLine().split(" "); int n=Integ...
partial
13
18
[{"idx": 8, "reason": "wrong_answer", "expected": "-1", "got": "26"}, {"idx": 9, "reason": "wrong_answer", "expected": "-1", "got": "59"}, {"idx": 12, "reason": "wrong_answer", "expected": "-1", "got": "173"}, {"idx": 13, "reason": "wrong_answer", "expected": "-1", "got": "59"}, {"idx": 17, "reason": "wrong_answer", "e...
codeforces
E
19
1374_E1. Reading Books (easy version)
Easy and hard versions are actually different problems, so read statements of both problems completely and carefully. Summer vacation has started so Alice and Bob want to play and joy, but... Their mom doesn't think so. She says that they have to read some amount of books before all entertainments. Alice and Bob will ...
python3
from collections import deque n, k = map(int, input().split()) onla = [] onlb = [] both = [] for i in range(n): a, b, c = map(int, input().split()) if b == 1 and c == 1: both.append(a) elif c == 1: onlb.append(a) elif b == 1: onla.append(a) if len(both) + len(onla) < k or len(bot...
partial
8
18
[{"idx": 8, "reason": "runtime_error", "rc": 1, "stderr": "Traceback (most recent call last):\n File \"/tmp/sbx_s7fci9gq/tmplj0ml0by.py\", line 2, in <module>\n n, k = map(int, input().split())\n ^^^^\nValueError: too many values to unpack (expected 2)\n", "stdout_tail": ""}, {"idx": 9, "reason": "runtime_error"...
codeforces
E
19
1374_E1. Reading Books (easy version)
Easy and hard versions are actually different problems, so read statements of both problems completely and carefully. Summer vacation has started so Alice and Bob want to play and joy, but... Their mom doesn't think so. She says that they have to read some amount of books before all entertainments. Alice and Bob will ...
python3
class Book: def __init__(self, time, for_alice, for_bob): self.time = time self.for_alice = bool(for_alice) self.for_bob = bool(for_bob) self.status = ('A' if self.for_alice else '') + ('B' if self.for_bob else '') def get(li, i): try: return li[i].time except Index...
partial
8
18
[{"idx": 8, "reason": "runtime_error", "rc": 1, "stderr": "Traceback (most recent call last):\n File \"/tmp/sbx_e15ot9du/tmpijq2uvis.py\", line 16, in <module>\n n, k = map(int, input().split())\n ^^^^\nValueError: too many values to unpack (expected 2)\n", "stdout_tail": ""}, {"idx": 9, "reason": "runtime_error...
codeforces
E
19
1374_E1. Reading Books (easy version)
Easy and hard versions are actually different problems, so read statements of both problems completely and carefully. Summer vacation has started so Alice and Bob want to play and joy, but... Their mom doesn't think so. She says that they have to read some amount of books before all entertainments. Alice and Bob will ...
java
import java.util.*; public class readingBooks { public static void main(String[] args) { Scanner input = new Scanner(System.in); int n = input.nextInt(); int k = input.nextInt(); ArrayList<Integer>[] arr = new ArrayList[4]; for(int i = 0; i < 4; i++){ arr[i] = n...
partial
8
18
[{"idx": 8, "reason": "runtime_error", "rc": 1, "stderr": "Exception in thread \"main\" java.lang.ArrayIndexOutOfBoundsException: Index 7 out of bounds for length 4\n\tat readingBooks.main(readingBooks.java:16)\n", "stdout_tail": ""}, {"idx": 9, "reason": "runtime_error", "rc": 1, "stderr": "Exception in thread \"main\...
codeforces
E
19
1374_E1. Reading Books (easy version)
Easy and hard versions are actually different problems, so read statements of both problems completely and carefully. Summer vacation has started so Alice and Bob want to play and joy, but... Their mom doesn't think so. She says that they have to read some amount of books before all entertainments. Alice and Bob will ...
python2
input = raw_input range = xrange import sys inp = [int(x) for x in sys.stdin.read().split()]; ii = 0 seg = [0]*200000 def offset(x): return x + 100000 def encode(x, y): return (x<<20) + y def upd(node, L, R, pos, val): if L+1 == R: seg[node] += val seg[offset(node)] = seg[node]*L return M = (L+R)>>1 if po...
partial
3
18
[{"idx": 0, "reason": "runtime_error", "rc": 1, "stderr": "Traceback (most recent call last):\n File \"/tmp/sbx_nb4s5pxa/tmp8m3fk8if.py\", line 41, in <module>\n t, a, b = inp[ii:ii+3]; ii += 3\nValueError: need more than 2 values to unpack\n", "stdout_tail": ""}, {"idx": 1, "reason": "runtime_error", "rc": 1, "std...
codeforces
E
19
1374_E1. Reading Books (easy version)
Easy and hard versions are actually different problems, so read statements of both problems completely and carefully. Summer vacation has started so Alice and Bob want to play and joy, but... Their mom doesn't think so. She says that they have to read some amount of books before all entertainments. Alice and Bob will ...
python2
n,k = map(int,raw_input().split()) both = [];alice = [];bob = [] for _ in range(n): t,a,b = map(int,raw_input().split()) if a&b: both.append(t) elif a: alice.append(t) elif b: bob.append(t) alice.sort() bob.sort() for i in range(min(len(alice),len(bob))): both.append(alice[i]...
partial
8
18
[{"idx": 8, "reason": "runtime_error", "rc": 1, "stderr": "Traceback (most recent call last):\n File \"/tmp/sbx_9_nzis5j/tmp1vq2hnbs.py\", line 1, in <module>\n n,k = map(int,raw_input().split())\nValueError: too many values to unpack\n", "stdout_tail": ""}, {"idx": 9, "reason": "runtime_error", "rc": 1, "stderr": ...
codeforces
E
End of preview. Expand in Data Studio
README.md exists but content is empty.
Downloads last month
28