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
663408055e555db7f010b395bf590de6
train_002.jsonl
1492785300
Mike has n strings s1, s2, ..., sn each consisting of lowercase English letters. In one move he can choose a string si, erase the first character and append it to the end of the string. For example, if he has the string "coolmike", in one move he can transform it into the string "oolmikec".Now Mike asks himself: what i...
256 megabytes
import java.io.OutputStream; import java.io.IOException; import java.io.InputStream; import java.io.PrintWriter; import java.util.Scanner; /** * Built using CHelper plug-in * Actual solution is at the top */ public class Main { public static void main(String[] args) { InputStream inputStream = System.in...
Java
["4\nxzzwo\nzwoxz\nzzwox\nxzzwo", "2\nmolzv\nlzvmo", "3\nkc\nkc\nkc", "3\naa\naa\nab"]
2 seconds
["5", "2", "0", "-1"]
NoteIn the first sample testcase the optimal scenario is to perform operations in such a way as to transform all strings into "zwoxz".
Java 8
standard input
[ "dp", "brute force", "strings" ]
a3a7515219ebb0154218ee3520e20d75
The first line contains integer n (1 ≤ n ≤ 50) — the number of strings. This is followed by n lines which contain a string each. The i-th line corresponding to string si. Lengths of strings are equal. Lengths of each string is positive and don't exceed 50.
1,300
Print the minimal number of moves Mike needs in order to make all the strings equal or print  - 1 if there is no solution.
standard output
PASSED
41856bec20eafddf1bcf2b0929d6e6f9
train_002.jsonl
1492785300
Mike has n strings s1, s2, ..., sn each consisting of lowercase English letters. In one move he can choose a string si, erase the first character and append it to the end of the string. For example, if he has the string "coolmike", in one move he can transform it into the string "oolmikec".Now Mike asks himself: what i...
256 megabytes
import java.awt.List; import java.io.ByteArrayInputStream; import java.io.IOException; import java.io.InputStream; import java.io.PrintWriter; import java.math.BigDecimal; import java.math.BigInteger; import java.util.ArrayDeque; import java.util.ArrayList; import java.util.Arrays; import java.util.BitSet; import java....
Java
["4\nxzzwo\nzwoxz\nzzwox\nxzzwo", "2\nmolzv\nlzvmo", "3\nkc\nkc\nkc", "3\naa\naa\nab"]
2 seconds
["5", "2", "0", "-1"]
NoteIn the first sample testcase the optimal scenario is to perform operations in such a way as to transform all strings into "zwoxz".
Java 8
standard input
[ "dp", "brute force", "strings" ]
a3a7515219ebb0154218ee3520e20d75
The first line contains integer n (1 ≤ n ≤ 50) — the number of strings. This is followed by n lines which contain a string each. The i-th line corresponding to string si. Lengths of strings are equal. Lengths of each string is positive and don't exceed 50.
1,300
Print the minimal number of moves Mike needs in order to make all the strings equal or print  - 1 if there is no solution.
standard output
PASSED
f0d165df79d945012f2f65ab14d1cd54
train_002.jsonl
1492785300
Mike has n strings s1, s2, ..., sn each consisting of lowercase English letters. In one move he can choose a string si, erase the first character and append it to the end of the string. For example, if he has the string "coolmike", in one move he can transform it into the string "oolmikec".Now Mike asks himself: what i...
256 megabytes
import java.util.HashMap; import java.util.HashSet; import java.util.Scanner; public class Mikeandstrings { public static void main(String args[]) { Scanner scan = new Scanner(System.in); int t = scan.nextInt(); HashMap<String, Integer> h = new HashMap<String, Integer>(); String s...
Java
["4\nxzzwo\nzwoxz\nzzwox\nxzzwo", "2\nmolzv\nlzvmo", "3\nkc\nkc\nkc", "3\naa\naa\nab"]
2 seconds
["5", "2", "0", "-1"]
NoteIn the first sample testcase the optimal scenario is to perform operations in such a way as to transform all strings into "zwoxz".
Java 8
standard input
[ "dp", "brute force", "strings" ]
a3a7515219ebb0154218ee3520e20d75
The first line contains integer n (1 ≤ n ≤ 50) — the number of strings. This is followed by n lines which contain a string each. The i-th line corresponding to string si. Lengths of strings are equal. Lengths of each string is positive and don't exceed 50.
1,300
Print the minimal number of moves Mike needs in order to make all the strings equal or print  - 1 if there is no solution.
standard output
PASSED
ca5126065dcba81a07c25a9755b6eecc
train_002.jsonl
1492785300
Mike has n strings s1, s2, ..., sn each consisting of lowercase English letters. In one move he can choose a string si, erase the first character and append it to the end of the string. For example, if he has the string "coolmike", in one move he can transform it into the string "oolmikec".Now Mike asks himself: what i...
256 megabytes
import java.util.Scanner; /** * Created by abgupta on 4/21/17. */ public class C_798_B { public static void main(String[] args) { Scanner in = new Scanner(System.in); int n = in.nextInt(); String[] s = new String[n]; for(int i=0;i<n;i++) { s[i] = in.next(); ...
Java
["4\nxzzwo\nzwoxz\nzzwox\nxzzwo", "2\nmolzv\nlzvmo", "3\nkc\nkc\nkc", "3\naa\naa\nab"]
2 seconds
["5", "2", "0", "-1"]
NoteIn the first sample testcase the optimal scenario is to perform operations in such a way as to transform all strings into "zwoxz".
Java 8
standard input
[ "dp", "brute force", "strings" ]
a3a7515219ebb0154218ee3520e20d75
The first line contains integer n (1 ≤ n ≤ 50) — the number of strings. This is followed by n lines which contain a string each. The i-th line corresponding to string si. Lengths of strings are equal. Lengths of each string is positive and don't exceed 50.
1,300
Print the minimal number of moves Mike needs in order to make all the strings equal or print  - 1 if there is no solution.
standard output
PASSED
5d1a3ca0dbb329a4fab2725738bdca9d
train_002.jsonl
1492785300
Mike has n strings s1, s2, ..., sn each consisting of lowercase English letters. In one move he can choose a string si, erase the first character and append it to the end of the string. For example, if he has the string "coolmike", in one move he can transform it into the string "oolmikec".Now Mike asks himself: what i...
256 megabytes
import java.util.Scanner; /** * Created by abgupta on 4/21/17. */ public class C_798_B { public static void main(String[] args) { Scanner in = new Scanner(System.in); int n = in.nextInt(); String[] s = new String[n]; for(int i=0;i<n;i++) { s[i] = in.next(); ...
Java
["4\nxzzwo\nzwoxz\nzzwox\nxzzwo", "2\nmolzv\nlzvmo", "3\nkc\nkc\nkc", "3\naa\naa\nab"]
2 seconds
["5", "2", "0", "-1"]
NoteIn the first sample testcase the optimal scenario is to perform operations in such a way as to transform all strings into "zwoxz".
Java 8
standard input
[ "dp", "brute force", "strings" ]
a3a7515219ebb0154218ee3520e20d75
The first line contains integer n (1 ≤ n ≤ 50) — the number of strings. This is followed by n lines which contain a string each. The i-th line corresponding to string si. Lengths of strings are equal. Lengths of each string is positive and don't exceed 50.
1,300
Print the minimal number of moves Mike needs in order to make all the strings equal or print  - 1 if there is no solution.
standard output
PASSED
e8f4232789dc04cfd9ff56bab9bcf64f
train_002.jsonl
1492785300
Mike has n strings s1, s2, ..., sn each consisting of lowercase English letters. In one move he can choose a string si, erase the first character and append it to the end of the string. For example, if he has the string "coolmike", in one move he can transform it into the string "oolmikec".Now Mike asks himself: what i...
256 megabytes
import java.io.OutputStream; import java.io.IOException; import java.io.InputStream; import java.io.PrintWriter; import java.util.StringTokenizer; import java.io.IOException; import java.io.BufferedReader; import java.io.InputStreamReader; import java.io.InputStream; /** * Built using CHelper plug-in * Actual soluti...
Java
["4\nxzzwo\nzwoxz\nzzwox\nxzzwo", "2\nmolzv\nlzvmo", "3\nkc\nkc\nkc", "3\naa\naa\nab"]
2 seconds
["5", "2", "0", "-1"]
NoteIn the first sample testcase the optimal scenario is to perform operations in such a way as to transform all strings into "zwoxz".
Java 8
standard input
[ "dp", "brute force", "strings" ]
a3a7515219ebb0154218ee3520e20d75
The first line contains integer n (1 ≤ n ≤ 50) — the number of strings. This is followed by n lines which contain a string each. The i-th line corresponding to string si. Lengths of strings are equal. Lengths of each string is positive and don't exceed 50.
1,300
Print the minimal number of moves Mike needs in order to make all the strings equal or print  - 1 if there is no solution.
standard output
PASSED
f57595e11d817c979e634d304b308e7f
train_002.jsonl
1492785300
Mike has n strings s1, s2, ..., sn each consisting of lowercase English letters. In one move he can choose a string si, erase the first character and append it to the end of the string. For example, if he has the string "coolmike", in one move he can transform it into the string "oolmikec".Now Mike asks himself: what i...
256 megabytes
import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; public class B410 { public static void main(String[] args)throws Exception{ int n = IO.nextInt(); if(n==1){IO.println(0);return;} String d[] = new String[51]; for(int i=1;i<=n;++i)d[i] = IO.nextString(); int size =...
Java
["4\nxzzwo\nzwoxz\nzzwox\nxzzwo", "2\nmolzv\nlzvmo", "3\nkc\nkc\nkc", "3\naa\naa\nab"]
2 seconds
["5", "2", "0", "-1"]
NoteIn the first sample testcase the optimal scenario is to perform operations in such a way as to transform all strings into "zwoxz".
Java 8
standard input
[ "dp", "brute force", "strings" ]
a3a7515219ebb0154218ee3520e20d75
The first line contains integer n (1 ≤ n ≤ 50) — the number of strings. This is followed by n lines which contain a string each. The i-th line corresponding to string si. Lengths of strings are equal. Lengths of each string is positive and don't exceed 50.
1,300
Print the minimal number of moves Mike needs in order to make all the strings equal or print  - 1 if there is no solution.
standard output
PASSED
3db08498740f33ed7d4e27839f54fd7b
train_002.jsonl
1492785300
Mike has n strings s1, s2, ..., sn each consisting of lowercase English letters. In one move he can choose a string si, erase the first character and append it to the end of the string. For example, if he has the string "coolmike", in one move he can transform it into the string "oolmikec".Now Mike asks himself: what i...
256 megabytes
import java.io.*; import java.util.*; public class Main { private static String rotString(String str,int i){ // System.out.println("sd"+i+"f"+str); String a=str.substring(0,i); String b=str.substring(i); return (b+a); } private static boolean check(String str1,String str2){ ...
Java
["4\nxzzwo\nzwoxz\nzzwox\nxzzwo", "2\nmolzv\nlzvmo", "3\nkc\nkc\nkc", "3\naa\naa\nab"]
2 seconds
["5", "2", "0", "-1"]
NoteIn the first sample testcase the optimal scenario is to perform operations in such a way as to transform all strings into "zwoxz".
Java 8
standard input
[ "dp", "brute force", "strings" ]
a3a7515219ebb0154218ee3520e20d75
The first line contains integer n (1 ≤ n ≤ 50) — the number of strings. This is followed by n lines which contain a string each. The i-th line corresponding to string si. Lengths of strings are equal. Lengths of each string is positive and don't exceed 50.
1,300
Print the minimal number of moves Mike needs in order to make all the strings equal or print  - 1 if there is no solution.
standard output
PASSED
2a1a46affb5a36cd074c1ab21609f685
train_002.jsonl
1492785300
Mike has n strings s1, s2, ..., sn each consisting of lowercase English letters. In one move he can choose a string si, erase the first character and append it to the end of the string. For example, if he has the string "coolmike", in one move he can transform it into the string "oolmikec".Now Mike asks himself: what i...
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); Solv...
Java
["4\nxzzwo\nzwoxz\nzzwox\nxzzwo", "2\nmolzv\nlzvmo", "3\nkc\nkc\nkc", "3\naa\naa\nab"]
2 seconds
["5", "2", "0", "-1"]
NoteIn the first sample testcase the optimal scenario is to perform operations in such a way as to transform all strings into "zwoxz".
Java 8
standard input
[ "dp", "brute force", "strings" ]
a3a7515219ebb0154218ee3520e20d75
The first line contains integer n (1 ≤ n ≤ 50) — the number of strings. This is followed by n lines which contain a string each. The i-th line corresponding to string si. Lengths of strings are equal. Lengths of each string is positive and don't exceed 50.
1,300
Print the minimal number of moves Mike needs in order to make all the strings equal or print  - 1 if there is no solution.
standard output
PASSED
21876351685334c9185c60b9dbdf8947
train_002.jsonl
1492785300
Mike has n strings s1, s2, ..., sn each consisting of lowercase English letters. In one move he can choose a string si, erase the first character and append it to the end of the string. For example, if he has the string "coolmike", in one move he can transform it into the string "oolmikec".Now Mike asks himself: what i...
256 megabytes
import java.util.Scanner; public class main { public static void main(String[] args) { // TODO Auto-generated method stub Scanner sc = new Scanner(System.in); while (sc.hasNextInt()) { int[][] count= new int[51][51]; String[] strings = new String[51]; in...
Java
["4\nxzzwo\nzwoxz\nzzwox\nxzzwo", "2\nmolzv\nlzvmo", "3\nkc\nkc\nkc", "3\naa\naa\nab"]
2 seconds
["5", "2", "0", "-1"]
NoteIn the first sample testcase the optimal scenario is to perform operations in such a way as to transform all strings into "zwoxz".
Java 8
standard input
[ "dp", "brute force", "strings" ]
a3a7515219ebb0154218ee3520e20d75
The first line contains integer n (1 ≤ n ≤ 50) — the number of strings. This is followed by n lines which contain a string each. The i-th line corresponding to string si. Lengths of strings are equal. Lengths of each string is positive and don't exceed 50.
1,300
Print the minimal number of moves Mike needs in order to make all the strings equal or print  - 1 if there is no solution.
standard output
PASSED
9ddffc2213451327963a0af05d20f831
train_002.jsonl
1492785300
Mike has n strings s1, s2, ..., sn each consisting of lowercase English letters. In one move he can choose a string si, erase the first character and append it to the end of the string. For example, if he has the string "coolmike", in one move he can transform it into the string "oolmikec".Now Mike asks himself: what i...
256 megabytes
/*package whatever //do not write package name here */ import java.io.*; import java.util.*; public class Main { public static int isRotation(String a, String b) { int nn = a.length(); // System.out.println(nn); int c=0; for(int i=0;i<nn;i++){ String vv = b.subs...
Java
["4\nxzzwo\nzwoxz\nzzwox\nxzzwo", "2\nmolzv\nlzvmo", "3\nkc\nkc\nkc", "3\naa\naa\nab"]
2 seconds
["5", "2", "0", "-1"]
NoteIn the first sample testcase the optimal scenario is to perform operations in such a way as to transform all strings into "zwoxz".
Java 8
standard input
[ "dp", "brute force", "strings" ]
a3a7515219ebb0154218ee3520e20d75
The first line contains integer n (1 ≤ n ≤ 50) — the number of strings. This is followed by n lines which contain a string each. The i-th line corresponding to string si. Lengths of strings are equal. Lengths of each string is positive and don't exceed 50.
1,300
Print the minimal number of moves Mike needs in order to make all the strings equal or print  - 1 if there is no solution.
standard output
PASSED
c31238c1427616cef58a455a78a74d2d
train_002.jsonl
1492785300
Mike has n strings s1, s2, ..., sn each consisting of lowercase English letters. In one move he can choose a string si, erase the first character and append it to the end of the string. For example, if he has the string "coolmike", in one move he can transform it into the string "oolmikec".Now Mike asks himself: what i...
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. */ //package springforth; import java.util.ArrayList; import java.util.Scanner; /** * * @author yabueh */ public class SpringForth { ...
Java
["4\nxzzwo\nzwoxz\nzzwox\nxzzwo", "2\nmolzv\nlzvmo", "3\nkc\nkc\nkc", "3\naa\naa\nab"]
2 seconds
["5", "2", "0", "-1"]
NoteIn the first sample testcase the optimal scenario is to perform operations in such a way as to transform all strings into "zwoxz".
Java 8
standard input
[ "dp", "brute force", "strings" ]
a3a7515219ebb0154218ee3520e20d75
The first line contains integer n (1 ≤ n ≤ 50) — the number of strings. This is followed by n lines which contain a string each. The i-th line corresponding to string si. Lengths of strings are equal. Lengths of each string is positive and don't exceed 50.
1,300
Print the minimal number of moves Mike needs in order to make all the strings equal or print  - 1 if there is no solution.
standard output
PASSED
66c065f780c3db9e3cc31232e7f3fc52
train_002.jsonl
1492785300
Mike has n strings s1, s2, ..., sn each consisting of lowercase English letters. In one move he can choose a string si, erase the first character and append it to the end of the string. For example, if he has the string "coolmike", in one move he can transform it into the string "oolmikec".Now Mike asks himself: what i...
256 megabytes
import java.io.*; import java.util.*; public class Problems2 { public static void main(String[] args) throws IOException { FastScanner sc=new FastScanner(System.in); int n=sc.nextInt(); String []a=new String[n]; String []a2=new String[n]; for(int i=0;i<n;i++)...
Java
["4\nxzzwo\nzwoxz\nzzwox\nxzzwo", "2\nmolzv\nlzvmo", "3\nkc\nkc\nkc", "3\naa\naa\nab"]
2 seconds
["5", "2", "0", "-1"]
NoteIn the first sample testcase the optimal scenario is to perform operations in such a way as to transform all strings into "zwoxz".
Java 8
standard input
[ "dp", "brute force", "strings" ]
a3a7515219ebb0154218ee3520e20d75
The first line contains integer n (1 ≤ n ≤ 50) — the number of strings. This is followed by n lines which contain a string each. The i-th line corresponding to string si. Lengths of strings are equal. Lengths of each string is positive and don't exceed 50.
1,300
Print the minimal number of moves Mike needs in order to make all the strings equal or print  - 1 if there is no solution.
standard output
PASSED
9c10f9a0e9455759ea0383fba3612ddb
train_002.jsonl
1492785300
Mike has n strings s1, s2, ..., sn each consisting of lowercase English letters. In one move he can choose a string si, erase the first character and append it to the end of the string. For example, if he has the string "coolmike", in one move he can transform it into the string "oolmikec".Now Mike asks himself: what i...
256 megabytes
import java.io.InputStreamReader; import java.io.BufferedReader; import java.io.IOException; import java.util.HashMap; public class B{ public static void main(String[]arg){ new B().read(); } HashMap<String, Integer> []dp; String[]ss; public void read(){ BufferedReader in = new BufferedReader(new InputStrea...
Java
["4\nxzzwo\nzwoxz\nzzwox\nxzzwo", "2\nmolzv\nlzvmo", "3\nkc\nkc\nkc", "3\naa\naa\nab"]
2 seconds
["5", "2", "0", "-1"]
NoteIn the first sample testcase the optimal scenario is to perform operations in such a way as to transform all strings into "zwoxz".
Java 8
standard input
[ "dp", "brute force", "strings" ]
a3a7515219ebb0154218ee3520e20d75
The first line contains integer n (1 ≤ n ≤ 50) — the number of strings. This is followed by n lines which contain a string each. The i-th line corresponding to string si. Lengths of strings are equal. Lengths of each string is positive and don't exceed 50.
1,300
Print the minimal number of moves Mike needs in order to make all the strings equal or print  - 1 if there is no solution.
standard output
PASSED
85ae1a8732c8854a69ac4f950736fc4c
train_002.jsonl
1492785300
Mike has n strings s1, s2, ..., sn each consisting of lowercase English letters. In one move he can choose a string si, erase the first character and append it to the end of the string. For example, if he has the string "coolmike", in one move he can transform it into the string "oolmikec".Now Mike asks himself: what i...
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.BigDecimal;...
Java
["4\nxzzwo\nzwoxz\nzzwox\nxzzwo", "2\nmolzv\nlzvmo", "3\nkc\nkc\nkc", "3\naa\naa\nab"]
2 seconds
["5", "2", "0", "-1"]
NoteIn the first sample testcase the optimal scenario is to perform operations in such a way as to transform all strings into "zwoxz".
Java 8
standard input
[ "dp", "brute force", "strings" ]
a3a7515219ebb0154218ee3520e20d75
The first line contains integer n (1 ≤ n ≤ 50) — the number of strings. This is followed by n lines which contain a string each. The i-th line corresponding to string si. Lengths of strings are equal. Lengths of each string is positive and don't exceed 50.
1,300
Print the minimal number of moves Mike needs in order to make all the strings equal or print  - 1 if there is no solution.
standard output
PASSED
c259929695a704192a8c3881acaef6d1
train_002.jsonl
1492785300
Mike has n strings s1, s2, ..., sn each consisting of lowercase English letters. In one move he can choose a string si, erase the first character and append it to the end of the string. For example, if he has the string "coolmike", in one move he can transform it into the string "oolmikec".Now Mike asks himself: what i...
256 megabytes
import java.io.*; import java.util.*; import java.math.*; public class _410div2Q2 { public static void main(String[] args) throws IOException { FastScanner obj = new FastScanner(); out = new PrintWriter(new BufferedOutputStream(System.out)); int n = obj.nextInt(); if(n==1)...
Java
["4\nxzzwo\nzwoxz\nzzwox\nxzzwo", "2\nmolzv\nlzvmo", "3\nkc\nkc\nkc", "3\naa\naa\nab"]
2 seconds
["5", "2", "0", "-1"]
NoteIn the first sample testcase the optimal scenario is to perform operations in such a way as to transform all strings into "zwoxz".
Java 8
standard input
[ "dp", "brute force", "strings" ]
a3a7515219ebb0154218ee3520e20d75
The first line contains integer n (1 ≤ n ≤ 50) — the number of strings. This is followed by n lines which contain a string each. The i-th line corresponding to string si. Lengths of strings are equal. Lengths of each string is positive and don't exceed 50.
1,300
Print the minimal number of moves Mike needs in order to make all the strings equal or print  - 1 if there is no solution.
standard output
PASSED
f010a44174e0b37de59c41fe234a5fdf
train_002.jsonl
1492785300
Mike has n strings s1, s2, ..., sn each consisting of lowercase English letters. In one move he can choose a string si, erase the first character and append it to the end of the string. For example, if he has the string "coolmike", in one move he can transform it into the string "oolmikec".Now Mike asks himself: what i...
256 megabytes
import java.util.*; import java.io.*; public class Test{ static BufferedReader sc=new BufferedReader(new InputStreamReader(System.in)); public static void main(String[] args)throws Exception { int t=Integer.valueOf(sc.readLine()); int z=1; String aide=sc.readLine(); int c=aide.length(); String S[][]=new St...
Java
["4\nxzzwo\nzwoxz\nzzwox\nxzzwo", "2\nmolzv\nlzvmo", "3\nkc\nkc\nkc", "3\naa\naa\nab"]
2 seconds
["5", "2", "0", "-1"]
NoteIn the first sample testcase the optimal scenario is to perform operations in such a way as to transform all strings into "zwoxz".
Java 8
standard input
[ "dp", "brute force", "strings" ]
a3a7515219ebb0154218ee3520e20d75
The first line contains integer n (1 ≤ n ≤ 50) — the number of strings. This is followed by n lines which contain a string each. The i-th line corresponding to string si. Lengths of strings are equal. Lengths of each string is positive and don't exceed 50.
1,300
Print the minimal number of moves Mike needs in order to make all the strings equal or print  - 1 if there is no solution.
standard output
PASSED
332d6db6db5ed07b86d10b49ab899d47
train_002.jsonl
1580826900
There are $$$n$$$ monsters standing in a row numbered from $$$1$$$ to $$$n$$$. The $$$i$$$-th monster has $$$h_i$$$ health points (hp). You have your attack power equal to $$$a$$$ hp and your opponent has his attack power equal to $$$b$$$ hp.You and your opponent are fighting these monsters. Firstly, you and your oppon...
256 megabytes
import java.util.ArrayList; import java.util.Collections; import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner scanner = new Scanner(System.in); int masters = scanner.nextInt(); int a = scanner.nextInt(); int b = scanner.nextInt(); i...
Java
["6 2 3 3\n7 10 50 12 1 8", "1 1 100 99\n100", "7 4 2 1\n1 3 5 4 2 7 6"]
1 second
["5", "1", "6"]
null
Java 8
standard input
[ "sortings", "greedy" ]
ada28bbbd92e0e7c6381bb9a4b56e7f9
The first line of the input contains four integers $$$n, a, b$$$ and $$$k$$$ ($$$1 \le n \le 2 \cdot 10^5, 1 \le a, b, k \le 10^9$$$) — the number of monsters, your attack power, the opponent's attack power and the number of times you can use the secret technique. The second line of the input contains $$$n$$$ integers ...
1,500
Print one integer — the maximum number of points you can gain if you use the secret technique optimally.
standard output
PASSED
9f01a7a947f0380d72b839733ca19a16
train_002.jsonl
1580826900
There are $$$n$$$ monsters standing in a row numbered from $$$1$$$ to $$$n$$$. The $$$i$$$-th monster has $$$h_i$$$ health points (hp). You have your attack power equal to $$$a$$$ hp and your opponent has his attack power equal to $$$b$$$ hp.You and your opponent are fighting these monsters. Firstly, you and your oppon...
256 megabytes
import java.util.*; import java.io.*; public class classs { static class pair implements Comparable<pair>{ int a;int b; public pair(int a, int b) { this.a=a; this.b=b; } public int compareTo(pair p){ return(a-p.a==0)?b-p.b:a-p.a; } public String toString () { ...
Java
["6 2 3 3\n7 10 50 12 1 8", "1 1 100 99\n100", "7 4 2 1\n1 3 5 4 2 7 6"]
1 second
["5", "1", "6"]
null
Java 8
standard input
[ "sortings", "greedy" ]
ada28bbbd92e0e7c6381bb9a4b56e7f9
The first line of the input contains four integers $$$n, a, b$$$ and $$$k$$$ ($$$1 \le n \le 2 \cdot 10^5, 1 \le a, b, k \le 10^9$$$) — the number of monsters, your attack power, the opponent's attack power and the number of times you can use the secret technique. The second line of the input contains $$$n$$$ integers ...
1,500
Print one integer — the maximum number of points you can gain if you use the secret technique optimally.
standard output
PASSED
e44ccbfd20f7d19acce7aec0f9d06516
train_002.jsonl
1580826900
There are $$$n$$$ monsters standing in a row numbered from $$$1$$$ to $$$n$$$. The $$$i$$$-th monster has $$$h_i$$$ health points (hp). You have your attack power equal to $$$a$$$ hp and your opponent has his attack power equal to $$$b$$$ hp.You and your opponent are fighting these monsters. Firstly, you and your oppon...
256 megabytes
import java.io.*; import java.util.*; public class CodeForces617D { public static void main (String[] args) throws IOException { BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); String[] str = br.readLine().split(" "); int n = Integer.valueOf(str[0]); int a =...
Java
["6 2 3 3\n7 10 50 12 1 8", "1 1 100 99\n100", "7 4 2 1\n1 3 5 4 2 7 6"]
1 second
["5", "1", "6"]
null
Java 8
standard input
[ "sortings", "greedy" ]
ada28bbbd92e0e7c6381bb9a4b56e7f9
The first line of the input contains four integers $$$n, a, b$$$ and $$$k$$$ ($$$1 \le n \le 2 \cdot 10^5, 1 \le a, b, k \le 10^9$$$) — the number of monsters, your attack power, the opponent's attack power and the number of times you can use the secret technique. The second line of the input contains $$$n$$$ integers ...
1,500
Print one integer — the maximum number of points you can gain if you use the secret technique optimally.
standard output
PASSED
e232349730e061e45382394f73fc6bec
train_002.jsonl
1580826900
There are $$$n$$$ monsters standing in a row numbered from $$$1$$$ to $$$n$$$. The $$$i$$$-th monster has $$$h_i$$$ health points (hp). You have your attack power equal to $$$a$$$ hp and your opponent has his attack power equal to $$$b$$$ hp.You and your opponent are fighting these monsters. Firstly, you and your oppon...
256 megabytes
//package com.codeforces.milindc; import java.io.BufferedReader; import java.io.DataInputStream; import java.io.FileInputStream; import java.io.IOException; import java.io.InputStreamReader; import java.util.ArrayList; //import java.util.Arrays; import java.util.Collections; import java.util.List; public class Fightw...
Java
["6 2 3 3\n7 10 50 12 1 8", "1 1 100 99\n100", "7 4 2 1\n1 3 5 4 2 7 6"]
1 second
["5", "1", "6"]
null
Java 8
standard input
[ "sortings", "greedy" ]
ada28bbbd92e0e7c6381bb9a4b56e7f9
The first line of the input contains four integers $$$n, a, b$$$ and $$$k$$$ ($$$1 \le n \le 2 \cdot 10^5, 1 \le a, b, k \le 10^9$$$) — the number of monsters, your attack power, the opponent's attack power and the number of times you can use the secret technique. The second line of the input contains $$$n$$$ integers ...
1,500
Print one integer — the maximum number of points you can gain if you use the secret technique optimally.
standard output
PASSED
a7269b3a62d79c42825f50ca2d6f7897
train_002.jsonl
1580826900
There are $$$n$$$ monsters standing in a row numbered from $$$1$$$ to $$$n$$$. The $$$i$$$-th monster has $$$h_i$$$ health points (hp). You have your attack power equal to $$$a$$$ hp and your opponent has his attack power equal to $$$b$$$ hp.You and your opponent are fighting these monsters. Firstly, you and your oppon...
256 megabytes
//package com.codeforces.milindc; import java.util.ArrayList; //import java.util.Arrays; import java.util.Collections; import java.util.List; import java.util.Scanner; public class FightwithMonsters { public static void main(String[] args) { Scanner s = new Scanner(System.in); int[] tokens = toInt(s.nextLine());...
Java
["6 2 3 3\n7 10 50 12 1 8", "1 1 100 99\n100", "7 4 2 1\n1 3 5 4 2 7 6"]
1 second
["5", "1", "6"]
null
Java 8
standard input
[ "sortings", "greedy" ]
ada28bbbd92e0e7c6381bb9a4b56e7f9
The first line of the input contains four integers $$$n, a, b$$$ and $$$k$$$ ($$$1 \le n \le 2 \cdot 10^5, 1 \le a, b, k \le 10^9$$$) — the number of monsters, your attack power, the opponent's attack power and the number of times you can use the secret technique. The second line of the input contains $$$n$$$ integers ...
1,500
Print one integer — the maximum number of points you can gain if you use the secret technique optimally.
standard output
PASSED
4924206df44869718a3bb0b86bc844d4
train_002.jsonl
1580826900
There are $$$n$$$ monsters standing in a row numbered from $$$1$$$ to $$$n$$$. The $$$i$$$-th monster has $$$h_i$$$ health points (hp). You have your attack power equal to $$$a$$$ hp and your opponent has his attack power equal to $$$b$$$ hp.You and your opponent are fighting these monsters. Firstly, you and your oppon...
256 megabytes
//package round617; import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; import java.util.PriorityQueue; public class Main { public static void main(String[] args) throws IOException { BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); ...
Java
["6 2 3 3\n7 10 50 12 1 8", "1 1 100 99\n100", "7 4 2 1\n1 3 5 4 2 7 6"]
1 second
["5", "1", "6"]
null
Java 8
standard input
[ "sortings", "greedy" ]
ada28bbbd92e0e7c6381bb9a4b56e7f9
The first line of the input contains four integers $$$n, a, b$$$ and $$$k$$$ ($$$1 \le n \le 2 \cdot 10^5, 1 \le a, b, k \le 10^9$$$) — the number of monsters, your attack power, the opponent's attack power and the number of times you can use the secret technique. The second line of the input contains $$$n$$$ integers ...
1,500
Print one integer — the maximum number of points you can gain if you use the secret technique optimally.
standard output
PASSED
03e67d81a582b3495442fb4092041c87
train_002.jsonl
1580826900
There are $$$n$$$ monsters standing in a row numbered from $$$1$$$ to $$$n$$$. The $$$i$$$-th monster has $$$h_i$$$ health points (hp). You have your attack power equal to $$$a$$$ hp and your opponent has his attack power equal to $$$b$$$ hp.You and your opponent are fighting these monsters. Firstly, you and your oppon...
256 megabytes
import java.io.BufferedReader; import java.io.InputStreamReader; import java.io.PrintWriter; import java.util.*; public class Main { final static long MOD = 1000000007; public static void main(String[] args) { FastScanner fs = new FastScanner(); PrintWriter out = new PrintWriter(System.out); ...
Java
["6 2 3 3\n7 10 50 12 1 8", "1 1 100 99\n100", "7 4 2 1\n1 3 5 4 2 7 6"]
1 second
["5", "1", "6"]
null
Java 8
standard input
[ "sortings", "greedy" ]
ada28bbbd92e0e7c6381bb9a4b56e7f9
The first line of the input contains four integers $$$n, a, b$$$ and $$$k$$$ ($$$1 \le n \le 2 \cdot 10^5, 1 \le a, b, k \le 10^9$$$) — the number of monsters, your attack power, the opponent's attack power and the number of times you can use the secret technique. The second line of the input contains $$$n$$$ integers ...
1,500
Print one integer — the maximum number of points you can gain if you use the secret technique optimally.
standard output
PASSED
6aab5a2b25f60ee9b979309bf25c9c29
train_002.jsonl
1580826900
There are $$$n$$$ monsters standing in a row numbered from $$$1$$$ to $$$n$$$. The $$$i$$$-th monster has $$$h_i$$$ health points (hp). You have your attack power equal to $$$a$$$ hp and your opponent has his attack power equal to $$$b$$$ hp.You and your opponent are fighting these monsters. Firstly, you and your oppon...
256 megabytes
import java.io.*; import java.math.*; import java.util.*; /** * * @author Saju * */ public class Main { private static int dx[] = { -2, -3, -2, -1, -1, 1}; private static int dy[] = { 1, -1, -1, -2, -3, -2}; private static final long INF = (long) (1e15); private static final int INT_INF = Integer.MAX_VALUE;...
Java
["6 2 3 3\n7 10 50 12 1 8", "1 1 100 99\n100", "7 4 2 1\n1 3 5 4 2 7 6"]
1 second
["5", "1", "6"]
null
Java 8
standard input
[ "sortings", "greedy" ]
ada28bbbd92e0e7c6381bb9a4b56e7f9
The first line of the input contains four integers $$$n, a, b$$$ and $$$k$$$ ($$$1 \le n \le 2 \cdot 10^5, 1 \le a, b, k \le 10^9$$$) — the number of monsters, your attack power, the opponent's attack power and the number of times you can use the secret technique. The second line of the input contains $$$n$$$ integers ...
1,500
Print one integer — the maximum number of points you can gain if you use the secret technique optimally.
standard output
PASSED
9f37e665b9d4824fe0570c52c91837da
train_002.jsonl
1580826900
There are $$$n$$$ monsters standing in a row numbered from $$$1$$$ to $$$n$$$. The $$$i$$$-th monster has $$$h_i$$$ health points (hp). You have your attack power equal to $$$a$$$ hp and your opponent has his attack power equal to $$$b$$$ hp.You and your opponent are fighting these monsters. Firstly, you and your oppon...
256 megabytes
import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; import java.io.PrintWriter; import java.util.ArrayList; import java.util.Collections; import java.util.Comparator; import java.util.List; import java.util.StringTokenizer; public class FightWithMonsters { // Template for CF ...
Java
["6 2 3 3\n7 10 50 12 1 8", "1 1 100 99\n100", "7 4 2 1\n1 3 5 4 2 7 6"]
1 second
["5", "1", "6"]
null
Java 8
standard input
[ "sortings", "greedy" ]
ada28bbbd92e0e7c6381bb9a4b56e7f9
The first line of the input contains four integers $$$n, a, b$$$ and $$$k$$$ ($$$1 \le n \le 2 \cdot 10^5, 1 \le a, b, k \le 10^9$$$) — the number of monsters, your attack power, the opponent's attack power and the number of times you can use the secret technique. The second line of the input contains $$$n$$$ integers ...
1,500
Print one integer — the maximum number of points you can gain if you use the secret technique optimally.
standard output
PASSED
4e81da6d3be726ed3e6750005885376d
train_002.jsonl
1580826900
There are $$$n$$$ monsters standing in a row numbered from $$$1$$$ to $$$n$$$. The $$$i$$$-th monster has $$$h_i$$$ health points (hp). You have your attack power equal to $$$a$$$ hp and your opponent has his attack power equal to $$$b$$$ hp.You and your opponent are fighting these monsters. Firstly, you and your oppon...
256 megabytes
import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; import java.util.Arrays; import java.util.HashMap; import java.util.Stack; public class Main { static int n, a, b, k; static Integer arr[], cont[]; public static void main(String[] args) throws IOException { ...
Java
["6 2 3 3\n7 10 50 12 1 8", "1 1 100 99\n100", "7 4 2 1\n1 3 5 4 2 7 6"]
1 second
["5", "1", "6"]
null
Java 8
standard input
[ "sortings", "greedy" ]
ada28bbbd92e0e7c6381bb9a4b56e7f9
The first line of the input contains four integers $$$n, a, b$$$ and $$$k$$$ ($$$1 \le n \le 2 \cdot 10^5, 1 \le a, b, k \le 10^9$$$) — the number of monsters, your attack power, the opponent's attack power and the number of times you can use the secret technique. The second line of the input contains $$$n$$$ integers ...
1,500
Print one integer — the maximum number of points you can gain if you use the secret technique optimally.
standard output
PASSED
4ed4c365432aee2f8d09be41f681e324
train_002.jsonl
1580826900
There are $$$n$$$ monsters standing in a row numbered from $$$1$$$ to $$$n$$$. The $$$i$$$-th monster has $$$h_i$$$ health points (hp). You have your attack power equal to $$$a$$$ hp and your opponent has his attack power equal to $$$b$$$ hp.You and your opponent are fighting these monsters. Firstly, you and your oppon...
256 megabytes
import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; import java.util.Arrays; import java.util.HashMap; import java.util.Stack; public class Main { static int n, a, b, k; static Integer arr[], cont[]; public static void main(String[] args) throws IOException { ...
Java
["6 2 3 3\n7 10 50 12 1 8", "1 1 100 99\n100", "7 4 2 1\n1 3 5 4 2 7 6"]
1 second
["5", "1", "6"]
null
Java 8
standard input
[ "sortings", "greedy" ]
ada28bbbd92e0e7c6381bb9a4b56e7f9
The first line of the input contains four integers $$$n, a, b$$$ and $$$k$$$ ($$$1 \le n \le 2 \cdot 10^5, 1 \le a, b, k \le 10^9$$$) — the number of monsters, your attack power, the opponent's attack power and the number of times you can use the secret technique. The second line of the input contains $$$n$$$ integers ...
1,500
Print one integer — the maximum number of points you can gain if you use the secret technique optimally.
standard output
PASSED
df1696f3090dc9daccdc0254ca7f63d7
train_002.jsonl
1580826900
There are $$$n$$$ monsters standing in a row numbered from $$$1$$$ to $$$n$$$. The $$$i$$$-th monster has $$$h_i$$$ health points (hp). You have your attack power equal to $$$a$$$ hp and your opponent has his attack power equal to $$$b$$$ hp.You and your opponent are fighting these monsters. Firstly, you and your oppon...
256 megabytes
import java.io.*; import java.lang.reflect.Array; import java.util.Arrays; import java.util.HashMap; import java.util.HashSet; import java.util.stream.Collectors; public class Main { static Long max = (long) (2 * 10E5); static BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); stati...
Java
["6 2 3 3\n7 10 50 12 1 8", "1 1 100 99\n100", "7 4 2 1\n1 3 5 4 2 7 6"]
1 second
["5", "1", "6"]
null
Java 8
standard input
[ "sortings", "greedy" ]
ada28bbbd92e0e7c6381bb9a4b56e7f9
The first line of the input contains four integers $$$n, a, b$$$ and $$$k$$$ ($$$1 \le n \le 2 \cdot 10^5, 1 \le a, b, k \le 10^9$$$) — the number of monsters, your attack power, the opponent's attack power and the number of times you can use the secret technique. The second line of the input contains $$$n$$$ integers ...
1,500
Print one integer — the maximum number of points you can gain if you use the secret technique optimally.
standard output
PASSED
2b0be9b100326ee45f919b0e8cd4acfd
train_002.jsonl
1580826900
There are $$$n$$$ monsters standing in a row numbered from $$$1$$$ to $$$n$$$. The $$$i$$$-th monster has $$$h_i$$$ health points (hp). You have your attack power equal to $$$a$$$ hp and your opponent has his attack power equal to $$$b$$$ hp.You and your opponent are fighting these monsters. Firstly, you and your oppon...
256 megabytes
import java.util.*; import java.lang.*; import java.io.*; public class d{ public static void main (String[] args) { PrintWriter pw=new PrintWriter(System.out); Scanner sc=new Scanner(System.in); int n=sc.nextInt(); int a1=sc.next...
Java
["6 2 3 3\n7 10 50 12 1 8", "1 1 100 99\n100", "7 4 2 1\n1 3 5 4 2 7 6"]
1 second
["5", "1", "6"]
null
Java 8
standard input
[ "sortings", "greedy" ]
ada28bbbd92e0e7c6381bb9a4b56e7f9
The first line of the input contains four integers $$$n, a, b$$$ and $$$k$$$ ($$$1 \le n \le 2 \cdot 10^5, 1 \le a, b, k \le 10^9$$$) — the number of monsters, your attack power, the opponent's attack power and the number of times you can use the secret technique. The second line of the input contains $$$n$$$ integers ...
1,500
Print one integer — the maximum number of points you can gain if you use the secret technique optimally.
standard output
PASSED
a13fe93144200ac8f25857b89e42192d
train_002.jsonl
1580826900
There are $$$n$$$ monsters standing in a row numbered from $$$1$$$ to $$$n$$$. The $$$i$$$-th monster has $$$h_i$$$ health points (hp). You have your attack power equal to $$$a$$$ hp and your opponent has his attack power equal to $$$b$$$ hp.You and your opponent are fighting these monsters. Firstly, you and your oppon...
256 megabytes
import java.awt.Point; import java.io.*; import java.util.*; import java.math.BigInteger; public class D { static class Solver { MyReader mr = new MyReader(); public void solve() { int n = mr.nextInt(); int a = mr.nextInt(); int b= mr.nextInt(); int ...
Java
["6 2 3 3\n7 10 50 12 1 8", "1 1 100 99\n100", "7 4 2 1\n1 3 5 4 2 7 6"]
1 second
["5", "1", "6"]
null
Java 8
standard input
[ "sortings", "greedy" ]
ada28bbbd92e0e7c6381bb9a4b56e7f9
The first line of the input contains four integers $$$n, a, b$$$ and $$$k$$$ ($$$1 \le n \le 2 \cdot 10^5, 1 \le a, b, k \le 10^9$$$) — the number of monsters, your attack power, the opponent's attack power and the number of times you can use the secret technique. The second line of the input contains $$$n$$$ integers ...
1,500
Print one integer — the maximum number of points you can gain if you use the secret technique optimally.
standard output
PASSED
48621690c582992703f86588ee122dfe
train_002.jsonl
1580826900
There are $$$n$$$ monsters standing in a row numbered from $$$1$$$ to $$$n$$$. The $$$i$$$-th monster has $$$h_i$$$ health points (hp). You have your attack power equal to $$$a$$$ hp and your opponent has his attack power equal to $$$b$$$ hp.You and your opponent are fighting these monsters. Firstly, you and your oppon...
256 megabytes
import java.io.*; import java.util.*; public class Main { static PrintWriter pw; static int[] visit; static int max; static int[] arr; static void dfs(int i, int c) { visit[i-1]=c; max=Math.max(c, max); int lim=arr.length/i; for(int j=2; j<=lim; j++){ if(visit[...
Java
["6 2 3 3\n7 10 50 12 1 8", "1 1 100 99\n100", "7 4 2 1\n1 3 5 4 2 7 6"]
1 second
["5", "1", "6"]
null
Java 8
standard input
[ "sortings", "greedy" ]
ada28bbbd92e0e7c6381bb9a4b56e7f9
The first line of the input contains four integers $$$n, a, b$$$ and $$$k$$$ ($$$1 \le n \le 2 \cdot 10^5, 1 \le a, b, k \le 10^9$$$) — the number of monsters, your attack power, the opponent's attack power and the number of times you can use the secret technique. The second line of the input contains $$$n$$$ integers ...
1,500
Print one integer — the maximum number of points you can gain if you use the secret technique optimally.
standard output
PASSED
c6887a20f797f0c40bacd24b0268ba3a
train_002.jsonl
1580826900
There are $$$n$$$ monsters standing in a row numbered from $$$1$$$ to $$$n$$$. The $$$i$$$-th monster has $$$h_i$$$ health points (hp). You have your attack power equal to $$$a$$$ hp and your opponent has his attack power equal to $$$b$$$ hp.You and your opponent are fighting these monsters. Firstly, you and your oppon...
256 megabytes
import java.util.*; import java.io.*; public class Solution{ public static int[] nextArray(FastReader sc1, int n){ int[] arr = new int[n]; for(int i=0; i<n; i++){ arr[i] = sc1.nextInt(); } return arr; } public static void main(String[] args){ FastReader ...
Java
["6 2 3 3\n7 10 50 12 1 8", "1 1 100 99\n100", "7 4 2 1\n1 3 5 4 2 7 6"]
1 second
["5", "1", "6"]
null
Java 8
standard input
[ "sortings", "greedy" ]
ada28bbbd92e0e7c6381bb9a4b56e7f9
The first line of the input contains four integers $$$n, a, b$$$ and $$$k$$$ ($$$1 \le n \le 2 \cdot 10^5, 1 \le a, b, k \le 10^9$$$) — the number of monsters, your attack power, the opponent's attack power and the number of times you can use the secret technique. The second line of the input contains $$$n$$$ integers ...
1,500
Print one integer — the maximum number of points you can gain if you use the secret technique optimally.
standard output
PASSED
73ae844462d0922ee45df72eb4dff924
train_002.jsonl
1580826900
There are $$$n$$$ monsters standing in a row numbered from $$$1$$$ to $$$n$$$. The $$$i$$$-th monster has $$$h_i$$$ health points (hp). You have your attack power equal to $$$a$$$ hp and your opponent has his attack power equal to $$$b$$$ hp.You and your opponent are fighting these monsters. Firstly, you and your oppon...
256 megabytes
import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; import java.io.PrintWriter; import java.util.Arrays; import java.util.PriorityQueue; public class Monster { public static void main(String[] args) throws IOException { ...
Java
["6 2 3 3\n7 10 50 12 1 8", "1 1 100 99\n100", "7 4 2 1\n1 3 5 4 2 7 6"]
1 second
["5", "1", "6"]
null
Java 8
standard input
[ "sortings", "greedy" ]
ada28bbbd92e0e7c6381bb9a4b56e7f9
The first line of the input contains four integers $$$n, a, b$$$ and $$$k$$$ ($$$1 \le n \le 2 \cdot 10^5, 1 \le a, b, k \le 10^9$$$) — the number of monsters, your attack power, the opponent's attack power and the number of times you can use the secret technique. The second line of the input contains $$$n$$$ integers ...
1,500
Print one integer — the maximum number of points you can gain if you use the secret technique optimally.
standard output
PASSED
0a2244ee375719f5ce341635368a3558
train_002.jsonl
1580826900
There are $$$n$$$ monsters standing in a row numbered from $$$1$$$ to $$$n$$$. The $$$i$$$-th monster has $$$h_i$$$ health points (hp). You have your attack power equal to $$$a$$$ hp and your opponent has his attack power equal to $$$b$$$ hp.You and your opponent are fighting these monsters. Firstly, you and your oppon...
256 megabytes
import java.util.ArrayList; import java.util.Arrays; import java.util.Collections; import java.util.Scanner; public class fightWithMonsters { public static void main(String args[]) { Scanner in = new Scanner(System.in); int n = in.nextInt(); long a = in.nextLong(); long b = in.nextLong(); long k = in.nextL...
Java
["6 2 3 3\n7 10 50 12 1 8", "1 1 100 99\n100", "7 4 2 1\n1 3 5 4 2 7 6"]
1 second
["5", "1", "6"]
null
Java 8
standard input
[ "sortings", "greedy" ]
ada28bbbd92e0e7c6381bb9a4b56e7f9
The first line of the input contains four integers $$$n, a, b$$$ and $$$k$$$ ($$$1 \le n \le 2 \cdot 10^5, 1 \le a, b, k \le 10^9$$$) — the number of monsters, your attack power, the opponent's attack power and the number of times you can use the secret technique. The second line of the input contains $$$n$$$ integers ...
1,500
Print one integer — the maximum number of points you can gain if you use the secret technique optimally.
standard output
PASSED
38908a3d331b8559c1b8253847017f0d
train_002.jsonl
1580826900
There are $$$n$$$ monsters standing in a row numbered from $$$1$$$ to $$$n$$$. The $$$i$$$-th monster has $$$h_i$$$ health points (hp). You have your attack power equal to $$$a$$$ hp and your opponent has his attack power equal to $$$b$$$ hp.You and your opponent are fighting these monsters. Firstly, you and your oppon...
256 megabytes
import java.io.BufferedReader; import java.io.InputStreamReader; import java.util.ArrayList; import java.util.Collections; import java.util.StringTokenizer; public class MonsterFight { public static void main(String args[]) throws Exception { BufferedReader br = new BufferedReader(new InputStreamReader(Sys...
Java
["6 2 3 3\n7 10 50 12 1 8", "1 1 100 99\n100", "7 4 2 1\n1 3 5 4 2 7 6"]
1 second
["5", "1", "6"]
null
Java 8
standard input
[ "sortings", "greedy" ]
ada28bbbd92e0e7c6381bb9a4b56e7f9
The first line of the input contains four integers $$$n, a, b$$$ and $$$k$$$ ($$$1 \le n \le 2 \cdot 10^5, 1 \le a, b, k \le 10^9$$$) — the number of monsters, your attack power, the opponent's attack power and the number of times you can use the secret technique. The second line of the input contains $$$n$$$ integers ...
1,500
Print one integer — the maximum number of points you can gain if you use the secret technique optimally.
standard output
PASSED
845efeb3c3635612b27dbfecd67d50e3
train_002.jsonl
1580826900
There are $$$n$$$ monsters standing in a row numbered from $$$1$$$ to $$$n$$$. The $$$i$$$-th monster has $$$h_i$$$ health points (hp). You have your attack power equal to $$$a$$$ hp and your opponent has his attack power equal to $$$b$$$ hp.You and your opponent are fighting these monsters. Firstly, you and your oppon...
256 megabytes
import java.util.*; public class Main { public static void main(String[] args) { Scanner sc=new Scanner(System.in); int n=sc.nextInt(); int a=sc.nextInt(); int b=sc.nextInt(); int k=sc.nextInt(); int arr[]=new int[n]; int s[]=new int[n]; int ans=0; for(int i=0;i<n;i++)...
Java
["6 2 3 3\n7 10 50 12 1 8", "1 1 100 99\n100", "7 4 2 1\n1 3 5 4 2 7 6"]
1 second
["5", "1", "6"]
null
Java 8
standard input
[ "sortings", "greedy" ]
ada28bbbd92e0e7c6381bb9a4b56e7f9
The first line of the input contains four integers $$$n, a, b$$$ and $$$k$$$ ($$$1 \le n \le 2 \cdot 10^5, 1 \le a, b, k \le 10^9$$$) — the number of monsters, your attack power, the opponent's attack power and the number of times you can use the secret technique. The second line of the input contains $$$n$$$ integers ...
1,500
Print one integer — the maximum number of points you can gain if you use the secret technique optimally.
standard output
PASSED
fa83e7ad5a808b3f2a542e92723bd349
train_002.jsonl
1580826900
There are $$$n$$$ monsters standing in a row numbered from $$$1$$$ to $$$n$$$. The $$$i$$$-th monster has $$$h_i$$$ health points (hp). You have your attack power equal to $$$a$$$ hp and your opponent has his attack power equal to $$$b$$$ hp.You and your opponent are fighting these monsters. Firstly, you and your oppon...
256 megabytes
// Don't place your source in a package import java.util.*; import java.lang.*; import java.io.*; import java.math.*; // Please name your class Main public class Main { //static StreamTokenizer in = new StreamTokenizer(new BufferedReader(new InputStreamReader(System.in))); /*static int read() throws IOE...
Java
["6 2 3 3\n7 10 50 12 1 8", "1 1 100 99\n100", "7 4 2 1\n1 3 5 4 2 7 6"]
1 second
["5", "1", "6"]
null
Java 8
standard input
[ "sortings", "greedy" ]
ada28bbbd92e0e7c6381bb9a4b56e7f9
The first line of the input contains four integers $$$n, a, b$$$ and $$$k$$$ ($$$1 \le n \le 2 \cdot 10^5, 1 \le a, b, k \le 10^9$$$) — the number of monsters, your attack power, the opponent's attack power and the number of times you can use the secret technique. The second line of the input contains $$$n$$$ integers ...
1,500
Print one integer — the maximum number of points you can gain if you use the secret technique optimally.
standard output
PASSED
c150beddb30a87b78f3e0de1a4cf8bdf
train_002.jsonl
1580826900
There are $$$n$$$ monsters standing in a row numbered from $$$1$$$ to $$$n$$$. The $$$i$$$-th monster has $$$h_i$$$ health points (hp). You have your attack power equal to $$$a$$$ hp and your opponent has his attack power equal to $$$b$$$ hp.You and your opponent are fighting these monsters. Firstly, you and your oppon...
256 megabytes
import java.io.BufferedInputStream; import java.util.Arrays; import java.util.Scanner; public class demo01 { public static void main(String[] args) { Scanner sc=new Scanner(new BufferedInputStream(System.in)); int n=sc.nextInt(); long a=sc.nextLong(); long b=sc.nextLong(); /...
Java
["6 2 3 3\n7 10 50 12 1 8", "1 1 100 99\n100", "7 4 2 1\n1 3 5 4 2 7 6"]
1 second
["5", "1", "6"]
null
Java 8
standard input
[ "sortings", "greedy" ]
ada28bbbd92e0e7c6381bb9a4b56e7f9
The first line of the input contains four integers $$$n, a, b$$$ and $$$k$$$ ($$$1 \le n \le 2 \cdot 10^5, 1 \le a, b, k \le 10^9$$$) — the number of monsters, your attack power, the opponent's attack power and the number of times you can use the secret technique. The second line of the input contains $$$n$$$ integers ...
1,500
Print one integer — the maximum number of points you can gain if you use the secret technique optimally.
standard output
PASSED
2708854e35ce7fc310f64b46bcdd8855
train_002.jsonl
1580826900
There are $$$n$$$ monsters standing in a row numbered from $$$1$$$ to $$$n$$$. The $$$i$$$-th monster has $$$h_i$$$ health points (hp). You have your attack power equal to $$$a$$$ hp and your opponent has his attack power equal to $$$b$$$ hp.You and your opponent are fighting these monsters. Firstly, you and your oppon...
256 megabytes
import java.util.*; public class cf1296D { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int n = sc.nextInt(); long a = sc.nextLong(); long b = sc.nextLong(); long k = sc.nextLong(); long hp[] = new long [n]; for (int i = 0...
Java
["6 2 3 3\n7 10 50 12 1 8", "1 1 100 99\n100", "7 4 2 1\n1 3 5 4 2 7 6"]
1 second
["5", "1", "6"]
null
Java 8
standard input
[ "sortings", "greedy" ]
ada28bbbd92e0e7c6381bb9a4b56e7f9
The first line of the input contains four integers $$$n, a, b$$$ and $$$k$$$ ($$$1 \le n \le 2 \cdot 10^5, 1 \le a, b, k \le 10^9$$$) — the number of monsters, your attack power, the opponent's attack power and the number of times you can use the secret technique. The second line of the input contains $$$n$$$ integers ...
1,500
Print one integer — the maximum number of points you can gain if you use the secret technique optimally.
standard output
PASSED
8842634976682b07f811e08979f2e6be
train_002.jsonl
1580826900
There are $$$n$$$ monsters standing in a row numbered from $$$1$$$ to $$$n$$$. The $$$i$$$-th monster has $$$h_i$$$ health points (hp). You have your attack power equal to $$$a$$$ hp and your opponent has his attack power equal to $$$b$$$ hp.You and your opponent are fighting these monsters. Firstly, you and your oppon...
256 megabytes
import java.util.*; public class C617_PD { public static void main(String[] args) { // TODO Auto-generated method stub Scanner in = new Scanner(System.in); int n = in.nextInt(); int a = in.nextInt(); int b = in.nextInt(); int k = in.nextInt(); int[] arr = new int[n]; int count = 0; int[] d = new int...
Java
["6 2 3 3\n7 10 50 12 1 8", "1 1 100 99\n100", "7 4 2 1\n1 3 5 4 2 7 6"]
1 second
["5", "1", "6"]
null
Java 8
standard input
[ "sortings", "greedy" ]
ada28bbbd92e0e7c6381bb9a4b56e7f9
The first line of the input contains four integers $$$n, a, b$$$ and $$$k$$$ ($$$1 \le n \le 2 \cdot 10^5, 1 \le a, b, k \le 10^9$$$) — the number of monsters, your attack power, the opponent's attack power and the number of times you can use the secret technique. The second line of the input contains $$$n$$$ integers ...
1,500
Print one integer — the maximum number of points you can gain if you use the secret technique optimally.
standard output
PASSED
cd0cfa751567ec97cba095d419a22f64
train_002.jsonl
1580826900
There are $$$n$$$ monsters standing in a row numbered from $$$1$$$ to $$$n$$$. The $$$i$$$-th monster has $$$h_i$$$ health points (hp). You have your attack power equal to $$$a$$$ hp and your opponent has his attack power equal to $$$b$$$ hp.You and your opponent are fighting these monsters. Firstly, you and your oppon...
256 megabytes
// you can also use imports, for example: import java.util.*; import java.io.*; public class Solution { public static void main(String args[]) { Scanner in = new Scanner(new BufferedReader(new InputStreamReader(System.in))); int len = in.nextInt(), a = in.nextInt(), b = in.nextInt(), k = in.nextInt(); long di...
Java
["6 2 3 3\n7 10 50 12 1 8", "1 1 100 99\n100", "7 4 2 1\n1 3 5 4 2 7 6"]
1 second
["5", "1", "6"]
null
Java 8
standard input
[ "sortings", "greedy" ]
ada28bbbd92e0e7c6381bb9a4b56e7f9
The first line of the input contains four integers $$$n, a, b$$$ and $$$k$$$ ($$$1 \le n \le 2 \cdot 10^5, 1 \le a, b, k \le 10^9$$$) — the number of monsters, your attack power, the opponent's attack power and the number of times you can use the secret technique. The second line of the input contains $$$n$$$ integers ...
1,500
Print one integer — the maximum number of points you can gain if you use the secret technique optimally.
standard output
PASSED
a22f14127058465d78b5d52a7c3aea57
train_002.jsonl
1580826900
There are $$$n$$$ monsters standing in a row numbered from $$$1$$$ to $$$n$$$. The $$$i$$$-th monster has $$$h_i$$$ health points (hp). You have your attack power equal to $$$a$$$ hp and your opponent has his attack power equal to $$$b$$$ hp.You and your opponent are fighting these monsters. Firstly, you and your oppon...
256 megabytes
import java.awt.*; import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; import java.io.PrintWriter; import java.math.BigInteger; import java.util.*; import java.util.List; public class Main { static int mod = (int) 1e9 + 7; public static void main(String[] args) { ...
Java
["6 2 3 3\n7 10 50 12 1 8", "1 1 100 99\n100", "7 4 2 1\n1 3 5 4 2 7 6"]
1 second
["5", "1", "6"]
null
Java 8
standard input
[ "sortings", "greedy" ]
ada28bbbd92e0e7c6381bb9a4b56e7f9
The first line of the input contains four integers $$$n, a, b$$$ and $$$k$$$ ($$$1 \le n \le 2 \cdot 10^5, 1 \le a, b, k \le 10^9$$$) — the number of monsters, your attack power, the opponent's attack power and the number of times you can use the secret technique. The second line of the input contains $$$n$$$ integers ...
1,500
Print one integer — the maximum number of points you can gain if you use the secret technique optimally.
standard output
PASSED
eb7649e23bb92bef5edb435cd9ca3d7b
train_002.jsonl
1580826900
There are $$$n$$$ monsters standing in a row numbered from $$$1$$$ to $$$n$$$. The $$$i$$$-th monster has $$$h_i$$$ health points (hp). You have your attack power equal to $$$a$$$ hp and your opponent has his attack power equal to $$$b$$$ hp.You and your opponent are fighting these monsters. Firstly, you and your oppon...
256 megabytes
import javax.print.attribute.standard.PrintQuality; import java.awt.*; import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; import java.io.PrintWriter; import java.math.BigInteger; import java.util.*; import java.util.List; public class Main { static int mod = (int) 1e9 + 7;...
Java
["6 2 3 3\n7 10 50 12 1 8", "1 1 100 99\n100", "7 4 2 1\n1 3 5 4 2 7 6"]
1 second
["5", "1", "6"]
null
Java 8
standard input
[ "sortings", "greedy" ]
ada28bbbd92e0e7c6381bb9a4b56e7f9
The first line of the input contains four integers $$$n, a, b$$$ and $$$k$$$ ($$$1 \le n \le 2 \cdot 10^5, 1 \le a, b, k \le 10^9$$$) — the number of monsters, your attack power, the opponent's attack power and the number of times you can use the secret technique. The second line of the input contains $$$n$$$ integers ...
1,500
Print one integer — the maximum number of points you can gain if you use the secret technique optimally.
standard output
PASSED
584c46b7fcdcead17e87680493f84458
train_002.jsonl
1580826900
There are $$$n$$$ monsters standing in a row numbered from $$$1$$$ to $$$n$$$. The $$$i$$$-th monster has $$$h_i$$$ health points (hp). You have your attack power equal to $$$a$$$ hp and your opponent has his attack power equal to $$$b$$$ hp.You and your opponent are fighting these monsters. Firstly, you and your oppon...
256 megabytes
import java.util.*; import java.io.*; public class Main{ public static void main(String[] args) throws IOException { OutputStream outputStream = System.out; InputStream inputStream = System.in; InputReader in = new InputReader(inputStream); OutputWriter out = new OutputWriter(output...
Java
["6 2 3 3\n7 10 50 12 1 8", "1 1 100 99\n100", "7 4 2 1\n1 3 5 4 2 7 6"]
1 second
["5", "1", "6"]
null
Java 8
standard input
[ "sortings", "greedy" ]
ada28bbbd92e0e7c6381bb9a4b56e7f9
The first line of the input contains four integers $$$n, a, b$$$ and $$$k$$$ ($$$1 \le n \le 2 \cdot 10^5, 1 \le a, b, k \le 10^9$$$) — the number of monsters, your attack power, the opponent's attack power and the number of times you can use the secret technique. The second line of the input contains $$$n$$$ integers ...
1,500
Print one integer — the maximum number of points you can gain if you use the secret technique optimally.
standard output
PASSED
e57f3b723393594065335a34ea7456fa
train_002.jsonl
1580826900
There are $$$n$$$ monsters standing in a row numbered from $$$1$$$ to $$$n$$$. The $$$i$$$-th monster has $$$h_i$$$ health points (hp). You have your attack power equal to $$$a$$$ hp and your opponent has his attack power equal to $$$b$$$ hp.You and your opponent are fighting these monsters. Firstly, you and your oppon...
256 megabytes
import java.util.*; public class codefor { public static void main(String args[]) { Scanner input = new Scanner(System.in); int n = input.nextInt(); int a = input.nextInt(); int b = input.nextInt(); int k = input.nextInt(); int arr[] = new int[n]; for(int i=0;i<n;i++) { arr[i] = input.nextInt(); } ...
Java
["6 2 3 3\n7 10 50 12 1 8", "1 1 100 99\n100", "7 4 2 1\n1 3 5 4 2 7 6"]
1 second
["5", "1", "6"]
null
Java 8
standard input
[ "sortings", "greedy" ]
ada28bbbd92e0e7c6381bb9a4b56e7f9
The first line of the input contains four integers $$$n, a, b$$$ and $$$k$$$ ($$$1 \le n \le 2 \cdot 10^5, 1 \le a, b, k \le 10^9$$$) — the number of monsters, your attack power, the opponent's attack power and the number of times you can use the secret technique. The second line of the input contains $$$n$$$ integers ...
1,500
Print one integer — the maximum number of points you can gain if you use the secret technique optimally.
standard output
PASSED
a57916ccfc674187da368d115874fbf4
train_002.jsonl
1580826900
There are $$$n$$$ monsters standing in a row numbered from $$$1$$$ to $$$n$$$. The $$$i$$$-th monster has $$$h_i$$$ health points (hp). You have your attack power equal to $$$a$$$ hp and your opponent has his attack power equal to $$$b$$$ hp.You and your opponent are fighting these monsters. Firstly, you and your oppon...
256 megabytes
import java.util.*; import java.io.*; public class Main{ public static void main(String[] args) throws Exception { BufferedReader br=new BufferedReader(new InputStreamReader(System.in)); String[] s=br.readLine().split(" "); int n=Integer.parseInt(s[0]); int a=Integer.parseInt(s[1...
Java
["6 2 3 3\n7 10 50 12 1 8", "1 1 100 99\n100", "7 4 2 1\n1 3 5 4 2 7 6"]
1 second
["5", "1", "6"]
null
Java 8
standard input
[ "sortings", "greedy" ]
ada28bbbd92e0e7c6381bb9a4b56e7f9
The first line of the input contains four integers $$$n, a, b$$$ and $$$k$$$ ($$$1 \le n \le 2 \cdot 10^5, 1 \le a, b, k \le 10^9$$$) — the number of monsters, your attack power, the opponent's attack power and the number of times you can use the secret technique. The second line of the input contains $$$n$$$ integers ...
1,500
Print one integer — the maximum number of points you can gain if you use the secret technique optimally.
standard output
PASSED
d571582e9321f21af9960fe672a12f62
train_002.jsonl
1580826900
There are $$$n$$$ monsters standing in a row numbered from $$$1$$$ to $$$n$$$. The $$$i$$$-th monster has $$$h_i$$$ health points (hp). You have your attack power equal to $$$a$$$ hp and your opponent has his attack power equal to $$$b$$$ hp.You and your opponent are fighting these monsters. Firstly, you and your oppon...
256 megabytes
import java.util.Arrays; import java.util.Scanner; public class qD { public static void main(String[] args) { Scanner in = new Scanner(System.in); int n = in.nextInt(); long a = in.nextLong(); long b = in.nextLong(); long k = in.nextLong(); long [...
Java
["6 2 3 3\n7 10 50 12 1 8", "1 1 100 99\n100", "7 4 2 1\n1 3 5 4 2 7 6"]
1 second
["5", "1", "6"]
null
Java 8
standard input
[ "sortings", "greedy" ]
ada28bbbd92e0e7c6381bb9a4b56e7f9
The first line of the input contains four integers $$$n, a, b$$$ and $$$k$$$ ($$$1 \le n \le 2 \cdot 10^5, 1 \le a, b, k \le 10^9$$$) — the number of monsters, your attack power, the opponent's attack power and the number of times you can use the secret technique. The second line of the input contains $$$n$$$ integers ...
1,500
Print one integer — the maximum number of points you can gain if you use the secret technique optimally.
standard output
PASSED
b34a74975a7357f8430dc41196c3fb99
train_002.jsonl
1580826900
There are $$$n$$$ monsters standing in a row numbered from $$$1$$$ to $$$n$$$. The $$$i$$$-th monster has $$$h_i$$$ health points (hp). You have your attack power equal to $$$a$$$ hp and your opponent has his attack power equal to $$$b$$$ hp.You and your opponent are fighting these monsters. Firstly, you and your oppon...
256 megabytes
//package power.rankings; import java.util.*; import java.io.*; public class PowerRankings { static BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); static StringTokenizer st; public static void main(String[] args) throws IOException { int n = readInt(), a = readInt(), b...
Java
["6 2 3 3\n7 10 50 12 1 8", "1 1 100 99\n100", "7 4 2 1\n1 3 5 4 2 7 6"]
1 second
["5", "1", "6"]
null
Java 8
standard input
[ "sortings", "greedy" ]
ada28bbbd92e0e7c6381bb9a4b56e7f9
The first line of the input contains four integers $$$n, a, b$$$ and $$$k$$$ ($$$1 \le n \le 2 \cdot 10^5, 1 \le a, b, k \le 10^9$$$) — the number of monsters, your attack power, the opponent's attack power and the number of times you can use the secret technique. The second line of the input contains $$$n$$$ integers ...
1,500
Print one integer — the maximum number of points you can gain if you use the secret technique optimally.
standard output
PASSED
20d6eb5cfd27a630cdc09dbbced5efd2
train_002.jsonl
1580826900
There are $$$n$$$ monsters standing in a row numbered from $$$1$$$ to $$$n$$$. The $$$i$$$-th monster has $$$h_i$$$ health points (hp). You have your attack power equal to $$$a$$$ hp and your opponent has his attack power equal to $$$b$$$ hp.You and your opponent are fighting these monsters. Firstly, you and your oppon...
256 megabytes
import java.io.*; import java.util.*; import java.math.*; import java.lang.*; import static java.lang.Math.*; public class MakingString implements Runnable { static class InputReader { private InputStream stream; private byte[] buf = new byte[1024]; private int curChar; pri...
Java
["6 2 3 3\n7 10 50 12 1 8", "1 1 100 99\n100", "7 4 2 1\n1 3 5 4 2 7 6"]
1 second
["5", "1", "6"]
null
Java 8
standard input
[ "sortings", "greedy" ]
ada28bbbd92e0e7c6381bb9a4b56e7f9
The first line of the input contains four integers $$$n, a, b$$$ and $$$k$$$ ($$$1 \le n \le 2 \cdot 10^5, 1 \le a, b, k \le 10^9$$$) — the number of monsters, your attack power, the opponent's attack power and the number of times you can use the secret technique. The second line of the input contains $$$n$$$ integers ...
1,500
Print one integer — the maximum number of points you can gain if you use the secret technique optimally.
standard output
PASSED
ac0b51fde94e5ddf7408ff7363a5698a
train_002.jsonl
1580826900
There are $$$n$$$ monsters standing in a row numbered from $$$1$$$ to $$$n$$$. The $$$i$$$-th monster has $$$h_i$$$ health points (hp). You have your attack power equal to $$$a$$$ hp and your opponent has his attack power equal to $$$b$$$ hp.You and your opponent are fighting these monsters. Firstly, you and your oppon...
256 megabytes
import java.io.*; import java.util.*; import java.math.*; import java.lang.*; import static java.lang.Math.*; public class MakingString implements Runnable { static class InputReader { private InputStream stream; private byte[] buf = new byte[1024]; private int curChar; pri...
Java
["6 2 3 3\n7 10 50 12 1 8", "1 1 100 99\n100", "7 4 2 1\n1 3 5 4 2 7 6"]
1 second
["5", "1", "6"]
null
Java 8
standard input
[ "sortings", "greedy" ]
ada28bbbd92e0e7c6381bb9a4b56e7f9
The first line of the input contains four integers $$$n, a, b$$$ and $$$k$$$ ($$$1 \le n \le 2 \cdot 10^5, 1 \le a, b, k \le 10^9$$$) — the number of monsters, your attack power, the opponent's attack power and the number of times you can use the secret technique. The second line of the input contains $$$n$$$ integers ...
1,500
Print one integer — the maximum number of points you can gain if you use the secret technique optimally.
standard output
PASSED
332400cb9e0a63fad0f8dd6c0bec5e66
train_002.jsonl
1580826900
There are $$$n$$$ monsters standing in a row numbered from $$$1$$$ to $$$n$$$. The $$$i$$$-th monster has $$$h_i$$$ health points (hp). You have your attack power equal to $$$a$$$ hp and your opponent has his attack power equal to $$$b$$$ hp.You and your opponent are fighting these monsters. Firstly, you and your oppon...
256 megabytes
import java.util.*; import java.io.*; public class FightwithMonsters { public static void main(String[] args)throws IOException { BufferedReader br=new BufferedReader(new InputStreamReader(System.in)); String[] str=br.readLine().split(" "); int n=Integer.parseInt(str[0]); int a=I...
Java
["6 2 3 3\n7 10 50 12 1 8", "1 1 100 99\n100", "7 4 2 1\n1 3 5 4 2 7 6"]
1 second
["5", "1", "6"]
null
Java 8
standard input
[ "sortings", "greedy" ]
ada28bbbd92e0e7c6381bb9a4b56e7f9
The first line of the input contains four integers $$$n, a, b$$$ and $$$k$$$ ($$$1 \le n \le 2 \cdot 10^5, 1 \le a, b, k \le 10^9$$$) — the number of monsters, your attack power, the opponent's attack power and the number of times you can use the secret technique. The second line of the input contains $$$n$$$ integers ...
1,500
Print one integer — the maximum number of points you can gain if you use the secret technique optimally.
standard output
PASSED
66735b566c0a06bf9887c5c710111cd5
train_002.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, well not so much 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(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
766a66169aecc3b5b7603db5c89244a3
train_002.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.InputStreamReader; import java.util.*; public class Main { public static void main(String[] args) { Scanner in = new Scanner(new BufferedReader(new InputStreamReader(System.in))); int n = in.nextInt(); int aX = 0, aY = 0; int bX = 0, bY...
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
a8085b0122ad81a8ce53490c601681ef
train_002.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.InputStream; import java.io.InputStreamReader; import java.io.PrintWriter; import java.util.Arrays; import java.util.StringTokenizer; import java.util.TreeMap; import java.util.TreeSet; public class Main { public static void main(String[] a...
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
b33af145317e88b7197c4505679c66a7
train_002.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 sc = new Scanner(System.in); int n = sc.nextInt(); int[] to=new int[2]; int[] from=new int[2]; for(int i = 0 ; i<n;i++){ int z = sc.nextInt()-1; to[z]+=sc.next...
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
ecbb4bf27b98f9788dd2e387de4099cd
train_002.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; /* * 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. */ /** * * @author Quan */ public class Main { /** * @param args the command line arguments ...
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
d9e24a266f439d6a54664540820477c9
train_002.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; /* * 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. */ /** * * @author anhnth37 */ public class A_0245 { public static void main(String[] args) { ...
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
1e564cd5fe6a2cfd044f7507e2da685d
train_002.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) { new A().begin(); } public void begin() { Scanner scanner = new Scanner(System.in); int n = scanner.nextInt(); int xa = 0, ya = 0; int xb = 0, yb = 0; for (int i = 1; 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
933b3148e3c6efab227e50f43aa44207
train_002.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
/****************************************************************************** Online Java Compiler. Code, Compile, Run and Debug java program online. Write your code in this editor and press "Run" button to execute it. ***************************************************...
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
443d443e4376e75fcd6ee6180bca4beb
train_002.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 main; import java.io.*; import java.util.*; import java.awt.Point; public final class Main { BufferedReader br; StringTokenizer stk; public static void main(String[] args) throws Exception { new Main().run(); } { stk = null; br = new BufferedReader(new Input...
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
24ff79fa2d28ce87d2a03a174fa5760d
train_002.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.OutputStream; import java.io.IOException; import java.io.InputStream; import java.io.PrintWriter; import java.util.Scanner; /** * Built using CHelper plug-in * Actual solution is at the top * * @author Bartikraw */ public class Main { public static void main(String[] args) { InputStream...
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
7037ddda824f1a01f526a18c5ff4de21
train_002.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 A { FastScanner in; PrintWriter out; void solve() { int n = in.nextInt(); int sa=0,fa=0,sb=0,fb=0; while(n-->0) { if(in.nextInt()==1) { sa+=in.nextInt(); fa+=in.nextInt(); }else { sb+=in.nextInt(); f...
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
8207337a84ee842a36b0d6fb4962c682
train_002.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 chapter { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int n = sc.nextInt(); int[][]a = new int[n][3]; for (int i = 0; i < n; i++) { for (int j = 0; j < 3; j++) { a[i][j] = 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
11c2cf02ca9ca05120ef9745b19966b0
train_002.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 codeforces; import java.util.Scanner; public class SystemAdministrator { public static void print(int pingX, int pingY) { if (pingX >= pingY) { System.out.println("LIVE"); } else System.out.println("DEAD"); } public static void main(String[] args) { Scanner scanner = new Scanner(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
e00ca96ac13a3e1d937ceec734a5a34c
train_002.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 Sample { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int n = sc.nextInt(); int cx = 0, ct = 0, dy = 0, dt = 0; while(n-- != 0) { int t = sc.nextInt(); int x = sc.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
27f8629f2fe5000fa3335df9dd93f275
train_002.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 { static StringBuilder data=new StringBuilder(); final static FastReader in = new FastReader(); public static void main(String[] args) { int n=in.nextInt(); String a; String []b; int sa=0,sb=0; for (int i = 0; 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
693e8957013a9b10801def600d12697f
train_002.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 Problem_245A { public static void main(String[] args){ Scanner in = new Scanner(System.in); int n = in.nextInt(); int gooda = 0; int bada = 0; int goodb = 0; int badb = 0; for(int i = 0; i < n; i++) { int t = in.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
e798238ac14875c24100c269e05979d4
train_002.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 sc=new Scanner(System.in); int n=sc.nextInt(); int a = 0,b = 0; while(n-->0) { int x = sc.nextInt(),g = sc.nextInt(),l = sc.nextInt(); if(x==1) { a+=g; a-=l; } else { b+=g; b-=l; } } if(a...
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
7c25b489121ab9ce42c7dbeec6b6dd6d
train_002.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 Servers { public static void main(String[] args) { // TODO Auto-generated method stub Scanner sc = new Scanner(System.in); int n = sc.nextInt(); int a = 0; int nota = 0; int b = 0; int notb = 0; for (int i = 0; i < n; i++) { int t = sc.nextInt(); int x = 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
5dbfc2cdcb405424a9351a812a4fbbf3
train_002.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.ArrayList; import java.util.Scanner; public class SystemAdministrator_245A { public static void main(String[] args) { Scanner input = new Scanner(System.in); int n = input.nextInt(); ArrayList<Integer> array = new ArrayList<Integer>(); for (int i = 0; i < n; i++) { int index = input.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
eb8ee47170425d84ebb0ca03560dd7f7
train_002.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 Codeforces { public static void main(String[] args) { Scanner in = new Scanner(System.in); int n = in.nextInt(); int[] sa = new int[2]; int[] sb = new int[2]; int s; for (int i=0;i<n;i++){ s = 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
fc76a5e1aacb17a213f966cdc40164ac
train_002.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.OutputStream; import java.io.IOException; import java.io.InputStream; import java.io.PrintWriter; import java.util.StringTokenizer; import java.io.IOException; import java.io.BufferedReader; import java.io.InputStreamReader; import java.io.InputStream; /** * Built using CHelper plug-in * Actual soluti...
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
60bbda7b6572f403d561db98b8c34a78
train_002.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 CodeForces { public static void main(String[] args) { Scanner input = new Scanner(System.in); int n = input.nextInt(); int a1 = 0; int a2 = 0; int b1 = 0; int b2 = 0; for (int i = 0; i < n; i++) { int t = input.nextInt(); if (t == 1) { a1 += input...
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
55dc3183cf231332c4aa2b09121c0b71
train_002.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.*; import java.math.*; import java.awt.geom.*; public class Test { public static void main(String[] args) { MyScanner sc = new MyScanner(); int n = sc.ni(); int apos = 0, aneg = 0, bpos = 0, bneg = 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
c0577857c4abf17e39bf95607ece0b6d
train_002.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 sc = new Scanner(System.in); int n = sc.nextInt(); int a = 0; int b = 0; for (int i = 0; i < n; i++) { int ping = sc.nextInt(); int success; int lost; if (ping == 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
4f9fb3964752731fbf8cc56b9dc657f8
train_002.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.lang.*;; import java.io.*; public class Codechef { public static void main (String[] args) { java.util.Scanner s=new java.util.Scanner(System.in); // int t=s.nextInt(); int n=s.nextInt(); int S1=0,T1=0,S2=0,T2=0; while(n-->0) { int t=s.nextInt(); int x=s.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
74e4f53bcd0a114ffd564a0004051b5e
train_002.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 Code245A { public static void main(String[] args) { Scanner sc=new Scanner(System.in); int s=sc.nextInt(); int a=0,b=0; for(int i=0;i<s;i++){ int l=sc.nextInt(); int m=sc.nextInt(); int n=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
acc1a0b177fee1bf680ed38d068cfdd2
train_002.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 sin = new Scanner(System.in); int bing = sin.nextInt(); int server, aCount = 0, bCount = 0, a = 0, b = 0, noth = 0; for(int i = 0; i < bing; 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
3aede3fce16fb23377aabe78493b4984
train_002.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 Codeforces { public static void main(String[] args) { Scanner scan = new Scanner(System.in); int n = scan.nextInt(); int totalA = 0, totalB = 0, packageA = 0, packageB = 0, t = 0, x = 0, y = 0; for (int i = 0 ;i< n ; i++) { t = scan.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
9b1333c546073347805c69b79f7db057
train_002.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 ASystemAdministrator { public static void main(String[] args) { Scanner sc=new Scanner(System.in); int n=sc.nextInt(); long sum=0,sum1=0,sum2=0,sum3=0; for(int i=0;i<n;i++) { int t=sc.nextInt(); int x=sc.nextInt(); int y=sc.nextInt(); if(t==1) { sum=sum+...
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
d0c10322375530cd9166699b21710fee
train_002.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 SystemniyAdministrator { public static void main(String[] args) { Scanner scanner = new Scanner(System.in); int n = scanner.nextInt(); int sumAok = 0; int sumAfail = 0; int sumBok = 0; int sumBfail = 0; for (int i = 0; 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
9c4005ba4368c3dd2ce0876e2d24c324
train_002.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 SystAdmin{ public static void main(String arg[]){ Scanner sc=new Scanner(System.in); int s=sc.nextInt(); int a=0,b=0; for(int i=0;i<s;i++){ int l=sc.nextInt(); int m=sc.nextInt(); int n=sc.nextInt(); if(l==1) a=a+(m-n); else b=b+(m-n); } if(a...
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
bee4c6548a92dddf9789b0a78e50532b
train_002.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 test2 { public static void main(String[] args) throws IOException { int numA=0; int sumAX=0; int sumBX=0; BufferedReader br = new BufferedRead...
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
c6a1393464e1d83cbe5ba6566ee9e6df
train_002.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.Scanner; public class Main { public static void main(String[] args) throws IOException { Scanner in = new Scanner(System.in); short n = in.nextShort(); byte t; short a = 0, b = 0; int suma = 0, sumb = 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
f73a10108503df54986419addf164df1
train_002.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 A0245_System { public static void main(String[] args) { Scanner scan = new Scanner(System.in); int n = scan.nextInt(); int counta = 0, suma = 0; int countb = 0, sumb = 0; for (int i = 0; i < n; i++) { int t = scan.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
7a10c5a01a238eb4bd5d6055f5c04dbf
train_002.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 in = new Scanner(System.in); StringBuilder sb = new StringBuilder(); int n = in.nextInt(); int x1=0,y1=0,x2=0,y2=0; while(n--!=0){ int s = in.nextInt(); if(...
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
c0ecd3cf8288acb2648638123abfac59
train_002.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 CF254A { public static void main(String[] args) throws Exception { BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); int n = Integer.parseInt(br.readLine()); int x1 = 0; int y1 = 0; int x2 = 0; int y2 = 0; while(n-- > 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
a3a94b57efad558749ab09c9708c5fe9
train_002.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.Stream; public class SystemAdministrator { public static void main(String[] args) { Scanner sc=new Scanner(System.in); int n=sc.nextInt(); sc.nextLine(); int ax=0,ay=0,bx=0,by=0; for (int i = 0; i < n; i++) { int[...
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
1c45237f84eebf4b5b34a386c540e10e
train_002.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 P245A { public static void main(String [] args) { Scanner in = new Scanner(System.in); int n = in.nextInt(); int [] results = new int[2]; for (int i = 0; i < n; i++) { int t = in.nextInt(); int x = 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
8fcaff9df0ceb81537e25381b7bdb42c
train_002.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 shapes { public static void main(String[]args) { Scanner a=new Scanner(System.in); int x=a.nextInt(); int[][]arr=new int[x][3]; for(int i=0;i<x;i++) { for(int j=0;j<3;j++) { arr[i][j]=a.nextInt(); } } int a1=0; int valid1=0; int b1=0; int valid2=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
d2d3482baf096837de372b4f0376b3b7
train_002.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 ax=0,ay=0,bx=0,by=0; for(int i=0;i<n;i++) { int server=sc.nextInt(); if(server==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
349cc257720d0de2ca5b540d81a4160a
train_002.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 { int N, A, B, x, y; void go(Scanner s) { N = s.nextInt(); while(N --> 0) { if(s.nextInt() == 1) { A += 10; x += s.nextInt(); s.next(); } else { B += 10; y += s.nextInt(); s.next(); } } System.out.println(2 * x >= A ? "LIVE" : "DEAD"); System.o...
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
a6490e97eead788dab0c39cb92a15495
train_002.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.util.Scanner; public class Solutions { public static void main(String[] args) throws IOException { Scanner sc = new Scanner(System.in); int n = sc.nextInt(); int xa = 0; int xb = 0; int cnta = 0; int cntb = 0; for (int i = 0; i < n; i++) { int 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
6bdb637e6da1f1d67e8a805064a6d1d1
train_002.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.*; public class Trans { public static void main(String[] args) throws IOException { BufferedReader bf = new BufferedReader(new InputStreamReader(System.in)); int n = Integer.parseInt(bf.readLine()); PrintWriter pw = new PrintWriter(new BufferedWriter(new OutputStreamWriter(Sys...
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
32107fd9c0372ba336690ded525bcd2d
train_002.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 SystemAdministrator{ public static void main(String[] args){ Scanner sc = new Scanner(System.in); int n = sc.nextInt(); int ra = 0; int rb = 0; int la = 0; int lb=0; for(int i =0;i<n;i++){ int count = 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
e24ae3b033d45198ac388fb517f73ec9
train_002.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.util.Scanner; public class jakb { public static void main(String[] args) throws IOException { Scanner scanner = new Scanner(System.in); int n=scanner.nextInt(); int [] aa=new int[2]; int counta=0; int countb=0; int [] bb=new 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
ecbdc2b41eef516e2bc70adffa87c392
train_002.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 Prog245A{ public static void main(String[] args){ Scanner sc=new Scanner(System.in); short n=sc.nextShort(); int ax=0; int bx=0; int ay=0; int by=0; for (short i=1;i<=n;i++){ int t=sc.nextInt(); if(t==1){ ax=ax+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
c12f6ad81658f6f0f37e71be6849463d
train_002.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.InputStream; import java.io.InputStreamReader; import java.io.PrintWriter; import java.util.ArrayList; import java.util.StringTokenizer; public class Abood2C { public static void main(String[] args) throws IOException { Scanner 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
5694130b15f9b585950bb5191d824552
train_002.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 SystemAdministrator{ public static void main(String[] args){ Scanner scan = new Scanner(System.in); int n = scan.nextInt(); double s1 = 0; double r1 = 0; double s2 = 0; double r2 = 0; for(int i=0; i<n; i++){ int s = scan.nextInt(); if(s==1){ s1 += scan.nextDoub...
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