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
8c1b6c6aaecf89f07f540b393002f8bf
train_000.jsonl
1298908800
The ship crashed into a reef and is sinking. Now the entire crew must be evacuated. All n crew members have already lined up in a row (for convenience let's label them all from left to right with positive integers from 1 to n) and await further instructions. However, one should evacuate the crew properly, in a strict o...
256 megabytes
import java.util.*; import java.lang.*; import java.math.*; import java.io.*; import static java.lang.Math.*; import static java.util.Arrays.*; import static java.util.Collections.*; public class P063A { Scanner sc = new Scanner(System.in); int INF = 1 << 28; double EPS = 1e-9; int n; P[] ps; void run() { ...
Java
["6\nJack captain\nAlice woman\nCharlie man\nTeddy rat\nBob child\nJulia woman"]
2 seconds
["Teddy\nAlice\nBob\nJulia\nCharlie\nJack"]
null
Java 6
standard input
[ "implementation", "sortings", "strings" ]
753113fa5130a67423f2e205c97f8017
The first line contains an integer n, which is the number of people in the crew (1 ≀ n ≀ 100). Then follow n lines. The i-th of those lines contains two words β€” the name of the crew member who is i-th in line, and his status on the ship. The words are separated by exactly one space. There are no other spaces in the lin...
900
Print n lines. The i-th of them should contain the name of the crew member who must be the i-th one to leave the ship.
standard output
PASSED
c84b862d62bef272611a19e257a89b80
train_000.jsonl
1298908800
The ship crashed into a reef and is sinking. Now the entire crew must be evacuated. All n crew members have already lined up in a row (for convenience let's label them all from left to right with positive integers from 1 to n) and await further instructions. However, one should evacuate the crew properly, in a strict o...
256 megabytes
import java.util.*; import java.lang.*; import java.math.*; import java.io.*; import static java.lang.Math.*; import static java.util.Arrays.*; import static java.util.Collections.*; // Sinking Ship // 2012/11/03 public class P063A{ Scanner sc=new Scanner(System.in); int n; P[] ps; void run(){ n=sc.nextInt(); ...
Java
["6\nJack captain\nAlice woman\nCharlie man\nTeddy rat\nBob child\nJulia woman"]
2 seconds
["Teddy\nAlice\nBob\nJulia\nCharlie\nJack"]
null
Java 6
standard input
[ "implementation", "sortings", "strings" ]
753113fa5130a67423f2e205c97f8017
The first line contains an integer n, which is the number of people in the crew (1 ≀ n ≀ 100). Then follow n lines. The i-th of those lines contains two words β€” the name of the crew member who is i-th in line, and his status on the ship. The words are separated by exactly one space. There are no other spaces in the lin...
900
Print n lines. The i-th of them should contain the name of the crew member who must be the i-th one to leave the ship.
standard output
PASSED
3314a2a9114773ea552ba5d8f06a969c
train_000.jsonl
1298908800
The ship crashed into a reef and is sinking. Now the entire crew must be evacuated. All n crew members have already lined up in a row (for convenience let's label them all from left to right with positive integers from 1 to n) and await further instructions. However, one should evacuate the crew properly, in a strict o...
256 megabytes
import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; import java.io.PrintWriter; import java.math.BigInteger; import java.util.ArrayList; import java.util.Arrays; import java.util.Comparator; import java.util.StringTokenizer; public class korablekrushenie implements Runnable { ...
Java
["6\nJack captain\nAlice woman\nCharlie man\nTeddy rat\nBob child\nJulia woman"]
2 seconds
["Teddy\nAlice\nBob\nJulia\nCharlie\nJack"]
null
Java 6
standard input
[ "implementation", "sortings", "strings" ]
753113fa5130a67423f2e205c97f8017
The first line contains an integer n, which is the number of people in the crew (1 ≀ n ≀ 100). Then follow n lines. The i-th of those lines contains two words β€” the name of the crew member who is i-th in line, and his status on the ship. The words are separated by exactly one space. There are no other spaces in the lin...
900
Print n lines. The i-th of them should contain the name of the crew member who must be the i-th one to leave the ship.
standard output
PASSED
b2715126ebfd4f34bd94ee77743307ac
train_000.jsonl
1298908800
The ship crashed into a reef and is sinking. Now the entire crew must be evacuated. All n crew members have already lined up in a row (for convenience let's label them all from left to right with positive integers from 1 to n) and await further instructions. However, one should evacuate the crew properly, in a strict o...
256 megabytes
import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner s=new Scanner(System.in); String [] str1 = new String [105]; String [] str2 = new String [105]; int n=s.nextInt(); s.nextLine(); for(int i=0;i<n;i++) { str1[i] = s.next(); str2[i] = s.next(); } for(i...
Java
["6\nJack captain\nAlice woman\nCharlie man\nTeddy rat\nBob child\nJulia woman"]
2 seconds
["Teddy\nAlice\nBob\nJulia\nCharlie\nJack"]
null
Java 6
standard input
[ "implementation", "sortings", "strings" ]
753113fa5130a67423f2e205c97f8017
The first line contains an integer n, which is the number of people in the crew (1 ≀ n ≀ 100). Then follow n lines. The i-th of those lines contains two words β€” the name of the crew member who is i-th in line, and his status on the ship. The words are separated by exactly one space. There are no other spaces in the lin...
900
Print n lines. The i-th of them should contain the name of the crew member who must be the i-th one to leave the ship.
standard output
PASSED
984ca6b32e70454dc00b283617ede0ee
train_000.jsonl
1298908800
The ship crashed into a reef and is sinking. Now the entire crew must be evacuated. All n crew members have already lined up in a row (for convenience let's label them all from left to right with positive integers from 1 to n) and await further instructions. However, one should evacuate the crew properly, in a strict o...
256 megabytes
import java.util.Scanner; /** * * @author madi */ public class Codeforces59C { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int n = Integer.parseInt(sc.nextLine()); String[][] a = new String[n][2]; for (int i = 0; i < n; i++) { Str...
Java
["6\nJack captain\nAlice woman\nCharlie man\nTeddy rat\nBob child\nJulia woman"]
2 seconds
["Teddy\nAlice\nBob\nJulia\nCharlie\nJack"]
null
Java 6
standard input
[ "implementation", "sortings", "strings" ]
753113fa5130a67423f2e205c97f8017
The first line contains an integer n, which is the number of people in the crew (1 ≀ n ≀ 100). Then follow n lines. The i-th of those lines contains two words β€” the name of the crew member who is i-th in line, and his status on the ship. The words are separated by exactly one space. There are no other spaces in the lin...
900
Print n lines. The i-th of them should contain the name of the crew member who must be the i-th one to leave the ship.
standard output
PASSED
4a8829469d79ad4f8d9b31ce3f0490bf
train_000.jsonl
1298908800
The ship crashed into a reef and is sinking. Now the entire crew must be evacuated. All n crew members have already lined up in a row (for convenience let's label them all from left to right with positive integers from 1 to n) and await further instructions. However, one should evacuate the crew properly, in a strict o...
256 megabytes
import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; public class one { public static void main(String[] args) throws IOException { BufferedReader buf = new BufferedReader( new InputStreamReader(System.in)); int n = Integer.parseInt(...
Java
["6\nJack captain\nAlice woman\nCharlie man\nTeddy rat\nBob child\nJulia woman"]
2 seconds
["Teddy\nAlice\nBob\nJulia\nCharlie\nJack"]
null
Java 6
standard input
[ "implementation", "sortings", "strings" ]
753113fa5130a67423f2e205c97f8017
The first line contains an integer n, which is the number of people in the crew (1 ≀ n ≀ 100). Then follow n lines. The i-th of those lines contains two words β€” the name of the crew member who is i-th in line, and his status on the ship. The words are separated by exactly one space. There are no other spaces in the lin...
900
Print n lines. The i-th of them should contain the name of the crew member who must be the i-th one to leave the ship.
standard output
PASSED
53617cc35c8e7d54a3f61d1b1ec15a16
train_000.jsonl
1298908800
The ship crashed into a reef and is sinking. Now the entire crew must be evacuated. All n crew members have already lined up in a row (for convenience let's label them all from left to right with positive integers from 1 to n) and await further instructions. However, one should evacuate the crew properly, in a strict o...
256 megabytes
import java.util.Scanner; public class Prob063A { public static void main( String[] Args ) { Scanner scan = new Scanner( System.in ); int x = scan.nextInt(); String[][] order = new String[4][100]; int[] num = new int[4]; for ( int a = 0; a < x; a++ ) { ...
Java
["6\nJack captain\nAlice woman\nCharlie man\nTeddy rat\nBob child\nJulia woman"]
2 seconds
["Teddy\nAlice\nBob\nJulia\nCharlie\nJack"]
null
Java 6
standard input
[ "implementation", "sortings", "strings" ]
753113fa5130a67423f2e205c97f8017
The first line contains an integer n, which is the number of people in the crew (1 ≀ n ≀ 100). Then follow n lines. The i-th of those lines contains two words β€” the name of the crew member who is i-th in line, and his status on the ship. The words are separated by exactly one space. There are no other spaces in the lin...
900
Print n lines. The i-th of them should contain the name of the crew member who must be the i-th one to leave the ship.
standard output
PASSED
2805f7db02bafce5b6439d7fe386f3e9
train_000.jsonl
1298908800
The ship crashed into a reef and is sinking. Now the entire crew must be evacuated. All n crew members have already lined up in a row (for convenience let's label them all from left to right with positive integers from 1 to n) and await further instructions. However, one should evacuate the crew properly, in a strict o...
256 megabytes
import java.util.Scanner; public class A63 { public static void main(String[] args) { Scanner in = new Scanner(System.in); int n = in.nextInt(), a[] = new int[n]; String s[] = new String[n]; for (int i = 0; i < n; i++) { s[i] = in.next(); String t = in.next(); if (t.compareTo("rat") == 0) a[i...
Java
["6\nJack captain\nAlice woman\nCharlie man\nTeddy rat\nBob child\nJulia woman"]
2 seconds
["Teddy\nAlice\nBob\nJulia\nCharlie\nJack"]
null
Java 6
standard input
[ "implementation", "sortings", "strings" ]
753113fa5130a67423f2e205c97f8017
The first line contains an integer n, which is the number of people in the crew (1 ≀ n ≀ 100). Then follow n lines. The i-th of those lines contains two words β€” the name of the crew member who is i-th in line, and his status on the ship. The words are separated by exactly one space. There are no other spaces in the lin...
900
Print n lines. The i-th of them should contain the name of the crew member who must be the i-th one to leave the ship.
standard output
PASSED
839b068d4b42c475e85f1b05aa2678c1
train_000.jsonl
1298908800
The ship crashed into a reef and is sinking. Now the entire crew must be evacuated. All n crew members have already lined up in a row (for convenience let's label them all from left to right with positive integers from 1 to n) and await further instructions. However, one should evacuate the crew properly, in a strict o...
256 megabytes
import java.util.Scanner; import java.util.Vector; public class Main { public static void main(String[] args) { Scanner in = new Scanner(System.in); int n = in.nextInt(); Vector<String> r = new Vector<String>(); Vector<String> w = new Vector<String>(); Vector<String> m = new Vector<Str...
Java
["6\nJack captain\nAlice woman\nCharlie man\nTeddy rat\nBob child\nJulia woman"]
2 seconds
["Teddy\nAlice\nBob\nJulia\nCharlie\nJack"]
null
Java 6
standard input
[ "implementation", "sortings", "strings" ]
753113fa5130a67423f2e205c97f8017
The first line contains an integer n, which is the number of people in the crew (1 ≀ n ≀ 100). Then follow n lines. The i-th of those lines contains two words β€” the name of the crew member who is i-th in line, and his status on the ship. The words are separated by exactly one space. There are no other spaces in the lin...
900
Print n lines. The i-th of them should contain the name of the crew member who must be the i-th one to leave the ship.
standard output
PASSED
c6d71973ab4b6a3f248727f500e5bc77
train_000.jsonl
1298908800
The ship crashed into a reef and is sinking. Now the entire crew must be evacuated. All n crew members have already lined up in a row (for convenience let's label them all from left to right with positive integers from 1 to n) and await further instructions. However, one should evacuate the crew properly, in a strict o...
256 megabytes
import java.io.*; import java.util.*; public class SinkingShip { private void solve() throws IOException { int n = nextInt(); LinkedList<String> Wo_ch = new LinkedList<String>(); LinkedList<String> man = new LinkedList<String>(); String captain = ""; for (int i = 0; i < n; i++) { String name = nextToken...
Java
["6\nJack captain\nAlice woman\nCharlie man\nTeddy rat\nBob child\nJulia woman"]
2 seconds
["Teddy\nAlice\nBob\nJulia\nCharlie\nJack"]
null
Java 6
standard input
[ "implementation", "sortings", "strings" ]
753113fa5130a67423f2e205c97f8017
The first line contains an integer n, which is the number of people in the crew (1 ≀ n ≀ 100). Then follow n lines. The i-th of those lines contains two words β€” the name of the crew member who is i-th in line, and his status on the ship. The words are separated by exactly one space. There are no other spaces in the lin...
900
Print n lines. The i-th of them should contain the name of the crew member who must be the i-th one to leave the ship.
standard output
PASSED
5839fb2166d53f60c03bd99904aa2d2f
train_000.jsonl
1298908800
The ship crashed into a reef and is sinking. Now the entire crew must be evacuated. All n crew members have already lined up in a row (for convenience let's label them all from left to right with positive integers from 1 to n) and await further instructions. However, one should evacuate the crew properly, in a strict o...
256 megabytes
import java.io.*; import java.math.*; import java.util.*; import java.util.List; import java.util.Queue; import java.awt.*; public class codefors implements Runnable { private BufferedReader br = null; private PrintWriter pw = null; private StringTokenizer stk = new StringTokenizer(""); public stati...
Java
["6\nJack captain\nAlice woman\nCharlie man\nTeddy rat\nBob child\nJulia woman"]
2 seconds
["Teddy\nAlice\nBob\nJulia\nCharlie\nJack"]
null
Java 6
standard input
[ "implementation", "sortings", "strings" ]
753113fa5130a67423f2e205c97f8017
The first line contains an integer n, which is the number of people in the crew (1 ≀ n ≀ 100). Then follow n lines. The i-th of those lines contains two words β€” the name of the crew member who is i-th in line, and his status on the ship. The words are separated by exactly one space. There are no other spaces in the lin...
900
Print n lines. The i-th of them should contain the name of the crew member who must be the i-th one to leave the ship.
standard output
PASSED
0a6074c38fb0dc58af860807851fe3e8
train_000.jsonl
1298908800
The ship crashed into a reef and is sinking. Now the entire crew must be evacuated. All n crew members have already lined up in a row (for convenience let's label them all from left to right with positive integers from 1 to n) and await further instructions. However, one should evacuate the crew properly, in a strict o...
256 megabytes
import java.io.*; import java.io.PrintWriter; import java.util.Arrays; import java.util.Scanner; public class cf2d59a { //PrintWriter out; public static void main(String[] args) throws IOException { //System.setIn(new FileInputStream("input.txt")); //System.setOut(new PrintStream("output.txt")); Buffe...
Java
["6\nJack captain\nAlice woman\nCharlie man\nTeddy rat\nBob child\nJulia woman"]
2 seconds
["Teddy\nAlice\nBob\nJulia\nCharlie\nJack"]
null
Java 6
standard input
[ "implementation", "sortings", "strings" ]
753113fa5130a67423f2e205c97f8017
The first line contains an integer n, which is the number of people in the crew (1 ≀ n ≀ 100). Then follow n lines. The i-th of those lines contains two words β€” the name of the crew member who is i-th in line, and his status on the ship. The words are separated by exactly one space. There are no other spaces in the lin...
900
Print n lines. The i-th of them should contain the name of the crew member who must be the i-th one to leave the ship.
standard output
PASSED
127a96916fdab291ff7b298a9e409b22
train_000.jsonl
1298908800
The ship crashed into a reef and is sinking. Now the entire crew must be evacuated. All n crew members have already lined up in a row (for convenience let's label them all from left to right with positive integers from 1 to n) and await further instructions. However, one should evacuate the crew properly, in a strict o...
256 megabytes
import java.io.*; import java.util.*; public class Test{ public static void main(String[] args) { Scanner in= new Scanner(System.in); ArrayList<String> rats = new ArrayList<String>(); ArrayList<String> other = new ArrayList<String>(); ArrayList<String> man = new ArrayList<String>...
Java
["6\nJack captain\nAlice woman\nCharlie man\nTeddy rat\nBob child\nJulia woman"]
2 seconds
["Teddy\nAlice\nBob\nJulia\nCharlie\nJack"]
null
Java 6
standard input
[ "implementation", "sortings", "strings" ]
753113fa5130a67423f2e205c97f8017
The first line contains an integer n, which is the number of people in the crew (1 ≀ n ≀ 100). Then follow n lines. The i-th of those lines contains two words β€” the name of the crew member who is i-th in line, and his status on the ship. The words are separated by exactly one space. There are no other spaces in the lin...
900
Print n lines. The i-th of them should contain the name of the crew member who must be the i-th one to leave the ship.
standard output
PASSED
807c4f79c532acb63e883b401619e77e
train_000.jsonl
1298908800
The ship crashed into a reef and is sinking. Now the entire crew must be evacuated. All n crew members have already lined up in a row (for convenience let's label them all from left to right with positive integers from 1 to n) and await further instructions. However, one should evacuate the crew properly, in a strict o...
256 megabytes
//package A; import java.io.*; import java.math.*; import java.util.*; public class Main { Scanner sc; int p(String str) { if (str.equals("rat")) { return 0; } if (str.equals("child")) { return 1; } if (str.equals("woman")) { return 1; } if (str.equals("man")) { return 2; } return 3; ...
Java
["6\nJack captain\nAlice woman\nCharlie man\nTeddy rat\nBob child\nJulia woman"]
2 seconds
["Teddy\nAlice\nBob\nJulia\nCharlie\nJack"]
null
Java 6
standard input
[ "implementation", "sortings", "strings" ]
753113fa5130a67423f2e205c97f8017
The first line contains an integer n, which is the number of people in the crew (1 ≀ n ≀ 100). Then follow n lines. The i-th of those lines contains two words β€” the name of the crew member who is i-th in line, and his status on the ship. The words are separated by exactly one space. There are no other spaces in the lin...
900
Print n lines. The i-th of them should contain the name of the crew member who must be the i-th one to leave the ship.
standard output
PASSED
15826b92f5fd256dcb64887d4893e83f
train_000.jsonl
1298908800
The ship crashed into a reef and is sinking. Now the entire crew must be evacuated. All n crew members have already lined up in a row (for convenience let's label them all from left to right with positive integers from 1 to n) and await further instructions. However, one should evacuate the crew properly, in a strict o...
256 megabytes
import java.io.BufferedInputStream; import java.util.ArrayList; import java.util.HashMap; import java.util.Scanner; public class _59A { public static void main(String[] args) { Scanner sc = new Scanner(new BufferedInputStream(System.in)); int n = sc.nextInt(); String[] m1 = new String[n]; String[] m2 ...
Java
["6\nJack captain\nAlice woman\nCharlie man\nTeddy rat\nBob child\nJulia woman"]
2 seconds
["Teddy\nAlice\nBob\nJulia\nCharlie\nJack"]
null
Java 6
standard input
[ "implementation", "sortings", "strings" ]
753113fa5130a67423f2e205c97f8017
The first line contains an integer n, which is the number of people in the crew (1 ≀ n ≀ 100). Then follow n lines. The i-th of those lines contains two words β€” the name of the crew member who is i-th in line, and his status on the ship. The words are separated by exactly one space. There are no other spaces in the lin...
900
Print n lines. The i-th of them should contain the name of the crew member who must be the i-th one to leave the ship.
standard output
PASSED
0420c046daf7a91886ad84518633d107
train_000.jsonl
1298908800
The ship crashed into a reef and is sinking. Now the entire crew must be evacuated. All n crew members have already lined up in a row (for convenience let's label them all from left to right with positive integers from 1 to n) and await further instructions. However, one should evacuate the crew properly, in a strict o...
256 megabytes
import java.io.BufferedReader; import java.io.InputStreamReader; import java.io.PrintWriter; import java.util.ArrayList; import java.util.Arrays; import java.util.Collections; import java.util.HashMap; import java.util.HashSet; import java.util.StringTokenizer; /* * To change this template, choose Tools | Templates ...
Java
["6\nJack captain\nAlice woman\nCharlie man\nTeddy rat\nBob child\nJulia woman"]
2 seconds
["Teddy\nAlice\nBob\nJulia\nCharlie\nJack"]
null
Java 6
standard input
[ "implementation", "sortings", "strings" ]
753113fa5130a67423f2e205c97f8017
The first line contains an integer n, which is the number of people in the crew (1 ≀ n ≀ 100). Then follow n lines. The i-th of those lines contains two words β€” the name of the crew member who is i-th in line, and his status on the ship. The words are separated by exactly one space. There are no other spaces in the lin...
900
Print n lines. The i-th of them should contain the name of the crew member who must be the i-th one to leave the ship.
standard output
PASSED
c79e2c8d23e07b5ce5402b9b0e19f902
train_000.jsonl
1298908800
The ship crashed into a reef and is sinking. Now the entire crew must be evacuated. All n crew members have already lined up in a row (for convenience let's label them all from left to right with positive integers from 1 to n) and await further instructions. However, one should evacuate the crew properly, in a strict o...
256 megabytes
import java.util.Scanner; import java.util.LinkedList; public class SinkingShip { public static class Member { String name; String status; public Member(String name, String status) { this.name = name; this.status = status; } } public static void main(String[] args) { int[] priority = {0, 1, 2,...
Java
["6\nJack captain\nAlice woman\nCharlie man\nTeddy rat\nBob child\nJulia woman"]
2 seconds
["Teddy\nAlice\nBob\nJulia\nCharlie\nJack"]
null
Java 6
standard input
[ "implementation", "sortings", "strings" ]
753113fa5130a67423f2e205c97f8017
The first line contains an integer n, which is the number of people in the crew (1 ≀ n ≀ 100). Then follow n lines. The i-th of those lines contains two words β€” the name of the crew member who is i-th in line, and his status on the ship. The words are separated by exactly one space. There are no other spaces in the lin...
900
Print n lines. The i-th of them should contain the name of the crew member who must be the i-th one to leave the ship.
standard output
PASSED
e85ccf1d3a83f51964263aff9d06c70f
train_000.jsonl
1298908800
The ship crashed into a reef and is sinking. Now the entire crew must be evacuated. All n crew members have already lined up in a row (for convenience let's label them all from left to right with positive integers from 1 to n) and await further instructions. However, one should evacuate the crew properly, in a strict o...
256 megabytes
import java.util.ArrayList; import java.util.Iterator; import java.util.List; import java.util.Scanner; /** * @author manu * */ public class SinkingShip { /** * @param args */ public static void main(String[] args) { Scanner in = new Scanner(System.in); String captain = null; ...
Java
["6\nJack captain\nAlice woman\nCharlie man\nTeddy rat\nBob child\nJulia woman"]
2 seconds
["Teddy\nAlice\nBob\nJulia\nCharlie\nJack"]
null
Java 6
standard input
[ "implementation", "sortings", "strings" ]
753113fa5130a67423f2e205c97f8017
The first line contains an integer n, which is the number of people in the crew (1 ≀ n ≀ 100). Then follow n lines. The i-th of those lines contains two words β€” the name of the crew member who is i-th in line, and his status on the ship. The words are separated by exactly one space. There are no other spaces in the lin...
900
Print n lines. The i-th of them should contain the name of the crew member who must be the i-th one to leave the ship.
standard output
PASSED
fa61805c236bdc2edee516e50d1a2f85
train_000.jsonl
1298908800
The ship crashed into a reef and is sinking. Now the entire crew must be evacuated. All n crew members have already lined up in a row (for convenience let's label them all from left to right with positive integers from 1 to n) and await further instructions. However, one should evacuate the crew properly, in a strict o...
256 megabytes
import java.util.ArrayList; import java.util.List; import java.util.Scanner; /** * @author manu * */ public class SinkingShip { /** * @param args */ public static void main(String[] args) { Scanner in = new Scanner(System.in); String captain = null; List<String> womanchild...
Java
["6\nJack captain\nAlice woman\nCharlie man\nTeddy rat\nBob child\nJulia woman"]
2 seconds
["Teddy\nAlice\nBob\nJulia\nCharlie\nJack"]
null
Java 6
standard input
[ "implementation", "sortings", "strings" ]
753113fa5130a67423f2e205c97f8017
The first line contains an integer n, which is the number of people in the crew (1 ≀ n ≀ 100). Then follow n lines. The i-th of those lines contains two words β€” the name of the crew member who is i-th in line, and his status on the ship. The words are separated by exactly one space. There are no other spaces in the lin...
900
Print n lines. The i-th of them should contain the name of the crew member who must be the i-th one to leave the ship.
standard output
PASSED
93d2a84b52dffa7b3c93f87bcf53c883
train_000.jsonl
1332860400
Let's dive into one of the most interesting areas of magic β€” writing spells. Learning this exciting but challenging science is very troublesome, so now you will not learn the magic words, but only get to know the basic rules of writing spells.Each spell consists of several lines. The line, whose first non-space charact...
256 megabytes
import java.io.BufferedReader; import java.io.FileReader; import java.io.FileWriter; import java.io.IOException; import java.io.InputStreamReader; import java.io.PrintWriter; import java.util.StringTokenizer; public class Solver { StringTokenizer st; BufferedReader in; PrintWriter out; public static ...
Java
["# include &lt;cstdio&gt;\n\nusing namespace std;\n\nint main ( ){\nputs(\"Hello # World\"); #\n#\n}", "#\n\n#"]
2 seconds
["# include &lt;cstdio&gt;\nusingnamespacestd;intmain(){puts(\"Hello#World\");#\n#\n}", "#\n\n#"]
NoteIn the first sample the amplifying lines are lines 1 and 7. So, lines 2 to 6 are concatenated to each other, all spaces are deleted from them.In the second sample the amplifying lines are lines 1 and 3. So, no lines are concatenated to each other.
Java 6
standard input
[ "implementation", "strings" ]
a16bb696858bc592c33dcf0fd99df197
The input contains multiple lines. All characters in the lines have codes from 32 to 127 (inclusive). Please note that the lines may begin with or end with one or more spaces. The size of the input does not exceed 1048576 ( = 220) bytes. Newlines are included in this size. In the Windows operating system used on the te...
1,700
Print the text of the spell where all extra characters are deleted. Please note that each output line should be followed by a newline. Please be careful: your answers will be validated by comparing them to the jury's answer byte-by-byte. So, all spaces and newlines matter.
standard output
PASSED
d6cac5af6f3c8bf3c15dcf5f972efeee
train_000.jsonl
1332860400
Let's dive into one of the most interesting areas of magic β€” writing spells. Learning this exciting but challenging science is very troublesome, so now you will not learn the magic words, but only get to know the basic rules of writing spells.Each spell consists of several lines. The line, whose first non-space charact...
256 megabytes
import java.io.*; import java.util.*; public class B { public void solve() throws IOException { boolean isOnline = false; while (true) { String s = reader.readLine(); if (s == null) { if (isOnline) writer.println(); break; } if (isAmplify(s)) { if (isOnline) writer.println(); isOnline...
Java
["# include &lt;cstdio&gt;\n\nusing namespace std;\n\nint main ( ){\nputs(\"Hello # World\"); #\n#\n}", "#\n\n#"]
2 seconds
["# include &lt;cstdio&gt;\nusingnamespacestd;intmain(){puts(\"Hello#World\");#\n#\n}", "#\n\n#"]
NoteIn the first sample the amplifying lines are lines 1 and 7. So, lines 2 to 6 are concatenated to each other, all spaces are deleted from them.In the second sample the amplifying lines are lines 1 and 3. So, no lines are concatenated to each other.
Java 6
standard input
[ "implementation", "strings" ]
a16bb696858bc592c33dcf0fd99df197
The input contains multiple lines. All characters in the lines have codes from 32 to 127 (inclusive). Please note that the lines may begin with or end with one or more spaces. The size of the input does not exceed 1048576 ( = 220) bytes. Newlines are included in this size. In the Windows operating system used on the te...
1,700
Print the text of the spell where all extra characters are deleted. Please note that each output line should be followed by a newline. Please be careful: your answers will be validated by comparing them to the jury's answer byte-by-byte. So, all spaces and newlines matter.
standard output
PASSED
b87b4bd7586905fd49fd23c7d188ea28
train_000.jsonl
1332860400
Let's dive into one of the most interesting areas of magic β€” writing spells. Learning this exciting but challenging science is very troublesome, so now you will not learn the magic words, but only get to know the basic rules of writing spells.Each spell consists of several lines. The line, whose first non-space charact...
256 megabytes
import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; import java.io.PrintWriter; public class Main { /** * @param args * @throws IOException */ public static void main(String[] args) throws IOException { // TODO Auto-generated method stub ...
Java
["# include &lt;cstdio&gt;\n\nusing namespace std;\n\nint main ( ){\nputs(\"Hello # World\"); #\n#\n}", "#\n\n#"]
2 seconds
["# include &lt;cstdio&gt;\nusingnamespacestd;intmain(){puts(\"Hello#World\");#\n#\n}", "#\n\n#"]
NoteIn the first sample the amplifying lines are lines 1 and 7. So, lines 2 to 6 are concatenated to each other, all spaces are deleted from them.In the second sample the amplifying lines are lines 1 and 3. So, no lines are concatenated to each other.
Java 6
standard input
[ "implementation", "strings" ]
a16bb696858bc592c33dcf0fd99df197
The input contains multiple lines. All characters in the lines have codes from 32 to 127 (inclusive). Please note that the lines may begin with or end with one or more spaces. The size of the input does not exceed 1048576 ( = 220) bytes. Newlines are included in this size. In the Windows operating system used on the te...
1,700
Print the text of the spell where all extra characters are deleted. Please note that each output line should be followed by a newline. Please be careful: your answers will be validated by comparing them to the jury's answer byte-by-byte. So, all spaces and newlines matter.
standard output
PASSED
be172335b6d42f2b2b8913c674ac6b5a
train_000.jsonl
1332860400
Let's dive into one of the most interesting areas of magic β€” writing spells. Learning this exciting but challenging science is very troublesome, so now you will not learn the magic words, but only get to know the basic rules of writing spells.Each spell consists of several lines. The line, whose first non-space charact...
256 megabytes
import java.awt.*; import java.awt.event.*; import java.awt.geom.*; import java.io.*; import java.math.*; import java.text.*; import java.util.*; /* br = new BufferedReader(new FileReader("input.txt")); pw = new PrintWriter(new BufferedWriter(new FileWriter("output.txt"))); br = new BufferedReader(new InputStreamRead...
Java
["# include &lt;cstdio&gt;\n\nusing namespace std;\n\nint main ( ){\nputs(\"Hello # World\"); #\n#\n}", "#\n\n#"]
2 seconds
["# include &lt;cstdio&gt;\nusingnamespacestd;intmain(){puts(\"Hello#World\");#\n#\n}", "#\n\n#"]
NoteIn the first sample the amplifying lines are lines 1 and 7. So, lines 2 to 6 are concatenated to each other, all spaces are deleted from them.In the second sample the amplifying lines are lines 1 and 3. So, no lines are concatenated to each other.
Java 6
standard input
[ "implementation", "strings" ]
a16bb696858bc592c33dcf0fd99df197
The input contains multiple lines. All characters in the lines have codes from 32 to 127 (inclusive). Please note that the lines may begin with or end with one or more spaces. The size of the input does not exceed 1048576 ( = 220) bytes. Newlines are included in this size. In the Windows operating system used on the te...
1,700
Print the text of the spell where all extra characters are deleted. Please note that each output line should be followed by a newline. Please be careful: your answers will be validated by comparing them to the jury's answer byte-by-byte. So, all spaces and newlines matter.
standard output
PASSED
1f2676b9106e4efaff9cad24104497bb
train_000.jsonl
1332860400
Let's dive into one of the most interesting areas of magic β€” writing spells. Learning this exciting but challenging science is very troublesome, so now you will not learn the magic words, but only get to know the basic rules of writing spells.Each spell consists of several lines. The line, whose first non-space charact...
256 megabytes
import java.util.Scanner; /** * Created by IntelliJ IDEA. * User: ΠœΠΈΡ…Π°ΠΈΠ» * Date: 27.03.12 * Time: 5:39 * To change this template use File | Settings | File Templates. */ public class Problem2 { public static void main(String [] args) { Scanner scanner = new Scanner(System.in); String buf = ...
Java
["# include &lt;cstdio&gt;\n\nusing namespace std;\n\nint main ( ){\nputs(\"Hello # World\"); #\n#\n}", "#\n\n#"]
2 seconds
["# include &lt;cstdio&gt;\nusingnamespacestd;intmain(){puts(\"Hello#World\");#\n#\n}", "#\n\n#"]
NoteIn the first sample the amplifying lines are lines 1 and 7. So, lines 2 to 6 are concatenated to each other, all spaces are deleted from them.In the second sample the amplifying lines are lines 1 and 3. So, no lines are concatenated to each other.
Java 6
standard input
[ "implementation", "strings" ]
a16bb696858bc592c33dcf0fd99df197
The input contains multiple lines. All characters in the lines have codes from 32 to 127 (inclusive). Please note that the lines may begin with or end with one or more spaces. The size of the input does not exceed 1048576 ( = 220) bytes. Newlines are included in this size. In the Windows operating system used on the te...
1,700
Print the text of the spell where all extra characters are deleted. Please note that each output line should be followed by a newline. Please be careful: your answers will be validated by comparing them to the jury's answer byte-by-byte. So, all spaces and newlines matter.
standard output
PASSED
2245dcd9cb551691b22c6ef8295ac3d9
train_000.jsonl
1332860400
Let's dive into one of the most interesting areas of magic β€” writing spells. Learning this exciting but challenging science is very troublesome, so now you will not learn the magic words, but only get to know the basic rules of writing spells.Each spell consists of several lines. The line, whose first non-space charact...
256 megabytes
import java.util.Scanner; public class Main { static String linea; static boolean ok; public static void main(String[] args) { Scanner l = new Scanner(System.in); ok=true; while (l.hasNextLine()) { linea=l.nextLine(); if(linea.trim().length()>0){ ...
Java
["# include &lt;cstdio&gt;\n\nusing namespace std;\n\nint main ( ){\nputs(\"Hello # World\"); #\n#\n}", "#\n\n#"]
2 seconds
["# include &lt;cstdio&gt;\nusingnamespacestd;intmain(){puts(\"Hello#World\");#\n#\n}", "#\n\n#"]
NoteIn the first sample the amplifying lines are lines 1 and 7. So, lines 2 to 6 are concatenated to each other, all spaces are deleted from them.In the second sample the amplifying lines are lines 1 and 3. So, no lines are concatenated to each other.
Java 6
standard input
[ "implementation", "strings" ]
a16bb696858bc592c33dcf0fd99df197
The input contains multiple lines. All characters in the lines have codes from 32 to 127 (inclusive). Please note that the lines may begin with or end with one or more spaces. The size of the input does not exceed 1048576 ( = 220) bytes. Newlines are included in this size. In the Windows operating system used on the te...
1,700
Print the text of the spell where all extra characters are deleted. Please note that each output line should be followed by a newline. Please be careful: your answers will be validated by comparing them to the jury's answer byte-by-byte. So, all spaces and newlines matter.
standard output
PASSED
cbf35c0ab3502902e62f37d50d14ee17
train_000.jsonl
1332860400
Let's dive into one of the most interesting areas of magic β€” writing spells. Learning this exciting but challenging science is very troublesome, so now you will not learn the magic words, but only get to know the basic rules of writing spells.Each spell consists of several lines. The line, whose first non-space charact...
256 megabytes
import java.util.*; import java.io.*; public class Main { static BufferedReader br; static Scanner sc; static PrintWriter pw; static int n, x, y; static boolean isPower(String s) { int i = 0; while(i < s.length() && s.charAt(i) == ' ') i++; if(s.indexOf('#') =...
Java
["# include &lt;cstdio&gt;\n\nusing namespace std;\n\nint main ( ){\nputs(\"Hello # World\"); #\n#\n}", "#\n\n#"]
2 seconds
["# include &lt;cstdio&gt;\nusingnamespacestd;intmain(){puts(\"Hello#World\");#\n#\n}", "#\n\n#"]
NoteIn the first sample the amplifying lines are lines 1 and 7. So, lines 2 to 6 are concatenated to each other, all spaces are deleted from them.In the second sample the amplifying lines are lines 1 and 3. So, no lines are concatenated to each other.
Java 6
standard input
[ "implementation", "strings" ]
a16bb696858bc592c33dcf0fd99df197
The input contains multiple lines. All characters in the lines have codes from 32 to 127 (inclusive). Please note that the lines may begin with or end with one or more spaces. The size of the input does not exceed 1048576 ( = 220) bytes. Newlines are included in this size. In the Windows operating system used on the te...
1,700
Print the text of the spell where all extra characters are deleted. Please note that each output line should be followed by a newline. Please be careful: your answers will be validated by comparing them to the jury's answer byte-by-byte. So, all spaces and newlines matter.
standard output
PASSED
2d14c25335629e9225d9b3e06eba7319
train_000.jsonl
1332860400
Let's dive into one of the most interesting areas of magic β€” writing spells. Learning this exciting but challenging science is very troublesome, so now you will not learn the magic words, but only get to know the basic rules of writing spells.Each spell consists of several lines. The line, whose first non-space charact...
256 megabytes
import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; import java.util.Scanner; public class CF114B { private void work() throws IOException { Scanner sc = new Scanner(new BufferedReader(new InputStreamReader( System.in))); boolean first = true; while (sc.hasNextLine(...
Java
["# include &lt;cstdio&gt;\n\nusing namespace std;\n\nint main ( ){\nputs(\"Hello # World\"); #\n#\n}", "#\n\n#"]
2 seconds
["# include &lt;cstdio&gt;\nusingnamespacestd;intmain(){puts(\"Hello#World\");#\n#\n}", "#\n\n#"]
NoteIn the first sample the amplifying lines are lines 1 and 7. So, lines 2 to 6 are concatenated to each other, all spaces are deleted from them.In the second sample the amplifying lines are lines 1 and 3. So, no lines are concatenated to each other.
Java 6
standard input
[ "implementation", "strings" ]
a16bb696858bc592c33dcf0fd99df197
The input contains multiple lines. All characters in the lines have codes from 32 to 127 (inclusive). Please note that the lines may begin with or end with one or more spaces. The size of the input does not exceed 1048576 ( = 220) bytes. Newlines are included in this size. In the Windows operating system used on the te...
1,700
Print the text of the spell where all extra characters are deleted. Please note that each output line should be followed by a newline. Please be careful: your answers will be validated by comparing them to the jury's answer byte-by-byte. So, all spaces and newlines matter.
standard output
PASSED
9ba9627c8564b8bed4e333f3e83e351b
train_000.jsonl
1332860400
Let's dive into one of the most interesting areas of magic β€” writing spells. Learning this exciting but challenging science is very troublesome, so now you will not learn the magic words, but only get to know the basic rules of writing spells.Each spell consists of several lines. The line, whose first non-space charact...
256 megabytes
import java.util.Scanner; public class B { public static void main(String[] args) { B problem = new B(); problem.solve(); } private void solve() { Scanner sc = new Scanner(System.in); StringBuilder o = new StringBuilder(); String i; boolean u ...
Java
["# include &lt;cstdio&gt;\n\nusing namespace std;\n\nint main ( ){\nputs(\"Hello # World\"); #\n#\n}", "#\n\n#"]
2 seconds
["# include &lt;cstdio&gt;\nusingnamespacestd;intmain(){puts(\"Hello#World\");#\n#\n}", "#\n\n#"]
NoteIn the first sample the amplifying lines are lines 1 and 7. So, lines 2 to 6 are concatenated to each other, all spaces are deleted from them.In the second sample the amplifying lines are lines 1 and 3. So, no lines are concatenated to each other.
Java 6
standard input
[ "implementation", "strings" ]
a16bb696858bc592c33dcf0fd99df197
The input contains multiple lines. All characters in the lines have codes from 32 to 127 (inclusive). Please note that the lines may begin with or end with one or more spaces. The size of the input does not exceed 1048576 ( = 220) bytes. Newlines are included in this size. In the Windows operating system used on the te...
1,700
Print the text of the spell where all extra characters are deleted. Please note that each output line should be followed by a newline. Please be careful: your answers will be validated by comparing them to the jury's answer byte-by-byte. So, all spaces and newlines matter.
standard output
PASSED
34f1df35342031205a55cfaaef02e68f
train_000.jsonl
1332860400
Let's dive into one of the most interesting areas of magic β€” writing spells. Learning this exciting but challenging science is very troublesome, so now you will not learn the magic words, but only get to know the basic rules of writing spells.Each spell consists of several lines. The line, whose first non-space charact...
256 megabytes
import java.io.BufferedReader; import java.io.FileReader; import java.io.IOException; import java.io.InputStreamReader; import java.io.PrintStream; import java.util.*; public class B { BufferedReader in; PrintStream out; StringTokenizer tok; public B() throws NumberFormatException, IOException { in = new Buffe...
Java
["# include &lt;cstdio&gt;\n\nusing namespace std;\n\nint main ( ){\nputs(\"Hello # World\"); #\n#\n}", "#\n\n#"]
2 seconds
["# include &lt;cstdio&gt;\nusingnamespacestd;intmain(){puts(\"Hello#World\");#\n#\n}", "#\n\n#"]
NoteIn the first sample the amplifying lines are lines 1 and 7. So, lines 2 to 6 are concatenated to each other, all spaces are deleted from them.In the second sample the amplifying lines are lines 1 and 3. So, no lines are concatenated to each other.
Java 6
standard input
[ "implementation", "strings" ]
a16bb696858bc592c33dcf0fd99df197
The input contains multiple lines. All characters in the lines have codes from 32 to 127 (inclusive). Please note that the lines may begin with or end with one or more spaces. The size of the input does not exceed 1048576 ( = 220) bytes. Newlines are included in this size. In the Windows operating system used on the te...
1,700
Print the text of the spell where all extra characters are deleted. Please note that each output line should be followed by a newline. Please be careful: your answers will be validated by comparing them to the jury's answer byte-by-byte. So, all spaces and newlines matter.
standard output
PASSED
534269cac752ed38c9560844969fd18d
train_000.jsonl
1332860400
Let's dive into one of the most interesting areas of magic β€” writing spells. Learning this exciting but challenging science is very troublesome, so now you will not learn the magic words, but only get to know the basic rules of writing spells.Each spell consists of several lines. The line, whose first non-space charact...
256 megabytes
import java.io.BufferedReader; import java.io.BufferedWriter; import java.io.IOException; import java.io.InputStreamReader; import java.io.OutputStreamWriter; import java.io.PrintWriter; import java.util.ArrayList; public class B { public static void main(String[] args) throws IOException{ BufferedReader...
Java
["# include &lt;cstdio&gt;\n\nusing namespace std;\n\nint main ( ){\nputs(\"Hello # World\"); #\n#\n}", "#\n\n#"]
2 seconds
["# include &lt;cstdio&gt;\nusingnamespacestd;intmain(){puts(\"Hello#World\");#\n#\n}", "#\n\n#"]
NoteIn the first sample the amplifying lines are lines 1 and 7. So, lines 2 to 6 are concatenated to each other, all spaces are deleted from them.In the second sample the amplifying lines are lines 1 and 3. So, no lines are concatenated to each other.
Java 6
standard input
[ "implementation", "strings" ]
a16bb696858bc592c33dcf0fd99df197
The input contains multiple lines. All characters in the lines have codes from 32 to 127 (inclusive). Please note that the lines may begin with or end with one or more spaces. The size of the input does not exceed 1048576 ( = 220) bytes. Newlines are included in this size. In the Windows operating system used on the te...
1,700
Print the text of the spell where all extra characters are deleted. Please note that each output line should be followed by a newline. Please be careful: your answers will be validated by comparing them to the jury's answer byte-by-byte. So, all spaces and newlines matter.
standard output
PASSED
1d50207e6ebac806fbbd3bbfa01bd7ab
train_000.jsonl
1332860400
Let's dive into one of the most interesting areas of magic β€” writing spells. Learning this exciting but challenging science is very troublesome, so now you will not learn the magic words, but only get to know the basic rules of writing spells.Each spell consists of several lines. The line, whose first non-space charact...
256 megabytes
import java.io.BufferedReader; import java.io.FileReader; import java.io.IOException; import java.io.InputStreamReader; import java.util.ArrayList; import java.util.Arrays; import java.util.Locale; import java.util.StringTokenizer; public class Main { static BufferedReader input; static StringTokenizer _stk;...
Java
["# include &lt;cstdio&gt;\n\nusing namespace std;\n\nint main ( ){\nputs(\"Hello # World\"); #\n#\n}", "#\n\n#"]
2 seconds
["# include &lt;cstdio&gt;\nusingnamespacestd;intmain(){puts(\"Hello#World\");#\n#\n}", "#\n\n#"]
NoteIn the first sample the amplifying lines are lines 1 and 7. So, lines 2 to 6 are concatenated to each other, all spaces are deleted from them.In the second sample the amplifying lines are lines 1 and 3. So, no lines are concatenated to each other.
Java 6
standard input
[ "implementation", "strings" ]
a16bb696858bc592c33dcf0fd99df197
The input contains multiple lines. All characters in the lines have codes from 32 to 127 (inclusive). Please note that the lines may begin with or end with one or more spaces. The size of the input does not exceed 1048576 ( = 220) bytes. Newlines are included in this size. In the Windows operating system used on the te...
1,700
Print the text of the spell where all extra characters are deleted. Please note that each output line should be followed by a newline. Please be careful: your answers will be validated by comparing them to the jury's answer byte-by-byte. So, all spaces and newlines matter.
standard output
PASSED
97121b45add579d70665925aa36b5173
train_000.jsonl
1332860400
Let's dive into one of the most interesting areas of magic β€” writing spells. Learning this exciting but challenging science is very troublesome, so now you will not learn the magic words, but only get to know the basic rules of writing spells.Each spell consists of several lines. The line, whose first non-space charact...
256 megabytes
import java.io.*; import java.util.*; import java.math.*; public class Main { BufferedReader br=new BufferedReader(new InputStreamReader(System.in)); StringTokenizer tokenizer=null; public static void main(String[] args) throws IOException { new Main().execute(); } void debug(Object...os) { System.out.p...
Java
["# include &lt;cstdio&gt;\n\nusing namespace std;\n\nint main ( ){\nputs(\"Hello # World\"); #\n#\n}", "#\n\n#"]
2 seconds
["# include &lt;cstdio&gt;\nusingnamespacestd;intmain(){puts(\"Hello#World\");#\n#\n}", "#\n\n#"]
NoteIn the first sample the amplifying lines are lines 1 and 7. So, lines 2 to 6 are concatenated to each other, all spaces are deleted from them.In the second sample the amplifying lines are lines 1 and 3. So, no lines are concatenated to each other.
Java 6
standard input
[ "implementation", "strings" ]
a16bb696858bc592c33dcf0fd99df197
The input contains multiple lines. All characters in the lines have codes from 32 to 127 (inclusive). Please note that the lines may begin with or end with one or more spaces. The size of the input does not exceed 1048576 ( = 220) bytes. Newlines are included in this size. In the Windows operating system used on the te...
1,700
Print the text of the spell where all extra characters are deleted. Please note that each output line should be followed by a newline. Please be careful: your answers will be validated by comparing them to the jury's answer byte-by-byte. So, all spaces and newlines matter.
standard output
PASSED
89db0dea17aea2f16f53e1200292444d
train_000.jsonl
1332860400
Let's dive into one of the most interesting areas of magic β€” writing spells. Learning this exciting but challenging science is very troublesome, so now you will not learn the magic words, but only get to know the basic rules of writing spells.Each spell consists of several lines. The line, whose first non-space charact...
256 megabytes
import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; import java.util.Scanner; import java.util.StringTokenizer; /** * * @author Tarek Gamal */ public class A { /** * @param args the command line arguments */ public static void main(String[] args) throws I...
Java
["# include &lt;cstdio&gt;\n\nusing namespace std;\n\nint main ( ){\nputs(\"Hello # World\"); #\n#\n}", "#\n\n#"]
2 seconds
["# include &lt;cstdio&gt;\nusingnamespacestd;intmain(){puts(\"Hello#World\");#\n#\n}", "#\n\n#"]
NoteIn the first sample the amplifying lines are lines 1 and 7. So, lines 2 to 6 are concatenated to each other, all spaces are deleted from them.In the second sample the amplifying lines are lines 1 and 3. So, no lines are concatenated to each other.
Java 6
standard input
[ "implementation", "strings" ]
a16bb696858bc592c33dcf0fd99df197
The input contains multiple lines. All characters in the lines have codes from 32 to 127 (inclusive). Please note that the lines may begin with or end with one or more spaces. The size of the input does not exceed 1048576 ( = 220) bytes. Newlines are included in this size. In the Windows operating system used on the te...
1,700
Print the text of the spell where all extra characters are deleted. Please note that each output line should be followed by a newline. Please be careful: your answers will be validated by comparing them to the jury's answer byte-by-byte. So, all spaces and newlines matter.
standard output
PASSED
07eafed7e778efaa5313bbc84966e103
train_000.jsonl
1332860400
Let's dive into one of the most interesting areas of magic β€” writing spells. Learning this exciting but challenging science is very troublesome, so now you will not learn the magic words, but only get to know the basic rules of writing spells.Each spell consists of several lines. The line, whose first non-space charact...
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.InputMismatchException; public class SolA { private static BufferedReader in; private static PrintWriter out; public static void main(String[] args)...
Java
["# include &lt;cstdio&gt;\n\nusing namespace std;\n\nint main ( ){\nputs(\"Hello # World\"); #\n#\n}", "#\n\n#"]
2 seconds
["# include &lt;cstdio&gt;\nusingnamespacestd;intmain(){puts(\"Hello#World\");#\n#\n}", "#\n\n#"]
NoteIn the first sample the amplifying lines are lines 1 and 7. So, lines 2 to 6 are concatenated to each other, all spaces are deleted from them.In the second sample the amplifying lines are lines 1 and 3. So, no lines are concatenated to each other.
Java 6
standard input
[ "implementation", "strings" ]
a16bb696858bc592c33dcf0fd99df197
The input contains multiple lines. All characters in the lines have codes from 32 to 127 (inclusive). Please note that the lines may begin with or end with one or more spaces. The size of the input does not exceed 1048576 ( = 220) bytes. Newlines are included in this size. In the Windows operating system used on the te...
1,700
Print the text of the spell where all extra characters are deleted. Please note that each output line should be followed by a newline. Please be careful: your answers will be validated by comparing them to the jury's answer byte-by-byte. So, all spaces and newlines matter.
standard output
PASSED
380cff3ed250f9035762da78a21c10a2
train_000.jsonl
1332860400
Let's dive into one of the most interesting areas of magic β€” writing spells. Learning this exciting but challenging science is very troublesome, so now you will not learn the magic words, but only get to know the basic rules of writing spells.Each spell consists of several lines. The line, whose first non-space charact...
256 megabytes
import java.io.*; import java.util.*; import java.math.BigInteger; public class B114 { public static void main(String args[])throws IOException { BufferedReader br=new BufferedReader(new InputStreamReader(System.in)); boolean prevamp=true; while(true) { String s=br.readLine(); if(s==null...
Java
["# include &lt;cstdio&gt;\n\nusing namespace std;\n\nint main ( ){\nputs(\"Hello # World\"); #\n#\n}", "#\n\n#"]
2 seconds
["# include &lt;cstdio&gt;\nusingnamespacestd;intmain(){puts(\"Hello#World\");#\n#\n}", "#\n\n#"]
NoteIn the first sample the amplifying lines are lines 1 and 7. So, lines 2 to 6 are concatenated to each other, all spaces are deleted from them.In the second sample the amplifying lines are lines 1 and 3. So, no lines are concatenated to each other.
Java 6
standard input
[ "implementation", "strings" ]
a16bb696858bc592c33dcf0fd99df197
The input contains multiple lines. All characters in the lines have codes from 32 to 127 (inclusive). Please note that the lines may begin with or end with one or more spaces. The size of the input does not exceed 1048576 ( = 220) bytes. Newlines are included in this size. In the Windows operating system used on the te...
1,700
Print the text of the spell where all extra characters are deleted. Please note that each output line should be followed by a newline. Please be careful: your answers will be validated by comparing them to the jury's answer byte-by-byte. So, all spaces and newlines matter.
standard output
PASSED
e3f9782757e487a656b28fff0dfa7f22
train_000.jsonl
1332860400
Let's dive into one of the most interesting areas of magic β€” writing spells. Learning this exciting but challenging science is very troublesome, so now you will not learn the magic words, but only get to know the basic rules of writing spells.Each spell consists of several lines. The line, whose first non-space charact...
256 megabytes
import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; import java.util.NoSuchElementException; import java.util.Scanner; import java.util.regex.Pattern; public class CF168B { public static void main(String[] args) throws IOException { BufferedReader br = new Buffere...
Java
["# include &lt;cstdio&gt;\n\nusing namespace std;\n\nint main ( ){\nputs(\"Hello # World\"); #\n#\n}", "#\n\n#"]
2 seconds
["# include &lt;cstdio&gt;\nusingnamespacestd;intmain(){puts(\"Hello#World\");#\n#\n}", "#\n\n#"]
NoteIn the first sample the amplifying lines are lines 1 and 7. So, lines 2 to 6 are concatenated to each other, all spaces are deleted from them.In the second sample the amplifying lines are lines 1 and 3. So, no lines are concatenated to each other.
Java 6
standard input
[ "implementation", "strings" ]
a16bb696858bc592c33dcf0fd99df197
The input contains multiple lines. All characters in the lines have codes from 32 to 127 (inclusive). Please note that the lines may begin with or end with one or more spaces. The size of the input does not exceed 1048576 ( = 220) bytes. Newlines are included in this size. In the Windows operating system used on the te...
1,700
Print the text of the spell where all extra characters are deleted. Please note that each output line should be followed by a newline. Please be careful: your answers will be validated by comparing them to the jury's answer byte-by-byte. So, all spaces and newlines matter.
standard output
PASSED
a768e4636940f8bb60aff0c377c9372e
train_000.jsonl
1332860400
Let's dive into one of the most interesting areas of magic β€” writing spells. Learning this exciting but challenging science is very troublesome, so now you will not learn the magic words, but only get to know the basic rules of writing spells.Each spell consists of several lines. The line, whose first non-space charact...
256 megabytes
import java.util.Scanner; import java.util.regex.Pattern; public class CF168B { public static void main(String[] args) { Scanner sc = new Scanner(System.in); Pattern isAmpPtn = Pattern.compile("^\\s*#"); Pattern spacePtn = Pattern.compile(" "); StringBuilder buf = new Str...
Java
["# include &lt;cstdio&gt;\n\nusing namespace std;\n\nint main ( ){\nputs(\"Hello # World\"); #\n#\n}", "#\n\n#"]
2 seconds
["# include &lt;cstdio&gt;\nusingnamespacestd;intmain(){puts(\"Hello#World\");#\n#\n}", "#\n\n#"]
NoteIn the first sample the amplifying lines are lines 1 and 7. So, lines 2 to 6 are concatenated to each other, all spaces are deleted from them.In the second sample the amplifying lines are lines 1 and 3. So, no lines are concatenated to each other.
Java 6
standard input
[ "implementation", "strings" ]
a16bb696858bc592c33dcf0fd99df197
The input contains multiple lines. All characters in the lines have codes from 32 to 127 (inclusive). Please note that the lines may begin with or end with one or more spaces. The size of the input does not exceed 1048576 ( = 220) bytes. Newlines are included in this size. In the Windows operating system used on the te...
1,700
Print the text of the spell where all extra characters are deleted. Please note that each output line should be followed by a newline. Please be careful: your answers will be validated by comparing them to the jury's answer byte-by-byte. So, all spaces and newlines matter.
standard output
PASSED
8ff6f369431b6d22e446d4b291243741
train_000.jsonl
1332860400
Let's dive into one of the most interesting areas of magic β€” writing spells. Learning this exciting but challenging science is very troublesome, so now you will not learn the magic words, but only get to know the basic rules of writing spells.Each spell consists of several lines. The line, whose first non-space charact...
256 megabytes
import java.io.BufferedReader; import java.io.InputStreamReader; import java.util.regex.Pattern; public class CF168B { public static void main(String[] args) throws Exception { BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); Pattern isAmpPtn = Pattern.compile("^...
Java
["# include &lt;cstdio&gt;\n\nusing namespace std;\n\nint main ( ){\nputs(\"Hello # World\"); #\n#\n}", "#\n\n#"]
2 seconds
["# include &lt;cstdio&gt;\nusingnamespacestd;intmain(){puts(\"Hello#World\");#\n#\n}", "#\n\n#"]
NoteIn the first sample the amplifying lines are lines 1 and 7. So, lines 2 to 6 are concatenated to each other, all spaces are deleted from them.In the second sample the amplifying lines are lines 1 and 3. So, no lines are concatenated to each other.
Java 6
standard input
[ "implementation", "strings" ]
a16bb696858bc592c33dcf0fd99df197
The input contains multiple lines. All characters in the lines have codes from 32 to 127 (inclusive). Please note that the lines may begin with or end with one or more spaces. The size of the input does not exceed 1048576 ( = 220) bytes. Newlines are included in this size. In the Windows operating system used on the te...
1,700
Print the text of the spell where all extra characters are deleted. Please note that each output line should be followed by a newline. Please be careful: your answers will be validated by comparing them to the jury's answer byte-by-byte. So, all spaces and newlines matter.
standard output
PASSED
fed3594b50e3d852cb4e544e58ba74fa
train_000.jsonl
1332860400
Let's dive into one of the most interesting areas of magic β€” writing spells. Learning this exciting but challenging science is very troublesome, so now you will not learn the magic words, but only get to know the basic rules of writing spells.Each spell consists of several lines. The line, whose first non-space charact...
256 megabytes
import java.io.BufferedReader; import java.io.FileInputStream; import java.io.IOException; import java.io.InputStreamReader; import java.util.ArrayList; import java.util.Arrays; import java.util.HashMap; import java.util.HashSet; import java.util.Iterator; import java.util.LinkedList; import java.util.List; import java...
Java
["# include &lt;cstdio&gt;\n\nusing namespace std;\n\nint main ( ){\nputs(\"Hello # World\"); #\n#\n}", "#\n\n#"]
2 seconds
["# include &lt;cstdio&gt;\nusingnamespacestd;intmain(){puts(\"Hello#World\");#\n#\n}", "#\n\n#"]
NoteIn the first sample the amplifying lines are lines 1 and 7. So, lines 2 to 6 are concatenated to each other, all spaces are deleted from them.In the second sample the amplifying lines are lines 1 and 3. So, no lines are concatenated to each other.
Java 6
standard input
[ "implementation", "strings" ]
a16bb696858bc592c33dcf0fd99df197
The input contains multiple lines. All characters in the lines have codes from 32 to 127 (inclusive). Please note that the lines may begin with or end with one or more spaces. The size of the input does not exceed 1048576 ( = 220) bytes. Newlines are included in this size. In the Windows operating system used on the te...
1,700
Print the text of the spell where all extra characters are deleted. Please note that each output line should be followed by a newline. Please be careful: your answers will be validated by comparing them to the jury's answer byte-by-byte. So, all spaces and newlines matter.
standard output
PASSED
8584da38529dfc49b50566414fbdcd47
train_000.jsonl
1332860400
Let's dive into one of the most interesting areas of magic β€” writing spells. Learning this exciting but challenging science is very troublesome, so now you will not learn the magic words, but only get to know the basic rules of writing spells.Each spell consists of several lines. The line, whose first non-space charact...
256 megabytes
import java.io.BufferedReader; import java.io.InputStreamReader; import java.util.StringTokenizer; public class Main { public static class Parser { private StringTokenizer tokenizer; public Parser(String input) { tokenizer = new StringTokenizer(input);} public boolean hasNext() { return to...
Java
["# include &lt;cstdio&gt;\n\nusing namespace std;\n\nint main ( ){\nputs(\"Hello # World\"); #\n#\n}", "#\n\n#"]
2 seconds
["# include &lt;cstdio&gt;\nusingnamespacestd;intmain(){puts(\"Hello#World\");#\n#\n}", "#\n\n#"]
NoteIn the first sample the amplifying lines are lines 1 and 7. So, lines 2 to 6 are concatenated to each other, all spaces are deleted from them.In the second sample the amplifying lines are lines 1 and 3. So, no lines are concatenated to each other.
Java 6
standard input
[ "implementation", "strings" ]
a16bb696858bc592c33dcf0fd99df197
The input contains multiple lines. All characters in the lines have codes from 32 to 127 (inclusive). Please note that the lines may begin with or end with one or more spaces. The size of the input does not exceed 1048576 ( = 220) bytes. Newlines are included in this size. In the Windows operating system used on the te...
1,700
Print the text of the spell where all extra characters are deleted. Please note that each output line should be followed by a newline. Please be careful: your answers will be validated by comparing them to the jury's answer byte-by-byte. So, all spaces and newlines matter.
standard output
PASSED
83d56b1df341a2f0fc3741d4c5d953cf
train_000.jsonl
1332860400
Let's dive into one of the most interesting areas of magic β€” writing spells. Learning this exciting but challenging science is very troublesome, so now you will not learn the magic words, but only get to know the basic rules of writing spells.Each spell consists of several lines. The line, whose first non-space charact...
256 megabytes
import java.io.*; import java.util.*; public class sp{ public static void main(String args[]) throws IOException{ BufferedReader lector = new BufferedReader(new InputStreamReader(System.in)); StringBuilder res = new StringBuilder(""); String tmp = ""; boolean t = true; while((tmp = lector.readLine())!=null){ String r =...
Java
["# include &lt;cstdio&gt;\n\nusing namespace std;\n\nint main ( ){\nputs(\"Hello # World\"); #\n#\n}", "#\n\n#"]
2 seconds
["# include &lt;cstdio&gt;\nusingnamespacestd;intmain(){puts(\"Hello#World\");#\n#\n}", "#\n\n#"]
NoteIn the first sample the amplifying lines are lines 1 and 7. So, lines 2 to 6 are concatenated to each other, all spaces are deleted from them.In the second sample the amplifying lines are lines 1 and 3. So, no lines are concatenated to each other.
Java 6
standard input
[ "implementation", "strings" ]
a16bb696858bc592c33dcf0fd99df197
The input contains multiple lines. All characters in the lines have codes from 32 to 127 (inclusive). Please note that the lines may begin with or end with one or more spaces. The size of the input does not exceed 1048576 ( = 220) bytes. Newlines are included in this size. In the Windows operating system used on the te...
1,700
Print the text of the spell where all extra characters are deleted. Please note that each output line should be followed by a newline. Please be careful: your answers will be validated by comparing them to the jury's answer byte-by-byte. So, all spaces and newlines matter.
standard output
PASSED
9d739079ffdd5a56e91bcaca6e940362
train_000.jsonl
1380295800
One day n friends gathered together to play "Mafia". During each round of the game some player must be the supervisor and other n - 1 people take part in the game. For each person we know in how many rounds he wants to be a player, not the supervisor: the i-th person wants to play ai rounds. What is the minimum number ...
256 megabytes
import java.io.BufferedReader; import java.io.BufferedWriter; import java.io.IOException; import java.io.InputStream; import java.io.InputStreamReader; import java.io.OutputStreamWriter; import java.io.PrintWriter; import java.util.Arrays; import java.util.StringTokenizer; public class P349C { static boolean mul...
Java
["3\n3 2 2", "4\n2 2 2 2"]
2 seconds
["4", "3"]
NoteYou don't need to know the rules of "Mafia" to solve this problem. If you're curious, it's a game Russia got from the Soviet times: http://en.wikipedia.org/wiki/Mafia_(party_game).
Java 8
standard input
[ "implementation" ]
09f5623c3717c9d360334500b198d8e0
The first line contains integer n (3 ≀ n ≀ 105). The second line contains n space-separated integers a1, a2, ..., an (1 ≀ ai ≀ 109) β€” the i-th number in the list is the number of rounds the i-th person wants to play.
1,600
In a single line print a single integer β€” the minimum number of game rounds the friends need to let the i-th person play at least ai rounds. Please, do not use the %lld specifier to read or write 64-bit integers in Π‘++. It is preferred to use the cin, cout streams or the %I64d specifier.
standard output
PASSED
d774366f15d31617cb5d1366d5a3a581
train_000.jsonl
1380295800
One day n friends gathered together to play "Mafia". During each round of the game some player must be the supervisor and other n - 1 people take part in the game. For each person we know in how many rounds he wants to be a player, not the supervisor: the i-th person wants to play ai rounds. What is the minimum number ...
256 megabytes
import java.util.*; import java.lang.*; import java.io.*; public class Solution{ public static void main (String[] args)throws Exception { BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); PrintWriter out = new PrintWriter(System.out); int n = Integer.parseInt(br.readLine()); int...
Java
["3\n3 2 2", "4\n2 2 2 2"]
2 seconds
["4", "3"]
NoteYou don't need to know the rules of "Mafia" to solve this problem. If you're curious, it's a game Russia got from the Soviet times: http://en.wikipedia.org/wiki/Mafia_(party_game).
Java 8
standard input
[ "implementation" ]
09f5623c3717c9d360334500b198d8e0
The first line contains integer n (3 ≀ n ≀ 105). The second line contains n space-separated integers a1, a2, ..., an (1 ≀ ai ≀ 109) β€” the i-th number in the list is the number of rounds the i-th person wants to play.
1,600
In a single line print a single integer β€” the minimum number of game rounds the friends need to let the i-th person play at least ai rounds. Please, do not use the %lld specifier to read or write 64-bit integers in Π‘++. It is preferred to use the cin, cout streams or the %I64d specifier.
standard output
PASSED
cd7a713b8a4843d85ef907002bdc2477
train_000.jsonl
1380295800
One day n friends gathered together to play "Mafia". During each round of the game some player must be the supervisor and other n - 1 people take part in the game. For each person we know in how many rounds he wants to be a player, not the supervisor: the i-th person wants to play ai rounds. What is the minimum number ...
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.Collection; import java.util.StringTokenizer; import java.util.stream.IntStream; import java.util.stream.Stream; public class Main implements Runnable { s...
Java
["3\n3 2 2", "4\n2 2 2 2"]
2 seconds
["4", "3"]
NoteYou don't need to know the rules of "Mafia" to solve this problem. If you're curious, it's a game Russia got from the Soviet times: http://en.wikipedia.org/wiki/Mafia_(party_game).
Java 8
standard input
[ "implementation" ]
09f5623c3717c9d360334500b198d8e0
The first line contains integer n (3 ≀ n ≀ 105). The second line contains n space-separated integers a1, a2, ..., an (1 ≀ ai ≀ 109) β€” the i-th number in the list is the number of rounds the i-th person wants to play.
1,600
In a single line print a single integer β€” the minimum number of game rounds the friends need to let the i-th person play at least ai rounds. Please, do not use the %lld specifier to read or write 64-bit integers in Π‘++. It is preferred to use the cin, cout streams or the %I64d specifier.
standard output
PASSED
c623a42d45e0ea005b9ce5cbf35eb79f
train_000.jsonl
1380295800
One day n friends gathered together to play "Mafia". During each round of the game some player must be the supervisor and other n - 1 people take part in the game. For each person we know in how many rounds he wants to be a player, not the supervisor: the i-th person wants to play ai rounds. What is the minimum number ...
256 megabytes
import java.util.*; import java.io.*; public class CF_349_C_MAFIA { public static void main (String [] args) throws Exception { Scanner sc = new Scanner(System.in); int n = sc.nextInt() - 1 , mx = 0; long x = 0 ; for( int i = 0 ; i <= n ; i++ ) { int xx =...
Java
["3\n3 2 2", "4\n2 2 2 2"]
2 seconds
["4", "3"]
NoteYou don't need to know the rules of "Mafia" to solve this problem. If you're curious, it's a game Russia got from the Soviet times: http://en.wikipedia.org/wiki/Mafia_(party_game).
Java 8
standard input
[ "implementation" ]
09f5623c3717c9d360334500b198d8e0
The first line contains integer n (3 ≀ n ≀ 105). The second line contains n space-separated integers a1, a2, ..., an (1 ≀ ai ≀ 109) β€” the i-th number in the list is the number of rounds the i-th person wants to play.
1,600
In a single line print a single integer β€” the minimum number of game rounds the friends need to let the i-th person play at least ai rounds. Please, do not use the %lld specifier to read or write 64-bit integers in Π‘++. It is preferred to use the cin, cout streams or the %I64d specifier.
standard output
PASSED
64623c3898b0844d57130543e1de6b48
train_000.jsonl
1380295800
One day n friends gathered together to play "Mafia". During each round of the game some player must be the supervisor and other n - 1 people take part in the game. For each person we know in how many rounds he wants to be a player, not the supervisor: the i-th person wants to play ai rounds. What is the minimum number ...
256 megabytes
import java.util.Scanner; public class Mafia { public static void main(String[] args) { Scanner in = new Scanner(System.in); int n=in.nextInt(); //int[] a=new int[n]; long sum=0,max=0; for(int i=0;i<n;i++){ int x=in.nextInt(); sum+=x; max...
Java
["3\n3 2 2", "4\n2 2 2 2"]
2 seconds
["4", "3"]
NoteYou don't need to know the rules of "Mafia" to solve this problem. If you're curious, it's a game Russia got from the Soviet times: http://en.wikipedia.org/wiki/Mafia_(party_game).
Java 8
standard input
[ "implementation" ]
09f5623c3717c9d360334500b198d8e0
The first line contains integer n (3 ≀ n ≀ 105). The second line contains n space-separated integers a1, a2, ..., an (1 ≀ ai ≀ 109) β€” the i-th number in the list is the number of rounds the i-th person wants to play.
1,600
In a single line print a single integer β€” the minimum number of game rounds the friends need to let the i-th person play at least ai rounds. Please, do not use the %lld specifier to read or write 64-bit integers in Π‘++. It is preferred to use the cin, cout streams or the %I64d specifier.
standard output
PASSED
db4edd89be8bc08962dfcdb8f6d1586e
train_000.jsonl
1380295800
One day n friends gathered together to play "Mafia". During each round of the game some player must be the supervisor and other n - 1 people take part in the game. For each person we know in how many rounds he wants to be a player, not the supervisor: the i-th person wants to play ai rounds. What is the minimum number ...
256 megabytes
import java.io.*; import java.util.*; public class Main { static InputReader in = new InputReader(System.in); static PrintWriter out = new PrintWriter(System.out); static int oo = (int)1e9; // static long oo = (long)1e15; static int mod = 1_000_000_007; static int[] di = {1, 0, 0, -1}; static int[] dj...
Java
["3\n3 2 2", "4\n2 2 2 2"]
2 seconds
["4", "3"]
NoteYou don't need to know the rules of "Mafia" to solve this problem. If you're curious, it's a game Russia got from the Soviet times: http://en.wikipedia.org/wiki/Mafia_(party_game).
Java 8
standard input
[ "implementation" ]
09f5623c3717c9d360334500b198d8e0
The first line contains integer n (3 ≀ n ≀ 105). The second line contains n space-separated integers a1, a2, ..., an (1 ≀ ai ≀ 109) β€” the i-th number in the list is the number of rounds the i-th person wants to play.
1,600
In a single line print a single integer β€” the minimum number of game rounds the friends need to let the i-th person play at least ai rounds. Please, do not use the %lld specifier to read or write 64-bit integers in Π‘++. It is preferred to use the cin, cout streams or the %I64d specifier.
standard output
PASSED
96e963cd8d2d9905582ca5918cb280d7
train_000.jsonl
1380295800
One day n friends gathered together to play "Mafia". During each round of the game some player must be the supervisor and other n - 1 people take part in the game. For each person we know in how many rounds he wants to be a player, not the supervisor: the i-th person wants to play ai rounds. What is the minimum number ...
256 megabytes
import java.io.*; import java.math.*; import java.util.*; /** * * @author Saju * */ public class Main { private static int dx[] = { 1, 0, -1, 0 }; private static int dy[] = { 0, -1, 0, 1 }; private static final long INF = (long) Math.pow(10, 16); private static final int INT_INF = Integer.MAX_VA...
Java
["3\n3 2 2", "4\n2 2 2 2"]
2 seconds
["4", "3"]
NoteYou don't need to know the rules of "Mafia" to solve this problem. If you're curious, it's a game Russia got from the Soviet times: http://en.wikipedia.org/wiki/Mafia_(party_game).
Java 8
standard input
[ "implementation" ]
09f5623c3717c9d360334500b198d8e0
The first line contains integer n (3 ≀ n ≀ 105). The second line contains n space-separated integers a1, a2, ..., an (1 ≀ ai ≀ 109) β€” the i-th number in the list is the number of rounds the i-th person wants to play.
1,600
In a single line print a single integer β€” the minimum number of game rounds the friends need to let the i-th person play at least ai rounds. Please, do not use the %lld specifier to read or write 64-bit integers in Π‘++. It is preferred to use the cin, cout streams or the %I64d specifier.
standard output
PASSED
0750eab91fd7055d9c88e734980ad8ee
train_000.jsonl
1380295800
One day n friends gathered together to play "Mafia". During each round of the game some player must be the supervisor and other n - 1 people take part in the game. For each person we know in how many rounds he wants to be a player, not the supervisor: the i-th person wants to play ai rounds. What is the minimum number ...
256 megabytes
import java.io.*; import java.util.*; import java.lang.*; import java.math.BigInteger; public class Main { public static void main(String[] args) throws Exception { BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); int t,ca,i,j; String[] my; String line = br.readLine(); ...
Java
["3\n3 2 2", "4\n2 2 2 2"]
2 seconds
["4", "3"]
NoteYou don't need to know the rules of "Mafia" to solve this problem. If you're curious, it's a game Russia got from the Soviet times: http://en.wikipedia.org/wiki/Mafia_(party_game).
Java 8
standard input
[ "implementation" ]
09f5623c3717c9d360334500b198d8e0
The first line contains integer n (3 ≀ n ≀ 105). The second line contains n space-separated integers a1, a2, ..., an (1 ≀ ai ≀ 109) β€” the i-th number in the list is the number of rounds the i-th person wants to play.
1,600
In a single line print a single integer β€” the minimum number of game rounds the friends need to let the i-th person play at least ai rounds. Please, do not use the %lld specifier to read or write 64-bit integers in Π‘++. It is preferred to use the cin, cout streams or the %I64d specifier.
standard output
PASSED
7bb7daad9762e525855ebe97de1e2cab
train_000.jsonl
1380295800
One day n friends gathered together to play "Mafia". During each round of the game some player must be the supervisor and other n - 1 people take part in the game. For each person we know in how many rounds he wants to be a player, not the supervisor: the i-th person wants to play ai rounds. What is the minimum number ...
256 megabytes
import java.io.*; import java.util.*; import java.text.*; import java.math.*; import java.util.regex.*; import java.lang.*; public class P349C { //static long mod=1000000007; public static void main(String[] args) throws Exception{ InputReader in = new InputReader(System.in); ...
Java
["3\n3 2 2", "4\n2 2 2 2"]
2 seconds
["4", "3"]
NoteYou don't need to know the rules of "Mafia" to solve this problem. If you're curious, it's a game Russia got from the Soviet times: http://en.wikipedia.org/wiki/Mafia_(party_game).
Java 8
standard input
[ "implementation" ]
09f5623c3717c9d360334500b198d8e0
The first line contains integer n (3 ≀ n ≀ 105). The second line contains n space-separated integers a1, a2, ..., an (1 ≀ ai ≀ 109) β€” the i-th number in the list is the number of rounds the i-th person wants to play.
1,600
In a single line print a single integer β€” the minimum number of game rounds the friends need to let the i-th person play at least ai rounds. Please, do not use the %lld specifier to read or write 64-bit integers in Π‘++. It is preferred to use the cin, cout streams or the %I64d specifier.
standard output
PASSED
80f7d4906ebdc09ebe003cb7e332d7b3
train_000.jsonl
1380295800
One day n friends gathered together to play "Mafia". During each round of the game some player must be the supervisor and other n - 1 people take part in the game. For each person we know in how many rounds he wants to be a player, not the supervisor: the i-th person wants to play ai rounds. What is the minimum number ...
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 = Syste...
Java
["3\n3 2 2", "4\n2 2 2 2"]
2 seconds
["4", "3"]
NoteYou don't need to know the rules of "Mafia" to solve this problem. If you're curious, it's a game Russia got from the Soviet times: http://en.wikipedia.org/wiki/Mafia_(party_game).
Java 8
standard input
[ "implementation" ]
09f5623c3717c9d360334500b198d8e0
The first line contains integer n (3 ≀ n ≀ 105). The second line contains n space-separated integers a1, a2, ..., an (1 ≀ ai ≀ 109) β€” the i-th number in the list is the number of rounds the i-th person wants to play.
1,600
In a single line print a single integer β€” the minimum number of game rounds the friends need to let the i-th person play at least ai rounds. Please, do not use the %lld specifier to read or write 64-bit integers in Π‘++. It is preferred to use the cin, cout streams or the %I64d specifier.
standard output
PASSED
d323a680f8a8286aca9f9304447ae9fd
train_000.jsonl
1380295800
One day n friends gathered together to play "Mafia". During each round of the game some player must be the supervisor and other n - 1 people take part in the game. For each person we know in how many rounds he wants to be a player, not the supervisor: the i-th person wants to play ai rounds. What is the minimum number ...
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 = Syste...
Java
["3\n3 2 2", "4\n2 2 2 2"]
2 seconds
["4", "3"]
NoteYou don't need to know the rules of "Mafia" to solve this problem. If you're curious, it's a game Russia got from the Soviet times: http://en.wikipedia.org/wiki/Mafia_(party_game).
Java 8
standard input
[ "implementation" ]
09f5623c3717c9d360334500b198d8e0
The first line contains integer n (3 ≀ n ≀ 105). The second line contains n space-separated integers a1, a2, ..., an (1 ≀ ai ≀ 109) β€” the i-th number in the list is the number of rounds the i-th person wants to play.
1,600
In a single line print a single integer β€” the minimum number of game rounds the friends need to let the i-th person play at least ai rounds. Please, do not use the %lld specifier to read or write 64-bit integers in Π‘++. It is preferred to use the cin, cout streams or the %I64d specifier.
standard output
PASSED
25f7271b5b6e7d6aee6b94d5ad93f924
train_000.jsonl
1380295800
One day n friends gathered together to play "Mafia". During each round of the game some player must be the supervisor and other n - 1 people take part in the game. For each person we know in how many rounds he wants to be a player, not the supervisor: the i-th person wants to play ai rounds. What is the minimum number ...
256 megabytes
//package CF; 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.Collections; import java.util.StringTokenizer; public class B { public static void main(String[] args) throw...
Java
["3\n3 2 2", "4\n2 2 2 2"]
2 seconds
["4", "3"]
NoteYou don't need to know the rules of "Mafia" to solve this problem. If you're curious, it's a game Russia got from the Soviet times: http://en.wikipedia.org/wiki/Mafia_(party_game).
Java 8
standard input
[ "implementation" ]
09f5623c3717c9d360334500b198d8e0
The first line contains integer n (3 ≀ n ≀ 105). The second line contains n space-separated integers a1, a2, ..., an (1 ≀ ai ≀ 109) β€” the i-th number in the list is the number of rounds the i-th person wants to play.
1,600
In a single line print a single integer β€” the minimum number of game rounds the friends need to let the i-th person play at least ai rounds. Please, do not use the %lld specifier to read or write 64-bit integers in Π‘++. It is preferred to use the cin, cout streams or the %I64d specifier.
standard output
PASSED
107aedf30be6396213f144c97ba57feb
train_000.jsonl
1380295800
One day n friends gathered together to play "Mafia". During each round of the game some player must be the supervisor and other n - 1 people take part in the game. For each person we know in how many rounds he wants to be a player, not the supervisor: the i-th person wants to play ai rounds. What is the minimum number ...
256 megabytes
import java.io.OutputStream; import java.io.IOException; import java.io.InputStream; import java.io.PrintWriter; import java.io.OutputStream; import java.io.IOException; import java.io.InputStreamReader; import java.io.BufferedOutputStream; import java.util.StringTokenizer; import java.io.BufferedReader; import java.io...
Java
["3\n3 2 2", "4\n2 2 2 2"]
2 seconds
["4", "3"]
NoteYou don't need to know the rules of "Mafia" to solve this problem. If you're curious, it's a game Russia got from the Soviet times: http://en.wikipedia.org/wiki/Mafia_(party_game).
Java 8
standard input
[ "implementation" ]
09f5623c3717c9d360334500b198d8e0
The first line contains integer n (3 ≀ n ≀ 105). The second line contains n space-separated integers a1, a2, ..., an (1 ≀ ai ≀ 109) β€” the i-th number in the list is the number of rounds the i-th person wants to play.
1,600
In a single line print a single integer β€” the minimum number of game rounds the friends need to let the i-th person play at least ai rounds. Please, do not use the %lld specifier to read or write 64-bit integers in Π‘++. It is preferred to use the cin, cout streams or the %I64d specifier.
standard output
PASSED
27649817b24c1ce6fc9a715783e0dac0
train_000.jsonl
1380295800
One day n friends gathered together to play "Mafia". During each round of the game some player must be the supervisor and other n - 1 people take part in the game. For each person we know in how many rounds he wants to be a player, not the supervisor: the i-th person wants to play ai rounds. What is the minimum number ...
256 megabytes
import java.io.OutputStream; import java.io.IOException; import java.io.InputStream; import java.io.PrintWriter; import java.io.OutputStream; import java.util.StringTokenizer; import java.io.IOException; import java.io.BufferedReader; import java.io.InputStreamReader; import java.io.InputStream; import java.io.Buffered...
Java
["3\n3 2 2", "4\n2 2 2 2"]
2 seconds
["4", "3"]
NoteYou don't need to know the rules of "Mafia" to solve this problem. If you're curious, it's a game Russia got from the Soviet times: http://en.wikipedia.org/wiki/Mafia_(party_game).
Java 8
standard input
[ "implementation" ]
09f5623c3717c9d360334500b198d8e0
The first line contains integer n (3 ≀ n ≀ 105). The second line contains n space-separated integers a1, a2, ..., an (1 ≀ ai ≀ 109) β€” the i-th number in the list is the number of rounds the i-th person wants to play.
1,600
In a single line print a single integer β€” the minimum number of game rounds the friends need to let the i-th person play at least ai rounds. Please, do not use the %lld specifier to read or write 64-bit integers in Π‘++. It is preferred to use the cin, cout streams or the %I64d specifier.
standard output
PASSED
101e64d7d3729bc901fe84d578530b5d
train_000.jsonl
1380295800
One day n friends gathered together to play "Mafia". During each round of the game some player must be the supervisor and other n - 1 people take part in the game. For each person we know in how many rounds he wants to be a player, not the supervisor: the i-th person wants to play ai rounds. What is the minimum number ...
256 megabytes
import java.io.*; import java.util.*; public class CF349C { public static void main(String[] args) throws IOException { BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); int n = Integer.parseInt(br.readLine()); int[] aa = new int[n]; StringTokenizer st = new StringTokenizer(br.readLine...
Java
["3\n3 2 2", "4\n2 2 2 2"]
2 seconds
["4", "3"]
NoteYou don't need to know the rules of "Mafia" to solve this problem. If you're curious, it's a game Russia got from the Soviet times: http://en.wikipedia.org/wiki/Mafia_(party_game).
Java 8
standard input
[ "implementation" ]
09f5623c3717c9d360334500b198d8e0
The first line contains integer n (3 ≀ n ≀ 105). The second line contains n space-separated integers a1, a2, ..., an (1 ≀ ai ≀ 109) β€” the i-th number in the list is the number of rounds the i-th person wants to play.
1,600
In a single line print a single integer β€” the minimum number of game rounds the friends need to let the i-th person play at least ai rounds. Please, do not use the %lld specifier to read or write 64-bit integers in Π‘++. It is preferred to use the cin, cout streams or the %I64d specifier.
standard output
PASSED
83491f6d0d68ad2e3f6a9dd10952ecc3
train_000.jsonl
1380295800
One day n friends gathered together to play "Mafia". During each round of the game some player must be the supervisor and other n - 1 people take part in the game. For each person we know in how many rounds he wants to be a player, not the supervisor: the i-th person wants to play ai rounds. What is the minimum number ...
256 megabytes
import java.io.*; import java.util.*; public class CodeForce{ public static void main(String[] args) throws IOException { BufferedReader br=new BufferedReader(new InputStreamReader(System.in)); int n=Integer.parseInt(br.readLine()); String[] str=br.readLine().split(" "); ...
Java
["3\n3 2 2", "4\n2 2 2 2"]
2 seconds
["4", "3"]
NoteYou don't need to know the rules of "Mafia" to solve this problem. If you're curious, it's a game Russia got from the Soviet times: http://en.wikipedia.org/wiki/Mafia_(party_game).
Java 8
standard input
[ "implementation" ]
09f5623c3717c9d360334500b198d8e0
The first line contains integer n (3 ≀ n ≀ 105). The second line contains n space-separated integers a1, a2, ..., an (1 ≀ ai ≀ 109) β€” the i-th number in the list is the number of rounds the i-th person wants to play.
1,600
In a single line print a single integer β€” the minimum number of game rounds the friends need to let the i-th person play at least ai rounds. Please, do not use the %lld specifier to read or write 64-bit integers in Π‘++. It is preferred to use the cin, cout streams or the %I64d specifier.
standard output
PASSED
18a047b5efb5ff7d6440186d426d4df9
train_000.jsonl
1380295800
One day n friends gathered together to play "Mafia". During each round of the game some player must be the supervisor and other n - 1 people take part in the game. For each person we know in how many rounds he wants to be a player, not the supervisor: the i-th person wants to play ai rounds. What is the minimum number ...
256 megabytes
//import com.sun.org.apache.xpath.internal.operations.String; //import com.sun.org.apache.xpath.internal.operations.String; import java.io.*; import java.math.BigDecimal; import java.math.BigInteger; import java.math.RoundingMode; import java.util.*; public class scratch_25 { // int count=0; //static long c...
Java
["3\n3 2 2", "4\n2 2 2 2"]
2 seconds
["4", "3"]
NoteYou don't need to know the rules of "Mafia" to solve this problem. If you're curious, it's a game Russia got from the Soviet times: http://en.wikipedia.org/wiki/Mafia_(party_game).
Java 8
standard input
[ "implementation" ]
09f5623c3717c9d360334500b198d8e0
The first line contains integer n (3 ≀ n ≀ 105). The second line contains n space-separated integers a1, a2, ..., an (1 ≀ ai ≀ 109) β€” the i-th number in the list is the number of rounds the i-th person wants to play.
1,600
In a single line print a single integer β€” the minimum number of game rounds the friends need to let the i-th person play at least ai rounds. Please, do not use the %lld specifier to read or write 64-bit integers in Π‘++. It is preferred to use the cin, cout streams or the %I64d specifier.
standard output
PASSED
5e7314d4ed52756d430077b1171c02a0
train_000.jsonl
1380295800
One day n friends gathered together to play "Mafia". During each round of the game some player must be the supervisor and other n - 1 people take part in the game. For each person we know in how many rounds he wants to be a player, not the supervisor: the i-th person wants to play ai rounds. What is the minimum number ...
256 megabytes
import java.util.*; import java.io.*; public class C { Reader in; PrintWriter out; int i = 0, j = 0; void solve() { //START// long n = in.nextInt(); long sum = 0; long high = 0; for (i = 0; i < n; i++) { long cur = in.nextLong()...
Java
["3\n3 2 2", "4\n2 2 2 2"]
2 seconds
["4", "3"]
NoteYou don't need to know the rules of "Mafia" to solve this problem. If you're curious, it's a game Russia got from the Soviet times: http://en.wikipedia.org/wiki/Mafia_(party_game).
Java 8
standard input
[ "implementation" ]
09f5623c3717c9d360334500b198d8e0
The first line contains integer n (3 ≀ n ≀ 105). The second line contains n space-separated integers a1, a2, ..., an (1 ≀ ai ≀ 109) β€” the i-th number in the list is the number of rounds the i-th person wants to play.
1,600
In a single line print a single integer β€” the minimum number of game rounds the friends need to let the i-th person play at least ai rounds. Please, do not use the %lld specifier to read or write 64-bit integers in Π‘++. It is preferred to use the cin, cout streams or the %I64d specifier.
standard output
PASSED
e46fe22d9d460287703ecb9229d8d873
train_000.jsonl
1380295800
One day n friends gathered together to play "Mafia". During each round of the game some player must be the supervisor and other n - 1 people take part in the game. For each person we know in how many rounds he wants to be a player, not the supervisor: the i-th person wants to play ai rounds. What is the minimum number ...
256 megabytes
import java.util.*; public class Main{ boolean debug=false; int INF=1<<28; long n,max; long[] a; void solve(){ Scanner sc=new Scanner(System.in); n=sc.nextLong(); a=new long[(int)n]; max=-1L; for(int i=0;i<n;i++){ a[i]=sc.nextLong(); if(a[i]>max)max=a[i]; } long left=1L; long ...
Java
["3\n3 2 2", "4\n2 2 2 2"]
2 seconds
["4", "3"]
NoteYou don't need to know the rules of "Mafia" to solve this problem. If you're curious, it's a game Russia got from the Soviet times: http://en.wikipedia.org/wiki/Mafia_(party_game).
Java 8
standard input
[ "implementation" ]
09f5623c3717c9d360334500b198d8e0
The first line contains integer n (3 ≀ n ≀ 105). The second line contains n space-separated integers a1, a2, ..., an (1 ≀ ai ≀ 109) β€” the i-th number in the list is the number of rounds the i-th person wants to play.
1,600
In a single line print a single integer β€” the minimum number of game rounds the friends need to let the i-th person play at least ai rounds. Please, do not use the %lld specifier to read or write 64-bit integers in Π‘++. It is preferred to use the cin, cout streams or the %I64d specifier.
standard output
PASSED
34237c51c963cd95256d5662828dc454
train_000.jsonl
1380295800
One day n friends gathered together to play "Mafia". During each round of the game some player must be the supervisor and other n - 1 people take part in the game. For each person we know in how many rounds he wants to be a player, not the supervisor: the i-th person wants to play ai rounds. What is the minimum number ...
256 megabytes
/* * Remember a 7.0 student can know more than a 10.0 student. * Grades don't determine intelligence, they test obedience. * I Never Give Up. */ import java.util.*; import java.util.Map.Entry; import java.io.*; import com.sun.javafx.collections.MappingChange.Map; import static java.lang.System.out; import static...
Java
["3\n3 2 2", "4\n2 2 2 2"]
2 seconds
["4", "3"]
NoteYou don't need to know the rules of "Mafia" to solve this problem. If you're curious, it's a game Russia got from the Soviet times: http://en.wikipedia.org/wiki/Mafia_(party_game).
Java 8
standard input
[ "implementation" ]
09f5623c3717c9d360334500b198d8e0
The first line contains integer n (3 ≀ n ≀ 105). The second line contains n space-separated integers a1, a2, ..., an (1 ≀ ai ≀ 109) β€” the i-th number in the list is the number of rounds the i-th person wants to play.
1,600
In a single line print a single integer β€” the minimum number of game rounds the friends need to let the i-th person play at least ai rounds. Please, do not use the %lld specifier to read or write 64-bit integers in Π‘++. It is preferred to use the cin, cout streams or the %I64d specifier.
standard output
PASSED
65f18eb0f6d8a01d337450c45939b742
train_000.jsonl
1380295800
One day n friends gathered together to play "Mafia". During each round of the game some player must be the supervisor and other n - 1 people take part in the game. For each person we know in how many rounds he wants to be a player, not the supervisor: the i-th person wants to play ai rounds. What is the minimum number ...
256 megabytes
import java.util.*; import java.io.*; //267630EY public class Main348A { static PrintWriter out=new PrintWriter(System.out); public static void main(String[] args) throws IOException { Scanner sc=new Scanner(System.in); int n=sc.nextInt(); int[] a=sc.nextIntArray(n); long sum=0; long max...
Java
["3\n3 2 2", "4\n2 2 2 2"]
2 seconds
["4", "3"]
NoteYou don't need to know the rules of "Mafia" to solve this problem. If you're curious, it's a game Russia got from the Soviet times: http://en.wikipedia.org/wiki/Mafia_(party_game).
Java 8
standard input
[ "implementation" ]
09f5623c3717c9d360334500b198d8e0
The first line contains integer n (3 ≀ n ≀ 105). The second line contains n space-separated integers a1, a2, ..., an (1 ≀ ai ≀ 109) β€” the i-th number in the list is the number of rounds the i-th person wants to play.
1,600
In a single line print a single integer β€” the minimum number of game rounds the friends need to let the i-th person play at least ai rounds. Please, do not use the %lld specifier to read or write 64-bit integers in Π‘++. It is preferred to use the cin, cout streams or the %I64d specifier.
standard output
PASSED
8528ea7c55d23a796c61af613c453eb8
train_000.jsonl
1380295800
One day n friends gathered together to play "Mafia". During each round of the game some player must be the supervisor and other n - 1 people take part in the game. For each person we know in how many rounds he wants to be a player, not the supervisor: the i-th person wants to play ai rounds. What is the minimum number ...
256 megabytes
import java.io.BufferedReader; import java.io.FileNotFoundException; import java.io.FileReader; import java.io.IOException; import java.io.InputStream; import java.io.InputStreamReader; import java.util.StringTokenizer; public class Main { public static void main(String[] args) throws Throwable { Scanner sc = new ...
Java
["3\n3 2 2", "4\n2 2 2 2"]
2 seconds
["4", "3"]
NoteYou don't need to know the rules of "Mafia" to solve this problem. If you're curious, it's a game Russia got from the Soviet times: http://en.wikipedia.org/wiki/Mafia_(party_game).
Java 8
standard input
[ "implementation" ]
09f5623c3717c9d360334500b198d8e0
The first line contains integer n (3 ≀ n ≀ 105). The second line contains n space-separated integers a1, a2, ..., an (1 ≀ ai ≀ 109) β€” the i-th number in the list is the number of rounds the i-th person wants to play.
1,600
In a single line print a single integer β€” the minimum number of game rounds the friends need to let the i-th person play at least ai rounds. Please, do not use the %lld specifier to read or write 64-bit integers in Π‘++. It is preferred to use the cin, cout streams or the %I64d specifier.
standard output
PASSED
ed12e5168ce1fded5984951a46981b6f
train_000.jsonl
1380295800
One day n friends gathered together to play "Mafia". During each round of the game some player must be the supervisor and other n - 1 people take part in the game. For each person we know in how many rounds he wants to be a player, not the supervisor: the i-th person wants to play ai rounds. What is the minimum number ...
256 megabytes
import java.io.BufferedReader; import java.io.FileNotFoundException; import java.io.IOException; import java.io.InputStream; import java.io.InputStreamReader; import java.io.OutputStream; import java.io.PrintWriter; import java.util.Arrays; import java.util.StringTokenizer; public class Codeforces_BS_C349 { public st...
Java
["3\n3 2 2", "4\n2 2 2 2"]
2 seconds
["4", "3"]
NoteYou don't need to know the rules of "Mafia" to solve this problem. If you're curious, it's a game Russia got from the Soviet times: http://en.wikipedia.org/wiki/Mafia_(party_game).
Java 8
standard input
[ "implementation" ]
09f5623c3717c9d360334500b198d8e0
The first line contains integer n (3 ≀ n ≀ 105). The second line contains n space-separated integers a1, a2, ..., an (1 ≀ ai ≀ 109) β€” the i-th number in the list is the number of rounds the i-th person wants to play.
1,600
In a single line print a single integer β€” the minimum number of game rounds the friends need to let the i-th person play at least ai rounds. Please, do not use the %lld specifier to read or write 64-bit integers in Π‘++. It is preferred to use the cin, cout streams or the %I64d specifier.
standard output
PASSED
e0f7ed65e8d9d7bb59a031da037ff560
train_000.jsonl
1380295800
One day n friends gathered together to play "Mafia". During each round of the game some player must be the supervisor and other n - 1 people take part in the game. For each person we know in how many rounds he wants to be a player, not the supervisor: the i-th person wants to play ai rounds. What is the minimum number ...
256 megabytes
import java.awt.*; import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; public final class MafiaCF { public static void main(String[] args) throws IOException { BufferedReader br=new BufferedReader(new InputStreamReader(System.in)); int n=Integer.parseInt(br....
Java
["3\n3 2 2", "4\n2 2 2 2"]
2 seconds
["4", "3"]
NoteYou don't need to know the rules of "Mafia" to solve this problem. If you're curious, it's a game Russia got from the Soviet times: http://en.wikipedia.org/wiki/Mafia_(party_game).
Java 8
standard input
[ "implementation" ]
09f5623c3717c9d360334500b198d8e0
The first line contains integer n (3 ≀ n ≀ 105). The second line contains n space-separated integers a1, a2, ..., an (1 ≀ ai ≀ 109) β€” the i-th number in the list is the number of rounds the i-th person wants to play.
1,600
In a single line print a single integer β€” the minimum number of game rounds the friends need to let the i-th person play at least ai rounds. Please, do not use the %lld specifier to read or write 64-bit integers in Π‘++. It is preferred to use the cin, cout streams or the %I64d specifier.
standard output
PASSED
54d6e2aeb4355eff4af2c0359d618f7e
train_000.jsonl
1380295800
One day n friends gathered together to play "Mafia". During each round of the game some player must be the supervisor and other n - 1 people take part in the game. For each person we know in how many rounds he wants to be a player, not the supervisor: the i-th person wants to play ai rounds. What is the minimum number ...
256 megabytes
import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; import java.util.StringTokenizer; public class C202 { public static void main(String[] args) throws IOException { BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); StringTokenizer st...
Java
["3\n3 2 2", "4\n2 2 2 2"]
2 seconds
["4", "3"]
NoteYou don't need to know the rules of "Mafia" to solve this problem. If you're curious, it's a game Russia got from the Soviet times: http://en.wikipedia.org/wiki/Mafia_(party_game).
Java 8
standard input
[ "implementation" ]
09f5623c3717c9d360334500b198d8e0
The first line contains integer n (3 ≀ n ≀ 105). The second line contains n space-separated integers a1, a2, ..., an (1 ≀ ai ≀ 109) β€” the i-th number in the list is the number of rounds the i-th person wants to play.
1,600
In a single line print a single integer β€” the minimum number of game rounds the friends need to let the i-th person play at least ai rounds. Please, do not use the %lld specifier to read or write 64-bit integers in Π‘++. It is preferred to use the cin, cout streams or the %I64d specifier.
standard output
PASSED
3fe504fef8dd57ae04677d3c1a45ef10
train_000.jsonl
1380295800
One day n friends gathered together to play "Mafia". During each round of the game some player must be the supervisor and other n - 1 people take part in the game. For each person we know in how many rounds he wants to be a player, not the supervisor: the i-th person wants to play ai rounds. What is the minimum number ...
256 megabytes
import java.util.Scanner; public class hef { public static boolean check(int a[],int n,long mid) { long sum = 0; for(int i=0;i<n;i++) { if(a[i]>mid) { return false; } sum+=mid-a[i]; } if(sum>=mid) { return true; } return false; } public static void main(String[] args) { Scan...
Java
["3\n3 2 2", "4\n2 2 2 2"]
2 seconds
["4", "3"]
NoteYou don't need to know the rules of "Mafia" to solve this problem. If you're curious, it's a game Russia got from the Soviet times: http://en.wikipedia.org/wiki/Mafia_(party_game).
Java 8
standard input
[ "implementation" ]
09f5623c3717c9d360334500b198d8e0
The first line contains integer n (3 ≀ n ≀ 105). The second line contains n space-separated integers a1, a2, ..., an (1 ≀ ai ≀ 109) β€” the i-th number in the list is the number of rounds the i-th person wants to play.
1,600
In a single line print a single integer β€” the minimum number of game rounds the friends need to let the i-th person play at least ai rounds. Please, do not use the %lld specifier to read or write 64-bit integers in Π‘++. It is preferred to use the cin, cout streams or the %I64d specifier.
standard output
PASSED
0ad58473b1ab310b13656adb128776f4
train_000.jsonl
1380295800
One day n friends gathered together to play "Mafia". During each round of the game some player must be the supervisor and other n - 1 people take part in the game. For each person we know in how many rounds he wants to be a player, not the supervisor: the i-th person wants to play ai rounds. What is the minimum number ...
256 megabytes
import java.io.*; import static java.lang.Math.max; import static java.lang.Math.sin; import java.util.*; public class Kaudo { static Reader in =new Reader(); static StringBuilder Sd=new StringBuilder(); static long ans=0,res; static boolean B[]; static List<Integer> gr[]; public static void...
Java
["3\n3 2 2", "4\n2 2 2 2"]
2 seconds
["4", "3"]
NoteYou don't need to know the rules of "Mafia" to solve this problem. If you're curious, it's a game Russia got from the Soviet times: http://en.wikipedia.org/wiki/Mafia_(party_game).
Java 8
standard input
[ "implementation" ]
09f5623c3717c9d360334500b198d8e0
The first line contains integer n (3 ≀ n ≀ 105). The second line contains n space-separated integers a1, a2, ..., an (1 ≀ ai ≀ 109) β€” the i-th number in the list is the number of rounds the i-th person wants to play.
1,600
In a single line print a single integer β€” the minimum number of game rounds the friends need to let the i-th person play at least ai rounds. Please, do not use the %lld specifier to read or write 64-bit integers in Π‘++. It is preferred to use the cin, cout streams or the %I64d specifier.
standard output
PASSED
5a4f649372922a2afebdd8dadc2e3d7d
train_000.jsonl
1380295800
One day n friends gathered together to play "Mafia". During each round of the game some player must be the supervisor and other n - 1 people take part in the game. For each person we know in how many rounds he wants to be a player, not the supervisor: the i-th person wants to play ai rounds. What is the minimum number ...
256 megabytes
import java.util.Scanner; public class Mafiaa { public static void main(String[] args) { Scanner in = new Scanner(System.in); int n=in.nextInt(); //int[] a=new int[n]; long sum=0,max=0; for(int i=0;i<n;i++){ int x=in.nextInt(); sum+=x; ma...
Java
["3\n3 2 2", "4\n2 2 2 2"]
2 seconds
["4", "3"]
NoteYou don't need to know the rules of "Mafia" to solve this problem. If you're curious, it's a game Russia got from the Soviet times: http://en.wikipedia.org/wiki/Mafia_(party_game).
Java 8
standard input
[ "implementation" ]
09f5623c3717c9d360334500b198d8e0
The first line contains integer n (3 ≀ n ≀ 105). The second line contains n space-separated integers a1, a2, ..., an (1 ≀ ai ≀ 109) β€” the i-th number in the list is the number of rounds the i-th person wants to play.
1,600
In a single line print a single integer β€” the minimum number of game rounds the friends need to let the i-th person play at least ai rounds. Please, do not use the %lld specifier to read or write 64-bit integers in Π‘++. It is preferred to use the cin, cout streams or the %I64d specifier.
standard output
PASSED
24f7f8e2df55a4eacedccec34e59b7de
train_000.jsonl
1380295800
One day n friends gathered together to play "Mafia". During each round of the game some player must be the supervisor and other n - 1 people take part in the game. For each person we know in how many rounds he wants to be a player, not the supervisor: the i-th person wants to play ai rounds. What is the minimum number ...
256 megabytes
import java.util.*; import java.io.*; public class cf { static int n; static int arr[]; public static void main(String[] args) { PrintWriter out= new PrintWriter(System.out); Scanner sc = new Scanner(System.in); n=sc.nextInt(); arr=new int[n]; int max=0; l...
Java
["3\n3 2 2", "4\n2 2 2 2"]
2 seconds
["4", "3"]
NoteYou don't need to know the rules of "Mafia" to solve this problem. If you're curious, it's a game Russia got from the Soviet times: http://en.wikipedia.org/wiki/Mafia_(party_game).
Java 8
standard input
[ "implementation" ]
09f5623c3717c9d360334500b198d8e0
The first line contains integer n (3 ≀ n ≀ 105). The second line contains n space-separated integers a1, a2, ..., an (1 ≀ ai ≀ 109) β€” the i-th number in the list is the number of rounds the i-th person wants to play.
1,600
In a single line print a single integer β€” the minimum number of game rounds the friends need to let the i-th person play at least ai rounds. Please, do not use the %lld specifier to read or write 64-bit integers in Π‘++. It is preferred to use the cin, cout streams or the %I64d specifier.
standard output
PASSED
373e08fdbefbf9bbbde88cc129c241fa
train_000.jsonl
1380295800
One day n friends gathered together to play "Mafia". During each round of the game some player must be the supervisor and other n - 1 people take part in the game. For each person we know in how many rounds he wants to be a player, not the supervisor: the i-th person wants to play ai rounds. What is the minimum number ...
256 megabytes
import java.io.*; import java.util.*; public class ProblemC { InputReader in; PrintWriter out; void solve() { int n = in.nextInt(); long sum = 0; long max = 0; for (int i = 0; i < n; i++) { long cur = in.nextLong(); sum += cur; if (cur > max)...
Java
["3\n3 2 2", "4\n2 2 2 2"]
2 seconds
["4", "3"]
NoteYou don't need to know the rules of "Mafia" to solve this problem. If you're curious, it's a game Russia got from the Soviet times: http://en.wikipedia.org/wiki/Mafia_(party_game).
Java 8
standard input
[ "implementation" ]
09f5623c3717c9d360334500b198d8e0
The first line contains integer n (3 ≀ n ≀ 105). The second line contains n space-separated integers a1, a2, ..., an (1 ≀ ai ≀ 109) β€” the i-th number in the list is the number of rounds the i-th person wants to play.
1,600
In a single line print a single integer β€” the minimum number of game rounds the friends need to let the i-th person play at least ai rounds. Please, do not use the %lld specifier to read or write 64-bit integers in Π‘++. It is preferred to use the cin, cout streams or the %I64d specifier.
standard output
PASSED
42faa5ddf1dc3c3b437a5618597186c4
train_000.jsonl
1380295800
One day n friends gathered together to play "Mafia". During each round of the game some player must be the supervisor and other n - 1 people take part in the game. For each person we know in how many rounds he wants to be a player, not the supervisor: the i-th person wants to play ai rounds. What is the minimum number ...
256 megabytes
import java.io.*; import java.util.*; public class Mafia { public static void main(String[] args) throws IOException { Scanner in = new Scanner(System.in); //while(in.hasNext()) { int n = in.nextInt(); int max, temp; long sum=0; int count=0; max=0...
Java
["3\n3 2 2", "4\n2 2 2 2"]
2 seconds
["4", "3"]
NoteYou don't need to know the rules of "Mafia" to solve this problem. If you're curious, it's a game Russia got from the Soviet times: http://en.wikipedia.org/wiki/Mafia_(party_game).
Java 6
standard input
[ "implementation" ]
09f5623c3717c9d360334500b198d8e0
The first line contains integer n (3 ≀ n ≀ 105). The second line contains n space-separated integers a1, a2, ..., an (1 ≀ ai ≀ 109) β€” the i-th number in the list is the number of rounds the i-th person wants to play.
1,600
In a single line print a single integer β€” the minimum number of game rounds the friends need to let the i-th person play at least ai rounds. Please, do not use the %lld specifier to read or write 64-bit integers in Π‘++. It is preferred to use the cin, cout streams or the %I64d specifier.
standard output
PASSED
435349247a90e04a35069ddadb3f8e10
train_000.jsonl
1380295800
One day n friends gathered together to play "Mafia". During each round of the game some player must be the supervisor and other n - 1 people take part in the game. For each person we know in how many rounds he wants to be a player, not the supervisor: the i-th person wants to play ai rounds. What is the minimum number ...
256 megabytes
import java.io.BufferedReader; import java.io.InputStreamReader; public class C349 { public static void main(String[] args)throws Exception{ // TODO Auto-generated method stub new C349().run(); } int[] getArray(String line){ String[] array=line.split(" "); int[] res=ne...
Java
["3\n3 2 2", "4\n2 2 2 2"]
2 seconds
["4", "3"]
NoteYou don't need to know the rules of "Mafia" to solve this problem. If you're curious, it's a game Russia got from the Soviet times: http://en.wikipedia.org/wiki/Mafia_(party_game).
Java 6
standard input
[ "implementation" ]
09f5623c3717c9d360334500b198d8e0
The first line contains integer n (3 ≀ n ≀ 105). The second line contains n space-separated integers a1, a2, ..., an (1 ≀ ai ≀ 109) β€” the i-th number in the list is the number of rounds the i-th person wants to play.
1,600
In a single line print a single integer β€” the minimum number of game rounds the friends need to let the i-th person play at least ai rounds. Please, do not use the %lld specifier to read or write 64-bit integers in Π‘++. It is preferred to use the cin, cout streams or the %I64d specifier.
standard output
PASSED
9960ea12c7a1f7e8f5203671d59c4b0e
train_000.jsonl
1380295800
One day n friends gathered together to play "Mafia". During each round of the game some player must be the supervisor and other n - 1 people take part in the game. For each person we know in how many rounds he wants to be a player, not the supervisor: the i-th person wants to play ai rounds. What is the minimum number ...
256 megabytes
import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; import java.io.PrintStream; import java.util.Arrays; import java.util.StringTokenizer; /* * To change this template, choose Tools | Templates * and open the template in the editor. */ /** * * @author baha */ public clas...
Java
["3\n3 2 2", "4\n2 2 2 2"]
2 seconds
["4", "3"]
NoteYou don't need to know the rules of "Mafia" to solve this problem. If you're curious, it's a game Russia got from the Soviet times: http://en.wikipedia.org/wiki/Mafia_(party_game).
Java 6
standard input
[ "implementation" ]
09f5623c3717c9d360334500b198d8e0
The first line contains integer n (3 ≀ n ≀ 105). The second line contains n space-separated integers a1, a2, ..., an (1 ≀ ai ≀ 109) β€” the i-th number in the list is the number of rounds the i-th person wants to play.
1,600
In a single line print a single integer β€” the minimum number of game rounds the friends need to let the i-th person play at least ai rounds. Please, do not use the %lld specifier to read or write 64-bit integers in Π‘++. It is preferred to use the cin, cout streams or the %I64d specifier.
standard output
PASSED
9453e53fec065e8d13147597c17707b1
train_000.jsonl
1380295800
One day n friends gathered together to play "Mafia". During each round of the game some player must be the supervisor and other n - 1 people take part in the game. For each person we know in how many rounds he wants to be a player, not the supervisor: the i-th person wants to play ai rounds. What is the minimum number ...
256 megabytes
import java.io.File; import java.io.FileNotFoundException; import java.io.PrintWriter; import java.util.Arrays; import java.util.Scanner; public class Main { public static boolean ok(long n, long[] num) { long sum = 0; for (Long x : num) { if (n > x) sum += (n - x); ...
Java
["3\n3 2 2", "4\n2 2 2 2"]
2 seconds
["4", "3"]
NoteYou don't need to know the rules of "Mafia" to solve this problem. If you're curious, it's a game Russia got from the Soviet times: http://en.wikipedia.org/wiki/Mafia_(party_game).
Java 6
standard input
[ "implementation" ]
09f5623c3717c9d360334500b198d8e0
The first line contains integer n (3 ≀ n ≀ 105). The second line contains n space-separated integers a1, a2, ..., an (1 ≀ ai ≀ 109) β€” the i-th number in the list is the number of rounds the i-th person wants to play.
1,600
In a single line print a single integer β€” the minimum number of game rounds the friends need to let the i-th person play at least ai rounds. Please, do not use the %lld specifier to read or write 64-bit integers in Π‘++. It is preferred to use the cin, cout streams or the %I64d specifier.
standard output
PASSED
9c4e55bd8c7a03849d59fac55e50089f
train_000.jsonl
1380295800
One day n friends gathered together to play "Mafia". During each round of the game some player must be the supervisor and other n - 1 people take part in the game. For each person we know in how many rounds he wants to be a player, not the supervisor: the i-th person wants to play ai rounds. What is the minimum number ...
256 megabytes
import java.util.Arrays; import java.util.Scanner; public class C { public static void main(String[] args) { Scanner in = new Scanner(System.in); int n = in.nextInt(); long[] a = new long[n]; for (int i = 0; i < a.length; i++) { a[i] = in.nextLong(); } ...
Java
["3\n3 2 2", "4\n2 2 2 2"]
2 seconds
["4", "3"]
NoteYou don't need to know the rules of "Mafia" to solve this problem. If you're curious, it's a game Russia got from the Soviet times: http://en.wikipedia.org/wiki/Mafia_(party_game).
Java 6
standard input
[ "implementation" ]
09f5623c3717c9d360334500b198d8e0
The first line contains integer n (3 ≀ n ≀ 105). The second line contains n space-separated integers a1, a2, ..., an (1 ≀ ai ≀ 109) β€” the i-th number in the list is the number of rounds the i-th person wants to play.
1,600
In a single line print a single integer β€” the minimum number of game rounds the friends need to let the i-th person play at least ai rounds. Please, do not use the %lld specifier to read or write 64-bit integers in Π‘++. It is preferred to use the cin, cout streams or the %I64d specifier.
standard output
PASSED
936ed3ed24f3d01d68c512feeadcf0c0
train_000.jsonl
1380295800
One day n friends gathered together to play "Mafia". During each round of the game some player must be the supervisor and other n - 1 people take part in the game. For each person we know in how many rounds he wants to be a player, not the supervisor: the i-th person wants to play ai rounds. What is the minimum number ...
256 megabytes
import java.util.*; import java.io.*; public class a { static long mod = 1000000007; public static void main(String[] args) throws IOException { // Scanner input = new Scanner(new File("input.txt")); // PrintWriter out = new PrintWriter(new File("output.txt")); input.init(System.in); ...
Java
["3\n3 2 2", "4\n2 2 2 2"]
2 seconds
["4", "3"]
NoteYou don't need to know the rules of "Mafia" to solve this problem. If you're curious, it's a game Russia got from the Soviet times: http://en.wikipedia.org/wiki/Mafia_(party_game).
Java 6
standard input
[ "implementation" ]
09f5623c3717c9d360334500b198d8e0
The first line contains integer n (3 ≀ n ≀ 105). The second line contains n space-separated integers a1, a2, ..., an (1 ≀ ai ≀ 109) β€” the i-th number in the list is the number of rounds the i-th person wants to play.
1,600
In a single line print a single integer β€” the minimum number of game rounds the friends need to let the i-th person play at least ai rounds. Please, do not use the %lld specifier to read or write 64-bit integers in Π‘++. It is preferred to use the cin, cout streams or the %I64d specifier.
standard output
PASSED
27035690a5935fc96993a3cefa875702
train_000.jsonl
1380295800
One day n friends gathered together to play "Mafia". During each round of the game some player must be the supervisor and other n - 1 people take part in the game. For each person we know in how many rounds he wants to be a player, not the supervisor: the i-th person wants to play ai rounds. What is the minimum number ...
256 megabytes
import java.util.*; public class B { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int n = sc.nextInt(); int a[] = new int[n]; long max = 0, t = 0; for (int i = 0; i < n; i++) { max = Math.max(max, a[i] = sc.nextInt()); ...
Java
["3\n3 2 2", "4\n2 2 2 2"]
2 seconds
["4", "3"]
NoteYou don't need to know the rules of "Mafia" to solve this problem. If you're curious, it's a game Russia got from the Soviet times: http://en.wikipedia.org/wiki/Mafia_(party_game).
Java 6
standard input
[ "implementation" ]
09f5623c3717c9d360334500b198d8e0
The first line contains integer n (3 ≀ n ≀ 105). The second line contains n space-separated integers a1, a2, ..., an (1 ≀ ai ≀ 109) β€” the i-th number in the list is the number of rounds the i-th person wants to play.
1,600
In a single line print a single integer β€” the minimum number of game rounds the friends need to let the i-th person play at least ai rounds. Please, do not use the %lld specifier to read or write 64-bit integers in Π‘++. It is preferred to use the cin, cout streams or the %I64d specifier.
standard output
PASSED
2f2ae02d64353e9c929e553d1898bee0
train_000.jsonl
1271346300
Tom is interested in power consumption of his favourite laptop. His laptop has three modes. In normal mode laptop consumes P1 watt per minute. T1 minutes after Tom moved the mouse or touched the keyboard for the last time, a screensaver starts and power consumption changes to P2 watt per minute. Finally, after T2 minut...
256 megabytes
import java.util.Scanner; public class A10 { public static void main(String[] args) { Scanner sc =new Scanner(System.in); int n =sc.nextInt(); int p1=sc.nextInt(); int p2=sc.nextInt(); int p3=sc.nextInt(); int t1=sc.nextInt(); int t2=sc.nextInt(); int...
Java
["1 3 2 1 5 10\n0 10", "2 8 4 2 5 10\n20 30\n50 100"]
1 second
["30", "570"]
null
Java 8
standard input
[ "implementation" ]
7ed9265b56ef6244f95a7a663f7860dd
The first line contains 6 integer numbers n, P1, P2, P3, T1, T2 (1 ≀ n ≀ 100, 0 ≀ P1, P2, P3 ≀ 100, 1 ≀ T1, T2 ≀ 60). The following n lines contain description of Tom's work. Each i-th of these lines contains two space-separated integers li and ri (0 ≀ li &lt; ri ≀ 1440, ri &lt; li + 1 for i &lt; n), which stand for th...
900
Output the answer to the problem.
standard output
PASSED
63b89678628447a213fe57fbde67f6f9
train_000.jsonl
1271346300
Tom is interested in power consumption of his favourite laptop. His laptop has three modes. In normal mode laptop consumes P1 watt per minute. T1 minutes after Tom moved the mouse or touched the keyboard for the last time, a screensaver starts and power consumption changes to P2 watt per minute. Finally, after T2 minut...
256 megabytes
import java.util.*; public class Trying { public static void main (String[] args) { Scanner enter = new Scanner(System.in); int n = enter.nextInt(), p1 = enter.nextInt(), p2 = enter.nextInt(), p3 = enter.nextInt(), fornow = 0, t1 = enter.nextInt(), t2 = enter.nextInt(), total ...
Java
["1 3 2 1 5 10\n0 10", "2 8 4 2 5 10\n20 30\n50 100"]
1 second
["30", "570"]
null
Java 8
standard input
[ "implementation" ]
7ed9265b56ef6244f95a7a663f7860dd
The first line contains 6 integer numbers n, P1, P2, P3, T1, T2 (1 ≀ n ≀ 100, 0 ≀ P1, P2, P3 ≀ 100, 1 ≀ T1, T2 ≀ 60). The following n lines contain description of Tom's work. Each i-th of these lines contains two space-separated integers li and ri (0 ≀ li &lt; ri ≀ 1440, ri &lt; li + 1 for i &lt; n), which stand for th...
900
Output the answer to the problem.
standard output
PASSED
80348f7a17945366efde342cbde5b9e4
train_000.jsonl
1271346300
Tom is interested in power consumption of his favourite laptop. His laptop has three modes. In normal mode laptop consumes P1 watt per minute. T1 minutes after Tom moved the mouse or touched the keyboard for the last time, a screensaver starts and power consumption changes to P2 watt per minute. Finally, after T2 minut...
256 megabytes
import java.io.*; /** * * @author SYSTEM */ public class Main { /** * @param args the command line arguments */ public static void main(String[] args) { // TODO code application logic here try { BufferedReader br = new BufferedReader(new InputStreamReade...
Java
["1 3 2 1 5 10\n0 10", "2 8 4 2 5 10\n20 30\n50 100"]
1 second
["30", "570"]
null
Java 8
standard input
[ "implementation" ]
7ed9265b56ef6244f95a7a663f7860dd
The first line contains 6 integer numbers n, P1, P2, P3, T1, T2 (1 ≀ n ≀ 100, 0 ≀ P1, P2, P3 ≀ 100, 1 ≀ T1, T2 ≀ 60). The following n lines contain description of Tom's work. Each i-th of these lines contains two space-separated integers li and ri (0 ≀ li &lt; ri ≀ 1440, ri &lt; li + 1 for i &lt; n), which stand for th...
900
Output the answer to the problem.
standard output
PASSED
7690fda92abc176e73b133bc028a2992
train_000.jsonl
1271346300
Tom is interested in power consumption of his favourite laptop. His laptop has three modes. In normal mode laptop consumes P1 watt per minute. T1 minutes after Tom moved the mouse or touched the keyboard for the last time, a screensaver starts and power consumption changes to P2 watt per minute. Finally, after T2 minut...
256 megabytes
import java.util.Scanner; public class Ishu { public static void main(String[] args) { Scanner scan=new Scanner(System.in); int n,P1,P2,P3,T1,T2,i,time,sum=0; int[][] inter=new int[2][100]; n=scan.nextInt(); P1=scan.nextInt(); P2=scan.nextInt(); P3=scan.nextInt(); //28864 T1=scan.nextInt(...
Java
["1 3 2 1 5 10\n0 10", "2 8 4 2 5 10\n20 30\n50 100"]
1 second
["30", "570"]
null
Java 8
standard input
[ "implementation" ]
7ed9265b56ef6244f95a7a663f7860dd
The first line contains 6 integer numbers n, P1, P2, P3, T1, T2 (1 ≀ n ≀ 100, 0 ≀ P1, P2, P3 ≀ 100, 1 ≀ T1, T2 ≀ 60). The following n lines contain description of Tom's work. Each i-th of these lines contains two space-separated integers li and ri (0 ≀ li &lt; ri ≀ 1440, ri &lt; li + 1 for i &lt; n), which stand for th...
900
Output the answer to the problem.
standard output
PASSED
27988ea36681841d10d654b8cc64d3fa
train_000.jsonl
1271346300
Tom is interested in power consumption of his favourite laptop. His laptop has three modes. In normal mode laptop consumes P1 watt per minute. T1 minutes after Tom moved the mouse or touched the keyboard for the last time, a screensaver starts and power consumption changes to P2 watt per minute. Finally, after T2 minut...
256 megabytes
import java.io.*; import java.util.*; public class A { public static void solution(BufferedReader reader, PrintWriter out) throws IOException { In in = new In(reader); int n = in.nextInt(); int p1 = in.nextInt(), p2 = in.nextInt(), p3 = in.nextInt(); int t1 = in.nextInt(...
Java
["1 3 2 1 5 10\n0 10", "2 8 4 2 5 10\n20 30\n50 100"]
1 second
["30", "570"]
null
Java 8
standard input
[ "implementation" ]
7ed9265b56ef6244f95a7a663f7860dd
The first line contains 6 integer numbers n, P1, P2, P3, T1, T2 (1 ≀ n ≀ 100, 0 ≀ P1, P2, P3 ≀ 100, 1 ≀ T1, T2 ≀ 60). The following n lines contain description of Tom's work. Each i-th of these lines contains two space-separated integers li and ri (0 ≀ li &lt; ri ≀ 1440, ri &lt; li + 1 for i &lt; n), which stand for th...
900
Output the answer to the problem.
standard output
PASSED
75a418339c8637cd879382ac3651dd87
train_000.jsonl
1271346300
Tom is interested in power consumption of his favourite laptop. His laptop has three modes. In normal mode laptop consumes P1 watt per minute. T1 minutes after Tom moved the mouse or touched the keyboard for the last time, a screensaver starts and power consumption changes to P2 watt per minute. Finally, after T2 minut...
256 megabytes
import java.util.Scanner; public class Test { public static void main(String args[]) { Scanner in = new Scanner(System.in); int n = in.nextInt(); int p1 = in.nextInt(); int p2 = in.nextInt(); int p3 = in.nextInt(); int t1 = in.nextInt(); int t2 = in.nextInt(...
Java
["1 3 2 1 5 10\n0 10", "2 8 4 2 5 10\n20 30\n50 100"]
1 second
["30", "570"]
null
Java 8
standard input
[ "implementation" ]
7ed9265b56ef6244f95a7a663f7860dd
The first line contains 6 integer numbers n, P1, P2, P3, T1, T2 (1 ≀ n ≀ 100, 0 ≀ P1, P2, P3 ≀ 100, 1 ≀ T1, T2 ≀ 60). The following n lines contain description of Tom's work. Each i-th of these lines contains two space-separated integers li and ri (0 ≀ li &lt; ri ≀ 1440, ri &lt; li + 1 for i &lt; n), which stand for th...
900
Output the answer to the problem.
standard output
PASSED
3e6c92c3f92c3e69498adc211691196c
train_000.jsonl
1271346300
Tom is interested in power consumption of his favourite laptop. His laptop has three modes. In normal mode laptop consumes P1 watt per minute. T1 minutes after Tom moved the mouse or touched the keyboard for the last time, a screensaver starts and power consumption changes to P2 watt per minute. Finally, after T2 minut...
256 megabytes
import java.io.OutputStream; import java.io.IOException; import java.io.InputStream; import java.io.PrintWriter; import java.io.PrintStream; import java.util.Scanner; /** * Built using CHelper plug-in * Actual solution is at the top * * @author captainTurtle */ public class Main { public static void main(Stri...
Java
["1 3 2 1 5 10\n0 10", "2 8 4 2 5 10\n20 30\n50 100"]
1 second
["30", "570"]
null
Java 8
standard input
[ "implementation" ]
7ed9265b56ef6244f95a7a663f7860dd
The first line contains 6 integer numbers n, P1, P2, P3, T1, T2 (1 ≀ n ≀ 100, 0 ≀ P1, P2, P3 ≀ 100, 1 ≀ T1, T2 ≀ 60). The following n lines contain description of Tom's work. Each i-th of these lines contains two space-separated integers li and ri (0 ≀ li &lt; ri ≀ 1440, ri &lt; li + 1 for i &lt; n), which stand for th...
900
Output the answer to the problem.
standard output
PASSED
48ca5273902ec18185980165b39cd0d7
train_000.jsonl
1271346300
Tom is interested in power consumption of his favourite laptop. His laptop has three modes. In normal mode laptop consumes P1 watt per minute. T1 minutes after Tom moved the mouse or touched the keyboard for the last time, a screensaver starts and power consumption changes to P2 watt per minute. Finally, after T2 minut...
256 megabytes
import java.util.Scanner; public class A { private static class Work { private int l, r; public Work(int l, int r) { this.l = l; this.r = r; } public int getL() { return l; } public int getR() { return r; } ...
Java
["1 3 2 1 5 10\n0 10", "2 8 4 2 5 10\n20 30\n50 100"]
1 second
["30", "570"]
null
Java 8
standard input
[ "implementation" ]
7ed9265b56ef6244f95a7a663f7860dd
The first line contains 6 integer numbers n, P1, P2, P3, T1, T2 (1 ≀ n ≀ 100, 0 ≀ P1, P2, P3 ≀ 100, 1 ≀ T1, T2 ≀ 60). The following n lines contain description of Tom's work. Each i-th of these lines contains two space-separated integers li and ri (0 ≀ li &lt; ri ≀ 1440, ri &lt; li + 1 for i &lt; n), which stand for th...
900
Output the answer to the problem.
standard output
PASSED
ce5b0ae365636f61997c05dc33af45ba
train_000.jsonl
1271346300
Tom is interested in power consumption of his favourite laptop. His laptop has three modes. In normal mode laptop consumes P1 watt per minute. T1 minutes after Tom moved the mouse or touched the keyboard for the last time, a screensaver starts and power consumption changes to P2 watt per minute. Finally, after T2 minut...
256 megabytes
import java.util.*; import java.io.*; public class a { static long mod = 1000000000l; public static void main(String[] args) throws IOException { input.init(System.in); PrintWriter out = new PrintWriter(new OutputStreamWriter(System.out)); int n = input.nextInt(), p1 = input.nextInt(), p2 = input.nextInt(), ...
Java
["1 3 2 1 5 10\n0 10", "2 8 4 2 5 10\n20 30\n50 100"]
1 second
["30", "570"]
null
Java 8
standard input
[ "implementation" ]
7ed9265b56ef6244f95a7a663f7860dd
The first line contains 6 integer numbers n, P1, P2, P3, T1, T2 (1 ≀ n ≀ 100, 0 ≀ P1, P2, P3 ≀ 100, 1 ≀ T1, T2 ≀ 60). The following n lines contain description of Tom's work. Each i-th of these lines contains two space-separated integers li and ri (0 ≀ li &lt; ri ≀ 1440, ri &lt; li + 1 for i &lt; n), which stand for th...
900
Output the answer to the problem.
standard output
PASSED
3a9351f68766c167af324f17691706e4
train_000.jsonl
1271346300
Tom is interested in power consumption of his favourite laptop. His laptop has three modes. In normal mode laptop consumes P1 watt per minute. T1 minutes after Tom moved the mouse or touched the keyboard for the last time, a screensaver starts and power consumption changes to P2 watt per minute. Finally, after T2 minut...
256 megabytes
import java.io.*; public class CF10A { static String[] ins; static int N, s, e; static long ans = 0; static int[] p = new int[3]; static int[] t = new int[2]; public static void main(String[] args) throws IOException { BufferedReader br = new BufferedReader(new InputStreamReader(System....
Java
["1 3 2 1 5 10\n0 10", "2 8 4 2 5 10\n20 30\n50 100"]
1 second
["30", "570"]
null
Java 8
standard input
[ "implementation" ]
7ed9265b56ef6244f95a7a663f7860dd
The first line contains 6 integer numbers n, P1, P2, P3, T1, T2 (1 ≀ n ≀ 100, 0 ≀ P1, P2, P3 ≀ 100, 1 ≀ T1, T2 ≀ 60). The following n lines contain description of Tom's work. Each i-th of these lines contains two space-separated integers li and ri (0 ≀ li &lt; ri ≀ 1440, ri &lt; li + 1 for i &lt; n), which stand for th...
900
Output the answer to the problem.
standard output
PASSED
e86f2e308a5145ccb1d822d369e7561d
train_000.jsonl
1271346300
Tom is interested in power consumption of his favourite laptop. His laptop has three modes. In normal mode laptop consumes P1 watt per minute. T1 minutes after Tom moved the mouse or touched the keyboard for the last time, a screensaver starts and power consumption changes to P2 watt per minute. Finally, after T2 minut...
256 megabytes
import java.io.BufferedReader; import java.io.FileReader; import java.io.IOException; import java.io.InputStream; import java.io.InputStreamReader; import java.io.PrintWriter; import java.util.StringTokenizer; public class A { public static void main(String[] args) throws IOException { Scanner sc = new Scanner(S...
Java
["1 3 2 1 5 10\n0 10", "2 8 4 2 5 10\n20 30\n50 100"]
1 second
["30", "570"]
null
Java 8
standard input
[ "implementation" ]
7ed9265b56ef6244f95a7a663f7860dd
The first line contains 6 integer numbers n, P1, P2, P3, T1, T2 (1 ≀ n ≀ 100, 0 ≀ P1, P2, P3 ≀ 100, 1 ≀ T1, T2 ≀ 60). The following n lines contain description of Tom's work. Each i-th of these lines contains two space-separated integers li and ri (0 ≀ li &lt; ri ≀ 1440, ri &lt; li + 1 for i &lt; n), which stand for th...
900
Output the answer to the problem.
standard output
PASSED
bb6e7ee9356709434e6dffa624601c81
train_000.jsonl
1271346300
Tom is interested in power consumption of his favourite laptop. His laptop has three modes. In normal mode laptop consumes P1 watt per minute. T1 minutes after Tom moved the mouse or touched the keyboard for the last time, a screensaver starts and power consumption changes to P2 watt per minute. Finally, after T2 minut...
256 megabytes
import java.io.*; import java.util.*; public class CF { void realSolve() { int n = in.nextInt(); int p1 = in.nextInt(); int p2 = in.nextInt(); int p3 = in.nextInt(); int t1 = in.nextInt(); int t2 = in.nextInt(); int[] fr = new int[n]; int[] to = new int[n]; long res = 0; for (int i = 0; i < n; i+...
Java
["1 3 2 1 5 10\n0 10", "2 8 4 2 5 10\n20 30\n50 100"]
1 second
["30", "570"]
null
Java 8
standard input
[ "implementation" ]
7ed9265b56ef6244f95a7a663f7860dd
The first line contains 6 integer numbers n, P1, P2, P3, T1, T2 (1 ≀ n ≀ 100, 0 ≀ P1, P2, P3 ≀ 100, 1 ≀ T1, T2 ≀ 60). The following n lines contain description of Tom's work. Each i-th of these lines contains two space-separated integers li and ri (0 ≀ li &lt; ri ≀ 1440, ri &lt; li + 1 for i &lt; n), which stand for th...
900
Output the answer to the problem.
standard output
PASSED
67955f537c03aabaa6cad3d938cac4d0
train_000.jsonl
1271346300
Tom is interested in power consumption of his favourite laptop. His laptop has three modes. In normal mode laptop consumes P1 watt per minute. T1 minutes after Tom moved the mouse or touched the keyboard for the last time, a screensaver starts and power consumption changes to P2 watt per minute. Finally, after T2 minut...
256 megabytes
//package kitsune; import java.util.*; public class powercon { public static void main(String[] args) { // TODO Auto-generated method stub Scanner s = new Scanner(System.in); int n = s.nextInt(); int p1 = s.nextInt(); int p2 = s.nextInt(); int p3 = s.nextInt(); int t1 = s.nextInt(); int t2 = s.nextInt...
Java
["1 3 2 1 5 10\n0 10", "2 8 4 2 5 10\n20 30\n50 100"]
1 second
["30", "570"]
null
Java 8
standard input
[ "implementation" ]
7ed9265b56ef6244f95a7a663f7860dd
The first line contains 6 integer numbers n, P1, P2, P3, T1, T2 (1 ≀ n ≀ 100, 0 ≀ P1, P2, P3 ≀ 100, 1 ≀ T1, T2 ≀ 60). The following n lines contain description of Tom's work. Each i-th of these lines contains two space-separated integers li and ri (0 ≀ li &lt; ri ≀ 1440, ri &lt; li + 1 for i &lt; n), which stand for th...
900
Output the answer to the problem.
standard output
PASSED
f960e58e19dd83146c1941d7f48ff3b3
train_000.jsonl
1396798800
Mashmokh's boss, Bimokh, didn't like Mashmokh. So he fired him. Mashmokh decided to go to university and participate in ACM instead of finding a new job. He wants to become a member of Bamokh's team. In order to join he was given some programming tasks and one week to solve them. Mashmokh is not a very experienced prog...
512 megabytes
import java.io.ByteArrayInputStream; import java.io.File; import java.io.FileInputStream; import java.io.FileNotFoundException; import java.io.IOException; import java.io.InputStream; import java.io.PrintWriter; import java.nio.charset.StandardCharsets; import java.util.Arrays; import java.util.InputMismatchException; ...
Java
["2\n2 1 4 3\n4\n1 2 0 2", "1\n1 2\n3\n0 1 1"]
4 seconds
["0\n6\n6\n0", "0\n1\n0"]
NoteIf we reverse an array x[1], x[2], ..., x[n] it becomes new array y[1], y[2], ..., y[n], where y[i] = x[n - i + 1] for each i.The number of inversions of an array x[1], x[2], ..., x[n] is the number of pairs of indices i, j such that: i &lt; j and x[i] &gt; x[j].
Java 8
standard input
[ "combinatorics", "divide and conquer" ]
ea7f8bd397f80ba7d3add6f9609dcc4a
The first line of input contains a single integer nΒ (0 ≀ n ≀ 20). The second line of input contains 2n space-separated integers a[1], a[2], ..., a[2n]Β (1 ≀ a[i] ≀ 109), the initial array. The third line of input contains a single integer mΒ (1 ≀ m ≀ 106). The fourth line of input contains m space-separated integers q1...
2,100
Output m lines. In the i-th line print the answer (the number of inversions) for the i-th query.
standard output
PASSED
108146489e4de80cb3ec4be1358b7386
train_000.jsonl
1396798800
Mashmokh's boss, Bimokh, didn't like Mashmokh. So he fired him. Mashmokh decided to go to university and participate in ACM instead of finding a new job. He wants to become a member of Bamokh's team. In order to join he was given some programming tasks and one week to solve them. Mashmokh is not a very experienced prog...
512 megabytes
//package practice.E; import java.io.*; import java.util.Arrays; import java.util.HashMap; import java.util.StringTokenizer; public class CF414E { static long cur[]; static long dupl[]; static int n; static HashMap<Integer, Integer> log; public static void main(String[] args) throws IOException {...
Java
["2\n2 1 4 3\n4\n1 2 0 2", "1\n1 2\n3\n0 1 1"]
4 seconds
["0\n6\n6\n0", "0\n1\n0"]
NoteIf we reverse an array x[1], x[2], ..., x[n] it becomes new array y[1], y[2], ..., y[n], where y[i] = x[n - i + 1] for each i.The number of inversions of an array x[1], x[2], ..., x[n] is the number of pairs of indices i, j such that: i &lt; j and x[i] &gt; x[j].
Java 8
standard input
[ "combinatorics", "divide and conquer" ]
ea7f8bd397f80ba7d3add6f9609dcc4a
The first line of input contains a single integer nΒ (0 ≀ n ≀ 20). The second line of input contains 2n space-separated integers a[1], a[2], ..., a[2n]Β (1 ≀ a[i] ≀ 109), the initial array. The third line of input contains a single integer mΒ (1 ≀ m ≀ 106). The fourth line of input contains m space-separated integers q1...
2,100
Output m lines. In the i-th line print the answer (the number of inversions) for the i-th query.
standard output
PASSED
0afb73d708972a921c54796c7598bae2
train_000.jsonl
1396798800
Mashmokh's boss, Bimokh, didn't like Mashmokh. So he fired him. Mashmokh decided to go to university and participate in ACM instead of finding a new job. He wants to become a member of Bamokh's team. In order to join he was given some programming tasks and one week to solve them. Mashmokh is not a very experienced prog...
512 megabytes
import java.io.BufferedReader; import java.io.IOException; import java.io.InputStream; import java.io.InputStreamReader; import java.util.StringTokenizer; import java.io.PrintWriter; public class C414 { static class Scanner { BufferedReader br; StringTokenizer tk=new StringTokenizer(""); ...
Java
["2\n2 1 4 3\n4\n1 2 0 2", "1\n1 2\n3\n0 1 1"]
4 seconds
["0\n6\n6\n0", "0\n1\n0"]
NoteIf we reverse an array x[1], x[2], ..., x[n] it becomes new array y[1], y[2], ..., y[n], where y[i] = x[n - i + 1] for each i.The number of inversions of an array x[1], x[2], ..., x[n] is the number of pairs of indices i, j such that: i &lt; j and x[i] &gt; x[j].
Java 8
standard input
[ "combinatorics", "divide and conquer" ]
ea7f8bd397f80ba7d3add6f9609dcc4a
The first line of input contains a single integer nΒ (0 ≀ n ≀ 20). The second line of input contains 2n space-separated integers a[1], a[2], ..., a[2n]Β (1 ≀ a[i] ≀ 109), the initial array. The third line of input contains a single integer mΒ (1 ≀ m ≀ 106). The fourth line of input contains m space-separated integers q1...
2,100
Output m lines. In the i-th line print the answer (the number of inversions) for the i-th query.
standard output
PASSED
975ad4b3a3f03ad6ac0290004c760e06
train_000.jsonl
1396798800
Mashmokh's boss, Bimokh, didn't like Mashmokh. So he fired him. Mashmokh decided to go to university and participate in ACM instead of finding a new job. He wants to become a member of Bamokh's team. In order to join he was given some programming tasks and one week to solve them. Mashmokh is not a very experienced prog...
512 megabytes
import java.io.*; import java.util.*; //I am fading....... //read the question correctly (is y a vowel? what are the exact constraints?) //look out for SPECIAL CASES (n=1?) and overflow (ll vs int?) //always declare multidimensional arrays as [2][n] not [n][2] //it can lead to upto 2-3x diff in runtime public class Mai...
Java
["2\n2 1 4 3\n4\n1 2 0 2", "1\n1 2\n3\n0 1 1"]
4 seconds
["0\n6\n6\n0", "0\n1\n0"]
NoteIf we reverse an array x[1], x[2], ..., x[n] it becomes new array y[1], y[2], ..., y[n], where y[i] = x[n - i + 1] for each i.The number of inversions of an array x[1], x[2], ..., x[n] is the number of pairs of indices i, j such that: i &lt; j and x[i] &gt; x[j].
Java 8
standard input
[ "combinatorics", "divide and conquer" ]
ea7f8bd397f80ba7d3add6f9609dcc4a
The first line of input contains a single integer nΒ (0 ≀ n ≀ 20). The second line of input contains 2n space-separated integers a[1], a[2], ..., a[2n]Β (1 ≀ a[i] ≀ 109), the initial array. The third line of input contains a single integer mΒ (1 ≀ m ≀ 106). The fourth line of input contains m space-separated integers q1...
2,100
Output m lines. In the i-th line print the answer (the number of inversions) for the i-th query.
standard output
PASSED
803ee47db4e0ffb3030632b9a492cc73
train_000.jsonl
1396798800
Mashmokh's boss, Bimokh, didn't like Mashmokh. So he fired him. Mashmokh decided to go to university and participate in ACM instead of finding a new job. He wants to become a member of Bamokh's team. In order to join he was given some programming tasks and one week to solve them. Mashmokh is not a very experienced prog...
512 megabytes
import java.io.*; import java.math.*; import java.util.*; import java.util.stream.*; public class Main { int n,a[]; long dp[][],seg[]; void m(ArrayList<Integer> al,ArrayList<Integer> al1,ArrayList<Integer> al2,int l,int node){ int sz1=al1.size(),sz2=al2.size(); int p1=0,p2=...
Java
["2\n2 1 4 3\n4\n1 2 0 2", "1\n1 2\n3\n0 1 1"]
4 seconds
["0\n6\n6\n0", "0\n1\n0"]
NoteIf we reverse an array x[1], x[2], ..., x[n] it becomes new array y[1], y[2], ..., y[n], where y[i] = x[n - i + 1] for each i.The number of inversions of an array x[1], x[2], ..., x[n] is the number of pairs of indices i, j such that: i &lt; j and x[i] &gt; x[j].
Java 8
standard input
[ "combinatorics", "divide and conquer" ]
ea7f8bd397f80ba7d3add6f9609dcc4a
The first line of input contains a single integer nΒ (0 ≀ n ≀ 20). The second line of input contains 2n space-separated integers a[1], a[2], ..., a[2n]Β (1 ≀ a[i] ≀ 109), the initial array. The third line of input contains a single integer mΒ (1 ≀ m ≀ 106). The fourth line of input contains m space-separated integers q1...
2,100
Output m lines. In the i-th line print the answer (the number of inversions) for the i-th query.
standard output
PASSED
89e4ca11588e5a147a2aa8752b0fcaf7
train_000.jsonl
1396798800
Mashmokh's boss, Bimokh, didn't like Mashmokh. So he fired him. Mashmokh decided to go to university and participate in ACM instead of finding a new job. He wants to become a member of Bamokh's team. In order to join he was given some programming tasks and one week to solve them. Mashmokh is not a very experienced prog...
512 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.Arrays; import java.util.InputMismatchException; import java.util.Iterator; public...
Java
["2\n2 1 4 3\n4\n1 2 0 2", "1\n1 2\n3\n0 1 1"]
4 seconds
["0\n6\n6\n0", "0\n1\n0"]
NoteIf we reverse an array x[1], x[2], ..., x[n] it becomes new array y[1], y[2], ..., y[n], where y[i] = x[n - i + 1] for each i.The number of inversions of an array x[1], x[2], ..., x[n] is the number of pairs of indices i, j such that: i &lt; j and x[i] &gt; x[j].
Java 8
standard input
[ "combinatorics", "divide and conquer" ]
ea7f8bd397f80ba7d3add6f9609dcc4a
The first line of input contains a single integer nΒ (0 ≀ n ≀ 20). The second line of input contains 2n space-separated integers a[1], a[2], ..., a[2n]Β (1 ≀ a[i] ≀ 109), the initial array. The third line of input contains a single integer mΒ (1 ≀ m ≀ 106). The fourth line of input contains m space-separated integers q1...
2,100
Output m lines. In the i-th line print the answer (the number of inversions) for the i-th query.
standard output
PASSED
2628104178891576a664e4b92ee1c434
train_000.jsonl
1396798800
Mashmokh's boss, Bimokh, didn't like Mashmokh. So he fired him. Mashmokh decided to go to university and participate in ACM instead of finding a new job. He wants to become a member of Bamokh's team. In order to join he was given some programming tasks and one week to solve them. Mashmokh is not a very experienced prog...
512 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\n2 1 4 3\n4\n1 2 0 2", "1\n1 2\n3\n0 1 1"]
4 seconds
["0\n6\n6\n0", "0\n1\n0"]
NoteIf we reverse an array x[1], x[2], ..., x[n] it becomes new array y[1], y[2], ..., y[n], where y[i] = x[n - i + 1] for each i.The number of inversions of an array x[1], x[2], ..., x[n] is the number of pairs of indices i, j such that: i &lt; j and x[i] &gt; x[j].
Java 8
standard input
[ "combinatorics", "divide and conquer" ]
ea7f8bd397f80ba7d3add6f9609dcc4a
The first line of input contains a single integer nΒ (0 ≀ n ≀ 20). The second line of input contains 2n space-separated integers a[1], a[2], ..., a[2n]Β (1 ≀ a[i] ≀ 109), the initial array. The third line of input contains a single integer mΒ (1 ≀ m ≀ 106). The fourth line of input contains m space-separated integers q1...
2,100
Output m lines. In the i-th line print the answer (the number of inversions) for the i-th query.
standard output
PASSED
1b6ce5fd8d44ffd0661bf0ae5d9a9fb0
train_000.jsonl
1396798800
Mashmokh's boss, Bimokh, didn't like Mashmokh. So he fired him. Mashmokh decided to go to university and participate in ACM instead of finding a new job. He wants to become a member of Bamokh's team. In order to join he was given some programming tasks and one week to solve them. Mashmokh is not a very experienced prog...
512 megabytes
import java.io.OutputStream; import java.io.IOException; import java.io.InputStream; import java.io.PrintWriter; import java.util.InputMismatchException; import java.io.IOException; import java.io.InputStream; /** * Built using CHelper plug-in * Actual solution is at the top */ public class Main { public static...
Java
["2\n2 1 4 3\n4\n1 2 0 2", "1\n1 2\n3\n0 1 1"]
4 seconds
["0\n6\n6\n0", "0\n1\n0"]
NoteIf we reverse an array x[1], x[2], ..., x[n] it becomes new array y[1], y[2], ..., y[n], where y[i] = x[n - i + 1] for each i.The number of inversions of an array x[1], x[2], ..., x[n] is the number of pairs of indices i, j such that: i &lt; j and x[i] &gt; x[j].
Java 8
standard input
[ "combinatorics", "divide and conquer" ]
ea7f8bd397f80ba7d3add6f9609dcc4a
The first line of input contains a single integer nΒ (0 ≀ n ≀ 20). The second line of input contains 2n space-separated integers a[1], a[2], ..., a[2n]Β (1 ≀ a[i] ≀ 109), the initial array. The third line of input contains a single integer mΒ (1 ≀ m ≀ 106). The fourth line of input contains m space-separated integers q1...
2,100
Output m lines. In the i-th line print the answer (the number of inversions) for the i-th query.
standard output
PASSED
bf0dc18483d1da67c029051827784d9a
train_000.jsonl
1396798800
Mashmokh's boss, Bimokh, didn't like Mashmokh. So he fired him. Mashmokh decided to go to university and participate in ACM instead of finding a new job. He wants to become a member of Bamokh's team. In order to join he was given some programming tasks and one week to solve them. Mashmokh is not a very experienced prog...
512 megabytes
import java.io.*; import java.util.*; public class Mn { FastScanner in; PrintWriter out; long[] inv1, inv2; int[] tmp = new int[1 << 21]; void go(int[] a, int l, int r, int h) { if (l == r) { return; } else { int m = (l + r) >> 1; m++; ...
Java
["2\n2 1 4 3\n4\n1 2 0 2", "1\n1 2\n3\n0 1 1"]
4 seconds
["0\n6\n6\n0", "0\n1\n0"]
NoteIf we reverse an array x[1], x[2], ..., x[n] it becomes new array y[1], y[2], ..., y[n], where y[i] = x[n - i + 1] for each i.The number of inversions of an array x[1], x[2], ..., x[n] is the number of pairs of indices i, j such that: i &lt; j and x[i] &gt; x[j].
Java 8
standard input
[ "combinatorics", "divide and conquer" ]
ea7f8bd397f80ba7d3add6f9609dcc4a
The first line of input contains a single integer nΒ (0 ≀ n ≀ 20). The second line of input contains 2n space-separated integers a[1], a[2], ..., a[2n]Β (1 ≀ a[i] ≀ 109), the initial array. The third line of input contains a single integer mΒ (1 ≀ m ≀ 106). The fourth line of input contains m space-separated integers q1...
2,100
Output m lines. In the i-th line print the answer (the number of inversions) for the i-th query.
standard output