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
cc4bd913258499eede67360abafe1602
train_000.jsonl
1267117200
The Olympic Games in Bercouver are in full swing now. Here everyone has their own objectives: sportsmen compete for medals, and sport commentators compete for more convenient positions to give a running commentary. Today the main sport events take place at three round stadiums, and the commentator's objective is to cho...
64 megabytes
import java.io.*; import java.util.*; public class Comments implements Runnable { static class Circle { double x; double y; double r; Circle(double x, double y, double r) { this.x = x; this.y = y; this.r = r; } public Circle swap...
Java
["0 0 10\n60 0 10\n30 30 10"]
1 second
["30.00000 0.00000"]
null
Java 8
standard input
[ "geometry" ]
9829e1913e64072aadc9df5cddb63573
The input data consists of three lines, each of them describes the position of one stadium. The lines have the format x,  y,  r, where (x, y) are the coordinates of the stadium's center ( -  103 ≤ x,  y ≤ 103), and r (1 ≤ r  ≤ 103) is its radius. All the numbers in the input data are integer, stadiums do not have commo...
2,600
Print the coordinates of the required point with five digits after the decimal point. If there is no answer meeting the conditions, the program shouldn't print anything. The output data should be left blank.
standard output
PASSED
d1919199d00f776e7cdd2c7f77f34624
train_000.jsonl
1267117200
The Olympic Games in Bercouver are in full swing now. Here everyone has their own objectives: sportsmen compete for medals, and sport commentators compete for more convenient positions to give a running commentary. Today the main sport events take place at three round stadiums, and the commentator's objective is to cho...
64 megabytes
import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; import java.util.Collections; import static java.lang.Math.*; import static java.util.Arrays.asList; import static java.util.Comparator.comparing; public class Main { public static void main(String[] args) throws IOExcept...
Java
["0 0 10\n60 0 10\n30 30 10"]
1 second
["30.00000 0.00000"]
null
Java 8
standard input
[ "geometry" ]
9829e1913e64072aadc9df5cddb63573
The input data consists of three lines, each of them describes the position of one stadium. The lines have the format x,  y,  r, where (x, y) are the coordinates of the stadium's center ( -  103 ≤ x,  y ≤ 103), and r (1 ≤ r  ≤ 103) is its radius. All the numbers in the input data are integer, stadiums do not have commo...
2,600
Print the coordinates of the required point with five digits after the decimal point. If there is no answer meeting the conditions, the program shouldn't print anything. The output data should be left blank.
standard output
PASSED
dbd3f672d8f9851cf7469f9698e769c6
train_000.jsonl
1267117200
The Olympic Games in Bercouver are in full swing now. Here everyone has their own objectives: sportsmen compete for medals, and sport commentators compete for more convenient positions to give a running commentary. Today the main sport events take place at three round stadiums, and the commentator's objective is to cho...
64 megabytes
import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; import static java.lang.Math.max; import static java.lang.Math.sqrt; public class Main { public static void main(String[] args) throws IOException { BufferedReader br = new BufferedReader(new InputStreamReader(Sys...
Java
["0 0 10\n60 0 10\n30 30 10"]
1 second
["30.00000 0.00000"]
null
Java 8
standard input
[ "geometry" ]
9829e1913e64072aadc9df5cddb63573
The input data consists of three lines, each of them describes the position of one stadium. The lines have the format x,  y,  r, where (x, y) are the coordinates of the stadium's center ( -  103 ≤ x,  y ≤ 103), and r (1 ≤ r  ≤ 103) is its radius. All the numbers in the input data are integer, stadiums do not have commo...
2,600
Print the coordinates of the required point with five digits after the decimal point. If there is no answer meeting the conditions, the program shouldn't print anything. The output data should be left blank.
standard output
PASSED
5cd110d142ab60cd92a26e09b8f93dc2
train_000.jsonl
1267117200
The Olympic Games in Bercouver are in full swing now. Here everyone has their own objectives: sportsmen compete for medals, and sport commentators compete for more convenient positions to give a running commentary. Today the main sport events take place at three round stadiums, and the commentator's objective is to cho...
64 megabytes
import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; import static java.lang.Math.max; import static java.lang.Math.sqrt; public class Main { public static void main(String[] args) throws IOException { BufferedReader br = new BufferedReader(new InputStreamReader(Sys...
Java
["0 0 10\n60 0 10\n30 30 10"]
1 second
["30.00000 0.00000"]
null
Java 8
standard input
[ "geometry" ]
9829e1913e64072aadc9df5cddb63573
The input data consists of three lines, each of them describes the position of one stadium. The lines have the format x,  y,  r, where (x, y) are the coordinates of the stadium's center ( -  103 ≤ x,  y ≤ 103), and r (1 ≤ r  ≤ 103) is its radius. All the numbers in the input data are integer, stadiums do not have commo...
2,600
Print the coordinates of the required point with five digits after the decimal point. If there is no answer meeting the conditions, the program shouldn't print anything. The output data should be left blank.
standard output
PASSED
3d7e2291665226311f7c4ab643a866fd
train_000.jsonl
1267117200
The Olympic Games in Bercouver are in full swing now. Here everyone has their own objectives: sportsmen compete for medals, and sport commentators compete for more convenient positions to give a running commentary. Today the main sport events take place at three round stadiums, and the commentator's objective is to cho...
64 megabytes
import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; import static java.lang.Math.max; import static java.lang.Math.sqrt; public class Main { public static void main(String[] args) throws IOException { BufferedReader br = new BufferedReader(new InputStreamReader(Sys...
Java
["0 0 10\n60 0 10\n30 30 10"]
1 second
["30.00000 0.00000"]
null
Java 8
standard input
[ "geometry" ]
9829e1913e64072aadc9df5cddb63573
The input data consists of three lines, each of them describes the position of one stadium. The lines have the format x,  y,  r, where (x, y) are the coordinates of the stadium's center ( -  103 ≤ x,  y ≤ 103), and r (1 ≤ r  ≤ 103) is its radius. All the numbers in the input data are integer, stadiums do not have commo...
2,600
Print the coordinates of the required point with five digits after the decimal point. If there is no answer meeting the conditions, the program shouldn't print anything. The output data should be left blank.
standard output
PASSED
d8a3e42fa33516709cdc634c5586356c
train_000.jsonl
1267117200
The Olympic Games in Bercouver are in full swing now. Here everyone has their own objectives: sportsmen compete for medals, and sport commentators compete for more convenient positions to give a running commentary. Today the main sport events take place at three round stadiums, and the commentator's objective is to cho...
64 megabytes
import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; import java.util.Collections; import static java.lang.Math.*; import static java.util.Arrays.asList; import static java.util.Comparator.comparing; public class Main { public static void main(String[] args) throws IOExcept...
Java
["0 0 10\n60 0 10\n30 30 10"]
1 second
["30.00000 0.00000"]
null
Java 8
standard input
[ "geometry" ]
9829e1913e64072aadc9df5cddb63573
The input data consists of three lines, each of them describes the position of one stadium. The lines have the format x,  y,  r, where (x, y) are the coordinates of the stadium's center ( -  103 ≤ x,  y ≤ 103), and r (1 ≤ r  ≤ 103) is its radius. All the numbers in the input data are integer, stadiums do not have commo...
2,600
Print the coordinates of the required point with five digits after the decimal point. If there is no answer meeting the conditions, the program shouldn't print anything. The output data should be left blank.
standard output
PASSED
32bb9539cbdb45e1a19c7cadf06da816
train_000.jsonl
1267117200
The Olympic Games in Bercouver are in full swing now. Here everyone has their own objectives: sportsmen compete for medals, and sport commentators compete for more convenient positions to give a running commentary. Today the main sport events take place at three round stadiums, and the commentator's objective is to cho...
64 megabytes
import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; import static java.lang.Math.max; import static java.lang.Math.sqrt; public class Main { public static void main(String[] args) throws IOException { BufferedReader br = new BufferedReader(new InputStreamReader(Sys...
Java
["0 0 10\n60 0 10\n30 30 10"]
1 second
["30.00000 0.00000"]
null
Java 8
standard input
[ "geometry" ]
9829e1913e64072aadc9df5cddb63573
The input data consists of three lines, each of them describes the position of one stadium. The lines have the format x,  y,  r, where (x, y) are the coordinates of the stadium's center ( -  103 ≤ x,  y ≤ 103), and r (1 ≤ r  ≤ 103) is its radius. All the numbers in the input data are integer, stadiums do not have commo...
2,600
Print the coordinates of the required point with five digits after the decimal point. If there is no answer meeting the conditions, the program shouldn't print anything. The output data should be left blank.
standard output
PASSED
484b157955d6d903d36c67350d8c076e
train_000.jsonl
1267117200
The Olympic Games in Bercouver are in full swing now. Here everyone has their own objectives: sportsmen compete for medals, and sport commentators compete for more convenient positions to give a running commentary. Today the main sport events take place at three round stadiums, and the commentator's objective is to cho...
64 megabytes
import java.text.DecimalFormat; import java.util.Scanner; public class Main2 { class circle{ double x,y; double r; } circle[] circ = new circle[3]; public double dis(double x, double y, circle c){ return Math.sqrt((x-c.x)*(x-c.x) + (y-c.y)*(y-c.y)); } public double cost(double x, double y){ double...
Java
["0 0 10\n60 0 10\n30 30 10"]
1 second
["30.00000 0.00000"]
null
Java 8
standard input
[ "geometry" ]
9829e1913e64072aadc9df5cddb63573
The input data consists of three lines, each of them describes the position of one stadium. The lines have the format x,  y,  r, where (x, y) are the coordinates of the stadium's center ( -  103 ≤ x,  y ≤ 103), and r (1 ≤ r  ≤ 103) is its radius. All the numbers in the input data are integer, stadiums do not have commo...
2,600
Print the coordinates of the required point with five digits after the decimal point. If there is no answer meeting the conditions, the program shouldn't print anything. The output data should be left blank.
standard output
PASSED
d5fe5b35f07924a21fb3e39562986e95
train_000.jsonl
1267117200
The Olympic Games in Bercouver are in full swing now. Here everyone has their own objectives: sportsmen compete for medals, and sport commentators compete for more convenient positions to give a running commentary. Today the main sport events take place at three round stadiums, and the commentator's objective is to cho...
64 megabytes
import java.util.*; public class Main { static Point[] cs; static double[] rs; static double fit(Point p) { double[] asist = new double[3]; for (int i = 0; i < 3; i++) { asist[i] = ang(p, cs[i], rs[i]); } return (asist[0] - asist[1]) * (asist[0] - asist[1]) + (a...
Java
["0 0 10\n60 0 10\n30 30 10"]
1 second
["30.00000 0.00000"]
null
Java 8
standard input
[ "geometry" ]
9829e1913e64072aadc9df5cddb63573
The input data consists of three lines, each of them describes the position of one stadium. The lines have the format x,  y,  r, where (x, y) are the coordinates of the stadium's center ( -  103 ≤ x,  y ≤ 103), and r (1 ≤ r  ≤ 103) is its radius. All the numbers in the input data are integer, stadiums do not have commo...
2,600
Print the coordinates of the required point with five digits after the decimal point. If there is no answer meeting the conditions, the program shouldn't print anything. The output data should be left blank.
standard output
PASSED
20ab5f78ebd014335ad2354169ecd1ae
train_000.jsonl
1267117200
The Olympic Games in Bercouver are in full swing now. Here everyone has their own objectives: sportsmen compete for medals, and sport commentators compete for more convenient positions to give a running commentary. Today the main sport events take place at three round stadiums, and the commentator's objective is to cho...
64 megabytes
import java.io.BufferedReader; import java.io.InputStreamReader; import java.util.*; import static java.lang.Math.*; import static java.lang.String.format; public class CF002C { private static class Point { double x; double y; public Point(double x, double y) { this.x = x; ...
Java
["0 0 10\n60 0 10\n30 30 10"]
1 second
["30.00000 0.00000"]
null
Java 8
standard input
[ "geometry" ]
9829e1913e64072aadc9df5cddb63573
The input data consists of three lines, each of them describes the position of one stadium. The lines have the format x,  y,  r, where (x, y) are the coordinates of the stadium's center ( -  103 ≤ x,  y ≤ 103), and r (1 ≤ r  ≤ 103) is its radius. All the numbers in the input data are integer, stadiums do not have commo...
2,600
Print the coordinates of the required point with five digits after the decimal point. If there is no answer meeting the conditions, the program shouldn't print anything. The output data should be left blank.
standard output
PASSED
acd005a428978dcbd582ad264898421a
train_000.jsonl
1267117200
The Olympic Games in Bercouver are in full swing now. Here everyone has their own objectives: sportsmen compete for medals, and sport commentators compete for more convenient positions to give a running commentary. Today the main sport events take place at three round stadiums, and the commentator's objective is to cho...
64 megabytes
import java.util.Scanner; // 模拟退火 public class P2C { private static int[][] p = new int[3][3]; public static void main(String[] args) { Scanner sc = new Scanner(System.in); double x = 0.0, y = 0.0; for (int i = 0; i < 3; ++i) { for (int j = 0; j < 3; ++j) { ...
Java
["0 0 10\n60 0 10\n30 30 10"]
1 second
["30.00000 0.00000"]
null
Java 8
standard input
[ "geometry" ]
9829e1913e64072aadc9df5cddb63573
The input data consists of three lines, each of them describes the position of one stadium. The lines have the format x,  y,  r, where (x, y) are the coordinates of the stadium's center ( -  103 ≤ x,  y ≤ 103), and r (1 ≤ r  ≤ 103) is its radius. All the numbers in the input data are integer, stadiums do not have commo...
2,600
Print the coordinates of the required point with five digits after the decimal point. If there is no answer meeting the conditions, the program shouldn't print anything. The output data should be left blank.
standard output
PASSED
947c69e36031e26d8252f44fffc5b0af
train_000.jsonl
1267117200
The Olympic Games in Bercouver are in full swing now. Here everyone has their own objectives: sportsmen compete for medals, and sport commentators compete for more convenient positions to give a running commentary. Today the main sport events take place at three round stadiums, and the commentator's objective is to cho...
64 megabytes
import java.util.*; import java.io.*; import java.awt.Point; import java.math.BigDecimal; import java.math.BigInteger; import static java.lang.Math.*; // Solution is at the bottom of code public class C implements Runnable{ final boolean ONLINE_JUDGE = System.getProperty("ONLINE_JUDGE") != null; BufferedReader...
Java
["0 0 10\n60 0 10\n30 30 10"]
1 second
["30.00000 0.00000"]
null
Java 8
standard input
[ "geometry" ]
9829e1913e64072aadc9df5cddb63573
The input data consists of three lines, each of them describes the position of one stadium. The lines have the format x,  y,  r, where (x, y) are the coordinates of the stadium's center ( -  103 ≤ x,  y ≤ 103), and r (1 ≤ r  ≤ 103) is its radius. All the numbers in the input data are integer, stadiums do not have commo...
2,600
Print the coordinates of the required point with five digits after the decimal point. If there is no answer meeting the conditions, the program shouldn't print anything. The output data should be left blank.
standard output
PASSED
9e8f67fb945993b33a796282e4ecbe3a
train_000.jsonl
1267117200
The Olympic Games in Bercouver are in full swing now. Here everyone has their own objectives: sportsmen compete for medals, and sport commentators compete for more convenient positions to give a running commentary. Today the main sport events take place at three round stadiums, and the commentator's objective is to cho...
64 megabytes
import java.io.*; import java.util.*; public class Solution { private BufferedReader in; private PrintWriter out; private StringTokenizer st; public String next() throws Exception { while (st == null || !st.hasMoreElements()) { st = new StringTokenizer(in.readLine()); } ...
Java
["0 0 10\n60 0 10\n30 30 10"]
1 second
["30.00000 0.00000"]
null
Java 8
standard input
[ "geometry" ]
9829e1913e64072aadc9df5cddb63573
The input data consists of three lines, each of them describes the position of one stadium. The lines have the format x,  y,  r, where (x, y) are the coordinates of the stadium's center ( -  103 ≤ x,  y ≤ 103), and r (1 ≤ r  ≤ 103) is its radius. All the numbers in the input data are integer, stadiums do not have commo...
2,600
Print the coordinates of the required point with five digits after the decimal point. If there is no answer meeting the conditions, the program shouldn't print anything. The output data should be left blank.
standard output
PASSED
721b681ccf3799012d2df800eb58417b
train_000.jsonl
1267117200
The Olympic Games in Bercouver are in full swing now. Here everyone has their own objectives: sportsmen compete for medals, and sport commentators compete for more convenient positions to give a running commentary. Today the main sport events take place at three round stadiums, and the commentator's objective is to cho...
64 megabytes
import java.io.*; import java.util.*; public class C2 { FastScanner in; PrintWriter out; int x1, y1, r1, x2, y2, r2, x3, y3, r3; double[] getPoints(double angle) { double R1 = r1 / Math.sin(angle / 2), R2 = r2 / Math.sin(angle / 2), R3 = r3 / Math.sin(angle / 2); double A1 = x1 - x2, ...
Java
["0 0 10\n60 0 10\n30 30 10"]
1 second
["30.00000 0.00000"]
null
Java 8
standard input
[ "geometry" ]
9829e1913e64072aadc9df5cddb63573
The input data consists of three lines, each of them describes the position of one stadium. The lines have the format x,  y,  r, where (x, y) are the coordinates of the stadium's center ( -  103 ≤ x,  y ≤ 103), and r (1 ≤ r  ≤ 103) is its radius. All the numbers in the input data are integer, stadiums do not have commo...
2,600
Print the coordinates of the required point with five digits after the decimal point. If there is no answer meeting the conditions, the program shouldn't print anything. The output data should be left blank.
standard output
PASSED
4ca6fe52da7d6651178fe913952c5d66
train_000.jsonl
1267117200
The Olympic Games in Bercouver are in full swing now. Here everyone has their own objectives: sportsmen compete for medals, and sport commentators compete for more convenient positions to give a running commentary. Today the main sport events take place at three round stadiums, and the commentator's objective is to cho...
64 megabytes
import java.util.*; public class Main { public static void main(String[] args) { Scanner input = new Scanner(System.in); cs = new Point[3]; rs = new double[3]; for (int i = 0; i < 3; i++) { cs[i] = new Point(input.nextInt(), input.nextInt()); rs[i] = input.n...
Java
["0 0 10\n60 0 10\n30 30 10"]
1 second
["30.00000 0.00000"]
null
Java 8
standard input
[ "geometry" ]
9829e1913e64072aadc9df5cddb63573
The input data consists of three lines, each of them describes the position of one stadium. The lines have the format x,  y,  r, where (x, y) are the coordinates of the stadium's center ( -  103 ≤ x,  y ≤ 103), and r (1 ≤ r  ≤ 103) is its radius. All the numbers in the input data are integer, stadiums do not have commo...
2,600
Print the coordinates of the required point with five digits after the decimal point. If there is no answer meeting the conditions, the program shouldn't print anything. The output data should be left blank.
standard output
PASSED
c34cf58dfbe1568315750bfcc8c032c2
train_000.jsonl
1267117200
The Olympic Games in Bercouver are in full swing now. Here everyone has their own objectives: sportsmen compete for medals, and sport commentators compete for more convenient positions to give a running commentary. Today the main sport events take place at three round stadiums, and the commentator's objective is to cho...
64 megabytes
import java.util.Scanner; /** * 2c-commentator problem 模拟退火 * 作者:hongyanbo * 时间:2018/3/19 */ public class Main { static Circle[] circles = new Circle[3]; static class Circle{ double x,y,r; } public static void main(String[] args) { Scanner sc = new Scanner(System.in); ...
Java
["0 0 10\n60 0 10\n30 30 10"]
1 second
["30.00000 0.00000"]
null
Java 8
standard input
[ "geometry" ]
9829e1913e64072aadc9df5cddb63573
The input data consists of three lines, each of them describes the position of one stadium. The lines have the format x,  y,  r, where (x, y) are the coordinates of the stadium's center ( -  103 ≤ x,  y ≤ 103), and r (1 ≤ r  ≤ 103) is its radius. All the numbers in the input data are integer, stadiums do not have commo...
2,600
Print the coordinates of the required point with five digits after the decimal point. If there is no answer meeting the conditions, the program shouldn't print anything. The output data should be left blank.
standard output
PASSED
493f399574cec4264d6cd8046da5e45d
train_000.jsonl
1267117200
The Olympic Games in Bercouver are in full swing now. Here everyone has their own objectives: sportsmen compete for medals, and sport commentators compete for more convenient positions to give a running commentary. Today the main sport events take place at three round stadiums, and the commentator's objective is to cho...
64 megabytes
import java.io.*; import java.text.*; import java.math.*; import java.util.*; public class Main implements Runnable { final double eps = 1e-5; circle[] stad; double ans_x, ans_y, ans_r; boolean ans_found; void test2(double x, double y, int e ) { double[] rr = new double[3]; f...
Java
["0 0 10\n60 0 10\n30 30 10"]
1 second
["30.00000 0.00000"]
null
Java 8
standard input
[ "geometry" ]
9829e1913e64072aadc9df5cddb63573
The input data consists of three lines, each of them describes the position of one stadium. The lines have the format x,  y,  r, where (x, y) are the coordinates of the stadium's center ( -  103 ≤ x,  y ≤ 103), and r (1 ≤ r  ≤ 103) is its radius. All the numbers in the input data are integer, stadiums do not have commo...
2,600
Print the coordinates of the required point with five digits after the decimal point. If there is no answer meeting the conditions, the program shouldn't print anything. The output data should be left blank.
standard output
PASSED
b3e4b3e304afddd51c36c06295c00f16
train_000.jsonl
1267117200
The Olympic Games in Bercouver are in full swing now. Here everyone has their own objectives: sportsmen compete for medals, and sport commentators compete for more convenient positions to give a running commentary. Today the main sport events take place at three round stadiums, and the commentator's objective is to cho...
64 megabytes
import java.util.Scanner; public class Solution { public static double distance (double x1, double y1, double x2, double y2) { return Math.sqrt((x2 - x1)*(x2 - x1) + (y2 - y1) * (y2 - y1)); } public static void calculate_line_circle(double a, double b, double c, double x1, double y1, double...
Java
["0 0 10\n60 0 10\n30 30 10"]
1 second
["30.00000 0.00000"]
null
Java 6
standard input
[ "geometry" ]
9829e1913e64072aadc9df5cddb63573
The input data consists of three lines, each of them describes the position of one stadium. The lines have the format x,  y,  r, where (x, y) are the coordinates of the stadium's center ( -  103 ≤ x,  y ≤ 103), and r (1 ≤ r  ≤ 103) is its radius. All the numbers in the input data are integer, stadiums do not have commo...
2,600
Print the coordinates of the required point with five digits after the decimal point. If there is no answer meeting the conditions, the program shouldn't print anything. The output data should be left blank.
standard output
PASSED
a60b40d27e64373ff3c87f645c466b77
train_000.jsonl
1267117200
The Olympic Games in Bercouver are in full swing now. Here everyone has their own objectives: sportsmen compete for medals, and sport commentators compete for more convenient positions to give a running commentary. Today the main sport events take place at three round stadiums, and the commentator's objective is to cho...
64 megabytes
import java.awt.geom.Point2D; import java.io.*; import java.util.*; public class C { static Scanner in = new Scanner(new BufferedInputStream(System.in)); static PrintWriter out = new PrintWriter(System.out); static class Circle { double x, y, r; Circle(double x, double y, double r) { this.x = x; this...
Java
["0 0 10\n60 0 10\n30 30 10"]
1 second
["30.00000 0.00000"]
null
Java 6
standard input
[ "geometry" ]
9829e1913e64072aadc9df5cddb63573
The input data consists of three lines, each of them describes the position of one stadium. The lines have the format x,  y,  r, where (x, y) are the coordinates of the stadium's center ( -  103 ≤ x,  y ≤ 103), and r (1 ≤ r  ≤ 103) is its radius. All the numbers in the input data are integer, stadiums do not have commo...
2,600
Print the coordinates of the required point with five digits after the decimal point. If there is no answer meeting the conditions, the program shouldn't print anything. The output data should be left blank.
standard output
PASSED
d397aafaaa3d15830c0cf85fe7c255c7
train_000.jsonl
1267117200
The Olympic Games in Bercouver are in full swing now. Here everyone has their own objectives: sportsmen compete for medals, and sport commentators compete for more convenient positions to give a running commentary. Today the main sport events take place at three round stadiums, and the commentator's objective is to cho...
64 megabytes
import java.io.PrintWriter; import java.util.*; public class Main { static double EPS = 1e-6; int[][] dir = { { 1, 0 }, { 0, 1 }, { 0, -1 }, { -1, 0 } }; double[] x = new double[3]; double[] y = new double[3]; double[] r = new double[3]; double[] d = new double[3]; double clac(double px, ...
Java
["0 0 10\n60 0 10\n30 30 10"]
1 second
["30.00000 0.00000"]
null
Java 6
standard input
[ "geometry" ]
9829e1913e64072aadc9df5cddb63573
The input data consists of three lines, each of them describes the position of one stadium. The lines have the format x,  y,  r, where (x, y) are the coordinates of the stadium's center ( -  103 ≤ x,  y ≤ 103), and r (1 ≤ r  ≤ 103) is its radius. All the numbers in the input data are integer, stadiums do not have commo...
2,600
Print the coordinates of the required point with five digits after the decimal point. If there is no answer meeting the conditions, the program shouldn't print anything. The output data should be left blank.
standard output
PASSED
da9c8ac216145a37949d635d1c1bba88
train_000.jsonl
1267117200
The Olympic Games in Bercouver are in full swing now. Here everyone has their own objectives: sportsmen compete for medals, and sport commentators compete for more convenient positions to give a running commentary. Today the main sport events take place at three round stadiums, and the commentator's objective is to cho...
64 megabytes
import static java.lang.Math.*; import static java.lang.System.currentTimeMillis; import static java.lang.System.exit; import static java.lang.System.arraycopy; import static java.util.Arrays.sort; import static java.util.Arrays.binarySearch; import static java.util.Arrays.fill; import java.util.*; import java.io.*; /...
Java
["0 0 10\n60 0 10\n30 30 10"]
1 second
["30.00000 0.00000"]
null
Java 6
standard input
[ "geometry" ]
9829e1913e64072aadc9df5cddb63573
The input data consists of three lines, each of them describes the position of one stadium. The lines have the format x,  y,  r, where (x, y) are the coordinates of the stadium's center ( -  103 ≤ x,  y ≤ 103), and r (1 ≤ r  ≤ 103) is its radius. All the numbers in the input data are integer, stadiums do not have commo...
2,600
Print the coordinates of the required point with five digits after the decimal point. If there is no answer meeting the conditions, the program shouldn't print anything. The output data should be left blank.
standard output
PASSED
6365cccab84346b1c2eaf1ae15af6b90
train_000.jsonl
1267117200
The Olympic Games in Bercouver are in full swing now. Here everyone has their own objectives: sportsmen compete for medals, and sport commentators compete for more convenient positions to give a running commentary. Today the main sport events take place at three round stadiums, and the commentator's objective is to cho...
64 megabytes
import static java.lang.Math.*; import static java.lang.System.currentTimeMillis; import static java.lang.System.exit; import static java.lang.System.arraycopy; import static java.util.Arrays.sort; import static java.util.Arrays.binarySearch; import static java.util.Arrays.fill; import java.util.*; import java.io.*; /...
Java
["0 0 10\n60 0 10\n30 30 10"]
1 second
["30.00000 0.00000"]
null
Java 6
standard input
[ "geometry" ]
9829e1913e64072aadc9df5cddb63573
The input data consists of three lines, each of them describes the position of one stadium. The lines have the format x,  y,  r, where (x, y) are the coordinates of the stadium's center ( -  103 ≤ x,  y ≤ 103), and r (1 ≤ r  ≤ 103) is its radius. All the numbers in the input data are integer, stadiums do not have commo...
2,600
Print the coordinates of the required point with five digits after the decimal point. If there is no answer meeting the conditions, the program shouldn't print anything. The output data should be left blank.
standard output
PASSED
93f5103f941818655c1bf4e562840c77
train_000.jsonl
1267117200
The Olympic Games in Bercouver are in full swing now. Here everyone has their own objectives: sportsmen compete for medals, and sport commentators compete for more convenient positions to give a running commentary. Today the main sport events take place at three round stadiums, and the commentator's objective is to cho...
64 megabytes
import static java.lang.Math.*; import static java.lang.System.currentTimeMillis; import static java.lang.System.exit; import static java.lang.System.arraycopy; import static java.util.Arrays.sort; import static java.util.Arrays.binarySearch; import static java.util.Arrays.fill; import java.util.*; import java.io.*; /...
Java
["0 0 10\n60 0 10\n30 30 10"]
1 second
["30.00000 0.00000"]
null
Java 6
standard input
[ "geometry" ]
9829e1913e64072aadc9df5cddb63573
The input data consists of three lines, each of them describes the position of one stadium. The lines have the format x,  y,  r, where (x, y) are the coordinates of the stadium's center ( -  103 ≤ x,  y ≤ 103), and r (1 ≤ r  ≤ 103) is its radius. All the numbers in the input data are integer, stadiums do not have commo...
2,600
Print the coordinates of the required point with five digits after the decimal point. If there is no answer meeting the conditions, the program shouldn't print anything. The output data should be left blank.
standard output
PASSED
cf8bd3c084b232fe371178d096ed87b7
train_000.jsonl
1267117200
The Olympic Games in Bercouver are in full swing now. Here everyone has their own objectives: sportsmen compete for medals, and sport commentators compete for more convenient positions to give a running commentary. Today the main sport events take place at three round stadiums, and the commentator's objective is to cho...
64 megabytes
import static java.lang.Math.*; import static java.lang.System.currentTimeMillis; import static java.lang.System.exit; import static java.lang.System.arraycopy; import static java.util.Arrays.sort; import static java.util.Arrays.binarySearch; import static java.util.Arrays.fill; import java.util.*; import java.io.*; /...
Java
["0 0 10\n60 0 10\n30 30 10"]
1 second
["30.00000 0.00000"]
null
Java 6
standard input
[ "geometry" ]
9829e1913e64072aadc9df5cddb63573
The input data consists of three lines, each of them describes the position of one stadium. The lines have the format x,  y,  r, where (x, y) are the coordinates of the stadium's center ( -  103 ≤ x,  y ≤ 103), and r (1 ≤ r  ≤ 103) is its radius. All the numbers in the input data are integer, stadiums do not have commo...
2,600
Print the coordinates of the required point with five digits after the decimal point. If there is no answer meeting the conditions, the program shouldn't print anything. The output data should be left blank.
standard output
PASSED
2edf1517f0315cffa50eebf2cf6e7fed
train_000.jsonl
1267117200
The Olympic Games in Bercouver are in full swing now. Here everyone has their own objectives: sportsmen compete for medals, and sport commentators compete for more convenient positions to give a running commentary. Today the main sport events take place at three round stadiums, and the commentator's objective is to cho...
64 megabytes
import static java.lang.Math.*; import static java.lang.System.currentTimeMillis; import static java.lang.System.exit; import static java.lang.System.arraycopy; import static java.util.Arrays.sort; import static java.util.Arrays.binarySearch; import static java.util.Arrays.fill; import java.util.*; import java.io.*; /...
Java
["0 0 10\n60 0 10\n30 30 10"]
1 second
["30.00000 0.00000"]
null
Java 6
standard input
[ "geometry" ]
9829e1913e64072aadc9df5cddb63573
The input data consists of three lines, each of them describes the position of one stadium. The lines have the format x,  y,  r, where (x, y) are the coordinates of the stadium's center ( -  103 ≤ x,  y ≤ 103), and r (1 ≤ r  ≤ 103) is its radius. All the numbers in the input data are integer, stadiums do not have commo...
2,600
Print the coordinates of the required point with five digits after the decimal point. If there is no answer meeting the conditions, the program shouldn't print anything. The output data should be left blank.
standard output
PASSED
f3bfdd2ed4ba95247aa44154e63a1e15
train_000.jsonl
1267117200
The Olympic Games in Bercouver are in full swing now. Here everyone has their own objectives: sportsmen compete for medals, and sport commentators compete for more convenient positions to give a running commentary. Today the main sport events take place at three round stadiums, and the commentator's objective is to cho...
64 megabytes
import static java.lang.Math.*; import static java.lang.System.currentTimeMillis; import static java.lang.System.exit; import static java.lang.System.arraycopy; import static java.util.Arrays.sort; import static java.util.Arrays.binarySearch; import static java.util.Arrays.fill; import java.util.*; import java.io.*; /...
Java
["0 0 10\n60 0 10\n30 30 10"]
1 second
["30.00000 0.00000"]
null
Java 6
standard input
[ "geometry" ]
9829e1913e64072aadc9df5cddb63573
The input data consists of three lines, each of them describes the position of one stadium. The lines have the format x,  y,  r, where (x, y) are the coordinates of the stadium's center ( -  103 ≤ x,  y ≤ 103), and r (1 ≤ r  ≤ 103) is its radius. All the numbers in the input data are integer, stadiums do not have commo...
2,600
Print the coordinates of the required point with five digits after the decimal point. If there is no answer meeting the conditions, the program shouldn't print anything. The output data should be left blank.
standard output
PASSED
a97d0a33000022c448bff532d897936a
train_000.jsonl
1267117200
The Olympic Games in Bercouver are in full swing now. Here everyone has their own objectives: sportsmen compete for medals, and sport commentators compete for more convenient positions to give a running commentary. Today the main sport events take place at three round stadiums, and the commentator's objective is to cho...
64 megabytes
import static java.lang.Math.*; import static java.lang.System.currentTimeMillis; import static java.lang.System.exit; import static java.lang.System.arraycopy; import static java.util.Arrays.sort; import static java.util.Arrays.binarySearch; import static java.util.Arrays.fill; import java.util.*; import java.io.*; /...
Java
["0 0 10\n60 0 10\n30 30 10"]
1 second
["30.00000 0.00000"]
null
Java 6
standard input
[ "geometry" ]
9829e1913e64072aadc9df5cddb63573
The input data consists of three lines, each of them describes the position of one stadium. The lines have the format x,  y,  r, where (x, y) are the coordinates of the stadium's center ( -  103 ≤ x,  y ≤ 103), and r (1 ≤ r  ≤ 103) is its radius. All the numbers in the input data are integer, stadiums do not have commo...
2,600
Print the coordinates of the required point with five digits after the decimal point. If there is no answer meeting the conditions, the program shouldn't print anything. The output data should be left blank.
standard output
PASSED
ea1c806c30ae30f3c9348908e9ecd9f7
train_000.jsonl
1267117200
The Olympic Games in Bercouver are in full swing now. Here everyone has their own objectives: sportsmen compete for medals, and sport commentators compete for more convenient positions to give a running commentary. Today the main sport events take place at three round stadiums, and the commentator's objective is to cho...
64 megabytes
import static java.lang.Math.*; import static java.lang.System.currentTimeMillis; import static java.lang.System.exit; import static java.lang.System.arraycopy; import static java.util.Arrays.sort; import static java.util.Arrays.binarySearch; import static java.util.Arrays.fill; import java.util.*; import java.io.*; /...
Java
["0 0 10\n60 0 10\n30 30 10"]
1 second
["30.00000 0.00000"]
null
Java 6
standard input
[ "geometry" ]
9829e1913e64072aadc9df5cddb63573
The input data consists of three lines, each of them describes the position of one stadium. The lines have the format x,  y,  r, where (x, y) are the coordinates of the stadium's center ( -  103 ≤ x,  y ≤ 103), and r (1 ≤ r  ≤ 103) is its radius. All the numbers in the input data are integer, stadiums do not have commo...
2,600
Print the coordinates of the required point with five digits after the decimal point. If there is no answer meeting the conditions, the program shouldn't print anything. The output data should be left blank.
standard output
PASSED
6166ea9e2e610c32a3a51beecc9ee626
train_000.jsonl
1267117200
The Olympic Games in Bercouver are in full swing now. Here everyone has their own objectives: sportsmen compete for medals, and sport commentators compete for more convenient positions to give a running commentary. Today the main sport events take place at three round stadiums, and the commentator's objective is to cho...
64 megabytes
import static java.lang.Math.*; import static java.lang.System.currentTimeMillis; import static java.lang.System.exit; import static java.lang.System.arraycopy; import static java.util.Arrays.sort; import static java.util.Arrays.binarySearch; import static java.util.Arrays.fill; import java.util.*; import java.io.*; /...
Java
["0 0 10\n60 0 10\n30 30 10"]
1 second
["30.00000 0.00000"]
null
Java 6
standard input
[ "geometry" ]
9829e1913e64072aadc9df5cddb63573
The input data consists of three lines, each of them describes the position of one stadium. The lines have the format x,  y,  r, where (x, y) are the coordinates of the stadium's center ( -  103 ≤ x,  y ≤ 103), and r (1 ≤ r  ≤ 103) is its radius. All the numbers in the input data are integer, stadiums do not have commo...
2,600
Print the coordinates of the required point with five digits after the decimal point. If there is no answer meeting the conditions, the program shouldn't print anything. The output data should be left blank.
standard output
PASSED
309a0a57b54058f378abea37258d3dc0
train_000.jsonl
1267117200
The Olympic Games in Bercouver are in full swing now. Here everyone has their own objectives: sportsmen compete for medals, and sport commentators compete for more convenient positions to give a running commentary. Today the main sport events take place at three round stadiums, and the commentator's objective is to cho...
64 megabytes
import static java.lang.Math.*; import static java.lang.System.currentTimeMillis; import static java.lang.System.exit; import static java.lang.System.arraycopy; import static java.util.Arrays.sort; import static java.util.Arrays.binarySearch; import static java.util.Arrays.fill; import java.util.*; import java.io.*; /...
Java
["0 0 10\n60 0 10\n30 30 10"]
1 second
["30.00000 0.00000"]
null
Java 6
standard input
[ "geometry" ]
9829e1913e64072aadc9df5cddb63573
The input data consists of three lines, each of them describes the position of one stadium. The lines have the format x,  y,  r, where (x, y) are the coordinates of the stadium's center ( -  103 ≤ x,  y ≤ 103), and r (1 ≤ r  ≤ 103) is its radius. All the numbers in the input data are integer, stadiums do not have commo...
2,600
Print the coordinates of the required point with five digits after the decimal point. If there is no answer meeting the conditions, the program shouldn't print anything. The output data should be left blank.
standard output
PASSED
447d7366dd4a9189ff85ff8db7790ebb
train_000.jsonl
1267117200
The Olympic Games in Bercouver are in full swing now. Here everyone has their own objectives: sportsmen compete for medals, and sport commentators compete for more convenient positions to give a running commentary. Today the main sport events take place at three round stadiums, and the commentator's objective is to cho...
64 megabytes
import static java.lang.Math.abs; import static java.lang.Math.sqrt; import static java.util.Arrays.deepToString; public class Main{ static void debug(Object...os){ System.err.println(deepToString(os)); } void run(){ P A,B,C; double ra,rb,rc; A=new P(nextDouble(),nextD...
Java
["0 0 10\n60 0 10\n30 30 10"]
1 second
["30.00000 0.00000"]
null
Java 6
standard input
[ "geometry" ]
9829e1913e64072aadc9df5cddb63573
The input data consists of three lines, each of them describes the position of one stadium. The lines have the format x,  y,  r, where (x, y) are the coordinates of the stadium's center ( -  103 ≤ x,  y ≤ 103), and r (1 ≤ r  ≤ 103) is its radius. All the numbers in the input data are integer, stadiums do not have commo...
2,600
Print the coordinates of the required point with five digits after the decimal point. If there is no answer meeting the conditions, the program shouldn't print anything. The output data should be left blank.
standard output
PASSED
b52cf6cb570a96d409ea17b0fa64063e
train_000.jsonl
1267117200
The Olympic Games in Bercouver are in full swing now. Here everyone has their own objectives: sportsmen compete for medals, and sport commentators compete for more convenient positions to give a running commentary. Today the main sport events take place at three round stadiums, and the commentator's objective is to cho...
64 megabytes
import java.util.*; import java.math.*; import static java.lang.Character.isDigit; import static java.lang.Character.isLowerCase; import static java.lang.Character.isUpperCase; import static java.lang.Math.*; import static java.math.BigInteger.*; import static java.util.Arrays.*; import static java.util.Collections.*;...
Java
["0 0 10\n60 0 10\n30 30 10"]
1 second
["30.00000 0.00000"]
null
Java 6
standard input
[ "geometry" ]
9829e1913e64072aadc9df5cddb63573
The input data consists of three lines, each of them describes the position of one stadium. The lines have the format x,  y,  r, where (x, y) are the coordinates of the stadium's center ( -  103 ≤ x,  y ≤ 103), and r (1 ≤ r  ≤ 103) is its radius. All the numbers in the input data are integer, stadiums do not have commo...
2,600
Print the coordinates of the required point with five digits after the decimal point. If there is no answer meeting the conditions, the program shouldn't print anything. The output data should be left blank.
standard output
PASSED
354ca85c891e7dbe5708a81bba41715f
train_000.jsonl
1267117200
The Olympic Games in Bercouver are in full swing now. Here everyone has their own objectives: sportsmen compete for medals, and sport commentators compete for more convenient positions to give a running commentary. Today the main sport events take place at three round stadiums, and the commentator's objective is to cho...
64 megabytes
import java.util.*; import java.io.*; public class _2c { static double TWO(double xx) {return xx * xx; } static double ABS(double xx) {if (xx < 0) xx = -xx; return xx;} static double tmp[] = new double [3]; static double x[] = new double [3]; static double y[] = new double [3]; static double r[] = new double [3...
Java
["0 0 10\n60 0 10\n30 30 10"]
1 second
["30.00000 0.00000"]
null
Java 6
standard input
[ "geometry" ]
9829e1913e64072aadc9df5cddb63573
The input data consists of three lines, each of them describes the position of one stadium. The lines have the format x,  y,  r, where (x, y) are the coordinates of the stadium's center ( -  103 ≤ x,  y ≤ 103), and r (1 ≤ r  ≤ 103) is its radius. All the numbers in the input data are integer, stadiums do not have commo...
2,600
Print the coordinates of the required point with five digits after the decimal point. If there is no answer meeting the conditions, the program shouldn't print anything. The output data should be left blank.
standard output
PASSED
b2e2a45b70c8387336ab94457fdba6b2
train_000.jsonl
1267117200
The Olympic Games in Bercouver are in full swing now. Here everyone has their own objectives: sportsmen compete for medals, and sport commentators compete for more convenient positions to give a running commentary. Today the main sport events take place at three round stadiums, and the commentator's objective is to cho...
64 megabytes
import java.util.Collection; import java.util.Collections; import java.util.HashMap; import java.util.Map; import java.util.Map.Entry; import java.util.Scanner; import java.util.Vector; import java.text.DecimalFormat; /* * To change this license header, choose License Headers in Project Properties. * To change this ...
Java
["0 0 10\n60 0 10\n30 30 10"]
1 second
["30.00000 0.00000"]
null
Java 6
standard input
[ "geometry" ]
9829e1913e64072aadc9df5cddb63573
The input data consists of three lines, each of them describes the position of one stadium. The lines have the format x,  y,  r, where (x, y) are the coordinates of the stadium's center ( -  103 ≤ x,  y ≤ 103), and r (1 ≤ r  ≤ 103) is its radius. All the numbers in the input data are integer, stadiums do not have commo...
2,600
Print the coordinates of the required point with five digits after the decimal point. If there is no answer meeting the conditions, the program shouldn't print anything. The output data should be left blank.
standard output
PASSED
e6c4e01f6c282a0d0d886ee63eb26383
train_000.jsonl
1267117200
The Olympic Games in Bercouver are in full swing now. Here everyone has their own objectives: sportsmen compete for medals, and sport commentators compete for more convenient positions to give a running commentary. Today the main sport events take place at three round stadiums, and the commentator's objective is to cho...
64 megabytes
import java.util.Scanner; public class CommentatorProblem { void p(int ax, int ay, int ar, int bx, int by, int br, int cx, int cy, int cr) { if (ar == br && br == cr) ll(ax, ay, ar, bx, by, br, cx, cy, cr); else if (ar == br || br == cr || ar == cr) if (br == cr) ...
Java
["0 0 10\n60 0 10\n30 30 10"]
1 second
["30.00000 0.00000"]
null
Java 6
standard input
[ "geometry" ]
9829e1913e64072aadc9df5cddb63573
The input data consists of three lines, each of them describes the position of one stadium. The lines have the format x,  y,  r, where (x, y) are the coordinates of the stadium's center ( -  103 ≤ x,  y ≤ 103), and r (1 ≤ r  ≤ 103) is its radius. All the numbers in the input data are integer, stadiums do not have commo...
2,600
Print the coordinates of the required point with five digits after the decimal point. If there is no answer meeting the conditions, the program shouldn't print anything. The output data should be left blank.
standard output
PASSED
62bc801780b31eed85a1b2eb777a3bde
train_000.jsonl
1267117200
The Olympic Games in Bercouver are in full swing now. Here everyone has their own objectives: sportsmen compete for medals, and sport commentators compete for more convenient positions to give a running commentary. Today the main sport events take place at three round stadiums, and the commentator's objective is to cho...
64 megabytes
import java.util.Scanner; /* * kab = (ay - by) / (ax - bx); * y - maby = (-1/kab) * (x - mabx); * y - macy = (-1/kac) * (x - macx); * kab*maby - kab*y + mabx = x; * kac*macy - kac*y + macx = x; * kab*maby + mabx - kac*macy - macx = (kab - kac) * y; * * double k = -1 / kab; * double b = mabx / kab + maby; *...
Java
["0 0 10\n60 0 10\n30 30 10"]
1 second
["30.00000 0.00000"]
null
Java 6
standard input
[ "geometry" ]
9829e1913e64072aadc9df5cddb63573
The input data consists of three lines, each of them describes the position of one stadium. The lines have the format x,  y,  r, where (x, y) are the coordinates of the stadium's center ( -  103 ≤ x,  y ≤ 103), and r (1 ≤ r  ≤ 103) is its radius. All the numbers in the input data are integer, stadiums do not have commo...
2,600
Print the coordinates of the required point with five digits after the decimal point. If there is no answer meeting the conditions, the program shouldn't print anything. The output data should be left blank.
standard output
PASSED
e1eb569bf1bec4a43a324491408c86f8
train_000.jsonl
1267117200
The Olympic Games in Bercouver are in full swing now. Here everyone has their own objectives: sportsmen compete for medals, and sport commentators compete for more convenient positions to give a running commentary. Today the main sport events take place at three round stadiums, and the commentator's objective is to cho...
64 megabytes
import java.util.*; public class Commentator { public static void main(String[] args){ Scanner input = new Scanner(System.in); double x1 = input.nextDouble(); double y1 = input.nextDouble(); double r1 = input.nextInt(); double x2 = input.nextInt(); double y2 = input.nextInt(); double r2 =...
Java
["0 0 10\n60 0 10\n30 30 10"]
1 second
["30.00000 0.00000"]
null
Java 6
standard input
[ "geometry" ]
9829e1913e64072aadc9df5cddb63573
The input data consists of three lines, each of them describes the position of one stadium. The lines have the format x,  y,  r, where (x, y) are the coordinates of the stadium's center ( -  103 ≤ x,  y ≤ 103), and r (1 ≤ r  ≤ 103) is its radius. All the numbers in the input data are integer, stadiums do not have commo...
2,600
Print the coordinates of the required point with five digits after the decimal point. If there is no answer meeting the conditions, the program shouldn't print anything. The output data should be left blank.
standard output
PASSED
3d8037d0f81545edeb9ccfb43f6da9c2
train_000.jsonl
1267117200
The Olympic Games in Bercouver are in full swing now. Here everyone has their own objectives: sportsmen compete for medals, and sport commentators compete for more convenient positions to give a running commentary. Today the main sport events take place at three round stadiums, and the commentator's objective is to cho...
64 megabytes
import java.util.Scanner; import static java.lang.Math.*; public class CCommentatorProblem { public static double g(double u, double v, int[] x, int[] y, int[] r) { double f1 = sqrt(pow(u - x[0], 2) + pow(v - y[0], 2)) - sqrt(pow(u - x[1], 2) + pow(v - y[1], 2)) * r[0] / r[1]; double f2 = sqrt(pow(u - x[0], ...
Java
["0 0 10\n60 0 10\n30 30 10"]
1 second
["30.00000 0.00000"]
null
Java 6
standard input
[ "geometry" ]
9829e1913e64072aadc9df5cddb63573
The input data consists of three lines, each of them describes the position of one stadium. The lines have the format x,  y,  r, where (x, y) are the coordinates of the stadium's center ( -  103 ≤ x,  y ≤ 103), and r (1 ≤ r  ≤ 103) is its radius. All the numbers in the input data are integer, stadiums do not have commo...
2,600
Print the coordinates of the required point with five digits after the decimal point. If there is no answer meeting the conditions, the program shouldn't print anything. The output data should be left blank.
standard output
PASSED
fae2896a7e16a51cfcdcafa7fe4c7a2c
train_000.jsonl
1267117200
The Olympic Games in Bercouver are in full swing now. Here everyone has their own objectives: sportsmen compete for medals, and sport commentators compete for more convenient positions to give a running commentary. Today the main sport events take place at three round stadiums, and the commentator's objective is to cho...
64 megabytes
import java.io.*; import java.text.*; import java.math.*; import java.util.*; public class Main implements Runnable { final static String taskname = "filename"; final double eps = 1e-5; circle[] stad; double ans_x, ans_y, ans_r; boolean ans_found; void test2(double x, double y, int e ) ...
Java
["0 0 10\n60 0 10\n30 30 10"]
1 second
["30.00000 0.00000"]
null
Java 6
standard input
[ "geometry" ]
9829e1913e64072aadc9df5cddb63573
The input data consists of three lines, each of them describes the position of one stadium. The lines have the format x,  y,  r, where (x, y) are the coordinates of the stadium's center ( -  103 ≤ x,  y ≤ 103), and r (1 ≤ r  ≤ 103) is its radius. All the numbers in the input data are integer, stadiums do not have commo...
2,600
Print the coordinates of the required point with five digits after the decimal point. If there is no answer meeting the conditions, the program shouldn't print anything. The output data should be left blank.
standard output
PASSED
189cdcd2c2bbf56e17a6c9f4da663f85
train_000.jsonl
1267117200
The Olympic Games in Bercouver are in full swing now. Here everyone has their own objectives: sportsmen compete for medals, and sport commentators compete for more convenient positions to give a running commentary. Today the main sport events take place at three round stadiums, and the commentator's objective is to cho...
64 megabytes
import java.util.*; import java.util.*; import java.lang.*; import java.io.*; import java.math.*; public class Main { static final double EPS = 1e-6; static class Point { double x, y; Point(double x, double y) { this.x = x; this.y = y; } Point add(Point p) { return new Point(x + p.x, y + p.y);...
Java
["0 0 10\n60 0 10\n30 30 10"]
1 second
["30.00000 0.00000"]
null
Java 6
standard input
[ "geometry" ]
9829e1913e64072aadc9df5cddb63573
The input data consists of three lines, each of them describes the position of one stadium. The lines have the format x,  y,  r, where (x, y) are the coordinates of the stadium's center ( -  103 ≤ x,  y ≤ 103), and r (1 ≤ r  ≤ 103) is its radius. All the numbers in the input data are integer, stadiums do not have commo...
2,600
Print the coordinates of the required point with five digits after the decimal point. If there is no answer meeting the conditions, the program shouldn't print anything. The output data should be left blank.
standard output
PASSED
fb84d9b166d9d31b33303007e56e09ca
train_000.jsonl
1267117200
The Olympic Games in Bercouver are in full swing now. Here everyone has their own objectives: sportsmen compete for medals, and sport commentators compete for more convenient positions to give a running commentary. Today the main sport events take place at three round stadiums, and the commentator's objective is to cho...
64 megabytes
import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; import java.io.PrintWriter; import java.util.StringTokenizer; public class L implements Runnable { static String hack = "public class X "; static final double EPS = 1e-5; public static void main(String[] args) { ...
Java
["0 0 10\n60 0 10\n30 30 10"]
1 second
["30.00000 0.00000"]
null
Java 6
standard input
[ "geometry" ]
9829e1913e64072aadc9df5cddb63573
The input data consists of three lines, each of them describes the position of one stadium. The lines have the format x,  y,  r, where (x, y) are the coordinates of the stadium's center ( -  103 ≤ x,  y ≤ 103), and r (1 ≤ r  ≤ 103) is its radius. All the numbers in the input data are integer, stadiums do not have commo...
2,600
Print the coordinates of the required point with five digits after the decimal point. If there is no answer meeting the conditions, the program shouldn't print anything. The output data should be left blank.
standard output
PASSED
52f8d62af777ee6e40baed5abb1e7e91
train_000.jsonl
1267117200
The Olympic Games in Bercouver are in full swing now. Here everyone has their own objectives: sportsmen compete for medals, and sport commentators compete for more convenient positions to give a running commentary. Today the main sport events take place at three round stadiums, and the commentator's objective is to cho...
64 megabytes
import java.io.*; import java.util.*; import java.math.*; import java.text.*; public class Main { static final int MAXN = 1005; static final int MAXM = 1000005; static final int MOD = 10000; static final int INF = 1000000000; static final double EPS = 1E-6; Point[] p = new Point[3]; double[] ang = new doubl...
Java
["0 0 10\n60 0 10\n30 30 10"]
1 second
["30.00000 0.00000"]
null
Java 6
standard input
[ "geometry" ]
9829e1913e64072aadc9df5cddb63573
The input data consists of three lines, each of them describes the position of one stadium. The lines have the format x,  y,  r, where (x, y) are the coordinates of the stadium's center ( -  103 ≤ x,  y ≤ 103), and r (1 ≤ r  ≤ 103) is its radius. All the numbers in the input data are integer, stadiums do not have commo...
2,600
Print the coordinates of the required point with five digits after the decimal point. If there is no answer meeting the conditions, the program shouldn't print anything. The output data should be left blank.
standard output
PASSED
84792a1f6cf6addd589537653223c652
train_000.jsonl
1518705300
For a permutation P[1... N] of integers from 1 to N, function f is defined as follows: Let g(i) be the minimum positive integer j such that f(i, j) = i. We can show such j always exists.For given N, A, B, find a permutation P of integers from 1 to N such that for 1 ≤ i ≤ N, g(i) equals either A or B.
256 megabytes
import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; import java.util.Scanner; import java.util.StringTokenizer; public class Main { static Scanner cin = new Scanner(System.in); public static void main(String[] args) throws IOException { int n = cin.nextInt...
Java
["9 2 5", "3 2 1"]
2 seconds
["6 5 8 3 4 1 9 2 7", "1 2 3"]
NoteIn the first example, g(1) = g(6) = g(7) = g(9) = 2 and g(2) = g(3) = g(4) = g(5) = g(8) = 5 In the second example, g(1) = g(2) = g(3) = 1
Java 11
standard input
[ "constructive algorithms", "brute force" ]
138f7db4a858fb1efe817ee6491f83d9
The only line contains three integers N, A, B (1 ≤ N ≤ 106, 1 ≤ A, B ≤ N).
1,600
If no such permutation exists, output -1. Otherwise, output a permutation of integers from 1 to N.
standard output
PASSED
2a98c8133da46b66c1bbe9f8cda58568
train_000.jsonl
1518705300
For a permutation P[1... N] of integers from 1 to N, function f is defined as follows: Let g(i) be the minimum positive integer j such that f(i, j) = i. We can show such j always exists.For given N, A, B, find a permutation P of integers from 1 to N such that for 1 ≤ i ≤ N, g(i) equals either A or B.
256 megabytes
import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; import java.util.StringTokenizer; public class Main { public static void main(String[] args) throws IOException { int n = Reader.nextInt(); int A = Reader.nextInt(); int B = Reader.nextInt(...
Java
["9 2 5", "3 2 1"]
2 seconds
["6 5 8 3 4 1 9 2 7", "1 2 3"]
NoteIn the first example, g(1) = g(6) = g(7) = g(9) = 2 and g(2) = g(3) = g(4) = g(5) = g(8) = 5 In the second example, g(1) = g(2) = g(3) = 1
Java 11
standard input
[ "constructive algorithms", "brute force" ]
138f7db4a858fb1efe817ee6491f83d9
The only line contains three integers N, A, B (1 ≤ N ≤ 106, 1 ≤ A, B ≤ N).
1,600
If no such permutation exists, output -1. Otherwise, output a permutation of integers from 1 to N.
standard output
PASSED
8ba88a6ed3bb843e065a2444453e2eae
train_000.jsonl
1359732600
Emuskald needs a fence around his farm, but he is too lazy to build it himself. So he purchased a fence-building robot.He wants the fence to be a regular polygon. The robot builds the fence along a single path, but it can only make fence corners at a single angle a.Will the robot be able to build the fence Emuskald wan...
256 megabytes
import java.util.*; public class Solution { public static void main(String[] args) { Scanner scanner = new Scanner(System.in); int t = scanner.nextInt(); for (int i = 0; i < t; i++) { int a = scanner.nextInt(); if (a < 60) { System.out.println("NO");...
Java
["3\n30\n60\n90"]
2 seconds
["NO\nYES\nYES"]
NoteIn the first test case, it is impossible to build the fence, since there is no regular polygon with angle .In the second test case, the fence is a regular triangle, and in the last test case — a square.
Java 8
standard input
[ "implementation", "geometry", "math" ]
9037f487a426ead347baa803955b2c00
The first line of input contains an integer t (0 &lt; t &lt; 180) — the number of tests. Each of the following t lines contains a single integer a (0 &lt; a &lt; 180) — the angle the robot can make corners at measured in degrees.
1,100
For each test, output on a single line "YES" (without quotes), if the robot can build a fence Emuskald wants, and "NO" (without quotes), if it is impossible.
standard output
PASSED
71e59fe48b9af6011a0b75e5cf35e60d
train_000.jsonl
1359732600
Emuskald needs a fence around his farm, but he is too lazy to build it himself. So he purchased a fence-building robot.He wants the fence to be a regular polygon. The robot builds the fence along a single path, but it can only make fence corners at a single angle a.Will the robot be able to build the fence Emuskald wan...
256 megabytes
import java.util.*; import java.lang.Math; public class hello { public static void main (String[] args) throws java.lang.Exception { Scanner scan = new Scanner(System.in); int ans = 0; int a = scan.nextInt(); ArrayList<Double> list = new ArrayList<Double>(); Str...
Java
["3\n30\n60\n90"]
2 seconds
["NO\nYES\nYES"]
NoteIn the first test case, it is impossible to build the fence, since there is no regular polygon with angle .In the second test case, the fence is a regular triangle, and in the last test case — a square.
Java 8
standard input
[ "implementation", "geometry", "math" ]
9037f487a426ead347baa803955b2c00
The first line of input contains an integer t (0 &lt; t &lt; 180) — the number of tests. Each of the following t lines contains a single integer a (0 &lt; a &lt; 180) — the angle the robot can make corners at measured in degrees.
1,100
For each test, output on a single line "YES" (without quotes), if the robot can build a fence Emuskald wants, and "NO" (without quotes), if it is impossible.
standard output
PASSED
4fc89b0d778f4f47471899a3b3aee9de
train_000.jsonl
1359732600
Emuskald needs a fence around his farm, but he is too lazy to build it himself. So he purchased a fence-building robot.He wants the fence to be a regular polygon. The robot builds the fence along a single path, but it can only make fence corners at a single angle a.Will the robot be able to build the fence Emuskald wan...
256 megabytes
import java.util.*; public class _270A_Fancy_Fence { public static void main(String[] args) { Scanner input= new Scanner (System.in); int n= input.nextInt(),i; int a[]= new int[n]; for (i=0;i<n;i++) a[i]= input.nextInt(); for (i=0;i<n;i++) { ...
Java
["3\n30\n60\n90"]
2 seconds
["NO\nYES\nYES"]
NoteIn the first test case, it is impossible to build the fence, since there is no regular polygon with angle .In the second test case, the fence is a regular triangle, and in the last test case — a square.
Java 8
standard input
[ "implementation", "geometry", "math" ]
9037f487a426ead347baa803955b2c00
The first line of input contains an integer t (0 &lt; t &lt; 180) — the number of tests. Each of the following t lines contains a single integer a (0 &lt; a &lt; 180) — the angle the robot can make corners at measured in degrees.
1,100
For each test, output on a single line "YES" (without quotes), if the robot can build a fence Emuskald wants, and "NO" (without quotes), if it is impossible.
standard output
PASSED
7f1145fbff79056efd5e8f45072313d8
train_000.jsonl
1359732600
Emuskald needs a fence around his farm, but he is too lazy to build it himself. So he purchased a fence-building robot.He wants the fence to be a regular polygon. The robot builds the fence along a single path, but it can only make fence corners at a single angle a.Will the robot be able to build the fence Emuskald wan...
256 megabytes
import java.util.*; public class _270A_Fancy_Fence { public static void main(String[] args) { Scanner input= new Scanner (System.in); int n= input.nextInt(),i; int a[]= new int[n]; for (i=0;i<n;i++) { a[i]= input.nextInt(); if(360%(180-a[i])==0) ...
Java
["3\n30\n60\n90"]
2 seconds
["NO\nYES\nYES"]
NoteIn the first test case, it is impossible to build the fence, since there is no regular polygon with angle .In the second test case, the fence is a regular triangle, and in the last test case — a square.
Java 8
standard input
[ "implementation", "geometry", "math" ]
9037f487a426ead347baa803955b2c00
The first line of input contains an integer t (0 &lt; t &lt; 180) — the number of tests. Each of the following t lines contains a single integer a (0 &lt; a &lt; 180) — the angle the robot can make corners at measured in degrees.
1,100
For each test, output on a single line "YES" (without quotes), if the robot can build a fence Emuskald wants, and "NO" (without quotes), if it is impossible.
standard output
PASSED
d6f13ae8649d9dec1134c187bfc2c2e3
train_000.jsonl
1359732600
Emuskald needs a fence around his farm, but he is too lazy to build it himself. So he purchased a fence-building robot.He wants the fence to be a regular polygon. The robot builds the fence along a single path, but it can only make fence corners at a single angle a.Will the robot be able to build the fence Emuskald wan...
256 megabytes
import java.util.*; public class Solution{ public static void main (String args[]){ Scanner sc = new Scanner (System.in); int t = sc.nextInt(); while (t --> 0){ int a = sc.nextInt(); int s = a - 180; int ans = -360%s; ...
Java
["3\n30\n60\n90"]
2 seconds
["NO\nYES\nYES"]
NoteIn the first test case, it is impossible to build the fence, since there is no regular polygon with angle .In the second test case, the fence is a regular triangle, and in the last test case — a square.
Java 8
standard input
[ "implementation", "geometry", "math" ]
9037f487a426ead347baa803955b2c00
The first line of input contains an integer t (0 &lt; t &lt; 180) — the number of tests. Each of the following t lines contains a single integer a (0 &lt; a &lt; 180) — the angle the robot can make corners at measured in degrees.
1,100
For each test, output on a single line "YES" (without quotes), if the robot can build a fence Emuskald wants, and "NO" (without quotes), if it is impossible.
standard output
PASSED
7f7e0575295f984361423547fdd3044b
train_000.jsonl
1359732600
Emuskald needs a fence around his farm, but he is too lazy to build it himself. So he purchased a fence-building robot.He wants the fence to be a regular polygon. The robot builds the fence along a single path, but it can only make fence corners at a single angle a.Will the robot be able to build the fence Emuskald wan...
256 megabytes
import java.io.InputStream; import java.io.InputStreamReader; import java.util.HashMap; import java.io.BufferedReader; import java.util.Map; import java.io.OutputStream; import java.io.PrintWriter; import java.io.IOException; import java.util.StringTokenizer; import java.util.Arrays; import java.util.PriorityQueue; pub...
Java
["3\n30\n60\n90"]
2 seconds
["NO\nYES\nYES"]
NoteIn the first test case, it is impossible to build the fence, since there is no regular polygon with angle .In the second test case, the fence is a regular triangle, and in the last test case — a square.
Java 8
standard input
[ "implementation", "geometry", "math" ]
9037f487a426ead347baa803955b2c00
The first line of input contains an integer t (0 &lt; t &lt; 180) — the number of tests. Each of the following t lines contains a single integer a (0 &lt; a &lt; 180) — the angle the robot can make corners at measured in degrees.
1,100
For each test, output on a single line "YES" (without quotes), if the robot can build a fence Emuskald wants, and "NO" (without quotes), if it is impossible.
standard output
PASSED
3a49ac6107c3f40fc332014580d83563
train_000.jsonl
1359732600
Emuskald needs a fence around his farm, but he is too lazy to build it himself. So he purchased a fence-building robot.He wants the fence to be a regular polygon. The robot builds the fence along a single path, but it can only make fence corners at a single angle a.Will the robot be able to build the fence Emuskald wan...
256 megabytes
import java.util.*; public class Main { public static void main(String[] args) { Scanner in = new Scanner(System.in); for (int t = in.nextInt(); t --> 0 ;) { int a = in.nextInt(); boolean x = false; int c = a + a; for (int i = 3; i < 1000000; ++i) { ...
Java
["3\n30\n60\n90"]
2 seconds
["NO\nYES\nYES"]
NoteIn the first test case, it is impossible to build the fence, since there is no regular polygon with angle .In the second test case, the fence is a regular triangle, and in the last test case — a square.
Java 8
standard input
[ "implementation", "geometry", "math" ]
9037f487a426ead347baa803955b2c00
The first line of input contains an integer t (0 &lt; t &lt; 180) — the number of tests. Each of the following t lines contains a single integer a (0 &lt; a &lt; 180) — the angle the robot can make corners at measured in degrees.
1,100
For each test, output on a single line "YES" (without quotes), if the robot can build a fence Emuskald wants, and "NO" (without quotes), if it is impossible.
standard output
PASSED
98a830ff7f0ddb3d80300d99def85ffa
train_000.jsonl
1359732600
Emuskald needs a fence around his farm, but he is too lazy to build it himself. So he purchased a fence-building robot.He wants the fence to be a regular polygon. The robot builds the fence along a single path, but it can only make fence corners at a single angle a.Will the robot be able to build the fence Emuskald wan...
256 megabytes
import java.util.*; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int n = sc.nextInt(); for(int i = 0; i < n; i++){ int a = sc.nextInt(); int x = 360 / (180 - a); if(x * (180 - a) == 360){ System.out.println("YES"); } else{ ...
Java
["3\n30\n60\n90"]
2 seconds
["NO\nYES\nYES"]
NoteIn the first test case, it is impossible to build the fence, since there is no regular polygon with angle .In the second test case, the fence is a regular triangle, and in the last test case — a square.
Java 8
standard input
[ "implementation", "geometry", "math" ]
9037f487a426ead347baa803955b2c00
The first line of input contains an integer t (0 &lt; t &lt; 180) — the number of tests. Each of the following t lines contains a single integer a (0 &lt; a &lt; 180) — the angle the robot can make corners at measured in degrees.
1,100
For each test, output on a single line "YES" (without quotes), if the robot can build a fence Emuskald wants, and "NO" (without quotes), if it is impossible.
standard output
PASSED
6b59e947de4ab90d6566fe4a1ea2fea6
train_000.jsonl
1359732600
Emuskald needs a fence around his farm, but he is too lazy to build it himself. So he purchased a fence-building robot.He wants the fence to be a regular polygon. The robot builds the fence along a single path, but it can only make fence corners at a single angle a.Will the robot be able to build the fence Emuskald wan...
256 megabytes
import java.util.Scanner; public class A270 { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int n = sc.nextInt(); int[] array = new int[n]; for (int i = 0; i < n; i++) { array[i] = sc.nextInt(); } for (int i = 0; i < n; i++...
Java
["3\n30\n60\n90"]
2 seconds
["NO\nYES\nYES"]
NoteIn the first test case, it is impossible to build the fence, since there is no regular polygon with angle .In the second test case, the fence is a regular triangle, and in the last test case — a square.
Java 8
standard input
[ "implementation", "geometry", "math" ]
9037f487a426ead347baa803955b2c00
The first line of input contains an integer t (0 &lt; t &lt; 180) — the number of tests. Each of the following t lines contains a single integer a (0 &lt; a &lt; 180) — the angle the robot can make corners at measured in degrees.
1,100
For each test, output on a single line "YES" (without quotes), if the robot can build a fence Emuskald wants, and "NO" (without quotes), if it is impossible.
standard output
PASSED
c05c3f0350436b258c750e437021edcd
train_000.jsonl
1359732600
Emuskald needs a fence around his farm, but he is too lazy to build it himself. So he purchased a fence-building robot.He wants the fence to be a regular polygon. The robot builds the fence along a single path, but it can only make fence corners at a single angle a.Will the robot be able to build the fence Emuskald wan...
256 megabytes
import java.util.*; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int n= sc.nextInt(); int a[]=new int[n]; for(int i=0;i<n;i++){ a[i]=sc.nextInt(); } for(int i=0;i<n;i++){ if(360%(180-a[i])==0) System.out.println("YES"); ...
Java
["3\n30\n60\n90"]
2 seconds
["NO\nYES\nYES"]
NoteIn the first test case, it is impossible to build the fence, since there is no regular polygon with angle .In the second test case, the fence is a regular triangle, and in the last test case — a square.
Java 8
standard input
[ "implementation", "geometry", "math" ]
9037f487a426ead347baa803955b2c00
The first line of input contains an integer t (0 &lt; t &lt; 180) — the number of tests. Each of the following t lines contains a single integer a (0 &lt; a &lt; 180) — the angle the robot can make corners at measured in degrees.
1,100
For each test, output on a single line "YES" (without quotes), if the robot can build a fence Emuskald wants, and "NO" (without quotes), if it is impossible.
standard output
PASSED
341233ccd5ddc70bdfb6794999229cb5
train_000.jsonl
1359732600
Emuskald needs a fence around his farm, but he is too lazy to build it himself. So he purchased a fence-building robot.He wants the fence to be a regular polygon. The robot builds the fence along a single path, but it can only make fence corners at a single angle a.Will the robot be able to build the fence Emuskald wan...
256 megabytes
import java.util.Scanner; public class FancyFence { public static void main(String[] args) { Scanner z=new Scanner(System.in); int t=z.nextInt(); int a[]=new int[t]; String aa[]=new String[t]; for(int i=0;i<a.length;i++) a[i]=z.nextInt(); for(int i=0;...
Java
["3\n30\n60\n90"]
2 seconds
["NO\nYES\nYES"]
NoteIn the first test case, it is impossible to build the fence, since there is no regular polygon with angle .In the second test case, the fence is a regular triangle, and in the last test case — a square.
Java 8
standard input
[ "implementation", "geometry", "math" ]
9037f487a426ead347baa803955b2c00
The first line of input contains an integer t (0 &lt; t &lt; 180) — the number of tests. Each of the following t lines contains a single integer a (0 &lt; a &lt; 180) — the angle the robot can make corners at measured in degrees.
1,100
For each test, output on a single line "YES" (without quotes), if the robot can build a fence Emuskald wants, and "NO" (without quotes), if it is impossible.
standard output
PASSED
c2f972dbb80d330d7fc90dcd03bc1511
train_000.jsonl
1359732600
Emuskald needs a fence around his farm, but he is too lazy to build it himself. So he purchased a fence-building robot.He wants the fence to be a regular polygon. The robot builds the fence along a single path, but it can only make fence corners at a single angle a.Will the robot be able to build the fence Emuskald wan...
256 megabytes
import java.util.Scanner; public class AFancyFence { public static void main(String[] args) { Scanner scanner = new Scanner(System.in); int n = scanner.nextInt(); //System.out.println(n); String t = scanner.nextLine(); int a; double[] brStrana = new double[361]; brStrana[0] = 0; brStrana[1] = 0; ...
Java
["3\n30\n60\n90"]
2 seconds
["NO\nYES\nYES"]
NoteIn the first test case, it is impossible to build the fence, since there is no regular polygon with angle .In the second test case, the fence is a regular triangle, and in the last test case — a square.
Java 8
standard input
[ "implementation", "geometry", "math" ]
9037f487a426ead347baa803955b2c00
The first line of input contains an integer t (0 &lt; t &lt; 180) — the number of tests. Each of the following t lines contains a single integer a (0 &lt; a &lt; 180) — the angle the robot can make corners at measured in degrees.
1,100
For each test, output on a single line "YES" (without quotes), if the robot can build a fence Emuskald wants, and "NO" (without quotes), if it is impossible.
standard output
PASSED
d0d3f3727a84544e4754f2b798c08cfa
train_000.jsonl
1359732600
Emuskald needs a fence around his farm, but he is too lazy to build it himself. So he purchased a fence-building robot.He wants the fence to be a regular polygon. The robot builds the fence along a single path, but it can only make fence corners at a single angle a.Will the robot be able to build the fence Emuskald wan...
256 megabytes
import java.util.*; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int t = sc.nextInt(); for(int i = 0; i < t; i++) { int a = sc.nextInt(); double n = 360/(180.0-a); if(n==Math.floor(n)) System.out.println("YES"); else System.out.println(...
Java
["3\n30\n60\n90"]
2 seconds
["NO\nYES\nYES"]
NoteIn the first test case, it is impossible to build the fence, since there is no regular polygon with angle .In the second test case, the fence is a regular triangle, and in the last test case — a square.
Java 8
standard input
[ "implementation", "geometry", "math" ]
9037f487a426ead347baa803955b2c00
The first line of input contains an integer t (0 &lt; t &lt; 180) — the number of tests. Each of the following t lines contains a single integer a (0 &lt; a &lt; 180) — the angle the robot can make corners at measured in degrees.
1,100
For each test, output on a single line "YES" (without quotes), if the robot can build a fence Emuskald wants, and "NO" (without quotes), if it is impossible.
standard output
PASSED
dc7c94813f1f0dec5ad87e5da2263d60
train_000.jsonl
1359732600
Emuskald needs a fence around his farm, but he is too lazy to build it himself. So he purchased a fence-building robot.He wants the fence to be a regular polygon. The robot builds the fence along a single path, but it can only make fence corners at a single angle a.Will the robot be able to build the fence Emuskald wan...
256 megabytes
import java.util.*; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int t = sc.nextInt(); for(int i = 0; i < t; i++) { int a = sc.nextInt(); double n = 360/(180.0-a); if(n==Math.floor(n)) System.out.println("YES"); else System.out.println(...
Java
["3\n30\n60\n90"]
2 seconds
["NO\nYES\nYES"]
NoteIn the first test case, it is impossible to build the fence, since there is no regular polygon with angle .In the second test case, the fence is a regular triangle, and in the last test case — a square.
Java 8
standard input
[ "implementation", "geometry", "math" ]
9037f487a426ead347baa803955b2c00
The first line of input contains an integer t (0 &lt; t &lt; 180) — the number of tests. Each of the following t lines contains a single integer a (0 &lt; a &lt; 180) — the angle the robot can make corners at measured in degrees.
1,100
For each test, output on a single line "YES" (without quotes), if the robot can build a fence Emuskald wants, and "NO" (without quotes), if it is impossible.
standard output
PASSED
5564d363210833d6c1ed724b23d2cba9
train_000.jsonl
1359732600
Emuskald needs a fence around his farm, but he is too lazy to build it himself. So he purchased a fence-building robot.He wants the fence to be a regular polygon. The robot builds the fence along a single path, but it can only make fence corners at a single angle a.Will the robot be able to build the fence Emuskald wan...
256 megabytes
import java.util.Scanner; public class FancyFence { public static void main(String[] args){ Scanner kbd = new Scanner(System.in); int numOfTests = Integer.parseInt(kbd.nextLine()); String[] results = new String[numOfTests]; boolean confirmed = false; String decision = ""; ...
Java
["3\n30\n60\n90"]
2 seconds
["NO\nYES\nYES"]
NoteIn the first test case, it is impossible to build the fence, since there is no regular polygon with angle .In the second test case, the fence is a regular triangle, and in the last test case — a square.
Java 8
standard input
[ "implementation", "geometry", "math" ]
9037f487a426ead347baa803955b2c00
The first line of input contains an integer t (0 &lt; t &lt; 180) — the number of tests. Each of the following t lines contains a single integer a (0 &lt; a &lt; 180) — the angle the robot can make corners at measured in degrees.
1,100
For each test, output on a single line "YES" (without quotes), if the robot can build a fence Emuskald wants, and "NO" (without quotes), if it is impossible.
standard output
PASSED
ed16471c6d8498890ba2c076a52cd046
train_000.jsonl
1359732600
Emuskald needs a fence around his farm, but he is too lazy to build it himself. So he purchased a fence-building robot.He wants the fence to be a regular polygon. The robot builds the fence along a single path, but it can only make fence corners at a single angle a.Will the robot be able to build the fence Emuskald wan...
256 megabytes
import java.util.Scanner; public class Fancy_Fence_270A { public static void main(String[] args) { Scanner tau=new Scanner(System.in); int t=tau.nextInt(); float a[]; int i; float n; a=new float[180]; for (i=0; i<t;i++) { a[i]=tau.nextInt(); } for (i=0; i<t;i++) { if (a[i]==...
Java
["3\n30\n60\n90"]
2 seconds
["NO\nYES\nYES"]
NoteIn the first test case, it is impossible to build the fence, since there is no regular polygon with angle .In the second test case, the fence is a regular triangle, and in the last test case — a square.
Java 8
standard input
[ "implementation", "geometry", "math" ]
9037f487a426ead347baa803955b2c00
The first line of input contains an integer t (0 &lt; t &lt; 180) — the number of tests. Each of the following t lines contains a single integer a (0 &lt; a &lt; 180) — the angle the robot can make corners at measured in degrees.
1,100
For each test, output on a single line "YES" (without quotes), if the robot can build a fence Emuskald wants, and "NO" (without quotes), if it is impossible.
standard output
PASSED
bb760d57cc60efac222e392e7143240c
train_000.jsonl
1359732600
Emuskald needs a fence around his farm, but he is too lazy to build it himself. So he purchased a fence-building robot.He wants the fence to be a regular polygon. The robot builds the fence along a single path, but it can only make fence corners at a single angle a.Will the robot be able to build the fence Emuskald wan...
256 megabytes
import java.io.*; import java.math.*; import java.util.*; public class A { FastScanner in; PrintWriter out; void solve() { int t = in.nextInt(); while (0 < t--) { int a = in.nextInt(); String r = "NO"; for (int i = 1; i <= 360; i++) { if ...
Java
["3\n30\n60\n90"]
2 seconds
["NO\nYES\nYES"]
NoteIn the first test case, it is impossible to build the fence, since there is no regular polygon with angle .In the second test case, the fence is a regular triangle, and in the last test case — a square.
Java 8
standard input
[ "implementation", "geometry", "math" ]
9037f487a426ead347baa803955b2c00
The first line of input contains an integer t (0 &lt; t &lt; 180) — the number of tests. Each of the following t lines contains a single integer a (0 &lt; a &lt; 180) — the angle the robot can make corners at measured in degrees.
1,100
For each test, output on a single line "YES" (without quotes), if the robot can build a fence Emuskald wants, and "NO" (without quotes), if it is impossible.
standard output
PASSED
0340a30401f21b7e46cb1f390cee1150
train_000.jsonl
1359732600
Emuskald needs a fence around his farm, but he is too lazy to build it himself. So he purchased a fence-building robot.He wants the fence to be a regular polygon. The robot builds the fence along a single path, but it can only make fence corners at a single angle a.Will the robot be able to build the fence Emuskald wan...
256 megabytes
import java.util.Scanner; public class FancyFence { static int gcd(int a, int b) { return b == 0 ? a : gcd(b, a % b); } public static void main(String[] args) { Scanner sc = new Scanner(System.in); int n = sc.nextInt(); for (int i = 0; i < n; i++) { System.out.p...
Java
["3\n30\n60\n90"]
2 seconds
["NO\nYES\nYES"]
NoteIn the first test case, it is impossible to build the fence, since there is no regular polygon with angle .In the second test case, the fence is a regular triangle, and in the last test case — a square.
Java 8
standard input
[ "implementation", "geometry", "math" ]
9037f487a426ead347baa803955b2c00
The first line of input contains an integer t (0 &lt; t &lt; 180) — the number of tests. Each of the following t lines contains a single integer a (0 &lt; a &lt; 180) — the angle the robot can make corners at measured in degrees.
1,100
For each test, output on a single line "YES" (without quotes), if the robot can build a fence Emuskald wants, and "NO" (without quotes), if it is impossible.
standard output
PASSED
dcda54910e79affb3f008acf7c80dec4
train_000.jsonl
1359732600
Emuskald needs a fence around his farm, but he is too lazy to build it himself. So he purchased a fence-building robot.He wants the fence to be a regular polygon. The robot builds the fence along a single path, but it can only make fence corners at a single angle a.Will the robot be able to build the fence Emuskald wan...
256 megabytes
import java.util.HashMap; import java.util.Scanner; public class A165 { public static void main(String[] args) { Scanner in = new Scanner(System.in); //int t = in.nextInt(); float n = 3; HashMap<Integer,Boolean> map = new HashMap<>(); for(int i=0;i<=180;i++){ ma...
Java
["3\n30\n60\n90"]
2 seconds
["NO\nYES\nYES"]
NoteIn the first test case, it is impossible to build the fence, since there is no regular polygon with angle .In the second test case, the fence is a regular triangle, and in the last test case — a square.
Java 8
standard input
[ "implementation", "geometry", "math" ]
9037f487a426ead347baa803955b2c00
The first line of input contains an integer t (0 &lt; t &lt; 180) — the number of tests. Each of the following t lines contains a single integer a (0 &lt; a &lt; 180) — the angle the robot can make corners at measured in degrees.
1,100
For each test, output on a single line "YES" (without quotes), if the robot can build a fence Emuskald wants, and "NO" (without quotes), if it is impossible.
standard output
PASSED
7ee2769b3c8fb5d221505bc1da79c1bd
train_000.jsonl
1368968400
Unfortunately, Vasya can only sum pairs of integers (a, b), such that for any decimal place at least one number has digit 0 in this place. For example, Vasya can sum numbers 505 and 50, but he cannot sum 1 and 4.Vasya has a set of k distinct non-negative integers d1, d2, ..., dk.Vasya wants to choose some integers from...
256 megabytes
import java.io.*; import java.util.*; public class StrangeAddition { static StringTokenizer st; static BufferedReader in; static PrintWriter out; private static int nextInt() throws IOException { return Integer.parseInt(next()); } private static long nextLong() throws IOException { ...
Java
["4\n100 10 1 0", "3\n2 70 3"]
2 seconds
["4\n0 1 10 100", "2\n2 70"]
null
Java 8
standard input
[ "constructive algorithms", "implementation", "brute force" ]
6b7d6f5c07b313c57d52db6a48d3eeef
The first input line contains integer k (1 ≤ k ≤ 100) — the number of integers. The second line contains k distinct space-separated integers d1, d2, ..., dk (0 ≤ di ≤ 100).
1,600
In the first line print a single integer n the maximum number of the chosen integers. In the second line print n distinct non-negative integers — the required integers. If there are multiple solutions, print any of them. You can print the numbers in any order.
standard output
PASSED
dc4cf0d9e268fefe3e9b65af82249f81
train_000.jsonl
1368968400
Unfortunately, Vasya can only sum pairs of integers (a, b), such that for any decimal place at least one number has digit 0 in this place. For example, Vasya can sum numbers 505 and 50, but he cannot sum 1 and 4.Vasya has a set of k distinct non-negative integers d1, d2, ..., dk.Vasya wants to choose some integers from...
256 megabytes
import java.util.*; public class Main{ public static void main(String[] args){ Scanner sc = new Scanner(System.in); int a,b,c,d,e,f,g; a = sc.nextInt(); Vector<Integer> x = new Vector<Integer>(); g = 0; e = 0; f = 0; d = 0; for(b = 0;b < a;b++){ c = sc.nextInt(); if(c =...
Java
["4\n100 10 1 0", "3\n2 70 3"]
2 seconds
["4\n0 1 10 100", "2\n2 70"]
null
Java 8
standard input
[ "constructive algorithms", "implementation", "brute force" ]
6b7d6f5c07b313c57d52db6a48d3eeef
The first input line contains integer k (1 ≤ k ≤ 100) — the number of integers. The second line contains k distinct space-separated integers d1, d2, ..., dk (0 ≤ di ≤ 100).
1,600
In the first line print a single integer n the maximum number of the chosen integers. In the second line print n distinct non-negative integers — the required integers. If there are multiple solutions, print any of them. You can print the numbers in any order.
standard output
PASSED
5e14cdc35940624ff0f0488ee0997f9f
train_000.jsonl
1368968400
Unfortunately, Vasya can only sum pairs of integers (a, b), such that for any decimal place at least one number has digit 0 in this place. For example, Vasya can sum numbers 505 and 50, but he cannot sum 1 and 4.Vasya has a set of k distinct non-negative integers d1, d2, ..., dk.Vasya wants to choose some integers from...
256 megabytes
import java.util.*; public class Main { public static void main(String[] args) { Scanner s = new Scanner (System.in); boolean zero=false,one=false,ten=false,hund=false; int n=s.nextInt(); int val[] = new int [n]; int ans=0; int val2=-1; ArrayList<Integer> E= new ArrayList<Integer>(); for (int i=0;i<n;i++) { va...
Java
["4\n100 10 1 0", "3\n2 70 3"]
2 seconds
["4\n0 1 10 100", "2\n2 70"]
null
Java 8
standard input
[ "constructive algorithms", "implementation", "brute force" ]
6b7d6f5c07b313c57d52db6a48d3eeef
The first input line contains integer k (1 ≤ k ≤ 100) — the number of integers. The second line contains k distinct space-separated integers d1, d2, ..., dk (0 ≤ di ≤ 100).
1,600
In the first line print a single integer n the maximum number of the chosen integers. In the second line print n distinct non-negative integers — the required integers. If there are multiple solutions, print any of them. You can print the numbers in any order.
standard output
PASSED
954b49ace3da3427555326611322ff7c
train_000.jsonl
1368968400
Unfortunately, Vasya can only sum pairs of integers (a, b), such that for any decimal place at least one number has digit 0 in this place. For example, Vasya can sum numbers 505 and 50, but he cannot sum 1 and 4.Vasya has a set of k distinct non-negative integers d1, d2, ..., dk.Vasya wants to choose some integers from...
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 k = in.nextInt(); int n100 = -1, n10 = -1, n1 = -1, n0 = -1, n11 = -1; for (int i = 0; i < k; i++) ...
Java
["4\n100 10 1 0", "3\n2 70 3"]
2 seconds
["4\n0 1 10 100", "2\n2 70"]
null
Java 8
standard input
[ "constructive algorithms", "implementation", "brute force" ]
6b7d6f5c07b313c57d52db6a48d3eeef
The first input line contains integer k (1 ≤ k ≤ 100) — the number of integers. The second line contains k distinct space-separated integers d1, d2, ..., dk (0 ≤ di ≤ 100).
1,600
In the first line print a single integer n the maximum number of the chosen integers. In the second line print n distinct non-negative integers — the required integers. If there are multiple solutions, print any of them. You can print the numbers in any order.
standard output
PASSED
05e5ec3b796cd524bcdf9121b6284356
train_000.jsonl
1368968400
Unfortunately, Vasya can only sum pairs of integers (a, b), such that for any decimal place at least one number has digit 0 in this place. For example, Vasya can sum numbers 505 and 50, but he cannot sum 1 and 4.Vasya has a set of k distinct non-negative integers d1, d2, ..., dk.Vasya wants to choose some integers from...
256 megabytes
import java.io.*; import java.util.*; public class Test { static BufferedReader reader; static StringTokenizer tokenizer; static PrintWriter writer; static int nextInt() throws IOException { return Integer.parseInt(nextToken()); } static long nextLong() throws IOException { return Long.parseLong(nextToken(...
Java
["4\n100 10 1 0", "3\n2 70 3"]
2 seconds
["4\n0 1 10 100", "2\n2 70"]
null
Java 8
standard input
[ "constructive algorithms", "implementation", "brute force" ]
6b7d6f5c07b313c57d52db6a48d3eeef
The first input line contains integer k (1 ≤ k ≤ 100) — the number of integers. The second line contains k distinct space-separated integers d1, d2, ..., dk (0 ≤ di ≤ 100).
1,600
In the first line print a single integer n the maximum number of the chosen integers. In the second line print n distinct non-negative integers — the required integers. If there are multiple solutions, print any of them. You can print the numbers in any order.
standard output
PASSED
41bb4d02b985507d665f74908494c363
train_000.jsonl
1368968400
Unfortunately, Vasya can only sum pairs of integers (a, b), such that for any decimal place at least one number has digit 0 in this place. For example, Vasya can sum numbers 505 and 50, but he cannot sum 1 and 4.Vasya has a set of k distinct non-negative integers d1, d2, ..., dk.Vasya wants to choose some integers from...
256 megabytes
//package Omar; import java.util.Scanner; import java.util.Vector; public class StrangeAddition { public static void main(String... args) { Scanner input = new Scanner(System.in); int n = input.nextInt(); int numbers[] = new int[n]; for (int i = 0; i < n; ++i) { numbers...
Java
["4\n100 10 1 0", "3\n2 70 3"]
2 seconds
["4\n0 1 10 100", "2\n2 70"]
null
Java 8
standard input
[ "constructive algorithms", "implementation", "brute force" ]
6b7d6f5c07b313c57d52db6a48d3eeef
The first input line contains integer k (1 ≤ k ≤ 100) — the number of integers. The second line contains k distinct space-separated integers d1, d2, ..., dk (0 ≤ di ≤ 100).
1,600
In the first line print a single integer n the maximum number of the chosen integers. In the second line print n distinct non-negative integers — the required integers. If there are multiple solutions, print any of them. You can print the numbers in any order.
standard output
PASSED
73157a144b347114d245db96c75c5c80
train_000.jsonl
1368968400
Unfortunately, Vasya can only sum pairs of integers (a, b), such that for any decimal place at least one number has digit 0 in this place. For example, Vasya can sum numbers 505 and 50, but he cannot sum 1 and 4.Vasya has a set of k distinct non-negative integers d1, d2, ..., dk.Vasya wants to choose some integers from...
256 megabytes
import java.util.ArrayList; import java.util.List; import java.util.Scanner; public class strangeAddition { public static void main(String args[]){ Scanner sc=new Scanner(System.in); int n=sc.nextInt(); List<String> in=new ArrayList<>(); List<String> l=new ArrayList<>(); int[] out=new int [5]; while(n-->...
Java
["4\n100 10 1 0", "3\n2 70 3"]
2 seconds
["4\n0 1 10 100", "2\n2 70"]
null
Java 8
standard input
[ "constructive algorithms", "implementation", "brute force" ]
6b7d6f5c07b313c57d52db6a48d3eeef
The first input line contains integer k (1 ≤ k ≤ 100) — the number of integers. The second line contains k distinct space-separated integers d1, d2, ..., dk (0 ≤ di ≤ 100).
1,600
In the first line print a single integer n the maximum number of the chosen integers. In the second line print n distinct non-negative integers — the required integers. If there are multiple solutions, print any of them. You can print the numbers in any order.
standard output
PASSED
36c8705284060232dbff3d91ba7880da
train_000.jsonl
1347291900
The Free Meteor Association (FMA) has got a problem: as meteors are moving, the Universal Cosmic Descriptive Humorous Program (UCDHP) needs to add a special module that would analyze this movement. UCDHP stores some secret information about meteors as an n × m table with integers in its cells. The order of meteors in t...
256 megabytes
import java.io.IOException; import java.io.InputStream; import java.io.PrintWriter; import java.io.BufferedReader; import java.io.InputStreamReader; import java.util.HashMap; import java.util.StringTokenizer; public class Main { public static void main(String[] args) { InputReader in = new InputReader(System.in...
Java
["3 3 5\n1 2 3\n4 5 6\n7 8 9\ng 3 2\nr 3 2\nc 2 3\ng 2 2\ng 3 2", "2 3 3\n1 2 4\n3 1 5\nc 2 1\nr 1 2\ng 1 3"]
3 seconds
["8\n9\n6", "5"]
NoteLet's see how the table changes in the second test case.After the first operation is fulfilled, the table looks like that:2 1 41 3 5After the second operation is fulfilled, the table looks like that:1 3 52 1 4So the answer to the third query (the number located in the first row and in the third column) will be 5.
Java 11
standard input
[ "data structures", "implementation" ]
290d9779a6be44ce6a2e62989aee0dbd
The first line contains three space-separated integers n, m and k (1 ≤ n, m ≤ 1000, 1 ≤ k ≤ 500000) — the number of table columns and rows and the number of queries, correspondingly. Next n lines contain m space-separated numbers each — the initial state of the table. Each number p in the table is an integer and satisf...
1,300
For each query to obtain a number (si = "g") print the required number. Print the answers to the queries in the order of the queries in the input.
standard output
PASSED
06708807b63c99c75220b30ae0e47604
train_000.jsonl
1347291900
The Free Meteor Association (FMA) has got a problem: as meteors are moving, the Universal Cosmic Descriptive Humorous Program (UCDHP) needs to add a special module that would analyze this movement. UCDHP stores some secret information about meteors as an n × m table with integers in its cells. The order of meteors in t...
256 megabytes
import java.io.BufferedReader; import java.io.BufferedWriter; import java.io.IOException; import java.io.InputStreamReader; import java.io.OutputStreamWriter; import java.util.StringTokenizer; /** * * @author LENOVO Y520 */ public class cosmictables { /** * @param args the command line arguments * @...
Java
["3 3 5\n1 2 3\n4 5 6\n7 8 9\ng 3 2\nr 3 2\nc 2 3\ng 2 2\ng 3 2", "2 3 3\n1 2 4\n3 1 5\nc 2 1\nr 1 2\ng 1 3"]
3 seconds
["8\n9\n6", "5"]
NoteLet's see how the table changes in the second test case.After the first operation is fulfilled, the table looks like that:2 1 41 3 5After the second operation is fulfilled, the table looks like that:1 3 52 1 4So the answer to the third query (the number located in the first row and in the third column) will be 5.
Java 11
standard input
[ "data structures", "implementation" ]
290d9779a6be44ce6a2e62989aee0dbd
The first line contains three space-separated integers n, m and k (1 ≤ n, m ≤ 1000, 1 ≤ k ≤ 500000) — the number of table columns and rows and the number of queries, correspondingly. Next n lines contain m space-separated numbers each — the initial state of the table. Each number p in the table is an integer and satisf...
1,300
For each query to obtain a number (si = "g") print the required number. Print the answers to the queries in the order of the queries in the input.
standard output
PASSED
8c395f195fec39ae1be6b3a322f5968e
train_000.jsonl
1347291900
The Free Meteor Association (FMA) has got a problem: as meteors are moving, the Universal Cosmic Descriptive Humorous Program (UCDHP) needs to add a special module that would analyze this movement. UCDHP stores some secret information about meteors as an n × m table with integers in its cells. The order of meteors in t...
256 megabytes
import java.util.*; import java.io.*; import java.math.*; /* javac Main.java java Main <input.txt> output.txt */ public class Main { public static void process()throws IOException { int n=ni(); int m=ni(); int k=ni(); long arr[][]=new long[n][m]; int r[]=new int[n]; int c[]=new...
Java
["3 3 5\n1 2 3\n4 5 6\n7 8 9\ng 3 2\nr 3 2\nc 2 3\ng 2 2\ng 3 2", "2 3 3\n1 2 4\n3 1 5\nc 2 1\nr 1 2\ng 1 3"]
3 seconds
["8\n9\n6", "5"]
NoteLet's see how the table changes in the second test case.After the first operation is fulfilled, the table looks like that:2 1 41 3 5After the second operation is fulfilled, the table looks like that:1 3 52 1 4So the answer to the third query (the number located in the first row and in the third column) will be 5.
Java 11
standard input
[ "data structures", "implementation" ]
290d9779a6be44ce6a2e62989aee0dbd
The first line contains three space-separated integers n, m and k (1 ≤ n, m ≤ 1000, 1 ≤ k ≤ 500000) — the number of table columns and rows and the number of queries, correspondingly. Next n lines contain m space-separated numbers each — the initial state of the table. Each number p in the table is an integer and satisf...
1,300
For each query to obtain a number (si = "g") print the required number. Print the answers to the queries in the order of the queries in the input.
standard output
PASSED
f038fab895328c56d019026d83deefef
train_000.jsonl
1347291900
The Free Meteor Association (FMA) has got a problem: as meteors are moving, the Universal Cosmic Descriptive Humorous Program (UCDHP) needs to add a special module that would analyze this movement. UCDHP stores some secret information about meteors as an n × m table with integers in its cells. The order of meteors in t...
256 megabytes
import javax.swing.*; import java.io.*; import java.math.BigInteger; import java.util.*; public class Main { static PrintWriter out = new PrintWriter(System.out); static int[] tree; static long m = 1000000007; public static void main(String[] args) throws IOException { //BufferedReader reader=...
Java
["3 3 5\n1 2 3\n4 5 6\n7 8 9\ng 3 2\nr 3 2\nc 2 3\ng 2 2\ng 3 2", "2 3 3\n1 2 4\n3 1 5\nc 2 1\nr 1 2\ng 1 3"]
3 seconds
["8\n9\n6", "5"]
NoteLet's see how the table changes in the second test case.After the first operation is fulfilled, the table looks like that:2 1 41 3 5After the second operation is fulfilled, the table looks like that:1 3 52 1 4So the answer to the third query (the number located in the first row and in the third column) will be 5.
Java 11
standard input
[ "data structures", "implementation" ]
290d9779a6be44ce6a2e62989aee0dbd
The first line contains three space-separated integers n, m and k (1 ≤ n, m ≤ 1000, 1 ≤ k ≤ 500000) — the number of table columns and rows and the number of queries, correspondingly. Next n lines contain m space-separated numbers each — the initial state of the table. Each number p in the table is an integer and satisf...
1,300
For each query to obtain a number (si = "g") print the required number. Print the answers to the queries in the order of the queries in the input.
standard output
PASSED
f1f17abccbd40c262b06b31128c50314
train_000.jsonl
1347291900
The Free Meteor Association (FMA) has got a problem: as meteors are moving, the Universal Cosmic Descriptive Humorous Program (UCDHP) needs to add a special module that would analyze this movement. UCDHP stores some secret information about meteors as an n × m table with integers in its cells. The order of meteors in t...
256 megabytes
import java.awt.*; import java.io.*; import java.math.BigInteger; import java.util.*; public class TaskC { static Long[][]dp; static int n, m, ans; static StringBuilder[]s1,s2; static int[]arr; public static void main(String[] args) throws Exception { ...
Java
["3 3 5\n1 2 3\n4 5 6\n7 8 9\ng 3 2\nr 3 2\nc 2 3\ng 2 2\ng 3 2", "2 3 3\n1 2 4\n3 1 5\nc 2 1\nr 1 2\ng 1 3"]
3 seconds
["8\n9\n6", "5"]
NoteLet's see how the table changes in the second test case.After the first operation is fulfilled, the table looks like that:2 1 41 3 5After the second operation is fulfilled, the table looks like that:1 3 52 1 4So the answer to the third query (the number located in the first row and in the third column) will be 5.
Java 11
standard input
[ "data structures", "implementation" ]
290d9779a6be44ce6a2e62989aee0dbd
The first line contains three space-separated integers n, m and k (1 ≤ n, m ≤ 1000, 1 ≤ k ≤ 500000) — the number of table columns and rows and the number of queries, correspondingly. Next n lines contain m space-separated numbers each — the initial state of the table. Each number p in the table is an integer and satisf...
1,300
For each query to obtain a number (si = "g") print the required number. Print the answers to the queries in the order of the queries in the input.
standard output
PASSED
a12729f0bbe93dc35c16f56ff4fc767b
train_000.jsonl
1347291900
The Free Meteor Association (FMA) has got a problem: as meteors are moving, the Universal Cosmic Descriptive Humorous Program (UCDHP) needs to add a special module that would analyze this movement. UCDHP stores some secret information about meteors as an n × m table with integers in its cells. The order of meteors in t...
256 megabytes
import java.util.*; import java.io.*; public class A2OJ { public static class FastIO { BufferedReader br; BufferedWriter bw; StringTokenizer st; public FastIO() { br = new BufferedReader(new InputStreamReader(System.in)); bw = new BufferedWriter(new OutputStreamWriter(System.out)); st = new Strin...
Java
["3 3 5\n1 2 3\n4 5 6\n7 8 9\ng 3 2\nr 3 2\nc 2 3\ng 2 2\ng 3 2", "2 3 3\n1 2 4\n3 1 5\nc 2 1\nr 1 2\ng 1 3"]
3 seconds
["8\n9\n6", "5"]
NoteLet's see how the table changes in the second test case.After the first operation is fulfilled, the table looks like that:2 1 41 3 5After the second operation is fulfilled, the table looks like that:1 3 52 1 4So the answer to the third query (the number located in the first row and in the third column) will be 5.
Java 11
standard input
[ "data structures", "implementation" ]
290d9779a6be44ce6a2e62989aee0dbd
The first line contains three space-separated integers n, m and k (1 ≤ n, m ≤ 1000, 1 ≤ k ≤ 500000) — the number of table columns and rows and the number of queries, correspondingly. Next n lines contain m space-separated numbers each — the initial state of the table. Each number p in the table is an integer and satisf...
1,300
For each query to obtain a number (si = "g") print the required number. Print the answers to the queries in the order of the queries in the input.
standard output
PASSED
9a816eb6aba0fd634d7571dab7afbc0a
train_000.jsonl
1347291900
The Free Meteor Association (FMA) has got a problem: as meteors are moving, the Universal Cosmic Descriptive Humorous Program (UCDHP) needs to add a special module that would analyze this movement. UCDHP stores some secret information about meteors as an n × m table with integers in its cells. The order of meteors in t...
256 megabytes
import java.io.*; import java.util.*; public class main { static StringBuilder out=new StringBuilder(); static FastReader in=new FastReader(); public static void main(String []args){ int n=in.nextInt(), m=in.nextInt(), k=in.nextInt(); int arr[][]=new int[n][m]; ...
Java
["3 3 5\n1 2 3\n4 5 6\n7 8 9\ng 3 2\nr 3 2\nc 2 3\ng 2 2\ng 3 2", "2 3 3\n1 2 4\n3 1 5\nc 2 1\nr 1 2\ng 1 3"]
3 seconds
["8\n9\n6", "5"]
NoteLet's see how the table changes in the second test case.After the first operation is fulfilled, the table looks like that:2 1 41 3 5After the second operation is fulfilled, the table looks like that:1 3 52 1 4So the answer to the third query (the number located in the first row and in the third column) will be 5.
Java 11
standard input
[ "data structures", "implementation" ]
290d9779a6be44ce6a2e62989aee0dbd
The first line contains three space-separated integers n, m and k (1 ≤ n, m ≤ 1000, 1 ≤ k ≤ 500000) — the number of table columns and rows and the number of queries, correspondingly. Next n lines contain m space-separated numbers each — the initial state of the table. Each number p in the table is an integer and satisf...
1,300
For each query to obtain a number (si = "g") print the required number. Print the answers to the queries in the order of the queries in the input.
standard output
PASSED
59f3d5afa7f7687f1ba9a909bc4c246d
train_000.jsonl
1347291900
The Free Meteor Association (FMA) has got a problem: as meteors are moving, the Universal Cosmic Descriptive Humorous Program (UCDHP) needs to add a special module that would analyze this movement. UCDHP stores some secret information about meteors as an n × m table with integers in its cells. The order of meteors in t...
256 megabytes
import java.io.BufferedReader; import java.io.BufferedWriter; import java.io.InputStreamReader; import java.io.OutputStreamWriter; import java.util.StringTokenizer; public class CosmicTable { public static void main(String[] args) throws Exception { BufferedReader read = new BufferedReader(new InputSt...
Java
["3 3 5\n1 2 3\n4 5 6\n7 8 9\ng 3 2\nr 3 2\nc 2 3\ng 2 2\ng 3 2", "2 3 3\n1 2 4\n3 1 5\nc 2 1\nr 1 2\ng 1 3"]
3 seconds
["8\n9\n6", "5"]
NoteLet's see how the table changes in the second test case.After the first operation is fulfilled, the table looks like that:2 1 41 3 5After the second operation is fulfilled, the table looks like that:1 3 52 1 4So the answer to the third query (the number located in the first row and in the third column) will be 5.
Java 11
standard input
[ "data structures", "implementation" ]
290d9779a6be44ce6a2e62989aee0dbd
The first line contains three space-separated integers n, m and k (1 ≤ n, m ≤ 1000, 1 ≤ k ≤ 500000) — the number of table columns and rows and the number of queries, correspondingly. Next n lines contain m space-separated numbers each — the initial state of the table. Each number p in the table is an integer and satisf...
1,300
For each query to obtain a number (si = "g") print the required number. Print the answers to the queries in the order of the queries in the input.
standard output
PASSED
d6f7e51948680f6441a0c782d26fd64f
train_000.jsonl
1443890700
The GCD table G of size n × n for an array of positive integers a of length n is defined by formula Let us remind you that the greatest common divisor (GCD) of two positive integers x and y is the greatest integer that is divisor of both x and y, it is denoted as . For example, for array a = {4, 3, 6, 2} of length 4 ...
256 megabytes
import java.io.*; import java.util.*; /** * @author master_j * @version 0.4.1 * @since Mar 22, 2015 */ public class Solution { private int gcd(int a, int b) { if (b == 0) return a; else return gcd(b, a % b); } private void solve() throws IOException { // ...
Java
["4\n2 1 2 3 4 3 2 6 1 1 2 2 1 2 3 2", "1\n42", "2\n1 1 1 1"]
2 seconds
["4 3 6 2", "42", "1 1"]
null
Java 8
standard input
[ "constructive algorithms", "number theory" ]
71dc07f0ea8962f23457af1d6509aeee
The first line contains number n (1 ≤ n ≤ 500) — the length of array a. The second line contains n2 space-separated numbers — the elements of the GCD table of G for array a. All the numbers in the table are positive integers, not exceeding 109. Note that the elements are given in an arbitrary order. It is guaranteed t...
1,700
In the single line print n positive integers — the elements of array a. If there are multiple possible solutions, you are allowed to print any of them.
standard output
PASSED
3e94df8bfdb16f0d1b858cd122df36a7
train_000.jsonl
1443890700
The GCD table G of size n × n for an array of positive integers a of length n is defined by formula Let us remind you that the greatest common divisor (GCD) of two positive integers x and y is the greatest integer that is divisor of both x and y, it is denoted as . For example, for array a = {4, 3, 6, 2} of length 4 ...
256 megabytes
// Problem : C. GCD Table // Contest : Codeforces - Codeforces Round #323 (Div. 2) // URL : https://codeforces.com/contest/583/problem/C // Memory Limit : 0 MB // Time Limit : 0 ms // Powered by CP Editor (https://github.com/cpeditor/cpeditor) import java.io.*; import java.util.*; public class a implements Runnable{...
Java
["4\n2 1 2 3 4 3 2 6 1 1 2 2 1 2 3 2", "1\n42", "2\n1 1 1 1"]
2 seconds
["4 3 6 2", "42", "1 1"]
null
Java 8
standard input
[ "constructive algorithms", "number theory" ]
71dc07f0ea8962f23457af1d6509aeee
The first line contains number n (1 ≤ n ≤ 500) — the length of array a. The second line contains n2 space-separated numbers — the elements of the GCD table of G for array a. All the numbers in the table are positive integers, not exceeding 109. Note that the elements are given in an arbitrary order. It is guaranteed t...
1,700
In the single line print n positive integers — the elements of array a. If there are multiple possible solutions, you are allowed to print any of them.
standard output
PASSED
eb1e508a13f6de044b3a891497f99c92
train_000.jsonl
1443890700
The GCD table G of size n × n for an array of positive integers a of length n is defined by formula Let us remind you that the greatest common divisor (GCD) of two positive integers x and y is the greatest integer that is divisor of both x and y, it is denoted as . For example, for array a = {4, 3, 6, 2} of length 4 ...
256 megabytes
import java.util.Arrays; import java.util.ArrayList; import java.io.InputStream; import java.io.InputStreamReader; import java.util.HashMap; import java.io.BufferedReader; import java.util.List; import java.io.OutputStream; import java.util.Comparator; import java.io.PrintWriter; import java.io.Writer; import java.io.F...
Java
["4\n2 1 2 3 4 3 2 6 1 1 2 2 1 2 3 2", "1\n42", "2\n1 1 1 1"]
2 seconds
["4 3 6 2", "42", "1 1"]
null
Java 8
standard input
[ "constructive algorithms", "number theory" ]
71dc07f0ea8962f23457af1d6509aeee
The first line contains number n (1 ≤ n ≤ 500) — the length of array a. The second line contains n2 space-separated numbers — the elements of the GCD table of G for array a. All the numbers in the table are positive integers, not exceeding 109. Note that the elements are given in an arbitrary order. It is guaranteed t...
1,700
In the single line print n positive integers — the elements of array a. If there are multiple possible solutions, you are allowed to print any of them.
standard output
PASSED
c9e1dce37aa4e6b5bffff318cb31ac43
train_000.jsonl
1443890700
The GCD table G of size n × n for an array of positive integers a of length n is defined by formula Let us remind you that the greatest common divisor (GCD) of two positive integers x and y is the greatest integer that is divisor of both x and y, it is denoted as . For example, for array a = {4, 3, 6, 2} of length 4 ...
256 megabytes
import java.io.InputStream; import java.io.OutputStream; import java.io.IOException; import java.util.ArrayList; import java.io.InputStream; import java.io.BufferedReader; import java.util.List; import java.util.TreeMap; import java.io.InputStreamReader; import java.io.IOException; import java.io.PrintWriter; import ja...
Java
["4\n2 1 2 3 4 3 2 6 1 1 2 2 1 2 3 2", "1\n42", "2\n1 1 1 1"]
2 seconds
["4 3 6 2", "42", "1 1"]
null
Java 8
standard input
[ "constructive algorithms", "number theory" ]
71dc07f0ea8962f23457af1d6509aeee
The first line contains number n (1 ≤ n ≤ 500) — the length of array a. The second line contains n2 space-separated numbers — the elements of the GCD table of G for array a. All the numbers in the table are positive integers, not exceeding 109. Note that the elements are given in an arbitrary order. It is guaranteed t...
1,700
In the single line print n positive integers — the elements of array a. If there are multiple possible solutions, you are allowed to print any of them.
standard output
PASSED
bd91c3506970149274b8a171f39fbd30
train_000.jsonl
1443890700
The GCD table G of size n × n for an array of positive integers a of length n is defined by formula Let us remind you that the greatest common divisor (GCD) of two positive integers x and y is the greatest integer that is divisor of both x and y, it is denoted as . For example, for array a = {4, 3, 6, 2} of length 4 ...
256 megabytes
import java.io.*; import java.util.*; public class Main { public static void main(String[] args) { InputStream inputStream = System.in; OutputStream outputStream = System.out; InputReader in = new InputReader(inputStream); OutputWriter out = new OutputWriter(outputStream); ...
Java
["4\n2 1 2 3 4 3 2 6 1 1 2 2 1 2 3 2", "1\n42", "2\n1 1 1 1"]
2 seconds
["4 3 6 2", "42", "1 1"]
null
Java 8
standard input
[ "constructive algorithms", "number theory" ]
71dc07f0ea8962f23457af1d6509aeee
The first line contains number n (1 ≤ n ≤ 500) — the length of array a. The second line contains n2 space-separated numbers — the elements of the GCD table of G for array a. All the numbers in the table are positive integers, not exceeding 109. Note that the elements are given in an arbitrary order. It is guaranteed t...
1,700
In the single line print n positive integers — the elements of array a. If there are multiple possible solutions, you are allowed to print any of them.
standard output
PASSED
d919f722625b465ed26cd2817b461e94
train_000.jsonl
1443890700
The GCD table G of size n × n for an array of positive integers a of length n is defined by formula Let us remind you that the greatest common divisor (GCD) of two positive integers x and y is the greatest integer that is divisor of both x and y, it is denoted as . For example, for array a = {4, 3, 6, 2} of length 4 ...
256 megabytes
import java.io.*; import java.util.*; public class Main { public static void main(String[] args) throws Exception { BufferedReader in = new BufferedReader(new InputStreamReader(System.in)); PrintWriter out = new PrintWriter(System.out); TreeMap<Integer, Integer> set = new TreeMap<>(); ...
Java
["4\n2 1 2 3 4 3 2 6 1 1 2 2 1 2 3 2", "1\n42", "2\n1 1 1 1"]
2 seconds
["4 3 6 2", "42", "1 1"]
null
Java 8
standard input
[ "constructive algorithms", "number theory" ]
71dc07f0ea8962f23457af1d6509aeee
The first line contains number n (1 ≤ n ≤ 500) — the length of array a. The second line contains n2 space-separated numbers — the elements of the GCD table of G for array a. All the numbers in the table are positive integers, not exceeding 109. Note that the elements are given in an arbitrary order. It is guaranteed t...
1,700
In the single line print n positive integers — the elements of array a. If there are multiple possible solutions, you are allowed to print any of them.
standard output
PASSED
75f54f37e906280352da16ba08940c94
train_000.jsonl
1443890700
The GCD table G of size n × n for an array of positive integers a of length n is defined by formula Let us remind you that the greatest common divisor (GCD) of two positive integers x and y is the greatest integer that is divisor of both x and y, it is denoted as . For example, for array a = {4, 3, 6, 2} of length 4 ...
256 megabytes
/* * To change this license header, choose License Headers in Project Properties. * To change this template file, choose Tools | Templates * and open the template in the editor. */ import java.util.ArrayList; import java.util.Scanner; import java.util.TreeMap; /** * * @author Simone Vuotto */ public class C ...
Java
["4\n2 1 2 3 4 3 2 6 1 1 2 2 1 2 3 2", "1\n42", "2\n1 1 1 1"]
2 seconds
["4 3 6 2", "42", "1 1"]
null
Java 8
standard input
[ "constructive algorithms", "number theory" ]
71dc07f0ea8962f23457af1d6509aeee
The first line contains number n (1 ≤ n ≤ 500) — the length of array a. The second line contains n2 space-separated numbers — the elements of the GCD table of G for array a. All the numbers in the table are positive integers, not exceeding 109. Note that the elements are given in an arbitrary order. It is guaranteed t...
1,700
In the single line print n positive integers — the elements of array a. If there are multiple possible solutions, you are allowed to print any of them.
standard output
PASSED
fe6c7d5afad631709c51f303a68b1709
train_000.jsonl
1443890700
The GCD table G of size n × n for an array of positive integers a of length n is defined by formula Let us remind you that the greatest common divisor (GCD) of two positive integers x and y is the greatest integer that is divisor of both x and y, it is denoted as . For example, for array a = {4, 3, 6, 2} of length 4 ...
256 megabytes
/* * To change this license header, choose License Headers in Project Properties. * To change this template file, choose Tools | Templates * and open the template in the editor. */ //package codeforces323; import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; import java.util...
Java
["4\n2 1 2 3 4 3 2 6 1 1 2 2 1 2 3 2", "1\n42", "2\n1 1 1 1"]
2 seconds
["4 3 6 2", "42", "1 1"]
null
Java 8
standard input
[ "constructive algorithms", "number theory" ]
71dc07f0ea8962f23457af1d6509aeee
The first line contains number n (1 ≤ n ≤ 500) — the length of array a. The second line contains n2 space-separated numbers — the elements of the GCD table of G for array a. All the numbers in the table are positive integers, not exceeding 109. Note that the elements are given in an arbitrary order. It is guaranteed t...
1,700
In the single line print n positive integers — the elements of array a. If there are multiple possible solutions, you are allowed to print any of them.
standard output
PASSED
fc5c4e3d26a536fb9911e75232c2da4d
train_000.jsonl
1443890700
The GCD table G of size n × n for an array of positive integers a of length n is defined by formula Let us remind you that the greatest common divisor (GCD) of two positive integers x and y is the greatest integer that is divisor of both x and y, it is denoted as . For example, for array a = {4, 3, 6, 2} of length 4 ...
256 megabytes
import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; import java.io.PrintWriter; import java.util.Map.Entry; import java.util.StringTokenizer; import java.util.TreeMap; public class Main { public static void main(String args[]) throws NumberFormatException,IOException { S...
Java
["4\n2 1 2 3 4 3 2 6 1 1 2 2 1 2 3 2", "1\n42", "2\n1 1 1 1"]
2 seconds
["4 3 6 2", "42", "1 1"]
null
Java 8
standard input
[ "constructive algorithms", "number theory" ]
71dc07f0ea8962f23457af1d6509aeee
The first line contains number n (1 ≤ n ≤ 500) — the length of array a. The second line contains n2 space-separated numbers — the elements of the GCD table of G for array a. All the numbers in the table are positive integers, not exceeding 109. Note that the elements are given in an arbitrary order. It is guaranteed t...
1,700
In the single line print n positive integers — the elements of array a. If there are multiple possible solutions, you are allowed to print any of them.
standard output
PASSED
4a70a20dac3d7dfc8e779c40cdb23411
train_000.jsonl
1443890700
The GCD table G of size n × n for an array of positive integers a of length n is defined by formula Let us remind you that the greatest common divisor (GCD) of two positive integers x and y is the greatest integer that is divisor of both x and y, it is denoted as . For example, for array a = {4, 3, 6, 2} of length 4 ...
256 megabytes
import java.io.*; import java.math.*; import java.util.*; import java.util.stream.*; import java.util.concurrent.*; @SuppressWarnings("unchecked") public class P583C { int gcd(int a, int b) { return ((b > 0) ? gcd(b, a % b) : a); } TreeMap<Integer, Integer> nc = new TreeMap(Comparator.reverseOrder()); v...
Java
["4\n2 1 2 3 4 3 2 6 1 1 2 2 1 2 3 2", "1\n42", "2\n1 1 1 1"]
2 seconds
["4 3 6 2", "42", "1 1"]
null
Java 8
standard input
[ "constructive algorithms", "number theory" ]
71dc07f0ea8962f23457af1d6509aeee
The first line contains number n (1 ≤ n ≤ 500) — the length of array a. The second line contains n2 space-separated numbers — the elements of the GCD table of G for array a. All the numbers in the table are positive integers, not exceeding 109. Note that the elements are given in an arbitrary order. It is guaranteed t...
1,700
In the single line print n positive integers — the elements of array a. If there are multiple possible solutions, you are allowed to print any of them.
standard output
PASSED
5d48e92823ebed09bf983c2bb54da3f3
train_000.jsonl
1443890700
The GCD table G of size n × n for an array of positive integers a of length n is defined by formula Let us remind you that the greatest common divisor (GCD) of two positive integers x and y is the greatest integer that is divisor of both x and y, it is denoted as . For example, for array a = {4, 3, 6, 2} of length 4 ...
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); public static void main(String[] args) { int n = in.nextInt(); int[] a = new int[n * n]; MyTreeMap t = new MyTreeMap(); for(int i=0; ...
Java
["4\n2 1 2 3 4 3 2 6 1 1 2 2 1 2 3 2", "1\n42", "2\n1 1 1 1"]
2 seconds
["4 3 6 2", "42", "1 1"]
null
Java 8
standard input
[ "constructive algorithms", "number theory" ]
71dc07f0ea8962f23457af1d6509aeee
The first line contains number n (1 ≤ n ≤ 500) — the length of array a. The second line contains n2 space-separated numbers — the elements of the GCD table of G for array a. All the numbers in the table are positive integers, not exceeding 109. Note that the elements are given in an arbitrary order. It is guaranteed t...
1,700
In the single line print n positive integers — the elements of array a. If there are multiple possible solutions, you are allowed to print any of them.
standard output
PASSED
07d2102218a761918004f91785a036f6
train_000.jsonl
1443890700
The GCD table G of size n × n for an array of positive integers a of length n is defined by formula Let us remind you that the greatest common divisor (GCD) of two positive integers x and y is the greatest integer that is divisor of both x and y, it is denoted as . For example, for array a = {4, 3, 6, 2} of length 4 ...
256 megabytes
import java.io.OutputStream; import java.io.IOException; import java.io.InputStream; import java.io.PrintWriter; import java.util.TreeMap; import java.util.StringTokenizer; import java.io.IOException; import java.io.BufferedReader; import java.io.InputStreamReader; import java.io.InputStream; /** * Built using CHelpe...
Java
["4\n2 1 2 3 4 3 2 6 1 1 2 2 1 2 3 2", "1\n42", "2\n1 1 1 1"]
2 seconds
["4 3 6 2", "42", "1 1"]
null
Java 8
standard input
[ "constructive algorithms", "number theory" ]
71dc07f0ea8962f23457af1d6509aeee
The first line contains number n (1 ≤ n ≤ 500) — the length of array a. The second line contains n2 space-separated numbers — the elements of the GCD table of G for array a. All the numbers in the table are positive integers, not exceeding 109. Note that the elements are given in an arbitrary order. It is guaranteed t...
1,700
In the single line print n positive integers — the elements of array a. If there are multiple possible solutions, you are allowed to print any of them.
standard output
PASSED
c547425985bdf81bcf0e4cf6ceb3d203
train_000.jsonl
1443890700
The GCD table G of size n × n for an array of positive integers a of length n is defined by formula Let us remind you that the greatest common divisor (GCD) of two positive integers x and y is the greatest integer that is divisor of both x and y, it is denoted as . For example, for array a = {4, 3, 6, 2} of length 4 ...
256 megabytes
import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; import java.io.PrintWriter; import java.util.ArrayList; import java.util.Arrays; import java.util.Collections; import java.util.HashMap; import java.util.Scanner; public class CF_323_C { private static int gcd(int a,...
Java
["4\n2 1 2 3 4 3 2 6 1 1 2 2 1 2 3 2", "1\n42", "2\n1 1 1 1"]
2 seconds
["4 3 6 2", "42", "1 1"]
null
Java 8
standard input
[ "constructive algorithms", "number theory" ]
71dc07f0ea8962f23457af1d6509aeee
The first line contains number n (1 ≤ n ≤ 500) — the length of array a. The second line contains n2 space-separated numbers — the elements of the GCD table of G for array a. All the numbers in the table are positive integers, not exceeding 109. Note that the elements are given in an arbitrary order. It is guaranteed t...
1,700
In the single line print n positive integers — the elements of array a. If there are multiple possible solutions, you are allowed to print any of them.
standard output
PASSED
19f752e80768dae5662b014f81e235a5
train_000.jsonl
1443890700
The GCD table G of size n × n for an array of positive integers a of length n is defined by formula Let us remind you that the greatest common divisor (GCD) of two positive integers x and y is the greatest integer that is divisor of both x and y, it is denoted as . For example, for array a = {4, 3, 6, 2} of length 4 ...
256 megabytes
import java.io.InputStream; import java.io.OutputStream; import java.io.IOException; import java.util.ArrayList; import java.io.InputStream; import java.io.BufferedReader; import java.io.FileReader; import java.util.TreeMap; import java.io.InputStreamReader; import java.io.IOException; import java.io.PrintWriter; impor...
Java
["4\n2 1 2 3 4 3 2 6 1 1 2 2 1 2 3 2", "1\n42", "2\n1 1 1 1"]
2 seconds
["4 3 6 2", "42", "1 1"]
null
Java 8
standard input
[ "constructive algorithms", "number theory" ]
71dc07f0ea8962f23457af1d6509aeee
The first line contains number n (1 ≤ n ≤ 500) — the length of array a. The second line contains n2 space-separated numbers — the elements of the GCD table of G for array a. All the numbers in the table are positive integers, not exceeding 109. Note that the elements are given in an arbitrary order. It is guaranteed t...
1,700
In the single line print n positive integers — the elements of array a. If there are multiple possible solutions, you are allowed to print any of them.
standard output
PASSED
aed00afb17bca8fff70322f1aa70ceb6
train_000.jsonl
1443890700
The GCD table G of size n × n for an array of positive integers a of length n is defined by formula Let us remind you that the greatest common divisor (GCD) of two positive integers x and y is the greatest integer that is divisor of both x and y, it is denoted as . For example, for array a = {4, 3, 6, 2} of length 4 ...
256 megabytes
import java.util.*; public class C { private static Map<Integer, Integer> map; public static void main(String[] args) { Scanner cin = new Scanner(System.in); int n = cin.nextInt(); int[] a = new int[n * n]; map = new HashMap<>(); for (int i = 0; i < n * n; i++) { ...
Java
["4\n2 1 2 3 4 3 2 6 1 1 2 2 1 2 3 2", "1\n42", "2\n1 1 1 1"]
2 seconds
["4 3 6 2", "42", "1 1"]
null
Java 8
standard input
[ "constructive algorithms", "number theory" ]
71dc07f0ea8962f23457af1d6509aeee
The first line contains number n (1 ≤ n ≤ 500) — the length of array a. The second line contains n2 space-separated numbers — the elements of the GCD table of G for array a. All the numbers in the table are positive integers, not exceeding 109. Note that the elements are given in an arbitrary order. It is guaranteed t...
1,700
In the single line print n positive integers — the elements of array a. If there are multiple possible solutions, you are allowed to print any of them.
standard output
PASSED
3a52b6af6e596f8b469ceeb91d41b18c
train_000.jsonl
1443890700
The GCD table G of size n × n for an array of positive integers a of length n is defined by formula Let us remind you that the greatest common divisor (GCD) of two positive integers x and y is the greatest integer that is divisor of both x and y, it is denoted as . For example, for array a = {4, 3, 6, 2} of length 4 ...
256 megabytes
import java.util.ArrayList; import java.util.Comparator; import java.util.List; import java.util.Scanner; import java.util.TreeMap; public class GCDTable { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int n = sc.nextInt(); List<Integer> res = new ArrayList<...
Java
["4\n2 1 2 3 4 3 2 6 1 1 2 2 1 2 3 2", "1\n42", "2\n1 1 1 1"]
2 seconds
["4 3 6 2", "42", "1 1"]
null
Java 8
standard input
[ "constructive algorithms", "number theory" ]
71dc07f0ea8962f23457af1d6509aeee
The first line contains number n (1 ≤ n ≤ 500) — the length of array a. The second line contains n2 space-separated numbers — the elements of the GCD table of G for array a. All the numbers in the table are positive integers, not exceeding 109. Note that the elements are given in an arbitrary order. It is guaranteed t...
1,700
In the single line print n positive integers — the elements of array a. If there are multiple possible solutions, you are allowed to print any of them.
standard output
PASSED
6e89d2d25ad311278764d6850084cba6
train_000.jsonl
1443890700
The GCD table G of size n × n for an array of positive integers a of length n is defined by formula Let us remind you that the greatest common divisor (GCD) of two positive integers x and y is the greatest integer that is divisor of both x and y, it is denoted as . For example, for array a = {4, 3, 6, 2} of length 4 ...
256 megabytes
import java.util.*; public class C { static HashMap<Integer, Integer> hash = new HashMap<>(); public static void main(String[] args) { Scanner sc = new Scanner(System.in); int N = sc.nextInt(); int max = 0; for (int i = 0; i < N * N; i++) { int x = sc.nextInt(); ...
Java
["4\n2 1 2 3 4 3 2 6 1 1 2 2 1 2 3 2", "1\n42", "2\n1 1 1 1"]
2 seconds
["4 3 6 2", "42", "1 1"]
null
Java 8
standard input
[ "constructive algorithms", "number theory" ]
71dc07f0ea8962f23457af1d6509aeee
The first line contains number n (1 ≤ n ≤ 500) — the length of array a. The second line contains n2 space-separated numbers — the elements of the GCD table of G for array a. All the numbers in the table are positive integers, not exceeding 109. Note that the elements are given in an arbitrary order. It is guaranteed t...
1,700
In the single line print n positive integers — the elements of array a. If there are multiple possible solutions, you are allowed to print any of them.
standard output
PASSED
271a77819a743cdbc35c0fb2e9c75446
train_000.jsonl
1443890700
The GCD table G of size n × n for an array of positive integers a of length n is defined by formula Let us remind you that the greatest common divisor (GCD) of two positive integers x and y is the greatest integer that is divisor of both x and y, it is denoted as . For example, for array a = {4, 3, 6, 2} of length 4 ...
256 megabytes
import java.io.OutputStream; import java.io.IOException; import java.io.InputStream; import java.io.PrintWriter; import java.util.TreeMap; import java.util.StringTokenizer; import java.io.IOException; import java.io.BufferedReader; import java.io.InputStreamReader; import java.io.InputStream; /** * Built using CHelpe...
Java
["4\n2 1 2 3 4 3 2 6 1 1 2 2 1 2 3 2", "1\n42", "2\n1 1 1 1"]
2 seconds
["4 3 6 2", "42", "1 1"]
null
Java 8
standard input
[ "constructive algorithms", "number theory" ]
71dc07f0ea8962f23457af1d6509aeee
The first line contains number n (1 ≤ n ≤ 500) — the length of array a. The second line contains n2 space-separated numbers — the elements of the GCD table of G for array a. All the numbers in the table are positive integers, not exceeding 109. Note that the elements are given in an arbitrary order. It is guaranteed t...
1,700
In the single line print n positive integers — the elements of array a. If there are multiple possible solutions, you are allowed to print any of them.
standard output
PASSED
e4f695117b147b4dec34c3dd6861910a
train_000.jsonl
1443890700
The GCD table G of size n × n for an array of positive integers a of length n is defined by formula Let us remind you that the greatest common divisor (GCD) of two positive integers x and y is the greatest integer that is divisor of both x and y, it is denoted as . For example, for array a = {4, 3, 6, 2} of length 4 ...
256 megabytes
import java.io.*; import java.util.*; import java.text.*; import java.math.*; import java.util.regex.*; import java.lang.*; public class Third { //static long m=1000000007; static BigInteger ways(int N, int K) { BigInteger ret = BigInteger.ONE; for(int i=N;i>=N-K+1;i--) { ...
Java
["4\n2 1 2 3 4 3 2 6 1 1 2 2 1 2 3 2", "1\n42", "2\n1 1 1 1"]
2 seconds
["4 3 6 2", "42", "1 1"]
null
Java 8
standard input
[ "constructive algorithms", "number theory" ]
71dc07f0ea8962f23457af1d6509aeee
The first line contains number n (1 ≤ n ≤ 500) — the length of array a. The second line contains n2 space-separated numbers — the elements of the GCD table of G for array a. All the numbers in the table are positive integers, not exceeding 109. Note that the elements are given in an arbitrary order. It is guaranteed t...
1,700
In the single line print n positive integers — the elements of array a. If there are multiple possible solutions, you are allowed to print any of them.
standard output
PASSED
4f2de08dfd2d5f38eb3583b0c581e361
train_000.jsonl
1443890700
The GCD table G of size n × n for an array of positive integers a of length n is defined by formula Let us remind you that the greatest common divisor (GCD) of two positive integers x and y is the greatest integer that is divisor of both x and y, it is denoted as . For example, for array a = {4, 3, 6, 2} of length 4 ...
256 megabytes
//package Codeforces; import java.io.*; import java.util.*; /** * Created by tawsif on 10/10/15. * Time: 3:50 PM */ public class GCDTable323C { final boolean ONLINE_JUDGE = System.getProperty("ONLINE_JUDGE") != null; PrintWriter out; long timeBegin, timeEnd; // Write Solution Here int gcd(int a, int b) { r...
Java
["4\n2 1 2 3 4 3 2 6 1 1 2 2 1 2 3 2", "1\n42", "2\n1 1 1 1"]
2 seconds
["4 3 6 2", "42", "1 1"]
null
Java 8
standard input
[ "constructive algorithms", "number theory" ]
71dc07f0ea8962f23457af1d6509aeee
The first line contains number n (1 ≤ n ≤ 500) — the length of array a. The second line contains n2 space-separated numbers — the elements of the GCD table of G for array a. All the numbers in the table are positive integers, not exceeding 109. Note that the elements are given in an arbitrary order. It is guaranteed t...
1,700
In the single line print n positive integers — the elements of array a. If there are multiple possible solutions, you are allowed to print any of them.
standard output
PASSED
8022c7f333a511707dbdaf5164db48db
train_000.jsonl
1443890700
The GCD table G of size n × n for an array of positive integers a of length n is defined by formula Let us remind you that the greatest common divisor (GCD) of two positive integers x and y is the greatest integer that is divisor of both x and y, it is denoted as . For example, for array a = {4, 3, 6, 2} of length 4 ...
256 megabytes
import java.io.*; import java.util.Map; import java.util.SortedMap; import java.util.StringTokenizer; import java.util.TreeMap; public class Main { private final InputReader in; private final PrintWriter out; public Main(final InputReader in, final PrintWriter out) { this.in = in; this.out...
Java
["4\n2 1 2 3 4 3 2 6 1 1 2 2 1 2 3 2", "1\n42", "2\n1 1 1 1"]
2 seconds
["4 3 6 2", "42", "1 1"]
null
Java 8
standard input
[ "constructive algorithms", "number theory" ]
71dc07f0ea8962f23457af1d6509aeee
The first line contains number n (1 ≤ n ≤ 500) — the length of array a. The second line contains n2 space-separated numbers — the elements of the GCD table of G for array a. All the numbers in the table are positive integers, not exceeding 109. Note that the elements are given in an arbitrary order. It is guaranteed t...
1,700
In the single line print n positive integers — the elements of array a. If there are multiple possible solutions, you are allowed to print any of them.
standard output
PASSED
888262bebde60e271e19ed5dfdeeb408
train_000.jsonl
1443890700
The GCD table G of size n × n for an array of positive integers a of length n is defined by formula Let us remind you that the greatest common divisor (GCD) of two positive integers x and y is the greatest integer that is divisor of both x and y, it is denoted as . For example, for array a = {4, 3, 6, 2} of length 4 ...
256 megabytes
import java.io.OutputStream; import java.io.IOException; import java.io.InputStream; import java.io.PrintWriter; import java.util.Arrays; import java.io.IOException; import java.io.InputStreamReader; import java.util.TreeMap; import java.util.StringTokenizer; import java.io.BufferedReader; import java.io.InputStream; ...
Java
["4\n2 1 2 3 4 3 2 6 1 1 2 2 1 2 3 2", "1\n42", "2\n1 1 1 1"]
2 seconds
["4 3 6 2", "42", "1 1"]
null
Java 8
standard input
[ "constructive algorithms", "number theory" ]
71dc07f0ea8962f23457af1d6509aeee
The first line contains number n (1 ≤ n ≤ 500) — the length of array a. The second line contains n2 space-separated numbers — the elements of the GCD table of G for array a. All the numbers in the table are positive integers, not exceeding 109. Note that the elements are given in an arbitrary order. It is guaranteed t...
1,700
In the single line print n positive integers — the elements of array a. If there are multiple possible solutions, you are allowed to print any of them.
standard output