exec_outcome
stringclasses
1 value
code_uid
stringlengths
32
32
file_name
stringclasses
111 values
prob_desc_created_at
stringlengths
10
10
prob_desc_description
stringlengths
63
3.8k
prob_desc_memory_limit
stringclasses
18 values
source_code
stringlengths
117
65.5k
lang_cluster
stringclasses
1 value
prob_desc_sample_inputs
stringlengths
2
802
prob_desc_time_limit
stringclasses
27 values
prob_desc_sample_outputs
stringlengths
2
796
prob_desc_notes
stringlengths
4
3k
⌀
lang
stringclasses
5 values
prob_desc_input_from
stringclasses
3 values
tags
listlengths
0
11
src_uid
stringlengths
32
32
prob_desc_input_spec
stringlengths
28
2.37k
⌀
difficulty
int64
-1
3.5k
⌀
prob_desc_output_spec
stringlengths
17
1.47k
⌀
prob_desc_output_to
stringclasses
3 values
hidden_unit_tests
stringclasses
1 value
PASSED
9632f9c171786a15a65023e2f25654f2
train_003.jsonl
1361374200
A tree is a graph with n vertices and exactly n - 1 edges; this graph should meet the following condition: there exists exactly one shortest (by number of edges) path between any pair of its vertices.A subtree of a tree T is a tree with both vertices and edges as subsets of vertices and edges of T.You're given a tree w...
256 megabytes
import java.io.BufferedReader; import java.io.FileReader; import java.io.IOException; import java.io.InputStreamReader; import java.util.Scanner; import java.util.StringTokenizer; import java.util.*; import java.io.*; public class codeforces { static class Student{ int x,y;//z; Student(int x,int...
Java
["3\n1 2\n1 3\n1 -1 1"]
2 seconds
["3"]
null
Java 8
standard input
[ "dp", "dfs and similar", "greedy", "trees" ]
f3c26aa520f6bfa6b181ec40bde7ee1b
The first line of the input contains n (1 ≤ n ≤ 105). Each of the next n - 1 lines contains two integers ai and bi (1 ≤ ai, bi ≤ n; ai ≠ bi) indicating there's an edge between vertices ai and bi. It's guaranteed that the input graph is a tree. The last line of the input contains a list of n space-separated integers v1...
1,800
Print the minimum number of operations needed to solve the task. Please, do not write the %lld specifier to read or write 64-bit integers in С++. It is preferred to use the cin, cout streams or the %I64d specifier.
standard output
PASSED
0a0c25827984c844192d7794d6f44506
train_003.jsonl
1361374200
A tree is a graph with n vertices and exactly n - 1 edges; this graph should meet the following condition: there exists exactly one shortest (by number of edges) path between any pair of its vertices.A subtree of a tree T is a tree with both vertices and edges as subsets of vertices and edges of T.You're given a tree w...
256 megabytes
import java.util.ArrayList; import java.util.Scanner; public class _28_Zero_trees { static long[][] dp; public static void main(String[] args) { Scanner scn = new Scanner(System.in); int n = scn.nextInt(); dp = new long[n][2]; int[] arr = new int[n]; ArrayList<ArrayList<Integer>> list = new ArrayList<>();...
Java
["3\n1 2\n1 3\n1 -1 1"]
2 seconds
["3"]
null
Java 8
standard input
[ "dp", "dfs and similar", "greedy", "trees" ]
f3c26aa520f6bfa6b181ec40bde7ee1b
The first line of the input contains n (1 ≤ n ≤ 105). Each of the next n - 1 lines contains two integers ai and bi (1 ≤ ai, bi ≤ n; ai ≠ bi) indicating there's an edge between vertices ai and bi. It's guaranteed that the input graph is a tree. The last line of the input contains a list of n space-separated integers v1...
1,800
Print the minimum number of operations needed to solve the task. Please, do not write the %lld specifier to read or write 64-bit integers in С++. It is preferred to use the cin, cout streams or the %I64d specifier.
standard output
PASSED
75b6f00a93aa2c6fd33648be7c649a4c
train_003.jsonl
1361374200
A tree is a graph with n vertices and exactly n - 1 edges; this graph should meet the following condition: there exists exactly one shortest (by number of edges) path between any pair of its vertices.A subtree of a tree T is a tree with both vertices and edges as subsets of vertices and edges of T.You're given a tree w...
256 megabytes
import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; import java.lang.reflect.Array; import java.util.ArrayList; import java.util.Arrays; import java.util.StringTokenizer; import java.util.*; import java.lang.*; import java.io.*; public class Main { public static ArrayList...
Java
["3\n1 2\n1 3\n1 -1 1"]
2 seconds
["3"]
null
Java 8
standard input
[ "dp", "dfs and similar", "greedy", "trees" ]
f3c26aa520f6bfa6b181ec40bde7ee1b
The first line of the input contains n (1 ≤ n ≤ 105). Each of the next n - 1 lines contains two integers ai and bi (1 ≤ ai, bi ≤ n; ai ≠ bi) indicating there's an edge between vertices ai and bi. It's guaranteed that the input graph is a tree. The last line of the input contains a list of n space-separated integers v1...
1,800
Print the minimum number of operations needed to solve the task. Please, do not write the %lld specifier to read or write 64-bit integers in С++. It is preferred to use the cin, cout streams or the %I64d specifier.
standard output
PASSED
8900c894e740c94ab9c544c74190a2bf
train_003.jsonl
1361374200
A tree is a graph with n vertices and exactly n - 1 edges; this graph should meet the following condition: there exists exactly one shortest (by number of edges) path between any pair of its vertices.A subtree of a tree T is a tree with both vertices and edges as subsets of vertices and edges of T.You're given a tree w...
256 megabytes
// ONE DAY, YOU WILL BE BEYOND THE REACH OF SPACE AND TIME. // // UNTIL THEN, STAY LOW AND CODE HARD. // // Author :- Saurabh// //BIT MESRA, RANCHI// import java.io.*; import java.util.*; import java.util.Queue; import static java.lang.Math.*; public class zeroTree { static ArrayList<Integer> adj[]; static long ar...
Java
["3\n1 2\n1 3\n1 -1 1"]
2 seconds
["3"]
null
Java 8
standard input
[ "dp", "dfs and similar", "greedy", "trees" ]
f3c26aa520f6bfa6b181ec40bde7ee1b
The first line of the input contains n (1 ≤ n ≤ 105). Each of the next n - 1 lines contains two integers ai and bi (1 ≤ ai, bi ≤ n; ai ≠ bi) indicating there's an edge between vertices ai and bi. It's guaranteed that the input graph is a tree. The last line of the input contains a list of n space-separated integers v1...
1,800
Print the minimum number of operations needed to solve the task. Please, do not write the %lld specifier to read or write 64-bit integers in С++. It is preferred to use the cin, cout streams or the %I64d specifier.
standard output
PASSED
803ef65bdf28a3034e56d7d90bcfef7a
train_003.jsonl
1361374200
A tree is a graph with n vertices and exactly n - 1 edges; this graph should meet the following condition: there exists exactly one shortest (by number of edges) path between any pair of its vertices.A subtree of a tree T is a tree with both vertices and edges as subsets of vertices and edges of T.You're given a tree w...
256 megabytes
import java.io.OutputStream; import java.io.IOException; import java.io.InputStream; import java.io.OutputStream; import java.io.PrintWriter; import java.util.List; import java.io.BufferedWriter; import java.io.Writer; import java.io.OutputStreamWriter; import java.util.InputMismatchException; import java.io.IOExceptio...
Java
["3\n1 2\n1 3\n1 -1 1"]
2 seconds
["3"]
null
Java 8
standard input
[ "dp", "dfs and similar", "greedy", "trees" ]
f3c26aa520f6bfa6b181ec40bde7ee1b
The first line of the input contains n (1 ≤ n ≤ 105). Each of the next n - 1 lines contains two integers ai and bi (1 ≤ ai, bi ≤ n; ai ≠ bi) indicating there's an edge between vertices ai and bi. It's guaranteed that the input graph is a tree. The last line of the input contains a list of n space-separated integers v1...
1,800
Print the minimum number of operations needed to solve the task. Please, do not write the %lld specifier to read or write 64-bit integers in С++. It is preferred to use the cin, cout streams or the %I64d specifier.
standard output
PASSED
dfa6ff7e1517e3f3025d79276b4b8221
train_003.jsonl
1361374200
A tree is a graph with n vertices and exactly n - 1 edges; this graph should meet the following condition: there exists exactly one shortest (by number of edges) path between any pair of its vertices.A subtree of a tree T is a tree with both vertices and edges as subsets of vertices and edges of T.You're given a tree w...
256 megabytes
import java.io.BufferedReader; import java.io.BufferedWriter; import java.io.FileInputStream; import java.io.IOException; import java.io.InputStream; import java.io.InputStreamReader; import java.io.OutputStreamWriter; import java.io.ObjectInputStream.GetField; import java.io.PrintWriter; import java.math.BigInteger; i...
Java
["3\n1 2\n1 3\n1 -1 1"]
2 seconds
["3"]
null
Java 8
standard input
[ "dp", "dfs and similar", "greedy", "trees" ]
f3c26aa520f6bfa6b181ec40bde7ee1b
The first line of the input contains n (1 ≤ n ≤ 105). Each of the next n - 1 lines contains two integers ai and bi (1 ≤ ai, bi ≤ n; ai ≠ bi) indicating there's an edge between vertices ai and bi. It's guaranteed that the input graph is a tree. The last line of the input contains a list of n space-separated integers v1...
1,800
Print the minimum number of operations needed to solve the task. Please, do not write the %lld specifier to read or write 64-bit integers in С++. It is preferred to use the cin, cout streams or the %I64d specifier.
standard output
PASSED
1d1718c1a6384ba9e5e712ddda9bd7b4
train_003.jsonl
1361374200
A tree is a graph with n vertices and exactly n - 1 edges; this graph should meet the following condition: there exists exactly one shortest (by number of edges) path between any pair of its vertices.A subtree of a tree T is a tree with both vertices and edges as subsets of vertices and edges of T.You're given a tree w...
256 megabytes
import java.io.*; import java.util.*; /** * Created by yusuf on 21/03/17. */ public class Main { public static void main(String[] args) { InputReader in = new InputReader(System.in); PrintWriter out = new PrintWriter(System.out); Solver solver = new Solver(); solver.solve(in, out)...
Java
["3\n1 2\n1 3\n1 -1 1"]
2 seconds
["3"]
null
Java 8
standard input
[ "dp", "dfs and similar", "greedy", "trees" ]
f3c26aa520f6bfa6b181ec40bde7ee1b
The first line of the input contains n (1 ≤ n ≤ 105). Each of the next n - 1 lines contains two integers ai and bi (1 ≤ ai, bi ≤ n; ai ≠ bi) indicating there's an edge between vertices ai and bi. It's guaranteed that the input graph is a tree. The last line of the input contains a list of n space-separated integers v1...
1,800
Print the minimum number of operations needed to solve the task. Please, do not write the %lld specifier to read or write 64-bit integers in С++. It is preferred to use the cin, cout streams or the %I64d specifier.
standard output
PASSED
de40f270290ad9b3aca04c5ea1424f6d
train_003.jsonl
1361374200
A tree is a graph with n vertices and exactly n - 1 edges; this graph should meet the following condition: there exists exactly one shortest (by number of edges) path between any pair of its vertices.A subtree of a tree T is a tree with both vertices and edges as subsets of vertices and edges of T.You're given a tree w...
256 megabytes
//package Graphs; import javafx.util.Pair; import java.io.*; import java.util.*; import java.util.StringTokenizer; public class main274B { public static PrintWriter out = new PrintWriter(System.out); public static FastScanner enter = new FastScanner(System.in); public static long[] w; public static...
Java
["3\n1 2\n1 3\n1 -1 1"]
2 seconds
["3"]
null
Java 8
standard input
[ "dp", "dfs and similar", "greedy", "trees" ]
f3c26aa520f6bfa6b181ec40bde7ee1b
The first line of the input contains n (1 ≤ n ≤ 105). Each of the next n - 1 lines contains two integers ai and bi (1 ≤ ai, bi ≤ n; ai ≠ bi) indicating there's an edge between vertices ai and bi. It's guaranteed that the input graph is a tree. The last line of the input contains a list of n space-separated integers v1...
1,800
Print the minimum number of operations needed to solve the task. Please, do not write the %lld specifier to read or write 64-bit integers in С++. It is preferred to use the cin, cout streams or the %I64d specifier.
standard output
PASSED
6929238e5c9ed04dde7a815358c92915
train_003.jsonl
1361374200
A tree is a graph with n vertices and exactly n - 1 edges; this graph should meet the following condition: there exists exactly one shortest (by number of edges) path between any pair of its vertices.A subtree of a tree T is a tree with both vertices and edges as subsets of vertices and edges of T.You're given a tree w...
256 megabytes
import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; import java.util.*; /** * Created by birukoudzmitry on 23.07.18. */ public class B274 { public static void main(String[] args) { MyScanner in = new MyScanner(); int n = in.nextInt(); Set<Intege...
Java
["3\n1 2\n1 3\n1 -1 1"]
2 seconds
["3"]
null
Java 8
standard input
[ "dp", "dfs and similar", "greedy", "trees" ]
f3c26aa520f6bfa6b181ec40bde7ee1b
The first line of the input contains n (1 ≤ n ≤ 105). Each of the next n - 1 lines contains two integers ai and bi (1 ≤ ai, bi ≤ n; ai ≠ bi) indicating there's an edge between vertices ai and bi. It's guaranteed that the input graph is a tree. The last line of the input contains a list of n space-separated integers v1...
1,800
Print the minimum number of operations needed to solve the task. Please, do not write the %lld specifier to read or write 64-bit integers in С++. It is preferred to use the cin, cout streams or the %I64d specifier.
standard output
PASSED
e806699acf25a536e3038e01c9dc5e32
train_003.jsonl
1361374200
A tree is a graph with n vertices and exactly n - 1 edges; this graph should meet the following condition: there exists exactly one shortest (by number of edges) path between any pair of its vertices.A subtree of a tree T is a tree with both vertices and edges as subsets of vertices and edges of T.You're given a tree w...
256 megabytes
import java.util.*; import java.lang.*; import java.math.*; import java.io.*; /* spar5h */ public class cf4 implements Runnable{ final static long mod = (long)1e9 + 7; static ArrayList<Integer>[] adj; static long[] inc, dec, val; static int[] vis; static void dfs(int x, int p) { vis[x] = 1; ...
Java
["3\n1 2\n1 3\n1 -1 1"]
2 seconds
["3"]
null
Java 8
standard input
[ "dp", "dfs and similar", "greedy", "trees" ]
f3c26aa520f6bfa6b181ec40bde7ee1b
The first line of the input contains n (1 ≤ n ≤ 105). Each of the next n - 1 lines contains two integers ai and bi (1 ≤ ai, bi ≤ n; ai ≠ bi) indicating there's an edge between vertices ai and bi. It's guaranteed that the input graph is a tree. The last line of the input contains a list of n space-separated integers v1...
1,800
Print the minimum number of operations needed to solve the task. Please, do not write the %lld specifier to read or write 64-bit integers in С++. It is preferred to use the cin, cout streams or the %I64d specifier.
standard output
PASSED
28130a96eb23f4d6307dae05b25b4e84
train_003.jsonl
1353339000
Polycarpus is a system administrator. There are two servers under his strict guidance — a and b. To stay informed about the servers' performance, Polycarpus executes commands "ping a" and "ping b". Each ping command sends exactly ten packets to the server specified in the argument of the command. Executing a program re...
256 megabytes
import java.util.Scanner; public class pr245A { public static void main(String[] args) { Scanner in = new Scanner(System.in); int n = in.nextInt(); int aSum, bSum, aPack, bPack; int[] sum = new int[3]; int[] pack = new int[3]; for (int i = 0; i < n; i++) { ...
Java
["2\n1 5 5\n2 6 4", "3\n1 0 10\n2 0 10\n1 10 0"]
2 seconds
["LIVE\nLIVE", "LIVE\nDEAD"]
NoteConsider the first test case. There 10 packets were sent to server a, 5 of them reached it. Therefore, at least half of all packets sent to this server successfully reached it through the network. Overall there were 10 packets sent to server b, 6 of them reached it. Therefore, at least half of all packets sent to t...
Java 8
standard input
[ "implementation" ]
1d8870a705036b9820227309d74dd1e8
The first line contains a single integer n (2 ≤ n ≤ 1000) — the number of commands Polycarpus has fulfilled. Each of the following n lines contains three integers — the description of the commands. The i-th of these lines contains three space-separated integers ti, xi, yi (1 ≤ ti ≤ 2; xi, yi ≥ 0; xi + yi = 10). If ti =...
800
In the first line print string "LIVE" (without the quotes) if server a is "alive", otherwise print "DEAD" (without the quotes). In the second line print the state of server b in the similar format.
standard output
PASSED
994edbcc76abc41da509263ea4e8fabe
train_003.jsonl
1353339000
Polycarpus is a system administrator. There are two servers under his strict guidance — a and b. To stay informed about the servers' performance, Polycarpus executes commands "ping a" and "ping b". Each ping command sends exactly ten packets to the server specified in the argument of the command. Executing a program re...
256 megabytes
import java.util.Scanner; public class Solution { public static void main(String[] args) { Scanner scanner = new Scanner(System.in); int n = scanner.nextInt(); int res = 0; int a = 0, b = 0; int aTotal = 0, bTotal = 0; for (int i = 0; i < n; i++) { int t...
Java
["2\n1 5 5\n2 6 4", "3\n1 0 10\n2 0 10\n1 10 0"]
2 seconds
["LIVE\nLIVE", "LIVE\nDEAD"]
NoteConsider the first test case. There 10 packets were sent to server a, 5 of them reached it. Therefore, at least half of all packets sent to this server successfully reached it through the network. Overall there were 10 packets sent to server b, 6 of them reached it. Therefore, at least half of all packets sent to t...
Java 8
standard input
[ "implementation" ]
1d8870a705036b9820227309d74dd1e8
The first line contains a single integer n (2 ≤ n ≤ 1000) — the number of commands Polycarpus has fulfilled. Each of the following n lines contains three integers — the description of the commands. The i-th of these lines contains three space-separated integers ti, xi, yi (1 ≤ ti ≤ 2; xi, yi ≥ 0; xi + yi = 10). If ti =...
800
In the first line print string "LIVE" (without the quotes) if server a is "alive", otherwise print "DEAD" (without the quotes). In the second line print the state of server b in the similar format.
standard output
PASSED
1c52efa842cb11ab9382f7370ff64ae9
train_003.jsonl
1353339000
Polycarpus is a system administrator. There are two servers under his strict guidance — a and b. To stay informed about the servers' performance, Polycarpus executes commands "ping a" and "ping b". Each ping command sends exactly ten packets to the server specified in the argument of the command. Executing a program re...
256 megabytes
import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner cv=new Scanner(System.in); int n=cv.nextInt(); int sum1=0,sum2=0; int a,b,c; for (int i = 0; i < n ; i++) { a=cv.nextInt(); b=cv.nextInt(); c=c...
Java
["2\n1 5 5\n2 6 4", "3\n1 0 10\n2 0 10\n1 10 0"]
2 seconds
["LIVE\nLIVE", "LIVE\nDEAD"]
NoteConsider the first test case. There 10 packets were sent to server a, 5 of them reached it. Therefore, at least half of all packets sent to this server successfully reached it through the network. Overall there were 10 packets sent to server b, 6 of them reached it. Therefore, at least half of all packets sent to t...
Java 8
standard input
[ "implementation" ]
1d8870a705036b9820227309d74dd1e8
The first line contains a single integer n (2 ≤ n ≤ 1000) — the number of commands Polycarpus has fulfilled. Each of the following n lines contains three integers — the description of the commands. The i-th of these lines contains three space-separated integers ti, xi, yi (1 ≤ ti ≤ 2; xi, yi ≥ 0; xi + yi = 10). If ti =...
800
In the first line print string "LIVE" (without the quotes) if server a is "alive", otherwise print "DEAD" (without the quotes). In the second line print the state of server b in the similar format.
standard output
PASSED
c4935bcb73277074f8b2c52b52762565
train_003.jsonl
1353339000
Polycarpus is a system administrator. There are two servers under his strict guidance — a and b. To stay informed about the servers' performance, Polycarpus executes commands "ping a" and "ping b". Each ping command sends exactly ten packets to the server specified in the argument of the command. Executing a program re...
256 megabytes
//package Fcis; import java.util.*; import javafx.util.Pair; import java.lang.*; public class Assignment1 { static Scanner in = new Scanner(System.in); public static void main(String[] args) { long n, t, x, y, a = 0, b = 0; n = in.nextLong(); for(int i = 0; i < n; i++) { ...
Java
["2\n1 5 5\n2 6 4", "3\n1 0 10\n2 0 10\n1 10 0"]
2 seconds
["LIVE\nLIVE", "LIVE\nDEAD"]
NoteConsider the first test case. There 10 packets were sent to server a, 5 of them reached it. Therefore, at least half of all packets sent to this server successfully reached it through the network. Overall there were 10 packets sent to server b, 6 of them reached it. Therefore, at least half of all packets sent to t...
Java 8
standard input
[ "implementation" ]
1d8870a705036b9820227309d74dd1e8
The first line contains a single integer n (2 ≤ n ≤ 1000) — the number of commands Polycarpus has fulfilled. Each of the following n lines contains three integers — the description of the commands. The i-th of these lines contains three space-separated integers ti, xi, yi (1 ≤ ti ≤ 2; xi, yi ≥ 0; xi + yi = 10). If ti =...
800
In the first line print string "LIVE" (without the quotes) if server a is "alive", otherwise print "DEAD" (without the quotes). In the second line print the state of server b in the similar format.
standard output
PASSED
31d5630fee2d13d963128a176ece46c4
train_003.jsonl
1353339000
Polycarpus is a system administrator. There are two servers under his strict guidance — a and b. To stay informed about the servers' performance, Polycarpus executes commands "ping a" and "ping b". Each ping command sends exactly ten packets to the server specified in the argument of the command. Executing a program re...
256 megabytes
import java.util.Scanner; import java.util.stream.Collectors; import java.util.stream.IntStream; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int n = sc.nextInt(); int[] t = new int[n]; int[] x = new int[n]; int[] y = new int[n]; for (int i = 0; i < n;...
Java
["2\n1 5 5\n2 6 4", "3\n1 0 10\n2 0 10\n1 10 0"]
2 seconds
["LIVE\nLIVE", "LIVE\nDEAD"]
NoteConsider the first test case. There 10 packets were sent to server a, 5 of them reached it. Therefore, at least half of all packets sent to this server successfully reached it through the network. Overall there were 10 packets sent to server b, 6 of them reached it. Therefore, at least half of all packets sent to t...
Java 8
standard input
[ "implementation" ]
1d8870a705036b9820227309d74dd1e8
The first line contains a single integer n (2 ≤ n ≤ 1000) — the number of commands Polycarpus has fulfilled. Each of the following n lines contains three integers — the description of the commands. The i-th of these lines contains three space-separated integers ti, xi, yi (1 ≤ ti ≤ 2; xi, yi ≥ 0; xi + yi = 10). If ti =...
800
In the first line print string "LIVE" (without the quotes) if server a is "alive", otherwise print "DEAD" (without the quotes). In the second line print the state of server b in the similar format.
standard output
PASSED
af64ea859ef292dc997c4b66e714a4c3
train_003.jsonl
1353339000
Polycarpus is a system administrator. There are two servers under his strict guidance — a and b. To stay informed about the servers' performance, Polycarpus executes commands "ping a" and "ping b". Each ping command sends exactly ten packets to the server specified in the argument of the command. Executing a program re...
256 megabytes
/* package whatever; // don't place package name! */ import java.util.*; import java.lang.*; import java.io.*; /* Name of the class has to be "Main" only if the class is public. */ public class whatever { public static void main (String[] args) throws java.lang.Exception { Scanner f = new Scanner(System.in); i...
Java
["2\n1 5 5\n2 6 4", "3\n1 0 10\n2 0 10\n1 10 0"]
2 seconds
["LIVE\nLIVE", "LIVE\nDEAD"]
NoteConsider the first test case. There 10 packets were sent to server a, 5 of them reached it. Therefore, at least half of all packets sent to this server successfully reached it through the network. Overall there were 10 packets sent to server b, 6 of them reached it. Therefore, at least half of all packets sent to t...
Java 8
standard input
[ "implementation" ]
1d8870a705036b9820227309d74dd1e8
The first line contains a single integer n (2 ≤ n ≤ 1000) — the number of commands Polycarpus has fulfilled. Each of the following n lines contains three integers — the description of the commands. The i-th of these lines contains three space-separated integers ti, xi, yi (1 ≤ ti ≤ 2; xi, yi ≥ 0; xi + yi = 10). If ti =...
800
In the first line print string "LIVE" (without the quotes) if server a is "alive", otherwise print "DEAD" (without the quotes). In the second line print the state of server b in the similar format.
standard output
PASSED
217b817ace28db8da06aa399ffab6895
train_003.jsonl
1353339000
Polycarpus is a system administrator. There are two servers under his strict guidance — a and b. To stay informed about the servers' performance, Polycarpus executes commands "ping a" and "ping b". Each ping command sends exactly ten packets to the server specified in the argument of the command. Executing a program re...
256 megabytes
import java.io.*; import java.util.*; public class SystemAdministrator { public static void main(String[] args) throws IOException{ BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); int n = Integer.parseInt(br.readLine()); int value1 = 0; int value2 = 0; for(int i = 0; i < n; i++) { ...
Java
["2\n1 5 5\n2 6 4", "3\n1 0 10\n2 0 10\n1 10 0"]
2 seconds
["LIVE\nLIVE", "LIVE\nDEAD"]
NoteConsider the first test case. There 10 packets were sent to server a, 5 of them reached it. Therefore, at least half of all packets sent to this server successfully reached it through the network. Overall there were 10 packets sent to server b, 6 of them reached it. Therefore, at least half of all packets sent to t...
Java 8
standard input
[ "implementation" ]
1d8870a705036b9820227309d74dd1e8
The first line contains a single integer n (2 ≤ n ≤ 1000) — the number of commands Polycarpus has fulfilled. Each of the following n lines contains three integers — the description of the commands. The i-th of these lines contains three space-separated integers ti, xi, yi (1 ≤ ti ≤ 2; xi, yi ≥ 0; xi + yi = 10). If ti =...
800
In the first line print string "LIVE" (without the quotes) if server a is "alive", otherwise print "DEAD" (without the quotes). In the second line print the state of server b in the similar format.
standard output
PASSED
0c2239b2fefe1cb2a41021d7b3d5eb8b
train_003.jsonl
1353339000
Polycarpus is a system administrator. There are two servers under his strict guidance — a and b. To stay informed about the servers' performance, Polycarpus executes commands "ping a" and "ping b". Each ping command sends exactly ten packets to the server specified in the argument of the command. Executing a program re...
256 megabytes
//take 3 (with fucking counters) //take 4 bitches //take 5 the counter are no counters anymore import java.util.Scanner; public class foo { static boolean isEven(int n){ if ( n % 2 == 0 ) return true; else return false; } public static void main(String[] args) { Scanner read = new Scanner(System.in); in...
Java
["2\n1 5 5\n2 6 4", "3\n1 0 10\n2 0 10\n1 10 0"]
2 seconds
["LIVE\nLIVE", "LIVE\nDEAD"]
NoteConsider the first test case. There 10 packets were sent to server a, 5 of them reached it. Therefore, at least half of all packets sent to this server successfully reached it through the network. Overall there were 10 packets sent to server b, 6 of them reached it. Therefore, at least half of all packets sent to t...
Java 8
standard input
[ "implementation" ]
1d8870a705036b9820227309d74dd1e8
The first line contains a single integer n (2 ≤ n ≤ 1000) — the number of commands Polycarpus has fulfilled. Each of the following n lines contains three integers — the description of the commands. The i-th of these lines contains three space-separated integers ti, xi, yi (1 ≤ ti ≤ 2; xi, yi ≥ 0; xi + yi = 10). If ti =...
800
In the first line print string "LIVE" (without the quotes) if server a is "alive", otherwise print "DEAD" (without the quotes). In the second line print the state of server b in the similar format.
standard output
PASSED
0f134b98cb8eaa718c4fb1b78d1d8fee
train_003.jsonl
1353339000
Polycarpus is a system administrator. There are two servers under his strict guidance — a and b. To stay informed about the servers' performance, Polycarpus executes commands "ping a" and "ping b". Each ping command sends exactly ten packets to the server specified in the argument of the command. Executing a program re...
256 megabytes
import java.util.Scanner; public class Ishu { public static void main(String[] args) { Scanner scan=new Scanner(System.in); int n,i,j; int[][] a=new int[1002][3]; n=scan.nextInt(); for(i=0;i<n;++i) { for(j=0;j<3;++j) a[i][j]=scan.nextInt(); if(a[i][0]==1) { a[1000][1]+=a[i][1]; ...
Java
["2\n1 5 5\n2 6 4", "3\n1 0 10\n2 0 10\n1 10 0"]
2 seconds
["LIVE\nLIVE", "LIVE\nDEAD"]
NoteConsider the first test case. There 10 packets were sent to server a, 5 of them reached it. Therefore, at least half of all packets sent to this server successfully reached it through the network. Overall there were 10 packets sent to server b, 6 of them reached it. Therefore, at least half of all packets sent to t...
Java 8
standard input
[ "implementation" ]
1d8870a705036b9820227309d74dd1e8
The first line contains a single integer n (2 ≤ n ≤ 1000) — the number of commands Polycarpus has fulfilled. Each of the following n lines contains three integers — the description of the commands. The i-th of these lines contains three space-separated integers ti, xi, yi (1 ≤ ti ≤ 2; xi, yi ≥ 0; xi + yi = 10). If ti =...
800
In the first line print string "LIVE" (without the quotes) if server a is "alive", otherwise print "DEAD" (without the quotes). In the second line print the state of server b in the similar format.
standard output
PASSED
19e3b88dd89fcdc4a7b3f57f6bb3eeba
train_003.jsonl
1353339000
Polycarpus is a system administrator. There are two servers under his strict guidance — a and b. To stay informed about the servers' performance, Polycarpus executes commands "ping a" and "ping b". Each ping command sends exactly ten packets to the server specified in the argument of the command. Executing a program re...
256 megabytes
import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; import java.util.StringTokenizer; public class SystemAdministrator { static class FastReader { BufferedReader br; StringTokenizer st; public FastReader() { br = new BufferedReader(new InputStreamReader(System.in)); ...
Java
["2\n1 5 5\n2 6 4", "3\n1 0 10\n2 0 10\n1 10 0"]
2 seconds
["LIVE\nLIVE", "LIVE\nDEAD"]
NoteConsider the first test case. There 10 packets were sent to server a, 5 of them reached it. Therefore, at least half of all packets sent to this server successfully reached it through the network. Overall there were 10 packets sent to server b, 6 of them reached it. Therefore, at least half of all packets sent to t...
Java 8
standard input
[ "implementation" ]
1d8870a705036b9820227309d74dd1e8
The first line contains a single integer n (2 ≤ n ≤ 1000) — the number of commands Polycarpus has fulfilled. Each of the following n lines contains three integers — the description of the commands. The i-th of these lines contains three space-separated integers ti, xi, yi (1 ≤ ti ≤ 2; xi, yi ≥ 0; xi + yi = 10). If ti =...
800
In the first line print string "LIVE" (without the quotes) if server a is "alive", otherwise print "DEAD" (without the quotes). In the second line print the state of server b in the similar format.
standard output
PASSED
dd2b056028e865a709171ae0450b85ae
train_003.jsonl
1353339000
Polycarpus is a system administrator. There are two servers under his strict guidance — a and b. To stay informed about the servers' performance, Polycarpus executes commands "ping a" and "ping b". Each ping command sends exactly ten packets to the server specified in the argument of the command. Executing a program re...
256 megabytes
import java.util.Scanner; public class A245 { public static void main(String args[]){ Scanner sc = new Scanner(System.in); int sum1 = 0; int sum2 = 0; int sum3 = 0; int sum4 = 0; int n = sc.nextInt(); for (int i = 0; i < n; i++){ int ping = sc.n...
Java
["2\n1 5 5\n2 6 4", "3\n1 0 10\n2 0 10\n1 10 0"]
2 seconds
["LIVE\nLIVE", "LIVE\nDEAD"]
NoteConsider the first test case. There 10 packets were sent to server a, 5 of them reached it. Therefore, at least half of all packets sent to this server successfully reached it through the network. Overall there were 10 packets sent to server b, 6 of them reached it. Therefore, at least half of all packets sent to t...
Java 8
standard input
[ "implementation" ]
1d8870a705036b9820227309d74dd1e8
The first line contains a single integer n (2 ≤ n ≤ 1000) — the number of commands Polycarpus has fulfilled. Each of the following n lines contains three integers — the description of the commands. The i-th of these lines contains three space-separated integers ti, xi, yi (1 ≤ ti ≤ 2; xi, yi ≥ 0; xi + yi = 10). If ti =...
800
In the first line print string "LIVE" (without the quotes) if server a is "alive", otherwise print "DEAD" (without the quotes). In the second line print the state of server b in the similar format.
standard output
PASSED
262e62154194b7368d6054152b3bb590
train_003.jsonl
1353339000
Polycarpus is a system administrator. There are two servers under his strict guidance — a and b. To stay informed about the servers' performance, Polycarpus executes commands "ping a" and "ping b". Each ping command sends exactly ten packets to the server specified in the argument of the command. Executing a program re...
256 megabytes
import java.util.Scanner; public class Demo { public static void main(String args[]) { Scanner sc = new Scanner(System.in); short n = sc.nextShort(); int server[] = new int[n]; int packet[][] = new int[n][2]; int ping_a = 0, lost_a = 0, ping_b = 0, lost_b = 0; for(int i=0;i<n;i++) { server[i] = sc.ne...
Java
["2\n1 5 5\n2 6 4", "3\n1 0 10\n2 0 10\n1 10 0"]
2 seconds
["LIVE\nLIVE", "LIVE\nDEAD"]
NoteConsider the first test case. There 10 packets were sent to server a, 5 of them reached it. Therefore, at least half of all packets sent to this server successfully reached it through the network. Overall there were 10 packets sent to server b, 6 of them reached it. Therefore, at least half of all packets sent to t...
Java 8
standard input
[ "implementation" ]
1d8870a705036b9820227309d74dd1e8
The first line contains a single integer n (2 ≤ n ≤ 1000) — the number of commands Polycarpus has fulfilled. Each of the following n lines contains three integers — the description of the commands. The i-th of these lines contains three space-separated integers ti, xi, yi (1 ≤ ti ≤ 2; xi, yi ≥ 0; xi + yi = 10). If ti =...
800
In the first line print string "LIVE" (without the quotes) if server a is "alive", otherwise print "DEAD" (without the quotes). In the second line print the state of server b in the similar format.
standard output
PASSED
2d48927ea8c6c857f73b8153a897d6b4
train_003.jsonl
1353339000
Polycarpus is a system administrator. There are two servers under his strict guidance — a and b. To stay informed about the servers' performance, Polycarpus executes commands "ping a" and "ping b". Each ping command sends exactly ten packets to the server specified in the argument of the command. Executing a program re...
256 megabytes
import java.util.*; public class A245 { static void printStatus(int up, int down) { System.out.println(up >= down ? "LIVE" : "DEAD"); } public static void main(String[] args) { // TODO Auto-generated method stub Scanner scan = new Scanner(System.in); int tries = scan.nextInt(); int aUp = 0; int aD...
Java
["2\n1 5 5\n2 6 4", "3\n1 0 10\n2 0 10\n1 10 0"]
2 seconds
["LIVE\nLIVE", "LIVE\nDEAD"]
NoteConsider the first test case. There 10 packets were sent to server a, 5 of them reached it. Therefore, at least half of all packets sent to this server successfully reached it through the network. Overall there were 10 packets sent to server b, 6 of them reached it. Therefore, at least half of all packets sent to t...
Java 8
standard input
[ "implementation" ]
1d8870a705036b9820227309d74dd1e8
The first line contains a single integer n (2 ≤ n ≤ 1000) — the number of commands Polycarpus has fulfilled. Each of the following n lines contains three integers — the description of the commands. The i-th of these lines contains three space-separated integers ti, xi, yi (1 ≤ ti ≤ 2; xi, yi ≥ 0; xi + yi = 10). If ti =...
800
In the first line print string "LIVE" (without the quotes) if server a is "alive", otherwise print "DEAD" (without the quotes). In the second line print the state of server b in the similar format.
standard output
PASSED
68eeaa9e96089924e9fec687becf3375
train_003.jsonl
1353339000
Polycarpus is a system administrator. There are two servers under his strict guidance — a and b. To stay informed about the servers' performance, Polycarpus executes commands "ping a" and "ping b". Each ping command sends exactly ten packets to the server specified in the argument of the command. Executing a program re...
256 megabytes
import java.util.*; import java.io.*; public class CROCMBTU_2012A { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int n = sc.nextInt(); int c1 = 0, c2 = 0, w1 = 0, w2 = 0; for(int i = 0; i < n; i++) { if(sc.nextInt() == 1) { c1 += sc.nextInt(); w1 += sc.nextInt...
Java
["2\n1 5 5\n2 6 4", "3\n1 0 10\n2 0 10\n1 10 0"]
2 seconds
["LIVE\nLIVE", "LIVE\nDEAD"]
NoteConsider the first test case. There 10 packets were sent to server a, 5 of them reached it. Therefore, at least half of all packets sent to this server successfully reached it through the network. Overall there were 10 packets sent to server b, 6 of them reached it. Therefore, at least half of all packets sent to t...
Java 8
standard input
[ "implementation" ]
1d8870a705036b9820227309d74dd1e8
The first line contains a single integer n (2 ≤ n ≤ 1000) — the number of commands Polycarpus has fulfilled. Each of the following n lines contains three integers — the description of the commands. The i-th of these lines contains three space-separated integers ti, xi, yi (1 ≤ ti ≤ 2; xi, yi ≥ 0; xi + yi = 10). If ti =...
800
In the first line print string "LIVE" (without the quotes) if server a is "alive", otherwise print "DEAD" (without the quotes). In the second line print the state of server b in the similar format.
standard output
PASSED
1734b26c6031b0095a53ee222747a831
train_003.jsonl
1353339000
Polycarpus is a system administrator. There are two servers under his strict guidance — a and b. To stay informed about the servers' performance, Polycarpus executes commands "ping a" and "ping b". Each ping command sends exactly ten packets to the server specified in the argument of the command. Executing a program re...
256 megabytes
import java.util.Scanner; public class A{ public static void main(String[] args){ Scanner s = new Scanner(System.in); int n, aR, aL, bR, bL; n = s.nextInt(); aR = 0; aL = 0; bR = 0; bL = 0; while(n>0){ int t, x, y; t =...
Java
["2\n1 5 5\n2 6 4", "3\n1 0 10\n2 0 10\n1 10 0"]
2 seconds
["LIVE\nLIVE", "LIVE\nDEAD"]
NoteConsider the first test case. There 10 packets were sent to server a, 5 of them reached it. Therefore, at least half of all packets sent to this server successfully reached it through the network. Overall there were 10 packets sent to server b, 6 of them reached it. Therefore, at least half of all packets sent to t...
Java 8
standard input
[ "implementation" ]
1d8870a705036b9820227309d74dd1e8
The first line contains a single integer n (2 ≤ n ≤ 1000) — the number of commands Polycarpus has fulfilled. Each of the following n lines contains three integers — the description of the commands. The i-th of these lines contains three space-separated integers ti, xi, yi (1 ≤ ti ≤ 2; xi, yi ≥ 0; xi + yi = 10). If ti =...
800
In the first line print string "LIVE" (without the quotes) if server a is "alive", otherwise print "DEAD" (without the quotes). In the second line print the state of server b in the similar format.
standard output
PASSED
e7c99ccd750ebd8ffaf906f0c404825a
train_003.jsonl
1353339000
Polycarpus is a system administrator. There are two servers under his strict guidance — a and b. To stay informed about the servers' performance, Polycarpus executes commands "ping a" and "ping b". Each ping command sends exactly ten packets to the server specified in the argument of the command. Executing a program re...
256 megabytes
import java.util.Scanner; public class A245 { public static void main(String q[]){ Scanner sc=new Scanner(System.in); int n=sc.nextInt(); int sa=0,la=0,sb=0,lb=0; for (int i=0;i<n;i++){ int type=sc.nextInt(); if(type==1){ sa+=sc.nextInt(); ...
Java
["2\n1 5 5\n2 6 4", "3\n1 0 10\n2 0 10\n1 10 0"]
2 seconds
["LIVE\nLIVE", "LIVE\nDEAD"]
NoteConsider the first test case. There 10 packets were sent to server a, 5 of them reached it. Therefore, at least half of all packets sent to this server successfully reached it through the network. Overall there were 10 packets sent to server b, 6 of them reached it. Therefore, at least half of all packets sent to t...
Java 8
standard input
[ "implementation" ]
1d8870a705036b9820227309d74dd1e8
The first line contains a single integer n (2 ≤ n ≤ 1000) — the number of commands Polycarpus has fulfilled. Each of the following n lines contains three integers — the description of the commands. The i-th of these lines contains three space-separated integers ti, xi, yi (1 ≤ ti ≤ 2; xi, yi ≥ 0; xi + yi = 10). If ti =...
800
In the first line print string "LIVE" (without the quotes) if server a is "alive", otherwise print "DEAD" (without the quotes). In the second line print the state of server b in the similar format.
standard output
PASSED
05b5518759fc7e1705491954427a34d1
train_003.jsonl
1353339000
Polycarpus is a system administrator. There are two servers under his strict guidance — a and b. To stay informed about the servers' performance, Polycarpus executes commands "ping a" and "ping b". Each ping command sends exactly ten packets to the server specified in the argument of the command. Executing a program re...
256 megabytes
import java.io.*; import java.util.*; public class test { public static void main(String[] args) throws IOException { // BufferedReader br = new BufferedReader(new FileReader(".in")); // PrintWriter pw = new PrintWriter(new BufferedWriter(new FileWriter(".out"))); BufferedReader br = new BufferedReader(new InputSt...
Java
["2\n1 5 5\n2 6 4", "3\n1 0 10\n2 0 10\n1 10 0"]
2 seconds
["LIVE\nLIVE", "LIVE\nDEAD"]
NoteConsider the first test case. There 10 packets were sent to server a, 5 of them reached it. Therefore, at least half of all packets sent to this server successfully reached it through the network. Overall there were 10 packets sent to server b, 6 of them reached it. Therefore, at least half of all packets sent to t...
Java 8
standard input
[ "implementation" ]
1d8870a705036b9820227309d74dd1e8
The first line contains a single integer n (2 ≤ n ≤ 1000) — the number of commands Polycarpus has fulfilled. Each of the following n lines contains three integers — the description of the commands. The i-th of these lines contains three space-separated integers ti, xi, yi (1 ≤ ti ≤ 2; xi, yi ≥ 0; xi + yi = 10). If ti =...
800
In the first line print string "LIVE" (without the quotes) if server a is "alive", otherwise print "DEAD" (without the quotes). In the second line print the state of server b in the similar format.
standard output
PASSED
ea3b2d4911dccb86fbce939eaa168cb5
train_003.jsonl
1353339000
Polycarpus is a system administrator. There are two servers under his strict guidance — a and b. To stay informed about the servers' performance, Polycarpus executes commands "ping a" and "ping b". Each ping command sends exactly ten packets to the server specified in the argument of the command. Executing a program re...
256 megabytes
import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; public class A245 { public static void main(String[] args) throws NumberFormatException, IOException { BufferedReader in = new BufferedReader(new InputStreamReader(System.in)); int n = Integer.parseInt(in.readLine()); ...
Java
["2\n1 5 5\n2 6 4", "3\n1 0 10\n2 0 10\n1 10 0"]
2 seconds
["LIVE\nLIVE", "LIVE\nDEAD"]
NoteConsider the first test case. There 10 packets were sent to server a, 5 of them reached it. Therefore, at least half of all packets sent to this server successfully reached it through the network. Overall there were 10 packets sent to server b, 6 of them reached it. Therefore, at least half of all packets sent to t...
Java 8
standard input
[ "implementation" ]
1d8870a705036b9820227309d74dd1e8
The first line contains a single integer n (2 ≤ n ≤ 1000) — the number of commands Polycarpus has fulfilled. Each of the following n lines contains three integers — the description of the commands. The i-th of these lines contains three space-separated integers ti, xi, yi (1 ≤ ti ≤ 2; xi, yi ≥ 0; xi + yi = 10). If ti =...
800
In the first line print string "LIVE" (without the quotes) if server a is "alive", otherwise print "DEAD" (without the quotes). In the second line print the state of server b in the similar format.
standard output
PASSED
83293a51c5c5484f8541ab213d967c70
train_003.jsonl
1353339000
Polycarpus is a system administrator. There are two servers under his strict guidance — a and b. To stay informed about the servers' performance, Polycarpus executes commands "ping a" and "ping b". Each ping command sends exactly ten packets to the server specified in the argument of the command. Executing a program re...
256 megabytes
import java.util.Scanner ; public class A_245 { public static void main(String [] args) { Scanner sc = new Scanner(System.in); int n = sc.nextInt(); int as = 0, af = 0, bs = 0, bf = 0 ; int t, x, y ; for(int i = 0; i < n; i++) { t = sc.nextInt(); ...
Java
["2\n1 5 5\n2 6 4", "3\n1 0 10\n2 0 10\n1 10 0"]
2 seconds
["LIVE\nLIVE", "LIVE\nDEAD"]
NoteConsider the first test case. There 10 packets were sent to server a, 5 of them reached it. Therefore, at least half of all packets sent to this server successfully reached it through the network. Overall there were 10 packets sent to server b, 6 of them reached it. Therefore, at least half of all packets sent to t...
Java 8
standard input
[ "implementation" ]
1d8870a705036b9820227309d74dd1e8
The first line contains a single integer n (2 ≤ n ≤ 1000) — the number of commands Polycarpus has fulfilled. Each of the following n lines contains three integers — the description of the commands. The i-th of these lines contains three space-separated integers ti, xi, yi (1 ≤ ti ≤ 2; xi, yi ≥ 0; xi + yi = 10). If ti =...
800
In the first line print string "LIVE" (without the quotes) if server a is "alive", otherwise print "DEAD" (without the quotes). In the second line print the state of server b in the similar format.
standard output
PASSED
1f2246606194f174f89ff67b86dcb725
train_003.jsonl
1353339000
Polycarpus is a system administrator. There are two servers under his strict guidance — a and b. To stay informed about the servers' performance, Polycarpus executes commands "ping a" and "ping b". Each ping command sends exactly ten packets to the server specified in the argument of the command. Executing a program re...
256 megabytes
import java.util.*; public class Server { public static void main(String args[]) throws Exception { Scanner scan=new Scanner(System.in); int n=scan.nextInt(); int[] t=new int[n]; int[] x=new int[n]; int[] y=new int[n]; int a=0,b=0,ax=0,bx=0; for(int i=...
Java
["2\n1 5 5\n2 6 4", "3\n1 0 10\n2 0 10\n1 10 0"]
2 seconds
["LIVE\nLIVE", "LIVE\nDEAD"]
NoteConsider the first test case. There 10 packets were sent to server a, 5 of them reached it. Therefore, at least half of all packets sent to this server successfully reached it through the network. Overall there were 10 packets sent to server b, 6 of them reached it. Therefore, at least half of all packets sent to t...
Java 8
standard input
[ "implementation" ]
1d8870a705036b9820227309d74dd1e8
The first line contains a single integer n (2 ≤ n ≤ 1000) — the number of commands Polycarpus has fulfilled. Each of the following n lines contains three integers — the description of the commands. The i-th of these lines contains three space-separated integers ti, xi, yi (1 ≤ ti ≤ 2; xi, yi ≥ 0; xi + yi = 10). If ti =...
800
In the first line print string "LIVE" (without the quotes) if server a is "alive", otherwise print "DEAD" (without the quotes). In the second line print the state of server b in the similar format.
standard output
PASSED
bafaedbbc1db18e7e1d9975ffe7def48
train_003.jsonl
1353339000
Polycarpus is a system administrator. There are two servers under his strict guidance — a and b. To stay informed about the servers' performance, Polycarpus executes commands "ping a" and "ping b". Each ping command sends exactly ten packets to the server specified in the argument of the command. Executing a program re...
256 megabytes
import java.util.*; final public class SystemAdministration { public static void main(String args[]) { Scanner s=new Scanner(System.in); int n=s.nextInt(); int a=0,b=0; int lossa=0,lossb=0; int senta=0,sentb=0; for(int i=0;i<n;i++) { int p=s.nextInt(); if(p==1) { senta=senta+s.nextInt(); ...
Java
["2\n1 5 5\n2 6 4", "3\n1 0 10\n2 0 10\n1 10 0"]
2 seconds
["LIVE\nLIVE", "LIVE\nDEAD"]
NoteConsider the first test case. There 10 packets were sent to server a, 5 of them reached it. Therefore, at least half of all packets sent to this server successfully reached it through the network. Overall there were 10 packets sent to server b, 6 of them reached it. Therefore, at least half of all packets sent to t...
Java 8
standard input
[ "implementation" ]
1d8870a705036b9820227309d74dd1e8
The first line contains a single integer n (2 ≤ n ≤ 1000) — the number of commands Polycarpus has fulfilled. Each of the following n lines contains three integers — the description of the commands. The i-th of these lines contains three space-separated integers ti, xi, yi (1 ≤ ti ≤ 2; xi, yi ≥ 0; xi + yi = 10). If ti =...
800
In the first line print string "LIVE" (without the quotes) if server a is "alive", otherwise print "DEAD" (without the quotes). In the second line print the state of server b in the similar format.
standard output
PASSED
4e3ea7744b9a4ebd1fc9c1847e38c060
train_003.jsonl
1353339000
Polycarpus is a system administrator. There are two servers under his strict guidance — a and b. To stay informed about the servers' performance, Polycarpus executes commands "ping a" and "ping b". Each ping command sends exactly ten packets to the server specified in the argument of the command. Executing a program re...
256 megabytes
import java.util.*; public class Solution { public static void main(String[] args) { Scanner scan = new Scanner(System.in); int n = scan.nextInt(); int pingsA = 0; int pingsB = 0; int liveA = 0; int liveB = 0; for(int i = 0; i < n; i++) { int t = scan.nextInt(); int x = scan.nextInt(); int y = ...
Java
["2\n1 5 5\n2 6 4", "3\n1 0 10\n2 0 10\n1 10 0"]
2 seconds
["LIVE\nLIVE", "LIVE\nDEAD"]
NoteConsider the first test case. There 10 packets were sent to server a, 5 of them reached it. Therefore, at least half of all packets sent to this server successfully reached it through the network. Overall there were 10 packets sent to server b, 6 of them reached it. Therefore, at least half of all packets sent to t...
Java 8
standard input
[ "implementation" ]
1d8870a705036b9820227309d74dd1e8
The first line contains a single integer n (2 ≤ n ≤ 1000) — the number of commands Polycarpus has fulfilled. Each of the following n lines contains three integers — the description of the commands. The i-th of these lines contains three space-separated integers ti, xi, yi (1 ≤ ti ≤ 2; xi, yi ≥ 0; xi + yi = 10). If ti =...
800
In the first line print string "LIVE" (without the quotes) if server a is "alive", otherwise print "DEAD" (without the quotes). In the second line print the state of server b in the similar format.
standard output
PASSED
fe8f53f31a8a44f3395bbff3cb0f0494
train_003.jsonl
1353339000
Polycarpus is a system administrator. There are two servers under his strict guidance — a and b. To stay informed about the servers' performance, Polycarpus executes commands "ping a" and "ping b". Each ping command sends exactly ten packets to the server specified in the argument of the command. Executing a program re...
256 megabytes
import java.util.Scanner; public class SystemAdministrator { public static void main(String[] args) { Scanner sc=new Scanner(System.in); int n=sc.nextInt(); int suma=0; int sumb=0; for(int i=0; i<n; i++) { int t=sc.nextInt(); if(t==1) { suma+=sc.nextInt(); suma-=sc.nextInt(); } if(t==2) {...
Java
["2\n1 5 5\n2 6 4", "3\n1 0 10\n2 0 10\n1 10 0"]
2 seconds
["LIVE\nLIVE", "LIVE\nDEAD"]
NoteConsider the first test case. There 10 packets were sent to server a, 5 of them reached it. Therefore, at least half of all packets sent to this server successfully reached it through the network. Overall there were 10 packets sent to server b, 6 of them reached it. Therefore, at least half of all packets sent to t...
Java 8
standard input
[ "implementation" ]
1d8870a705036b9820227309d74dd1e8
The first line contains a single integer n (2 ≤ n ≤ 1000) — the number of commands Polycarpus has fulfilled. Each of the following n lines contains three integers — the description of the commands. The i-th of these lines contains three space-separated integers ti, xi, yi (1 ≤ ti ≤ 2; xi, yi ≥ 0; xi + yi = 10). If ti =...
800
In the first line print string "LIVE" (without the quotes) if server a is "alive", otherwise print "DEAD" (without the quotes). In the second line print the state of server b in the similar format.
standard output
PASSED
87778259df130d7bd8139fa12f788ebc
train_003.jsonl
1353339000
Polycarpus is a system administrator. There are two servers under his strict guidance — a and b. To stay informed about the servers' performance, Polycarpus executes commands "ping a" and "ping b". Each ping command sends exactly ten packets to the server specified in the argument of the command. Executing a program re...
256 megabytes
import java.lang.*; import java.util.*; import java.io.*; public class systemp { int n ; Scanner sc=new Scanner(System.in); PrintWriter pr=new PrintWriter(System.out,true); public static void main(String... args) { systemp c=new systemp(); c.prop(); } public void prop() { int x,y,t1,t2 ; n...
Java
["2\n1 5 5\n2 6 4", "3\n1 0 10\n2 0 10\n1 10 0"]
2 seconds
["LIVE\nLIVE", "LIVE\nDEAD"]
NoteConsider the first test case. There 10 packets were sent to server a, 5 of them reached it. Therefore, at least half of all packets sent to this server successfully reached it through the network. Overall there were 10 packets sent to server b, 6 of them reached it. Therefore, at least half of all packets sent to t...
Java 8
standard input
[ "implementation" ]
1d8870a705036b9820227309d74dd1e8
The first line contains a single integer n (2 ≤ n ≤ 1000) — the number of commands Polycarpus has fulfilled. Each of the following n lines contains three integers — the description of the commands. The i-th of these lines contains three space-separated integers ti, xi, yi (1 ≤ ti ≤ 2; xi, yi ≥ 0; xi + yi = 10). If ti =...
800
In the first line print string "LIVE" (without the quotes) if server a is "alive", otherwise print "DEAD" (without the quotes). In the second line print the state of server b in the similar format.
standard output
PASSED
f8f0e39ebd42e1f1974dfff57be6cef8
train_003.jsonl
1353339000
Polycarpus is a system administrator. There are two servers under his strict guidance — a and b. To stay informed about the servers' performance, Polycarpus executes commands "ping a" and "ping b". Each ping command sends exactly ten packets to the server specified in the argument of the command. Executing a program re...
256 megabytes
import java.io.*; import java.util.*; public class Main { public static void main(String[] args) { InputStream inputStream = System.in; OutputStream outputStream = System.out; InputReader in = new InputReader(inputStream); PrintWriter out = new PrintWriter(outputStream); Ta...
Java
["2\n1 5 5\n2 6 4", "3\n1 0 10\n2 0 10\n1 10 0"]
2 seconds
["LIVE\nLIVE", "LIVE\nDEAD"]
NoteConsider the first test case. There 10 packets were sent to server a, 5 of them reached it. Therefore, at least half of all packets sent to this server successfully reached it through the network. Overall there were 10 packets sent to server b, 6 of them reached it. Therefore, at least half of all packets sent to t...
Java 8
standard input
[ "implementation" ]
1d8870a705036b9820227309d74dd1e8
The first line contains a single integer n (2 ≤ n ≤ 1000) — the number of commands Polycarpus has fulfilled. Each of the following n lines contains three integers — the description of the commands. The i-th of these lines contains three space-separated integers ti, xi, yi (1 ≤ ti ≤ 2; xi, yi ≥ 0; xi + yi = 10). If ti =...
800
In the first line print string "LIVE" (without the quotes) if server a is "alive", otherwise print "DEAD" (without the quotes). In the second line print the state of server b in the similar format.
standard output
PASSED
d2f6d33fc58b49b7a28e38e9f16334fe
train_003.jsonl
1353339000
Polycarpus is a system administrator. There are two servers under his strict guidance — a and b. To stay informed about the servers' performance, Polycarpus executes commands "ping a" and "ping b". Each ping command sends exactly ten packets to the server specified in the argument of the command. Executing a program re...
256 megabytes
import java.util.Scanner; public class SystemAdministrator { public static void main(String[] args ) { Scanner scan = new Scanner(System.in); int n=scan.nextInt(); int c1=0,c2=0,c3=0,c4=0; while(n-->0) { int t=scan.nextInt(); int x=scan.nextInt(); int y=scan.nextInt(); if(t==1) { c1+=x; c...
Java
["2\n1 5 5\n2 6 4", "3\n1 0 10\n2 0 10\n1 10 0"]
2 seconds
["LIVE\nLIVE", "LIVE\nDEAD"]
NoteConsider the first test case. There 10 packets were sent to server a, 5 of them reached it. Therefore, at least half of all packets sent to this server successfully reached it through the network. Overall there were 10 packets sent to server b, 6 of them reached it. Therefore, at least half of all packets sent to t...
Java 8
standard input
[ "implementation" ]
1d8870a705036b9820227309d74dd1e8
The first line contains a single integer n (2 ≤ n ≤ 1000) — the number of commands Polycarpus has fulfilled. Each of the following n lines contains three integers — the description of the commands. The i-th of these lines contains three space-separated integers ti, xi, yi (1 ≤ ti ≤ 2; xi, yi ≥ 0; xi + yi = 10). If ti =...
800
In the first line print string "LIVE" (without the quotes) if server a is "alive", otherwise print "DEAD" (without the quotes). In the second line print the state of server b in the similar format.
standard output
PASSED
2c4943d7ad205a29668c375c8ee1df1e
train_003.jsonl
1353339000
Polycarpus is a system administrator. There are two servers under his strict guidance — a and b. To stay informed about the servers' performance, Polycarpus executes commands "ping a" and "ping b". Each ping command sends exactly ten packets to the server specified in the argument of the command. Executing a program re...
256 megabytes
import java.util.Scanner; public class Q2 { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int t = sc.nextInt(); int a1 = 0, a2=0, b1=0, b2=0; for (int i = 0; i < t; i++) { int s = sc.nextInt(); if (s == 1){ a1 ...
Java
["2\n1 5 5\n2 6 4", "3\n1 0 10\n2 0 10\n1 10 0"]
2 seconds
["LIVE\nLIVE", "LIVE\nDEAD"]
NoteConsider the first test case. There 10 packets were sent to server a, 5 of them reached it. Therefore, at least half of all packets sent to this server successfully reached it through the network. Overall there were 10 packets sent to server b, 6 of them reached it. Therefore, at least half of all packets sent to t...
Java 8
standard input
[ "implementation" ]
1d8870a705036b9820227309d74dd1e8
The first line contains a single integer n (2 ≤ n ≤ 1000) — the number of commands Polycarpus has fulfilled. Each of the following n lines contains three integers — the description of the commands. The i-th of these lines contains three space-separated integers ti, xi, yi (1 ≤ ti ≤ 2; xi, yi ≥ 0; xi + yi = 10). If ti =...
800
In the first line print string "LIVE" (without the quotes) if server a is "alive", otherwise print "DEAD" (without the quotes). In the second line print the state of server b in the similar format.
standard output
PASSED
d15ef88220996939d7477c94c36077ee
train_003.jsonl
1353339000
Polycarpus is a system administrator. There are two servers under his strict guidance — a and b. To stay informed about the servers' performance, Polycarpus executes commands "ping a" and "ping b". Each ping command sends exactly ten packets to the server specified in the argument of the command. Executing a program re...
256 megabytes
import java.util.*; import java.io.*; public class Solution { public static PrintWriter w = new PrintWriter(System.out); public static void main(String args[] ) throws Exception { Reader in = new Reader(); int n = in.nextInt(); int sa = 0, fa = 0; int sb = 0, fb = 0; while(n-- > 0) { if(in.nextInt() == ...
Java
["2\n1 5 5\n2 6 4", "3\n1 0 10\n2 0 10\n1 10 0"]
2 seconds
["LIVE\nLIVE", "LIVE\nDEAD"]
NoteConsider the first test case. There 10 packets were sent to server a, 5 of them reached it. Therefore, at least half of all packets sent to this server successfully reached it through the network. Overall there were 10 packets sent to server b, 6 of them reached it. Therefore, at least half of all packets sent to t...
Java 8
standard input
[ "implementation" ]
1d8870a705036b9820227309d74dd1e8
The first line contains a single integer n (2 ≤ n ≤ 1000) — the number of commands Polycarpus has fulfilled. Each of the following n lines contains three integers — the description of the commands. The i-th of these lines contains three space-separated integers ti, xi, yi (1 ≤ ti ≤ 2; xi, yi ≥ 0; xi + yi = 10). If ti =...
800
In the first line print string "LIVE" (without the quotes) if server a is "alive", otherwise print "DEAD" (without the quotes). In the second line print the state of server b in the similar format.
standard output
PASSED
0e64720e0c80469cf57eed706eab7819
train_003.jsonl
1353339000
Polycarpus is a system administrator. There are two servers under his strict guidance — a and b. To stay informed about the servers' performance, Polycarpus executes commands "ping a" and "ping b". Each ping command sends exactly ten packets to the server specified in the argument of the command. Executing a program re...
256 megabytes
import java.util.Scanner; public class SystemAdministrator { public static void main(String[] args) { Scanner in = new Scanner(System.in); int n = in.nextInt(), i, ax = 0, ay = 0, bx = 0, by = 0; for (i = 0; i < n; i++) { int t = in.nextInt(), x = in.nextInt(), y = in.nextInt(); if (t == 1) { ax...
Java
["2\n1 5 5\n2 6 4", "3\n1 0 10\n2 0 10\n1 10 0"]
2 seconds
["LIVE\nLIVE", "LIVE\nDEAD"]
NoteConsider the first test case. There 10 packets were sent to server a, 5 of them reached it. Therefore, at least half of all packets sent to this server successfully reached it through the network. Overall there were 10 packets sent to server b, 6 of them reached it. Therefore, at least half of all packets sent to t...
Java 8
standard input
[ "implementation" ]
1d8870a705036b9820227309d74dd1e8
The first line contains a single integer n (2 ≤ n ≤ 1000) — the number of commands Polycarpus has fulfilled. Each of the following n lines contains three integers — the description of the commands. The i-th of these lines contains three space-separated integers ti, xi, yi (1 ≤ ti ≤ 2; xi, yi ≥ 0; xi + yi = 10). If ti =...
800
In the first line print string "LIVE" (without the quotes) if server a is "alive", otherwise print "DEAD" (without the quotes). In the second line print the state of server b in the similar format.
standard output
PASSED
0aecd4a7b43476232f3890bdf1493535
train_003.jsonl
1353339000
Polycarpus is a system administrator. There are two servers under his strict guidance — a and b. To stay informed about the servers' performance, Polycarpus executes commands "ping a" and "ping b". Each ping command sends exactly ten packets to the server specified in the argument of the command. Executing a program re...
256 megabytes
import java.util.*; public class Main { public static void main(String[] args) { Scanner in = new Scanner(System.in); int t1cnt = 0; int t2cnt = 0; int t1s = 0; int t2s = 0; int n = in.nextInt(); for (int i = 0; i < n; i++) { int a = in.nextInt(); int b = in.nextInt(); int c = in.nextInt();...
Java
["2\n1 5 5\n2 6 4", "3\n1 0 10\n2 0 10\n1 10 0"]
2 seconds
["LIVE\nLIVE", "LIVE\nDEAD"]
NoteConsider the first test case. There 10 packets were sent to server a, 5 of them reached it. Therefore, at least half of all packets sent to this server successfully reached it through the network. Overall there were 10 packets sent to server b, 6 of them reached it. Therefore, at least half of all packets sent to t...
Java 8
standard input
[ "implementation" ]
1d8870a705036b9820227309d74dd1e8
The first line contains a single integer n (2 ≤ n ≤ 1000) — the number of commands Polycarpus has fulfilled. Each of the following n lines contains three integers — the description of the commands. The i-th of these lines contains three space-separated integers ti, xi, yi (1 ≤ ti ≤ 2; xi, yi ≥ 0; xi + yi = 10). If ti =...
800
In the first line print string "LIVE" (without the quotes) if server a is "alive", otherwise print "DEAD" (without the quotes). In the second line print the state of server b in the similar format.
standard output
PASSED
01518f6e1058bc527d91d7d630ac4704
train_003.jsonl
1353339000
Polycarpus is a system administrator. There are two servers under his strict guidance — a and b. To stay informed about the servers' performance, Polycarpus executes commands "ping a" and "ping b". Each ping command sends exactly ten packets to the server specified in the argument of the command. Executing a program re...
256 megabytes
import java.io.File; import java.io.FileNotFoundException; import java.util.Scanner; public class A245 { public static void main(String[] args) throws FileNotFoundException{ Scanner scan = new Scanner(System.in); int n = scan.nextInt(); int ar = 0; int al = 0; ...
Java
["2\n1 5 5\n2 6 4", "3\n1 0 10\n2 0 10\n1 10 0"]
2 seconds
["LIVE\nLIVE", "LIVE\nDEAD"]
NoteConsider the first test case. There 10 packets were sent to server a, 5 of them reached it. Therefore, at least half of all packets sent to this server successfully reached it through the network. Overall there were 10 packets sent to server b, 6 of them reached it. Therefore, at least half of all packets sent to t...
Java 8
standard input
[ "implementation" ]
1d8870a705036b9820227309d74dd1e8
The first line contains a single integer n (2 ≤ n ≤ 1000) — the number of commands Polycarpus has fulfilled. Each of the following n lines contains three integers — the description of the commands. The i-th of these lines contains three space-separated integers ti, xi, yi (1 ≤ ti ≤ 2; xi, yi ≥ 0; xi + yi = 10). If ti =...
800
In the first line print string "LIVE" (without the quotes) if server a is "alive", otherwise print "DEAD" (without the quotes). In the second line print the state of server b in the similar format.
standard output
PASSED
dce97a945caf213ea817f5a16b24b404
train_003.jsonl
1353339000
Polycarpus is a system administrator. There are two servers under his strict guidance — a and b. To stay informed about the servers' performance, Polycarpus executes commands "ping a" and "ping b". Each ping command sends exactly ten packets to the server specified in the argument of the command. Executing a program re...
256 megabytes
import java.util.Scanner; public class A18 { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int n = sc.nextInt(); int array[][] = new int[n][3]; for (int i = 0; i < n; i++) { for (int j = 0; j < 3; j++) { array[i][j] = sc.nextInt(); } } int one = 0; int tw...
Java
["2\n1 5 5\n2 6 4", "3\n1 0 10\n2 0 10\n1 10 0"]
2 seconds
["LIVE\nLIVE", "LIVE\nDEAD"]
NoteConsider the first test case. There 10 packets were sent to server a, 5 of them reached it. Therefore, at least half of all packets sent to this server successfully reached it through the network. Overall there were 10 packets sent to server b, 6 of them reached it. Therefore, at least half of all packets sent to t...
Java 8
standard input
[ "implementation" ]
1d8870a705036b9820227309d74dd1e8
The first line contains a single integer n (2 ≤ n ≤ 1000) — the number of commands Polycarpus has fulfilled. Each of the following n lines contains three integers — the description of the commands. The i-th of these lines contains three space-separated integers ti, xi, yi (1 ≤ ti ≤ 2; xi, yi ≥ 0; xi + yi = 10). If ti =...
800
In the first line print string "LIVE" (without the quotes) if server a is "alive", otherwise print "DEAD" (without the quotes). In the second line print the state of server b in the similar format.
standard output
PASSED
80fc8083dab035fd3783c7e787ce394d
train_003.jsonl
1353339000
Polycarpus is a system administrator. There are two servers under his strict guidance — a and b. To stay informed about the servers' performance, Polycarpus executes commands "ping a" and "ping b". Each ping command sends exactly ten packets to the server specified in the argument of the command. Executing a program re...
256 megabytes
import java.io.*; import java.util.StringTokenizer; public class Main { public static void main(String[] args) throws IOException { Scanner sc = new Scanner(System.in); PrintWriter out = new PrintWriter(System.out); int n = sc.nextInt(); int[] cntx = new int[2]; int[] cnty...
Java
["2\n1 5 5\n2 6 4", "3\n1 0 10\n2 0 10\n1 10 0"]
2 seconds
["LIVE\nLIVE", "LIVE\nDEAD"]
NoteConsider the first test case. There 10 packets were sent to server a, 5 of them reached it. Therefore, at least half of all packets sent to this server successfully reached it through the network. Overall there were 10 packets sent to server b, 6 of them reached it. Therefore, at least half of all packets sent to t...
Java 8
standard input
[ "implementation" ]
1d8870a705036b9820227309d74dd1e8
The first line contains a single integer n (2 ≤ n ≤ 1000) — the number of commands Polycarpus has fulfilled. Each of the following n lines contains three integers — the description of the commands. The i-th of these lines contains three space-separated integers ti, xi, yi (1 ≤ ti ≤ 2; xi, yi ≥ 0; xi + yi = 10). If ti =...
800
In the first line print string "LIVE" (without the quotes) if server a is "alive", otherwise print "DEAD" (without the quotes). In the second line print the state of server b in the similar format.
standard output
PASSED
a3645b1508be530bce5e808ea2d9ebc7
train_003.jsonl
1353339000
Polycarpus is a system administrator. There are two servers under his strict guidance — a and b. To stay informed about the servers' performance, Polycarpus executes commands "ping a" and "ping b". Each ping command sends exactly ten packets to the server specified in the argument of the command. Executing a program re...
256 megabytes
import java.io.IOException; import java.io.InputStream; import java.io.PrintWriter; import java.io.*; import java.util.*; import java.util.LinkedList; import java.math.*; import java.lang.*; import java.util.PriorityQueue; import static java.lang.Math.*; @SuppressWarnings("unchecked") public class Solution implements R...
Java
["2\n1 5 5\n2 6 4", "3\n1 0 10\n2 0 10\n1 10 0"]
2 seconds
["LIVE\nLIVE", "LIVE\nDEAD"]
NoteConsider the first test case. There 10 packets were sent to server a, 5 of them reached it. Therefore, at least half of all packets sent to this server successfully reached it through the network. Overall there were 10 packets sent to server b, 6 of them reached it. Therefore, at least half of all packets sent to t...
Java 8
standard input
[ "implementation" ]
1d8870a705036b9820227309d74dd1e8
The first line contains a single integer n (2 ≤ n ≤ 1000) — the number of commands Polycarpus has fulfilled. Each of the following n lines contains three integers — the description of the commands. The i-th of these lines contains three space-separated integers ti, xi, yi (1 ≤ ti ≤ 2; xi, yi ≥ 0; xi + yi = 10). If ti =...
800
In the first line print string "LIVE" (without the quotes) if server a is "alive", otherwise print "DEAD" (without the quotes). In the second line print the state of server b in the similar format.
standard output
PASSED
b4b773c8585927440536ea0605be1b2e
train_003.jsonl
1353339000
Polycarpus is a system administrator. There are two servers under his strict guidance — a and b. To stay informed about the servers' performance, Polycarpus executes commands "ping a" and "ping b". Each ping command sends exactly ten packets to the server specified in the argument of the command. Executing a program re...
256 megabytes
public class SystemAdministrator{ public static void main(String []args){ java.util.Scanner scan=new java.util.Scanner(System.in); int n=scan.nextInt(); int [][]arr=new int[n][3]; for(int i=1;i<=arr.length;i++){ for(int j=1;j<=3;j++){ arr[i-1][j-1]=scan.nextInt(); } } int totalA=0,totalB=0,sen...
Java
["2\n1 5 5\n2 6 4", "3\n1 0 10\n2 0 10\n1 10 0"]
2 seconds
["LIVE\nLIVE", "LIVE\nDEAD"]
NoteConsider the first test case. There 10 packets were sent to server a, 5 of them reached it. Therefore, at least half of all packets sent to this server successfully reached it through the network. Overall there were 10 packets sent to server b, 6 of them reached it. Therefore, at least half of all packets sent to t...
Java 8
standard input
[ "implementation" ]
1d8870a705036b9820227309d74dd1e8
The first line contains a single integer n (2 ≤ n ≤ 1000) — the number of commands Polycarpus has fulfilled. Each of the following n lines contains three integers — the description of the commands. The i-th of these lines contains three space-separated integers ti, xi, yi (1 ≤ ti ≤ 2; xi, yi ≥ 0; xi + yi = 10). If ti =...
800
In the first line print string "LIVE" (without the quotes) if server a is "alive", otherwise print "DEAD" (without the quotes). In the second line print the state of server b in the similar format.
standard output
PASSED
7cd988a7099f0eedeaf6f8c90b2e3257
train_003.jsonl
1353339000
Polycarpus is a system administrator. There are two servers under his strict guidance — a and b. To stay informed about the servers' performance, Polycarpus executes commands "ping a" and "ping b". Each ping command sends exactly ten packets to the server specified in the argument of the command. Executing a program re...
256 megabytes
import java.util.*; public class solution{ public static void main(String args[]){ Scanner sc = new Scanner(System.in); int n = sc.nextInt(); int xa = 0, ya = 0, xb = 0, yb = 0; while(n-- != 0){ int t = sc.nextInt(); int x = sc.nextInt(); int y ...
Java
["2\n1 5 5\n2 6 4", "3\n1 0 10\n2 0 10\n1 10 0"]
2 seconds
["LIVE\nLIVE", "LIVE\nDEAD"]
NoteConsider the first test case. There 10 packets were sent to server a, 5 of them reached it. Therefore, at least half of all packets sent to this server successfully reached it through the network. Overall there were 10 packets sent to server b, 6 of them reached it. Therefore, at least half of all packets sent to t...
Java 8
standard input
[ "implementation" ]
1d8870a705036b9820227309d74dd1e8
The first line contains a single integer n (2 ≤ n ≤ 1000) — the number of commands Polycarpus has fulfilled. Each of the following n lines contains three integers — the description of the commands. The i-th of these lines contains three space-separated integers ti, xi, yi (1 ≤ ti ≤ 2; xi, yi ≥ 0; xi + yi = 10). If ti =...
800
In the first line print string "LIVE" (without the quotes) if server a is "alive", otherwise print "DEAD" (without the quotes). In the second line print the state of server b in the similar format.
standard output
PASSED
d42ced329b63492f30f20bafcf1c5e67
train_003.jsonl
1353339000
Polycarpus is a system administrator. There are two servers under his strict guidance — a and b. To stay informed about the servers' performance, Polycarpus executes commands "ping a" and "ping b". Each ping command sends exactly ten packets to the server specified in the argument of the command. Executing a program re...
256 megabytes
import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner input = new Scanner (System.in); int [] [] data = new int [input.nextInt()] [3]; String a = null,b = null; int x = 0,y = 0; int s = 0,t = 0; for (int i = 0...
Java
["2\n1 5 5\n2 6 4", "3\n1 0 10\n2 0 10\n1 10 0"]
2 seconds
["LIVE\nLIVE", "LIVE\nDEAD"]
NoteConsider the first test case. There 10 packets were sent to server a, 5 of them reached it. Therefore, at least half of all packets sent to this server successfully reached it through the network. Overall there were 10 packets sent to server b, 6 of them reached it. Therefore, at least half of all packets sent to t...
Java 8
standard input
[ "implementation" ]
1d8870a705036b9820227309d74dd1e8
The first line contains a single integer n (2 ≤ n ≤ 1000) — the number of commands Polycarpus has fulfilled. Each of the following n lines contains three integers — the description of the commands. The i-th of these lines contains three space-separated integers ti, xi, yi (1 ≤ ti ≤ 2; xi, yi ≥ 0; xi + yi = 10). If ti =...
800
In the first line print string "LIVE" (without the quotes) if server a is "alive", otherwise print "DEAD" (without the quotes). In the second line print the state of server b in the similar format.
standard output
PASSED
032d03a70431e4f284cea880c60a1cbc
train_003.jsonl
1353339000
Polycarpus is a system administrator. There are two servers under his strict guidance — a and b. To stay informed about the servers' performance, Polycarpus executes commands "ping a" and "ping b". Each ping command sends exactly ten packets to the server specified in the argument of the command. Executing a program re...
256 megabytes
import java.util.*; public class check { public static void main(String[] args) { Scanner sc=new Scanner(System.in); int n=sc.nextInt(); int a[]=new int[2]; int b[]=new int[2]; int x=0; int y=0; while(n-->0) { int t=sc.nextIn...
Java
["2\n1 5 5\n2 6 4", "3\n1 0 10\n2 0 10\n1 10 0"]
2 seconds
["LIVE\nLIVE", "LIVE\nDEAD"]
NoteConsider the first test case. There 10 packets were sent to server a, 5 of them reached it. Therefore, at least half of all packets sent to this server successfully reached it through the network. Overall there were 10 packets sent to server b, 6 of them reached it. Therefore, at least half of all packets sent to t...
Java 8
standard input
[ "implementation" ]
1d8870a705036b9820227309d74dd1e8
The first line contains a single integer n (2 ≤ n ≤ 1000) — the number of commands Polycarpus has fulfilled. Each of the following n lines contains three integers — the description of the commands. The i-th of these lines contains three space-separated integers ti, xi, yi (1 ≤ ti ≤ 2; xi, yi ≥ 0; xi + yi = 10). If ti =...
800
In the first line print string "LIVE" (without the quotes) if server a is "alive", otherwise print "DEAD" (without the quotes). In the second line print the state of server b in the similar format.
standard output
PASSED
9875123895541a18b5cfea6631019a8f
train_003.jsonl
1353339000
Polycarpus is a system administrator. There are two servers under his strict guidance — a and b. To stay informed about the servers' performance, Polycarpus executes commands "ping a" and "ping b". Each ping command sends exactly ten packets to the server specified in the argument of the command. Executing a program re...
256 megabytes
import java.util.HashSet; import java.util.Scanner; import java.util.Set; /** * * @author ACM */ public class SystemAdministrator { /** * @param args the command line arguments */ public static void main(String[] args) { Scanner in = new Scanner(System.in); int n = in.nextInt();in...
Java
["2\n1 5 5\n2 6 4", "3\n1 0 10\n2 0 10\n1 10 0"]
2 seconds
["LIVE\nLIVE", "LIVE\nDEAD"]
NoteConsider the first test case. There 10 packets were sent to server a, 5 of them reached it. Therefore, at least half of all packets sent to this server successfully reached it through the network. Overall there were 10 packets sent to server b, 6 of them reached it. Therefore, at least half of all packets sent to t...
Java 8
standard input
[ "implementation" ]
1d8870a705036b9820227309d74dd1e8
The first line contains a single integer n (2 ≤ n ≤ 1000) — the number of commands Polycarpus has fulfilled. Each of the following n lines contains three integers — the description of the commands. The i-th of these lines contains three space-separated integers ti, xi, yi (1 ≤ ti ≤ 2; xi, yi ≥ 0; xi + yi = 10). If ti =...
800
In the first line print string "LIVE" (without the quotes) if server a is "alive", otherwise print "DEAD" (without the quotes). In the second line print the state of server b in the similar format.
standard output
PASSED
369d13b833aa68ebb4471fb9b18f24d0
train_003.jsonl
1353339000
Polycarpus is a system administrator. There are two servers under his strict guidance — a and b. To stay informed about the servers' performance, Polycarpus executes commands "ping a" and "ping b". Each ping command sends exactly ten packets to the server specified in the argument of the command. Executing a program re...
256 megabytes
import java.util.Scanner; public class Solution { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int n = sc.nextInt(); int xa = 0; int ya = 0; int xb = 0; int yb = 0; for (int i = 1; i <= n; i++) { int ti = sc.nextInt(); int xi = sc.nextInt(); int yi = sc.nex...
Java
["2\n1 5 5\n2 6 4", "3\n1 0 10\n2 0 10\n1 10 0"]
2 seconds
["LIVE\nLIVE", "LIVE\nDEAD"]
NoteConsider the first test case. There 10 packets were sent to server a, 5 of them reached it. Therefore, at least half of all packets sent to this server successfully reached it through the network. Overall there were 10 packets sent to server b, 6 of them reached it. Therefore, at least half of all packets sent to t...
Java 8
standard input
[ "implementation" ]
1d8870a705036b9820227309d74dd1e8
The first line contains a single integer n (2 ≤ n ≤ 1000) — the number of commands Polycarpus has fulfilled. Each of the following n lines contains three integers — the description of the commands. The i-th of these lines contains three space-separated integers ti, xi, yi (1 ≤ ti ≤ 2; xi, yi ≥ 0; xi + yi = 10). If ti =...
800
In the first line print string "LIVE" (without the quotes) if server a is "alive", otherwise print "DEAD" (without the quotes). In the second line print the state of server b in the similar format.
standard output
PASSED
b685245232bdbc0831367f859cd8857a
train_003.jsonl
1353339000
Polycarpus is a system administrator. There are two servers under his strict guidance — a and b. To stay informed about the servers' performance, Polycarpus executes commands "ping a" and "ping b". Each ping command sends exactly ten packets to the server specified in the argument of the command. Executing a program re...
256 megabytes
import java.util.*; public class mohammad { public static void main(String[] args) { /* .................................. _oo0oo_ o8888888o 88" . "88 (| ^_^ |) 0\ = /0 ___/`--...
Java
["2\n1 5 5\n2 6 4", "3\n1 0 10\n2 0 10\n1 10 0"]
2 seconds
["LIVE\nLIVE", "LIVE\nDEAD"]
NoteConsider the first test case. There 10 packets were sent to server a, 5 of them reached it. Therefore, at least half of all packets sent to this server successfully reached it through the network. Overall there were 10 packets sent to server b, 6 of them reached it. Therefore, at least half of all packets sent to t...
Java 8
standard input
[ "implementation" ]
1d8870a705036b9820227309d74dd1e8
The first line contains a single integer n (2 ≤ n ≤ 1000) — the number of commands Polycarpus has fulfilled. Each of the following n lines contains three integers — the description of the commands. The i-th of these lines contains three space-separated integers ti, xi, yi (1 ≤ ti ≤ 2; xi, yi ≥ 0; xi + yi = 10). If ti =...
800
In the first line print string "LIVE" (without the quotes) if server a is "alive", otherwise print "DEAD" (without the quotes). In the second line print the state of server b in the similar format.
standard output
PASSED
094aa0b94e0b1497b51c0368df552828
train_003.jsonl
1353339000
Polycarpus is a system administrator. There are two servers under his strict guidance — a and b. To stay informed about the servers' performance, Polycarpus executes commands "ping a" and "ping b". Each ping command sends exactly ten packets to the server specified in the argument of the command. Executing a program re...
256 megabytes
import java.util.Scanner; public class System_Administrator { public static void main(String[] args) { Scanner t = new Scanner(System.in); int n = t.nextInt(); int a = 0, b = 0, pa = 0, pb = 0; while (n-- > 0) { int p = t.nextInt(); int x = t.nextInt(); int y = t.nextInt(); if (p == 1) { p...
Java
["2\n1 5 5\n2 6 4", "3\n1 0 10\n2 0 10\n1 10 0"]
2 seconds
["LIVE\nLIVE", "LIVE\nDEAD"]
NoteConsider the first test case. There 10 packets were sent to server a, 5 of them reached it. Therefore, at least half of all packets sent to this server successfully reached it through the network. Overall there were 10 packets sent to server b, 6 of them reached it. Therefore, at least half of all packets sent to t...
Java 8
standard input
[ "implementation" ]
1d8870a705036b9820227309d74dd1e8
The first line contains a single integer n (2 ≤ n ≤ 1000) — the number of commands Polycarpus has fulfilled. Each of the following n lines contains three integers — the description of the commands. The i-th of these lines contains three space-separated integers ti, xi, yi (1 ≤ ti ≤ 2; xi, yi ≥ 0; xi + yi = 10). If ti =...
800
In the first line print string "LIVE" (without the quotes) if server a is "alive", otherwise print "DEAD" (without the quotes). In the second line print the state of server b in the similar format.
standard output
PASSED
d74c374b1c44ec57e19dcb56eb73890e
train_003.jsonl
1353339000
Polycarpus is a system administrator. There are two servers under his strict guidance — a and b. To stay informed about the servers' performance, Polycarpus executes commands "ping a" and "ping b". Each ping command sends exactly ten packets to the server specified in the argument of the command. Executing a program re...
256 megabytes
import java.util.*; public class Solution{ static Scanner scan = new Scanner(System.in); public static void main(String args[]){ int n = scan.nextInt(); int a1 = 0, b1 = 0, a2 = 0, b2 = 0; for(int i = 0; i < n; i++){ int t = scan.nextInt(); int x = scan...
Java
["2\n1 5 5\n2 6 4", "3\n1 0 10\n2 0 10\n1 10 0"]
2 seconds
["LIVE\nLIVE", "LIVE\nDEAD"]
NoteConsider the first test case. There 10 packets were sent to server a, 5 of them reached it. Therefore, at least half of all packets sent to this server successfully reached it through the network. Overall there were 10 packets sent to server b, 6 of them reached it. Therefore, at least half of all packets sent to t...
Java 8
standard input
[ "implementation" ]
1d8870a705036b9820227309d74dd1e8
The first line contains a single integer n (2 ≤ n ≤ 1000) — the number of commands Polycarpus has fulfilled. Each of the following n lines contains three integers — the description of the commands. The i-th of these lines contains three space-separated integers ti, xi, yi (1 ≤ ti ≤ 2; xi, yi ≥ 0; xi + yi = 10). If ti =...
800
In the first line print string "LIVE" (without the quotes) if server a is "alive", otherwise print "DEAD" (without the quotes). In the second line print the state of server b in the similar format.
standard output
PASSED
fc814ec2a914cae13b82df55757d5ffa
train_003.jsonl
1353339000
Polycarpus is a system administrator. There are two servers under his strict guidance — a and b. To stay informed about the servers' performance, Polycarpus executes commands "ping a" and "ping b". Each ping command sends exactly ten packets to the server specified in the argument of the command. Executing a program re...
256 megabytes
import java.util.*; public class A { public static void main(String[] args) { int n; Scanner s = new Scanner(System.in); n = s.nextInt(); int a[] = new int[3*n]; int suma = 0,sumb = 0; int ca = 0,cb = 0; for(int i = 0; i < n ; i++) { ...
Java
["2\n1 5 5\n2 6 4", "3\n1 0 10\n2 0 10\n1 10 0"]
2 seconds
["LIVE\nLIVE", "LIVE\nDEAD"]
NoteConsider the first test case. There 10 packets were sent to server a, 5 of them reached it. Therefore, at least half of all packets sent to this server successfully reached it through the network. Overall there were 10 packets sent to server b, 6 of them reached it. Therefore, at least half of all packets sent to t...
Java 8
standard input
[ "implementation" ]
1d8870a705036b9820227309d74dd1e8
The first line contains a single integer n (2 ≤ n ≤ 1000) — the number of commands Polycarpus has fulfilled. Each of the following n lines contains three integers — the description of the commands. The i-th of these lines contains three space-separated integers ti, xi, yi (1 ≤ ti ≤ 2; xi, yi ≥ 0; xi + yi = 10). If ti =...
800
In the first line print string "LIVE" (without the quotes) if server a is "alive", otherwise print "DEAD" (without the quotes). In the second line print the state of server b in the similar format.
standard output
PASSED
fdb1b4a78154be070757435d8c52785b
train_003.jsonl
1353339000
Polycarpus is a system administrator. There are two servers under his strict guidance — a and b. To stay informed about the servers' performance, Polycarpus executes commands "ping a" and "ping b". Each ping command sends exactly ten packets to the server specified in the argument of the command. Executing a program re...
256 megabytes
import java.util.Scanner; public class codePing { public static void main(String[] args) { Scanner jin = new Scanner(System.in); int t = jin.nextInt(); int paket1X = 0; int paket1Y = 0; int paket2X = 0; int paket2Y = 0; boolean t1 = false; boolea...
Java
["2\n1 5 5\n2 6 4", "3\n1 0 10\n2 0 10\n1 10 0"]
2 seconds
["LIVE\nLIVE", "LIVE\nDEAD"]
NoteConsider the first test case. There 10 packets were sent to server a, 5 of them reached it. Therefore, at least half of all packets sent to this server successfully reached it through the network. Overall there were 10 packets sent to server b, 6 of them reached it. Therefore, at least half of all packets sent to t...
Java 8
standard input
[ "implementation" ]
1d8870a705036b9820227309d74dd1e8
The first line contains a single integer n (2 ≤ n ≤ 1000) — the number of commands Polycarpus has fulfilled. Each of the following n lines contains three integers — the description of the commands. The i-th of these lines contains three space-separated integers ti, xi, yi (1 ≤ ti ≤ 2; xi, yi ≥ 0; xi + yi = 10). If ti =...
800
In the first line print string "LIVE" (without the quotes) if server a is "alive", otherwise print "DEAD" (without the quotes). In the second line print the state of server b in the similar format.
standard output
PASSED
4533be0fdf245a002562623f9606c9f7
train_003.jsonl
1353339000
Polycarpus is a system administrator. There are two servers under his strict guidance — a and b. To stay informed about the servers' performance, Polycarpus executes commands "ping a" and "ping b". Each ping command sends exactly ten packets to the server specified in the argument of the command. Executing a program re...
256 megabytes
/* package whatever; // don't place package name! */ import java.util.*; import java.lang.*; import java.io.*; import java.io.BufferedReader; import java.io.File; import java.io.FileReader; import java.io.IOException; /* Name of the class has to be "Main" only if the class is public. */ public class bbg { public s...
Java
["2\n1 5 5\n2 6 4", "3\n1 0 10\n2 0 10\n1 10 0"]
2 seconds
["LIVE\nLIVE", "LIVE\nDEAD"]
NoteConsider the first test case. There 10 packets were sent to server a, 5 of them reached it. Therefore, at least half of all packets sent to this server successfully reached it through the network. Overall there were 10 packets sent to server b, 6 of them reached it. Therefore, at least half of all packets sent to t...
Java 8
standard input
[ "implementation" ]
1d8870a705036b9820227309d74dd1e8
The first line contains a single integer n (2 ≤ n ≤ 1000) — the number of commands Polycarpus has fulfilled. Each of the following n lines contains three integers — the description of the commands. The i-th of these lines contains three space-separated integers ti, xi, yi (1 ≤ ti ≤ 2; xi, yi ≥ 0; xi + yi = 10). If ti =...
800
In the first line print string "LIVE" (without the quotes) if server a is "alive", otherwise print "DEAD" (without the quotes). In the second line print the state of server b in the similar format.
standard output
PASSED
5a147b2dc609c9d8b9e1b9176314df13
train_003.jsonl
1395502200
Little Chris is participating in a graph cutting contest. He's a pro. The time has come to test his skills to the fullest.Chris is given a simple undirected connected graph with n vertices (numbered from 1 to n) and m edges. The problem is to cut it into edge-distinct paths of length 2. Formally, Chris has to partition...
256 megabytes
import java.io.*; import java.util.*; public class Main { int n,m; ArrayList<Edge> list[],in[]; boolean visited[]; private void solve()throws Exception { n=nextInt(); m=nextInt(); list=new ArrayList[n+1]; for(int i=1;i<=n;i++) list[i]=new ArrayList<>(); for(int i=1;i<=m;i++) { int u=nextInt(); ...
Java
["8 12\n1 2\n2 3\n3 4\n4 1\n1 3\n2 4\n3 5\n3 6\n5 6\n6 7\n6 8\n7 8", "3 3\n1 2\n2 3\n3 1", "3 2\n1 2\n2 3"]
2 seconds
["1 2 4\n1 3 2\n1 4 3\n5 3 6\n5 6 8\n6 7 8", "No solution", "1 2 3"]
null
Java 11
standard input
[ "constructive algorithms", "dfs and similar", "graphs" ]
ac56745749fc10be925a456925b79ab6
The first line of input contains two space-separated integers n and m (1 ≤ n, m ≤ 105), the number of vertices and the number of edges in the graph. The next m lines contain the description of the graph's edges. The i-th line contains two space-separated integers ai and bi (1 ≤ ai, bi ≤ n; ai ≠ bi), the numbers of the ...
2,300
If it is possible to cut the given graph into edge-distinct paths of length 2, output lines. In the i-th line print three space-separated integers xi, yi and zi, the description of the i-th path. The graph should contain this path, i.e., the graph should contain edges (xi, yi) and (yi, zi). Each edge should appear in ...
standard output
PASSED
d870e9a4250b21fcaafb23fea0b4e0f4
train_003.jsonl
1394465400
Now it's time of Olympiads. Vanya and Egor decided to make his own team to take part in a programming Olympiad. They've been best friends ever since primary school and hopefully, that can somehow help them in teamwork.For each team Olympiad, Vanya takes his play cards with numbers. He takes only the cards containing nu...
256 megabytes
import java.util.Scanner; public class Command { /** * @param args */ public static void main(String[] args) { // TODO Auto-generated method stub Scanner scaner = new Scanner(System.in); int n = scaner.nextInt(); int m = scaner.nextInt(); int mMax = n * 2 + 2; int mMin = n - 1; if (m > mMax || m ...
Java
["1 2", "4 8", "4 10", "1 5"]
1 second
["101", "110110110101", "11011011011011", "-1"]
null
Java 6
standard input
[ "constructive algorithms", "implementation", "greedy" ]
854c561539596722b1dbc8f99cbdca78
The first line contains two integers: n (1 ≤ n ≤ 106) — the number of cards containing number 0; m (1 ≤ m ≤ 106) — the number of cards containing number 1.
1,400
In a single line print the required sequence of zeroes and ones without any spaces. If such sequence is impossible to obtain, print -1.
standard output
PASSED
1673622a5fe2e4ac252168fef5f8bce6
train_003.jsonl
1394465400
Now it's time of Olympiads. Vanya and Egor decided to make his own team to take part in a programming Olympiad. They've been best friends ever since primary school and hopefully, that can somehow help them in teamwork.For each team Olympiad, Vanya takes his play cards with numbers. He takes only the cards containing nu...
256 megabytes
import java.io.BufferedReader; import java.io.InputStreamReader; import java.util.StringTokenizer; public class C { void solve() throws Exception { int n = nextInt(); // zeros int m = nextInt(); // ones int size = n+m; if (m < n-1 || m > 2*(n+1)) { System.out.println(-1); return; } int[...
Java
["1 2", "4 8", "4 10", "1 5"]
1 second
["101", "110110110101", "11011011011011", "-1"]
null
Java 6
standard input
[ "constructive algorithms", "implementation", "greedy" ]
854c561539596722b1dbc8f99cbdca78
The first line contains two integers: n (1 ≤ n ≤ 106) — the number of cards containing number 0; m (1 ≤ m ≤ 106) — the number of cards containing number 1.
1,400
In a single line print the required sequence of zeroes and ones without any spaces. If such sequence is impossible to obtain, print -1.
standard output
PASSED
bee47922a6cf7107850fd6d29393a27a
train_003.jsonl
1394465400
Now it's time of Olympiads. Vanya and Egor decided to make his own team to take part in a programming Olympiad. They've been best friends ever since primary school and hopefully, that can somehow help them in teamwork.For each team Olympiad, Vanya takes his play cards with numbers. He takes only the cards containing nu...
256 megabytes
import java.util.*; import java.io.*; public class cartas2{ public static PrintWriter out = new PrintWriter(System.out);//HACER FLUSHHHH public static void main(String args[]) throws IOException{ BufferedReader lector = new BufferedReader(new InputStreamReader(System.in)); String tmp =lector.readLine(); int b = Integer...
Java
["1 2", "4 8", "4 10", "1 5"]
1 second
["101", "110110110101", "11011011011011", "-1"]
null
Java 6
standard input
[ "constructive algorithms", "implementation", "greedy" ]
854c561539596722b1dbc8f99cbdca78
The first line contains two integers: n (1 ≤ n ≤ 106) — the number of cards containing number 0; m (1 ≤ m ≤ 106) — the number of cards containing number 1.
1,400
In a single line print the required sequence of zeroes and ones without any spaces. If such sequence is impossible to obtain, print -1.
standard output
PASSED
fa29ff525fbde3ec247cf0d0a800205e
train_003.jsonl
1394465400
Now it's time of Olympiads. Vanya and Egor decided to make his own team to take part in a programming Olympiad. They've been best friends ever since primary school and hopefully, that can somehow help them in teamwork.For each team Olympiad, Vanya takes his play cards with numbers. He takes only the cards containing nu...
256 megabytes
import java.io.PrintWriter; import java.util.*; public class c { public static void main(String[] args) { Scanner input = new Scanner(System.in); PrintWriter out = new PrintWriter(System.out); int n = input.nextInt(), m = input.nextInt(); if(n > m+1 || m > 2*n+2) { out.println(-1); } ...
Java
["1 2", "4 8", "4 10", "1 5"]
1 second
["101", "110110110101", "11011011011011", "-1"]
null
Java 6
standard input
[ "constructive algorithms", "implementation", "greedy" ]
854c561539596722b1dbc8f99cbdca78
The first line contains two integers: n (1 ≤ n ≤ 106) — the number of cards containing number 0; m (1 ≤ m ≤ 106) — the number of cards containing number 1.
1,400
In a single line print the required sequence of zeroes and ones without any spaces. If such sequence is impossible to obtain, print -1.
standard output
PASSED
f84a02587a621fcffe80ac9b03b0b05b
train_003.jsonl
1394465400
Now it's time of Olympiads. Vanya and Egor decided to make his own team to take part in a programming Olympiad. They've been best friends ever since primary school and hopefully, that can somehow help them in teamwork.For each team Olympiad, Vanya takes his play cards with numbers. He takes only the cards containing nu...
256 megabytes
import java.io.BufferedInputStream; import java.io.BufferedOutputStream; import java.io.IOException; import java.io.PrintWriter; import java.util.*; /** * User: anatoly * Date: 25.06.13 * Time: 0:04 * Вот и подошел черед олимпиад. Ваня и Егор решили создать свою команду для участия в олимпиаде по программированию....
Java
["1 2", "4 8", "4 10", "1 5"]
1 second
["101", "110110110101", "11011011011011", "-1"]
null
Java 6
standard input
[ "constructive algorithms", "implementation", "greedy" ]
854c561539596722b1dbc8f99cbdca78
The first line contains two integers: n (1 ≤ n ≤ 106) — the number of cards containing number 0; m (1 ≤ m ≤ 106) — the number of cards containing number 1.
1,400
In a single line print the required sequence of zeroes and ones without any spaces. If such sequence is impossible to obtain, print -1.
standard output
PASSED
13f356473837cdf8ef0501d70480249f
train_003.jsonl
1394465400
Now it's time of Olympiads. Vanya and Egor decided to make his own team to take part in a programming Olympiad. They've been best friends ever since primary school and hopefully, that can somehow help them in teamwork.For each team Olympiad, Vanya takes his play cards with numbers. He takes only the cards containing nu...
256 megabytes
import java.util.*; import java.io.*; import java.lang.*; import java.math.*; import java.math.BigInteger; public class Main { final int INF = 1000000000; final int MAXN = 1111111; Scanner input = new Scanner(System.in); BufferedReader inp = new BufferedReader(new InputStreamReader(System.in)); PrintWriter out...
Java
["1 2", "4 8", "4 10", "1 5"]
1 second
["101", "110110110101", "11011011011011", "-1"]
null
Java 6
standard input
[ "constructive algorithms", "implementation", "greedy" ]
854c561539596722b1dbc8f99cbdca78
The first line contains two integers: n (1 ≤ n ≤ 106) — the number of cards containing number 0; m (1 ≤ m ≤ 106) — the number of cards containing number 1.
1,400
In a single line print the required sequence of zeroes and ones without any spaces. If such sequence is impossible to obtain, print -1.
standard output
PASSED
32cc4a401752b95b2cc635ad39368091
train_003.jsonl
1394465400
Now it's time of Olympiads. Vanya and Egor decided to make his own team to take part in a programming Olympiad. They've been best friends ever since primary school and hopefully, that can somehow help them in teamwork.For each team Olympiad, Vanya takes his play cards with numbers. He takes only the cards containing nu...
256 megabytes
import java.io.BufferedReader; import java.io.FileNotFoundException; import java.io.FileReader; import java.io.IOException; import java.io.InputStreamReader; import java.io.OutputStreamWriter; import java.io.PrintWriter; import java.util.StringTokenizer; public class Solver { public static void main(String[] Args) t...
Java
["1 2", "4 8", "4 10", "1 5"]
1 second
["101", "110110110101", "11011011011011", "-1"]
null
Java 6
standard input
[ "constructive algorithms", "implementation", "greedy" ]
854c561539596722b1dbc8f99cbdca78
The first line contains two integers: n (1 ≤ n ≤ 106) — the number of cards containing number 0; m (1 ≤ m ≤ 106) — the number of cards containing number 1.
1,400
In a single line print the required sequence of zeroes and ones without any spaces. If such sequence is impossible to obtain, print -1.
standard output
PASSED
52db8e433cc669e3e23c40ba8fa9400f
train_003.jsonl
1394465400
Now it's time of Olympiads. Vanya and Egor decided to make his own team to take part in a programming Olympiad. They've been best friends ever since primary school and hopefully, that can somehow help them in teamwork.For each team Olympiad, Vanya takes his play cards with numbers. He takes only the cards containing nu...
256 megabytes
import java.io.BufferedReader; import java.io.FileNotFoundException; import java.io.InputStreamReader; import java.io.PrintWriter; import java.util.StringTokenizer; /** * * * @author pttrung */ public class C { // public static long x, y, gcd; public static int Mod = 1000000007; public static Print...
Java
["1 2", "4 8", "4 10", "1 5"]
1 second
["101", "110110110101", "11011011011011", "-1"]
null
Java 6
standard input
[ "constructive algorithms", "implementation", "greedy" ]
854c561539596722b1dbc8f99cbdca78
The first line contains two integers: n (1 ≤ n ≤ 106) — the number of cards containing number 0; m (1 ≤ m ≤ 106) — the number of cards containing number 1.
1,400
In a single line print the required sequence of zeroes and ones without any spaces. If such sequence is impossible to obtain, print -1.
standard output
PASSED
cb3e5e030c0e2f1e71a812b47802fb7a
train_003.jsonl
1394465400
Now it's time of Olympiads. Vanya and Egor decided to make his own team to take part in a programming Olympiad. They've been best friends ever since primary school and hopefully, that can somehow help them in teamwork.For each team Olympiad, Vanya takes his play cards with numbers. He takes only the cards containing nu...
256 megabytes
import java.util.Scanner; public class C { public static void main(String[] args) { Scanner scan = new Scanner(System.in); int zeros = scan.nextInt(); int ones = scan.nextInt(); if (ones - 2 <= 2 * zeros && ones >= zeros - 1) { char[] sequence = new char[ones + zeros]; int i=0; if(ones == zeros - ...
Java
["1 2", "4 8", "4 10", "1 5"]
1 second
["101", "110110110101", "11011011011011", "-1"]
null
Java 6
standard input
[ "constructive algorithms", "implementation", "greedy" ]
854c561539596722b1dbc8f99cbdca78
The first line contains two integers: n (1 ≤ n ≤ 106) — the number of cards containing number 0; m (1 ≤ m ≤ 106) — the number of cards containing number 1.
1,400
In a single line print the required sequence of zeroes and ones without any spaces. If such sequence is impossible to obtain, print -1.
standard output
PASSED
e57086e59f77ec00f23c05f75ecfd5cf
train_003.jsonl
1394465400
Now it's time of Olympiads. Vanya and Egor decided to make his own team to take part in a programming Olympiad. They've been best friends ever since primary school and hopefully, that can somehow help them in teamwork.For each team Olympiad, Vanya takes his play cards with numbers. He takes only the cards containing nu...
256 megabytes
import java.util.Scanner; public class C { /** * @param args */ public static void main(String[] args) { Scanner in = new Scanner(System.in); int n = in.nextInt(); // zeros int m = in.nextInt(); // ones StringBuilder ss = new StringBuilder(); int a = (((int) M...
Java
["1 2", "4 8", "4 10", "1 5"]
1 second
["101", "110110110101", "11011011011011", "-1"]
null
Java 6
standard input
[ "constructive algorithms", "implementation", "greedy" ]
854c561539596722b1dbc8f99cbdca78
The first line contains two integers: n (1 ≤ n ≤ 106) — the number of cards containing number 0; m (1 ≤ m ≤ 106) — the number of cards containing number 1.
1,400
In a single line print the required sequence of zeroes and ones without any spaces. If such sequence is impossible to obtain, print -1.
standard output
PASSED
17d16b8836d7c3469ac333ad6803234f
train_003.jsonl
1394465400
Now it's time of Olympiads. Vanya and Egor decided to make his own team to take part in a programming Olympiad. They've been best friends ever since primary school and hopefully, that can somehow help them in teamwork.For each team Olympiad, Vanya takes his play cards with numbers. He takes only the cards containing nu...
256 megabytes
import java.util.*; public class Team401C { public static void main(String[] args) { // Set up scanner Scanner sc = new Scanner(System.in); // System.out.println("Enter n"); int n = sc.nextInt(); // System.out.println("Enter m"); int m = sc.nextInt(); ...
Java
["1 2", "4 8", "4 10", "1 5"]
1 second
["101", "110110110101", "11011011011011", "-1"]
null
Java 6
standard input
[ "constructive algorithms", "implementation", "greedy" ]
854c561539596722b1dbc8f99cbdca78
The first line contains two integers: n (1 ≤ n ≤ 106) — the number of cards containing number 0; m (1 ≤ m ≤ 106) — the number of cards containing number 1.
1,400
In a single line print the required sequence of zeroes and ones without any spaces. If such sequence is impossible to obtain, print -1.
standard output
PASSED
3fcc9333c337154d252de20d5a5c43d9
train_003.jsonl
1394465400
Now it's time of Olympiads. Vanya and Egor decided to make his own team to take part in a programming Olympiad. They've been best friends ever since primary school and hopefully, that can somehow help them in teamwork.For each team Olympiad, Vanya takes his play cards with numbers. He takes only the cards containing nu...
256 megabytes
import java.util.*; import java.io.*; public class TaskC { private FastScanner in; private PrintWriter out; public void solve() throws IOException { int n = in.nextInt(), m = in.nextInt(); if (n > m + 1 || m > 2 * (n + 1)) { out.print(-1); return; } ...
Java
["1 2", "4 8", "4 10", "1 5"]
1 second
["101", "110110110101", "11011011011011", "-1"]
null
Java 6
standard input
[ "constructive algorithms", "implementation", "greedy" ]
854c561539596722b1dbc8f99cbdca78
The first line contains two integers: n (1 ≤ n ≤ 106) — the number of cards containing number 0; m (1 ≤ m ≤ 106) — the number of cards containing number 1.
1,400
In a single line print the required sequence of zeroes and ones without any spaces. If such sequence is impossible to obtain, print -1.
standard output
PASSED
cadd8ad7d8d036856e0b05a0dc2c35b3
train_003.jsonl
1536165300
The Metropolis computer network consists of $$$n$$$ servers, each has an encryption key in the range from $$$0$$$ to $$$2^k - 1$$$ assigned to it. Let $$$c_i$$$ be the encryption key assigned to the $$$i$$$-th server. Additionally, $$$m$$$ pairs of servers are directly connected via a data communication channel. Becaus...
512 megabytes
import java.io.OutputStream; import java.io.IOException; import java.io.InputStream; import java.io.PrintWriter; import java.io.PrintStream; import java.io.BufferedReader; import java.util.Map; import java.util.Map.Entry; import java.util.HashMap; import java.util.ArrayList; import java.io.BufferedReader; import java....
Java
["4 4 2\n0 1 0 1\n1 2\n2 3\n3 4\n4 1", "4 5 3\n7 1 7 2\n1 2\n2 3\n3 4\n4 1\n2 4"]
3 seconds
["50", "96"]
NoteConsider the first example.Possible values for the number $$$x$$$ contained by the virus are $$$0$$$, $$$1$$$, $$$2$$$ and $$$3$$$.For values $$$0$$$, $$$2$$$ and $$$3$$$ the virus can infect any subset of the set of servers, which gives us $$$16$$$ pairs for each values. A virus containing the number $$$1$$$ can i...
Java 8
standard input
[ "combinatorics", "dfs and similar", "graphs" ]
9319661488d33bd0b43a5ff8b238f694
The first line of input contains three integers $$$n$$$, $$$m$$$ and $$$k$$$ ($$$1 \leq n \leq 500\,000$$$, $$$0 \leq m \leq \min(\frac{n(n - 1)}{2}, 500\,000)$$$, $$$0 \leq k \leq 60$$$) — the number of servers, the number of pairs of servers directly connected by a data communication channel, and the parameter $$$k$$...
2,200
The only output line should contain a single integer — the number of safe infections of some subset of servers by a virus with some parameter, modulo $$$10^9 + 7$$$.
standard output
PASSED
07e6fc332c9830be77d4bf888a0e2fc3
train_003.jsonl
1536165300
The Metropolis computer network consists of $$$n$$$ servers, each has an encryption key in the range from $$$0$$$ to $$$2^k - 1$$$ assigned to it. Let $$$c_i$$$ be the encryption key assigned to the $$$i$$$-th server. Additionally, $$$m$$$ pairs of servers are directly connected via a data communication channel. Becaus...
512 megabytes
import java.io.OutputStream; import java.io.IOException; import java.io.InputStream; import java.io.PrintWriter; import java.io.PrintStream; import java.io.BufferedReader; import java.util.Map; import java.util.Map.Entry; import java.util.HashMap; import java.util.ArrayList; import java.io.BufferedReader; import java....
Java
["4 4 2\n0 1 0 1\n1 2\n2 3\n3 4\n4 1", "4 5 3\n7 1 7 2\n1 2\n2 3\n3 4\n4 1\n2 4"]
3 seconds
["50", "96"]
NoteConsider the first example.Possible values for the number $$$x$$$ contained by the virus are $$$0$$$, $$$1$$$, $$$2$$$ and $$$3$$$.For values $$$0$$$, $$$2$$$ and $$$3$$$ the virus can infect any subset of the set of servers, which gives us $$$16$$$ pairs for each values. A virus containing the number $$$1$$$ can i...
Java 8
standard input
[ "combinatorics", "dfs and similar", "graphs" ]
9319661488d33bd0b43a5ff8b238f694
The first line of input contains three integers $$$n$$$, $$$m$$$ and $$$k$$$ ($$$1 \leq n \leq 500\,000$$$, $$$0 \leq m \leq \min(\frac{n(n - 1)}{2}, 500\,000)$$$, $$$0 \leq k \leq 60$$$) — the number of servers, the number of pairs of servers directly connected by a data communication channel, and the parameter $$$k$$...
2,200
The only output line should contain a single integer — the number of safe infections of some subset of servers by a virus with some parameter, modulo $$$10^9 + 7$$$.
standard output
PASSED
29d767efb26678626a4659adac4e9ce8
train_003.jsonl
1536165300
The Metropolis computer network consists of $$$n$$$ servers, each has an encryption key in the range from $$$0$$$ to $$$2^k - 1$$$ assigned to it. Let $$$c_i$$$ be the encryption key assigned to the $$$i$$$-th server. Additionally, $$$m$$$ pairs of servers are directly connected via a data communication channel. Becaus...
512 megabytes
import java.io.*; import java.math.*; import java.util.*; import static java.util.Arrays.fill; import static java.lang.Math.*; import static java.util.Arrays.sort; import static java.util.Collections.sort; public class E { static int mod = 1000000007; static InputReader in = new InputReader(System.in); static Prin...
Java
["4 4 2\n0 1 0 1\n1 2\n2 3\n3 4\n4 1", "4 5 3\n7 1 7 2\n1 2\n2 3\n3 4\n4 1\n2 4"]
3 seconds
["50", "96"]
NoteConsider the first example.Possible values for the number $$$x$$$ contained by the virus are $$$0$$$, $$$1$$$, $$$2$$$ and $$$3$$$.For values $$$0$$$, $$$2$$$ and $$$3$$$ the virus can infect any subset of the set of servers, which gives us $$$16$$$ pairs for each values. A virus containing the number $$$1$$$ can i...
Java 8
standard input
[ "combinatorics", "dfs and similar", "graphs" ]
9319661488d33bd0b43a5ff8b238f694
The first line of input contains three integers $$$n$$$, $$$m$$$ and $$$k$$$ ($$$1 \leq n \leq 500\,000$$$, $$$0 \leq m \leq \min(\frac{n(n - 1)}{2}, 500\,000)$$$, $$$0 \leq k \leq 60$$$) — the number of servers, the number of pairs of servers directly connected by a data communication channel, and the parameter $$$k$$...
2,200
The only output line should contain a single integer — the number of safe infections of some subset of servers by a virus with some parameter, modulo $$$10^9 + 7$$$.
standard output
PASSED
67c64174c9c9152a69aa8e0db481e8c5
train_003.jsonl
1536165300
The Metropolis computer network consists of $$$n$$$ servers, each has an encryption key in the range from $$$0$$$ to $$$2^k - 1$$$ assigned to it. Let $$$c_i$$$ be the encryption key assigned to the $$$i$$$-th server. Additionally, $$$m$$$ pairs of servers are directly connected via a data communication channel. Becaus...
512 megabytes
import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; import java.io.PrintWriter; import java.util.*; /** * Runtime O(E * log(V)) * * @author Don Li */ public class NetworkSafety { int N = (int) 5e5 + 10; int MOD = (int) 1e9 + 7; int sz = 0; int[] pa...
Java
["4 4 2\n0 1 0 1\n1 2\n2 3\n3 4\n4 1", "4 5 3\n7 1 7 2\n1 2\n2 3\n3 4\n4 1\n2 4"]
3 seconds
["50", "96"]
NoteConsider the first example.Possible values for the number $$$x$$$ contained by the virus are $$$0$$$, $$$1$$$, $$$2$$$ and $$$3$$$.For values $$$0$$$, $$$2$$$ and $$$3$$$ the virus can infect any subset of the set of servers, which gives us $$$16$$$ pairs for each values. A virus containing the number $$$1$$$ can i...
Java 8
standard input
[ "combinatorics", "dfs and similar", "graphs" ]
9319661488d33bd0b43a5ff8b238f694
The first line of input contains three integers $$$n$$$, $$$m$$$ and $$$k$$$ ($$$1 \leq n \leq 500\,000$$$, $$$0 \leq m \leq \min(\frac{n(n - 1)}{2}, 500\,000)$$$, $$$0 \leq k \leq 60$$$) — the number of servers, the number of pairs of servers directly connected by a data communication channel, and the parameter $$$k$$...
2,200
The only output line should contain a single integer — the number of safe infections of some subset of servers by a virus with some parameter, modulo $$$10^9 + 7$$$.
standard output
PASSED
760d75828dd2ef358d657601793d181b
train_003.jsonl
1536165300
The Metropolis computer network consists of $$$n$$$ servers, each has an encryption key in the range from $$$0$$$ to $$$2^k - 1$$$ assigned to it. Let $$$c_i$$$ be the encryption key assigned to the $$$i$$$-th server. Additionally, $$$m$$$ pairs of servers are directly connected via a data communication channel. Becaus...
512 megabytes
import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; import java.io.PrintWriter; import java.util.*; /** * @author Don Li */ public class NetworkSafety { int N = (int) 5e5 + 10; int MOD = (int) 1e9 + 7; int sz = 0; int[] parent = new int[N]; ...
Java
["4 4 2\n0 1 0 1\n1 2\n2 3\n3 4\n4 1", "4 5 3\n7 1 7 2\n1 2\n2 3\n3 4\n4 1\n2 4"]
3 seconds
["50", "96"]
NoteConsider the first example.Possible values for the number $$$x$$$ contained by the virus are $$$0$$$, $$$1$$$, $$$2$$$ and $$$3$$$.For values $$$0$$$, $$$2$$$ and $$$3$$$ the virus can infect any subset of the set of servers, which gives us $$$16$$$ pairs for each values. A virus containing the number $$$1$$$ can i...
Java 8
standard input
[ "combinatorics", "dfs and similar", "graphs" ]
9319661488d33bd0b43a5ff8b238f694
The first line of input contains three integers $$$n$$$, $$$m$$$ and $$$k$$$ ($$$1 \leq n \leq 500\,000$$$, $$$0 \leq m \leq \min(\frac{n(n - 1)}{2}, 500\,000)$$$, $$$0 \leq k \leq 60$$$) — the number of servers, the number of pairs of servers directly connected by a data communication channel, and the parameter $$$k$$...
2,200
The only output line should contain a single integer — the number of safe infections of some subset of servers by a virus with some parameter, modulo $$$10^9 + 7$$$.
standard output
PASSED
67f46bd0dcaa474374c9555754c89187
train_003.jsonl
1536165300
The Metropolis computer network consists of $$$n$$$ servers, each has an encryption key in the range from $$$0$$$ to $$$2^k - 1$$$ assigned to it. Let $$$c_i$$$ be the encryption key assigned to the $$$i$$$-th server. Additionally, $$$m$$$ pairs of servers are directly connected via a data communication channel. Becaus...
512 megabytes
import java.io.*; import java.util.*; import java.util.Map.Entry; public class e { static class DisjointSet { int[] s; public DisjointSet(int n) { Arrays.fill(s = new int[n], -1); } public int find(int i) { return s[i] < 0 ? i : (s[i] = find(s[i])); } public boolean union(int a, int b) { ...
Java
["4 4 2\n0 1 0 1\n1 2\n2 3\n3 4\n4 1", "4 5 3\n7 1 7 2\n1 2\n2 3\n3 4\n4 1\n2 4"]
3 seconds
["50", "96"]
NoteConsider the first example.Possible values for the number $$$x$$$ contained by the virus are $$$0$$$, $$$1$$$, $$$2$$$ and $$$3$$$.For values $$$0$$$, $$$2$$$ and $$$3$$$ the virus can infect any subset of the set of servers, which gives us $$$16$$$ pairs for each values. A virus containing the number $$$1$$$ can i...
Java 8
standard input
[ "combinatorics", "dfs and similar", "graphs" ]
9319661488d33bd0b43a5ff8b238f694
The first line of input contains three integers $$$n$$$, $$$m$$$ and $$$k$$$ ($$$1 \leq n \leq 500\,000$$$, $$$0 \leq m \leq \min(\frac{n(n - 1)}{2}, 500\,000)$$$, $$$0 \leq k \leq 60$$$) — the number of servers, the number of pairs of servers directly connected by a data communication channel, and the parameter $$$k$$...
2,200
The only output line should contain a single integer — the number of safe infections of some subset of servers by a virus with some parameter, modulo $$$10^9 + 7$$$.
standard output
PASSED
7e3ea4ee033aea0fc2bd955bad4e4a94
train_003.jsonl
1536165300
The Metropolis computer network consists of $$$n$$$ servers, each has an encryption key in the range from $$$0$$$ to $$$2^k - 1$$$ assigned to it. Let $$$c_i$$$ be the encryption key assigned to the $$$i$$$-th server. Additionally, $$$m$$$ pairs of servers are directly connected via a data communication channel. Becaus...
512 megabytes
import java.io.OutputStream; import java.io.IOException; import java.io.InputStream; import java.io.PrintWriter; import java.util.Arrays; import java.util.StringTokenizer; import java.io.IOException; import java.io.BufferedReader; import java.util.Comparator; import java.io.InputStreamReader; import java.io.InputStream...
Java
["4 4 2\n0 1 0 1\n1 2\n2 3\n3 4\n4 1", "4 5 3\n7 1 7 2\n1 2\n2 3\n3 4\n4 1\n2 4"]
3 seconds
["50", "96"]
NoteConsider the first example.Possible values for the number $$$x$$$ contained by the virus are $$$0$$$, $$$1$$$, $$$2$$$ and $$$3$$$.For values $$$0$$$, $$$2$$$ and $$$3$$$ the virus can infect any subset of the set of servers, which gives us $$$16$$$ pairs for each values. A virus containing the number $$$1$$$ can i...
Java 8
standard input
[ "combinatorics", "dfs and similar", "graphs" ]
9319661488d33bd0b43a5ff8b238f694
The first line of input contains three integers $$$n$$$, $$$m$$$ and $$$k$$$ ($$$1 \leq n \leq 500\,000$$$, $$$0 \leq m \leq \min(\frac{n(n - 1)}{2}, 500\,000)$$$, $$$0 \leq k \leq 60$$$) — the number of servers, the number of pairs of servers directly connected by a data communication channel, and the parameter $$$k$$...
2,200
The only output line should contain a single integer — the number of safe infections of some subset of servers by a virus with some parameter, modulo $$$10^9 + 7$$$.
standard output
PASSED
a024f222025f3dd25c363899e4b63eb1
train_003.jsonl
1536165300
The Metropolis computer network consists of $$$n$$$ servers, each has an encryption key in the range from $$$0$$$ to $$$2^k - 1$$$ assigned to it. Let $$$c_i$$$ be the encryption key assigned to the $$$i$$$-th server. Additionally, $$$m$$$ pairs of servers are directly connected via a data communication channel. Becaus...
512 megabytes
import java.util.*; import java.io.*; public class Main { static long mod = 1000000007; static HashMap<Long, ArrayList<Pair>> map = new HashMap<>(); public static void main(String[] args) { FastReader reader = new FastReader(); PrintWriter writer = new PrintWriter(System.out); int n = reader.nextInt(); i...
Java
["4 4 2\n0 1 0 1\n1 2\n2 3\n3 4\n4 1", "4 5 3\n7 1 7 2\n1 2\n2 3\n3 4\n4 1\n2 4"]
3 seconds
["50", "96"]
NoteConsider the first example.Possible values for the number $$$x$$$ contained by the virus are $$$0$$$, $$$1$$$, $$$2$$$ and $$$3$$$.For values $$$0$$$, $$$2$$$ and $$$3$$$ the virus can infect any subset of the set of servers, which gives us $$$16$$$ pairs for each values. A virus containing the number $$$1$$$ can i...
Java 8
standard input
[ "combinatorics", "dfs and similar", "graphs" ]
9319661488d33bd0b43a5ff8b238f694
The first line of input contains three integers $$$n$$$, $$$m$$$ and $$$k$$$ ($$$1 \leq n \leq 500\,000$$$, $$$0 \leq m \leq \min(\frac{n(n - 1)}{2}, 500\,000)$$$, $$$0 \leq k \leq 60$$$) — the number of servers, the number of pairs of servers directly connected by a data communication channel, and the parameter $$$k$$...
2,200
The only output line should contain a single integer — the number of safe infections of some subset of servers by a virus with some parameter, modulo $$$10^9 + 7$$$.
standard output
PASSED
30b5b6567f92f84c1c2b85caa2badc9f
train_003.jsonl
1536165300
The Metropolis computer network consists of $$$n$$$ servers, each has an encryption key in the range from $$$0$$$ to $$$2^k - 1$$$ assigned to it. Let $$$c_i$$$ be the encryption key assigned to the $$$i$$$-th server. Additionally, $$$m$$$ pairs of servers are directly connected via a data communication channel. Becaus...
512 megabytes
import java.io.BufferedReader; // import java.io.FileInputStream; // import java.io.FileOutputStream; import java.io.InputStream; import java.io.InputStreamReader; import java.io.IOException; import java.io.PrintWriter; import java.math.BigInteger; import java.util.Arrays; import java.util.ArrayList; import java.util.P...
Java
["4 4 2\n0 1 0 1\n1 2\n2 3\n3 4\n4 1", "4 5 3\n7 1 7 2\n1 2\n2 3\n3 4\n4 1\n2 4"]
3 seconds
["50", "96"]
NoteConsider the first example.Possible values for the number $$$x$$$ contained by the virus are $$$0$$$, $$$1$$$, $$$2$$$ and $$$3$$$.For values $$$0$$$, $$$2$$$ and $$$3$$$ the virus can infect any subset of the set of servers, which gives us $$$16$$$ pairs for each values. A virus containing the number $$$1$$$ can i...
Java 8
standard input
[ "combinatorics", "dfs and similar", "graphs" ]
9319661488d33bd0b43a5ff8b238f694
The first line of input contains three integers $$$n$$$, $$$m$$$ and $$$k$$$ ($$$1 \leq n \leq 500\,000$$$, $$$0 \leq m \leq \min(\frac{n(n - 1)}{2}, 500\,000)$$$, $$$0 \leq k \leq 60$$$) — the number of servers, the number of pairs of servers directly connected by a data communication channel, and the parameter $$$k$$...
2,200
The only output line should contain a single integer — the number of safe infections of some subset of servers by a virus with some parameter, modulo $$$10^9 + 7$$$.
standard output
PASSED
bb4a3dffbefa356089413fbb14114397
train_003.jsonl
1536165300
The Metropolis computer network consists of $$$n$$$ servers, each has an encryption key in the range from $$$0$$$ to $$$2^k - 1$$$ assigned to it. Let $$$c_i$$$ be the encryption key assigned to the $$$i$$$-th server. Additionally, $$$m$$$ pairs of servers are directly connected via a data communication channel. Becaus...
512 megabytes
import java.util.*; import java.lang.*; import java.math.*; import java.io.*; import static java.lang.Math.*; /* spar5h */ public class cf3 implements Runnable{ static class pair { int i, j; pair(int i, int j) { this.i = i; this.j = j; } } public void run() { InputReader s = new InputRead...
Java
["4 4 2\n0 1 0 1\n1 2\n2 3\n3 4\n4 1", "4 5 3\n7 1 7 2\n1 2\n2 3\n3 4\n4 1\n2 4"]
3 seconds
["50", "96"]
NoteConsider the first example.Possible values for the number $$$x$$$ contained by the virus are $$$0$$$, $$$1$$$, $$$2$$$ and $$$3$$$.For values $$$0$$$, $$$2$$$ and $$$3$$$ the virus can infect any subset of the set of servers, which gives us $$$16$$$ pairs for each values. A virus containing the number $$$1$$$ can i...
Java 8
standard input
[ "combinatorics", "dfs and similar", "graphs" ]
9319661488d33bd0b43a5ff8b238f694
The first line of input contains three integers $$$n$$$, $$$m$$$ and $$$k$$$ ($$$1 \leq n \leq 500\,000$$$, $$$0 \leq m \leq \min(\frac{n(n - 1)}{2}, 500\,000)$$$, $$$0 \leq k \leq 60$$$) — the number of servers, the number of pairs of servers directly connected by a data communication channel, and the parameter $$$k$$...
2,200
The only output line should contain a single integer — the number of safe infections of some subset of servers by a virus with some parameter, modulo $$$10^9 + 7$$$.
standard output
PASSED
c7dd8fd317aae852bff2b53c89804f77
train_003.jsonl
1536165300
The Metropolis computer network consists of $$$n$$$ servers, each has an encryption key in the range from $$$0$$$ to $$$2^k - 1$$$ assigned to it. Let $$$c_i$$$ be the encryption key assigned to the $$$i$$$-th server. Additionally, $$$m$$$ pairs of servers are directly connected via a data communication channel. Becaus...
512 megabytes
import java.lang.*; import java.lang.reflect.Array; import java.math.*; import java.util.*; import java.io.*; public class Main { class Node { int id; int x; public Node(int id,int x){ this.id=id; this.x=x; } } void solve() { int n=ni(),m=ni(),k=ni(); int from[]=new in...
Java
["4 4 2\n0 1 0 1\n1 2\n2 3\n3 4\n4 1", "4 5 3\n7 1 7 2\n1 2\n2 3\n3 4\n4 1\n2 4"]
3 seconds
["50", "96"]
NoteConsider the first example.Possible values for the number $$$x$$$ contained by the virus are $$$0$$$, $$$1$$$, $$$2$$$ and $$$3$$$.For values $$$0$$$, $$$2$$$ and $$$3$$$ the virus can infect any subset of the set of servers, which gives us $$$16$$$ pairs for each values. A virus containing the number $$$1$$$ can i...
Java 8
standard input
[ "combinatorics", "dfs and similar", "graphs" ]
9319661488d33bd0b43a5ff8b238f694
The first line of input contains three integers $$$n$$$, $$$m$$$ and $$$k$$$ ($$$1 \leq n \leq 500\,000$$$, $$$0 \leq m \leq \min(\frac{n(n - 1)}{2}, 500\,000)$$$, $$$0 \leq k \leq 60$$$) — the number of servers, the number of pairs of servers directly connected by a data communication channel, and the parameter $$$k$$...
2,200
The only output line should contain a single integer — the number of safe infections of some subset of servers by a virus with some parameter, modulo $$$10^9 + 7$$$.
standard output
PASSED
ba692268d99672a2b3fc15945008363d
train_003.jsonl
1537612500
After finding and moving to the new planet that supports human life, discussions started on which currency should be used. After long negotiations, Bitcoin was ultimately chosen as the universal currency.These were the great news for Alice, whose grandfather got into Bitcoin mining in 2013, and accumulated a lot of the...
256 megabytes
import java.io.*; import java.util.*; public class Main { private Reader r; private StreamTokenizer tk; public Main() { r = new BufferedReader(new InputStreamReader(System.in)); tk = new StreamTokenizer(r); } public void exit() throws IOException { r.close(); } ...
Java
["3\n13 7 6\n6 2"]
1 second
["4"]
NoteAlice can make two transactions in a following way:0. 13 7 6 (initial state)1. 6 7 6 5 (create new address and transfer from first public address 5 satoshies)2. 6 4 6 5 1 (create new address and transfer from second address 1 satoshi)Since cost per transaction is 2 satoshies, total fee is 4.
Java 8
standard input
[ "implementation" ]
8a3e8a5db6d7d668ffea0f59e2639e87
First line contains number $$$N$$$ ($$$1 \leq N \leq 200\,000$$$) representing total number of public addresses Alice has. Next line contains $$$N$$$ integer numbers $$$a_i$$$ ($$$1 \leq a_i \leq 10^9$$$) separated by a single space, representing how many satoshi Alice has in her public addresses. Last line contains tw...
1,400
Output one integer number representing total fee in satoshi Alice will need to pay to achieve her goal.
standard output
PASSED
ae90005c3df70c26eb2f001a3021ff0a
train_003.jsonl
1537612500
After finding and moving to the new planet that supports human life, discussions started on which currency should be used. After long negotiations, Bitcoin was ultimately chosen as the universal currency.These were the great news for Alice, whose grandfather got into Bitcoin mining in 2013, and accumulated a lot of the...
256 megabytes
//package math_codet; import java.io.*; import java.util.*; /****************************************** * AUTHOR: AMAN KUMAR SINGH * * INSTITUITION: KALYANI GOVERNMENT ENGINEERING COLLEGE * ******************************************/ public class lets_do { InputReader in; PrintWriter o...
Java
["3\n13 7 6\n6 2"]
1 second
["4"]
NoteAlice can make two transactions in a following way:0. 13 7 6 (initial state)1. 6 7 6 5 (create new address and transfer from first public address 5 satoshies)2. 6 4 6 5 1 (create new address and transfer from second address 1 satoshi)Since cost per transaction is 2 satoshies, total fee is 4.
Java 8
standard input
[ "implementation" ]
8a3e8a5db6d7d668ffea0f59e2639e87
First line contains number $$$N$$$ ($$$1 \leq N \leq 200\,000$$$) representing total number of public addresses Alice has. Next line contains $$$N$$$ integer numbers $$$a_i$$$ ($$$1 \leq a_i \leq 10^9$$$) separated by a single space, representing how many satoshi Alice has in her public addresses. Last line contains tw...
1,400
Output one integer number representing total fee in satoshi Alice will need to pay to achieve her goal.
standard output
PASSED
92214811e71100869a92cd9ec9e5ed71
train_003.jsonl
1537612500
After finding and moving to the new planet that supports human life, discussions started on which currency should be used. After long negotiations, Bitcoin was ultimately chosen as the universal currency.These were the great news for Alice, whose grandfather got into Bitcoin mining in 2013, and accumulated a lot of the...
256 megabytes
import javafx.util.*; import java.util.*; import java.io.*; import java.math.*; public class Test5 { Random rnd = new Random(); PrintWriter pw = new PrintWriter(System.out); static int[] n; void run(){ long a = ni(),x,k,nk; long o = 0; long[] m = new long[(int)a]; for(...
Java
["3\n13 7 6\n6 2"]
1 second
["4"]
NoteAlice can make two transactions in a following way:0. 13 7 6 (initial state)1. 6 7 6 5 (create new address and transfer from first public address 5 satoshies)2. 6 4 6 5 1 (create new address and transfer from second address 1 satoshi)Since cost per transaction is 2 satoshies, total fee is 4.
Java 8
standard input
[ "implementation" ]
8a3e8a5db6d7d668ffea0f59e2639e87
First line contains number $$$N$$$ ($$$1 \leq N \leq 200\,000$$$) representing total number of public addresses Alice has. Next line contains $$$N$$$ integer numbers $$$a_i$$$ ($$$1 \leq a_i \leq 10^9$$$) separated by a single space, representing how many satoshi Alice has in her public addresses. Last line contains tw...
1,400
Output one integer number representing total fee in satoshi Alice will need to pay to achieve her goal.
standard output
PASSED
1608ec85e8443fed0bf212174f225d96
train_003.jsonl
1537612500
After finding and moving to the new planet that supports human life, discussions started on which currency should be used. After long negotiations, Bitcoin was ultimately chosen as the universal currency.These were the great news for Alice, whose grandfather got into Bitcoin mining in 2013, and accumulated a lot of the...
256 megabytes
import java.util.Arrays; import java.util.Scanner; public class SplittingMoney { public static void main(String arg[]) { Scanner scan = new Scanner(System.in); int n = scan.nextInt(); Long [] num = new Long[n]; long fee = 0; for (int i = 0; i<n; i++) { Long a = scan.nextLong(); num[i] = a; } Long...
Java
["3\n13 7 6\n6 2"]
1 second
["4"]
NoteAlice can make two transactions in a following way:0. 13 7 6 (initial state)1. 6 7 6 5 (create new address and transfer from first public address 5 satoshies)2. 6 4 6 5 1 (create new address and transfer from second address 1 satoshi)Since cost per transaction is 2 satoshies, total fee is 4.
Java 8
standard input
[ "implementation" ]
8a3e8a5db6d7d668ffea0f59e2639e87
First line contains number $$$N$$$ ($$$1 \leq N \leq 200\,000$$$) representing total number of public addresses Alice has. Next line contains $$$N$$$ integer numbers $$$a_i$$$ ($$$1 \leq a_i \leq 10^9$$$) separated by a single space, representing how many satoshi Alice has in her public addresses. Last line contains tw...
1,400
Output one integer number representing total fee in satoshi Alice will need to pay to achieve her goal.
standard output
PASSED
adf9c2d192e9b65c95bbfe45251705ce
train_003.jsonl
1537612500
After finding and moving to the new planet that supports human life, discussions started on which currency should be used. After long negotiations, Bitcoin was ultimately chosen as the universal currency.These were the great news for Alice, whose grandfather got into Bitcoin mining in 2013, and accumulated a lot of the...
256 megabytes
import java.util.*; public class BubbleF{ public static void main(String args[]) { Scanner sc = new Scanner(System.in); int n = sc.nextInt(); long amounts[] = new long[n]; for (int i = 0; i < n;i++) { amounts[i] = sc.nextLong(); } long max = sc.ne...
Java
["3\n13 7 6\n6 2"]
1 second
["4"]
NoteAlice can make two transactions in a following way:0. 13 7 6 (initial state)1. 6 7 6 5 (create new address and transfer from first public address 5 satoshies)2. 6 4 6 5 1 (create new address and transfer from second address 1 satoshi)Since cost per transaction is 2 satoshies, total fee is 4.
Java 8
standard input
[ "implementation" ]
8a3e8a5db6d7d668ffea0f59e2639e87
First line contains number $$$N$$$ ($$$1 \leq N \leq 200\,000$$$) representing total number of public addresses Alice has. Next line contains $$$N$$$ integer numbers $$$a_i$$$ ($$$1 \leq a_i \leq 10^9$$$) separated by a single space, representing how many satoshi Alice has in her public addresses. Last line contains tw...
1,400
Output one integer number representing total fee in satoshi Alice will need to pay to achieve her goal.
standard output
PASSED
296ea02dd2162f863147bfc2ee445e75
train_003.jsonl
1537612500
After finding and moving to the new planet that supports human life, discussions started on which currency should be used. After long negotiations, Bitcoin was ultimately chosen as the universal currency.These were the great news for Alice, whose grandfather got into Bitcoin mining in 2013, and accumulated a lot of the...
256 megabytes
import java.util.*; import java.io.*; public class CFB { static int mod = (int) (1e9+7); static InputReader in; static PrintWriter out; public static void main(String[] args) { in = new InputReader(System.in); out = new PrintWriter(System.out); int n = in.nex...
Java
["3\n13 7 6\n6 2"]
1 second
["4"]
NoteAlice can make two transactions in a following way:0. 13 7 6 (initial state)1. 6 7 6 5 (create new address and transfer from first public address 5 satoshies)2. 6 4 6 5 1 (create new address and transfer from second address 1 satoshi)Since cost per transaction is 2 satoshies, total fee is 4.
Java 8
standard input
[ "implementation" ]
8a3e8a5db6d7d668ffea0f59e2639e87
First line contains number $$$N$$$ ($$$1 \leq N \leq 200\,000$$$) representing total number of public addresses Alice has. Next line contains $$$N$$$ integer numbers $$$a_i$$$ ($$$1 \leq a_i \leq 10^9$$$) separated by a single space, representing how many satoshi Alice has in her public addresses. Last line contains tw...
1,400
Output one integer number representing total fee in satoshi Alice will need to pay to achieve her goal.
standard output
PASSED
931fa1dfaee03bd6530600933bd9d98e
train_003.jsonl
1537612500
After finding and moving to the new planet that supports human life, discussions started on which currency should be used. After long negotiations, Bitcoin was ultimately chosen as the universal currency.These were the great news for Alice, whose grandfather got into Bitcoin mining in 2013, and accumulated a lot of the...
256 megabytes
/* * To change this license header, choose License Headers in Project Properties. * To change this template file, choose Tools | Templates * and open the template in the editor. */ import java.util.Scanner; /** * * @author ElchinF */ public class SplittingMoney { /** * @param args the command line ar...
Java
["3\n13 7 6\n6 2"]
1 second
["4"]
NoteAlice can make two transactions in a following way:0. 13 7 6 (initial state)1. 6 7 6 5 (create new address and transfer from first public address 5 satoshies)2. 6 4 6 5 1 (create new address and transfer from second address 1 satoshi)Since cost per transaction is 2 satoshies, total fee is 4.
Java 8
standard input
[ "implementation" ]
8a3e8a5db6d7d668ffea0f59e2639e87
First line contains number $$$N$$$ ($$$1 \leq N \leq 200\,000$$$) representing total number of public addresses Alice has. Next line contains $$$N$$$ integer numbers $$$a_i$$$ ($$$1 \leq a_i \leq 10^9$$$) separated by a single space, representing how many satoshi Alice has in her public addresses. Last line contains tw...
1,400
Output one integer number representing total fee in satoshi Alice will need to pay to achieve her goal.
standard output
PASSED
e715f8aef34d4578a98d3a000a01a5bd
train_003.jsonl
1537612500
After finding and moving to the new planet that supports human life, discussions started on which currency should be used. After long negotiations, Bitcoin was ultimately chosen as the universal currency.These were the great news for Alice, whose grandfather got into Bitcoin mining in 2013, and accumulated a lot of the...
256 megabytes
import java.util.Scanner; public class Main { private static Scanner in = new Scanner(System.in); public static void main(String[] args) { int n = in.nextInt(); int[] x = new int[n]; for (int i = 0; i < n; i++) { x[i] = in.nextInt(); } long ans = 0; ...
Java
["3\n13 7 6\n6 2"]
1 second
["4"]
NoteAlice can make two transactions in a following way:0. 13 7 6 (initial state)1. 6 7 6 5 (create new address and transfer from first public address 5 satoshies)2. 6 4 6 5 1 (create new address and transfer from second address 1 satoshi)Since cost per transaction is 2 satoshies, total fee is 4.
Java 8
standard input
[ "implementation" ]
8a3e8a5db6d7d668ffea0f59e2639e87
First line contains number $$$N$$$ ($$$1 \leq N \leq 200\,000$$$) representing total number of public addresses Alice has. Next line contains $$$N$$$ integer numbers $$$a_i$$$ ($$$1 \leq a_i \leq 10^9$$$) separated by a single space, representing how many satoshi Alice has in her public addresses. Last line contains tw...
1,400
Output one integer number representing total fee in satoshi Alice will need to pay to achieve her goal.
standard output
PASSED
060c7e3b102ca67c24643d7fa124c069
train_003.jsonl
1537612500
After finding and moving to the new planet that supports human life, discussions started on which currency should be used. After long negotiations, Bitcoin was ultimately chosen as the universal currency.These were the great news for Alice, whose grandfather got into Bitcoin mining in 2013, and accumulated a lot of the...
256 megabytes
import java.io.BufferedReader; import java.io.FileNotFoundException; import java.io.IOException; import java.io.InputStream; import java.io.InputStreamReader; import java.util.ArrayList; import java.util.HashMap; import java.util.HashSet; import java.util.List; import java.util.Map.Entry; import java.util.function.IntP...
Java
["3\n13 7 6\n6 2"]
1 second
["4"]
NoteAlice can make two transactions in a following way:0. 13 7 6 (initial state)1. 6 7 6 5 (create new address and transfer from first public address 5 satoshies)2. 6 4 6 5 1 (create new address and transfer from second address 1 satoshi)Since cost per transaction is 2 satoshies, total fee is 4.
Java 8
standard input
[ "implementation" ]
8a3e8a5db6d7d668ffea0f59e2639e87
First line contains number $$$N$$$ ($$$1 \leq N \leq 200\,000$$$) representing total number of public addresses Alice has. Next line contains $$$N$$$ integer numbers $$$a_i$$$ ($$$1 \leq a_i \leq 10^9$$$) separated by a single space, representing how many satoshi Alice has in her public addresses. Last line contains tw...
1,400
Output one integer number representing total fee in satoshi Alice will need to pay to achieve her goal.
standard output
PASSED
29d1e19ac561554f0882493829a3aa08
train_003.jsonl
1537612500
After finding and moving to the new planet that supports human life, discussions started on which currency should be used. After long negotiations, Bitcoin was ultimately chosen as the universal currency.These were the great news for Alice, whose grandfather got into Bitcoin mining in 2013, and accumulated a lot of the...
256 megabytes
//package codeforces.bubble_cup_final_mirror; import java.util.Scanner; public class F_SplittingMoney { public static void main(String[] args) { Scanner scanner = new Scanner(System.in); int N = scanner.nextInt(); int[] accounts = new int[N]; for (int i = 0; i < N; i++) { ...
Java
["3\n13 7 6\n6 2"]
1 second
["4"]
NoteAlice can make two transactions in a following way:0. 13 7 6 (initial state)1. 6 7 6 5 (create new address and transfer from first public address 5 satoshies)2. 6 4 6 5 1 (create new address and transfer from second address 1 satoshi)Since cost per transaction is 2 satoshies, total fee is 4.
Java 8
standard input
[ "implementation" ]
8a3e8a5db6d7d668ffea0f59e2639e87
First line contains number $$$N$$$ ($$$1 \leq N \leq 200\,000$$$) representing total number of public addresses Alice has. Next line contains $$$N$$$ integer numbers $$$a_i$$$ ($$$1 \leq a_i \leq 10^9$$$) separated by a single space, representing how many satoshi Alice has in her public addresses. Last line contains tw...
1,400
Output one integer number representing total fee in satoshi Alice will need to pay to achieve her goal.
standard output
PASSED
90ec6ed73d420a350978aa50b683141f
train_003.jsonl
1537612500
After finding and moving to the new planet that supports human life, discussions started on which currency should be used. After long negotiations, Bitcoin was ultimately chosen as the universal currency.These were the great news for Alice, whose grandfather got into Bitcoin mining in 2013, and accumulated a lot of the...
256 megabytes
import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; import java.util.StringTokenizer; /** * */ public class F { public static void main(String[] args) throws IOException { BufferedReader reader = new BufferedReader(new InputStreamReader(System.in)); Strin...
Java
["3\n13 7 6\n6 2"]
1 second
["4"]
NoteAlice can make two transactions in a following way:0. 13 7 6 (initial state)1. 6 7 6 5 (create new address and transfer from first public address 5 satoshies)2. 6 4 6 5 1 (create new address and transfer from second address 1 satoshi)Since cost per transaction is 2 satoshies, total fee is 4.
Java 8
standard input
[ "implementation" ]
8a3e8a5db6d7d668ffea0f59e2639e87
First line contains number $$$N$$$ ($$$1 \leq N \leq 200\,000$$$) representing total number of public addresses Alice has. Next line contains $$$N$$$ integer numbers $$$a_i$$$ ($$$1 \leq a_i \leq 10^9$$$) separated by a single space, representing how many satoshi Alice has in her public addresses. Last line contains tw...
1,400
Output one integer number representing total fee in satoshi Alice will need to pay to achieve her goal.
standard output
PASSED
67fdc5cf409f65c264655a69cdd740a9
train_003.jsonl
1537612500
After finding and moving to the new planet that supports human life, discussions started on which currency should be used. After long negotiations, Bitcoin was ultimately chosen as the universal currency.These were the great news for Alice, whose grandfather got into Bitcoin mining in 2013, and accumulated a lot of the...
256 megabytes
import java.io.*; import java.math.BigInteger; import java.util.*; public class A { static MyScanner sc; static PrintWriter pw; public static void main(String[] args) throws Throwable { sc = new MyScanner(); pw = new PrintWriter(System.out); int n = sc.nextInt(); long[] a ...
Java
["3\n13 7 6\n6 2"]
1 second
["4"]
NoteAlice can make two transactions in a following way:0. 13 7 6 (initial state)1. 6 7 6 5 (create new address and transfer from first public address 5 satoshies)2. 6 4 6 5 1 (create new address and transfer from second address 1 satoshi)Since cost per transaction is 2 satoshies, total fee is 4.
Java 8
standard input
[ "implementation" ]
8a3e8a5db6d7d668ffea0f59e2639e87
First line contains number $$$N$$$ ($$$1 \leq N \leq 200\,000$$$) representing total number of public addresses Alice has. Next line contains $$$N$$$ integer numbers $$$a_i$$$ ($$$1 \leq a_i \leq 10^9$$$) separated by a single space, representing how many satoshi Alice has in her public addresses. Last line contains tw...
1,400
Output one integer number representing total fee in satoshi Alice will need to pay to achieve her goal.
standard output
PASSED
21beaecdb8b191a16931c3f60b6ed740
train_003.jsonl
1537612500
After finding and moving to the new planet that supports human life, discussions started on which currency should be used. After long negotiations, Bitcoin was ultimately chosen as the universal currency.These were the great news for Alice, whose grandfather got into Bitcoin mining in 2013, and accumulated a lot of the...
256 megabytes
import java.io.BufferedReader; import java.io.InputStreamReader; import java.io.PrintWriter; import java.util.Arrays; import java.util.Scanner; import java.util.StringTokenizer; public class vk18 { public static void main(String[] stp) throws Exception { Scanner scan = new Scanner(System.in); P...
Java
["3\n13 7 6\n6 2"]
1 second
["4"]
NoteAlice can make two transactions in a following way:0. 13 7 6 (initial state)1. 6 7 6 5 (create new address and transfer from first public address 5 satoshies)2. 6 4 6 5 1 (create new address and transfer from second address 1 satoshi)Since cost per transaction is 2 satoshies, total fee is 4.
Java 8
standard input
[ "implementation" ]
8a3e8a5db6d7d668ffea0f59e2639e87
First line contains number $$$N$$$ ($$$1 \leq N \leq 200\,000$$$) representing total number of public addresses Alice has. Next line contains $$$N$$$ integer numbers $$$a_i$$$ ($$$1 \leq a_i \leq 10^9$$$) separated by a single space, representing how many satoshi Alice has in her public addresses. Last line contains tw...
1,400
Output one integer number representing total fee in satoshi Alice will need to pay to achieve her goal.
standard output
PASSED
2dbfc2fd6528ab66d9747e9302024e76
train_003.jsonl
1537612500
After finding and moving to the new planet that supports human life, discussions started on which currency should be used. After long negotiations, Bitcoin was ultimately chosen as the universal currency.These were the great news for Alice, whose grandfather got into Bitcoin mining in 2013, and accumulated a lot of the...
256 megabytes
// 1046 F import java.util.Scanner; import java.lang.Math; public class SplittingMoney{ public static void main(String [] args){ Scanner sc = new Scanner(System.in); int n = sc.nextInt(); long [] a = new long[n]; for(int i = 0; i < n; i++) a[i] = sc.nextInt(); long x = sc.nextInt(); long...
Java
["3\n13 7 6\n6 2"]
1 second
["4"]
NoteAlice can make two transactions in a following way:0. 13 7 6 (initial state)1. 6 7 6 5 (create new address and transfer from first public address 5 satoshies)2. 6 4 6 5 1 (create new address and transfer from second address 1 satoshi)Since cost per transaction is 2 satoshies, total fee is 4.
Java 8
standard input
[ "implementation" ]
8a3e8a5db6d7d668ffea0f59e2639e87
First line contains number $$$N$$$ ($$$1 \leq N \leq 200\,000$$$) representing total number of public addresses Alice has. Next line contains $$$N$$$ integer numbers $$$a_i$$$ ($$$1 \leq a_i \leq 10^9$$$) separated by a single space, representing how many satoshi Alice has in her public addresses. Last line contains tw...
1,400
Output one integer number representing total fee in satoshi Alice will need to pay to achieve her goal.
standard output
PASSED
a35fe0c6f6be670e46dd0bd6b65fcf9f
train_003.jsonl
1537612500
After finding and moving to the new planet that supports human life, discussions started on which currency should be used. After long negotiations, Bitcoin was ultimately chosen as the universal currency.These were the great news for Alice, whose grandfather got into Bitcoin mining in 2013, and accumulated a lot of the...
256 megabytes
import java.util.Scanner; /** * Created by shnovruzov on 22/10/2018. */ public class Test { public static void main(String args[]) { Scanner in = new Scanner(System.in); int N = in.nextInt(); int a[] = new int[N]; for (int i = 0; i < N; i++) a[i] = in.nextInt(); ...
Java
["3\n13 7 6\n6 2"]
1 second
["4"]
NoteAlice can make two transactions in a following way:0. 13 7 6 (initial state)1. 6 7 6 5 (create new address and transfer from first public address 5 satoshies)2. 6 4 6 5 1 (create new address and transfer from second address 1 satoshi)Since cost per transaction is 2 satoshies, total fee is 4.
Java 8
standard input
[ "implementation" ]
8a3e8a5db6d7d668ffea0f59e2639e87
First line contains number $$$N$$$ ($$$1 \leq N \leq 200\,000$$$) representing total number of public addresses Alice has. Next line contains $$$N$$$ integer numbers $$$a_i$$$ ($$$1 \leq a_i \leq 10^9$$$) separated by a single space, representing how many satoshi Alice has in her public addresses. Last line contains tw...
1,400
Output one integer number representing total fee in satoshi Alice will need to pay to achieve her goal.
standard output
PASSED
c2e841bca5194b243e722e2c1a5dd9c3
train_003.jsonl
1537612500
After finding and moving to the new planet that supports human life, discussions started on which currency should be used. After long negotiations, Bitcoin was ultimately chosen as the universal currency.These were the great news for Alice, whose grandfather got into Bitcoin mining in 2013, and accumulated a lot of the...
256 megabytes
import java.io.OutputStream; import java.io.IOException; import java.io.InputStream; import java.io.PrintWriter; import java.util.InputMismatchException; import java.io.IOException; import java.io.InputStream; /** * Built using CHelper plug-in * Actual solution is at the top */ public class Main { public static...
Java
["3\n13 7 6\n6 2"]
1 second
["4"]
NoteAlice can make two transactions in a following way:0. 13 7 6 (initial state)1. 6 7 6 5 (create new address and transfer from first public address 5 satoshies)2. 6 4 6 5 1 (create new address and transfer from second address 1 satoshi)Since cost per transaction is 2 satoshies, total fee is 4.
Java 8
standard input
[ "implementation" ]
8a3e8a5db6d7d668ffea0f59e2639e87
First line contains number $$$N$$$ ($$$1 \leq N \leq 200\,000$$$) representing total number of public addresses Alice has. Next line contains $$$N$$$ integer numbers $$$a_i$$$ ($$$1 \leq a_i \leq 10^9$$$) separated by a single space, representing how many satoshi Alice has in her public addresses. Last line contains tw...
1,400
Output one integer number representing total fee in satoshi Alice will need to pay to achieve her goal.
standard output
PASSED
cacb5f356a1aeab9f95cf25781459802
train_003.jsonl
1537612500
After finding and moving to the new planet that supports human life, discussions started on which currency should be used. After long negotiations, Bitcoin was ultimately chosen as the universal currency.These were the great news for Alice, whose grandfather got into Bitcoin mining in 2013, and accumulated a lot of the...
256 megabytes
import java.util.*; public class Main { public static void main(String[] args) { Scanner scn = new Scanner(System.in); int n = scn.nextInt(); int arr[] = new int[n]; for(int i=0;i<n;i++){ arr[i]=scn.nextInt(); } int x = scn.nextInt(); int f = scn.nextInt(); long count=0; for(int i=0;i<n...
Java
["3\n13 7 6\n6 2"]
1 second
["4"]
NoteAlice can make two transactions in a following way:0. 13 7 6 (initial state)1. 6 7 6 5 (create new address and transfer from first public address 5 satoshies)2. 6 4 6 5 1 (create new address and transfer from second address 1 satoshi)Since cost per transaction is 2 satoshies, total fee is 4.
Java 8
standard input
[ "implementation" ]
8a3e8a5db6d7d668ffea0f59e2639e87
First line contains number $$$N$$$ ($$$1 \leq N \leq 200\,000$$$) representing total number of public addresses Alice has. Next line contains $$$N$$$ integer numbers $$$a_i$$$ ($$$1 \leq a_i \leq 10^9$$$) separated by a single space, representing how many satoshi Alice has in her public addresses. Last line contains tw...
1,400
Output one integer number representing total fee in satoshi Alice will need to pay to achieve her goal.
standard output
PASSED
af46ca42ba995b622ce00ce607f167c2
train_003.jsonl
1537612500
After finding and moving to the new planet that supports human life, discussions started on which currency should be used. After long negotiations, Bitcoin was ultimately chosen as the universal currency.These were the great news for Alice, whose grandfather got into Bitcoin mining in 2013, and accumulated a lot of the...
256 megabytes
import java.util.*; import java.lang.*; import java.io.*; public class Main{ public static long find_count(long[] a, long max_satoshi,long fees){ long total = 0; for(int i=0;i<a.length;i++){ long div = 0; if(a[(int)i]>max_satoshi){ div = a[(int)i]/(max_satoshi+fees); total = total+div; lo...
Java
["3\n13 7 6\n6 2"]
1 second
["4"]
NoteAlice can make two transactions in a following way:0. 13 7 6 (initial state)1. 6 7 6 5 (create new address and transfer from first public address 5 satoshies)2. 6 4 6 5 1 (create new address and transfer from second address 1 satoshi)Since cost per transaction is 2 satoshies, total fee is 4.
Java 8
standard input
[ "implementation" ]
8a3e8a5db6d7d668ffea0f59e2639e87
First line contains number $$$N$$$ ($$$1 \leq N \leq 200\,000$$$) representing total number of public addresses Alice has. Next line contains $$$N$$$ integer numbers $$$a_i$$$ ($$$1 \leq a_i \leq 10^9$$$) separated by a single space, representing how many satoshi Alice has in her public addresses. Last line contains tw...
1,400
Output one integer number representing total fee in satoshi Alice will need to pay to achieve her goal.
standard output
PASSED
644dd28e7f84ca876bc64586f184155e
train_003.jsonl
1537612500
After finding and moving to the new planet that supports human life, discussions started on which currency should be used. After long negotiations, Bitcoin was ultimately chosen as the universal currency.These were the great news for Alice, whose grandfather got into Bitcoin mining in 2013, and accumulated a lot of the...
256 megabytes
import java.io.*; import java.lang.reflect.Array; import java.math.BigInteger; import java.util.*; import java.util.Random; import java.util.StringTokenizer; public class Main { String fileName = ""; ////////////////////// SOLUTION SOLUTION SOLUTION ////////////////////////////// Long INF = Long....
Java
["3\n13 7 6\n6 2"]
1 second
["4"]
NoteAlice can make two transactions in a following way:0. 13 7 6 (initial state)1. 6 7 6 5 (create new address and transfer from first public address 5 satoshies)2. 6 4 6 5 1 (create new address and transfer from second address 1 satoshi)Since cost per transaction is 2 satoshies, total fee is 4.
Java 8
standard input
[ "implementation" ]
8a3e8a5db6d7d668ffea0f59e2639e87
First line contains number $$$N$$$ ($$$1 \leq N \leq 200\,000$$$) representing total number of public addresses Alice has. Next line contains $$$N$$$ integer numbers $$$a_i$$$ ($$$1 \leq a_i \leq 10^9$$$) separated by a single space, representing how many satoshi Alice has in her public addresses. Last line contains tw...
1,400
Output one integer number representing total fee in satoshi Alice will need to pay to achieve her goal.
standard output
PASSED
b88e093c1e3cb341dc82d904ca80cb32
train_003.jsonl
1537612500
After finding and moving to the new planet that supports human life, discussions started on which currency should be used. After long negotiations, Bitcoin was ultimately chosen as the universal currency.These were the great news for Alice, whose grandfather got into Bitcoin mining in 2013, and accumulated a lot of the...
256 megabytes
import java.io.*; import java.util.StringTokenizer; public class F { public static void main(String[] args) throws IOException { init(); int n = nextInt(); int[] a = new int[n]; for (int i = 0; i < n; i++) a[i] = nextInt(); long x = nextInt(), f = nextInt(); lon...
Java
["3\n13 7 6\n6 2"]
1 second
["4"]
NoteAlice can make two transactions in a following way:0. 13 7 6 (initial state)1. 6 7 6 5 (create new address and transfer from first public address 5 satoshies)2. 6 4 6 5 1 (create new address and transfer from second address 1 satoshi)Since cost per transaction is 2 satoshies, total fee is 4.
Java 8
standard input
[ "implementation" ]
8a3e8a5db6d7d668ffea0f59e2639e87
First line contains number $$$N$$$ ($$$1 \leq N \leq 200\,000$$$) representing total number of public addresses Alice has. Next line contains $$$N$$$ integer numbers $$$a_i$$$ ($$$1 \leq a_i \leq 10^9$$$) separated by a single space, representing how many satoshi Alice has in her public addresses. Last line contains tw...
1,400
Output one integer number representing total fee in satoshi Alice will need to pay to achieve her goal.
standard output