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
cf3bc50bd84960c9c4c2a982e6ae4eeb
train_003.jsonl
1314633600
Petya loves lucky numbers. We all know that lucky numbers are the positive integers whose decimal representations contain only the lucky digits 4 and 7. For example, numbers 47, 744, 4 are lucky and 5, 17, 467 are not.One day Petya encountered a tree with n vertexes. Besides, the tree was weighted, i. e. each edge of t...
256 megabytes
/** * Created with IntelliJ IDEA. * User: yuantian * Date: 4/29/13 * Time: 11:08 PM * Copyright (c) 2013 All Right Reserved, http://github.com/tyuan73 */ import java.util.*; public class LuckyTree84Div2 { static long total = 0; static boolean[] visited; public static void main(String[] args) { ...
Java
["4\n1 2 4\n3 1 2\n1 4 7", "4\n1 2 4\n1 3 47\n1 4 7447"]
2 seconds
["16", "24"]
NoteThe 16 triples of vertexes from the first sample are: (1, 2, 4), (1, 4, 2), (2, 1, 3), (2, 1, 4), (2, 3, 1), (2, 3, 4), (2, 4, 1), (2, 4, 3), (3, 2, 4), (3, 4, 2), (4, 1, 2), (4, 1, 3), (4, 2, 1), (4, 2, 3), (4, 3, 1), (4, 3, 2).In the second sample all the triples should be counted: 4·3·2 = 24.
Java 6
standard input
[ "combinatorics", "dfs and similar", "trees" ]
6992db71923a01211b5073ee0f8a193a
The first line contains the single integer n (1 ≤ n ≤ 105) — the number of tree vertexes. Next n - 1 lines contain three integers each: ui vi wi (1 ≤ ui, vi ≤ n, 1 ≤ wi ≤ 109) — the pair of vertexes connected by the edge and the edge's weight.
1,900
On the single line print the single number — the answer. Please do not use the %lld specificator to read or write 64-bit numbers in С++. It is recommended to use the cin, cout streams or the %I64d specificator.
standard output
PASSED
79195685301854fb60cedd873132032d
train_003.jsonl
1314633600
Petya loves lucky numbers. We all know that lucky numbers are the positive integers whose decimal representations contain only the lucky digits 4 and 7. For example, numbers 47, 744, 4 are lucky and 5, 17, 467 are not.One day Petya encountered a tree with n vertexes. Besides, the tree was weighted, i. e. each edge of t...
256 megabytes
import java.util.ArrayList; import java.util.Arrays; import java.util.Scanner; public class LuckyTree { static ArrayList<ArrayList<int[]>> tree; static int[] f; static int[] g; static int[] c; static boolean[] p; static int time = 0; static int[] inTime; public static void main(String[]...
Java
["4\n1 2 4\n3 1 2\n1 4 7", "4\n1 2 4\n1 3 47\n1 4 7447"]
2 seconds
["16", "24"]
NoteThe 16 triples of vertexes from the first sample are: (1, 2, 4), (1, 4, 2), (2, 1, 3), (2, 1, 4), (2, 3, 1), (2, 3, 4), (2, 4, 1), (2, 4, 3), (3, 2, 4), (3, 4, 2), (4, 1, 2), (4, 1, 3), (4, 2, 1), (4, 2, 3), (4, 3, 1), (4, 3, 2).In the second sample all the triples should be counted: 4·3·2 = 24.
Java 6
standard input
[ "combinatorics", "dfs and similar", "trees" ]
6992db71923a01211b5073ee0f8a193a
The first line contains the single integer n (1 ≤ n ≤ 105) — the number of tree vertexes. Next n - 1 lines contain three integers each: ui vi wi (1 ≤ ui, vi ≤ n, 1 ≤ wi ≤ 109) — the pair of vertexes connected by the edge and the edge's weight.
1,900
On the single line print the single number — the answer. Please do not use the %lld specificator to read or write 64-bit numbers in С++. It is recommended to use the cin, cout streams or the %I64d specificator.
standard output
PASSED
f8109ba8f0ab90c4c034c4b374e66169
train_003.jsonl
1314633600
Petya loves lucky numbers. We all know that lucky numbers are the positive integers whose decimal representations contain only the lucky digits 4 and 7. For example, numbers 47, 744, 4 are lucky and 5, 17, 467 are not.One day Petya encountered a tree with n vertexes. Besides, the tree was weighted, i. e. each edge of t...
256 megabytes
import java.util.*; import java.lang.*; import java.math.*; import java.io.*; import static java.lang.Math.*; import static java.util.Arrays.*; public class E{ Scanner sc=new Scanner(System.in); int INF=1<<28; double EPS=1e-9; int n; void run(){ n=sc.nextInt(); make(n); ...
Java
["4\n1 2 4\n3 1 2\n1 4 7", "4\n1 2 4\n1 3 47\n1 4 7447"]
2 seconds
["16", "24"]
NoteThe 16 triples of vertexes from the first sample are: (1, 2, 4), (1, 4, 2), (2, 1, 3), (2, 1, 4), (2, 3, 1), (2, 3, 4), (2, 4, 1), (2, 4, 3), (3, 2, 4), (3, 4, 2), (4, 1, 2), (4, 1, 3), (4, 2, 1), (4, 2, 3), (4, 3, 1), (4, 3, 2).In the second sample all the triples should be counted: 4·3·2 = 24.
Java 6
standard input
[ "combinatorics", "dfs and similar", "trees" ]
6992db71923a01211b5073ee0f8a193a
The first line contains the single integer n (1 ≤ n ≤ 105) — the number of tree vertexes. Next n - 1 lines contain three integers each: ui vi wi (1 ≤ ui, vi ≤ n, 1 ≤ wi ≤ 109) — the pair of vertexes connected by the edge and the edge's weight.
1,900
On the single line print the single number — the answer. Please do not use the %lld specificator to read or write 64-bit numbers in С++. It is recommended to use the cin, cout streams or the %I64d specificator.
standard output
PASSED
3ed2a6ad9ae55a0ec181006fcc224242
train_003.jsonl
1314633600
Petya loves lucky numbers. We all know that lucky numbers are the positive integers whose decimal representations contain only the lucky digits 4 and 7. For example, numbers 47, 744, 4 are lucky and 5, 17, 467 are not.One day Petya encountered a tree with n vertexes. Besides, the tree was weighted, i. e. each edge of t...
256 megabytes
import java.util.*; import java.lang.*; import java.math.*; import java.io.*; import static java.lang.Math.*; import static java.util.Arrays.*; // Lucky Tree // 2011/8/30 public class P109C{ Scanner sc=new Scanner(System.in); int n; void run(){ n=sc.nextInt(); make(n); for(int i=0; i<n-1; i++){ int u=s...
Java
["4\n1 2 4\n3 1 2\n1 4 7", "4\n1 2 4\n1 3 47\n1 4 7447"]
2 seconds
["16", "24"]
NoteThe 16 triples of vertexes from the first sample are: (1, 2, 4), (1, 4, 2), (2, 1, 3), (2, 1, 4), (2, 3, 1), (2, 3, 4), (2, 4, 1), (2, 4, 3), (3, 2, 4), (3, 4, 2), (4, 1, 2), (4, 1, 3), (4, 2, 1), (4, 2, 3), (4, 3, 1), (4, 3, 2).In the second sample all the triples should be counted: 4·3·2 = 24.
Java 6
standard input
[ "combinatorics", "dfs and similar", "trees" ]
6992db71923a01211b5073ee0f8a193a
The first line contains the single integer n (1 ≤ n ≤ 105) — the number of tree vertexes. Next n - 1 lines contain three integers each: ui vi wi (1 ≤ ui, vi ≤ n, 1 ≤ wi ≤ 109) — the pair of vertexes connected by the edge and the edge's weight.
1,900
On the single line print the single number — the answer. Please do not use the %lld specificator to read or write 64-bit numbers in С++. It is recommended to use the cin, cout streams or the %I64d specificator.
standard output
PASSED
fe157d2e3d8865790bcf9b21affbf29a
train_003.jsonl
1314633600
Petya loves lucky numbers. We all know that lucky numbers are the positive integers whose decimal representations contain only the lucky digits 4 and 7. For example, numbers 47, 744, 4 are lucky and 5, 17, 467 are not.One day Petya encountered a tree with n vertexes. Besides, the tree was weighted, i. e. each edge of t...
256 megabytes
import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; import java.util.ArrayList; import java.util.LinkedList; import java.util.Queue; import java.util.StringTokenizer; public class E { public static StringTokenizer inp; public static int n; public static long ans; ...
Java
["4\n1 2 4\n3 1 2\n1 4 7", "4\n1 2 4\n1 3 47\n1 4 7447"]
2 seconds
["16", "24"]
NoteThe 16 triples of vertexes from the first sample are: (1, 2, 4), (1, 4, 2), (2, 1, 3), (2, 1, 4), (2, 3, 1), (2, 3, 4), (2, 4, 1), (2, 4, 3), (3, 2, 4), (3, 4, 2), (4, 1, 2), (4, 1, 3), (4, 2, 1), (4, 2, 3), (4, 3, 1), (4, 3, 2).In the second sample all the triples should be counted: 4·3·2 = 24.
Java 6
standard input
[ "combinatorics", "dfs and similar", "trees" ]
6992db71923a01211b5073ee0f8a193a
The first line contains the single integer n (1 ≤ n ≤ 105) — the number of tree vertexes. Next n - 1 lines contain three integers each: ui vi wi (1 ≤ ui, vi ≤ n, 1 ≤ wi ≤ 109) — the pair of vertexes connected by the edge and the edge's weight.
1,900
On the single line print the single number — the answer. Please do not use the %lld specificator to read or write 64-bit numbers in С++. It is recommended to use the cin, cout streams or the %I64d specificator.
standard output
PASSED
d47be56e3e57cf0d6c9d7d797db3d6bd
train_003.jsonl
1314633600
Petya loves lucky numbers. We all know that lucky numbers are the positive integers whose decimal representations contain only the lucky digits 4 and 7. For example, numbers 47, 744, 4 are lucky and 5, 17, 467 are not.One day Petya encountered a tree with n vertexes. Besides, the tree was weighted, i. e. each edge of t...
256 megabytes
import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; import java.util.LinkedList; import java.util.Stack; public class E { public static boolean isLucky(int x) { while (x > 0) { if (x % 10 != 4 && x % 10 != 7) return false; x...
Java
["4\n1 2 4\n3 1 2\n1 4 7", "4\n1 2 4\n1 3 47\n1 4 7447"]
2 seconds
["16", "24"]
NoteThe 16 triples of vertexes from the first sample are: (1, 2, 4), (1, 4, 2), (2, 1, 3), (2, 1, 4), (2, 3, 1), (2, 3, 4), (2, 4, 1), (2, 4, 3), (3, 2, 4), (3, 4, 2), (4, 1, 2), (4, 1, 3), (4, 2, 1), (4, 2, 3), (4, 3, 1), (4, 3, 2).In the second sample all the triples should be counted: 4·3·2 = 24.
Java 6
standard input
[ "combinatorics", "dfs and similar", "trees" ]
6992db71923a01211b5073ee0f8a193a
The first line contains the single integer n (1 ≤ n ≤ 105) — the number of tree vertexes. Next n - 1 lines contain three integers each: ui vi wi (1 ≤ ui, vi ≤ n, 1 ≤ wi ≤ 109) — the pair of vertexes connected by the edge and the edge's weight.
1,900
On the single line print the single number — the answer. Please do not use the %lld specificator to read or write 64-bit numbers in С++. It is recommended to use the cin, cout streams or the %I64d specificator.
standard output
PASSED
b1e399719dfb4dcd6e1302176b5d4055
train_003.jsonl
1314633600
Petya loves lucky numbers. We all know that lucky numbers are the positive integers whose decimal representations contain only the lucky digits 4 and 7. For example, numbers 47, 744, 4 are lucky and 5, 17, 467 are not.One day Petya encountered a tree with n vertexes. Besides, the tree was weighted, i. e. each edge of t...
256 megabytes
//package tes7; import java.io.ByteArrayInputStream; import java.io.IOException; import java.io.InputStream; import java.io.PrintWriter; import java.util.Arrays; import java.util.InputMismatchException; public class P84E { InputStream is; PrintWriter out; String INPUT = ""; void solve() { int n = ni(); int[...
Java
["4\n1 2 4\n3 1 2\n1 4 7", "4\n1 2 4\n1 3 47\n1 4 7447"]
2 seconds
["16", "24"]
NoteThe 16 triples of vertexes from the first sample are: (1, 2, 4), (1, 4, 2), (2, 1, 3), (2, 1, 4), (2, 3, 1), (2, 3, 4), (2, 4, 1), (2, 4, 3), (3, 2, 4), (3, 4, 2), (4, 1, 2), (4, 1, 3), (4, 2, 1), (4, 2, 3), (4, 3, 1), (4, 3, 2).In the second sample all the triples should be counted: 4·3·2 = 24.
Java 6
standard input
[ "combinatorics", "dfs and similar", "trees" ]
6992db71923a01211b5073ee0f8a193a
The first line contains the single integer n (1 ≤ n ≤ 105) — the number of tree vertexes. Next n - 1 lines contain three integers each: ui vi wi (1 ≤ ui, vi ≤ n, 1 ≤ wi ≤ 109) — the pair of vertexes connected by the edge and the edge's weight.
1,900
On the single line print the single number — the answer. Please do not use the %lld specificator to read or write 64-bit numbers in С++. It is recommended to use the cin, cout streams or the %I64d specificator.
standard output
PASSED
7eb128f091d71cf59361020d6e004d67
train_003.jsonl
1314633600
Petya loves lucky numbers. We all know that lucky numbers are the positive integers whose decimal representations contain only the lucky digits 4 and 7. For example, numbers 47, 744, 4 are lucky and 5, 17, 467 are not.One day Petya encountered a tree with n vertexes. Besides, the tree was weighted, i. e. each edge of t...
256 megabytes
/** * Created by IntelliJ IDEA. * User: piyushd * Date: 3/26/11 * Time: 10:53 PM * To change this template use File | Settings | File Templates. */ public class TaskC { int[] par; int[] size; int getParent(int v) { int parent = par[v]; if(parent == v) return v; return par[v] ...
Java
["4\n1 2 4\n3 1 2\n1 4 7", "4\n1 2 4\n1 3 47\n1 4 7447"]
2 seconds
["16", "24"]
NoteThe 16 triples of vertexes from the first sample are: (1, 2, 4), (1, 4, 2), (2, 1, 3), (2, 1, 4), (2, 3, 1), (2, 3, 4), (2, 4, 1), (2, 4, 3), (3, 2, 4), (3, 4, 2), (4, 1, 2), (4, 1, 3), (4, 2, 1), (4, 2, 3), (4, 3, 1), (4, 3, 2).In the second sample all the triples should be counted: 4·3·2 = 24.
Java 6
standard input
[ "combinatorics", "dfs and similar", "trees" ]
6992db71923a01211b5073ee0f8a193a
The first line contains the single integer n (1 ≤ n ≤ 105) — the number of tree vertexes. Next n - 1 lines contain three integers each: ui vi wi (1 ≤ ui, vi ≤ n, 1 ≤ wi ≤ 109) — the pair of vertexes connected by the edge and the edge's weight.
1,900
On the single line print the single number — the answer. Please do not use the %lld specificator to read or write 64-bit numbers in С++. It is recommended to use the cin, cout streams or the %I64d specificator.
standard output
PASSED
cc24c6508ade20617903f75c15baf10e
train_003.jsonl
1401627600
Of course our child likes walking in a zoo. The zoo has n areas, that are numbered from 1 to n. The i-th area contains ai animals in it. Also there are m roads in the zoo, and each road connects two distinct areas. Naturally the zoo is connected, so you can reach any area of the zoo from any other area using the roads....
256 megabytes
import java.io.*; import java.util.*; public class B { BufferedReader br; PrintWriter out; StringTokenizer st; boolean eof; int[] p, size; int get(int x) { return p[x] == x ? x : (p[x] = get(p[x])); } Random rng = new Random(); void union(int v, int u) { if (rng.nextBoolean()) { p[v] = u; size[...
Java
["4 3\n10 20 30 40\n1 3\n2 3\n4 3", "3 3\n10 20 30\n1 2\n2 3\n3 1", "7 8\n40 20 10 30 20 50 40\n1 2\n2 3\n3 4\n4 5\n5 6\n6 7\n1 4\n5 7"]
2 seconds
["16.666667", "13.333333", "18.571429"]
NoteConsider the first sample. There are 12 possible situations: p = 1, q = 3, f(p, q) = 10. p = 2, q = 3, f(p, q) = 20. p = 4, q = 3, f(p, q) = 30. p = 1, q = 2, f(p, q) = 10. p = 2, q = 4, f(p, q) = 20. p = 4, q = 1, f(p, q) = 10. Another 6 cases are symmetrical to the above. The average is .Consider the second...
Java 8
standard input
[ "dp", "dsu", "sortings" ]
6931beaa1c40e03ee52bcb0cfb9bff51
The first line contains two integers n and m (2 ≤ n ≤ 105; 0 ≤ m ≤ 105). The second line contains n integers: a1, a2, ..., an (0 ≤ ai ≤ 105). Then follow m lines, each line contains two integers xi and yi (1 ≤ xi, yi ≤ n; xi ≠ yi), denoting the road between areas xi and yi. All roads are bidirectional, each pair of are...
1,900
Output a real number — the value of . The answer will be considered correct if its relative or absolute error doesn't exceed 10 - 4.
standard output
PASSED
e38f32ccc01c0b4daeb9a022e0f40acf
train_003.jsonl
1401627600
Of course our child likes walking in a zoo. The zoo has n areas, that are numbered from 1 to n. The i-th area contains ai animals in it. Also there are m roads in the zoo, and each road connects two distinct areas. Naturally the zoo is connected, so you can reach any area of the zoo from any other area using the roads....
256 megabytes
import java.util.Collections; import java.util.Comparator; import java.util.Scanner; import java.util.Vector; public class B { public static final boolean DEBUG = false; Scanner sc; public void debug(Object o) { if (DEBUG) { int ln = Thread.currentThread().getStackTrace()[2].getLineNumber(); S...
Java
["4 3\n10 20 30 40\n1 3\n2 3\n4 3", "3 3\n10 20 30\n1 2\n2 3\n3 1", "7 8\n40 20 10 30 20 50 40\n1 2\n2 3\n3 4\n4 5\n5 6\n6 7\n1 4\n5 7"]
2 seconds
["16.666667", "13.333333", "18.571429"]
NoteConsider the first sample. There are 12 possible situations: p = 1, q = 3, f(p, q) = 10. p = 2, q = 3, f(p, q) = 20. p = 4, q = 3, f(p, q) = 30. p = 1, q = 2, f(p, q) = 10. p = 2, q = 4, f(p, q) = 20. p = 4, q = 1, f(p, q) = 10. Another 6 cases are symmetrical to the above. The average is .Consider the second...
Java 6
standard input
[ "dp", "dsu", "sortings" ]
6931beaa1c40e03ee52bcb0cfb9bff51
The first line contains two integers n and m (2 ≤ n ≤ 105; 0 ≤ m ≤ 105). The second line contains n integers: a1, a2, ..., an (0 ≤ ai ≤ 105). Then follow m lines, each line contains two integers xi and yi (1 ≤ xi, yi ≤ n; xi ≠ yi), denoting the road between areas xi and yi. All roads are bidirectional, each pair of are...
1,900
Output a real number — the value of . The answer will be considered correct if its relative or absolute error doesn't exceed 10 - 4.
standard output
PASSED
30b9e7bc09f74387c27c6be974ba357e
train_003.jsonl
1401627600
Of course our child likes walking in a zoo. The zoo has n areas, that are numbered from 1 to n. The i-th area contains ai animals in it. Also there are m roads in the zoo, and each road connects two distinct areas. Naturally the zoo is connected, so you can reach any area of the zoo from any other area using the roads....
256 megabytes
import java.io.BufferedReader; import java.io.IOException; import java.io.InputStream; import java.io.InputStreamReader; import java.util.*; /** * Created by fangxue.zhang on 2014/6/1. */ public class CF_250_div2 { public static List<Integer> nodes = new ArrayList<Integer>(1100); public static List<Integer>...
Java
["4 3\n10 20 30 40\n1 3\n2 3\n4 3", "3 3\n10 20 30\n1 2\n2 3\n3 1", "7 8\n40 20 10 30 20 50 40\n1 2\n2 3\n3 4\n4 5\n5 6\n6 7\n1 4\n5 7"]
2 seconds
["16.666667", "13.333333", "18.571429"]
NoteConsider the first sample. There are 12 possible situations: p = 1, q = 3, f(p, q) = 10. p = 2, q = 3, f(p, q) = 20. p = 4, q = 3, f(p, q) = 30. p = 1, q = 2, f(p, q) = 10. p = 2, q = 4, f(p, q) = 20. p = 4, q = 1, f(p, q) = 10. Another 6 cases are symmetrical to the above. The average is .Consider the second...
Java 6
standard input
[ "dp", "dsu", "sortings" ]
6931beaa1c40e03ee52bcb0cfb9bff51
The first line contains two integers n and m (2 ≤ n ≤ 105; 0 ≤ m ≤ 105). The second line contains n integers: a1, a2, ..., an (0 ≤ ai ≤ 105). Then follow m lines, each line contains two integers xi and yi (1 ≤ xi, yi ≤ n; xi ≠ yi), denoting the road between areas xi and yi. All roads are bidirectional, each pair of are...
1,900
Output a real number — the value of . The answer will be considered correct if its relative or absolute error doesn't exceed 10 - 4.
standard output
PASSED
db69385cd809fd62a2ad8ef9ea0fb0e1
train_003.jsonl
1565706900
You are given $$$4n$$$ sticks, the length of the $$$i$$$-th stick is $$$a_i$$$.You have to create $$$n$$$ rectangles, each rectangle will consist of exactly $$$4$$$ sticks from the given set. The rectangle consists of four sides, opposite sides should have equal length and all angles in it should be right. Note that ea...
256 megabytes
import java.util.*; public class EqualRectangles { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int wh = sc.nextInt(); while(wh > 0) { int[] arr = new int[sc.nextInt() * 4]; int lung = arr.length; for(int i = 0; i < lung...
Java
["5\n1\n1 1 10 10\n2\n10 5 2 10 1 1 2 5\n2\n10 5 1 10 5 1 1 1\n2\n1 1 1 1 1 1 1 1\n1\n10000 10000 10000 10000"]
2 seconds
["YES\nYES\nNO\nYES\nYES"]
null
Java 8
standard input
[ "greedy", "math" ]
08783e3dff3f3b7eb586931f9d0cd457
The first line of the input contains one integer $$$q$$$ ($$$1 \le q \le 500$$$) — the number of queries. Then $$$q$$$ queries follow. The first line of the query contains one integer $$$n$$$ ($$$1 \le n \le 100$$$) — the number of rectangles. The second line of the query contains $$$4n$$$ integers $$$a_1, a_2, \dots, ...
1,200
For each query print the answer to it. If it is impossible to create exactly $$$n$$$ rectangles of equal area using given sticks, print "NO". Otherwise print "YES".
standard output
PASSED
a9a3fe0ba31e12a844d61ce6c85e75a2
train_003.jsonl
1565706900
You are given $$$4n$$$ sticks, the length of the $$$i$$$-th stick is $$$a_i$$$.You have to create $$$n$$$ rectangles, each rectangle will consist of exactly $$$4$$$ sticks from the given set. The rectangle consists of four sides, opposite sides should have equal length and all angles in it should be right. Note that ea...
256 megabytes
import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; import java.util.ArrayList; import java.util.Arrays; import java.util.Collections; public class Main { public static void main(String[] args)throws IOException { BufferedReader in = new BufferedReader(new InputStr...
Java
["5\n1\n1 1 10 10\n2\n10 5 2 10 1 1 2 5\n2\n10 5 1 10 5 1 1 1\n2\n1 1 1 1 1 1 1 1\n1\n10000 10000 10000 10000"]
2 seconds
["YES\nYES\nNO\nYES\nYES"]
null
Java 8
standard input
[ "greedy", "math" ]
08783e3dff3f3b7eb586931f9d0cd457
The first line of the input contains one integer $$$q$$$ ($$$1 \le q \le 500$$$) — the number of queries. Then $$$q$$$ queries follow. The first line of the query contains one integer $$$n$$$ ($$$1 \le n \le 100$$$) — the number of rectangles. The second line of the query contains $$$4n$$$ integers $$$a_1, a_2, \dots, ...
1,200
For each query print the answer to it. If it is impossible to create exactly $$$n$$$ rectangles of equal area using given sticks, print "NO". Otherwise print "YES".
standard output
PASSED
5fecc7294b2f7b151c2b871560f26da4
train_003.jsonl
1565706900
You are given $$$4n$$$ sticks, the length of the $$$i$$$-th stick is $$$a_i$$$.You have to create $$$n$$$ rectangles, each rectangle will consist of exactly $$$4$$$ sticks from the given set. The rectangle consists of four sides, opposite sides should have equal length and all angles in it should be right. Note that ea...
256 megabytes
import java.io.OutputStream; import java.io.IOException; import java.io.InputStream; import java.io.PrintWriter; import java.io.FilterInputStream; import java.io.BufferedInputStream; import java.io.InputStream; /** * Built using CHelper plug-in * Actual solution is at the top * * @author Jenish */ public class Ma...
Java
["5\n1\n1 1 10 10\n2\n10 5 2 10 1 1 2 5\n2\n10 5 1 10 5 1 1 1\n2\n1 1 1 1 1 1 1 1\n1\n10000 10000 10000 10000"]
2 seconds
["YES\nYES\nNO\nYES\nYES"]
null
Java 8
standard input
[ "greedy", "math" ]
08783e3dff3f3b7eb586931f9d0cd457
The first line of the input contains one integer $$$q$$$ ($$$1 \le q \le 500$$$) — the number of queries. Then $$$q$$$ queries follow. The first line of the query contains one integer $$$n$$$ ($$$1 \le n \le 100$$$) — the number of rectangles. The second line of the query contains $$$4n$$$ integers $$$a_1, a_2, \dots, ...
1,200
For each query print the answer to it. If it is impossible to create exactly $$$n$$$ rectangles of equal area using given sticks, print "NO". Otherwise print "YES".
standard output
PASSED
4614733bf17aee7450c11f2647b4cf41
train_003.jsonl
1565706900
You are given $$$4n$$$ sticks, the length of the $$$i$$$-th stick is $$$a_i$$$.You have to create $$$n$$$ rectangles, each rectangle will consist of exactly $$$4$$$ sticks from the given set. The rectangle consists of four sides, opposite sides should have equal length and all angles in it should be right. Note that ea...
256 megabytes
import java.util.*; import java.math.*; import java.io.*; public class Exam { public static long mod = (long) Math.pow(10, 9)+7 ; public static InputReader sc = new InputReader(System.in); public static PrintWriter pw = new PrintWriter(System.out); public static int check(String or,String s[]){ for(int i=0;i<s.l...
Java
["5\n1\n1 1 10 10\n2\n10 5 2 10 1 1 2 5\n2\n10 5 1 10 5 1 1 1\n2\n1 1 1 1 1 1 1 1\n1\n10000 10000 10000 10000"]
2 seconds
["YES\nYES\nNO\nYES\nYES"]
null
Java 8
standard input
[ "greedy", "math" ]
08783e3dff3f3b7eb586931f9d0cd457
The first line of the input contains one integer $$$q$$$ ($$$1 \le q \le 500$$$) — the number of queries. Then $$$q$$$ queries follow. The first line of the query contains one integer $$$n$$$ ($$$1 \le n \le 100$$$) — the number of rectangles. The second line of the query contains $$$4n$$$ integers $$$a_1, a_2, \dots, ...
1,200
For each query print the answer to it. If it is impossible to create exactly $$$n$$$ rectangles of equal area using given sticks, print "NO". Otherwise print "YES".
standard output
PASSED
7aed2e308c516f3bf4397ec7595b226d
train_003.jsonl
1565706900
You are given $$$4n$$$ sticks, the length of the $$$i$$$-th stick is $$$a_i$$$.You have to create $$$n$$$ rectangles, each rectangle will consist of exactly $$$4$$$ sticks from the given set. The rectangle consists of four sides, opposite sides should have equal length and all angles in it should be right. Note that ea...
256 megabytes
import java.io.*; import java.util.Arrays; public class Main { public static void main(String[] args) throws IOException { Reader reader = new Reader(); int q = reader.nextInt(); loop: while(q-- > 0){ int n = reader.nextInt(); int[] a = new int[4 * n]; ...
Java
["5\n1\n1 1 10 10\n2\n10 5 2 10 1 1 2 5\n2\n10 5 1 10 5 1 1 1\n2\n1 1 1 1 1 1 1 1\n1\n10000 10000 10000 10000"]
2 seconds
["YES\nYES\nNO\nYES\nYES"]
null
Java 8
standard input
[ "greedy", "math" ]
08783e3dff3f3b7eb586931f9d0cd457
The first line of the input contains one integer $$$q$$$ ($$$1 \le q \le 500$$$) — the number of queries. Then $$$q$$$ queries follow. The first line of the query contains one integer $$$n$$$ ($$$1 \le n \le 100$$$) — the number of rectangles. The second line of the query contains $$$4n$$$ integers $$$a_1, a_2, \dots, ...
1,200
For each query print the answer to it. If it is impossible to create exactly $$$n$$$ rectangles of equal area using given sticks, print "NO". Otherwise print "YES".
standard output
PASSED
3b1b9a15b8dd8cdf955ba34ffa89b5d4
train_003.jsonl
1565706900
You are given $$$4n$$$ sticks, the length of the $$$i$$$-th stick is $$$a_i$$$.You have to create $$$n$$$ rectangles, each rectangle will consist of exactly $$$4$$$ sticks from the given set. The rectangle consists of four sides, opposite sides should have equal length and all angles in it should be right. Note that ea...
256 megabytes
import java.io.*; import java.util.ArrayList; import java.util.Collections; import java.util.List; public class Main { public static final int MAX = 10000 + 5; public static void main(String[] args) throws IOException { Reader reader = new Reader(); int q = reader.nextInt(); loop:...
Java
["5\n1\n1 1 10 10\n2\n10 5 2 10 1 1 2 5\n2\n10 5 1 10 5 1 1 1\n2\n1 1 1 1 1 1 1 1\n1\n10000 10000 10000 10000"]
2 seconds
["YES\nYES\nNO\nYES\nYES"]
null
Java 8
standard input
[ "greedy", "math" ]
08783e3dff3f3b7eb586931f9d0cd457
The first line of the input contains one integer $$$q$$$ ($$$1 \le q \le 500$$$) — the number of queries. Then $$$q$$$ queries follow. The first line of the query contains one integer $$$n$$$ ($$$1 \le n \le 100$$$) — the number of rectangles. The second line of the query contains $$$4n$$$ integers $$$a_1, a_2, \dots, ...
1,200
For each query print the answer to it. If it is impossible to create exactly $$$n$$$ rectangles of equal area using given sticks, print "NO". Otherwise print "YES".
standard output
PASSED
86b0e8f8fd33b55d2d42619b83498679
train_003.jsonl
1565706900
You are given $$$4n$$$ sticks, the length of the $$$i$$$-th stick is $$$a_i$$$.You have to create $$$n$$$ rectangles, each rectangle will consist of exactly $$$4$$$ sticks from the given set. The rectangle consists of four sides, opposite sides should have equal length and all angles in it should be right. Note that ea...
256 megabytes
import java.util.*; public class EqualRectagles { public static void main(String[] args) { Scanner sc=new Scanner(System.in); int t=sc.nextInt(); while (t>0){ t--; int n=sc.nextInt(); int arr[]=new int[4*n]; Map<Integer,Integer> map=n...
Java
["5\n1\n1 1 10 10\n2\n10 5 2 10 1 1 2 5\n2\n10 5 1 10 5 1 1 1\n2\n1 1 1 1 1 1 1 1\n1\n10000 10000 10000 10000"]
2 seconds
["YES\nYES\nNO\nYES\nYES"]
null
Java 8
standard input
[ "greedy", "math" ]
08783e3dff3f3b7eb586931f9d0cd457
The first line of the input contains one integer $$$q$$$ ($$$1 \le q \le 500$$$) — the number of queries. Then $$$q$$$ queries follow. The first line of the query contains one integer $$$n$$$ ($$$1 \le n \le 100$$$) — the number of rectangles. The second line of the query contains $$$4n$$$ integers $$$a_1, a_2, \dots, ...
1,200
For each query print the answer to it. If it is impossible to create exactly $$$n$$$ rectangles of equal area using given sticks, print "NO". Otherwise print "YES".
standard output
PASSED
788f85c00ddce2f85c3dbc3a2639a5ed
train_003.jsonl
1565706900
You are given $$$4n$$$ sticks, the length of the $$$i$$$-th stick is $$$a_i$$$.You have to create $$$n$$$ rectangles, each rectangle will consist of exactly $$$4$$$ sticks from the given set. The rectangle consists of four sides, opposite sides should have equal length and all angles in it should be right. Note that ea...
256 megabytes
import java.io.*; import java.math.*; import java.util.*; public class icpc { public static void main(String[] args) throws IOException { Reader in = new Reader(); // BufferedReader in = new BufferedReader(new InputStreamReader(System.in)); int q = in.nextInt(); for (int i=0;i<q;...
Java
["5\n1\n1 1 10 10\n2\n10 5 2 10 1 1 2 5\n2\n10 5 1 10 5 1 1 1\n2\n1 1 1 1 1 1 1 1\n1\n10000 10000 10000 10000"]
2 seconds
["YES\nYES\nNO\nYES\nYES"]
null
Java 8
standard input
[ "greedy", "math" ]
08783e3dff3f3b7eb586931f9d0cd457
The first line of the input contains one integer $$$q$$$ ($$$1 \le q \le 500$$$) — the number of queries. Then $$$q$$$ queries follow. The first line of the query contains one integer $$$n$$$ ($$$1 \le n \le 100$$$) — the number of rectangles. The second line of the query contains $$$4n$$$ integers $$$a_1, a_2, \dots, ...
1,200
For each query print the answer to it. If it is impossible to create exactly $$$n$$$ rectangles of equal area using given sticks, print "NO". Otherwise print "YES".
standard output
PASSED
a4f04f239d8798fa669b963ab7d82fff
train_003.jsonl
1565706900
You are given $$$4n$$$ sticks, the length of the $$$i$$$-th stick is $$$a_i$$$.You have to create $$$n$$$ rectangles, each rectangle will consist of exactly $$$4$$$ sticks from the given set. The rectangle consists of four sides, opposite sides should have equal length and all angles in it should be right. Note that ea...
256 megabytes
import java.util.*; import java.lang.*; import java.io.*; public class Codechef{ PrintWriter out; StringTokenizer st; BufferedReader br; class Pair { int f; int s; public Pair(int t, int r) { f = t; s = r; } } String ns() { while (st == null || !st....
Java
["5\n1\n1 1 10 10\n2\n10 5 2 10 1 1 2 5\n2\n10 5 1 10 5 1 1 1\n2\n1 1 1 1 1 1 1 1\n1\n10000 10000 10000 10000"]
2 seconds
["YES\nYES\nNO\nYES\nYES"]
null
Java 8
standard input
[ "greedy", "math" ]
08783e3dff3f3b7eb586931f9d0cd457
The first line of the input contains one integer $$$q$$$ ($$$1 \le q \le 500$$$) — the number of queries. Then $$$q$$$ queries follow. The first line of the query contains one integer $$$n$$$ ($$$1 \le n \le 100$$$) — the number of rectangles. The second line of the query contains $$$4n$$$ integers $$$a_1, a_2, \dots, ...
1,200
For each query print the answer to it. If it is impossible to create exactly $$$n$$$ rectangles of equal area using given sticks, print "NO". Otherwise print "YES".
standard output
PASSED
e44829bcc81720c69de89a69301b91c1
train_003.jsonl
1565706900
You are given $$$4n$$$ sticks, the length of the $$$i$$$-th stick is $$$a_i$$$.You have to create $$$n$$$ rectangles, each rectangle will consist of exactly $$$4$$$ sticks from the given set. The rectangle consists of four sides, opposite sides should have equal length and all angles in it should be right. Note that ea...
256 megabytes
import java.io.PrintWriter; import java.math.BigInteger; import java.util.Arrays; import java.util.Scanner; public class scratch_10 { public static void main(String[] args) { Scanner sc = new Scanner(System.in); PrintWriter pw = new PrintWriter(System.out); int T = sc.nextInt(); ...
Java
["5\n1\n1 1 10 10\n2\n10 5 2 10 1 1 2 5\n2\n10 5 1 10 5 1 1 1\n2\n1 1 1 1 1 1 1 1\n1\n10000 10000 10000 10000"]
2 seconds
["YES\nYES\nNO\nYES\nYES"]
null
Java 8
standard input
[ "greedy", "math" ]
08783e3dff3f3b7eb586931f9d0cd457
The first line of the input contains one integer $$$q$$$ ($$$1 \le q \le 500$$$) — the number of queries. Then $$$q$$$ queries follow. The first line of the query contains one integer $$$n$$$ ($$$1 \le n \le 100$$$) — the number of rectangles. The second line of the query contains $$$4n$$$ integers $$$a_1, a_2, \dots, ...
1,200
For each query print the answer to it. If it is impossible to create exactly $$$n$$$ rectangles of equal area using given sticks, print "NO". Otherwise print "YES".
standard output
PASSED
3abe5228904657b365ff91d645fa508f
train_003.jsonl
1565706900
You are given $$$4n$$$ sticks, the length of the $$$i$$$-th stick is $$$a_i$$$.You have to create $$$n$$$ rectangles, each rectangle will consist of exactly $$$4$$$ sticks from the given set. The rectangle consists of four sides, opposite sides should have equal length and all angles in it should be right. Note that ea...
256 megabytes
import java.math.*; import java.text.*; import java.util.*; import javafx.util.*; public class CompleteSearch { public static Scanner in =new Scanner(System.in); public static void main(String[] args){ int q=in.nextInt(); for(int t=0;t<q;t++){ int n=in.nextInt(); i...
Java
["5\n1\n1 1 10 10\n2\n10 5 2 10 1 1 2 5\n2\n10 5 1 10 5 1 1 1\n2\n1 1 1 1 1 1 1 1\n1\n10000 10000 10000 10000"]
2 seconds
["YES\nYES\nNO\nYES\nYES"]
null
Java 8
standard input
[ "greedy", "math" ]
08783e3dff3f3b7eb586931f9d0cd457
The first line of the input contains one integer $$$q$$$ ($$$1 \le q \le 500$$$) — the number of queries. Then $$$q$$$ queries follow. The first line of the query contains one integer $$$n$$$ ($$$1 \le n \le 100$$$) — the number of rectangles. The second line of the query contains $$$4n$$$ integers $$$a_1, a_2, \dots, ...
1,200
For each query print the answer to it. If it is impossible to create exactly $$$n$$$ rectangles of equal area using given sticks, print "NO". Otherwise print "YES".
standard output
PASSED
e22a1ec58e7550b65baa6e0ed7915a1d
train_003.jsonl
1565706900
You are given $$$4n$$$ sticks, the length of the $$$i$$$-th stick is $$$a_i$$$.You have to create $$$n$$$ rectangles, each rectangle will consist of exactly $$$4$$$ sticks from the given set. The rectangle consists of four sides, opposite sides should have equal length and all angles in it should be right. Note that ea...
256 megabytes
import java.io.*; import java.math.*; import java.security.*; import java.text.*; import java.util.*; import java.util.concurrent.*; import java.util.regex.*; public class Solution { public static String Array(int[] Arr) { int n=Arr[0]; for(int i=1;i<...
Java
["5\n1\n1 1 10 10\n2\n10 5 2 10 1 1 2 5\n2\n10 5 1 10 5 1 1 1\n2\n1 1 1 1 1 1 1 1\n1\n10000 10000 10000 10000"]
2 seconds
["YES\nYES\nNO\nYES\nYES"]
null
Java 8
standard input
[ "greedy", "math" ]
08783e3dff3f3b7eb586931f9d0cd457
The first line of the input contains one integer $$$q$$$ ($$$1 \le q \le 500$$$) — the number of queries. Then $$$q$$$ queries follow. The first line of the query contains one integer $$$n$$$ ($$$1 \le n \le 100$$$) — the number of rectangles. The second line of the query contains $$$4n$$$ integers $$$a_1, a_2, \dots, ...
1,200
For each query print the answer to it. If it is impossible to create exactly $$$n$$$ rectangles of equal area using given sticks, print "NO". Otherwise print "YES".
standard output
PASSED
67c0beec88f548ade958aab032779f52
train_003.jsonl
1565706900
You are given $$$4n$$$ sticks, the length of the $$$i$$$-th stick is $$$a_i$$$.You have to create $$$n$$$ rectangles, each rectangle will consist of exactly $$$4$$$ sticks from the given set. The rectangle consists of four sides, opposite sides should have equal length and all angles in it should be right. Note that ea...
256 megabytes
import java.util.*; public class Main { static int mod=1000000007; public static void main(String[] args) { Scanner sc=new Scanner(System.in); StringBuilder st=new StringBuilder(); int t=sc.nextInt(); while(t-->0) { int n=sc.nextInt(); int a[]=new int [4*n]; for(int...
Java
["5\n1\n1 1 10 10\n2\n10 5 2 10 1 1 2 5\n2\n10 5 1 10 5 1 1 1\n2\n1 1 1 1 1 1 1 1\n1\n10000 10000 10000 10000"]
2 seconds
["YES\nYES\nNO\nYES\nYES"]
null
Java 8
standard input
[ "greedy", "math" ]
08783e3dff3f3b7eb586931f9d0cd457
The first line of the input contains one integer $$$q$$$ ($$$1 \le q \le 500$$$) — the number of queries. Then $$$q$$$ queries follow. The first line of the query contains one integer $$$n$$$ ($$$1 \le n \le 100$$$) — the number of rectangles. The second line of the query contains $$$4n$$$ integers $$$a_1, a_2, \dots, ...
1,200
For each query print the answer to it. If it is impossible to create exactly $$$n$$$ rectangles of equal area using given sticks, print "NO". Otherwise print "YES".
standard output
PASSED
8a274142bdeb54a12629cbfc932b3ba0
train_003.jsonl
1565706900
You are given $$$4n$$$ sticks, the length of the $$$i$$$-th stick is $$$a_i$$$.You have to create $$$n$$$ rectangles, each rectangle will consist of exactly $$$4$$$ sticks from the given set. The rectangle consists of four sides, opposite sides should have equal length and all angles in it should be right. Note that ea...
256 megabytes
import java.io.*; import java.util.*; public class Hey2018 { public static void main(String[] args) throws IOException { BufferedReader jk = new BufferedReader(new InputStreamReader(System.in)) ; PrintWriter out = new PrintWriter(new OutputStreamWriter(System.out)) ; StringTokenizer ana = new StringTokenizer...
Java
["5\n1\n1 1 10 10\n2\n10 5 2 10 1 1 2 5\n2\n10 5 1 10 5 1 1 1\n2\n1 1 1 1 1 1 1 1\n1\n10000 10000 10000 10000"]
2 seconds
["YES\nYES\nNO\nYES\nYES"]
null
Java 8
standard input
[ "greedy", "math" ]
08783e3dff3f3b7eb586931f9d0cd457
The first line of the input contains one integer $$$q$$$ ($$$1 \le q \le 500$$$) — the number of queries. Then $$$q$$$ queries follow. The first line of the query contains one integer $$$n$$$ ($$$1 \le n \le 100$$$) — the number of rectangles. The second line of the query contains $$$4n$$$ integers $$$a_1, a_2, \dots, ...
1,200
For each query print the answer to it. If it is impossible to create exactly $$$n$$$ rectangles of equal area using given sticks, print "NO". Otherwise print "YES".
standard output
PASSED
9ed78e197cddf7e0ecd9a2b5c96c3f9a
train_003.jsonl
1565706900
You are given $$$4n$$$ sticks, the length of the $$$i$$$-th stick is $$$a_i$$$.You have to create $$$n$$$ rectangles, each rectangle will consist of exactly $$$4$$$ sticks from the given set. The rectangle consists of four sides, opposite sides should have equal length and all angles in it should be right. Note that ea...
256 megabytes
import java.util.*; import java.io.*; //267630EY public class Main1203BA2 { static PrintWriter out=new PrintWriter(System.out); public static void main(String[] args) throws IOException { Scanner sc=new Scanner(System.in); int q=sc.nextInt(); while(q-->0) { int n=sc.nextInt(); ...
Java
["5\n1\n1 1 10 10\n2\n10 5 2 10 1 1 2 5\n2\n10 5 1 10 5 1 1 1\n2\n1 1 1 1 1 1 1 1\n1\n10000 10000 10000 10000"]
2 seconds
["YES\nYES\nNO\nYES\nYES"]
null
Java 8
standard input
[ "greedy", "math" ]
08783e3dff3f3b7eb586931f9d0cd457
The first line of the input contains one integer $$$q$$$ ($$$1 \le q \le 500$$$) — the number of queries. Then $$$q$$$ queries follow. The first line of the query contains one integer $$$n$$$ ($$$1 \le n \le 100$$$) — the number of rectangles. The second line of the query contains $$$4n$$$ integers $$$a_1, a_2, \dots, ...
1,200
For each query print the answer to it. If it is impossible to create exactly $$$n$$$ rectangles of equal area using given sticks, print "NO". Otherwise print "YES".
standard output
PASSED
7004a359910312ac5ff812b881b8587b
train_003.jsonl
1565706900
You are given $$$4n$$$ sticks, the length of the $$$i$$$-th stick is $$$a_i$$$.You have to create $$$n$$$ rectangles, each rectangle will consist of exactly $$$4$$$ sticks from the given set. The rectangle consists of four sides, opposite sides should have equal length and all angles in it should be right. Note that ea...
256 megabytes
import java.util.*; import java.io.*; //267630EY public class Main1203B { static PrintWriter out=new PrintWriter(System.out); public static void main(String[] args) throws IOException { Scanner sc=new Scanner(System.in); int q=sc.nextInt(); while(q-->0) { int n=sc.nextInt(); int[...
Java
["5\n1\n1 1 10 10\n2\n10 5 2 10 1 1 2 5\n2\n10 5 1 10 5 1 1 1\n2\n1 1 1 1 1 1 1 1\n1\n10000 10000 10000 10000"]
2 seconds
["YES\nYES\nNO\nYES\nYES"]
null
Java 8
standard input
[ "greedy", "math" ]
08783e3dff3f3b7eb586931f9d0cd457
The first line of the input contains one integer $$$q$$$ ($$$1 \le q \le 500$$$) — the number of queries. Then $$$q$$$ queries follow. The first line of the query contains one integer $$$n$$$ ($$$1 \le n \le 100$$$) — the number of rectangles. The second line of the query contains $$$4n$$$ integers $$$a_1, a_2, \dots, ...
1,200
For each query print the answer to it. If it is impossible to create exactly $$$n$$$ rectangles of equal area using given sticks, print "NO". Otherwise print "YES".
standard output
PASSED
c695afed653573a21653a3762af04535
train_003.jsonl
1565706900
You are given $$$4n$$$ sticks, the length of the $$$i$$$-th stick is $$$a_i$$$.You have to create $$$n$$$ rectangles, each rectangle will consist of exactly $$$4$$$ sticks from the given set. The rectangle consists of four sides, opposite sides should have equal length and all angles in it should be right. Note that ea...
256 megabytes
import java.io.BufferedReader; import java.io.InputStream; import java.io.InputStreamReader; import java.util.*; public class div3B { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int q = sc.nextInt(); while(q-->0){ boolean ans = true; int ...
Java
["5\n1\n1 1 10 10\n2\n10 5 2 10 1 1 2 5\n2\n10 5 1 10 5 1 1 1\n2\n1 1 1 1 1 1 1 1\n1\n10000 10000 10000 10000"]
2 seconds
["YES\nYES\nNO\nYES\nYES"]
null
Java 8
standard input
[ "greedy", "math" ]
08783e3dff3f3b7eb586931f9d0cd457
The first line of the input contains one integer $$$q$$$ ($$$1 \le q \le 500$$$) — the number of queries. Then $$$q$$$ queries follow. The first line of the query contains one integer $$$n$$$ ($$$1 \le n \le 100$$$) — the number of rectangles. The second line of the query contains $$$4n$$$ integers $$$a_1, a_2, \dots, ...
1,200
For each query print the answer to it. If it is impossible to create exactly $$$n$$$ rectangles of equal area using given sticks, print "NO". Otherwise print "YES".
standard output
PASSED
1ba37923793159c1af456397451bf31e
train_003.jsonl
1565706900
You are given $$$4n$$$ sticks, the length of the $$$i$$$-th stick is $$$a_i$$$.You have to create $$$n$$$ rectangles, each rectangle will consist of exactly $$$4$$$ sticks from the given set. The rectangle consists of four sides, opposite sides should have equal length and all angles in it should be right. Note that ea...
256 megabytes
/*Author: Satyajeet Singh, Delhi Technological University*/ import java.io.*; import java.util.*; import java.text.*; import java.lang.*; import java.math.*; public class Main{ /*********************************************Constants******************************************/ static PrintWrite...
Java
["5\n1\n1 1 10 10\n2\n10 5 2 10 1 1 2 5\n2\n10 5 1 10 5 1 1 1\n2\n1 1 1 1 1 1 1 1\n1\n10000 10000 10000 10000"]
2 seconds
["YES\nYES\nNO\nYES\nYES"]
null
Java 8
standard input
[ "greedy", "math" ]
08783e3dff3f3b7eb586931f9d0cd457
The first line of the input contains one integer $$$q$$$ ($$$1 \le q \le 500$$$) — the number of queries. Then $$$q$$$ queries follow. The first line of the query contains one integer $$$n$$$ ($$$1 \le n \le 100$$$) — the number of rectangles. The second line of the query contains $$$4n$$$ integers $$$a_1, a_2, \dots, ...
1,200
For each query print the answer to it. If it is impossible to create exactly $$$n$$$ rectangles of equal area using given sticks, print "NO". Otherwise print "YES".
standard output
PASSED
3a671f50b1b098296d19d65b5a8c2c74
train_003.jsonl
1565706900
You are given $$$4n$$$ sticks, the length of the $$$i$$$-th stick is $$$a_i$$$.You have to create $$$n$$$ rectangles, each rectangle will consist of exactly $$$4$$$ sticks from the given set. The rectangle consists of four sides, opposite sides should have equal length and all angles in it should be right. Note that ea...
256 megabytes
import java.io.OutputStream; import java.io.IOException; import java.io.InputStream; import java.io.PrintWriter; import java.util.List; import java.util.Scanner; import java.util.ArrayList; /** * Built using CHelper plug-in * Actual solution is at the top */ public class Main { public static void main(String[] ...
Java
["5\n1\n1 1 10 10\n2\n10 5 2 10 1 1 2 5\n2\n10 5 1 10 5 1 1 1\n2\n1 1 1 1 1 1 1 1\n1\n10000 10000 10000 10000"]
2 seconds
["YES\nYES\nNO\nYES\nYES"]
null
Java 8
standard input
[ "greedy", "math" ]
08783e3dff3f3b7eb586931f9d0cd457
The first line of the input contains one integer $$$q$$$ ($$$1 \le q \le 500$$$) — the number of queries. Then $$$q$$$ queries follow. The first line of the query contains one integer $$$n$$$ ($$$1 \le n \le 100$$$) — the number of rectangles. The second line of the query contains $$$4n$$$ integers $$$a_1, a_2, \dots, ...
1,200
For each query print the answer to it. If it is impossible to create exactly $$$n$$$ rectangles of equal area using given sticks, print "NO". Otherwise print "YES".
standard output
PASSED
fcf5cd1891574f6c9ef4eab58d70cbc0
train_003.jsonl
1565706900
You are given $$$4n$$$ sticks, the length of the $$$i$$$-th stick is $$$a_i$$$.You have to create $$$n$$$ rectangles, each rectangle will consist of exactly $$$4$$$ sticks from the given set. The rectangle consists of four sides, opposite sides should have equal length and all angles in it should be right. Note that ea...
256 megabytes
import java.io.*; import java.util.*; public class Main { static Scanner sc = new Scanner(System.in); static PrintWriter out = new PrintWriter(System.out); static void solve() throws Exception{ int n = sc.nextInt(); HashMap<Integer,Integer> mp = new HashMap<>(); for(int i = 0; i < n * 4; i++) { int k = s...
Java
["5\n1\n1 1 10 10\n2\n10 5 2 10 1 1 2 5\n2\n10 5 1 10 5 1 1 1\n2\n1 1 1 1 1 1 1 1\n1\n10000 10000 10000 10000"]
2 seconds
["YES\nYES\nNO\nYES\nYES"]
null
Java 8
standard input
[ "greedy", "math" ]
08783e3dff3f3b7eb586931f9d0cd457
The first line of the input contains one integer $$$q$$$ ($$$1 \le q \le 500$$$) — the number of queries. Then $$$q$$$ queries follow. The first line of the query contains one integer $$$n$$$ ($$$1 \le n \le 100$$$) — the number of rectangles. The second line of the query contains $$$4n$$$ integers $$$a_1, a_2, \dots, ...
1,200
For each query print the answer to it. If it is impossible to create exactly $$$n$$$ rectangles of equal area using given sticks, print "NO". Otherwise print "YES".
standard output
PASSED
85494bee084894b10d04469cac927414
train_003.jsonl
1565706900
You are given $$$4n$$$ sticks, the length of the $$$i$$$-th stick is $$$a_i$$$.You have to create $$$n$$$ rectangles, each rectangle will consist of exactly $$$4$$$ sticks from the given set. The rectangle consists of four sides, opposite sides should have equal length and all angles in it should be right. Note that ea...
256 megabytes
import java.util.*; import java.io.*; public class B { public static void main(String[] args) throws NumberFormatException, IOException { BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); int q = Integer.parseInt(br.readLine()); loop : for(int d=0;d<q;d++) { int n = Integer.parseIn...
Java
["5\n1\n1 1 10 10\n2\n10 5 2 10 1 1 2 5\n2\n10 5 1 10 5 1 1 1\n2\n1 1 1 1 1 1 1 1\n1\n10000 10000 10000 10000"]
2 seconds
["YES\nYES\nNO\nYES\nYES"]
null
Java 8
standard input
[ "greedy", "math" ]
08783e3dff3f3b7eb586931f9d0cd457
The first line of the input contains one integer $$$q$$$ ($$$1 \le q \le 500$$$) — the number of queries. Then $$$q$$$ queries follow. The first line of the query contains one integer $$$n$$$ ($$$1 \le n \le 100$$$) — the number of rectangles. The second line of the query contains $$$4n$$$ integers $$$a_1, a_2, \dots, ...
1,200
For each query print the answer to it. If it is impossible to create exactly $$$n$$$ rectangles of equal area using given sticks, print "NO". Otherwise print "YES".
standard output
PASSED
4c28943229ad746103b9bfed8136de8d
train_003.jsonl
1565706900
You are given $$$4n$$$ sticks, the length of the $$$i$$$-th stick is $$$a_i$$$.You have to create $$$n$$$ rectangles, each rectangle will consist of exactly $$$4$$$ sticks from the given set. The rectangle consists of four sides, opposite sides should have equal length and all angles in it should be right. Note that ea...
256 megabytes
/* If you want to aim high, aim high Don't let that studying and grades consume you Just live life young ****************************** If I'm the sun, you're the moon Because when I go up, you go down ******************************* I'm working for the day I will surpass you https://www.a2oj.com/Ladder16.html */ impor...
Java
["5\n1\n1 1 10 10\n2\n10 5 2 10 1 1 2 5\n2\n10 5 1 10 5 1 1 1\n2\n1 1 1 1 1 1 1 1\n1\n10000 10000 10000 10000"]
2 seconds
["YES\nYES\nNO\nYES\nYES"]
null
Java 8
standard input
[ "greedy", "math" ]
08783e3dff3f3b7eb586931f9d0cd457
The first line of the input contains one integer $$$q$$$ ($$$1 \le q \le 500$$$) — the number of queries. Then $$$q$$$ queries follow. The first line of the query contains one integer $$$n$$$ ($$$1 \le n \le 100$$$) — the number of rectangles. The second line of the query contains $$$4n$$$ integers $$$a_1, a_2, \dots, ...
1,200
For each query print the answer to it. If it is impossible to create exactly $$$n$$$ rectangles of equal area using given sticks, print "NO". Otherwise print "YES".
standard output
PASSED
dc8fd7fdd377b9746c5a6995a3d30930
train_003.jsonl
1565706900
You are given $$$4n$$$ sticks, the length of the $$$i$$$-th stick is $$$a_i$$$.You have to create $$$n$$$ rectangles, each rectangle will consist of exactly $$$4$$$ sticks from the given set. The rectangle consists of four sides, opposite sides should have equal length and all angles in it should be right. Note that ea...
256 megabytes
import java.util.*; import java.io.*; import java.math.BigInteger; public class Solution{ public static void main(String[] args) throws Exception{ FastReader ip=new FastReader(); int q=ip.nextInt(); while(q-->0) { int n=ip.nextInt(); int arr[]=new int[4*n]; for(int i=0;i<4*n;i++) { arr[i]=ip...
Java
["5\n1\n1 1 10 10\n2\n10 5 2 10 1 1 2 5\n2\n10 5 1 10 5 1 1 1\n2\n1 1 1 1 1 1 1 1\n1\n10000 10000 10000 10000"]
2 seconds
["YES\nYES\nNO\nYES\nYES"]
null
Java 8
standard input
[ "greedy", "math" ]
08783e3dff3f3b7eb586931f9d0cd457
The first line of the input contains one integer $$$q$$$ ($$$1 \le q \le 500$$$) — the number of queries. Then $$$q$$$ queries follow. The first line of the query contains one integer $$$n$$$ ($$$1 \le n \le 100$$$) — the number of rectangles. The second line of the query contains $$$4n$$$ integers $$$a_1, a_2, \dots, ...
1,200
For each query print the answer to it. If it is impossible to create exactly $$$n$$$ rectangles of equal area using given sticks, print "NO". Otherwise print "YES".
standard output
PASSED
3788e349b62fbcfdc280228bb7d792e8
train_003.jsonl
1565706900
You are given $$$4n$$$ sticks, the length of the $$$i$$$-th stick is $$$a_i$$$.You have to create $$$n$$$ rectangles, each rectangle will consist of exactly $$$4$$$ sticks from the given set. The rectangle consists of four sides, opposite sides should have equal length and all angles in it should be right. Note that ea...
256 megabytes
import java.util.*; public class Main1 { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int t = sc.nextInt(); while (t-- > 0) { int n = sc.nextInt(); int[] arr = new int[4*n]; for (int i = 0; i < 4*n; i++) ...
Java
["5\n1\n1 1 10 10\n2\n10 5 2 10 1 1 2 5\n2\n10 5 1 10 5 1 1 1\n2\n1 1 1 1 1 1 1 1\n1\n10000 10000 10000 10000"]
2 seconds
["YES\nYES\nNO\nYES\nYES"]
null
Java 8
standard input
[ "greedy", "math" ]
08783e3dff3f3b7eb586931f9d0cd457
The first line of the input contains one integer $$$q$$$ ($$$1 \le q \le 500$$$) — the number of queries. Then $$$q$$$ queries follow. The first line of the query contains one integer $$$n$$$ ($$$1 \le n \le 100$$$) — the number of rectangles. The second line of the query contains $$$4n$$$ integers $$$a_1, a_2, \dots, ...
1,200
For each query print the answer to it. If it is impossible to create exactly $$$n$$$ rectangles of equal area using given sticks, print "NO". Otherwise print "YES".
standard output
PASSED
be3c0032cb92ebd5dded64c5138ec4b4
train_003.jsonl
1565706900
You are given $$$4n$$$ sticks, the length of the $$$i$$$-th stick is $$$a_i$$$.You have to create $$$n$$$ rectangles, each rectangle will consist of exactly $$$4$$$ sticks from the given set. The rectangle consists of four sides, opposite sides should have equal length and all angles in it should be right. Note that ea...
256 megabytes
import java.io.IOException; import java.io.InputStream; import java.io.InputStreamReader; import java.io.PrintWriter; import java.util.*; import java.io.BufferedReader; public class Main{ public static void main(String[] args) throws IOException { Scanner sc = new Scanner(System.in); PrintWrit...
Java
["5\n1\n1 1 10 10\n2\n10 5 2 10 1 1 2 5\n2\n10 5 1 10 5 1 1 1\n2\n1 1 1 1 1 1 1 1\n1\n10000 10000 10000 10000"]
2 seconds
["YES\nYES\nNO\nYES\nYES"]
null
Java 8
standard input
[ "greedy", "math" ]
08783e3dff3f3b7eb586931f9d0cd457
The first line of the input contains one integer $$$q$$$ ($$$1 \le q \le 500$$$) — the number of queries. Then $$$q$$$ queries follow. The first line of the query contains one integer $$$n$$$ ($$$1 \le n \le 100$$$) — the number of rectangles. The second line of the query contains $$$4n$$$ integers $$$a_1, a_2, \dots, ...
1,200
For each query print the answer to it. If it is impossible to create exactly $$$n$$$ rectangles of equal area using given sticks, print "NO". Otherwise print "YES".
standard output
PASSED
18218a9330965168876ec5220adf9c79
train_003.jsonl
1565706900
You are given $$$4n$$$ sticks, the length of the $$$i$$$-th stick is $$$a_i$$$.You have to create $$$n$$$ rectangles, each rectangle will consist of exactly $$$4$$$ sticks from the given set. The rectangle consists of four sides, opposite sides should have equal length and all angles in it should be right. Note that ea...
256 megabytes
import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; import java.io.StreamTokenizer; import java.util.Arrays; public class Main { static StreamTokenizer st=new StreamTokenizer(new BufferedReader(new InputStreamReader(System.in))); public static void main(String[] args) { i...
Java
["5\n1\n1 1 10 10\n2\n10 5 2 10 1 1 2 5\n2\n10 5 1 10 5 1 1 1\n2\n1 1 1 1 1 1 1 1\n1\n10000 10000 10000 10000"]
2 seconds
["YES\nYES\nNO\nYES\nYES"]
null
Java 8
standard input
[ "greedy", "math" ]
08783e3dff3f3b7eb586931f9d0cd457
The first line of the input contains one integer $$$q$$$ ($$$1 \le q \le 500$$$) — the number of queries. Then $$$q$$$ queries follow. The first line of the query contains one integer $$$n$$$ ($$$1 \le n \le 100$$$) — the number of rectangles. The second line of the query contains $$$4n$$$ integers $$$a_1, a_2, \dots, ...
1,200
For each query print the answer to it. If it is impossible to create exactly $$$n$$$ rectangles of equal area using given sticks, print "NO". Otherwise print "YES".
standard output
PASSED
238afb4b218d687970e78d0a89a4086f
train_003.jsonl
1565706900
You are given $$$4n$$$ sticks, the length of the $$$i$$$-th stick is $$$a_i$$$.You have to create $$$n$$$ rectangles, each rectangle will consist of exactly $$$4$$$ sticks from the given set. The rectangle consists of four sides, opposite sides should have equal length and all angles in it should be right. Note that ea...
256 megabytes
import java.util.*; public class Main { static Scanner scn = new Scanner(System.in); public static void main(String[] args) { Scanner scn = new Scanner(System.in); int t = scn.nextInt(); while (t != 0) { int n = scn.nextInt(); int a=0,b=4*n-1; int[]arr=new int[4*n]; for(int i=0;i<4*...
Java
["5\n1\n1 1 10 10\n2\n10 5 2 10 1 1 2 5\n2\n10 5 1 10 5 1 1 1\n2\n1 1 1 1 1 1 1 1\n1\n10000 10000 10000 10000"]
2 seconds
["YES\nYES\nNO\nYES\nYES"]
null
Java 8
standard input
[ "greedy", "math" ]
08783e3dff3f3b7eb586931f9d0cd457
The first line of the input contains one integer $$$q$$$ ($$$1 \le q \le 500$$$) — the number of queries. Then $$$q$$$ queries follow. The first line of the query contains one integer $$$n$$$ ($$$1 \le n \le 100$$$) — the number of rectangles. The second line of the query contains $$$4n$$$ integers $$$a_1, a_2, \dots, ...
1,200
For each query print the answer to it. If it is impossible to create exactly $$$n$$$ rectangles of equal area using given sticks, print "NO". Otherwise print "YES".
standard output
PASSED
6927a1e9c456647a0443693b5cc1d3f7
train_003.jsonl
1565706900
You are given $$$4n$$$ sticks, the length of the $$$i$$$-th stick is $$$a_i$$$.You have to create $$$n$$$ rectangles, each rectangle will consist of exactly $$$4$$$ sticks from the given set. The rectangle consists of four sides, opposite sides should have equal length and all angles in it should be right. Note that ea...
256 megabytes
import java.util.*; public class Mohammad { public static void Mohammad_AboHasan(){ Scanner sc = new Scanner(System.in); int t = sc.nextInt(); while(t-->0){ int n = sc.nextInt(); int[] a = new int[n*4]; int[] b = new int[n]; boolean m = true;...
Java
["5\n1\n1 1 10 10\n2\n10 5 2 10 1 1 2 5\n2\n10 5 1 10 5 1 1 1\n2\n1 1 1 1 1 1 1 1\n1\n10000 10000 10000 10000"]
2 seconds
["YES\nYES\nNO\nYES\nYES"]
null
Java 8
standard input
[ "greedy", "math" ]
08783e3dff3f3b7eb586931f9d0cd457
The first line of the input contains one integer $$$q$$$ ($$$1 \le q \le 500$$$) — the number of queries. Then $$$q$$$ queries follow. The first line of the query contains one integer $$$n$$$ ($$$1 \le n \le 100$$$) — the number of rectangles. The second line of the query contains $$$4n$$$ integers $$$a_1, a_2, \dots, ...
1,200
For each query print the answer to it. If it is impossible to create exactly $$$n$$$ rectangles of equal area using given sticks, print "NO". Otherwise print "YES".
standard output
PASSED
e9cec338d64c1be7f145a77f1925df71
train_003.jsonl
1596810900
This year in Equestria was a year of plenty, so Applejack has decided to build some new apple storages. According to the advice of the farm designers, she chose to build two storages with non-zero area: one in the shape of a square and another one in the shape of a rectangle (which possibly can be a square as well).App...
256 megabytes
import org.omg.CORBA.INTERNAL; import java.io. *; import java.util.*; import static java.lang.Math.*; public class Main { static final FastReader sc = new FastReader(System.in); static final PrintWriter pw = new PrintWriter(System.out); static int visited[]; static ArrayList<ArrayList<Integer>> adjli...
Java
["6\n1 1 1 2 1 1\n6\n+ 2\n+ 1\n- 1\n+ 2\n- 1\n+ 2"]
2 seconds
["NO\nYES\nNO\nNO\nNO\nYES"]
NoteAfter the second event Applejack can build a rectangular storage using planks with lengths $$$1$$$, $$$2$$$, $$$1$$$, $$$2$$$ and a square storage using planks with lengths $$$1$$$, $$$1$$$, $$$1$$$, $$$1$$$.After the sixth event Applejack can build a rectangular storage using planks with lengths $$$2$$$, $$$2$$$, ...
Java 8
standard input
[ "data structures", "constructive algorithms", "implementation", "greedy" ]
d14bad9abf2a27ba57c80851405a360b
The first line contains a single integer $$$n$$$ ($$$1 \le n \le 10^5$$$): the initial amount of planks at the company's storehouse, the second line contains $$$n$$$ integers $$$a_1, a_2, \ldots, a_n$$$ ($$$1 \le a_i \le 10^5$$$): the lengths of the planks. The third line contains a single integer $$$q$$$ ($$$1 \le q \...
1,400
After every event in the company, print "YES" if two storages of the required shape can be built from the planks of that company's set, and print "NO" otherwise. You can print each letter in any case (upper or lower).
standard output
PASSED
dac6e467a14b250d6a6645909e810b13
train_003.jsonl
1596810900
This year in Equestria was a year of plenty, so Applejack has decided to build some new apple storages. According to the advice of the farm designers, she chose to build two storages with non-zero area: one in the shape of a square and another one in the shape of a rectangle (which possibly can be a square as well).App...
256 megabytes
//package compete; import java.io.BufferedOutputStream; import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; import java.io.PrintWriter; import java.lang.reflect.Array; import java.security.acl.LastOwnerException; import java.util.*; import java.util.ArrayDeque; import java.util....
Java
["6\n1 1 1 2 1 1\n6\n+ 2\n+ 1\n- 1\n+ 2\n- 1\n+ 2"]
2 seconds
["NO\nYES\nNO\nNO\nNO\nYES"]
NoteAfter the second event Applejack can build a rectangular storage using planks with lengths $$$1$$$, $$$2$$$, $$$1$$$, $$$2$$$ and a square storage using planks with lengths $$$1$$$, $$$1$$$, $$$1$$$, $$$1$$$.After the sixth event Applejack can build a rectangular storage using planks with lengths $$$2$$$, $$$2$$$, ...
Java 8
standard input
[ "data structures", "constructive algorithms", "implementation", "greedy" ]
d14bad9abf2a27ba57c80851405a360b
The first line contains a single integer $$$n$$$ ($$$1 \le n \le 10^5$$$): the initial amount of planks at the company's storehouse, the second line contains $$$n$$$ integers $$$a_1, a_2, \ldots, a_n$$$ ($$$1 \le a_i \le 10^5$$$): the lengths of the planks. The third line contains a single integer $$$q$$$ ($$$1 \le q \...
1,400
After every event in the company, print "YES" if two storages of the required shape can be built from the planks of that company's set, and print "NO" otherwise. You can print each letter in any case (upper or lower).
standard output
PASSED
49e9e1f122eb4df0c603dd81f82a8d1b
train_003.jsonl
1596810900
This year in Equestria was a year of plenty, so Applejack has decided to build some new apple storages. According to the advice of the farm designers, she chose to build two storages with non-zero area: one in the shape of a square and another one in the shape of a rectangle (which possibly can be a square as well).App...
256 megabytes
import java.util.*; import java.io.*; public class Main{ public static void main(String[] args)throws IOException{ Scanner sc = new Scanner(System.in); InputStreamReader isr = new InputStreamReader(System.in); BufferedReader br = new BufferedReader(isr); int a,b,c,d,e,f,g,i,j,k,l; int h; ...
Java
["6\n1 1 1 2 1 1\n6\n+ 2\n+ 1\n- 1\n+ 2\n- 1\n+ 2"]
2 seconds
["NO\nYES\nNO\nNO\nNO\nYES"]
NoteAfter the second event Applejack can build a rectangular storage using planks with lengths $$$1$$$, $$$2$$$, $$$1$$$, $$$2$$$ and a square storage using planks with lengths $$$1$$$, $$$1$$$, $$$1$$$, $$$1$$$.After the sixth event Applejack can build a rectangular storage using planks with lengths $$$2$$$, $$$2$$$, ...
Java 8
standard input
[ "data structures", "constructive algorithms", "implementation", "greedy" ]
d14bad9abf2a27ba57c80851405a360b
The first line contains a single integer $$$n$$$ ($$$1 \le n \le 10^5$$$): the initial amount of planks at the company's storehouse, the second line contains $$$n$$$ integers $$$a_1, a_2, \ldots, a_n$$$ ($$$1 \le a_i \le 10^5$$$): the lengths of the planks. The third line contains a single integer $$$q$$$ ($$$1 \le q \...
1,400
After every event in the company, print "YES" if two storages of the required shape can be built from the planks of that company's set, and print "NO" otherwise. You can print each letter in any case (upper or lower).
standard output
PASSED
104bcdd592be0ceabc59b4f42116d1c1
train_003.jsonl
1596810900
This year in Equestria was a year of plenty, so Applejack has decided to build some new apple storages. According to the advice of the farm designers, she chose to build two storages with non-zero area: one in the shape of a square and another one in the shape of a rectangle (which possibly can be a square as well).App...
256 megabytes
import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; import java.util.*; public class Main { static int MAXN = 100005; static int[]a,qu; static int n,q; static int sqr,rec; public static void main(String[]args) throws IOException{ a = new int[MAXN]; ...
Java
["6\n1 1 1 2 1 1\n6\n+ 2\n+ 1\n- 1\n+ 2\n- 1\n+ 2"]
2 seconds
["NO\nYES\nNO\nNO\nNO\nYES"]
NoteAfter the second event Applejack can build a rectangular storage using planks with lengths $$$1$$$, $$$2$$$, $$$1$$$, $$$2$$$ and a square storage using planks with lengths $$$1$$$, $$$1$$$, $$$1$$$, $$$1$$$.After the sixth event Applejack can build a rectangular storage using planks with lengths $$$2$$$, $$$2$$$, ...
Java 8
standard input
[ "data structures", "constructive algorithms", "implementation", "greedy" ]
d14bad9abf2a27ba57c80851405a360b
The first line contains a single integer $$$n$$$ ($$$1 \le n \le 10^5$$$): the initial amount of planks at the company's storehouse, the second line contains $$$n$$$ integers $$$a_1, a_2, \ldots, a_n$$$ ($$$1 \le a_i \le 10^5$$$): the lengths of the planks. The third line contains a single integer $$$q$$$ ($$$1 \le q \...
1,400
After every event in the company, print "YES" if two storages of the required shape can be built from the planks of that company's set, and print "NO" otherwise. You can print each letter in any case (upper or lower).
standard output
PASSED
2bc3bc3ce11aba2a083c5c8e499ff9dc
train_003.jsonl
1596810900
This year in Equestria was a year of plenty, so Applejack has decided to build some new apple storages. According to the advice of the farm designers, she chose to build two storages with non-zero area: one in the shape of a square and another one in the shape of a rectangle (which possibly can be a square as well).App...
256 megabytes
import java.io.InputStream; import java.util.*; public class B662 { static int n; static int q; // static List<Integer> lenghts; static Map<Integer, Integer> len; public static void main(String[] args) { readInput(System.in); } private static void readInput(InputStream s) { ...
Java
["6\n1 1 1 2 1 1\n6\n+ 2\n+ 1\n- 1\n+ 2\n- 1\n+ 2"]
2 seconds
["NO\nYES\nNO\nNO\nNO\nYES"]
NoteAfter the second event Applejack can build a rectangular storage using planks with lengths $$$1$$$, $$$2$$$, $$$1$$$, $$$2$$$ and a square storage using planks with lengths $$$1$$$, $$$1$$$, $$$1$$$, $$$1$$$.After the sixth event Applejack can build a rectangular storage using planks with lengths $$$2$$$, $$$2$$$, ...
Java 8
standard input
[ "data structures", "constructive algorithms", "implementation", "greedy" ]
d14bad9abf2a27ba57c80851405a360b
The first line contains a single integer $$$n$$$ ($$$1 \le n \le 10^5$$$): the initial amount of planks at the company's storehouse, the second line contains $$$n$$$ integers $$$a_1, a_2, \ldots, a_n$$$ ($$$1 \le a_i \le 10^5$$$): the lengths of the planks. The third line contains a single integer $$$q$$$ ($$$1 \le q \...
1,400
After every event in the company, print "YES" if two storages of the required shape can be built from the planks of that company's set, and print "NO" otherwise. You can print each letter in any case (upper or lower).
standard output
PASSED
3b118535515938af2010c30daafca902
train_003.jsonl
1457870400
Polycarp is a big lover of killing time in social networks. A page with a chatlist in his favourite network is made so that when a message is sent to some friend, his friend's chat rises to the very top of the page. The relative order of the other chats doesn't change. If there was no chat with this friend before, then...
256 megabytes
import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; import java.util.HashSet; public class Main { public static void main(String[] args) throws NumberFormatException, IOException { BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); int n = Integer.p...
Java
["4\nalex\nivan\nroman\nivan", "8\nalina\nmaria\nekaterina\ndarya\ndarya\nekaterina\nmaria\nalina"]
3 seconds
["ivan\nroman\nalex", "alina\nmaria\nekaterina\ndarya"]
NoteIn the first test case Polycarpus first writes to friend by name "alex", and the list looks as follows: alex Then Polycarpus writes to friend by name "ivan" and the list looks as follows: ivan alex Polycarpus writes the third message to friend by name "roman" and the list looks as follows: roman ivan alex Po...
Java 8
standard input
[ "constructive algorithms", "*special", "sortings", "data structures", "binary search" ]
18f4d9262150294b63d99803250ed49c
The first line contains integer n (1 ≤ n ≤ 200 000) — the number of Polycarpus' messages. Next n lines enlist the message recipients in the order in which the messages were sent. The name of each participant is a non-empty sequence of lowercase English letters of length at most 10.
1,200
Print all the recipients to who Polycarp talked to in the order of chats with them, from top to bottom.
standard output
PASSED
0ba615524982456ed6408e9eed5ec608
train_003.jsonl
1457870400
Polycarp is a big lover of killing time in social networks. A page with a chatlist in his favourite network is made so that when a message is sent to some friend, his friend's chat rises to the very top of the page. The relative order of the other chats doesn't change. If there was no chat with this friend before, then...
256 megabytes
import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; import java.io.PrintWriter; import java.util.LinkedHashSet; import java.util.Stack; public class Main { public static void main(String[] args) throws NumberFormatException, IOException { BufferedReader br = new BufferedRe...
Java
["4\nalex\nivan\nroman\nivan", "8\nalina\nmaria\nekaterina\ndarya\ndarya\nekaterina\nmaria\nalina"]
3 seconds
["ivan\nroman\nalex", "alina\nmaria\nekaterina\ndarya"]
NoteIn the first test case Polycarpus first writes to friend by name "alex", and the list looks as follows: alex Then Polycarpus writes to friend by name "ivan" and the list looks as follows: ivan alex Polycarpus writes the third message to friend by name "roman" and the list looks as follows: roman ivan alex Po...
Java 8
standard input
[ "constructive algorithms", "*special", "sortings", "data structures", "binary search" ]
18f4d9262150294b63d99803250ed49c
The first line contains integer n (1 ≤ n ≤ 200 000) — the number of Polycarpus' messages. Next n lines enlist the message recipients in the order in which the messages were sent. The name of each participant is a non-empty sequence of lowercase English letters of length at most 10.
1,200
Print all the recipients to who Polycarp talked to in the order of chats with them, from top to bottom.
standard output
PASSED
1c801a6175492dd916ed23be07627682
train_003.jsonl
1457870400
Polycarp is a big lover of killing time in social networks. A page with a chatlist in his favourite network is made so that when a message is sent to some friend, his friend's chat rises to the very top of the page. The relative order of the other chats doesn't change. If there was no chat with this friend before, then...
256 megabytes
import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; import java.io.PrintWriter; import java.util.LinkedHashSet; import java.util.LinkedList; import java.util.Stack; public class Main { public static void main(String[] args) throws IOException { BufferedReader br = new Buffer...
Java
["4\nalex\nivan\nroman\nivan", "8\nalina\nmaria\nekaterina\ndarya\ndarya\nekaterina\nmaria\nalina"]
3 seconds
["ivan\nroman\nalex", "alina\nmaria\nekaterina\ndarya"]
NoteIn the first test case Polycarpus first writes to friend by name "alex", and the list looks as follows: alex Then Polycarpus writes to friend by name "ivan" and the list looks as follows: ivan alex Polycarpus writes the third message to friend by name "roman" and the list looks as follows: roman ivan alex Po...
Java 8
standard input
[ "constructive algorithms", "*special", "sortings", "data structures", "binary search" ]
18f4d9262150294b63d99803250ed49c
The first line contains integer n (1 ≤ n ≤ 200 000) — the number of Polycarpus' messages. Next n lines enlist the message recipients in the order in which the messages were sent. The name of each participant is a non-empty sequence of lowercase English letters of length at most 10.
1,200
Print all the recipients to who Polycarp talked to in the order of chats with them, from top to bottom.
standard output
PASSED
e6026b5a03700f8b0d5c463a8ac9e7ee
train_003.jsonl
1457870400
Polycarp is a big lover of killing time in social networks. A page with a chatlist in his favourite network is made so that when a message is sent to some friend, his friend's chat rises to the very top of the page. The relative order of the other chats doesn't change. If there was no chat with this friend before, then...
256 megabytes
import java.io.InputStreamReader; import java.io.IOException; import java.io.BufferedReader; import java.io.OutputStream; import java.io.PrintWriter; import java.util.*; import java.io.InputStream; public class B { public static void main(String[] args) { InputStream inputStream = System.in; Outpu...
Java
["4\nalex\nivan\nroman\nivan", "8\nalina\nmaria\nekaterina\ndarya\ndarya\nekaterina\nmaria\nalina"]
3 seconds
["ivan\nroman\nalex", "alina\nmaria\nekaterina\ndarya"]
NoteIn the first test case Polycarpus first writes to friend by name "alex", and the list looks as follows: alex Then Polycarpus writes to friend by name "ivan" and the list looks as follows: ivan alex Polycarpus writes the third message to friend by name "roman" and the list looks as follows: roman ivan alex Po...
Java 8
standard input
[ "constructive algorithms", "*special", "sortings", "data structures", "binary search" ]
18f4d9262150294b63d99803250ed49c
The first line contains integer n (1 ≤ n ≤ 200 000) — the number of Polycarpus' messages. Next n lines enlist the message recipients in the order in which the messages were sent. The name of each participant is a non-empty sequence of lowercase English letters of length at most 10.
1,200
Print all the recipients to who Polycarp talked to in the order of chats with them, from top to bottom.
standard output
PASSED
53c9753ba80c1dbe7178ccf8379d39f9
train_003.jsonl
1457870400
Polycarp is a big lover of killing time in social networks. A page with a chatlist in his favourite network is made so that when a message is sent to some friend, his friend's chat rises to the very top of the page. The relative order of the other chats doesn't change. If there was no chat with this friend before, then...
256 megabytes
import java.util.*; import java.lang.*; import java.lang.reflect.Array; import java.io.*; import java.math.*; import java.text.DecimalFormat; import java.util.Arrays; import java.util.Collections; public class Prac{ static class InputReader { private final InputStream stream; private final byte[]...
Java
["4\nalex\nivan\nroman\nivan", "8\nalina\nmaria\nekaterina\ndarya\ndarya\nekaterina\nmaria\nalina"]
3 seconds
["ivan\nroman\nalex", "alina\nmaria\nekaterina\ndarya"]
NoteIn the first test case Polycarpus first writes to friend by name "alex", and the list looks as follows: alex Then Polycarpus writes to friend by name "ivan" and the list looks as follows: ivan alex Polycarpus writes the third message to friend by name "roman" and the list looks as follows: roman ivan alex Po...
Java 8
standard input
[ "constructive algorithms", "*special", "sortings", "data structures", "binary search" ]
18f4d9262150294b63d99803250ed49c
The first line contains integer n (1 ≤ n ≤ 200 000) — the number of Polycarpus' messages. Next n lines enlist the message recipients in the order in which the messages were sent. The name of each participant is a non-empty sequence of lowercase English letters of length at most 10.
1,200
Print all the recipients to who Polycarp talked to in the order of chats with them, from top to bottom.
standard output
PASSED
7290e92d8d60359d2ad73c111a47cc61
train_003.jsonl
1457870400
Polycarp is a big lover of killing time in social networks. A page with a chatlist in his favourite network is made so that when a message is sent to some friend, his friend's chat rises to the very top of the page. The relative order of the other chats doesn't change. If there was no chat with this friend before, then...
256 megabytes
import java.io.*; import java.util.HashSet; import java.util.Set; public class Main { public static void main(String args[])throws IOException { BufferedReader obj=new BufferedReader(new InputStreamReader(System.in)); int N=Integer.parseInt(obj.readLine()); String temp="|"; String arr[]=new String[N]; int bit[]=ne...
Java
["4\nalex\nivan\nroman\nivan", "8\nalina\nmaria\nekaterina\ndarya\ndarya\nekaterina\nmaria\nalina"]
3 seconds
["ivan\nroman\nalex", "alina\nmaria\nekaterina\ndarya"]
NoteIn the first test case Polycarpus first writes to friend by name "alex", and the list looks as follows: alex Then Polycarpus writes to friend by name "ivan" and the list looks as follows: ivan alex Polycarpus writes the third message to friend by name "roman" and the list looks as follows: roman ivan alex Po...
Java 8
standard input
[ "constructive algorithms", "*special", "sortings", "data structures", "binary search" ]
18f4d9262150294b63d99803250ed49c
The first line contains integer n (1 ≤ n ≤ 200 000) — the number of Polycarpus' messages. Next n lines enlist the message recipients in the order in which the messages were sent. The name of each participant is a non-empty sequence of lowercase English letters of length at most 10.
1,200
Print all the recipients to who Polycarp talked to in the order of chats with them, from top to bottom.
standard output
PASSED
a7cc075cc3f63c3d8f91587972b5c116
train_003.jsonl
1457870400
Polycarp is a big lover of killing time in social networks. A page with a chatlist in his favourite network is made so that when a message is sent to some friend, his friend's chat rises to the very top of the page. The relative order of the other chats doesn't change. If there was no chat with this friend before, then...
256 megabytes
import java.io.BufferedReader; import java.io.IOException; import java.io.InputStream; import java.io.InputStreamReader; import java.io.PrintWriter; import java.util.HashMap; import java.util.HashSet; import java.util.Stack; //import java.util.*; //import java.io.Reader; //import java.math.BigDecimal; //import java.ut...
Java
["4\nalex\nivan\nroman\nivan", "8\nalina\nmaria\nekaterina\ndarya\ndarya\nekaterina\nmaria\nalina"]
3 seconds
["ivan\nroman\nalex", "alina\nmaria\nekaterina\ndarya"]
NoteIn the first test case Polycarpus first writes to friend by name "alex", and the list looks as follows: alex Then Polycarpus writes to friend by name "ivan" and the list looks as follows: ivan alex Polycarpus writes the third message to friend by name "roman" and the list looks as follows: roman ivan alex Po...
Java 8
standard input
[ "constructive algorithms", "*special", "sortings", "data structures", "binary search" ]
18f4d9262150294b63d99803250ed49c
The first line contains integer n (1 ≤ n ≤ 200 000) — the number of Polycarpus' messages. Next n lines enlist the message recipients in the order in which the messages were sent. The name of each participant is a non-empty sequence of lowercase English letters of length at most 10.
1,200
Print all the recipients to who Polycarp talked to in the order of chats with them, from top to bottom.
standard output
PASSED
d706a9eb362a719a347fa2c8ebde8a66
train_003.jsonl
1457870400
Polycarp is a big lover of killing time in social networks. A page with a chatlist in his favourite network is made so that when a message is sent to some friend, his friend's chat rises to the very top of the page. The relative order of the other chats doesn't change. If there was no chat with this friend before, then...
256 megabytes
import java.io.BufferedReader; import java.io.IOException; import java.io.InputStream; import java.io.InputStreamReader; import java.io.PrintWriter; import java.util.HashMap; import java.util.HashSet; import java.util.Stack; //import java.util.*; //import java.io.Reader; //import java.math.BigDecimal; //import java.ut...
Java
["4\nalex\nivan\nroman\nivan", "8\nalina\nmaria\nekaterina\ndarya\ndarya\nekaterina\nmaria\nalina"]
3 seconds
["ivan\nroman\nalex", "alina\nmaria\nekaterina\ndarya"]
NoteIn the first test case Polycarpus first writes to friend by name "alex", and the list looks as follows: alex Then Polycarpus writes to friend by name "ivan" and the list looks as follows: ivan alex Polycarpus writes the third message to friend by name "roman" and the list looks as follows: roman ivan alex Po...
Java 8
standard input
[ "constructive algorithms", "*special", "sortings", "data structures", "binary search" ]
18f4d9262150294b63d99803250ed49c
The first line contains integer n (1 ≤ n ≤ 200 000) — the number of Polycarpus' messages. Next n lines enlist the message recipients in the order in which the messages were sent. The name of each participant is a non-empty sequence of lowercase English letters of length at most 10.
1,200
Print all the recipients to who Polycarp talked to in the order of chats with them, from top to bottom.
standard output
PASSED
555f336d83a8c9c7ffb5d960d476322b
train_003.jsonl
1457870400
Polycarp is a big lover of killing time in social networks. A page with a chatlist in his favourite network is made so that when a message is sent to some friend, his friend's chat rises to the very top of the page. The relative order of the other chats doesn't change. If there was no chat with this friend before, then...
256 megabytes
import java.io.PrintWriter; import java.util.ArrayList; import java.util.HashSet; import java.util.Scanner; public class ChatOrder { public static void main(String[] args) { // TODO Auto-generated method stub Scanner input = new Scanner(System.in); int n = input.nextInt(); String[] s = new String[n]; Hash...
Java
["4\nalex\nivan\nroman\nivan", "8\nalina\nmaria\nekaterina\ndarya\ndarya\nekaterina\nmaria\nalina"]
3 seconds
["ivan\nroman\nalex", "alina\nmaria\nekaterina\ndarya"]
NoteIn the first test case Polycarpus first writes to friend by name "alex", and the list looks as follows: alex Then Polycarpus writes to friend by name "ivan" and the list looks as follows: ivan alex Polycarpus writes the third message to friend by name "roman" and the list looks as follows: roman ivan alex Po...
Java 8
standard input
[ "constructive algorithms", "*special", "sortings", "data structures", "binary search" ]
18f4d9262150294b63d99803250ed49c
The first line contains integer n (1 ≤ n ≤ 200 000) — the number of Polycarpus' messages. Next n lines enlist the message recipients in the order in which the messages were sent. The name of each participant is a non-empty sequence of lowercase English letters of length at most 10.
1,200
Print all the recipients to who Polycarp talked to in the order of chats with them, from top to bottom.
standard output
PASSED
d716e5594dc54b04919df09b05aff0fb
train_003.jsonl
1457870400
Polycarp is a big lover of killing time in social networks. A page with a chatlist in his favourite network is made so that when a message is sent to some friend, his friend's chat rises to the very top of the page. The relative order of the other chats doesn't change. If there was no chat with this friend before, then...
256 megabytes
import java.util.*; import java.io.*; public class p765c { public static void main(String[] args)throws Exception{ Scanner sc=new Scanner(System.in); PrintWriter out=new PrintWriter(System.out); int n=sc.nextInt(); Stack<String> s1=new Stack<String>(); for(int i=0;i<n;i++) { s1.push(sc.n...
Java
["4\nalex\nivan\nroman\nivan", "8\nalina\nmaria\nekaterina\ndarya\ndarya\nekaterina\nmaria\nalina"]
3 seconds
["ivan\nroman\nalex", "alina\nmaria\nekaterina\ndarya"]
NoteIn the first test case Polycarpus first writes to friend by name "alex", and the list looks as follows: alex Then Polycarpus writes to friend by name "ivan" and the list looks as follows: ivan alex Polycarpus writes the third message to friend by name "roman" and the list looks as follows: roman ivan alex Po...
Java 8
standard input
[ "constructive algorithms", "*special", "sortings", "data structures", "binary search" ]
18f4d9262150294b63d99803250ed49c
The first line contains integer n (1 ≤ n ≤ 200 000) — the number of Polycarpus' messages. Next n lines enlist the message recipients in the order in which the messages were sent. The name of each participant is a non-empty sequence of lowercase English letters of length at most 10.
1,200
Print all the recipients to who Polycarp talked to in the order of chats with them, from top to bottom.
standard output
PASSED
87722cf84299bcd8c9d92cd4855f683f
train_003.jsonl
1457870400
Polycarp is a big lover of killing time in social networks. A page with a chatlist in his favourite network is made so that when a message is sent to some friend, his friend's chat rises to the very top of the page. The relative order of the other chats doesn't change. If there was no chat with this friend before, then...
256 megabytes
import java.util.*; public class Chat { public static void main(String[] args) { Scanner sc = new Scanner(System.in); Stack<String> stack = new Stack<String>(); TreeSet<String> tree = new TreeSet<String>(); int n = sc.nextInt(); for (int i = 0; i < n; i++) stack.push(sc.next()); while(!stack.isEm...
Java
["4\nalex\nivan\nroman\nivan", "8\nalina\nmaria\nekaterina\ndarya\ndarya\nekaterina\nmaria\nalina"]
3 seconds
["ivan\nroman\nalex", "alina\nmaria\nekaterina\ndarya"]
NoteIn the first test case Polycarpus first writes to friend by name "alex", and the list looks as follows: alex Then Polycarpus writes to friend by name "ivan" and the list looks as follows: ivan alex Polycarpus writes the third message to friend by name "roman" and the list looks as follows: roman ivan alex Po...
Java 8
standard input
[ "constructive algorithms", "*special", "sortings", "data structures", "binary search" ]
18f4d9262150294b63d99803250ed49c
The first line contains integer n (1 ≤ n ≤ 200 000) — the number of Polycarpus' messages. Next n lines enlist the message recipients in the order in which the messages were sent. The name of each participant is a non-empty sequence of lowercase English letters of length at most 10.
1,200
Print all the recipients to who Polycarp talked to in the order of chats with them, from top to bottom.
standard output
PASSED
e102ca9772934f36ad63a895b60ed3a7
train_003.jsonl
1457870400
Polycarp is a big lover of killing time in social networks. A page with a chatlist in his favourite network is made so that when a message is sent to some friend, his friend's chat rises to the very top of the page. The relative order of the other chats doesn't change. If there was no chat with this friend before, then...
256 megabytes
import java.util.*; import java.io.*; import java.math.*; public class cf { static int n; static int m; static Integer arr[]; static Integer brr[]; public static void main(String[] args)throws IOException { PrintWriter out= new PrintWriter(System.out); BufferedReader sc=new Buffe...
Java
["4\nalex\nivan\nroman\nivan", "8\nalina\nmaria\nekaterina\ndarya\ndarya\nekaterina\nmaria\nalina"]
3 seconds
["ivan\nroman\nalex", "alina\nmaria\nekaterina\ndarya"]
NoteIn the first test case Polycarpus first writes to friend by name "alex", and the list looks as follows: alex Then Polycarpus writes to friend by name "ivan" and the list looks as follows: ivan alex Polycarpus writes the third message to friend by name "roman" and the list looks as follows: roman ivan alex Po...
Java 8
standard input
[ "constructive algorithms", "*special", "sortings", "data structures", "binary search" ]
18f4d9262150294b63d99803250ed49c
The first line contains integer n (1 ≤ n ≤ 200 000) — the number of Polycarpus' messages. Next n lines enlist the message recipients in the order in which the messages were sent. The name of each participant is a non-empty sequence of lowercase English letters of length at most 10.
1,200
Print all the recipients to who Polycarp talked to in the order of chats with them, from top to bottom.
standard output
PASSED
f0bdc78b4da59ca28ee2b7cd6547e3b1
train_003.jsonl
1457870400
Polycarp is a big lover of killing time in social networks. A page with a chatlist in his favourite network is made so that when a message is sent to some friend, his friend's chat rises to the very top of the page. The relative order of the other chats doesn't change. If there was no chat with this friend before, then...
256 megabytes
// AC as of 3/9/2018 // Solution: Trivial, store chat list in String array, then read from the back // Use HashMap to keep track of names already seen import java.util.HashMap; import java.util.Scanner; public class CF637B { public static void main(String[] args) { Scanner sc = new Scanner(System.in); ...
Java
["4\nalex\nivan\nroman\nivan", "8\nalina\nmaria\nekaterina\ndarya\ndarya\nekaterina\nmaria\nalina"]
3 seconds
["ivan\nroman\nalex", "alina\nmaria\nekaterina\ndarya"]
NoteIn the first test case Polycarpus first writes to friend by name "alex", and the list looks as follows: alex Then Polycarpus writes to friend by name "ivan" and the list looks as follows: ivan alex Polycarpus writes the third message to friend by name "roman" and the list looks as follows: roman ivan alex Po...
Java 8
standard input
[ "constructive algorithms", "*special", "sortings", "data structures", "binary search" ]
18f4d9262150294b63d99803250ed49c
The first line contains integer n (1 ≤ n ≤ 200 000) — the number of Polycarpus' messages. Next n lines enlist the message recipients in the order in which the messages were sent. The name of each participant is a non-empty sequence of lowercase English letters of length at most 10.
1,200
Print all the recipients to who Polycarp talked to in the order of chats with them, from top to bottom.
standard output
PASSED
0aa8f6af1246cf2d00b8682cd19c058b
train_003.jsonl
1457870400
Polycarp is a big lover of killing time in social networks. A page with a chatlist in his favourite network is made so that when a message is sent to some friend, his friend's chat rises to the very top of the page. The relative order of the other chats doesn't change. If there was no chat with this friend before, then...
256 megabytes
import java.util.ArrayList; import java.util.Collections; import java.util.HashMap; import java.util.Scanner; public class CF637B { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int nChats = sc.nextInt(); ArrayList<String> chats = new ArrayList<>(); while(nChats-->0) chats.add(...
Java
["4\nalex\nivan\nroman\nivan", "8\nalina\nmaria\nekaterina\ndarya\ndarya\nekaterina\nmaria\nalina"]
3 seconds
["ivan\nroman\nalex", "alina\nmaria\nekaterina\ndarya"]
NoteIn the first test case Polycarpus first writes to friend by name "alex", and the list looks as follows: alex Then Polycarpus writes to friend by name "ivan" and the list looks as follows: ivan alex Polycarpus writes the third message to friend by name "roman" and the list looks as follows: roman ivan alex Po...
Java 8
standard input
[ "constructive algorithms", "*special", "sortings", "data structures", "binary search" ]
18f4d9262150294b63d99803250ed49c
The first line contains integer n (1 ≤ n ≤ 200 000) — the number of Polycarpus' messages. Next n lines enlist the message recipients in the order in which the messages were sent. The name of each participant is a non-empty sequence of lowercase English letters of length at most 10.
1,200
Print all the recipients to who Polycarp talked to in the order of chats with them, from top to bottom.
standard output
PASSED
a145e8bc69dda068dee7af7cb9f9b628
train_003.jsonl
1457870400
Polycarp is a big lover of killing time in social networks. A page with a chatlist in his favourite network is made so that when a message is sent to some friend, his friend's chat rises to the very top of the page. The relative order of the other chats doesn't change. If there was no chat with this friend before, then...
256 megabytes
import java.io.*; import java.util.*; public class Main { static BufferedReader br; static StringTokenizer st; static PrintWriter pr = new PrintWriter(new BufferedWriter(new OutputStreamWriter(System.out))); public static class AL<T> extends ArrayList<T> {}; public static class HM<T,Integer> ...
Java
["4\nalex\nivan\nroman\nivan", "8\nalina\nmaria\nekaterina\ndarya\ndarya\nekaterina\nmaria\nalina"]
3 seconds
["ivan\nroman\nalex", "alina\nmaria\nekaterina\ndarya"]
NoteIn the first test case Polycarpus first writes to friend by name "alex", and the list looks as follows: alex Then Polycarpus writes to friend by name "ivan" and the list looks as follows: ivan alex Polycarpus writes the third message to friend by name "roman" and the list looks as follows: roman ivan alex Po...
Java 8
standard input
[ "constructive algorithms", "*special", "sortings", "data structures", "binary search" ]
18f4d9262150294b63d99803250ed49c
The first line contains integer n (1 ≤ n ≤ 200 000) — the number of Polycarpus' messages. Next n lines enlist the message recipients in the order in which the messages were sent. The name of each participant is a non-empty sequence of lowercase English letters of length at most 10.
1,200
Print all the recipients to who Polycarp talked to in the order of chats with them, from top to bottom.
standard output
PASSED
8b322c10bdfc71c146aa50470107c5fe
train_003.jsonl
1457870400
Polycarp is a big lover of killing time in social networks. A page with a chatlist in his favourite network is made so that when a message is sent to some friend, his friend's chat rises to the very top of the page. The relative order of the other chats doesn't change. If there was no chat with this friend before, then...
256 megabytes
import java.io.FileNotFoundException; import java.io.PrintWriter; import java.util.ArrayList; import java.util.Scanner; import java.util.TreeSet; //import java.util.*; /** * Created by Андрей on 13.03.2016. */ public class A { public static PrintWriter pw; public static void main(String[] args) throws FileN...
Java
["4\nalex\nivan\nroman\nivan", "8\nalina\nmaria\nekaterina\ndarya\ndarya\nekaterina\nmaria\nalina"]
3 seconds
["ivan\nroman\nalex", "alina\nmaria\nekaterina\ndarya"]
NoteIn the first test case Polycarpus first writes to friend by name "alex", and the list looks as follows: alex Then Polycarpus writes to friend by name "ivan" and the list looks as follows: ivan alex Polycarpus writes the third message to friend by name "roman" and the list looks as follows: roman ivan alex Po...
Java 8
standard input
[ "constructive algorithms", "*special", "sortings", "data structures", "binary search" ]
18f4d9262150294b63d99803250ed49c
The first line contains integer n (1 ≤ n ≤ 200 000) — the number of Polycarpus' messages. Next n lines enlist the message recipients in the order in which the messages were sent. The name of each participant is a non-empty sequence of lowercase English letters of length at most 10.
1,200
Print all the recipients to who Polycarp talked to in the order of chats with them, from top to bottom.
standard output
PASSED
5e57e99be4e43cbb79ba1b596313cc92
train_003.jsonl
1457870400
Polycarp is a big lover of killing time in social networks. A page with a chatlist in his favourite network is made so that when a message is sent to some friend, his friend's chat rises to the very top of the page. The relative order of the other chats doesn't change. If there was no chat with this friend before, then...
256 megabytes
import java.io.BufferedReader; import java.io.FileReader; import java.io.IOException; import java.io.InputStream; import java.io.InputStreamReader; import java.io.PrintWriter; import java.util.Map; import java.util.Stack; import java.util.StringTokenizer; import java.util.TreeMap; import java.util.TreeSet; public clas...
Java
["4\nalex\nivan\nroman\nivan", "8\nalina\nmaria\nekaterina\ndarya\ndarya\nekaterina\nmaria\nalina"]
3 seconds
["ivan\nroman\nalex", "alina\nmaria\nekaterina\ndarya"]
NoteIn the first test case Polycarpus first writes to friend by name "alex", and the list looks as follows: alex Then Polycarpus writes to friend by name "ivan" and the list looks as follows: ivan alex Polycarpus writes the third message to friend by name "roman" and the list looks as follows: roman ivan alex Po...
Java 8
standard input
[ "constructive algorithms", "*special", "sortings", "data structures", "binary search" ]
18f4d9262150294b63d99803250ed49c
The first line contains integer n (1 ≤ n ≤ 200 000) — the number of Polycarpus' messages. Next n lines enlist the message recipients in the order in which the messages were sent. The name of each participant is a non-empty sequence of lowercase English letters of length at most 10.
1,200
Print all the recipients to who Polycarp talked to in the order of chats with them, from top to bottom.
standard output
PASSED
dc3dcc19a4380e56b79fd7c2c2531b79
train_003.jsonl
1457870400
Polycarp is a big lover of killing time in social networks. A page with a chatlist in his favourite network is made so that when a message is sent to some friend, his friend's chat rises to the very top of the page. The relative order of the other chats doesn't change. If there was no chat with this friend before, then...
256 megabytes
import java.util.*; import java.io.*; public class ChatOrder { public static void main (String args [] ) throws IOException , InterruptedException { Scanner sc = new Scanner (System.in) ; PrintWriter p = new PrintWriter(System.out) ; // Thread.sleep(1500); int n = sc.nextInt() ; String x [] = new String [n...
Java
["4\nalex\nivan\nroman\nivan", "8\nalina\nmaria\nekaterina\ndarya\ndarya\nekaterina\nmaria\nalina"]
3 seconds
["ivan\nroman\nalex", "alina\nmaria\nekaterina\ndarya"]
NoteIn the first test case Polycarpus first writes to friend by name "alex", and the list looks as follows: alex Then Polycarpus writes to friend by name "ivan" and the list looks as follows: ivan alex Polycarpus writes the third message to friend by name "roman" and the list looks as follows: roman ivan alex Po...
Java 8
standard input
[ "constructive algorithms", "*special", "sortings", "data structures", "binary search" ]
18f4d9262150294b63d99803250ed49c
The first line contains integer n (1 ≤ n ≤ 200 000) — the number of Polycarpus' messages. Next n lines enlist the message recipients in the order in which the messages were sent. The name of each participant is a non-empty sequence of lowercase English letters of length at most 10.
1,200
Print all the recipients to who Polycarp talked to in the order of chats with them, from top to bottom.
standard output
PASSED
50a4b65e43c28fe422fca0836e44f74a
train_003.jsonl
1457870400
Polycarp is a big lover of killing time in social networks. A page with a chatlist in his favourite network is made so that when a message is sent to some friend, his friend's chat rises to the very top of the page. The relative order of the other chats doesn't change. If there was no chat with this friend before, then...
256 megabytes
import java.util.*; import java.io.*; public class Main { public static void main(String[] args) throws IOException { BufferedReader br=new BufferedReader(new InputStreamReader(System.in)); PrintWriter pw=new PrintWriter(new BufferedWriter(new OutputStreamWriter(System.out))); StringTokeniz...
Java
["4\nalex\nivan\nroman\nivan", "8\nalina\nmaria\nekaterina\ndarya\ndarya\nekaterina\nmaria\nalina"]
3 seconds
["ivan\nroman\nalex", "alina\nmaria\nekaterina\ndarya"]
NoteIn the first test case Polycarpus first writes to friend by name "alex", and the list looks as follows: alex Then Polycarpus writes to friend by name "ivan" and the list looks as follows: ivan alex Polycarpus writes the third message to friend by name "roman" and the list looks as follows: roman ivan alex Po...
Java 8
standard input
[ "constructive algorithms", "*special", "sortings", "data structures", "binary search" ]
18f4d9262150294b63d99803250ed49c
The first line contains integer n (1 ≤ n ≤ 200 000) — the number of Polycarpus' messages. Next n lines enlist the message recipients in the order in which the messages were sent. The name of each participant is a non-empty sequence of lowercase English letters of length at most 10.
1,200
Print all the recipients to who Polycarp talked to in the order of chats with them, from top to bottom.
standard output
PASSED
5f781899c2472bc9460f9e970d0ca53c
train_003.jsonl
1457870400
Polycarp is a big lover of killing time in social networks. A page with a chatlist in his favourite network is made so that when a message is sent to some friend, his friend's chat rises to the very top of the page. The relative order of the other chats doesn't change. If there was no chat with this friend before, then...
256 megabytes
import java.util.*; /** * Created by mooks on 13.03.2016. */ public class Main { public static void main(String[] args) { Scanner in = new Scanner(System.in); int n = in.nextInt(); Map<String, Integer> chats = new HashMap(); int size = 0; in.nextLine(); for (in...
Java
["4\nalex\nivan\nroman\nivan", "8\nalina\nmaria\nekaterina\ndarya\ndarya\nekaterina\nmaria\nalina"]
3 seconds
["ivan\nroman\nalex", "alina\nmaria\nekaterina\ndarya"]
NoteIn the first test case Polycarpus first writes to friend by name "alex", and the list looks as follows: alex Then Polycarpus writes to friend by name "ivan" and the list looks as follows: ivan alex Polycarpus writes the third message to friend by name "roman" and the list looks as follows: roman ivan alex Po...
Java 8
standard input
[ "constructive algorithms", "*special", "sortings", "data structures", "binary search" ]
18f4d9262150294b63d99803250ed49c
The first line contains integer n (1 ≤ n ≤ 200 000) — the number of Polycarpus' messages. Next n lines enlist the message recipients in the order in which the messages were sent. The name of each participant is a non-empty sequence of lowercase English letters of length at most 10.
1,200
Print all the recipients to who Polycarp talked to in the order of chats with them, from top to bottom.
standard output
PASSED
cf77cd24b19980fd023c513b04830889
train_003.jsonl
1457870400
Polycarp is a big lover of killing time in social networks. A page with a chatlist in his favourite network is made so that when a message is sent to some friend, his friend's chat rises to the very top of the page. The relative order of the other chats doesn't change. If there was no chat with this friend before, then...
256 megabytes
import java.io.*; import java.util.*; public class ChatOrder { public static void main(String[] args) throws IOException { Scanner scan = new Scanner(System.in); BufferedReader br=new BufferedReader(new InputStreamReader(System.in)); PrintWriter pr=new PrintWriter(System.out); int n=...
Java
["4\nalex\nivan\nroman\nivan", "8\nalina\nmaria\nekaterina\ndarya\ndarya\nekaterina\nmaria\nalina"]
3 seconds
["ivan\nroman\nalex", "alina\nmaria\nekaterina\ndarya"]
NoteIn the first test case Polycarpus first writes to friend by name "alex", and the list looks as follows: alex Then Polycarpus writes to friend by name "ivan" and the list looks as follows: ivan alex Polycarpus writes the third message to friend by name "roman" and the list looks as follows: roman ivan alex Po...
Java 8
standard input
[ "constructive algorithms", "*special", "sortings", "data structures", "binary search" ]
18f4d9262150294b63d99803250ed49c
The first line contains integer n (1 ≤ n ≤ 200 000) — the number of Polycarpus' messages. Next n lines enlist the message recipients in the order in which the messages were sent. The name of each participant is a non-empty sequence of lowercase English letters of length at most 10.
1,200
Print all the recipients to who Polycarp talked to in the order of chats with them, from top to bottom.
standard output
PASSED
784310f984cc2b11786fe6faea394981
train_003.jsonl
1364025600
A double tourist path, located at a park in Ultima Thule, is working by the following principle: We introduce the Cartesian coordinate system. At some points of time there are two tourists going (for a walk) from points ( - 1, 0) and (1, 0) simultaneously. The first one is walking from ( - 1, 0), the second one is wa...
256 megabytes
import java.util.NavigableSet; import java.io.OutputStreamWriter; import java.io.BufferedWriter; import java.util.Comparator; import java.io.OutputStream; import java.io.PrintWriter; import java.util.Random; import java.io.Writer; import java.util.Map; import java.util.List; import java.io.IOException; import java.util...
Java
["2 2\n1 4 3\n3 6 5\n0 1", "3 3\n0 3 4\n0 1 2\n2 4 0\n1 3 4"]
1 second
["2\n4", "2\n4\n4"]
null
Java 7
standard input
[ "data structures", "sortings" ]
8cbc9e2127c21746dc5341ab07bfee86
The first line contains two space-separated integers n and m (1 ≤ n, m ≤ 105) — the number of pairs of tourists and the number of built walls. The next m lines contain three space-separated integers li, ri and ti each (0 ≤ li &lt; ri ≤ 109, 0 ≤ ti ≤ 109) — the wall ends and the time it appeared. The last line contains ...
2,600
For each pair of tourists print on a single line a single integer — the time in seconds when the two tourists from the corresponding pair won't see each other. Print the numbers in the order in which the they go in the input.
standard output
PASSED
e0e73ee47d879c8aace504dad10f8958
train_003.jsonl
1364025600
A double tourist path, located at a park in Ultima Thule, is working by the following principle: We introduce the Cartesian coordinate system. At some points of time there are two tourists going (for a walk) from points ( - 1, 0) and (1, 0) simultaneously. The first one is walking from ( - 1, 0), the second one is wa...
256 megabytes
import java.io.IOException; import java.io.InputStreamReader; import java.util.Arrays; import java.util.TreeMap; import java.util.ArrayList; import java.io.BufferedReader; import java.io.OutputStream; import java.io.PrintWriter; import java.util.StringTokenizer; import java.io.InputStream; /** * Built using CHelper p...
Java
["2 2\n1 4 3\n3 6 5\n0 1", "3 3\n0 3 4\n0 1 2\n2 4 0\n1 3 4"]
1 second
["2\n4", "2\n4\n4"]
null
Java 7
standard input
[ "data structures", "sortings" ]
8cbc9e2127c21746dc5341ab07bfee86
The first line contains two space-separated integers n and m (1 ≤ n, m ≤ 105) — the number of pairs of tourists and the number of built walls. The next m lines contain three space-separated integers li, ri and ti each (0 ≤ li &lt; ri ≤ 109, 0 ≤ ti ≤ 109) — the wall ends and the time it appeared. The last line contains ...
2,600
For each pair of tourists print on a single line a single integer — the time in seconds when the two tourists from the corresponding pair won't see each other. Print the numbers in the order in which the they go in the input.
standard output
PASSED
34ff865d7b62780d4e03272a2d3317dd
train_003.jsonl
1364025600
A double tourist path, located at a park in Ultima Thule, is working by the following principle: We introduce the Cartesian coordinate system. At some points of time there are two tourists going (for a walk) from points ( - 1, 0) and (1, 0) simultaneously. The first one is walking from ( - 1, 0), the second one is wa...
256 megabytes
import java.util.Map; import java.io.IOException; import java.io.InputStreamReader; import java.util.Arrays; import java.util.InputMismatchException; import java.util.TreeMap; import java.util.Comparator; import java.io.BufferedReader; import java.io.OutputStream; import java.util.NavigableMap; import java.io.PrintWrit...
Java
["2 2\n1 4 3\n3 6 5\n0 1", "3 3\n0 3 4\n0 1 2\n2 4 0\n1 3 4"]
1 second
["2\n4", "2\n4\n4"]
null
Java 7
standard input
[ "data structures", "sortings" ]
8cbc9e2127c21746dc5341ab07bfee86
The first line contains two space-separated integers n and m (1 ≤ n, m ≤ 105) — the number of pairs of tourists and the number of built walls. The next m lines contain three space-separated integers li, ri and ti each (0 ≤ li &lt; ri ≤ 109, 0 ≤ ti ≤ 109) — the wall ends and the time it appeared. The last line contains ...
2,600
For each pair of tourists print on a single line a single integer — the time in seconds when the two tourists from the corresponding pair won't see each other. Print the numbers in the order in which the they go in the input.
standard output
PASSED
ab61bf89318d82ef87dc447ad4e38f13
train_003.jsonl
1364025600
A double tourist path, located at a park in Ultima Thule, is working by the following principle: We introduce the Cartesian coordinate system. At some points of time there are two tourists going (for a walk) from points ( - 1, 0) and (1, 0) simultaneously. The first one is walking from ( - 1, 0), the second one is wa...
256 megabytes
import java.io.IOException; import java.io.InputStreamReader; import java.util.Arrays; import java.util.TreeMap; import java.util.ArrayList; import java.io.BufferedReader; import java.io.OutputStream; import java.io.PrintWriter; import java.util.StringTokenizer; import java.io.InputStream; /** * Built using CHelper p...
Java
["2 2\n1 4 3\n3 6 5\n0 1", "3 3\n0 3 4\n0 1 2\n2 4 0\n1 3 4"]
1 second
["2\n4", "2\n4\n4"]
null
Java 7
standard input
[ "data structures", "sortings" ]
8cbc9e2127c21746dc5341ab07bfee86
The first line contains two space-separated integers n and m (1 ≤ n, m ≤ 105) — the number of pairs of tourists and the number of built walls. The next m lines contain three space-separated integers li, ri and ti each (0 ≤ li &lt; ri ≤ 109, 0 ≤ ti ≤ 109) — the wall ends and the time it appeared. The last line contains ...
2,600
For each pair of tourists print on a single line a single integer — the time in seconds when the two tourists from the corresponding pair won't see each other. Print the numbers in the order in which the they go in the input.
standard output
PASSED
e86379a1e7320ac19341c865f2135624
train_003.jsonl
1364025600
A double tourist path, located at a park in Ultima Thule, is working by the following principle: We introduce the Cartesian coordinate system. At some points of time there are two tourists going (for a walk) from points ( - 1, 0) and (1, 0) simultaneously. The first one is walking from ( - 1, 0), the second one is wa...
256 megabytes
import java.io.*; import java.util.*; public class D { public static void main(String[] args) { new D().run(); } BufferedReader br; StringTokenizer in; PrintWriter out; public String nextToken() throws IOException { while (in == null || !in.hasMoreTokens()) { in = new StringTokenizer(br.readLine()); }...
Java
["2 2\n1 4 3\n3 6 5\n0 1", "3 3\n0 3 4\n0 1 2\n2 4 0\n1 3 4"]
1 second
["2\n4", "2\n4\n4"]
null
Java 7
standard input
[ "data structures", "sortings" ]
8cbc9e2127c21746dc5341ab07bfee86
The first line contains two space-separated integers n and m (1 ≤ n, m ≤ 105) — the number of pairs of tourists and the number of built walls. The next m lines contain three space-separated integers li, ri and ti each (0 ≤ li &lt; ri ≤ 109, 0 ≤ ti ≤ 109) — the wall ends and the time it appeared. The last line contains ...
2,600
For each pair of tourists print on a single line a single integer — the time in seconds when the two tourists from the corresponding pair won't see each other. Print the numbers in the order in which the they go in the input.
standard output
PASSED
172272dd6fa9e5fd2ce4b8289aee6f2b
train_003.jsonl
1364025600
A double tourist path, located at a park in Ultima Thule, is working by the following principle: We introduce the Cartesian coordinate system. At some points of time there are two tourists going (for a walk) from points ( - 1, 0) and (1, 0) simultaneously. The first one is walking from ( - 1, 0), the second one is wa...
256 megabytes
// 10 monthes remaining for red =D import java.io.*; import java.util.*; public class D { public static void main(String[] args) { new D().run(); } BufferedReader br; StringTokenizer in; PrintWriter out; public String nextToken() throws IOException { while (in == null || !in.hasMoreTokens()) { in = new ...
Java
["2 2\n1 4 3\n3 6 5\n0 1", "3 3\n0 3 4\n0 1 2\n2 4 0\n1 3 4"]
1 second
["2\n4", "2\n4\n4"]
null
Java 7
standard input
[ "data structures", "sortings" ]
8cbc9e2127c21746dc5341ab07bfee86
The first line contains two space-separated integers n and m (1 ≤ n, m ≤ 105) — the number of pairs of tourists and the number of built walls. The next m lines contain three space-separated integers li, ri and ti each (0 ≤ li &lt; ri ≤ 109, 0 ≤ ti ≤ 109) — the wall ends and the time it appeared. The last line contains ...
2,600
For each pair of tourists print on a single line a single integer — the time in seconds when the two tourists from the corresponding pair won't see each other. Print the numbers in the order in which the they go in the input.
standard output
PASSED
b342fa6dc58e743cd41afa48232fff43
train_003.jsonl
1299340800
Brothers Fred and George Weasley once got into the sporting goods store and opened a box of Quidditch balls. After long and painful experiments they found out that the Golden Snitch is not enchanted at all. It is simply a programmed device. It always moves along the same trajectory, which is a polyline with vertices at...
256 megabytes
import java.io.*; import java.lang.Math; import java.util.Scanner; public class main { public static Scanner in; public static PrintStream out; public static double t0; public static boolean check_line(double x1, double y1, double z1, double x2, double y2, double z2, double xp, double yp, double zp, double vs,...
Java
["4\n0 0 0\n0 10 0\n10 10 0\n10 0 0\n0 0 0\n1 1\n5 5 25", "4\n0 0 0\n0 10 0\n10 10 0\n10 0 0\n0 0 0\n1 1\n5 5 50", "1\n1 2 3\n4 5 6\n20 10\n1 2 3"]
2 seconds
["YES\n25.5000000000\n10.0000000000 4.5000000000 0.0000000000", "NO", "YES\n0.0000000000\n1.0000000000 2.0000000000 3.0000000000"]
null
Java 6
standard input
[ "binary search", "geometry" ]
6e2a8aa58ed8cd308cb482e4c24cbbbb
The first line contains a single integer n (1 ≤ n ≤ 10000). The following n + 1 lines contain the coordinates xi, yi, zi, separated by single spaces. The coordinates of any two consecutive points do not coincide. The next line contains the velocities vp and vs, the last line contains Px, Py, Pz, separated by single spa...
2,100
If Harry Potter can catch the snitch while it is moving along the polyline (including the end (xn, yn, zn)), print "YES" in the first line (without the quotes). Print in the second line t, which is the earliest moment of time, when Harry will be able to catch the snitch. On the third line print three numbers X, Y, Z, t...
standard output
PASSED
f752777a85e5142704394732f0306090
train_003.jsonl
1299340800
Brothers Fred and George Weasley once got into the sporting goods store and opened a box of Quidditch balls. After long and painful experiments they found out that the Golden Snitch is not enchanted at all. It is simply a programmed device. It always moves along the same trajectory, which is a polyline with vertices at...
256 megabytes
import java.util.*; public class c60c { private final Scanner sc; private static final boolean debug = true; static void debug(Object ... objects) { if(debug) System.err.println(Arrays.toString(objects)); } c60c() { sc = new Scanner(System.in); } ...
Java
["4\n0 0 0\n0 10 0\n10 10 0\n10 0 0\n0 0 0\n1 1\n5 5 25", "4\n0 0 0\n0 10 0\n10 10 0\n10 0 0\n0 0 0\n1 1\n5 5 50", "1\n1 2 3\n4 5 6\n20 10\n1 2 3"]
2 seconds
["YES\n25.5000000000\n10.0000000000 4.5000000000 0.0000000000", "NO", "YES\n0.0000000000\n1.0000000000 2.0000000000 3.0000000000"]
null
Java 6
standard input
[ "binary search", "geometry" ]
6e2a8aa58ed8cd308cb482e4c24cbbbb
The first line contains a single integer n (1 ≤ n ≤ 10000). The following n + 1 lines contain the coordinates xi, yi, zi, separated by single spaces. The coordinates of any two consecutive points do not coincide. The next line contains the velocities vp and vs, the last line contains Px, Py, Pz, separated by single spa...
2,100
If Harry Potter can catch the snitch while it is moving along the polyline (including the end (xn, yn, zn)), print "YES" in the first line (without the quotes). Print in the second line t, which is the earliest moment of time, when Harry will be able to catch the snitch. On the third line print three numbers X, Y, Z, t...
standard output
PASSED
a23a71ff8378edab6d7ced033d915f5d
train_003.jsonl
1299340800
Brothers Fred and George Weasley once got into the sporting goods store and opened a box of Quidditch balls. After long and painful experiments they found out that the Golden Snitch is not enchanted at all. It is simply a programmed device. It always moves along the same trajectory, which is a polyline with vertices at...
256 megabytes
import java.io.PrintWriter; import java.util.Scanner; public class C { public static void main(String[] args) { Scanner in = new Scanner(System.in); PrintWriter out = new PrintWriter(System.out); int n = in.nextInt(); int[] x = new int[n + 1]; int[] y = new int[n + 1]; ...
Java
["4\n0 0 0\n0 10 0\n10 10 0\n10 0 0\n0 0 0\n1 1\n5 5 25", "4\n0 0 0\n0 10 0\n10 10 0\n10 0 0\n0 0 0\n1 1\n5 5 50", "1\n1 2 3\n4 5 6\n20 10\n1 2 3"]
2 seconds
["YES\n25.5000000000\n10.0000000000 4.5000000000 0.0000000000", "NO", "YES\n0.0000000000\n1.0000000000 2.0000000000 3.0000000000"]
null
Java 6
standard input
[ "binary search", "geometry" ]
6e2a8aa58ed8cd308cb482e4c24cbbbb
The first line contains a single integer n (1 ≤ n ≤ 10000). The following n + 1 lines contain the coordinates xi, yi, zi, separated by single spaces. The coordinates of any two consecutive points do not coincide. The next line contains the velocities vp and vs, the last line contains Px, Py, Pz, separated by single spa...
2,100
If Harry Potter can catch the snitch while it is moving along the polyline (including the end (xn, yn, zn)), print "YES" in the first line (without the quotes). Print in the second line t, which is the earliest moment of time, when Harry will be able to catch the snitch. On the third line print three numbers X, Y, Z, t...
standard output
PASSED
3d3abedb2c2c95ff98e4bfc840368e80
train_003.jsonl
1299340800
Brothers Fred and George Weasley once got into the sporting goods store and opened a box of Quidditch balls. After long and painful experiments they found out that the Golden Snitch is not enchanted at all. It is simply a programmed device. It always moves along the same trajectory, which is a polyline with vertices at...
256 megabytes
import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; import java.io.PrintWriter; import java.util.Locale; import java.util.StringTokenizer; public class TaskC { BufferedReader br; PrintWriter out; StringTokenizer st; public static void main(String[] args) throws...
Java
["4\n0 0 0\n0 10 0\n10 10 0\n10 0 0\n0 0 0\n1 1\n5 5 25", "4\n0 0 0\n0 10 0\n10 10 0\n10 0 0\n0 0 0\n1 1\n5 5 50", "1\n1 2 3\n4 5 6\n20 10\n1 2 3"]
2 seconds
["YES\n25.5000000000\n10.0000000000 4.5000000000 0.0000000000", "NO", "YES\n0.0000000000\n1.0000000000 2.0000000000 3.0000000000"]
null
Java 6
standard input
[ "binary search", "geometry" ]
6e2a8aa58ed8cd308cb482e4c24cbbbb
The first line contains a single integer n (1 ≤ n ≤ 10000). The following n + 1 lines contain the coordinates xi, yi, zi, separated by single spaces. The coordinates of any two consecutive points do not coincide. The next line contains the velocities vp and vs, the last line contains Px, Py, Pz, separated by single spa...
2,100
If Harry Potter can catch the snitch while it is moving along the polyline (including the end (xn, yn, zn)), print "YES" in the first line (without the quotes). Print in the second line t, which is the earliest moment of time, when Harry will be able to catch the snitch. On the third line print three numbers X, Y, Z, t...
standard output
PASSED
60888cf239c6a5c507c36d7e3226f193
train_003.jsonl
1299340800
Brothers Fred and George Weasley once got into the sporting goods store and opened a box of Quidditch balls. After long and painful experiments they found out that the Golden Snitch is not enchanted at all. It is simply a programmed device. It always moves along the same trajectory, which is a polyline with vertices at...
256 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
["4\n0 0 0\n0 10 0\n10 10 0\n10 0 0\n0 0 0\n1 1\n5 5 25", "4\n0 0 0\n0 10 0\n10 10 0\n10 0 0\n0 0 0\n1 1\n5 5 50", "1\n1 2 3\n4 5 6\n20 10\n1 2 3"]
2 seconds
["YES\n25.5000000000\n10.0000000000 4.5000000000 0.0000000000", "NO", "YES\n0.0000000000\n1.0000000000 2.0000000000 3.0000000000"]
null
Java 6
standard input
[ "binary search", "geometry" ]
6e2a8aa58ed8cd308cb482e4c24cbbbb
The first line contains a single integer n (1 ≤ n ≤ 10000). The following n + 1 lines contain the coordinates xi, yi, zi, separated by single spaces. The coordinates of any two consecutive points do not coincide. The next line contains the velocities vp and vs, the last line contains Px, Py, Pz, separated by single spa...
2,100
If Harry Potter can catch the snitch while it is moving along the polyline (including the end (xn, yn, zn)), print "YES" in the first line (without the quotes). Print in the second line t, which is the earliest moment of time, when Harry will be able to catch the snitch. On the third line print three numbers X, Y, Z, t...
standard output
PASSED
575daf30256bb3fe8c3514a28cc5f753
train_003.jsonl
1299340800
Brothers Fred and George Weasley once got into the sporting goods store and opened a box of Quidditch balls. After long and painful experiments they found out that the Golden Snitch is not enchanted at all. It is simply a programmed device. It always moves along the same trajectory, which is a polyline with vertices at...
256 megabytes
import java.io.*; import java.util.*; public class C65 { public static void main(String[] args) throws IOException { BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); int n = Integer.parseInt(br.readLine()); State[] list = new State[n+1]; for(int i = 0; i <= n; i++) { StringTokenizer...
Java
["4\n0 0 0\n0 10 0\n10 10 0\n10 0 0\n0 0 0\n1 1\n5 5 25", "4\n0 0 0\n0 10 0\n10 10 0\n10 0 0\n0 0 0\n1 1\n5 5 50", "1\n1 2 3\n4 5 6\n20 10\n1 2 3"]
2 seconds
["YES\n25.5000000000\n10.0000000000 4.5000000000 0.0000000000", "NO", "YES\n0.0000000000\n1.0000000000 2.0000000000 3.0000000000"]
null
Java 6
standard input
[ "binary search", "geometry" ]
6e2a8aa58ed8cd308cb482e4c24cbbbb
The first line contains a single integer n (1 ≤ n ≤ 10000). The following n + 1 lines contain the coordinates xi, yi, zi, separated by single spaces. The coordinates of any two consecutive points do not coincide. The next line contains the velocities vp and vs, the last line contains Px, Py, Pz, separated by single spa...
2,100
If Harry Potter can catch the snitch while it is moving along the polyline (including the end (xn, yn, zn)), print "YES" in the first line (without the quotes). Print in the second line t, which is the earliest moment of time, when Harry will be able to catch the snitch. On the third line print three numbers X, Y, Z, t...
standard output
PASSED
3d90d1f5138c412ad5b2db2f01a255cc
train_003.jsonl
1299340800
Brothers Fred and George Weasley once got into the sporting goods store and opened a box of Quidditch balls. After long and painful experiments they found out that the Golden Snitch is not enchanted at all. It is simply a programmed device. It always moves along the same trajectory, which is a polyline with vertices at...
256 megabytes
import java.util.Scanner; public class C { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int n = sc.nextInt(); int[]x = new int[n+1],y = new int[n+1], z = new int[n+1]; for (int i = 0; i <= n; i++) { x[i] = sc.nextInt(); y[i]...
Java
["4\n0 0 0\n0 10 0\n10 10 0\n10 0 0\n0 0 0\n1 1\n5 5 25", "4\n0 0 0\n0 10 0\n10 10 0\n10 0 0\n0 0 0\n1 1\n5 5 50", "1\n1 2 3\n4 5 6\n20 10\n1 2 3"]
2 seconds
["YES\n25.5000000000\n10.0000000000 4.5000000000 0.0000000000", "NO", "YES\n0.0000000000\n1.0000000000 2.0000000000 3.0000000000"]
null
Java 6
standard input
[ "binary search", "geometry" ]
6e2a8aa58ed8cd308cb482e4c24cbbbb
The first line contains a single integer n (1 ≤ n ≤ 10000). The following n + 1 lines contain the coordinates xi, yi, zi, separated by single spaces. The coordinates of any two consecutive points do not coincide. The next line contains the velocities vp and vs, the last line contains Px, Py, Pz, separated by single spa...
2,100
If Harry Potter can catch the snitch while it is moving along the polyline (including the end (xn, yn, zn)), print "YES" in the first line (without the quotes). Print in the second line t, which is the earliest moment of time, when Harry will be able to catch the snitch. On the third line print three numbers X, Y, Z, t...
standard output
PASSED
609b77d43c6f66782f3b4a81a213bd1a
train_003.jsonl
1299340800
Brothers Fred and George Weasley once got into the sporting goods store and opened a box of Quidditch balls. After long and painful experiments they found out that the Golden Snitch is not enchanted at all. It is simply a programmed device. It always moves along the same trajectory, which is a polyline with vertices at...
256 megabytes
import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; import java.io.StreamTokenizer; public class C65 { static StreamTokenizer sc; public static void main(String[] args) throws IOException{ sc = new StreamTokenizer(new BufferedReader(new InputStreamReader(...
Java
["4\n0 0 0\n0 10 0\n10 10 0\n10 0 0\n0 0 0\n1 1\n5 5 25", "4\n0 0 0\n0 10 0\n10 10 0\n10 0 0\n0 0 0\n1 1\n5 5 50", "1\n1 2 3\n4 5 6\n20 10\n1 2 3"]
2 seconds
["YES\n25.5000000000\n10.0000000000 4.5000000000 0.0000000000", "NO", "YES\n0.0000000000\n1.0000000000 2.0000000000 3.0000000000"]
null
Java 6
standard input
[ "binary search", "geometry" ]
6e2a8aa58ed8cd308cb482e4c24cbbbb
The first line contains a single integer n (1 ≤ n ≤ 10000). The following n + 1 lines contain the coordinates xi, yi, zi, separated by single spaces. The coordinates of any two consecutive points do not coincide. The next line contains the velocities vp and vs, the last line contains Px, Py, Pz, separated by single spa...
2,100
If Harry Potter can catch the snitch while it is moving along the polyline (including the end (xn, yn, zn)), print "YES" in the first line (without the quotes). Print in the second line t, which is the earliest moment of time, when Harry will be able to catch the snitch. On the third line print three numbers X, Y, Z, t...
standard output
PASSED
dbfa60b782a14d6a6f594c0fa436bfb2
train_003.jsonl
1299340800
Brothers Fred and George Weasley once got into the sporting goods store and opened a box of Quidditch balls. After long and painful experiments they found out that the Golden Snitch is not enchanted at all. It is simply a programmed device. It always moves along the same trajectory, which is a polyline with vertices at...
256 megabytes
import static java.lang.Math.*; import static java.util.Arrays.*; import static java.util.Collections.*; import java.io.*; import java.math.*; import java.util.*; @SuppressWarnings("unused") public class HarryPotterandtheGoldenSnitch { public static void main(String[] args) { Scanner in = new Scanner(System.in); ...
Java
["4\n0 0 0\n0 10 0\n10 10 0\n10 0 0\n0 0 0\n1 1\n5 5 25", "4\n0 0 0\n0 10 0\n10 10 0\n10 0 0\n0 0 0\n1 1\n5 5 50", "1\n1 2 3\n4 5 6\n20 10\n1 2 3"]
2 seconds
["YES\n25.5000000000\n10.0000000000 4.5000000000 0.0000000000", "NO", "YES\n0.0000000000\n1.0000000000 2.0000000000 3.0000000000"]
null
Java 6
standard input
[ "binary search", "geometry" ]
6e2a8aa58ed8cd308cb482e4c24cbbbb
The first line contains a single integer n (1 ≤ n ≤ 10000). The following n + 1 lines contain the coordinates xi, yi, zi, separated by single spaces. The coordinates of any two consecutive points do not coincide. The next line contains the velocities vp and vs, the last line contains Px, Py, Pz, separated by single spa...
2,100
If Harry Potter can catch the snitch while it is moving along the polyline (including the end (xn, yn, zn)), print "YES" in the first line (without the quotes). Print in the second line t, which is the earliest moment of time, when Harry will be able to catch the snitch. On the third line print three numbers X, Y, Z, t...
standard output
PASSED
ea41a93093e27ab489b343c29d3f8cc1
train_003.jsonl
1299340800
Brothers Fred and George Weasley once got into the sporting goods store and opened a box of Quidditch balls. After long and painful experiments they found out that the Golden Snitch is not enchanted at all. It is simply a programmed device. It always moves along the same trajectory, which is a polyline with vertices at...
256 megabytes
import java.awt.*; import java.io.*; import java.util.*; import java.awt.geom.*; public class C { class Point { public double x,y,z; public Point(double x,double y,double z) { this.x=x; this.y=y; this.z=z; } } double eps=1e-10; ...
Java
["4\n0 0 0\n0 10 0\n10 10 0\n10 0 0\n0 0 0\n1 1\n5 5 25", "4\n0 0 0\n0 10 0\n10 10 0\n10 0 0\n0 0 0\n1 1\n5 5 50", "1\n1 2 3\n4 5 6\n20 10\n1 2 3"]
2 seconds
["YES\n25.5000000000\n10.0000000000 4.5000000000 0.0000000000", "NO", "YES\n0.0000000000\n1.0000000000 2.0000000000 3.0000000000"]
null
Java 6
standard input
[ "binary search", "geometry" ]
6e2a8aa58ed8cd308cb482e4c24cbbbb
The first line contains a single integer n (1 ≤ n ≤ 10000). The following n + 1 lines contain the coordinates xi, yi, zi, separated by single spaces. The coordinates of any two consecutive points do not coincide. The next line contains the velocities vp and vs, the last line contains Px, Py, Pz, separated by single spa...
2,100
If Harry Potter can catch the snitch while it is moving along the polyline (including the end (xn, yn, zn)), print "YES" in the first line (without the quotes). Print in the second line t, which is the earliest moment of time, when Harry will be able to catch the snitch. On the third line print three numbers X, Y, Z, t...
standard output
PASSED
f21ad3a931c529baf61aee6c740ad960
train_003.jsonl
1299340800
Brothers Fred and George Weasley once got into the sporting goods store and opened a box of Quidditch balls. After long and painful experiments they found out that the Golden Snitch is not enchanted at all. It is simply a programmed device. It always moves along the same trajectory, which is a polyline with vertices at...
256 megabytes
import java.awt.*; import java.io.*; import java.util.*; import java.awt.geom.*; public class C { double eps=1e-14; void solve() throws Exception { int n=nextInt()+1; double[][]p=new double[n][3]; for(int i=0;i<n;i++) for(int j=0;j<3;j++) p[i][j]=nextDouble()...
Java
["4\n0 0 0\n0 10 0\n10 10 0\n10 0 0\n0 0 0\n1 1\n5 5 25", "4\n0 0 0\n0 10 0\n10 10 0\n10 0 0\n0 0 0\n1 1\n5 5 50", "1\n1 2 3\n4 5 6\n20 10\n1 2 3"]
2 seconds
["YES\n25.5000000000\n10.0000000000 4.5000000000 0.0000000000", "NO", "YES\n0.0000000000\n1.0000000000 2.0000000000 3.0000000000"]
null
Java 6
standard input
[ "binary search", "geometry" ]
6e2a8aa58ed8cd308cb482e4c24cbbbb
The first line contains a single integer n (1 ≤ n ≤ 10000). The following n + 1 lines contain the coordinates xi, yi, zi, separated by single spaces. The coordinates of any two consecutive points do not coincide. The next line contains the velocities vp and vs, the last line contains Px, Py, Pz, separated by single spa...
2,100
If Harry Potter can catch the snitch while it is moving along the polyline (including the end (xn, yn, zn)), print "YES" in the first line (without the quotes). Print in the second line t, which is the earliest moment of time, when Harry will be able to catch the snitch. On the third line print three numbers X, Y, Z, t...
standard output
PASSED
942f0a7cb0e7d7f4eaa99d8c25836c4c
train_003.jsonl
1299340800
Brothers Fred and George Weasley once got into the sporting goods store and opened a box of Quidditch balls. After long and painful experiments they found out that the Golden Snitch is not enchanted at all. It is simply a programmed device. It always moves along the same trajectory, which is a polyline with vertices at...
256 megabytes
import java.awt.*; import java.io.*; import java.util.*; import java.awt.geom.*; public class C { double eps=1e-8; void solve() throws Exception { int n=nextInt()+1; double[][]p=new double[n][3]; for(int i=0;i<n;i++) for(int j=0;j<3;j++) p[i][j]=nextDouble();...
Java
["4\n0 0 0\n0 10 0\n10 10 0\n10 0 0\n0 0 0\n1 1\n5 5 25", "4\n0 0 0\n0 10 0\n10 10 0\n10 0 0\n0 0 0\n1 1\n5 5 50", "1\n1 2 3\n4 5 6\n20 10\n1 2 3"]
2 seconds
["YES\n25.5000000000\n10.0000000000 4.5000000000 0.0000000000", "NO", "YES\n0.0000000000\n1.0000000000 2.0000000000 3.0000000000"]
null
Java 6
standard input
[ "binary search", "geometry" ]
6e2a8aa58ed8cd308cb482e4c24cbbbb
The first line contains a single integer n (1 ≤ n ≤ 10000). The following n + 1 lines contain the coordinates xi, yi, zi, separated by single spaces. The coordinates of any two consecutive points do not coincide. The next line contains the velocities vp and vs, the last line contains Px, Py, Pz, separated by single spa...
2,100
If Harry Potter can catch the snitch while it is moving along the polyline (including the end (xn, yn, zn)), print "YES" in the first line (without the quotes). Print in the second line t, which is the earliest moment of time, when Harry will be able to catch the snitch. On the third line print three numbers X, Y, Z, t...
standard output
PASSED
cf01c6d0a313f62faf963dfb00b21b51
train_003.jsonl
1299340800
Brothers Fred and George Weasley once got into the sporting goods store and opened a box of Quidditch balls. After long and painful experiments they found out that the Golden Snitch is not enchanted at all. It is simply a programmed device. It always moves along the same trajectory, which is a polyline with vertices at...
256 megabytes
import java.io.BufferedReader; import java.io.InputStream; import java.io.InputStreamReader; import java.util.*; public class Main { static double eps=1e-10; static BufferedReader reader=new BufferedReader(new InputStreamReader(System.in)); static StringTokenizer stk=new StringTokenizer(""); static i...
Java
["4\n0 0 0\n0 10 0\n10 10 0\n10 0 0\n0 0 0\n1 1\n5 5 25", "4\n0 0 0\n0 10 0\n10 10 0\n10 0 0\n0 0 0\n1 1\n5 5 50", "1\n1 2 3\n4 5 6\n20 10\n1 2 3"]
2 seconds
["YES\n25.5000000000\n10.0000000000 4.5000000000 0.0000000000", "NO", "YES\n0.0000000000\n1.0000000000 2.0000000000 3.0000000000"]
null
Java 6
standard input
[ "binary search", "geometry" ]
6e2a8aa58ed8cd308cb482e4c24cbbbb
The first line contains a single integer n (1 ≤ n ≤ 10000). The following n + 1 lines contain the coordinates xi, yi, zi, separated by single spaces. The coordinates of any two consecutive points do not coincide. The next line contains the velocities vp and vs, the last line contains Px, Py, Pz, separated by single spa...
2,100
If Harry Potter can catch the snitch while it is moving along the polyline (including the end (xn, yn, zn)), print "YES" in the first line (without the quotes). Print in the second line t, which is the earliest moment of time, when Harry will be able to catch the snitch. On the third line print three numbers X, Y, Z, t...
standard output
PASSED
aa074c134f7887f1bff6f3370926b67f
train_003.jsonl
1299340800
Brothers Fred and George Weasley once got into the sporting goods store and opened a box of Quidditch balls. After long and painful experiments they found out that the Golden Snitch is not enchanted at all. It is simply a programmed device. It always moves along the same trajectory, which is a polyline with vertices at...
256 megabytes
import java.io.BufferedReader; import java.io.InputStream; import java.io.InputStreamReader; import java.util.*; public class Main { static double eps=1e-10; static BufferedReader reader=new BufferedReader(new InputStreamReader(System.in)); static StringTokenizer stk=new StringTokenizer(""); static i...
Java
["4\n0 0 0\n0 10 0\n10 10 0\n10 0 0\n0 0 0\n1 1\n5 5 25", "4\n0 0 0\n0 10 0\n10 10 0\n10 0 0\n0 0 0\n1 1\n5 5 50", "1\n1 2 3\n4 5 6\n20 10\n1 2 3"]
2 seconds
["YES\n25.5000000000\n10.0000000000 4.5000000000 0.0000000000", "NO", "YES\n0.0000000000\n1.0000000000 2.0000000000 3.0000000000"]
null
Java 6
standard input
[ "binary search", "geometry" ]
6e2a8aa58ed8cd308cb482e4c24cbbbb
The first line contains a single integer n (1 ≤ n ≤ 10000). The following n + 1 lines contain the coordinates xi, yi, zi, separated by single spaces. The coordinates of any two consecutive points do not coincide. The next line contains the velocities vp and vs, the last line contains Px, Py, Pz, separated by single spa...
2,100
If Harry Potter can catch the snitch while it is moving along the polyline (including the end (xn, yn, zn)), print "YES" in the first line (without the quotes). Print in the second line t, which is the earliest moment of time, when Harry will be able to catch the snitch. On the third line print three numbers X, Y, Z, t...
standard output
PASSED
bdfbdeada01a81df03933866f01f1cb0
train_003.jsonl
1299340800
Brothers Fred and George Weasley once got into the sporting goods store and opened a box of Quidditch balls. After long and painful experiments they found out that the Golden Snitch is not enchanted at all. It is simply a programmed device. It always moves along the same trajectory, which is a polyline with vertices at...
256 megabytes
import java.awt.*; import java.io.*; import java.util.*; import java.awt.geom.*; public class C { double eps=1e-10; void solve() throws Exception { int n=nextInt()+1; double[][]p=new double[n][3]; for(int i=0;i<n;i++) for(int j=0;j<3;j++) p[i][j]=nextDouble()...
Java
["4\n0 0 0\n0 10 0\n10 10 0\n10 0 0\n0 0 0\n1 1\n5 5 25", "4\n0 0 0\n0 10 0\n10 10 0\n10 0 0\n0 0 0\n1 1\n5 5 50", "1\n1 2 3\n4 5 6\n20 10\n1 2 3"]
2 seconds
["YES\n25.5000000000\n10.0000000000 4.5000000000 0.0000000000", "NO", "YES\n0.0000000000\n1.0000000000 2.0000000000 3.0000000000"]
null
Java 6
standard input
[ "binary search", "geometry" ]
6e2a8aa58ed8cd308cb482e4c24cbbbb
The first line contains a single integer n (1 ≤ n ≤ 10000). The following n + 1 lines contain the coordinates xi, yi, zi, separated by single spaces. The coordinates of any two consecutive points do not coincide. The next line contains the velocities vp and vs, the last line contains Px, Py, Pz, separated by single spa...
2,100
If Harry Potter can catch the snitch while it is moving along the polyline (including the end (xn, yn, zn)), print "YES" in the first line (without the quotes). Print in the second line t, which is the earliest moment of time, when Harry will be able to catch the snitch. On the third line print three numbers X, Y, Z, t...
standard output
PASSED
9e2b7c27c0b847396591a6b17e5ad5fd
train_003.jsonl
1299340800
Brothers Fred and George Weasley once got into the sporting goods store and opened a box of Quidditch balls. After long and painful experiments they found out that the Golden Snitch is not enchanted at all. It is simply a programmed device. It always moves along the same trajectory, which is a polyline with vertices at...
256 megabytes
import java.io.BufferedReader; import java.io.File; import java.io.FileReader; import java.io.IOException; import java.io.InputStreamReader; import java.io.PrintWriter; import java.util.StringTokenizer; // 15.01.2012 17:56:37 // C65 by Resurgent public class C65 { class Point { double x, y, z; Point(double x, ...
Java
["4\n0 0 0\n0 10 0\n10 10 0\n10 0 0\n0 0 0\n1 1\n5 5 25", "4\n0 0 0\n0 10 0\n10 10 0\n10 0 0\n0 0 0\n1 1\n5 5 50", "1\n1 2 3\n4 5 6\n20 10\n1 2 3"]
2 seconds
["YES\n25.5000000000\n10.0000000000 4.5000000000 0.0000000000", "NO", "YES\n0.0000000000\n1.0000000000 2.0000000000 3.0000000000"]
null
Java 6
standard input
[ "binary search", "geometry" ]
6e2a8aa58ed8cd308cb482e4c24cbbbb
The first line contains a single integer n (1 ≤ n ≤ 10000). The following n + 1 lines contain the coordinates xi, yi, zi, separated by single spaces. The coordinates of any two consecutive points do not coincide. The next line contains the velocities vp and vs, the last line contains Px, Py, Pz, separated by single spa...
2,100
If Harry Potter can catch the snitch while it is moving along the polyline (including the end (xn, yn, zn)), print "YES" in the first line (without the quotes). Print in the second line t, which is the earliest moment of time, when Harry will be able to catch the snitch. On the third line print three numbers X, Y, Z, t...
standard output
PASSED
51c5c6beecc7052b5cc44e1256745170
train_003.jsonl
1299340800
Brothers Fred and George Weasley once got into the sporting goods store and opened a box of Quidditch balls. After long and painful experiments they found out that the Golden Snitch is not enchanted at all. It is simply a programmed device. It always moves along the same trajectory, which is a polyline with vertices at...
256 megabytes
import java.lang.*; import java.math.BigInteger; import java.io.*; import java.util.*; public class Solution implements Runnable{ public static BufferedReader br; public static PrintWriter out; public static StringTokenizer stk; public static boolean isStream = true; public static void main(String...
Java
["4\n0 0 0\n0 10 0\n10 10 0\n10 0 0\n0 0 0\n1 1\n5 5 25", "4\n0 0 0\n0 10 0\n10 10 0\n10 0 0\n0 0 0\n1 1\n5 5 50", "1\n1 2 3\n4 5 6\n20 10\n1 2 3"]
2 seconds
["YES\n25.5000000000\n10.0000000000 4.5000000000 0.0000000000", "NO", "YES\n0.0000000000\n1.0000000000 2.0000000000 3.0000000000"]
null
Java 6
standard input
[ "binary search", "geometry" ]
6e2a8aa58ed8cd308cb482e4c24cbbbb
The first line contains a single integer n (1 ≤ n ≤ 10000). The following n + 1 lines contain the coordinates xi, yi, zi, separated by single spaces. The coordinates of any two consecutive points do not coincide. The next line contains the velocities vp and vs, the last line contains Px, Py, Pz, separated by single spa...
2,100
If Harry Potter can catch the snitch while it is moving along the polyline (including the end (xn, yn, zn)), print "YES" in the first line (without the quotes). Print in the second line t, which is the earliest moment of time, when Harry will be able to catch the snitch. On the third line print three numbers X, Y, Z, t...
standard output
PASSED
a0fdc6c5698672e392002b8b9e2d265e
train_003.jsonl
1299340800
Brothers Fred and George Weasley once got into the sporting goods store and opened a box of Quidditch balls. After long and painful experiments they found out that the Golden Snitch is not enchanted at all. It is simply a programmed device. It always moves along the same trajectory, which is a polyline with vertices at...
256 megabytes
import java.io.BufferedReader; import java.io.FileReader; import java.io.IOException; import java.io.InputStreamReader; import java.io.PrintWriter; import java.util.ArrayList; import java.util.Arrays; import java.util.Comparator; import java.util.Iterator; import java.util.LinkedList; import java.util.Locale; import ja...
Java
["4\n0 0 0\n0 10 0\n10 10 0\n10 0 0\n0 0 0\n1 1\n5 5 25", "4\n0 0 0\n0 10 0\n10 10 0\n10 0 0\n0 0 0\n1 1\n5 5 50", "1\n1 2 3\n4 5 6\n20 10\n1 2 3"]
2 seconds
["YES\n25.5000000000\n10.0000000000 4.5000000000 0.0000000000", "NO", "YES\n0.0000000000\n1.0000000000 2.0000000000 3.0000000000"]
null
Java 6
standard input
[ "binary search", "geometry" ]
6e2a8aa58ed8cd308cb482e4c24cbbbb
The first line contains a single integer n (1 ≤ n ≤ 10000). The following n + 1 lines contain the coordinates xi, yi, zi, separated by single spaces. The coordinates of any two consecutive points do not coincide. The next line contains the velocities vp and vs, the last line contains Px, Py, Pz, separated by single spa...
2,100
If Harry Potter can catch the snitch while it is moving along the polyline (including the end (xn, yn, zn)), print "YES" in the first line (without the quotes). Print in the second line t, which is the earliest moment of time, when Harry will be able to catch the snitch. On the third line print three numbers X, Y, Z, t...
standard output
PASSED
d8290ce114a93269f1dfefef940c4481
train_003.jsonl
1299340800
Brothers Fred and George Weasley once got into the sporting goods store and opened a box of Quidditch balls. After long and painful experiments they found out that the Golden Snitch is not enchanted at all. It is simply a programmed device. It always moves along the same trajectory, which is a polyline with vertices at...
256 megabytes
import java.io.*; import java.util.*; /** * Codeforces #65C "Harry Potter and the Golden Snitch" * @link http://codeforces.ru/problemset/problem/65/C * @author Caesar */ public class Solution65C implements Runnable { private static final int EXIT_CODE = -1; private StringTokenizer tok; private Buffer...
Java
["4\n0 0 0\n0 10 0\n10 10 0\n10 0 0\n0 0 0\n1 1\n5 5 25", "4\n0 0 0\n0 10 0\n10 10 0\n10 0 0\n0 0 0\n1 1\n5 5 50", "1\n1 2 3\n4 5 6\n20 10\n1 2 3"]
2 seconds
["YES\n25.5000000000\n10.0000000000 4.5000000000 0.0000000000", "NO", "YES\n0.0000000000\n1.0000000000 2.0000000000 3.0000000000"]
null
Java 6
standard input
[ "binary search", "geometry" ]
6e2a8aa58ed8cd308cb482e4c24cbbbb
The first line contains a single integer n (1 ≤ n ≤ 10000). The following n + 1 lines contain the coordinates xi, yi, zi, separated by single spaces. The coordinates of any two consecutive points do not coincide. The next line contains the velocities vp and vs, the last line contains Px, Py, Pz, separated by single spa...
2,100
If Harry Potter can catch the snitch while it is moving along the polyline (including the end (xn, yn, zn)), print "YES" in the first line (without the quotes). Print in the second line t, which is the earliest moment of time, when Harry will be able to catch the snitch. On the third line print three numbers X, Y, Z, t...
standard output
PASSED
f2bad129de0c64f851f9c2b35d98ef33
train_003.jsonl
1299340800
Brothers Fred and George Weasley once got into the sporting goods store and opened a box of Quidditch balls. After long and painful experiments they found out that the Golden Snitch is not enchanted at all. It is simply a programmed device. It always moves along the same trajectory, which is a polyline with vertices at...
256 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.*; p...
Java
["4\n0 0 0\n0 10 0\n10 10 0\n10 0 0\n0 0 0\n1 1\n5 5 25", "4\n0 0 0\n0 10 0\n10 10 0\n10 0 0\n0 0 0\n1 1\n5 5 50", "1\n1 2 3\n4 5 6\n20 10\n1 2 3"]
2 seconds
["YES\n25.5000000000\n10.0000000000 4.5000000000 0.0000000000", "NO", "YES\n0.0000000000\n1.0000000000 2.0000000000 3.0000000000"]
null
Java 6
standard input
[ "binary search", "geometry" ]
6e2a8aa58ed8cd308cb482e4c24cbbbb
The first line contains a single integer n (1 ≤ n ≤ 10000). The following n + 1 lines contain the coordinates xi, yi, zi, separated by single spaces. The coordinates of any two consecutive points do not coincide. The next line contains the velocities vp and vs, the last line contains Px, Py, Pz, separated by single spa...
2,100
If Harry Potter can catch the snitch while it is moving along the polyline (including the end (xn, yn, zn)), print "YES" in the first line (without the quotes). Print in the second line t, which is the earliest moment of time, when Harry will be able to catch the snitch. On the third line print three numbers X, Y, Z, t...
standard output
PASSED
5ceb752dd4b1153f2237a79893ad92a7
train_003.jsonl
1299340800
Brothers Fred and George Weasley once got into the sporting goods store and opened a box of Quidditch balls. After long and painful experiments they found out that the Golden Snitch is not enchanted at all. It is simply a programmed device. It always moves along the same trajectory, which is a polyline with vertices at...
256 megabytes
import java.io.*; import java.lang.*; import java.util.*; import java.math.*; public class Main implements Runnable{ StringTokenizer str; BufferedReader in; int nextInt() throws IOException { while(!str.hasMoreElements()) str = new StringTokenizer(in.readLine()); return Integer.parseInt...
Java
["4\n0 0 0\n0 10 0\n10 10 0\n10 0 0\n0 0 0\n1 1\n5 5 25", "4\n0 0 0\n0 10 0\n10 10 0\n10 0 0\n0 0 0\n1 1\n5 5 50", "1\n1 2 3\n4 5 6\n20 10\n1 2 3"]
2 seconds
["YES\n25.5000000000\n10.0000000000 4.5000000000 0.0000000000", "NO", "YES\n0.0000000000\n1.0000000000 2.0000000000 3.0000000000"]
null
Java 6
standard input
[ "binary search", "geometry" ]
6e2a8aa58ed8cd308cb482e4c24cbbbb
The first line contains a single integer n (1 ≤ n ≤ 10000). The following n + 1 lines contain the coordinates xi, yi, zi, separated by single spaces. The coordinates of any two consecutive points do not coincide. The next line contains the velocities vp and vs, the last line contains Px, Py, Pz, separated by single spa...
2,100
If Harry Potter can catch the snitch while it is moving along the polyline (including the end (xn, yn, zn)), print "YES" in the first line (without the quotes). Print in the second line t, which is the earliest moment of time, when Harry will be able to catch the snitch. On the third line print three numbers X, Y, Z, t...
standard output
PASSED
5b71eba0382f8749e91a27326bc0f63d
train_003.jsonl
1299340800
Brothers Fred and George Weasley once got into the sporting goods store and opened a box of Quidditch balls. After long and painful experiments they found out that the Golden Snitch is not enchanted at all. It is simply a programmed device. It always moves along the same trajectory, which is a polyline with vertices at...
256 megabytes
import java.io.*; import java.math.BigInteger; import java.util.ArrayList; import java.util.InputMismatchException; import java.util.List; /** * @author Egor Kulikov (egor@egork.net) */ public class TaskC { @SuppressWarnings({"FieldCanBeLocal", "UnusedDeclaration"}) private final InputReader in; private final Pri...
Java
["4\n0 0 0\n0 10 0\n10 10 0\n10 0 0\n0 0 0\n1 1\n5 5 25", "4\n0 0 0\n0 10 0\n10 10 0\n10 0 0\n0 0 0\n1 1\n5 5 50", "1\n1 2 3\n4 5 6\n20 10\n1 2 3"]
2 seconds
["YES\n25.5000000000\n10.0000000000 4.5000000000 0.0000000000", "NO", "YES\n0.0000000000\n1.0000000000 2.0000000000 3.0000000000"]
null
Java 6
standard input
[ "binary search", "geometry" ]
6e2a8aa58ed8cd308cb482e4c24cbbbb
The first line contains a single integer n (1 ≤ n ≤ 10000). The following n + 1 lines contain the coordinates xi, yi, zi, separated by single spaces. The coordinates of any two consecutive points do not coincide. The next line contains the velocities vp and vs, the last line contains Px, Py, Pz, separated by single spa...
2,100
If Harry Potter can catch the snitch while it is moving along the polyline (including the end (xn, yn, zn)), print "YES" in the first line (without the quotes). Print in the second line t, which is the earliest moment of time, when Harry will be able to catch the snitch. On the third line print three numbers X, Y, Z, t...
standard output
PASSED
504497c760cbd0afacb8dd22bbaafc9f
train_003.jsonl
1299340800
Brothers Fred and George Weasley once got into the sporting goods store and opened a box of Quidditch balls. After long and painful experiments they found out that the Golden Snitch is not enchanted at all. It is simply a programmed device. It always moves along the same trajectory, which is a polyline with vertices at...
256 megabytes
/* * Hello! You are trying to hack my solution, are you? =) * Don't be afraid of the size, it's just a dump of useful methods like gcd, or n-th Fib number. * And I'm just too lazy to create a new .java for every task. * And if you were successful to hack my solution, please, send me this test as a message or to Abr...
Java
["4\n0 0 0\n0 10 0\n10 10 0\n10 0 0\n0 0 0\n1 1\n5 5 25", "4\n0 0 0\n0 10 0\n10 10 0\n10 0 0\n0 0 0\n1 1\n5 5 50", "1\n1 2 3\n4 5 6\n20 10\n1 2 3"]
2 seconds
["YES\n25.5000000000\n10.0000000000 4.5000000000 0.0000000000", "NO", "YES\n0.0000000000\n1.0000000000 2.0000000000 3.0000000000"]
null
Java 6
standard input
[ "binary search", "geometry" ]
6e2a8aa58ed8cd308cb482e4c24cbbbb
The first line contains a single integer n (1 ≤ n ≤ 10000). The following n + 1 lines contain the coordinates xi, yi, zi, separated by single spaces. The coordinates of any two consecutive points do not coincide. The next line contains the velocities vp and vs, the last line contains Px, Py, Pz, separated by single spa...
2,100
If Harry Potter can catch the snitch while it is moving along the polyline (including the end (xn, yn, zn)), print "YES" in the first line (without the quotes). Print in the second line t, which is the earliest moment of time, when Harry will be able to catch the snitch. On the third line print three numbers X, Y, Z, t...
standard output
PASSED
dab2e264091c313e820caa0d3d405ffd
train_003.jsonl
1299340800
Brothers Fred and George Weasley once got into the sporting goods store and opened a box of Quidditch balls. After long and painful experiments they found out that the Golden Snitch is not enchanted at all. It is simply a programmed device. It always moves along the same trajectory, which is a polyline with vertices at...
256 megabytes
import java.io.*; import java.util.*; import java.math.*; public class Main implements Runnable { final double eps = 1e-8; double dist(double x1, double y1, double z1, double x2, double y2, double z2) { return Math.sqrt((x1 - x2) * (x1 - x2) + (y1 - y2) * (y1 - y2) + (z1 - z2) * (z1 - z2)); } private void s...
Java
["4\n0 0 0\n0 10 0\n10 10 0\n10 0 0\n0 0 0\n1 1\n5 5 25", "4\n0 0 0\n0 10 0\n10 10 0\n10 0 0\n0 0 0\n1 1\n5 5 50", "1\n1 2 3\n4 5 6\n20 10\n1 2 3"]
2 seconds
["YES\n25.5000000000\n10.0000000000 4.5000000000 0.0000000000", "NO", "YES\n0.0000000000\n1.0000000000 2.0000000000 3.0000000000"]
null
Java 6
standard input
[ "binary search", "geometry" ]
6e2a8aa58ed8cd308cb482e4c24cbbbb
The first line contains a single integer n (1 ≤ n ≤ 10000). The following n + 1 lines contain the coordinates xi, yi, zi, separated by single spaces. The coordinates of any two consecutive points do not coincide. The next line contains the velocities vp and vs, the last line contains Px, Py, Pz, separated by single spa...
2,100
If Harry Potter can catch the snitch while it is moving along the polyline (including the end (xn, yn, zn)), print "YES" in the first line (without the quotes). Print in the second line t, which is the earliest moment of time, when Harry will be able to catch the snitch. On the third line print three numbers X, Y, Z, t...
standard output
PASSED
d6db9276c0c016732e2f3a6914709fce
train_003.jsonl
1299340800
Brothers Fred and George Weasley once got into the sporting goods store and opened a box of Quidditch balls. After long and painful experiments they found out that the Golden Snitch is not enchanted at all. It is simply a programmed device. It always moves along the same trajectory, which is a polyline with vertices at...
256 megabytes
import java.io.BufferedReader; import java.io.InputStreamReader; public class C { static double dist(double[] a, double[] b) { double sum = 0; for (int j = 0; j < 3; ++j) { double dx = a[j] - b[j]; sum += dx*dx; } return Math.sqrt(sum); } public static void main(String[] args) throws Exception {...
Java
["4\n0 0 0\n0 10 0\n10 10 0\n10 0 0\n0 0 0\n1 1\n5 5 25", "4\n0 0 0\n0 10 0\n10 10 0\n10 0 0\n0 0 0\n1 1\n5 5 50", "1\n1 2 3\n4 5 6\n20 10\n1 2 3"]
2 seconds
["YES\n25.5000000000\n10.0000000000 4.5000000000 0.0000000000", "NO", "YES\n0.0000000000\n1.0000000000 2.0000000000 3.0000000000"]
null
Java 6
standard input
[ "binary search", "geometry" ]
6e2a8aa58ed8cd308cb482e4c24cbbbb
The first line contains a single integer n (1 ≤ n ≤ 10000). The following n + 1 lines contain the coordinates xi, yi, zi, separated by single spaces. The coordinates of any two consecutive points do not coincide. The next line contains the velocities vp and vs, the last line contains Px, Py, Pz, separated by single spa...
2,100
If Harry Potter can catch the snitch while it is moving along the polyline (including the end (xn, yn, zn)), print "YES" in the first line (without the quotes). Print in the second line t, which is the earliest moment of time, when Harry will be able to catch the snitch. On the third line print three numbers X, Y, Z, t...
standard output
PASSED
5a1832b4c398d1cfcab7cddc2cebfcdb
train_003.jsonl
1299340800
Brothers Fred and George Weasley once got into the sporting goods store and opened a box of Quidditch balls. After long and painful experiments they found out that the Golden Snitch is not enchanted at all. It is simply a programmed device. It always moves along the same trajectory, which is a polyline with vertices at...
256 megabytes
import java.io.*; import java.util.*; import java.math.*; import static java.lang.Math.*; public class Main implements Runnable { int[] x,y,z; int vp, vs; int px, py, pz; double btw(double x1, double y1, double z1, double x2, double y2, double z2) { double dx = x1 - x2; double dy = y...
Java
["4\n0 0 0\n0 10 0\n10 10 0\n10 0 0\n0 0 0\n1 1\n5 5 25", "4\n0 0 0\n0 10 0\n10 10 0\n10 0 0\n0 0 0\n1 1\n5 5 50", "1\n1 2 3\n4 5 6\n20 10\n1 2 3"]
2 seconds
["YES\n25.5000000000\n10.0000000000 4.5000000000 0.0000000000", "NO", "YES\n0.0000000000\n1.0000000000 2.0000000000 3.0000000000"]
null
Java 6
standard input
[ "binary search", "geometry" ]
6e2a8aa58ed8cd308cb482e4c24cbbbb
The first line contains a single integer n (1 ≤ n ≤ 10000). The following n + 1 lines contain the coordinates xi, yi, zi, separated by single spaces. The coordinates of any two consecutive points do not coincide. The next line contains the velocities vp and vs, the last line contains Px, Py, Pz, separated by single spa...
2,100
If Harry Potter can catch the snitch while it is moving along the polyline (including the end (xn, yn, zn)), print "YES" in the first line (without the quotes). Print in the second line t, which is the earliest moment of time, when Harry will be able to catch the snitch. On the third line print three numbers X, Y, Z, t...
standard output
PASSED
6eba3688b86dc4bb35783a9689f960b8
train_003.jsonl
1299340800
Brothers Fred and George Weasley once got into the sporting goods store and opened a box of Quidditch balls. After long and painful experiments they found out that the Golden Snitch is not enchanted at all. It is simply a programmed device. It always moves along the same trajectory, which is a polyline with vertices at...
256 megabytes
import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; import java.util.StringTokenizer; public class HarryPotterandtheGoldenSnitch { static class Scanner{ BufferedReader br=null; StringTokenizer tk=null; public Scanner(){ br=new BufferedReader(new InputStreamReader(S...
Java
["4\n0 0 0\n0 10 0\n10 10 0\n10 0 0\n0 0 0\n1 1\n5 5 25", "4\n0 0 0\n0 10 0\n10 10 0\n10 0 0\n0 0 0\n1 1\n5 5 50", "1\n1 2 3\n4 5 6\n20 10\n1 2 3"]
2 seconds
["YES\n25.5000000000\n10.0000000000 4.5000000000 0.0000000000", "NO", "YES\n0.0000000000\n1.0000000000 2.0000000000 3.0000000000"]
null
Java 6
standard input
[ "binary search", "geometry" ]
6e2a8aa58ed8cd308cb482e4c24cbbbb
The first line contains a single integer n (1 ≤ n ≤ 10000). The following n + 1 lines contain the coordinates xi, yi, zi, separated by single spaces. The coordinates of any two consecutive points do not coincide. The next line contains the velocities vp and vs, the last line contains Px, Py, Pz, separated by single spa...
2,100
If Harry Potter can catch the snitch while it is moving along the polyline (including the end (xn, yn, zn)), print "YES" in the first line (without the quotes). Print in the second line t, which is the earliest moment of time, when Harry will be able to catch the snitch. On the third line print three numbers X, Y, Z, t...
standard output
PASSED
a05a884523af0602177a69e9c009fd9b
train_003.jsonl
1299340800
Brothers Fred and George Weasley once got into the sporting goods store and opened a box of Quidditch balls. After long and painful experiments they found out that the Golden Snitch is not enchanted at all. It is simply a programmed device. It always moves along the same trajectory, which is a polyline with vertices at...
256 megabytes
import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; import java.util.StringTokenizer; public class HarryPotterandtheGoldenSnitch { static class Scanner{ BufferedReader br=null; StringTokenizer tk=null; public Scanner(){ br=new BufferedReader(new InputStreamReader(S...
Java
["4\n0 0 0\n0 10 0\n10 10 0\n10 0 0\n0 0 0\n1 1\n5 5 25", "4\n0 0 0\n0 10 0\n10 10 0\n10 0 0\n0 0 0\n1 1\n5 5 50", "1\n1 2 3\n4 5 6\n20 10\n1 2 3"]
2 seconds
["YES\n25.5000000000\n10.0000000000 4.5000000000 0.0000000000", "NO", "YES\n0.0000000000\n1.0000000000 2.0000000000 3.0000000000"]
null
Java 6
standard input
[ "binary search", "geometry" ]
6e2a8aa58ed8cd308cb482e4c24cbbbb
The first line contains a single integer n (1 ≤ n ≤ 10000). The following n + 1 lines contain the coordinates xi, yi, zi, separated by single spaces. The coordinates of any two consecutive points do not coincide. The next line contains the velocities vp and vs, the last line contains Px, Py, Pz, separated by single spa...
2,100
If Harry Potter can catch the snitch while it is moving along the polyline (including the end (xn, yn, zn)), print "YES" in the first line (without the quotes). Print in the second line t, which is the earliest moment of time, when Harry will be able to catch the snitch. On the third line print three numbers X, Y, Z, t...
standard output
PASSED
7b1c4baa2d26cc99a2b53e523871cc81
train_003.jsonl
1299340800
Brothers Fred and George Weasley once got into the sporting goods store and opened a box of Quidditch balls. After long and painful experiments they found out that the Golden Snitch is not enchanted at all. It is simply a programmed device. It always moves along the same trajectory, which is a polyline with vertices at...
256 megabytes
import java.io.*; import java.util.*; import java.math.*; public class C implements Runnable { static class Point { double x; double y; double z; public Point(int x, int y, int z) { super(); this.x = x; this.y = y; this.z = z; } public Point(double x, double y, double z) { super(); th...
Java
["4\n0 0 0\n0 10 0\n10 10 0\n10 0 0\n0 0 0\n1 1\n5 5 25", "4\n0 0 0\n0 10 0\n10 10 0\n10 0 0\n0 0 0\n1 1\n5 5 50", "1\n1 2 3\n4 5 6\n20 10\n1 2 3"]
2 seconds
["YES\n25.5000000000\n10.0000000000 4.5000000000 0.0000000000", "NO", "YES\n0.0000000000\n1.0000000000 2.0000000000 3.0000000000"]
null
Java 6
standard input
[ "binary search", "geometry" ]
6e2a8aa58ed8cd308cb482e4c24cbbbb
The first line contains a single integer n (1 ≤ n ≤ 10000). The following n + 1 lines contain the coordinates xi, yi, zi, separated by single spaces. The coordinates of any two consecutive points do not coincide. The next line contains the velocities vp and vs, the last line contains Px, Py, Pz, separated by single spa...
2,100
If Harry Potter can catch the snitch while it is moving along the polyline (including the end (xn, yn, zn)), print "YES" in the first line (without the quotes). Print in the second line t, which is the earliest moment of time, when Harry will be able to catch the snitch. On the third line print three numbers X, Y, Z, t...
standard output