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 | 056777dab7de2e9a4db79cc78229f1ab | train_002.jsonl | 1325689200 | As meticulous Gerald sets the table and caring Alexander sends the postcards, Sergey makes snowmen. Each showman should consist of three snowballs: a big one, a medium one and a small one. Sergey's twins help him: they've already made n snowballs with radii equal to r1, r2, ..., rn. To make a snowman, one needs any thr... | 256 megabytes | import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.util.Arrays;
import java.util.StringTokenizer;
public class C implements Runnable{
BufferedReader in;
PrintWriter out;
StringTokenizer Tokenizer;
private boolea... | Java | ["7\n1 2 3 4 5 6 7", "3\n2 2 3"] | 2 seconds | ["2\n3 2 1\n6 5 4", "0"] | null | Java 6 | standard input | [
"data structures",
"binary search",
"greedy"
] | 551e66a4b3da71682652d84313adb8ab | The first line contains integer n (1ββ€βnββ€β105) β the number of snowballs. The next line contains n integers β the balls' radii r1, r2, ..., rn (1ββ€βriββ€β109). The balls' radii can coincide. | 1,800 | Print on the first line a single number k β the maximum number of the snowmen. Next k lines should contain the snowmen's descriptions. The description of each snowman should consist of three space-separated numbers β the big ball's radius, the medium ball's radius and the small ball's radius. It is allowed to print the... | standard output | |
PASSED | ea74863e956735142ac0f358febbdaa1 | train_002.jsonl | 1325689200 | As meticulous Gerald sets the table and caring Alexander sends the postcards, Sergey makes snowmen. Each showman should consist of three snowballs: a big one, a medium one and a small one. Sergey's twins help him: they've already made n snowballs with radii equal to r1, r2, ..., rn. To make a snowman, one needs any thr... | 256 megabytes | import java.io.File;
import java.io.FileNotFoundException;
import java.io.PrintWriter;
import java.util.*;
import java.util.regex.*;
import java.text.*;
import java.math.*;
import java.awt.HeadlessException;
import java.awt.geom.*;
public class C {
public static final boolean debug = false;
void pln(Object o) {Syst... | Java | ["7\n1 2 3 4 5 6 7", "3\n2 2 3"] | 2 seconds | ["2\n3 2 1\n6 5 4", "0"] | null | Java 6 | standard input | [
"data structures",
"binary search",
"greedy"
] | 551e66a4b3da71682652d84313adb8ab | The first line contains integer n (1ββ€βnββ€β105) β the number of snowballs. The next line contains n integers β the balls' radii r1, r2, ..., rn (1ββ€βriββ€β109). The balls' radii can coincide. | 1,800 | Print on the first line a single number k β the maximum number of the snowmen. Next k lines should contain the snowmen's descriptions. The description of each snowman should consist of three space-separated numbers β the big ball's radius, the medium ball's radius and the small ball's radius. It is allowed to print the... | standard output | |
PASSED | a9d2ffcd64281ec3d758d1ff9b70f346 | train_002.jsonl | 1325689200 | As meticulous Gerald sets the table and caring Alexander sends the postcards, Sergey makes snowmen. Each showman should consist of three snowballs: a big one, a medium one and a small one. Sergey's twins help him: they've already made n snowballs with radii equal to r1, r2, ..., rn. To make a snowman, one needs any thr... | 256 megabytes | import java.util.Map.Entry;
import java.util.*;
import java.io.*;
import static java.lang.Math.*;
public class Main {
BufferedReader in;
StringTokenizer st;
PrintWriter out;
static class Pair implements Comparable<Pair> {
int cnt, value;
public Pair(int cnt, int value) {
... | Java | ["7\n1 2 3 4 5 6 7", "3\n2 2 3"] | 2 seconds | ["2\n3 2 1\n6 5 4", "0"] | null | Java 6 | standard input | [
"data structures",
"binary search",
"greedy"
] | 551e66a4b3da71682652d84313adb8ab | The first line contains integer n (1ββ€βnββ€β105) β the number of snowballs. The next line contains n integers β the balls' radii r1, r2, ..., rn (1ββ€βriββ€β109). The balls' radii can coincide. | 1,800 | Print on the first line a single number k β the maximum number of the snowmen. Next k lines should contain the snowmen's descriptions. The description of each snowman should consist of three space-separated numbers β the big ball's radius, the medium ball's radius and the small ball's radius. It is allowed to print the... | standard output | |
PASSED | 0507f8a8d0d561eb2640449ac6420104 | train_002.jsonl | 1325689200 | As meticulous Gerald sets the table and caring Alexander sends the postcards, Sergey makes snowmen. Each showman should consist of three snowballs: a big one, a medium one and a small one. Sergey's twins help him: they've already made n snowballs with radii equal to r1, r2, ..., rn. To make a snowman, one needs any thr... | 256 megabytes | import java.util.*;
import java.io.*;
import java.awt.Point;
import static java.lang.Math.*;
public class P140C {
public static void main(String[] args) throws Exception {
Scanner in = new Scanner(System.in);
int n = in.nextInt();
int[] data = new int[n];
for(int i=0; i<n; i++)
... | Java | ["7\n1 2 3 4 5 6 7", "3\n2 2 3"] | 2 seconds | ["2\n3 2 1\n6 5 4", "0"] | null | Java 6 | standard input | [
"data structures",
"binary search",
"greedy"
] | 551e66a4b3da71682652d84313adb8ab | The first line contains integer n (1ββ€βnββ€β105) β the number of snowballs. The next line contains n integers β the balls' radii r1, r2, ..., rn (1ββ€βriββ€β109). The balls' radii can coincide. | 1,800 | Print on the first line a single number k β the maximum number of the snowmen. Next k lines should contain the snowmen's descriptions. The description of each snowman should consist of three space-separated numbers β the big ball's radius, the medium ball's radius and the small ball's radius. It is allowed to print the... | standard output | |
PASSED | 2a585dae6d3825ff05b2636295c1a013 | train_002.jsonl | 1325689200 | As meticulous Gerald sets the table and caring Alexander sends the postcards, Sergey makes snowmen. Each showman should consist of three snowballs: a big one, a medium one and a small one. Sergey's twins help him: they've already made n snowballs with radii equal to r1, r2, ..., rn. To make a snowman, one needs any thr... | 256 megabytes | import java.util.*;
public class c {
public static void main(String args[])
{
Scanner in = new Scanner(System.in);
int N = in.nextInt();
ArrayList<Integer> list = new ArrayList<Integer>();
ArrayList<Ball> snowballs = new ArrayList<Ball>();
for(int i = 0; i < N; i++)
{
list.add(in.nextInt());
}
... | Java | ["7\n1 2 3 4 5 6 7", "3\n2 2 3"] | 2 seconds | ["2\n3 2 1\n6 5 4", "0"] | null | Java 6 | standard input | [
"data structures",
"binary search",
"greedy"
] | 551e66a4b3da71682652d84313adb8ab | The first line contains integer n (1ββ€βnββ€β105) β the number of snowballs. The next line contains n integers β the balls' radii r1, r2, ..., rn (1ββ€βriββ€β109). The balls' radii can coincide. | 1,800 | Print on the first line a single number k β the maximum number of the snowmen. Next k lines should contain the snowmen's descriptions. The description of each snowman should consist of three space-separated numbers β the big ball's radius, the medium ball's radius and the small ball's radius. It is allowed to print the... | standard output | |
PASSED | 54c5ea50def3cfff4f8a9b7eb1f52b6b | train_002.jsonl | 1325689200 | As meticulous Gerald sets the table and caring Alexander sends the postcards, Sergey makes snowmen. Each showman should consist of three snowballs: a big one, a medium one and a small one. Sergey's twins help him: they've already made n snowballs with radii equal to r1, r2, ..., rn. To make a snowman, one needs any thr... | 256 megabytes | import java.lang.*;
import java.awt.geom.Line2D;
import java.io.*;
import java.util.*;
import java.math.*;
public class C implements Runnable{
class Val implements Comparable<Val> {
int cnt, sz;
public Val(int cnt, int sz) {
this.cnt = cnt;
this.sz = sz;
}
... | Java | ["7\n1 2 3 4 5 6 7", "3\n2 2 3"] | 2 seconds | ["2\n3 2 1\n6 5 4", "0"] | null | Java 6 | standard input | [
"data structures",
"binary search",
"greedy"
] | 551e66a4b3da71682652d84313adb8ab | The first line contains integer n (1ββ€βnββ€β105) β the number of snowballs. The next line contains n integers β the balls' radii r1, r2, ..., rn (1ββ€βriββ€β109). The balls' radii can coincide. | 1,800 | Print on the first line a single number k β the maximum number of the snowmen. Next k lines should contain the snowmen's descriptions. The description of each snowman should consist of three space-separated numbers β the big ball's radius, the medium ball's radius and the small ball's radius. It is allowed to print the... | standard output | |
PASSED | 808172288ebd5be364de84642a097f1d | train_002.jsonl | 1325689200 | As meticulous Gerald sets the table and caring Alexander sends the postcards, Sergey makes snowmen. Each showman should consist of three snowballs: a big one, a medium one and a small one. Sergey's twins help him: they've already made n snowballs with radii equal to r1, r2, ..., rn. To make a snowman, one needs any thr... | 256 megabytes | import java.util.List;
import java.io.IOException;
import java.util.Arrays;
import java.util.PriorityQueue;
import java.util.InputMismatchException;
import java.util.ArrayList;
import java.io.OutputStream;
import java.io.PrintWriter;
import java.io.Writer;
import java.math.BigInteger;
import java.io.InputStream;
/**
... | Java | ["7\n1 2 3 4 5 6 7", "3\n2 2 3"] | 2 seconds | ["2\n3 2 1\n6 5 4", "0"] | null | Java 6 | standard input | [
"data structures",
"binary search",
"greedy"
] | 551e66a4b3da71682652d84313adb8ab | The first line contains integer n (1ββ€βnββ€β105) β the number of snowballs. The next line contains n integers β the balls' radii r1, r2, ..., rn (1ββ€βriββ€β109). The balls' radii can coincide. | 1,800 | Print on the first line a single number k β the maximum number of the snowmen. Next k lines should contain the snowmen's descriptions. The description of each snowman should consist of three space-separated numbers β the big ball's radius, the medium ball's radius and the small ball's radius. It is allowed to print the... | standard output | |
PASSED | 2e944eddc7e66e154c72940980286bc1 | train_002.jsonl | 1408116600 | Pashmak has fallen in love with an attractive girl called Parmida since one year ago...Today, Pashmak set up a meeting with his partner in a romantic garden. Unfortunately, Pashmak has forgotten where the garden is. But he remembers that the garden looks like a square with sides parallel to the coordinate axes. He also... | 256 megabytes | import java.util.Scanner;
public class _459A {
public static void main(String[] args) {
Scanner s = new Scanner(System.in);
int x1 = s.nextInt(), y1 = s.nextInt(), x2 = s.nextInt(), y2 = s.nextInt();
int dx = Math.abs(x1 - x2), dy = Math.abs(y1 - y2);
if (x1 == x2)
System... | Java | ["0 0 0 1", "0 0 1 1", "0 0 1 2"] | 1 second | ["1 0 1 1", "0 1 1 0", "-1"] | null | Java 8 | standard input | [
"implementation"
] | 71dea31e1244797f916adf5f526f776e | The first line contains four space-separated x1,βy1,βx2,βy2 (β-β100ββ€βx1,βy1,βx2,βy2ββ€β100) integers, where x1 and y1 are coordinates of the first tree and x2 and y2 are coordinates of the second tree. It's guaranteed that the given points are distinct. | 1,200 | If there is no solution to the problem, print -1. Otherwise print four space-separated integers x3,βy3,βx4,βy4 that correspond to the coordinates of the two other trees. If there are several solutions you can output any of them. Note that x3,βy3,βx4,βy4 must be in the range (β-β1000ββ€βx3,βy3,βx4,βy4ββ€β1000). | standard output | |
PASSED | 75d9024915fcc785d52976ad739e29f7 | train_002.jsonl | 1408116600 | Pashmak has fallen in love with an attractive girl called Parmida since one year ago...Today, Pashmak set up a meeting with his partner in a romantic garden. Unfortunately, Pashmak has forgotten where the garden is. But he remembers that the garden looks like a square with sides parallel to the coordinate axes. He also... | 256 megabytes | import java.util.Scanner;
public class Main {
public static void main(String[] args) {
Scanner leer=new Scanner(System.in);
while(leer.hasNext())
{
int x1=leer.nextInt();
int y1=leer.nextInt();
int x2=leer.nextInt();
int y2=leer.nextInt();
int l=0;
if(y1==y2)
{
if(x1>0 && x2<0 || x1<... | Java | ["0 0 0 1", "0 0 1 1", "0 0 1 2"] | 1 second | ["1 0 1 1", "0 1 1 0", "-1"] | null | Java 8 | standard input | [
"implementation"
] | 71dea31e1244797f916adf5f526f776e | The first line contains four space-separated x1,βy1,βx2,βy2 (β-β100ββ€βx1,βy1,βx2,βy2ββ€β100) integers, where x1 and y1 are coordinates of the first tree and x2 and y2 are coordinates of the second tree. It's guaranteed that the given points are distinct. | 1,200 | If there is no solution to the problem, print -1. Otherwise print four space-separated integers x3,βy3,βx4,βy4 that correspond to the coordinates of the two other trees. If there are several solutions you can output any of them. Note that x3,βy3,βx4,βy4 must be in the range (β-β1000ββ€βx3,βy3,βx4,βy4ββ€β1000). | standard output | |
PASSED | e46c07c9fa01d805c29cf091eee20b9d | train_002.jsonl | 1408116600 | Pashmak has fallen in love with an attractive girl called Parmida since one year ago...Today, Pashmak set up a meeting with his partner in a romantic garden. Unfortunately, Pashmak has forgotten where the garden is. But he remembers that the garden looks like a square with sides parallel to the coordinate axes. He also... | 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.util.ArrayList;
import java.io.InputStream;
/**
* Built using CHelper plug-in
* Actual solution is at the top
*
* @autho... | Java | ["0 0 0 1", "0 0 1 1", "0 0 1 2"] | 1 second | ["1 0 1 1", "0 1 1 0", "-1"] | null | Java 8 | standard input | [
"implementation"
] | 71dea31e1244797f916adf5f526f776e | The first line contains four space-separated x1,βy1,βx2,βy2 (β-β100ββ€βx1,βy1,βx2,βy2ββ€β100) integers, where x1 and y1 are coordinates of the first tree and x2 and y2 are coordinates of the second tree. It's guaranteed that the given points are distinct. | 1,200 | If there is no solution to the problem, print -1. Otherwise print four space-separated integers x3,βy3,βx4,βy4 that correspond to the coordinates of the two other trees. If there are several solutions you can output any of them. Note that x3,βy3,βx4,βy4 must be in the range (β-β1000ββ€βx3,βy3,βx4,βy4ββ€β1000). | standard output | |
PASSED | fd9955c5cc153ebde3d25b73e1fb8bc9 | train_002.jsonl | 1408116600 | Pashmak has fallen in love with an attractive girl called Parmida since one year ago...Today, Pashmak set up a meeting with his partner in a romantic garden. Unfortunately, Pashmak has forgotten where the garden is. But he remembers that the garden looks like a square with sides parallel to the coordinate axes. He also... | 256 megabytes | import java.io.*;
import java.util.*;
import java.lang .*;
public class Main{
public static void main(String args[])
{
Scanner sc= new Scanner(System.in);
int x1= sc.nextInt();
int y1= sc.nextInt();
int x2= sc.nextInt();
int y2= sc.nextInt();
int u=Math.abs(x1-y... | Java | ["0 0 0 1", "0 0 1 1", "0 0 1 2"] | 1 second | ["1 0 1 1", "0 1 1 0", "-1"] | null | Java 8 | standard input | [
"implementation"
] | 71dea31e1244797f916adf5f526f776e | The first line contains four space-separated x1,βy1,βx2,βy2 (β-β100ββ€βx1,βy1,βx2,βy2ββ€β100) integers, where x1 and y1 are coordinates of the first tree and x2 and y2 are coordinates of the second tree. It's guaranteed that the given points are distinct. | 1,200 | If there is no solution to the problem, print -1. Otherwise print four space-separated integers x3,βy3,βx4,βy4 that correspond to the coordinates of the two other trees. If there are several solutions you can output any of them. Note that x3,βy3,βx4,βy4 must be in the range (β-β1000ββ€βx3,βy3,βx4,βy4ββ€β1000). | standard output | |
PASSED | 10d07d7778c03d5635d8af7b7ff3061c | train_002.jsonl | 1408116600 | Pashmak has fallen in love with an attractive girl called Parmida since one year ago...Today, Pashmak set up a meeting with his partner in a romantic garden. Unfortunately, Pashmak has forgotten where the garden is. But he remembers that the garden looks like a square with sides parallel to the coordinate axes. He also... | 256 megabytes | import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.StringTokenizer;
public class One1 {
public static void main(String[] args)throws IOException
{
BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
StringTokenizer st = new StringTo... | Java | ["0 0 0 1", "0 0 1 1", "0 0 1 2"] | 1 second | ["1 0 1 1", "0 1 1 0", "-1"] | null | Java 8 | standard input | [
"implementation"
] | 71dea31e1244797f916adf5f526f776e | The first line contains four space-separated x1,βy1,βx2,βy2 (β-β100ββ€βx1,βy1,βx2,βy2ββ€β100) integers, where x1 and y1 are coordinates of the first tree and x2 and y2 are coordinates of the second tree. It's guaranteed that the given points are distinct. | 1,200 | If there is no solution to the problem, print -1. Otherwise print four space-separated integers x3,βy3,βx4,βy4 that correspond to the coordinates of the two other trees. If there are several solutions you can output any of them. Note that x3,βy3,βx4,βy4 must be in the range (β-β1000ββ€βx3,βy3,βx4,βy4ββ€β1000). | standard output | |
PASSED | 5e6a96cc9769ebdea5cdd560abe34611 | train_002.jsonl | 1408116600 | Pashmak has fallen in love with an attractive girl called Parmida since one year ago...Today, Pashmak set up a meeting with his partner in a romantic garden. Unfortunately, Pashmak has forgotten where the garden is. But he remembers that the garden looks like a square with sides parallel to the coordinate axes. He also... | 256 megabytes | import org.omg.CORBA.MARSHAL;
import java.util.Scanner;
/**
* Created by acer on 4/15/2017.
*/
public class Codeforces_459A {
public static void main(String[] args){
Scanner p = new Scanner(System.in);
String[] n = p.nextLine().split(" ");
double x3 = 0,x4 = 0,y3 = 0,y4 = 0;
int ... | Java | ["0 0 0 1", "0 0 1 1", "0 0 1 2"] | 1 second | ["1 0 1 1", "0 1 1 0", "-1"] | null | Java 8 | standard input | [
"implementation"
] | 71dea31e1244797f916adf5f526f776e | The first line contains four space-separated x1,βy1,βx2,βy2 (β-β100ββ€βx1,βy1,βx2,βy2ββ€β100) integers, where x1 and y1 are coordinates of the first tree and x2 and y2 are coordinates of the second tree. It's guaranteed that the given points are distinct. | 1,200 | If there is no solution to the problem, print -1. Otherwise print four space-separated integers x3,βy3,βx4,βy4 that correspond to the coordinates of the two other trees. If there are several solutions you can output any of them. Note that x3,βy3,βx4,βy4 must be in the range (β-β1000ββ€βx3,βy3,βx4,βy4ββ€β1000). | standard output | |
PASSED | 41712ae51751b03530317cd587a45002 | train_002.jsonl | 1408116600 | Pashmak has fallen in love with an attractive girl called Parmida since one year ago...Today, Pashmak set up a meeting with his partner in a romantic garden. Unfortunately, Pashmak has forgotten where the garden is. But he remembers that the garden looks like a square with sides parallel to the coordinate axes. He also... | 256 megabytes | import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.util.StringTokenizer;
public class _11PashmakAndGarden {
public static void main(String[] args) {
FastInput input = new FastInput();
PrintWriter output = new PrintWri... | Java | ["0 0 0 1", "0 0 1 1", "0 0 1 2"] | 1 second | ["1 0 1 1", "0 1 1 0", "-1"] | null | Java 8 | standard input | [
"implementation"
] | 71dea31e1244797f916adf5f526f776e | The first line contains four space-separated x1,βy1,βx2,βy2 (β-β100ββ€βx1,βy1,βx2,βy2ββ€β100) integers, where x1 and y1 are coordinates of the first tree and x2 and y2 are coordinates of the second tree. It's guaranteed that the given points are distinct. | 1,200 | If there is no solution to the problem, print -1. Otherwise print four space-separated integers x3,βy3,βx4,βy4 that correspond to the coordinates of the two other trees. If there are several solutions you can output any of them. Note that x3,βy3,βx4,βy4 must be in the range (β-β1000ββ€βx3,βy3,βx4,βy4ββ€β1000). | standard output | |
PASSED | 677fcd87e804e1d0c4834bee311b10f6 | train_002.jsonl | 1408116600 | Pashmak has fallen in love with an attractive girl called Parmida since one year ago...Today, Pashmak set up a meeting with his partner in a romantic garden. Unfortunately, Pashmak has forgotten where the garden is. But he remembers that the garden looks like a square with sides parallel to the coordinate axes. He also... | 256 megabytes | import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.util.StringTokenizer;
public class _11PashmakAndGarden {
public static void main(String[] args) {
FastInput input = new FastInput();
PrintWriter output = new PrintWri... | Java | ["0 0 0 1", "0 0 1 1", "0 0 1 2"] | 1 second | ["1 0 1 1", "0 1 1 0", "-1"] | null | Java 8 | standard input | [
"implementation"
] | 71dea31e1244797f916adf5f526f776e | The first line contains four space-separated x1,βy1,βx2,βy2 (β-β100ββ€βx1,βy1,βx2,βy2ββ€β100) integers, where x1 and y1 are coordinates of the first tree and x2 and y2 are coordinates of the second tree. It's guaranteed that the given points are distinct. | 1,200 | If there is no solution to the problem, print -1. Otherwise print four space-separated integers x3,βy3,βx4,βy4 that correspond to the coordinates of the two other trees. If there are several solutions you can output any of them. Note that x3,βy3,βx4,βy4 must be in the range (β-β1000ββ€βx3,βy3,βx4,βy4ββ€β1000). | standard output | |
PASSED | 0f79c3cdfdaa0e2709702e1996a968d5 | train_002.jsonl | 1408116600 | Pashmak has fallen in love with an attractive girl called Parmida since one year ago...Today, Pashmak set up a meeting with his partner in a romantic garden. Unfortunately, Pashmak has forgotten where the garden is. But he remembers that the garden looks like a square with sides parallel to the coordinate axes. He also... | 256 megabytes | import java.util.*;
public class CodeForces
{
public static void main(String args[])
{
Scanner sc=new Scanner(System.in);
int x1=sc.nextInt();
int y1=sc.nextInt();
int x2=sc.nextInt();
int y2=sc.nextInt();
double distance=Math.sqrt((x2-x1)*(x2-x1)+(y2-y1)*(y2-y1)... | Java | ["0 0 0 1", "0 0 1 1", "0 0 1 2"] | 1 second | ["1 0 1 1", "0 1 1 0", "-1"] | null | Java 8 | standard input | [
"implementation"
] | 71dea31e1244797f916adf5f526f776e | The first line contains four space-separated x1,βy1,βx2,βy2 (β-β100ββ€βx1,βy1,βx2,βy2ββ€β100) integers, where x1 and y1 are coordinates of the first tree and x2 and y2 are coordinates of the second tree. It's guaranteed that the given points are distinct. | 1,200 | If there is no solution to the problem, print -1. Otherwise print four space-separated integers x3,βy3,βx4,βy4 that correspond to the coordinates of the two other trees. If there are several solutions you can output any of them. Note that x3,βy3,βx4,βy4 must be in the range (β-β1000ββ€βx3,βy3,βx4,βy4ββ€β1000). | standard output | |
PASSED | 11055ae6dae7b5b097954cea8efa2e7e | train_002.jsonl | 1408116600 | Pashmak has fallen in love with an attractive girl called Parmida since one year ago...Today, Pashmak set up a meeting with his partner in a romantic garden. Unfortunately, Pashmak has forgotten where the garden is. But he remembers that the garden looks like a square with sides parallel to the coordinate axes. He also... | 256 megabytes | import java.util.*;
import java.io.*;
public class Codechef
{
public static void main(String [] args)
{
Scanner s=new Scanner(System.in);
//int T=s.nextInt();
int T=1;
while(T-->0)
{
int x1=s.nextInt();
int y1=s.nextInt();
int x2=s.nextInt();
int y2=s.nextInt();
int a=Math.max(Math.abs(x2-x... | Java | ["0 0 0 1", "0 0 1 1", "0 0 1 2"] | 1 second | ["1 0 1 1", "0 1 1 0", "-1"] | null | Java 8 | standard input | [
"implementation"
] | 71dea31e1244797f916adf5f526f776e | The first line contains four space-separated x1,βy1,βx2,βy2 (β-β100ββ€βx1,βy1,βx2,βy2ββ€β100) integers, where x1 and y1 are coordinates of the first tree and x2 and y2 are coordinates of the second tree. It's guaranteed that the given points are distinct. | 1,200 | If there is no solution to the problem, print -1. Otherwise print four space-separated integers x3,βy3,βx4,βy4 that correspond to the coordinates of the two other trees. If there are several solutions you can output any of them. Note that x3,βy3,βx4,βy4 must be in the range (β-β1000ββ€βx3,βy3,βx4,βy4ββ€β1000). | standard output | |
PASSED | c2598b870e250de8693606f99e852928 | train_002.jsonl | 1408116600 | Pashmak has fallen in love with an attractive girl called Parmida since one year ago...Today, Pashmak set up a meeting with his partner in a romantic garden. Unfortunately, Pashmak has forgotten where the garden is. But he remembers that the garden looks like a square with sides parallel to the coordinate axes. He also... | 256 megabytes | import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.util.StringTokenizer;
public class Trees {
public static void main(String[] args) throws IOException{
BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
Print... | Java | ["0 0 0 1", "0 0 1 1", "0 0 1 2"] | 1 second | ["1 0 1 1", "0 1 1 0", "-1"] | null | Java 8 | standard input | [
"implementation"
] | 71dea31e1244797f916adf5f526f776e | The first line contains four space-separated x1,βy1,βx2,βy2 (β-β100ββ€βx1,βy1,βx2,βy2ββ€β100) integers, where x1 and y1 are coordinates of the first tree and x2 and y2 are coordinates of the second tree. It's guaranteed that the given points are distinct. | 1,200 | If there is no solution to the problem, print -1. Otherwise print four space-separated integers x3,βy3,βx4,βy4 that correspond to the coordinates of the two other trees. If there are several solutions you can output any of them. Note that x3,βy3,βx4,βy4 must be in the range (β-β1000ββ€βx3,βy3,βx4,βy4ββ€β1000). | standard output | |
PASSED | ed6e8168b790fd1f706c3a08fa8b9324 | train_002.jsonl | 1408116600 | Pashmak has fallen in love with an attractive girl called Parmida since one year ago...Today, Pashmak set up a meeting with his partner in a romantic garden. Unfortunately, Pashmak has forgotten where the garden is. But he remembers that the garden looks like a square with sides parallel to the coordinate axes. He also... | 256 megabytes | import java.util.Scanner;
public class Garden{
public static void main(String arg[]){
Scanner sc=new Scanner(System.in);
int x1=sc.nextInt();
int y1=sc.nextInt();
int x2=sc.nextInt();
int y2=sc.nextInt();
if(x1!=x2 && y1!=y2 && Math.abs(x2-x1)!=Math.abs(y2-y1))System.out.println("-1");
e... | Java | ["0 0 0 1", "0 0 1 1", "0 0 1 2"] | 1 second | ["1 0 1 1", "0 1 1 0", "-1"] | null | Java 8 | standard input | [
"implementation"
] | 71dea31e1244797f916adf5f526f776e | The first line contains four space-separated x1,βy1,βx2,βy2 (β-β100ββ€βx1,βy1,βx2,βy2ββ€β100) integers, where x1 and y1 are coordinates of the first tree and x2 and y2 are coordinates of the second tree. It's guaranteed that the given points are distinct. | 1,200 | If there is no solution to the problem, print -1. Otherwise print four space-separated integers x3,βy3,βx4,βy4 that correspond to the coordinates of the two other trees. If there are several solutions you can output any of them. Note that x3,βy3,βx4,βy4 must be in the range (β-β1000ββ€βx3,βy3,βx4,βy4ββ€β1000). | standard output | |
PASSED | 27e9424a13bcfd9794d0d54062cb82fd | train_002.jsonl | 1408116600 | Pashmak has fallen in love with an attractive girl called Parmida since one year ago...Today, Pashmak set up a meeting with his partner in a romantic garden. Unfortunately, Pashmak has forgotten where the garden is. But he remembers that the garden looks like a square with sides parallel to the coordinate axes. He also... | 256 megabytes | import java.util.Scanner;
public class cheaptravel {
public static void main(String[] args) {
// TODO Auto-generated method stub
Scanner sc=new Scanner(System.in);
int x1=sc.nextInt();
int y1=sc.nextInt();
int x2=sc.nextInt();
int y2=sc.nextInt();
if(x1==x2) {
int l=y2-y1;
int x3=l+x1;
System.... | Java | ["0 0 0 1", "0 0 1 1", "0 0 1 2"] | 1 second | ["1 0 1 1", "0 1 1 0", "-1"] | null | Java 8 | standard input | [
"implementation"
] | 71dea31e1244797f916adf5f526f776e | The first line contains four space-separated x1,βy1,βx2,βy2 (β-β100ββ€βx1,βy1,βx2,βy2ββ€β100) integers, where x1 and y1 are coordinates of the first tree and x2 and y2 are coordinates of the second tree. It's guaranteed that the given points are distinct. | 1,200 | If there is no solution to the problem, print -1. Otherwise print four space-separated integers x3,βy3,βx4,βy4 that correspond to the coordinates of the two other trees. If there are several solutions you can output any of them. Note that x3,βy3,βx4,βy4 must be in the range (β-β1000ββ€βx3,βy3,βx4,βy4ββ€β1000). | standard output | |
PASSED | dd9da580d76190f935fae779ac291d12 | train_002.jsonl | 1408116600 | Pashmak has fallen in love with an attractive girl called Parmida since one year ago...Today, Pashmak set up a meeting with his partner in a romantic garden. Unfortunately, Pashmak has forgotten where the garden is. But he remembers that the garden looks like a square with sides parallel to the coordinate axes. He also... | 256 megabytes | import java.util.ArrayList;
import java.util.Collections;
import java.util.Scanner;
import java.math.BigInteger;
/**
*
* @author T M Mohamad Mabrouk
*/
public class PashmakAndGarden {
/**
* @param args the command line arguments
*/
public static void main(String[] args) {
// TODO code app... | Java | ["0 0 0 1", "0 0 1 1", "0 0 1 2"] | 1 second | ["1 0 1 1", "0 1 1 0", "-1"] | null | Java 8 | standard input | [
"implementation"
] | 71dea31e1244797f916adf5f526f776e | The first line contains four space-separated x1,βy1,βx2,βy2 (β-β100ββ€βx1,βy1,βx2,βy2ββ€β100) integers, where x1 and y1 are coordinates of the first tree and x2 and y2 are coordinates of the second tree. It's guaranteed that the given points are distinct. | 1,200 | If there is no solution to the problem, print -1. Otherwise print four space-separated integers x3,βy3,βx4,βy4 that correspond to the coordinates of the two other trees. If there are several solutions you can output any of them. Note that x3,βy3,βx4,βy4 must be in the range (β-β1000ββ€βx3,βy3,βx4,βy4ββ€β1000). | standard output | |
PASSED | 13593e8a0b7c4279b5c6a1d8d7e19031 | train_002.jsonl | 1408116600 | Pashmak has fallen in love with an attractive girl called Parmida since one year ago...Today, Pashmak set up a meeting with his partner in a romantic garden. Unfortunately, Pashmak has forgotten where the garden is. But he remembers that the garden looks like a square with sides parallel to the coordinate axes. He also... | 256 megabytes | import java.util.Scanner;
public class PashmakandGarden {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
int x1 = sc.nextInt();
int y1 = sc.nextInt();
int x2 = sc.nextInt();
int y2 = sc.nextInt();
boolean error = false;
int error1 = -1;
int x3 = 0;
int y3 = 0;
int x... | Java | ["0 0 0 1", "0 0 1 1", "0 0 1 2"] | 1 second | ["1 0 1 1", "0 1 1 0", "-1"] | null | Java 8 | standard input | [
"implementation"
] | 71dea31e1244797f916adf5f526f776e | The first line contains four space-separated x1,βy1,βx2,βy2 (β-β100ββ€βx1,βy1,βx2,βy2ββ€β100) integers, where x1 and y1 are coordinates of the first tree and x2 and y2 are coordinates of the second tree. It's guaranteed that the given points are distinct. | 1,200 | If there is no solution to the problem, print -1. Otherwise print four space-separated integers x3,βy3,βx4,βy4 that correspond to the coordinates of the two other trees. If there are several solutions you can output any of them. Note that x3,βy3,βx4,βy4 must be in the range (β-β1000ββ€βx3,βy3,βx4,βy4ββ€β1000). | standard output | |
PASSED | 62dd05967c0018621fa9acf400ef237e | train_002.jsonl | 1408116600 | Pashmak has fallen in love with an attractive girl called Parmida since one year ago...Today, Pashmak set up a meeting with his partner in a romantic garden. Unfortunately, Pashmak has forgotten where the garden is. But he remembers that the garden looks like a square with sides parallel to the coordinate axes. He also... | 256 megabytes | import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.StringTokenizer;
public class PashmakAndGarden {
static class FastReader {
BufferedReader reader;
StringTokenizer tokenizer;
public FastReader() {
reader = new BufferedReader(new InputStreamReade... | Java | ["0 0 0 1", "0 0 1 1", "0 0 1 2"] | 1 second | ["1 0 1 1", "0 1 1 0", "-1"] | null | Java 8 | standard input | [
"implementation"
] | 71dea31e1244797f916adf5f526f776e | The first line contains four space-separated x1,βy1,βx2,βy2 (β-β100ββ€βx1,βy1,βx2,βy2ββ€β100) integers, where x1 and y1 are coordinates of the first tree and x2 and y2 are coordinates of the second tree. It's guaranteed that the given points are distinct. | 1,200 | If there is no solution to the problem, print -1. Otherwise print four space-separated integers x3,βy3,βx4,βy4 that correspond to the coordinates of the two other trees. If there are several solutions you can output any of them. Note that x3,βy3,βx4,βy4 must be in the range (β-β1000ββ€βx3,βy3,βx4,βy4ββ€β1000). | standard output | |
PASSED | 4ec6f6191c159c95155e11b7c5c6224c | train_002.jsonl | 1408116600 | Pashmak has fallen in love with an attractive girl called Parmida since one year ago...Today, Pashmak set up a meeting with his partner in a romantic garden. Unfortunately, Pashmak has forgotten where the garden is. But he remembers that the garden looks like a square with sides parallel to the coordinate axes. He also... | 256 megabytes |
import java.util.Scanner;
public class Main {
public static void main(String[] args) {
Scanner sc=new Scanner(System.in);
int x1=sc.nextInt();
int y1=sc.nextInt();
int x2=sc.nextInt();
int y2=sc.nextInt();
if((x1)==(x2)||(y1)==(y2)){
if((x1)==(x2)){
System.out.println((x1+(y2-y1)... | Java | ["0 0 0 1", "0 0 1 1", "0 0 1 2"] | 1 second | ["1 0 1 1", "0 1 1 0", "-1"] | null | Java 8 | standard input | [
"implementation"
] | 71dea31e1244797f916adf5f526f776e | The first line contains four space-separated x1,βy1,βx2,βy2 (β-β100ββ€βx1,βy1,βx2,βy2ββ€β100) integers, where x1 and y1 are coordinates of the first tree and x2 and y2 are coordinates of the second tree. It's guaranteed that the given points are distinct. | 1,200 | If there is no solution to the problem, print -1. Otherwise print four space-separated integers x3,βy3,βx4,βy4 that correspond to the coordinates of the two other trees. If there are several solutions you can output any of them. Note that x3,βy3,βx4,βy4 must be in the range (β-β1000ββ€βx3,βy3,βx4,βy4ββ€β1000). | standard output | |
PASSED | 43469230fa3e4bb4addd7ce66aebdc45 | train_002.jsonl | 1408116600 | Pashmak has fallen in love with an attractive girl called Parmida since one year ago...Today, Pashmak set up a meeting with his partner in a romantic garden. Unfortunately, Pashmak has forgotten where the garden is. But he remembers that the garden looks like a square with sides parallel to the coordinate axes. He also... | 256 megabytes | /*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
import java.util.Scanner;
public class PashmakGarden {
public static void main(String[] args) {
Scann... | Java | ["0 0 0 1", "0 0 1 1", "0 0 1 2"] | 1 second | ["1 0 1 1", "0 1 1 0", "-1"] | null | Java 8 | standard input | [
"implementation"
] | 71dea31e1244797f916adf5f526f776e | The first line contains four space-separated x1,βy1,βx2,βy2 (β-β100ββ€βx1,βy1,βx2,βy2ββ€β100) integers, where x1 and y1 are coordinates of the first tree and x2 and y2 are coordinates of the second tree. It's guaranteed that the given points are distinct. | 1,200 | If there is no solution to the problem, print -1. Otherwise print four space-separated integers x3,βy3,βx4,βy4 that correspond to the coordinates of the two other trees. If there are several solutions you can output any of them. Note that x3,βy3,βx4,βy4 must be in the range (β-β1000ββ€βx3,βy3,βx4,βy4ββ€β1000). | standard output | |
PASSED | 9125c3faf3cb16e742635748a9b190a2 | train_002.jsonl | 1408116600 | Pashmak has fallen in love with an attractive girl called Parmida since one year ago...Today, Pashmak set up a meeting with his partner in a romantic garden. Unfortunately, Pashmak has forgotten where the garden is. But he remembers that the garden looks like a square with sides parallel to the coordinate axes. He also... | 256 megabytes | /*BY:-PRASANG*/
import java.util.Scanner;
public class PashmakAndGarden {
public static void main(String[] ar)
{
int value[]=new int[4];
int c=0,temp=0;
Scanner sc=new Scanner(System.in);
for(int i=0;i<4;i++)
value[i]=sc.nextInt();
if(value[0]==value[2])
... | Java | ["0 0 0 1", "0 0 1 1", "0 0 1 2"] | 1 second | ["1 0 1 1", "0 1 1 0", "-1"] | null | Java 8 | standard input | [
"implementation"
] | 71dea31e1244797f916adf5f526f776e | The first line contains four space-separated x1,βy1,βx2,βy2 (β-β100ββ€βx1,βy1,βx2,βy2ββ€β100) integers, where x1 and y1 are coordinates of the first tree and x2 and y2 are coordinates of the second tree. It's guaranteed that the given points are distinct. | 1,200 | If there is no solution to the problem, print -1. Otherwise print four space-separated integers x3,βy3,βx4,βy4 that correspond to the coordinates of the two other trees. If there are several solutions you can output any of them. Note that x3,βy3,βx4,βy4 must be in the range (β-β1000ββ€βx3,βy3,βx4,βy4ββ€β1000). | standard output | |
PASSED | 128db73b52b4b61aaa633ca088db6882 | train_002.jsonl | 1592921100 | Lee is going to fashionably decorate his house for a party, using some regular convex polygons...Lee thinks a regular $$$n$$$-sided (convex) polygon is beautiful if and only if he can rotate it in such a way that at least one of its edges is parallel to the $$$OX$$$-axis and at least one of its edges is parallel to the... | 256 megabytes | import java.util.Scanner;
public class CF_652_Div2_A {
private CF_652_Div2_A() {
Scanner scanner = new Scanner(System.in);
int t = scanner.nextInt();
for (int i = 0; i < t; i++) {
long n = scanner.nextLong();
System.out.println((n & 3) == 0 ? "YES" : "NO");
}
}
public static void mai... | Java | ["4\n3\n4\n12\n1000000000"] | 2 seconds | ["NO\nYES\nYES\nYES"] | NoteIn the example, there are $$$4$$$ polygons in the market. It's easy to see that an equilateral triangle (a regular $$$3$$$-sided polygon) is not beautiful, a square (a regular $$$4$$$-sided polygon) is beautiful and a regular $$$12$$$-sided polygon (is shown below) is beautiful as well. | Java 8 | standard input | [
"geometry",
"math"
] | 07e56d4031bcb119d2f684203f7ed133 | The first line contains a single integer $$$t$$$ ($$$1 \le t \le 10^4$$$)Β β the number of polygons in the market. Each of the next $$$t$$$ lines contains a single integer $$$n_i$$$ ($$$3 \le n_i \le 10^9$$$): it means that the $$$i$$$-th polygon is a regular $$$n_i$$$-sided polygon. | 800 | For each polygon, print YES if it's beautiful or NO otherwise (case insensitive). | standard output | |
PASSED | 9792e5ccda83d095789bb6bd65c30ec9 | train_002.jsonl | 1592921100 | Lee is going to fashionably decorate his house for a party, using some regular convex polygons...Lee thinks a regular $$$n$$$-sided (convex) polygon is beautiful if and only if he can rotate it in such a way that at least one of its edges is parallel to the $$$OX$$$-axis and at least one of its edges is parallel to the... | 256 megabytes | import java.util.LinkedList;
import java.util.Scanner;
public class Exmple {
public static void main(String[] args) {
//LinkedList<E>
Scanner sc=new Scanner(System.in);
int t=sc.nextInt();
while(t-->0) {
int n=sc.nextInt();
if(n%4==0)System.out.println("YES");
else System.out.pr... | Java | ["4\n3\n4\n12\n1000000000"] | 2 seconds | ["NO\nYES\nYES\nYES"] | NoteIn the example, there are $$$4$$$ polygons in the market. It's easy to see that an equilateral triangle (a regular $$$3$$$-sided polygon) is not beautiful, a square (a regular $$$4$$$-sided polygon) is beautiful and a regular $$$12$$$-sided polygon (is shown below) is beautiful as well. | Java 8 | standard input | [
"geometry",
"math"
] | 07e56d4031bcb119d2f684203f7ed133 | The first line contains a single integer $$$t$$$ ($$$1 \le t \le 10^4$$$)Β β the number of polygons in the market. Each of the next $$$t$$$ lines contains a single integer $$$n_i$$$ ($$$3 \le n_i \le 10^9$$$): it means that the $$$i$$$-th polygon is a regular $$$n_i$$$-sided polygon. | 800 | For each polygon, print YES if it's beautiful or NO otherwise (case insensitive). | standard output | |
PASSED | c77f9fe73b4f185385282ab23338f6d2 | train_002.jsonl | 1592921100 | Lee is going to fashionably decorate his house for a party, using some regular convex polygons...Lee thinks a regular $$$n$$$-sided (convex) polygon is beautiful if and only if he can rotate it in such a way that at least one of its edges is parallel to the $$$OX$$$-axis and at least one of its edges is parallel to the... | 256 megabytes | import java.util.Scanner;
public class FashionabLee {
public static void main(String[] args) {
Scanner in = new Scanner(System.in);
int t = in.nextInt();
while (t-- > 0) {
System.out.println(in.nextInt() % 4 == 0 ? "YES" : "NO");
}
in.close();
}
}
| Java | ["4\n3\n4\n12\n1000000000"] | 2 seconds | ["NO\nYES\nYES\nYES"] | NoteIn the example, there are $$$4$$$ polygons in the market. It's easy to see that an equilateral triangle (a regular $$$3$$$-sided polygon) is not beautiful, a square (a regular $$$4$$$-sided polygon) is beautiful and a regular $$$12$$$-sided polygon (is shown below) is beautiful as well. | Java 8 | standard input | [
"geometry",
"math"
] | 07e56d4031bcb119d2f684203f7ed133 | The first line contains a single integer $$$t$$$ ($$$1 \le t \le 10^4$$$)Β β the number of polygons in the market. Each of the next $$$t$$$ lines contains a single integer $$$n_i$$$ ($$$3 \le n_i \le 10^9$$$): it means that the $$$i$$$-th polygon is a regular $$$n_i$$$-sided polygon. | 800 | For each polygon, print YES if it's beautiful or NO otherwise (case insensitive). | standard output | |
PASSED | 41a2111f863db3bcafba6d355c3aac04 | train_002.jsonl | 1592921100 | Lee is going to fashionably decorate his house for a party, using some regular convex polygons...Lee thinks a regular $$$n$$$-sided (convex) polygon is beautiful if and only if he can rotate it in such a way that at least one of its edges is parallel to the $$$OX$$$-axis and at least one of its edges is parallel to the... | 256 megabytes | import java.util.Scanner;
public class Div2 {
public static void main(String[] args) {
Scanner in=new Scanner (System.in);
int t=in.nextInt();
for (int i = 0; i < t; i++) {
int n=in.nextInt();
if(n%2==0){
if((n/2)%2==0)
System.out.println("Y... | Java | ["4\n3\n4\n12\n1000000000"] | 2 seconds | ["NO\nYES\nYES\nYES"] | NoteIn the example, there are $$$4$$$ polygons in the market. It's easy to see that an equilateral triangle (a regular $$$3$$$-sided polygon) is not beautiful, a square (a regular $$$4$$$-sided polygon) is beautiful and a regular $$$12$$$-sided polygon (is shown below) is beautiful as well. | Java 8 | standard input | [
"geometry",
"math"
] | 07e56d4031bcb119d2f684203f7ed133 | The first line contains a single integer $$$t$$$ ($$$1 \le t \le 10^4$$$)Β β the number of polygons in the market. Each of the next $$$t$$$ lines contains a single integer $$$n_i$$$ ($$$3 \le n_i \le 10^9$$$): it means that the $$$i$$$-th polygon is a regular $$$n_i$$$-sided polygon. | 800 | For each polygon, print YES if it's beautiful or NO otherwise (case insensitive). | standard output | |
PASSED | 119d505d53d8603f406f79388df03538 | train_002.jsonl | 1592921100 | Lee is going to fashionably decorate his house for a party, using some regular convex polygons...Lee thinks a regular $$$n$$$-sided (convex) polygon is beautiful if and only if he can rotate it in such a way that at least one of its edges is parallel to the $$$OX$$$-axis and at least one of its edges is parallel to the... | 256 megabytes | import java.io.PrintWriter;
import java.util.LinkedList;
import java.util.List;
import java.util.Random;
import java.util.Scanner;
public class TaskA {
static Scanner in = new Scanner(System.in);
static PrintWriter w = new PrintWriter(System.out);
public static void main(String[] args) {
int t = Integer.parseIn... | Java | ["4\n3\n4\n12\n1000000000"] | 2 seconds | ["NO\nYES\nYES\nYES"] | NoteIn the example, there are $$$4$$$ polygons in the market. It's easy to see that an equilateral triangle (a regular $$$3$$$-sided polygon) is not beautiful, a square (a regular $$$4$$$-sided polygon) is beautiful and a regular $$$12$$$-sided polygon (is shown below) is beautiful as well. | Java 8 | standard input | [
"geometry",
"math"
] | 07e56d4031bcb119d2f684203f7ed133 | The first line contains a single integer $$$t$$$ ($$$1 \le t \le 10^4$$$)Β β the number of polygons in the market. Each of the next $$$t$$$ lines contains a single integer $$$n_i$$$ ($$$3 \le n_i \le 10^9$$$): it means that the $$$i$$$-th polygon is a regular $$$n_i$$$-sided polygon. | 800 | For each polygon, print YES if it's beautiful or NO otherwise (case insensitive). | standard output | |
PASSED | 3bba756bc80c85e1b2dea0219f68a019 | train_002.jsonl | 1592921100 | Lee is going to fashionably decorate his house for a party, using some regular convex polygons...Lee thinks a regular $$$n$$$-sided (convex) polygon is beautiful if and only if he can rotate it in such a way that at least one of its edges is parallel to the $$$OX$$$-axis and at least one of its edges is parallel to the... | 256 megabytes | import java.io.BufferedReader;
import java.io.FileReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.lang.reflect.Array;
import java.math.BigInteger;
import java.util.*;
public class Codeforce... | Java | ["4\n3\n4\n12\n1000000000"] | 2 seconds | ["NO\nYES\nYES\nYES"] | NoteIn the example, there are $$$4$$$ polygons in the market. It's easy to see that an equilateral triangle (a regular $$$3$$$-sided polygon) is not beautiful, a square (a regular $$$4$$$-sided polygon) is beautiful and a regular $$$12$$$-sided polygon (is shown below) is beautiful as well. | Java 8 | standard input | [
"geometry",
"math"
] | 07e56d4031bcb119d2f684203f7ed133 | The first line contains a single integer $$$t$$$ ($$$1 \le t \le 10^4$$$)Β β the number of polygons in the market. Each of the next $$$t$$$ lines contains a single integer $$$n_i$$$ ($$$3 \le n_i \le 10^9$$$): it means that the $$$i$$$-th polygon is a regular $$$n_i$$$-sided polygon. | 800 | For each polygon, print YES if it's beautiful or NO otherwise (case insensitive). | standard output | |
PASSED | 9cb0b26e26a3d80063deb779dd7e49bb | train_002.jsonl | 1592921100 | Lee is going to fashionably decorate his house for a party, using some regular convex polygons...Lee thinks a regular $$$n$$$-sided (convex) polygon is beautiful if and only if he can rotate it in such a way that at least one of its edges is parallel to the $$$OX$$$-axis and at least one of its edges is parallel to the... | 256 megabytes | import java.io.*;
import java.util.*;
public class Main
{
static Scanner scan = new Scanner(System.in);
public static void solve() throws Exception
{
//BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
//StringTokenizer tk = new StringTokenizer(in.readLine());
int n = scan.nextInt();
... | Java | ["4\n3\n4\n12\n1000000000"] | 2 seconds | ["NO\nYES\nYES\nYES"] | NoteIn the example, there are $$$4$$$ polygons in the market. It's easy to see that an equilateral triangle (a regular $$$3$$$-sided polygon) is not beautiful, a square (a regular $$$4$$$-sided polygon) is beautiful and a regular $$$12$$$-sided polygon (is shown below) is beautiful as well. | Java 8 | standard input | [
"geometry",
"math"
] | 07e56d4031bcb119d2f684203f7ed133 | The first line contains a single integer $$$t$$$ ($$$1 \le t \le 10^4$$$)Β β the number of polygons in the market. Each of the next $$$t$$$ lines contains a single integer $$$n_i$$$ ($$$3 \le n_i \le 10^9$$$): it means that the $$$i$$$-th polygon is a regular $$$n_i$$$-sided polygon. | 800 | For each polygon, print YES if it's beautiful or NO otherwise (case insensitive). | standard output | |
PASSED | 1e6171153a6834c7aca1df55520817cd | train_002.jsonl | 1592921100 | Lee is going to fashionably decorate his house for a party, using some regular convex polygons...Lee thinks a regular $$$n$$$-sided (convex) polygon is beautiful if and only if he can rotate it in such a way that at least one of its edges is parallel to the $$$OX$$$-axis and at least one of its edges is parallel to the... | 256 megabytes | import java.util.*;
import java.lang.*;
import java.math.*;
import java.text.*;
import java.io.*;
public final class Solution {
static PrintWriter out = new PrintWriter(System.out);
static void flush() {
out.flush();
}
static int gcd(int a, int b) {
if (b == 0) return a;
return gcd(b, a % b);
... | Java | ["4\n3\n4\n12\n1000000000"] | 2 seconds | ["NO\nYES\nYES\nYES"] | NoteIn the example, there are $$$4$$$ polygons in the market. It's easy to see that an equilateral triangle (a regular $$$3$$$-sided polygon) is not beautiful, a square (a regular $$$4$$$-sided polygon) is beautiful and a regular $$$12$$$-sided polygon (is shown below) is beautiful as well. | Java 8 | standard input | [
"geometry",
"math"
] | 07e56d4031bcb119d2f684203f7ed133 | The first line contains a single integer $$$t$$$ ($$$1 \le t \le 10^4$$$)Β β the number of polygons in the market. Each of the next $$$t$$$ lines contains a single integer $$$n_i$$$ ($$$3 \le n_i \le 10^9$$$): it means that the $$$i$$$-th polygon is a regular $$$n_i$$$-sided polygon. | 800 | For each polygon, print YES if it's beautiful or NO otherwise (case insensitive). | standard output | |
PASSED | 8a38f77cc0b42ace87a5f627fac64e48 | train_002.jsonl | 1592921100 | Lee is going to fashionably decorate his house for a party, using some regular convex polygons...Lee thinks a regular $$$n$$$-sided (convex) polygon is beautiful if and only if he can rotate it in such a way that at least one of its edges is parallel to the $$$OX$$$-axis and at least one of its edges is parallel to the... | 256 megabytes | import java.util.*;
public class Main
{
public static void main(String[] args) {
int t,n;
Scanner in=new Scanner(System.in);
t=in.nextInt();
while(t!=0){
n=in.nextInt();
if(n % 4 == 0){
System.out.println("YES");
}
else{
System.out.println("NO");
... | Java | ["4\n3\n4\n12\n1000000000"] | 2 seconds | ["NO\nYES\nYES\nYES"] | NoteIn the example, there are $$$4$$$ polygons in the market. It's easy to see that an equilateral triangle (a regular $$$3$$$-sided polygon) is not beautiful, a square (a regular $$$4$$$-sided polygon) is beautiful and a regular $$$12$$$-sided polygon (is shown below) is beautiful as well. | Java 8 | standard input | [
"geometry",
"math"
] | 07e56d4031bcb119d2f684203f7ed133 | The first line contains a single integer $$$t$$$ ($$$1 \le t \le 10^4$$$)Β β the number of polygons in the market. Each of the next $$$t$$$ lines contains a single integer $$$n_i$$$ ($$$3 \le n_i \le 10^9$$$): it means that the $$$i$$$-th polygon is a regular $$$n_i$$$-sided polygon. | 800 | For each polygon, print YES if it's beautiful or NO otherwise (case insensitive). | standard output | |
PASSED | db52d013c14802cd13141eae984dad75 | train_002.jsonl | 1592921100 | Lee is going to fashionably decorate his house for a party, using some regular convex polygons...Lee thinks a regular $$$n$$$-sided (convex) polygon is beautiful if and only if he can rotate it in such a way that at least one of its edges is parallel to the $$$OX$$$-axis and at least one of its edges is parallel to the... | 256 megabytes | import java.util.*;
public class Main
{
public static void main(String[] args) {
int t,n;
Scanner in=new Scanner(System.in);
t=in.nextInt();
while(t!=0){
n=in.nextInt();
if(n % 4 == 0){
System.out.println("YES");
}
else{
System.out.println("NO");
... | Java | ["4\n3\n4\n12\n1000000000"] | 2 seconds | ["NO\nYES\nYES\nYES"] | NoteIn the example, there are $$$4$$$ polygons in the market. It's easy to see that an equilateral triangle (a regular $$$3$$$-sided polygon) is not beautiful, a square (a regular $$$4$$$-sided polygon) is beautiful and a regular $$$12$$$-sided polygon (is shown below) is beautiful as well. | Java 8 | standard input | [
"geometry",
"math"
] | 07e56d4031bcb119d2f684203f7ed133 | The first line contains a single integer $$$t$$$ ($$$1 \le t \le 10^4$$$)Β β the number of polygons in the market. Each of the next $$$t$$$ lines contains a single integer $$$n_i$$$ ($$$3 \le n_i \le 10^9$$$): it means that the $$$i$$$-th polygon is a regular $$$n_i$$$-sided polygon. | 800 | For each polygon, print YES if it's beautiful or NO otherwise (case insensitive). | standard output | |
PASSED | c062199719d2eff01d8fab90682bcea6 | train_002.jsonl | 1592921100 | Lee is going to fashionably decorate his house for a party, using some regular convex polygons...Lee thinks a regular $$$n$$$-sided (convex) polygon is beautiful if and only if he can rotate it in such a way that at least one of its edges is parallel to the $$$OX$$$-axis and at least one of its edges is parallel to the... | 256 megabytes | import java.util.Scanner;
public class A652 {
public static void main(String[] args) {
// TODO Auto-generated method stub
Scanner obj=new Scanner(System.in);
int t=obj.nextInt();
while(t-->0)
{
long n=obj.nextLong();
if(n%4==0)
System.out.println("YES");
else
System.out.println("NO");
}
... | Java | ["4\n3\n4\n12\n1000000000"] | 2 seconds | ["NO\nYES\nYES\nYES"] | NoteIn the example, there are $$$4$$$ polygons in the market. It's easy to see that an equilateral triangle (a regular $$$3$$$-sided polygon) is not beautiful, a square (a regular $$$4$$$-sided polygon) is beautiful and a regular $$$12$$$-sided polygon (is shown below) is beautiful as well. | Java 8 | standard input | [
"geometry",
"math"
] | 07e56d4031bcb119d2f684203f7ed133 | The first line contains a single integer $$$t$$$ ($$$1 \le t \le 10^4$$$)Β β the number of polygons in the market. Each of the next $$$t$$$ lines contains a single integer $$$n_i$$$ ($$$3 \le n_i \le 10^9$$$): it means that the $$$i$$$-th polygon is a regular $$$n_i$$$-sided polygon. | 800 | For each polygon, print YES if it's beautiful or NO otherwise (case insensitive). | standard output | |
PASSED | 15a41524821bbaaa05b3b1c038d308bc | train_002.jsonl | 1592921100 | Lee is going to fashionably decorate his house for a party, using some regular convex polygons...Lee thinks a regular $$$n$$$-sided (convex) polygon is beautiful if and only if he can rotate it in such a way that at least one of its edges is parallel to the $$$OX$$$-axis and at least one of its edges is parallel to the... | 256 megabytes | import java.util.*;
import java.io.*;
public class Main{
public static void main(String[] args) throws Exception {
Scanner sc = new Scanner(System.in);
int t = sc.nextInt();
while(t-->0) {
int sides = sc.nextInt();
if(sides%4==0) {
System.out.println("YES");
} else {
System.out.println("NO");
... | Java | ["4\n3\n4\n12\n1000000000"] | 2 seconds | ["NO\nYES\nYES\nYES"] | NoteIn the example, there are $$$4$$$ polygons in the market. It's easy to see that an equilateral triangle (a regular $$$3$$$-sided polygon) is not beautiful, a square (a regular $$$4$$$-sided polygon) is beautiful and a regular $$$12$$$-sided polygon (is shown below) is beautiful as well. | Java 8 | standard input | [
"geometry",
"math"
] | 07e56d4031bcb119d2f684203f7ed133 | The first line contains a single integer $$$t$$$ ($$$1 \le t \le 10^4$$$)Β β the number of polygons in the market. Each of the next $$$t$$$ lines contains a single integer $$$n_i$$$ ($$$3 \le n_i \le 10^9$$$): it means that the $$$i$$$-th polygon is a regular $$$n_i$$$-sided polygon. | 800 | For each polygon, print YES if it's beautiful or NO otherwise (case insensitive). | standard output | |
PASSED | c84b7e5505b1cb759eefd6b82a7a1b9e | train_002.jsonl | 1592921100 | Lee is going to fashionably decorate his house for a party, using some regular convex polygons...Lee thinks a regular $$$n$$$-sided (convex) polygon is beautiful if and only if he can rotate it in such a way that at least one of its edges is parallel to the $$$OX$$$-axis and at least one of its edges is parallel to the... | 256 megabytes | import java.util.*;
public class cdf652div2problemA
{
public static void main(String args[])
{
Scanner sc = new Scanner(System.in);
int t = sc.nextInt();
Queue<Integer> q = new LinkedList<Integer>();
for(int i=0;i<t;i++)
if(sc.hasNext())
q.add(sc.nextInt());
while(!q.isEmpty())
{... | Java | ["4\n3\n4\n12\n1000000000"] | 2 seconds | ["NO\nYES\nYES\nYES"] | NoteIn the example, there are $$$4$$$ polygons in the market. It's easy to see that an equilateral triangle (a regular $$$3$$$-sided polygon) is not beautiful, a square (a regular $$$4$$$-sided polygon) is beautiful and a regular $$$12$$$-sided polygon (is shown below) is beautiful as well. | Java 8 | standard input | [
"geometry",
"math"
] | 07e56d4031bcb119d2f684203f7ed133 | The first line contains a single integer $$$t$$$ ($$$1 \le t \le 10^4$$$)Β β the number of polygons in the market. Each of the next $$$t$$$ lines contains a single integer $$$n_i$$$ ($$$3 \le n_i \le 10^9$$$): it means that the $$$i$$$-th polygon is a regular $$$n_i$$$-sided polygon. | 800 | For each polygon, print YES if it's beautiful or NO otherwise (case insensitive). | standard output | |
PASSED | b1ed47626599c1c5af2ea201cec7388e | train_002.jsonl | 1592921100 | Lee is going to fashionably decorate his house for a party, using some regular convex polygons...Lee thinks a regular $$$n$$$-sided (convex) polygon is beautiful if and only if he can rotate it in such a way that at least one of its edges is parallel to the $$$OX$$$-axis and at least one of its edges is parallel to the... | 256 megabytes | import java.io.*;
import java.math.*;
import java.util.*;
public class R652Q1 {
public static void main(String[] args) {
Scanner input = new Scanner(System.in);
int T = input.nextInt();
for (int i = 1; i <= T; i++) {
int N = input.nextInt();
if (N%2==0) N/=2;
System.out.println(N%2==0?"YES":"NO");
}... | Java | ["4\n3\n4\n12\n1000000000"] | 2 seconds | ["NO\nYES\nYES\nYES"] | NoteIn the example, there are $$$4$$$ polygons in the market. It's easy to see that an equilateral triangle (a regular $$$3$$$-sided polygon) is not beautiful, a square (a regular $$$4$$$-sided polygon) is beautiful and a regular $$$12$$$-sided polygon (is shown below) is beautiful as well. | Java 8 | standard input | [
"geometry",
"math"
] | 07e56d4031bcb119d2f684203f7ed133 | The first line contains a single integer $$$t$$$ ($$$1 \le t \le 10^4$$$)Β β the number of polygons in the market. Each of the next $$$t$$$ lines contains a single integer $$$n_i$$$ ($$$3 \le n_i \le 10^9$$$): it means that the $$$i$$$-th polygon is a regular $$$n_i$$$-sided polygon. | 800 | For each polygon, print YES if it's beautiful or NO otherwise (case insensitive). | standard output | |
PASSED | 5c035f33a1b9858a3b5b2ed85cc23384 | train_002.jsonl | 1592921100 | Lee is going to fashionably decorate his house for a party, using some regular convex polygons...Lee thinks a regular $$$n$$$-sided (convex) polygon is beautiful if and only if he can rotate it in such a way that at least one of its edges is parallel to the $$$OX$$$-axis and at least one of its edges is parallel to the... | 256 megabytes | import java.io.OutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.util.Scanner;
/**
* Built using CHelper plug-in
* Actual solution is at the top
*
* @author booooooo
*/
public class Main {
public static void main(String[] args) {
InputStream ... | Java | ["4\n3\n4\n12\n1000000000"] | 2 seconds | ["NO\nYES\nYES\nYES"] | NoteIn the example, there are $$$4$$$ polygons in the market. It's easy to see that an equilateral triangle (a regular $$$3$$$-sided polygon) is not beautiful, a square (a regular $$$4$$$-sided polygon) is beautiful and a regular $$$12$$$-sided polygon (is shown below) is beautiful as well. | Java 8 | standard input | [
"geometry",
"math"
] | 07e56d4031bcb119d2f684203f7ed133 | The first line contains a single integer $$$t$$$ ($$$1 \le t \le 10^4$$$)Β β the number of polygons in the market. Each of the next $$$t$$$ lines contains a single integer $$$n_i$$$ ($$$3 \le n_i \le 10^9$$$): it means that the $$$i$$$-th polygon is a regular $$$n_i$$$-sided polygon. | 800 | For each polygon, print YES if it's beautiful or NO otherwise (case insensitive). | standard output | |
PASSED | e7b44c952e61e4ebd35d74767a447566 | train_002.jsonl | 1592921100 | Lee is going to fashionably decorate his house for a party, using some regular convex polygons...Lee thinks a regular $$$n$$$-sided (convex) polygon is beautiful if and only if he can rotate it in such a way that at least one of its edges is parallel to the $$$OX$$$-axis and at least one of its edges is parallel to the... | 256 megabytes | import java.util.Scanner;
public class Main {
public static void main(String[] args) {
Scanner scanner = new Scanner(System.in);
int T = scanner.nextInt();
while (T-- > 0) {
if (scanner.nextInt() % 4 == 0) {
System.out.println("YES");
} else {
... | Java | ["4\n3\n4\n12\n1000000000"] | 2 seconds | ["NO\nYES\nYES\nYES"] | NoteIn the example, there are $$$4$$$ polygons in the market. It's easy to see that an equilateral triangle (a regular $$$3$$$-sided polygon) is not beautiful, a square (a regular $$$4$$$-sided polygon) is beautiful and a regular $$$12$$$-sided polygon (is shown below) is beautiful as well. | Java 8 | standard input | [
"geometry",
"math"
] | 07e56d4031bcb119d2f684203f7ed133 | The first line contains a single integer $$$t$$$ ($$$1 \le t \le 10^4$$$)Β β the number of polygons in the market. Each of the next $$$t$$$ lines contains a single integer $$$n_i$$$ ($$$3 \le n_i \le 10^9$$$): it means that the $$$i$$$-th polygon is a regular $$$n_i$$$-sided polygon. | 800 | For each polygon, print YES if it's beautiful or NO otherwise (case insensitive). | standard output | |
PASSED | 2c4652e67b1980d4556b3c633a02962a | train_002.jsonl | 1592921100 | Lee is going to fashionably decorate his house for a party, using some regular convex polygons...Lee thinks a regular $$$n$$$-sided (convex) polygon is beautiful if and only if he can rotate it in such a way that at least one of its edges is parallel to the $$$OX$$$-axis and at least one of its edges is parallel to the... | 256 megabytes | import java.util.*;
public class Main
{
public static void main(String[] args) {
Scanner in = new Scanner(System.in);
int test = in.nextInt();
while(test-- > 0) {
long n = in.nextLong();
if(n%4 == 0) {
System.out.println("YES");
}
else
System.out.println("NO")... | Java | ["4\n3\n4\n12\n1000000000"] | 2 seconds | ["NO\nYES\nYES\nYES"] | NoteIn the example, there are $$$4$$$ polygons in the market. It's easy to see that an equilateral triangle (a regular $$$3$$$-sided polygon) is not beautiful, a square (a regular $$$4$$$-sided polygon) is beautiful and a regular $$$12$$$-sided polygon (is shown below) is beautiful as well. | Java 8 | standard input | [
"geometry",
"math"
] | 07e56d4031bcb119d2f684203f7ed133 | The first line contains a single integer $$$t$$$ ($$$1 \le t \le 10^4$$$)Β β the number of polygons in the market. Each of the next $$$t$$$ lines contains a single integer $$$n_i$$$ ($$$3 \le n_i \le 10^9$$$): it means that the $$$i$$$-th polygon is a regular $$$n_i$$$-sided polygon. | 800 | For each polygon, print YES if it's beautiful or NO otherwise (case insensitive). | standard output | |
PASSED | 4c9bb54ad230260e49f20fde89d7977a | train_002.jsonl | 1592921100 | Lee is going to fashionably decorate his house for a party, using some regular convex polygons...Lee thinks a regular $$$n$$$-sided (convex) polygon is beautiful if and only if he can rotate it in such a way that at least one of its edges is parallel to the $$$OX$$$-axis and at least one of its edges is parallel to the... | 256 megabytes |
import java.io.ByteArrayInputStream;
import java.io.File;
import java.io.PrintWriter;
import java.util.Scanner;
public class A {
public static void main(String[] args) throws Exception {
new A().go();
}
int use_file = 0;
String INPUT = "4\r\n" +
"3\r\n" +
"4\r\n" +
"12\r\n" +
"1000000000";
void... | Java | ["4\n3\n4\n12\n1000000000"] | 2 seconds | ["NO\nYES\nYES\nYES"] | NoteIn the example, there are $$$4$$$ polygons in the market. It's easy to see that an equilateral triangle (a regular $$$3$$$-sided polygon) is not beautiful, a square (a regular $$$4$$$-sided polygon) is beautiful and a regular $$$12$$$-sided polygon (is shown below) is beautiful as well. | Java 8 | standard input | [
"geometry",
"math"
] | 07e56d4031bcb119d2f684203f7ed133 | The first line contains a single integer $$$t$$$ ($$$1 \le t \le 10^4$$$)Β β the number of polygons in the market. Each of the next $$$t$$$ lines contains a single integer $$$n_i$$$ ($$$3 \le n_i \le 10^9$$$): it means that the $$$i$$$-th polygon is a regular $$$n_i$$$-sided polygon. | 800 | For each polygon, print YES if it's beautiful or NO otherwise (case insensitive). | standard output | |
PASSED | 83ac7d90bce0915cd4cd135557da4a51 | train_002.jsonl | 1592921100 | Lee is going to fashionably decorate his house for a party, using some regular convex polygons...Lee thinks a regular $$$n$$$-sided (convex) polygon is beautiful if and only if he can rotate it in such a way that at least one of its edges is parallel to the $$$OX$$$-axis and at least one of its edges is parallel to the... | 256 megabytes | import java.io.ByteArrayInputStream;
import java.io.PrintWriter;
import java.util.Scanner;
public class A {
static boolean LOCAL = System.getProperty("ONLINE_JUDGE") == null;
public static void main(String[] args) throws Exception {
new A().go();
}
Scanner in;
PrintWriter out = new PrintWriter(System.out);... | Java | ["4\n3\n4\n12\n1000000000"] | 2 seconds | ["NO\nYES\nYES\nYES"] | NoteIn the example, there are $$$4$$$ polygons in the market. It's easy to see that an equilateral triangle (a regular $$$3$$$-sided polygon) is not beautiful, a square (a regular $$$4$$$-sided polygon) is beautiful and a regular $$$12$$$-sided polygon (is shown below) is beautiful as well. | Java 8 | standard input | [
"geometry",
"math"
] | 07e56d4031bcb119d2f684203f7ed133 | The first line contains a single integer $$$t$$$ ($$$1 \le t \le 10^4$$$)Β β the number of polygons in the market. Each of the next $$$t$$$ lines contains a single integer $$$n_i$$$ ($$$3 \le n_i \le 10^9$$$): it means that the $$$i$$$-th polygon is a regular $$$n_i$$$-sided polygon. | 800 | For each polygon, print YES if it's beautiful or NO otherwise (case insensitive). | standard output | |
PASSED | 71a333ae45fd0c50c73e5fbe5fa65c01 | train_002.jsonl | 1592921100 | Lee is going to fashionably decorate his house for a party, using some regular convex polygons...Lee thinks a regular $$$n$$$-sided (convex) polygon is beautiful if and only if he can rotate it in such a way that at least one of its edges is parallel to the $$$OX$$$-axis and at least one of its edges is parallel to the... | 256 megabytes | import java.io.*;
import java.util.*;
import java.math.*;
import java.lang.*;
import static java.lang.Math.*;
public class MakingString implements Runnable
{
static class InputReader
{
private InputStream stream;
private byte[] buf = new byte[1024];
private int curChar;
pri... | Java | ["4\n3\n4\n12\n1000000000"] | 2 seconds | ["NO\nYES\nYES\nYES"] | NoteIn the example, there are $$$4$$$ polygons in the market. It's easy to see that an equilateral triangle (a regular $$$3$$$-sided polygon) is not beautiful, a square (a regular $$$4$$$-sided polygon) is beautiful and a regular $$$12$$$-sided polygon (is shown below) is beautiful as well. | Java 8 | standard input | [
"geometry",
"math"
] | 07e56d4031bcb119d2f684203f7ed133 | The first line contains a single integer $$$t$$$ ($$$1 \le t \le 10^4$$$)Β β the number of polygons in the market. Each of the next $$$t$$$ lines contains a single integer $$$n_i$$$ ($$$3 \le n_i \le 10^9$$$): it means that the $$$i$$$-th polygon is a regular $$$n_i$$$-sided polygon. | 800 | For each polygon, print YES if it's beautiful or NO otherwise (case insensitive). | standard output | |
PASSED | 658f14f5e98f28a24506997e63284c12 | train_002.jsonl | 1592921100 | Lee is going to fashionably decorate his house for a party, using some regular convex polygons...Lee thinks a regular $$$n$$$-sided (convex) polygon is beautiful if and only if he can rotate it in such a way that at least one of its edges is parallel to the $$$OX$$$-axis and at least one of its edges is parallel to the... | 256 megabytes | import java.io.BufferedOutputStream;
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.math.BigDecimal;
import java.util.StringTokenizer;
public class A {
public static void main(String[] args) {
MyScanner sc = new MyScanner();
... | Java | ["4\n3\n4\n12\n1000000000"] | 2 seconds | ["NO\nYES\nYES\nYES"] | NoteIn the example, there are $$$4$$$ polygons in the market. It's easy to see that an equilateral triangle (a regular $$$3$$$-sided polygon) is not beautiful, a square (a regular $$$4$$$-sided polygon) is beautiful and a regular $$$12$$$-sided polygon (is shown below) is beautiful as well. | Java 8 | standard input | [
"geometry",
"math"
] | 07e56d4031bcb119d2f684203f7ed133 | The first line contains a single integer $$$t$$$ ($$$1 \le t \le 10^4$$$)Β β the number of polygons in the market. Each of the next $$$t$$$ lines contains a single integer $$$n_i$$$ ($$$3 \le n_i \le 10^9$$$): it means that the $$$i$$$-th polygon is a regular $$$n_i$$$-sided polygon. | 800 | For each polygon, print YES if it's beautiful or NO otherwise (case insensitive). | standard output | |
PASSED | f73ee3b9411488e6ae4b2b48259cf204 | train_002.jsonl | 1592921100 | Lee is going to fashionably decorate his house for a party, using some regular convex polygons...Lee thinks a regular $$$n$$$-sided (convex) polygon is beautiful if and only if he can rotate it in such a way that at least one of its edges is parallel to the $$$OX$$$-axis and at least one of its edges is parallel to the... | 256 megabytes | import java.util.*;
public class fashion
{
public static void main(String args [])
{
Scanner s = new Scanner(System.in);
int t = s.nextInt();
while(t-->0)
{
int n = s.nextInt();
if(n%4==0)
System.out.println("YES");
else
... | Java | ["4\n3\n4\n12\n1000000000"] | 2 seconds | ["NO\nYES\nYES\nYES"] | NoteIn the example, there are $$$4$$$ polygons in the market. It's easy to see that an equilateral triangle (a regular $$$3$$$-sided polygon) is not beautiful, a square (a regular $$$4$$$-sided polygon) is beautiful and a regular $$$12$$$-sided polygon (is shown below) is beautiful as well. | Java 8 | standard input | [
"geometry",
"math"
] | 07e56d4031bcb119d2f684203f7ed133 | The first line contains a single integer $$$t$$$ ($$$1 \le t \le 10^4$$$)Β β the number of polygons in the market. Each of the next $$$t$$$ lines contains a single integer $$$n_i$$$ ($$$3 \le n_i \le 10^9$$$): it means that the $$$i$$$-th polygon is a regular $$$n_i$$$-sided polygon. | 800 | For each polygon, print YES if it's beautiful or NO otherwise (case insensitive). | standard output | |
PASSED | f081efdfc7a0c1b419f467af30b9198d | train_002.jsonl | 1592921100 | Lee is going to fashionably decorate his house for a party, using some regular convex polygons...Lee thinks a regular $$$n$$$-sided (convex) polygon is beautiful if and only if he can rotate it in such a way that at least one of its edges is parallel to the $$$OX$$$-axis and at least one of its edges is parallel to the... | 256 megabytes | import java.util.*;
public class fashion
{
public static void main(String args [])
{
Scanner s = new Scanner(System.in);
int t = s.nextInt();
while(t-->0)
{
int side = s.nextInt();
beauti(side);
}
}
static void beauti(int n)
{
... | Java | ["4\n3\n4\n12\n1000000000"] | 2 seconds | ["NO\nYES\nYES\nYES"] | NoteIn the example, there are $$$4$$$ polygons in the market. It's easy to see that an equilateral triangle (a regular $$$3$$$-sided polygon) is not beautiful, a square (a regular $$$4$$$-sided polygon) is beautiful and a regular $$$12$$$-sided polygon (is shown below) is beautiful as well. | Java 8 | standard input | [
"geometry",
"math"
] | 07e56d4031bcb119d2f684203f7ed133 | The first line contains a single integer $$$t$$$ ($$$1 \le t \le 10^4$$$)Β β the number of polygons in the market. Each of the next $$$t$$$ lines contains a single integer $$$n_i$$$ ($$$3 \le n_i \le 10^9$$$): it means that the $$$i$$$-th polygon is a regular $$$n_i$$$-sided polygon. | 800 | For each polygon, print YES if it's beautiful or NO otherwise (case insensitive). | standard output | |
PASSED | e7c547abc6cb1f83f62e7679c0b48f16 | train_002.jsonl | 1592921100 | Lee is going to fashionably decorate his house for a party, using some regular convex polygons...Lee thinks a regular $$$n$$$-sided (convex) polygon is beautiful if and only if he can rotate it in such a way that at least one of its edges is parallel to the $$$OX$$$-axis and at least one of its edges is parallel to the... | 256 megabytes | import java.io.*;
public class A {
public static void main(String [] args)throws IOException{
BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
int t = Integer.parseInt(br.readLine());
while(t-->0){
int n = Integer.parseInt(br.readLine());
if(n... | Java | ["4\n3\n4\n12\n1000000000"] | 2 seconds | ["NO\nYES\nYES\nYES"] | NoteIn the example, there are $$$4$$$ polygons in the market. It's easy to see that an equilateral triangle (a regular $$$3$$$-sided polygon) is not beautiful, a square (a regular $$$4$$$-sided polygon) is beautiful and a regular $$$12$$$-sided polygon (is shown below) is beautiful as well. | Java 8 | standard input | [
"geometry",
"math"
] | 07e56d4031bcb119d2f684203f7ed133 | The first line contains a single integer $$$t$$$ ($$$1 \le t \le 10^4$$$)Β β the number of polygons in the market. Each of the next $$$t$$$ lines contains a single integer $$$n_i$$$ ($$$3 \le n_i \le 10^9$$$): it means that the $$$i$$$-th polygon is a regular $$$n_i$$$-sided polygon. | 800 | For each polygon, print YES if it's beautiful or NO otherwise (case insensitive). | standard output | |
PASSED | 128ca1a1b3a26d382bb82fb50ff9f339 | train_002.jsonl | 1592921100 | Lee is going to fashionably decorate his house for a party, using some regular convex polygons...Lee thinks a regular $$$n$$$-sided (convex) polygon is beautiful if and only if he can rotate it in such a way that at least one of its edges is parallel to the $$$OX$$$-axis and at least one of its edges is parallel to the... | 256 megabytes |
import java.util.Scanner;
public class FashionableLee {
public static void main(String[] args) {
// TODO Auto-generated method stub
Scanner sc = new Scanner(System.in);
int t=sc.nextInt();
long k[]=new long[t];
for(int i=0;i<t;i++) {
k[i]=sc.nextLong();
}
for(int i=0;i<t;i++) {
if(k[i]... | Java | ["4\n3\n4\n12\n1000000000"] | 2 seconds | ["NO\nYES\nYES\nYES"] | NoteIn the example, there are $$$4$$$ polygons in the market. It's easy to see that an equilateral triangle (a regular $$$3$$$-sided polygon) is not beautiful, a square (a regular $$$4$$$-sided polygon) is beautiful and a regular $$$12$$$-sided polygon (is shown below) is beautiful as well. | Java 8 | standard input | [
"geometry",
"math"
] | 07e56d4031bcb119d2f684203f7ed133 | The first line contains a single integer $$$t$$$ ($$$1 \le t \le 10^4$$$)Β β the number of polygons in the market. Each of the next $$$t$$$ lines contains a single integer $$$n_i$$$ ($$$3 \le n_i \le 10^9$$$): it means that the $$$i$$$-th polygon is a regular $$$n_i$$$-sided polygon. | 800 | For each polygon, print YES if it's beautiful or NO otherwise (case insensitive). | standard output | |
PASSED | ad292e05221199b193dfb9eefed0073d | train_002.jsonl | 1592921100 | Lee is going to fashionably decorate his house for a party, using some regular convex polygons...Lee thinks a regular $$$n$$$-sided (convex) polygon is beautiful if and only if he can rotate it in such a way that at least one of its edges is parallel to the $$$OX$$$-axis and at least one of its edges is parallel to the... | 256 megabytes | import java.util.Scanner;
public class Solution {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
int t = sc.nextInt();
for(int i=0;i<t;i++) {
long n = sc.nextLong();
if(n%4 == 0)
System.out.println("YES");
else
Syste... | Java | ["4\n3\n4\n12\n1000000000"] | 2 seconds | ["NO\nYES\nYES\nYES"] | NoteIn the example, there are $$$4$$$ polygons in the market. It's easy to see that an equilateral triangle (a regular $$$3$$$-sided polygon) is not beautiful, a square (a regular $$$4$$$-sided polygon) is beautiful and a regular $$$12$$$-sided polygon (is shown below) is beautiful as well. | Java 8 | standard input | [
"geometry",
"math"
] | 07e56d4031bcb119d2f684203f7ed133 | The first line contains a single integer $$$t$$$ ($$$1 \le t \le 10^4$$$)Β β the number of polygons in the market. Each of the next $$$t$$$ lines contains a single integer $$$n_i$$$ ($$$3 \le n_i \le 10^9$$$): it means that the $$$i$$$-th polygon is a regular $$$n_i$$$-sided polygon. | 800 | For each polygon, print YES if it's beautiful or NO otherwise (case insensitive). | standard output | |
PASSED | 01b561b8f581b587e02f7e780eb77bba | train_002.jsonl | 1592921100 | Lee is going to fashionably decorate his house for a party, using some regular convex polygons...Lee thinks a regular $$$n$$$-sided (convex) polygon is beautiful if and only if he can rotate it in such a way that at least one of its edges is parallel to the $$$OX$$$-axis and at least one of its edges is parallel to the... | 256 megabytes | import java.util.Scanner;
public class cf652a {
public static void main(String[] args) {
// TODO Auto-generated method stub
Scanner s = new Scanner(System.in);
int T,n;
T= s.nextInt();
for(int i=0;i<T;i++) {
n = s.nextInt();
if(n<=3) {
System.out.println("NO");
}
else if(n%4==0) {
System... | Java | ["4\n3\n4\n12\n1000000000"] | 2 seconds | ["NO\nYES\nYES\nYES"] | NoteIn the example, there are $$$4$$$ polygons in the market. It's easy to see that an equilateral triangle (a regular $$$3$$$-sided polygon) is not beautiful, a square (a regular $$$4$$$-sided polygon) is beautiful and a regular $$$12$$$-sided polygon (is shown below) is beautiful as well. | Java 8 | standard input | [
"geometry",
"math"
] | 07e56d4031bcb119d2f684203f7ed133 | The first line contains a single integer $$$t$$$ ($$$1 \le t \le 10^4$$$)Β β the number of polygons in the market. Each of the next $$$t$$$ lines contains a single integer $$$n_i$$$ ($$$3 \le n_i \le 10^9$$$): it means that the $$$i$$$-th polygon is a regular $$$n_i$$$-sided polygon. | 800 | For each polygon, print YES if it's beautiful or NO otherwise (case insensitive). | standard output | |
PASSED | 60205c737b1fbd3f2a050952d5dd3c1b | train_002.jsonl | 1592921100 | Lee is going to fashionably decorate his house for a party, using some regular convex polygons...Lee thinks a regular $$$n$$$-sided (convex) polygon is beautiful if and only if he can rotate it in such a way that at least one of its edges is parallel to the $$$OX$$$-axis and at least one of its edges is parallel to the... | 256 megabytes |
import java.util.*;
public class Main{
public static void main(String[] args){
Scanner s=new Scanner(System.in);
int t=s.nextInt();
for(int j=0;j<t;j++){
int n=s.nextInt();
n=(n-2);
if(n%2==0){
if((n/2)%2==1 ){
System.out.p... | Java | ["4\n3\n4\n12\n1000000000"] | 2 seconds | ["NO\nYES\nYES\nYES"] | NoteIn the example, there are $$$4$$$ polygons in the market. It's easy to see that an equilateral triangle (a regular $$$3$$$-sided polygon) is not beautiful, a square (a regular $$$4$$$-sided polygon) is beautiful and a regular $$$12$$$-sided polygon (is shown below) is beautiful as well. | Java 8 | standard input | [
"geometry",
"math"
] | 07e56d4031bcb119d2f684203f7ed133 | The first line contains a single integer $$$t$$$ ($$$1 \le t \le 10^4$$$)Β β the number of polygons in the market. Each of the next $$$t$$$ lines contains a single integer $$$n_i$$$ ($$$3 \le n_i \le 10^9$$$): it means that the $$$i$$$-th polygon is a regular $$$n_i$$$-sided polygon. | 800 | For each polygon, print YES if it's beautiful or NO otherwise (case insensitive). | standard output | |
PASSED | 981fa89f0800748c0477beb020443d8f | train_002.jsonl | 1592921100 | Lee is going to fashionably decorate his house for a party, using some regular convex polygons...Lee thinks a regular $$$n$$$-sided (convex) polygon is beautiful if and only if he can rotate it in such a way that at least one of its edges is parallel to the $$$OX$$$-axis and at least one of its edges is parallel to the... | 256 megabytes | import java.util.Scanner;
import java.util.TreeSet;
public class FashionabLee_1369A {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
int t = sc.nextInt();
while(t-- > 0) {
long n = sc.nextLong();
if(n%4 == 0) {
System.ou... | Java | ["4\n3\n4\n12\n1000000000"] | 2 seconds | ["NO\nYES\nYES\nYES"] | NoteIn the example, there are $$$4$$$ polygons in the market. It's easy to see that an equilateral triangle (a regular $$$3$$$-sided polygon) is not beautiful, a square (a regular $$$4$$$-sided polygon) is beautiful and a regular $$$12$$$-sided polygon (is shown below) is beautiful as well. | Java 8 | standard input | [
"geometry",
"math"
] | 07e56d4031bcb119d2f684203f7ed133 | The first line contains a single integer $$$t$$$ ($$$1 \le t \le 10^4$$$)Β β the number of polygons in the market. Each of the next $$$t$$$ lines contains a single integer $$$n_i$$$ ($$$3 \le n_i \le 10^9$$$): it means that the $$$i$$$-th polygon is a regular $$$n_i$$$-sided polygon. | 800 | For each polygon, print YES if it's beautiful or NO otherwise (case insensitive). | standard output | |
PASSED | fbc2757dba57bba5303324d5b8266495 | train_002.jsonl | 1592921100 | Lee is going to fashionably decorate his house for a party, using some regular convex polygons...Lee thinks a regular $$$n$$$-sided (convex) polygon is beautiful if and only if he can rotate it in such a way that at least one of its edges is parallel to the $$$OX$$$-axis and at least one of its edges is parallel to the... | 256 megabytes | import java.util.Scanner;
public class Fashionablee
{
public static void main(String args[])
{
Scanner sc = new Scanner(System.in);
int t = sc.nextInt();
for(int i = 1;i <= t;i++)
{
long n = sc.nextLong();
if(n > 3&& n%4 == 0)
System.out.println("YES");
else
System.out.println("NO");
}
}
}
| Java | ["4\n3\n4\n12\n1000000000"] | 2 seconds | ["NO\nYES\nYES\nYES"] | NoteIn the example, there are $$$4$$$ polygons in the market. It's easy to see that an equilateral triangle (a regular $$$3$$$-sided polygon) is not beautiful, a square (a regular $$$4$$$-sided polygon) is beautiful and a regular $$$12$$$-sided polygon (is shown below) is beautiful as well. | Java 8 | standard input | [
"geometry",
"math"
] | 07e56d4031bcb119d2f684203f7ed133 | The first line contains a single integer $$$t$$$ ($$$1 \le t \le 10^4$$$)Β β the number of polygons in the market. Each of the next $$$t$$$ lines contains a single integer $$$n_i$$$ ($$$3 \le n_i \le 10^9$$$): it means that the $$$i$$$-th polygon is a regular $$$n_i$$$-sided polygon. | 800 | For each polygon, print YES if it's beautiful or NO otherwise (case insensitive). | standard output | |
PASSED | 83261ab275fe616b8b245767aab9a357 | train_002.jsonl | 1592921100 | Lee is going to fashionably decorate his house for a party, using some regular convex polygons...Lee thinks a regular $$$n$$$-sided (convex) polygon is beautiful if and only if he can rotate it in such a way that at least one of its edges is parallel to the $$$OX$$$-axis and at least one of its edges is parallel to the... | 256 megabytes | import java.util.*;
import java.lang.*;
import java.io.*;
/* Name of the class has to be "Main" only if the class is public. */
public class Ideone
{
public static void main (String[] args) throws java.lang.Exception
{
Scanner sc=new Scanner(System.in);
int t=sc.nextInt();
while(t!=0)
... | Java | ["4\n3\n4\n12\n1000000000"] | 2 seconds | ["NO\nYES\nYES\nYES"] | NoteIn the example, there are $$$4$$$ polygons in the market. It's easy to see that an equilateral triangle (a regular $$$3$$$-sided polygon) is not beautiful, a square (a regular $$$4$$$-sided polygon) is beautiful and a regular $$$12$$$-sided polygon (is shown below) is beautiful as well. | Java 8 | standard input | [
"geometry",
"math"
] | 07e56d4031bcb119d2f684203f7ed133 | The first line contains a single integer $$$t$$$ ($$$1 \le t \le 10^4$$$)Β β the number of polygons in the market. Each of the next $$$t$$$ lines contains a single integer $$$n_i$$$ ($$$3 \le n_i \le 10^9$$$): it means that the $$$i$$$-th polygon is a regular $$$n_i$$$-sided polygon. | 800 | For each polygon, print YES if it's beautiful or NO otherwise (case insensitive). | standard output | |
PASSED | 31d2a751b109cafc41ebd2bd27aea8fe | train_002.jsonl | 1568822700 | Alex decided to go on a touristic trip over the country.For simplicity let's assume that the country has $$$n$$$ cities and $$$m$$$ bidirectional roads connecting them. Alex lives in city $$$s$$$ and initially located in it. To compare different cities Alex assigned each city a score $$$w_i$$$ which is as high as inter... | 256 megabytes | import java.io.ByteArrayInputStream;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.nio.charset.StandardCharsets;
import java.util.ArrayList;
import java.util.Arrays;
import java.u... | Java | ["5 7\n2 2 8 6 9\n1 2\n1 3\n2 4\n3 2\n4 5\n2 5\n1 5\n2", "10 12\n1 7 1 9 3 3 6 30 1 10\n1 2\n1 3\n3 5\n5 7\n2 3\n5 4\n6 9\n4 6\n3 7\n6 8\n9 4\n9 10\n6"] | 2 seconds | ["27", "61"] | null | Java 8 | standard input | [
"dp",
"greedy",
"graphs",
"dsu",
"dfs and similar",
"trees"
] | 824c7f11e6c2997c98741d314cdd1970 | First line of input contains two integers $$$n$$$ and $$$m$$$, ($$$1 \le n \le 2 \cdot 10^5$$$, $$$0 \le m \le 2 \cdot 10^5$$$) which are numbers of cities and roads in the country. Second line contains $$$n$$$ integers $$$w_1, w_2, \ldots, w_n$$$ ($$$0 \le w_i \le 10^9$$$) which are scores of all cities. The following... | 2,200 | Output single integer which is the maximum possible sum of scores of visited cities. | standard output | |
PASSED | 3af2172b7439bf368e3ca2cd38659619 | train_002.jsonl | 1568822700 | Alex decided to go on a touristic trip over the country.For simplicity let's assume that the country has $$$n$$$ cities and $$$m$$$ bidirectional roads connecting them. Alex lives in city $$$s$$$ and initially located in it. To compare different cities Alex assigned each city a score $$$w_i$$$ which is as high as inter... | 256 megabytes | import java.io.BufferedOutputStream;
import java.io.BufferedReader;
import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.PrintStream;
import java.util.Locale;
import java.util.StringTokenizer;
public class Solution implements Runn... | Java | ["5 7\n2 2 8 6 9\n1 2\n1 3\n2 4\n3 2\n4 5\n2 5\n1 5\n2", "10 12\n1 7 1 9 3 3 6 30 1 10\n1 2\n1 3\n3 5\n5 7\n2 3\n5 4\n6 9\n4 6\n3 7\n6 8\n9 4\n9 10\n6"] | 2 seconds | ["27", "61"] | null | Java 8 | standard input | [
"dp",
"greedy",
"graphs",
"dsu",
"dfs and similar",
"trees"
] | 824c7f11e6c2997c98741d314cdd1970 | First line of input contains two integers $$$n$$$ and $$$m$$$, ($$$1 \le n \le 2 \cdot 10^5$$$, $$$0 \le m \le 2 \cdot 10^5$$$) which are numbers of cities and roads in the country. Second line contains $$$n$$$ integers $$$w_1, w_2, \ldots, w_n$$$ ($$$0 \le w_i \le 10^9$$$) which are scores of all cities. The following... | 2,200 | Output single integer which is the maximum possible sum of scores of visited cities. | standard output | |
PASSED | ad15e83eac62eecc850b5ad10a499b1a | train_002.jsonl | 1568822700 | Alex decided to go on a touristic trip over the country.For simplicity let's assume that the country has $$$n$$$ cities and $$$m$$$ bidirectional roads connecting them. Alex lives in city $$$s$$$ and initially located in it. To compare different cities Alex assigned each city a score $$$w_i$$$ which is as high as inter... | 256 megabytes | import java.io.OutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import java.io.PrintWriter;
import java.io.BufferedWriter;
import java.util.Collection;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.ArrayList;
import java.util.List;
impor... | Java | ["5 7\n2 2 8 6 9\n1 2\n1 3\n2 4\n3 2\n4 5\n2 5\n1 5\n2", "10 12\n1 7 1 9 3 3 6 30 1 10\n1 2\n1 3\n3 5\n5 7\n2 3\n5 4\n6 9\n4 6\n3 7\n6 8\n9 4\n9 10\n6"] | 2 seconds | ["27", "61"] | null | Java 8 | standard input | [
"dp",
"greedy",
"graphs",
"dsu",
"dfs and similar",
"trees"
] | 824c7f11e6c2997c98741d314cdd1970 | First line of input contains two integers $$$n$$$ and $$$m$$$, ($$$1 \le n \le 2 \cdot 10^5$$$, $$$0 \le m \le 2 \cdot 10^5$$$) which are numbers of cities and roads in the country. Second line contains $$$n$$$ integers $$$w_1, w_2, \ldots, w_n$$$ ($$$0 \le w_i \le 10^9$$$) which are scores of all cities. The following... | 2,200 | Output single integer which is the maximum possible sum of scores of visited cities. | standard output | |
PASSED | 14be850775a2a69be34f50157605588e | train_002.jsonl | 1568822700 | Alex decided to go on a touristic trip over the country.For simplicity let's assume that the country has $$$n$$$ cities and $$$m$$$ bidirectional roads connecting them. Alex lives in city $$$s$$$ and initially located in it. To compare different cities Alex assigned each city a score $$$w_i$$$ which is as high as inter... | 256 megabytes | import java.io.BufferedReader;
import java.io.BufferedWriter;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.OutputStreamWriter;
import java.util.*;
import static java.util.Arrays.sort;
import static java.util.Collections.sort;
import static java.util.Arrays.fill;
import static java.util.... | Java | ["5 7\n2 2 8 6 9\n1 2\n1 3\n2 4\n3 2\n4 5\n2 5\n1 5\n2", "10 12\n1 7 1 9 3 3 6 30 1 10\n1 2\n1 3\n3 5\n5 7\n2 3\n5 4\n6 9\n4 6\n3 7\n6 8\n9 4\n9 10\n6"] | 2 seconds | ["27", "61"] | null | Java 8 | standard input | [
"dp",
"greedy",
"graphs",
"dsu",
"dfs and similar",
"trees"
] | 824c7f11e6c2997c98741d314cdd1970 | First line of input contains two integers $$$n$$$ and $$$m$$$, ($$$1 \le n \le 2 \cdot 10^5$$$, $$$0 \le m \le 2 \cdot 10^5$$$) which are numbers of cities and roads in the country. Second line contains $$$n$$$ integers $$$w_1, w_2, \ldots, w_n$$$ ($$$0 \le w_i \le 10^9$$$) which are scores of all cities. The following... | 2,200 | Output single integer which is the maximum possible sum of scores of visited cities. | standard output | |
PASSED | 784fcbcbd228bd705583b82a26388d39 | train_002.jsonl | 1568822700 | Alex decided to go on a touristic trip over the country.For simplicity let's assume that the country has $$$n$$$ cities and $$$m$$$ bidirectional roads connecting them. Alex lives in city $$$s$$$ and initially located in it. To compare different cities Alex assigned each city a score $$$w_i$$$ which is as high as inter... | 256 megabytes | import java.util.*;
import java.io.*;
public class Main{
static PrintWriter out;
static InputReader in;
public static void main(String args[]){
out = new PrintWriter(System.out);
in = new InputReader();
new Main();
out.flush(); out.close();
}
Main(){
solve(... | Java | ["5 7\n2 2 8 6 9\n1 2\n1 3\n2 4\n3 2\n4 5\n2 5\n1 5\n2", "10 12\n1 7 1 9 3 3 6 30 1 10\n1 2\n1 3\n3 5\n5 7\n2 3\n5 4\n6 9\n4 6\n3 7\n6 8\n9 4\n9 10\n6"] | 2 seconds | ["27", "61"] | null | Java 8 | standard input | [
"dp",
"greedy",
"graphs",
"dsu",
"dfs and similar",
"trees"
] | 824c7f11e6c2997c98741d314cdd1970 | First line of input contains two integers $$$n$$$ and $$$m$$$, ($$$1 \le n \le 2 \cdot 10^5$$$, $$$0 \le m \le 2 \cdot 10^5$$$) which are numbers of cities and roads in the country. Second line contains $$$n$$$ integers $$$w_1, w_2, \ldots, w_n$$$ ($$$0 \le w_i \le 10^9$$$) which are scores of all cities. The following... | 2,200 | Output single integer which is the maximum possible sum of scores of visited cities. | standard output | |
PASSED | b773a395e6f6a6b36eb47b6ef9e053ae | train_002.jsonl | 1568822700 | Alex decided to go on a touristic trip over the country.For simplicity let's assume that the country has $$$n$$$ cities and $$$m$$$ bidirectional roads connecting them. Alex lives in city $$$s$$$ and initially located in it. To compare different cities Alex assigned each city a score $$$w_i$$$ which is as high as inter... | 256 megabytes | import java.util.*;
import java.io.*;
public class Tourism {
static ArrayList<Edge>[] graph;
static ArrayList<Integer>[] aux;
static int[] pre;
static int[] ll;
static int cnt;
static int curCol;
static int[] col;
//todo switch this up to include the fact that the subtree can be explore... | Java | ["5 7\n2 2 8 6 9\n1 2\n1 3\n2 4\n3 2\n4 5\n2 5\n1 5\n2", "10 12\n1 7 1 9 3 3 6 30 1 10\n1 2\n1 3\n3 5\n5 7\n2 3\n5 4\n6 9\n4 6\n3 7\n6 8\n9 4\n9 10\n6"] | 2 seconds | ["27", "61"] | null | Java 8 | standard input | [
"dp",
"greedy",
"graphs",
"dsu",
"dfs and similar",
"trees"
] | 824c7f11e6c2997c98741d314cdd1970 | First line of input contains two integers $$$n$$$ and $$$m$$$, ($$$1 \le n \le 2 \cdot 10^5$$$, $$$0 \le m \le 2 \cdot 10^5$$$) which are numbers of cities and roads in the country. Second line contains $$$n$$$ integers $$$w_1, w_2, \ldots, w_n$$$ ($$$0 \le w_i \le 10^9$$$) which are scores of all cities. The following... | 2,200 | Output single integer which is the maximum possible sum of scores of visited cities. | standard output | |
PASSED | 0257667dc44b1b9308a281543d063fb7 | train_002.jsonl | 1568822700 | Alex decided to go on a touristic trip over the country.For simplicity let's assume that the country has $$$n$$$ cities and $$$m$$$ bidirectional roads connecting them. Alex lives in city $$$s$$$ and initially located in it. To compare different cities Alex assigned each city a score $$$w_i$$$ which is as high as inter... | 256 megabytes | import java.util.*;
import java.io.*;
public class Solution1{
public static Integer INT(String s){
return Integer.parseInt(s);
}
public static Long LONG(String s){
return Long.parseLong(s);
}
//=================================================================================================================... | Java | ["5 7\n2 2 8 6 9\n1 2\n1 3\n2 4\n3 2\n4 5\n2 5\n1 5\n2", "10 12\n1 7 1 9 3 3 6 30 1 10\n1 2\n1 3\n3 5\n5 7\n2 3\n5 4\n6 9\n4 6\n3 7\n6 8\n9 4\n9 10\n6"] | 2 seconds | ["27", "61"] | null | Java 8 | standard input | [
"dp",
"greedy",
"graphs",
"dsu",
"dfs and similar",
"trees"
] | 824c7f11e6c2997c98741d314cdd1970 | First line of input contains two integers $$$n$$$ and $$$m$$$, ($$$1 \le n \le 2 \cdot 10^5$$$, $$$0 \le m \le 2 \cdot 10^5$$$) which are numbers of cities and roads in the country. Second line contains $$$n$$$ integers $$$w_1, w_2, \ldots, w_n$$$ ($$$0 \le w_i \le 10^9$$$) which are scores of all cities. The following... | 2,200 | Output single integer which is the maximum possible sum of scores of visited cities. | standard output | |
PASSED | e97e0fd5dea115db6bd7f3d45caa28f8 | train_002.jsonl | 1586788500 | You are given a correct solution of the sudoku puzzle. If you don't know what is the sudoku, you can read about it here.The picture showing the correct sudoku solution:Blocks are bordered with bold black color.Your task is to change at most $$$9$$$ elements of this field (i.e. choose some $$$1 \le i, j \le 9$$$ and cha... | 256 megabytes | import java.io.*;
import java.util.HashSet;
import java.util.Set;
import java.util.StringTokenizer;
public class ProblemD {
public static InputStream inputStream = System.in;
public static OutputStream outputStream = System.out;
public static void main(String[] args) {
MyScanner scanner = new My... | Java | ["1\n154873296\n386592714\n729641835\n863725149\n975314628\n412968357\n631457982\n598236471\n247189563"] | 2 seconds | ["154873396\n336592714\n729645835\n863725145\n979314628\n412958357\n631457992\n998236471\n247789563"] | null | Java 8 | standard input | [
"constructive algorithms",
"implementation"
] | 0e21f1c48c8c0463b2ffa7275eddc633 | The first line of the input contains one integer $$$t$$$ ($$$1 \le t \le 10^4$$$) β the number of test cases. Then $$$t$$$ test cases follow. Each test case consists of $$$9$$$ lines, each line consists of $$$9$$$ characters from $$$1$$$ to $$$9$$$ without any whitespaces β the correct solution of the sudoku puzzle. | 1,300 | For each test case, print the answer β the initial field with at most $$$9$$$ changed elements so that the obtained field is anti-sudoku. If there are several solutions, you can print any. It is guaranteed that the answer exists. | standard output | |
PASSED | b6698becda9b61f65620588ec668d63f | train_002.jsonl | 1586788500 | You are given a correct solution of the sudoku puzzle. If you don't know what is the sudoku, you can read about it here.The picture showing the correct sudoku solution:Blocks are bordered with bold black color.Your task is to change at most $$$9$$$ elements of this field (i.e. choose some $$$1 \le i, j \le 9$$$ and cha... | 256 megabytes | import javax.management.DynamicMBean;
import javax.print.DocFlavor;
import javax.print.attribute.HashAttributeSet;
import java.awt.*;
import java.io.BufferedReader;
import java.io.CharConversionException;
import java.io.IOException;
import java.io.InputStreamReader;
import java.nio.file.attribute.FileAttribute;
import ... | Java | ["1\n154873296\n386592714\n729641835\n863725149\n975314628\n412968357\n631457982\n598236471\n247189563"] | 2 seconds | ["154873396\n336592714\n729645835\n863725145\n979314628\n412958357\n631457992\n998236471\n247789563"] | null | Java 8 | standard input | [
"constructive algorithms",
"implementation"
] | 0e21f1c48c8c0463b2ffa7275eddc633 | The first line of the input contains one integer $$$t$$$ ($$$1 \le t \le 10^4$$$) β the number of test cases. Then $$$t$$$ test cases follow. Each test case consists of $$$9$$$ lines, each line consists of $$$9$$$ characters from $$$1$$$ to $$$9$$$ without any whitespaces β the correct solution of the sudoku puzzle. | 1,300 | For each test case, print the answer β the initial field with at most $$$9$$$ changed elements so that the obtained field is anti-sudoku. If there are several solutions, you can print any. It is guaranteed that the answer exists. | standard output | |
PASSED | 33fb2b67e40e424b8ae0b9cf58e27808 | train_002.jsonl | 1586788500 | You are given a correct solution of the sudoku puzzle. If you don't know what is the sudoku, you can read about it here.The picture showing the correct sudoku solution:Blocks are bordered with bold black color.Your task is to change at most $$$9$$$ elements of this field (i.e. choose some $$$1 \le i, j \le 9$$$ and cha... | 256 megabytes | import java.io.OutputStream;
import java.util.*;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.io.BufferedReader;
import java.io.BufferedWriter;
import java.io.File;
import java.io.FileNotFoundException;
import java.util.Arrays;
import ... | Java | ["1\n154873296\n386592714\n729641835\n863725149\n975314628\n412968357\n631457982\n598236471\n247189563"] | 2 seconds | ["154873396\n336592714\n729645835\n863725145\n979314628\n412958357\n631457992\n998236471\n247789563"] | null | Java 8 | standard input | [
"constructive algorithms",
"implementation"
] | 0e21f1c48c8c0463b2ffa7275eddc633 | The first line of the input contains one integer $$$t$$$ ($$$1 \le t \le 10^4$$$) β the number of test cases. Then $$$t$$$ test cases follow. Each test case consists of $$$9$$$ lines, each line consists of $$$9$$$ characters from $$$1$$$ to $$$9$$$ without any whitespaces β the correct solution of the sudoku puzzle. | 1,300 | For each test case, print the answer β the initial field with at most $$$9$$$ changed elements so that the obtained field is anti-sudoku. If there are several solutions, you can print any. It is guaranteed that the answer exists. | standard output | |
PASSED | 7ecf99357d515b9d581c199e53fecd19 | train_002.jsonl | 1586788500 | You are given a correct solution of the sudoku puzzle. If you don't know what is the sudoku, you can read about it here.The picture showing the correct sudoku solution:Blocks are bordered with bold black color.Your task is to change at most $$$9$$$ elements of this field (i.e. choose some $$$1 \le i, j \le 9$$$ and cha... | 256 megabytes | // Magic. Do not touch.
import java.io.*;
import java.math.*;
import java.util.*;
public class Main {
static class FastReader
{
private InputStream mIs;private byte[] buf = new byte[1024];private int curChar,numChars;public FastReader() { this(System.in); }public FastReader(InputStream is) { mIs = is;}... | Java | ["1\n154873296\n386592714\n729641835\n863725149\n975314628\n412968357\n631457982\n598236471\n247189563"] | 2 seconds | ["154873396\n336592714\n729645835\n863725145\n979314628\n412958357\n631457992\n998236471\n247789563"] | null | Java 8 | standard input | [
"constructive algorithms",
"implementation"
] | 0e21f1c48c8c0463b2ffa7275eddc633 | The first line of the input contains one integer $$$t$$$ ($$$1 \le t \le 10^4$$$) β the number of test cases. Then $$$t$$$ test cases follow. Each test case consists of $$$9$$$ lines, each line consists of $$$9$$$ characters from $$$1$$$ to $$$9$$$ without any whitespaces β the correct solution of the sudoku puzzle. | 1,300 | For each test case, print the answer β the initial field with at most $$$9$$$ changed elements so that the obtained field is anti-sudoku. If there are several solutions, you can print any. It is guaranteed that the answer exists. | standard output | |
PASSED | a6f30f5f49307e70c7dd3ab88061eb6c | train_002.jsonl | 1586788500 | You are given a correct solution of the sudoku puzzle. If you don't know what is the sudoku, you can read about it here.The picture showing the correct sudoku solution:Blocks are bordered with bold black color.Your task is to change at most $$$9$$$ elements of this field (i.e. choose some $$$1 \le i, j \le 9$$$ and cha... | 256 megabytes | // Magic. Do not touch.
import java.io.*;
import java.math.*;
import java.util.*;
public class Main {
static class FastReader
{
private InputStream mIs;private byte[] buf = new byte[1024];private int curChar,numChars;public FastReader() { this(System.in); }public FastReader(InputStream is) { mIs = is;}... | Java | ["1\n154873296\n386592714\n729641835\n863725149\n975314628\n412968357\n631457982\n598236471\n247189563"] | 2 seconds | ["154873396\n336592714\n729645835\n863725145\n979314628\n412958357\n631457992\n998236471\n247789563"] | null | Java 8 | standard input | [
"constructive algorithms",
"implementation"
] | 0e21f1c48c8c0463b2ffa7275eddc633 | The first line of the input contains one integer $$$t$$$ ($$$1 \le t \le 10^4$$$) β the number of test cases. Then $$$t$$$ test cases follow. Each test case consists of $$$9$$$ lines, each line consists of $$$9$$$ characters from $$$1$$$ to $$$9$$$ without any whitespaces β the correct solution of the sudoku puzzle. | 1,300 | For each test case, print the answer β the initial field with at most $$$9$$$ changed elements so that the obtained field is anti-sudoku. If there are several solutions, you can print any. It is guaranteed that the answer exists. | standard output | |
PASSED | 72716d385bc8f484afbd4790eb9f9249 | train_002.jsonl | 1586788500 | You are given a correct solution of the sudoku puzzle. If you don't know what is the sudoku, you can read about it here.The picture showing the correct sudoku solution:Blocks are bordered with bold black color.Your task is to change at most $$$9$$$ elements of this field (i.e. choose some $$$1 \le i, j \le 9$$$ and cha... | 256 megabytes | // Magic. Do not touch.
import java.io.*;
import java.math.*;
import java.util.*;
public class Main {
static class FastReader
{
private InputStream mIs;private byte[] buf = new byte[1024];private int curChar,numChars;public FastReader() { this(System.in); }public FastReader(InputStream is) { mIs = is;}... | Java | ["1\n154873296\n386592714\n729641835\n863725149\n975314628\n412968357\n631457982\n598236471\n247189563"] | 2 seconds | ["154873396\n336592714\n729645835\n863725145\n979314628\n412958357\n631457992\n998236471\n247789563"] | null | Java 8 | standard input | [
"constructive algorithms",
"implementation"
] | 0e21f1c48c8c0463b2ffa7275eddc633 | The first line of the input contains one integer $$$t$$$ ($$$1 \le t \le 10^4$$$) β the number of test cases. Then $$$t$$$ test cases follow. Each test case consists of $$$9$$$ lines, each line consists of $$$9$$$ characters from $$$1$$$ to $$$9$$$ without any whitespaces β the correct solution of the sudoku puzzle. | 1,300 | For each test case, print the answer β the initial field with at most $$$9$$$ changed elements so that the obtained field is anti-sudoku. If there are several solutions, you can print any. It is guaranteed that the answer exists. | standard output | |
PASSED | dab74cdb68d5a503d2845153087a70a3 | train_002.jsonl | 1586788500 | You are given a correct solution of the sudoku puzzle. If you don't know what is the sudoku, you can read about it here.The picture showing the correct sudoku solution:Blocks are bordered with bold black color.Your task is to change at most $$$9$$$ elements of this field (i.e. choose some $$$1 \le i, j \le 9$$$ and cha... | 256 megabytes | /*
Sugoi
*/
import java.util.*;
import java.io.*;
import java.math.*;
public class D
{
public static void main(String arima[]) throws Exception
{
BufferedReader infile = new BufferedReader(new InputStreamReader(System.in));
StringTokenizer st = new StringTokenizer(infile.readLine(... | Java | ["1\n154873296\n386592714\n729641835\n863725149\n975314628\n412968357\n631457982\n598236471\n247189563"] | 2 seconds | ["154873396\n336592714\n729645835\n863725145\n979314628\n412958357\n631457992\n998236471\n247789563"] | null | Java 8 | standard input | [
"constructive algorithms",
"implementation"
] | 0e21f1c48c8c0463b2ffa7275eddc633 | The first line of the input contains one integer $$$t$$$ ($$$1 \le t \le 10^4$$$) β the number of test cases. Then $$$t$$$ test cases follow. Each test case consists of $$$9$$$ lines, each line consists of $$$9$$$ characters from $$$1$$$ to $$$9$$$ without any whitespaces β the correct solution of the sudoku puzzle. | 1,300 | For each test case, print the answer β the initial field with at most $$$9$$$ changed elements so that the obtained field is anti-sudoku. If there are several solutions, you can print any. It is guaranteed that the answer exists. | standard output | |
PASSED | 45881a85dd8284fd6b9ce0d246ddbca5 | train_002.jsonl | 1586788500 | You are given a correct solution of the sudoku puzzle. If you don't know what is the sudoku, you can read about it here.The picture showing the correct sudoku solution:Blocks are bordered with bold black color.Your task is to change at most $$$9$$$ elements of this field (i.e. choose some $$$1 \le i, j \le 9$$$ and cha... | 256 megabytes | import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.util.*;
public class Solution {
public static void main(String[] args){
try{
BufferedReader br=new BufferedReader(new InputStreamReader(System.in));
int t=Integer.parseInt(br.readLine());
for(in... | Java | ["1\n154873296\n386592714\n729641835\n863725149\n975314628\n412968357\n631457982\n598236471\n247189563"] | 2 seconds | ["154873396\n336592714\n729645835\n863725145\n979314628\n412958357\n631457992\n998236471\n247789563"] | null | Java 8 | standard input | [
"constructive algorithms",
"implementation"
] | 0e21f1c48c8c0463b2ffa7275eddc633 | The first line of the input contains one integer $$$t$$$ ($$$1 \le t \le 10^4$$$) β the number of test cases. Then $$$t$$$ test cases follow. Each test case consists of $$$9$$$ lines, each line consists of $$$9$$$ characters from $$$1$$$ to $$$9$$$ without any whitespaces β the correct solution of the sudoku puzzle. | 1,300 | For each test case, print the answer β the initial field with at most $$$9$$$ changed elements so that the obtained field is anti-sudoku. If there are several solutions, you can print any. It is guaranteed that the answer exists. | standard output | |
PASSED | 67ef30d6ce34d20211932529a7fcc20a | train_002.jsonl | 1586788500 | You are given a correct solution of the sudoku puzzle. If you don't know what is the sudoku, you can read about it here.The picture showing the correct sudoku solution:Blocks are bordered with bold black color.Your task is to change at most $$$9$$$ elements of this field (i.e. choose some $$$1 \le i, j \le 9$$$ and cha... | 256 megabytes | import java.util.*;
public class D {
public static void main(String args[]) {
Scanner scn = new Scanner(System.in);
int t = scn.nextInt();
scn.nextLine();
while (t-- > 0) {
for (int i = 0; i < 9; ++i) {
char c[] = scn.nextLine().toCharArray();
... | Java | ["1\n154873296\n386592714\n729641835\n863725149\n975314628\n412968357\n631457982\n598236471\n247189563"] | 2 seconds | ["154873396\n336592714\n729645835\n863725145\n979314628\n412958357\n631457992\n998236471\n247789563"] | null | Java 8 | standard input | [
"constructive algorithms",
"implementation"
] | 0e21f1c48c8c0463b2ffa7275eddc633 | The first line of the input contains one integer $$$t$$$ ($$$1 \le t \le 10^4$$$) β the number of test cases. Then $$$t$$$ test cases follow. Each test case consists of $$$9$$$ lines, each line consists of $$$9$$$ characters from $$$1$$$ to $$$9$$$ without any whitespaces β the correct solution of the sudoku puzzle. | 1,300 | For each test case, print the answer β the initial field with at most $$$9$$$ changed elements so that the obtained field is anti-sudoku. If there are several solutions, you can print any. It is guaranteed that the answer exists. | standard output | |
PASSED | 8a85fb731fefbf63b54ffd85bf6c5fc9 | train_002.jsonl | 1586788500 | You are given a correct solution of the sudoku puzzle. If you don't know what is the sudoku, you can read about it here.The picture showing the correct sudoku solution:Blocks are bordered with bold black color.Your task is to change at most $$$9$$$ elements of this field (i.e. choose some $$$1 \le i, j \le 9$$$ and cha... | 256 megabytes | import java.util.*;
import java.io.*;
public class try20 {
public static void main(String[] args)throws IOException{
BufferedReader br=new BufferedReader(new InputStreamReader(System.in));
int t=Integer.parseInt(br.readLine());
while(t-->0)
{
int ar[][]=... | Java | ["1\n154873296\n386592714\n729641835\n863725149\n975314628\n412968357\n631457982\n598236471\n247189563"] | 2 seconds | ["154873396\n336592714\n729645835\n863725145\n979314628\n412958357\n631457992\n998236471\n247789563"] | null | Java 8 | standard input | [
"constructive algorithms",
"implementation"
] | 0e21f1c48c8c0463b2ffa7275eddc633 | The first line of the input contains one integer $$$t$$$ ($$$1 \le t \le 10^4$$$) β the number of test cases. Then $$$t$$$ test cases follow. Each test case consists of $$$9$$$ lines, each line consists of $$$9$$$ characters from $$$1$$$ to $$$9$$$ without any whitespaces β the correct solution of the sudoku puzzle. | 1,300 | For each test case, print the answer β the initial field with at most $$$9$$$ changed elements so that the obtained field is anti-sudoku. If there are several solutions, you can print any. It is guaranteed that the answer exists. | standard output | |
PASSED | 1e14255e925173cfa2f9da123a0e8124 | train_002.jsonl | 1586788500 | You are given a correct solution of the sudoku puzzle. If you don't know what is the sudoku, you can read about it here.The picture showing the correct sudoku solution:Blocks are bordered with bold black color.Your task is to change at most $$$9$$$ elements of this field (i.e. choose some $$$1 \le i, j \le 9$$$ and cha... | 256 megabytes | import java.io.*;
public class AntiSudoku {
static Integer[] dp;
static int INF = (int) 1e9 + 7;
public static void main(String[] args) throws IOException {
BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
PrintWriter out = new PrintWriter(new BufferedWriter(new Ou... | Java | ["1\n154873296\n386592714\n729641835\n863725149\n975314628\n412968357\n631457982\n598236471\n247189563"] | 2 seconds | ["154873396\n336592714\n729645835\n863725145\n979314628\n412958357\n631457992\n998236471\n247789563"] | null | Java 8 | standard input | [
"constructive algorithms",
"implementation"
] | 0e21f1c48c8c0463b2ffa7275eddc633 | The first line of the input contains one integer $$$t$$$ ($$$1 \le t \le 10^4$$$) β the number of test cases. Then $$$t$$$ test cases follow. Each test case consists of $$$9$$$ lines, each line consists of $$$9$$$ characters from $$$1$$$ to $$$9$$$ without any whitespaces β the correct solution of the sudoku puzzle. | 1,300 | For each test case, print the answer β the initial field with at most $$$9$$$ changed elements so that the obtained field is anti-sudoku. If there are several solutions, you can print any. It is guaranteed that the answer exists. | standard output | |
PASSED | 27f90227ea3e683f222b84ebd0efca9f | train_002.jsonl | 1586788500 | You are given a correct solution of the sudoku puzzle. If you don't know what is the sudoku, you can read about it here.The picture showing the correct sudoku solution:Blocks are bordered with bold black color.Your task is to change at most $$$9$$$ elements of this field (i.e. choose some $$$1 \le i, j \le 9$$$ and cha... | 256 megabytes | import java.util.*;
import java.io.*;
public class OO7
{
public static void main(String[] args) throws IOException
{
BufferedReader br=new BufferedReader(new InputStreamReader(System.in));
int T=Integer.parseInt(br.readLine());
while(T-->0)
{
String[] s=new String[9];
for(int i=0;i<9;i++)
... | Java | ["1\n154873296\n386592714\n729641835\n863725149\n975314628\n412968357\n631457982\n598236471\n247189563"] | 2 seconds | ["154873396\n336592714\n729645835\n863725145\n979314628\n412958357\n631457992\n998236471\n247789563"] | null | Java 8 | standard input | [
"constructive algorithms",
"implementation"
] | 0e21f1c48c8c0463b2ffa7275eddc633 | The first line of the input contains one integer $$$t$$$ ($$$1 \le t \le 10^4$$$) β the number of test cases. Then $$$t$$$ test cases follow. Each test case consists of $$$9$$$ lines, each line consists of $$$9$$$ characters from $$$1$$$ to $$$9$$$ without any whitespaces β the correct solution of the sudoku puzzle. | 1,300 | For each test case, print the answer β the initial field with at most $$$9$$$ changed elements so that the obtained field is anti-sudoku. If there are several solutions, you can print any. It is guaranteed that the answer exists. | standard output | |
PASSED | 60c72c7ff26bef7aec5b83ef8307e2f1 | train_002.jsonl | 1395502200 | This problem has nothing to do with Little Chris. It is about hill climbers instead (and Chris definitely isn't one).There are n hills arranged on a line, each in the form of a vertical line segment with one endpoint on the ground. The hills are numbered with numbers from 1 to n from left to right. The i-th hill stands... | 256 megabytes | import java.io.*;
import java.util.*;
public class HillClimbing {
static class Hill{
int x;
long y;
Hill(int x, long y){
this.x=x;
this.y=y;
}
}
static class Climbers{
int a, b;
Climbers(int a,int b){
this.a =a;
... | Java | ["6\n1 4\n2 1\n3 2\n4 3\n6 4\n7 4\n3\n3 1\n5 6\n2 3"] | 1 second | ["5 6 3"] | null | Java 11 | standard input | [
"geometry",
"trees",
"dfs and similar"
] | b8438567bb30f91e165502f1dc365546 | The first line of input contains a single integer n (1ββ€βnββ€β105), the number of hills. The next n lines describe the hills. The i-th of them contains two space-separated integers xi, yi (1ββ€βxiββ€β107; 1ββ€βyiββ€β1011), the position and the height of the i-th hill. The hills are given in the ascending order of xi, i.e., ... | 2,200 | In a single line output m space-separated integers, where the i-th integer is the number of the meeting hill for the members of the i-th team. | standard output | |
PASSED | 6c3d026028b211f6d5b238292886063e | train_002.jsonl | 1395502200 | This problem has nothing to do with Little Chris. It is about hill climbers instead (and Chris definitely isn't one).There are n hills arranged on a line, each in the form of a vertical line segment with one endpoint on the ground. The hills are numbered with numbers from 1 to n from left to right. The i-th hill stands... | 256 megabytes | import java.io.*;
import java.util.*;
public class HillClimbing {
static class Hill{
int x;
long y;
Hill(int x, long y){
this.x=x;
this.y=y;
}
}
static class Climbers{
int a, b;
Climbers(int a,int b){
this.a =a;
... | Java | ["6\n1 4\n2 1\n3 2\n4 3\n6 4\n7 4\n3\n3 1\n5 6\n2 3"] | 1 second | ["5 6 3"] | null | Java 11 | standard input | [
"geometry",
"trees",
"dfs and similar"
] | b8438567bb30f91e165502f1dc365546 | The first line of input contains a single integer n (1ββ€βnββ€β105), the number of hills. The next n lines describe the hills. The i-th of them contains two space-separated integers xi, yi (1ββ€βxiββ€β107; 1ββ€βyiββ€β1011), the position and the height of the i-th hill. The hills are given in the ascending order of xi, i.e., ... | 2,200 | In a single line output m space-separated integers, where the i-th integer is the number of the meeting hill for the members of the i-th team. | standard output | |
PASSED | cfa5b2326d98b850ddb582dce9f8388e | train_002.jsonl | 1361374200 | A k-multiple free set is a set of integers where there is no pair of integers where one is equal to another integer multiplied by k. That is, there are no two integers x and y (xβ<βy) from the set, such that yβ=βxΒ·k.You're given a set of n distinct positive integers. Your task is to find the size of it's largest k-m... | 256 megabytes |
import java.io.BufferedReader;
import java.io.File;
import java.io.FileNotFoundException;
import java.io.FileReader;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.util.Arrays;
import java.util.StringTokenizer;
import java.util.TreeSet;... | Java | ["6 2\n2 3 6 5 4 10"] | 2 seconds | ["3"] | NoteIn the sample input one of the possible maximum 2-multiple free subsets is {4, 5, 6}. | Java 8 | standard input | [
"binary search",
"sortings",
"greedy"
] | 4ea1de740aa131cae632c612e1d582ed | The first line of the input contains two integers n and k (1ββ€βnββ€β105,β1ββ€βkββ€β109). The next line contains a list of n distinct positive integers a1,βa2,β...,βan (1ββ€βaiββ€β109). All the numbers in the lines are separated by single spaces. | 1,500 | On the only line of the output print the size of the largest k-multiple free subset of {a1,βa2,β...,βan}. | standard output | |
PASSED | 740b31c3c398b401ebdc2788716be0db | train_002.jsonl | 1361374200 | A k-multiple free set is a set of integers where there is no pair of integers where one is equal to another integer multiplied by k. That is, there are no two integers x and y (xβ<βy) from the set, such that yβ=βxΒ·k.You're given a set of n distinct positive integers. Your task is to find the size of it's largest k-m... | 256 megabytes |
import java.util.*;
import java.io.*;
public class Main {
public static void main(String[] args) {
FastReader in = new FastReader();
int n = in.nextInt(), k = in.nextInt();
int[] x = new int[n];
Set<Integer> set = new HashSet<Integer>();
for (int i = 0; i < n; i++) {
... | Java | ["6 2\n2 3 6 5 4 10"] | 2 seconds | ["3"] | NoteIn the sample input one of the possible maximum 2-multiple free subsets is {4, 5, 6}. | Java 8 | standard input | [
"binary search",
"sortings",
"greedy"
] | 4ea1de740aa131cae632c612e1d582ed | The first line of the input contains two integers n and k (1ββ€βnββ€β105,β1ββ€βkββ€β109). The next line contains a list of n distinct positive integers a1,βa2,β...,βan (1ββ€βaiββ€β109). All the numbers in the lines are separated by single spaces. | 1,500 | On the only line of the output print the size of the largest k-multiple free subset of {a1,βa2,β...,βan}. | standard output | |
PASSED | 690e6940e879e7cc878148c9d3b3e1bd | train_002.jsonl | 1361374200 | A k-multiple free set is a set of integers where there is no pair of integers where one is equal to another integer multiplied by k. That is, there are no two integers x and y (xβ<βy) from the set, such that yβ=βxΒ·k.You're given a set of n distinct positive integers. Your task is to find the size of it's largest k-m... | 256 megabytes | //codeforces_275C
import java.io.*;
import java.util.*;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
import static java.lang.Math.*;
import java.math.*;
public class acm{
static PrintWriter go = new PrintWriter(System.out);
public static void main(String args[]) throws IOException,FileNotFoundE... | Java | ["6 2\n2 3 6 5 4 10"] | 2 seconds | ["3"] | NoteIn the sample input one of the possible maximum 2-multiple free subsets is {4, 5, 6}. | Java 8 | standard input | [
"binary search",
"sortings",
"greedy"
] | 4ea1de740aa131cae632c612e1d582ed | The first line of the input contains two integers n and k (1ββ€βnββ€β105,β1ββ€βkββ€β109). The next line contains a list of n distinct positive integers a1,βa2,β...,βan (1ββ€βaiββ€β109). All the numbers in the lines are separated by single spaces. | 1,500 | On the only line of the output print the size of the largest k-multiple free subset of {a1,βa2,β...,βan}. | standard output | |
PASSED | 29d7cb50dcdc8e7414be049ff51fe573 | train_002.jsonl | 1361374200 | A k-multiple free set is a set of integers where there is no pair of integers where one is equal to another integer multiplied by k. That is, there are no two integers x and y (xβ<βy) from the set, such that yβ=βxΒ·k.You're given a set of n distinct positive integers. Your task is to find the size of it's largest k-m... | 256 megabytes | /* / οΎοΎβ β β β β β β β β β β β γ
/ )\β β β β β β β β β β β β Y
(β β | ( Ν‘Β° ΝΚ Ν‘Β°οΌβ β(β γ
(β οΎβ Y βγ½-γ __οΌ
| _β qγ| γq |/
(β γΌ '_δΊΊ`γΌ οΎ
β |\ οΏ£ _δΊΊ'彑οΎ
β )\β β qβ β /
β β (\β #β /
β /β β β /α½£====================D-
/β β β /β \ \β β \
( (β )β β β β ) ).β )
(β β )β β β β β ( | /
|β /β β β β β β | /
[_] β β β β β [___] */
// Main Code at th... | Java | ["6 2\n2 3 6 5 4 10"] | 2 seconds | ["3"] | NoteIn the sample input one of the possible maximum 2-multiple free subsets is {4, 5, 6}. | Java 8 | standard input | [
"binary search",
"sortings",
"greedy"
] | 4ea1de740aa131cae632c612e1d582ed | The first line of the input contains two integers n and k (1ββ€βnββ€β105,β1ββ€βkββ€β109). The next line contains a list of n distinct positive integers a1,βa2,β...,βan (1ββ€βaiββ€β109). All the numbers in the lines are separated by single spaces. | 1,500 | On the only line of the output print the size of the largest k-multiple free subset of {a1,βa2,β...,βan}. | standard output | |
PASSED | 583d4f8fc0ffc5de3b8584e5bdf26e7d | train_002.jsonl | 1361374200 | A k-multiple free set is a set of integers where there is no pair of integers where one is equal to another integer multiplied by k. That is, there are no two integers x and y (xβ<βy) from the set, such that yβ=βxΒ·k.You're given a set of n distinct positive integers. Your task is to find the size of it's largest k-m... | 256 megabytes |
import java.io.*;
import java.math.BigInteger;
import java.util.*;
public class TaskC {
static Integer[][]dp;
static int n, m, ans;
static String s;
static TreeSet<Integer> primes;
static void generatePrimes()
{
primes = new TreeSet<>();
primes.add(2);
for (int i = ... | Java | ["6 2\n2 3 6 5 4 10"] | 2 seconds | ["3"] | NoteIn the sample input one of the possible maximum 2-multiple free subsets is {4, 5, 6}. | Java 8 | standard input | [
"binary search",
"sortings",
"greedy"
] | 4ea1de740aa131cae632c612e1d582ed | The first line of the input contains two integers n and k (1ββ€βnββ€β105,β1ββ€βkββ€β109). The next line contains a list of n distinct positive integers a1,βa2,β...,βan (1ββ€βaiββ€β109). All the numbers in the lines are separated by single spaces. | 1,500 | On the only line of the output print the size of the largest k-multiple free subset of {a1,βa2,β...,βan}. | standard output | |
PASSED | 2f5858476f7486ef46ac672d6abe00c2 | train_002.jsonl | 1361374200 | A k-multiple free set is a set of integers where there is no pair of integers where one is equal to another integer multiplied by k. That is, there are no two integers x and y (xβ<βy) from the set, such that yβ=βxΒ·k.You're given a set of n distinct positive integers. Your task is to find the size of it's largest k-m... | 256 megabytes | /*
* Remember a 7.0 student can know more than a 10.0 student.
* Grades don't determine intelligence, they test obedience.
* I Never Give Up.
*/
import java.util.*;
import java.util.Map.Entry;
import java.io.*;
import java.text.*;
import static java.lang.System.out;
import static java.util.Arrays.*;
import static... | Java | ["6 2\n2 3 6 5 4 10"] | 2 seconds | ["3"] | NoteIn the sample input one of the possible maximum 2-multiple free subsets is {4, 5, 6}. | Java 8 | standard input | [
"binary search",
"sortings",
"greedy"
] | 4ea1de740aa131cae632c612e1d582ed | The first line of the input contains two integers n and k (1ββ€βnββ€β105,β1ββ€βkββ€β109). The next line contains a list of n distinct positive integers a1,βa2,β...,βan (1ββ€βaiββ€β109). All the numbers in the lines are separated by single spaces. | 1,500 | On the only line of the output print the size of the largest k-multiple free subset of {a1,βa2,β...,βan}. | standard output | |
PASSED | e500b5ccca1e9722caeecb77e5a91c15 | train_002.jsonl | 1361374200 | A k-multiple free set is a set of integers where there is no pair of integers where one is equal to another integer multiplied by k. That is, there are no two integers x and y (xβ<βy) from the set, such that yβ=βxΒ·k.You're given a set of n distinct positive integers. Your task is to find the size of it's largest k-m... | 256 megabytes | import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.Arrays;
import java.util.HashSet;
public class kMultipleFreeSet {
public static void main(String[] args) throws IOException {
// TODO Auto-generated method stub
BufferedReader br = new BufferedReader(new... | Java | ["6 2\n2 3 6 5 4 10"] | 2 seconds | ["3"] | NoteIn the sample input one of the possible maximum 2-multiple free subsets is {4, 5, 6}. | Java 8 | standard input | [
"binary search",
"sortings",
"greedy"
] | 4ea1de740aa131cae632c612e1d582ed | The first line of the input contains two integers n and k (1ββ€βnββ€β105,β1ββ€βkββ€β109). The next line contains a list of n distinct positive integers a1,βa2,β...,βan (1ββ€βaiββ€β109). All the numbers in the lines are separated by single spaces. | 1,500 | On the only line of the output print the size of the largest k-multiple free subset of {a1,βa2,β...,βan}. | standard output | |
PASSED | b43b567cfa53bfc028948b95f2c664de | train_002.jsonl | 1361374200 | A k-multiple free set is a set of integers where there is no pair of integers where one is equal to another integer multiplied by k. That is, there are no two integers x and y (xβ<βy) from the set, such that yβ=βxΒ·k.You're given a set of n distinct positive integers. Your task is to find the size of it's largest k-m... | 256 megabytes | import java.io.*;
import java.util.*;
import java.text.*;
import java.lang.*;
import java.math.BigInteger;
import java.util.regex.*;
public class Myclass {
/* public static ArrayList a[]=new ArrayList[200001];
public static int cat[]=new int [200001];
static int upto[]=new int[200001];
static int maxi[]=new int[... | Java | ["6 2\n2 3 6 5 4 10"] | 2 seconds | ["3"] | NoteIn the sample input one of the possible maximum 2-multiple free subsets is {4, 5, 6}. | Java 8 | standard input | [
"binary search",
"sortings",
"greedy"
] | 4ea1de740aa131cae632c612e1d582ed | The first line of the input contains two integers n and k (1ββ€βnββ€β105,β1ββ€βkββ€β109). The next line contains a list of n distinct positive integers a1,βa2,β...,βan (1ββ€βaiββ€β109). All the numbers in the lines are separated by single spaces. | 1,500 | On the only line of the output print the size of the largest k-multiple free subset of {a1,βa2,β...,βan}. | standard output | |
PASSED | 21f759198f6ee03c4891deebb6f05d6b | train_002.jsonl | 1361374200 | A k-multiple free set is a set of integers where there is no pair of integers where one is equal to another integer multiplied by k. That is, there are no two integers x and y (xβ<βy) from the set, such that yβ=βxΒ·k.You're given a set of n distinct positive integers. Your task is to find the size of it's largest k-m... | 256 megabytes | import java.io.BufferedReader;
import java.io.FileNotFoundException;
import java.io.FileReader;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.util.ArrayList;
import java.util.Collections;
import java.util.HashSet;
import java.util.StringTokenizer;
public class Ma... | Java | ["6 2\n2 3 6 5 4 10"] | 2 seconds | ["3"] | NoteIn the sample input one of the possible maximum 2-multiple free subsets is {4, 5, 6}. | Java 8 | standard input | [
"binary search",
"sortings",
"greedy"
] | 4ea1de740aa131cae632c612e1d582ed | The first line of the input contains two integers n and k (1ββ€βnββ€β105,β1ββ€βkββ€β109). The next line contains a list of n distinct positive integers a1,βa2,β...,βan (1ββ€βaiββ€β109). All the numbers in the lines are separated by single spaces. | 1,500 | On the only line of the output print the size of the largest k-multiple free subset of {a1,βa2,β...,βan}. | standard output | |
PASSED | 54aecbf17f0bd0b75cdd405c8cb02235 | train_002.jsonl | 1361374200 | A k-multiple free set is a set of integers where there is no pair of integers where one is equal to another integer multiplied by k. That is, there are no two integers x and y (xβ<βy) from the set, such that yβ=βxΒ·k.You're given a set of n distinct positive integers. Your task is to find the size of it's largest k-m... | 256 megabytes | import java.io.BufferedWriter;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import java.io.OutputStreamWriter;
import java.io.PrintWriter;
import java.io.Writer;
import java.util.Arrays;
import java.util.HashSet;
import java.util.InputMismatchException;
public class Sticks
{
... | Java | ["6 2\n2 3 6 5 4 10"] | 2 seconds | ["3"] | NoteIn the sample input one of the possible maximum 2-multiple free subsets is {4, 5, 6}. | Java 8 | standard input | [
"binary search",
"sortings",
"greedy"
] | 4ea1de740aa131cae632c612e1d582ed | The first line of the input contains two integers n and k (1ββ€βnββ€β105,β1ββ€βkββ€β109). The next line contains a list of n distinct positive integers a1,βa2,β...,βan (1ββ€βaiββ€β109). All the numbers in the lines are separated by single spaces. | 1,500 | On the only line of the output print the size of the largest k-multiple free subset of {a1,βa2,β...,βan}. | standard output | |
PASSED | fa48bb86c2d02f5a0a0300ec6ad65059 | train_002.jsonl | 1361374200 | A k-multiple free set is a set of integers where there is no pair of integers where one is equal to another integer multiplied by k. That is, there are no two integers x and y (xβ<βy) from the set, such that yβ=βxΒ·k.You're given a set of n distinct positive integers. Your task is to find the size of it's largest k-m... | 256 megabytes | /*Talent is something you make bloom , instinct is something you polish*/
import java.io.*;
import java.math.*;
import java.util.*;
public class Main
{
static long mod=((long)1e9)+7;//toString
public static int gcd(int a,int b){if(b==0)return a;else return gcd(b,a%b);}
public static long pow_mod(long x,long... | Java | ["6 2\n2 3 6 5 4 10"] | 2 seconds | ["3"] | NoteIn the sample input one of the possible maximum 2-multiple free subsets is {4, 5, 6}. | Java 8 | standard input | [
"binary search",
"sortings",
"greedy"
] | 4ea1de740aa131cae632c612e1d582ed | The first line of the input contains two integers n and k (1ββ€βnββ€β105,β1ββ€βkββ€β109). The next line contains a list of n distinct positive integers a1,βa2,β...,βan (1ββ€βaiββ€β109). All the numbers in the lines are separated by single spaces. | 1,500 | On the only line of the output print the size of the largest k-multiple free subset of {a1,βa2,β...,βan}. | standard output | |
PASSED | 973c85ed9c1b3fe9f0975f3a1e1bf642 | train_002.jsonl | 1361374200 | A k-multiple free set is a set of integers where there is no pair of integers where one is equal to another integer multiplied by k. That is, there are no two integers x and y (xβ<βy) from the set, such that yβ=βxΒ·k.You're given a set of n distinct positive integers. Your task is to find the size of it's largest k-m... | 256 megabytes | import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.nio.Buffer;
import java.util.*;
public class Watermelon {
static long steps = 0;
public static void main(String[] args) throws IOException {
Scanner sc = new Scanner(System.in);
HashMap<Inte... | Java | ["6 2\n2 3 6 5 4 10"] | 2 seconds | ["3"] | NoteIn the sample input one of the possible maximum 2-multiple free subsets is {4, 5, 6}. | Java 8 | standard input | [
"binary search",
"sortings",
"greedy"
] | 4ea1de740aa131cae632c612e1d582ed | The first line of the input contains two integers n and k (1ββ€βnββ€β105,β1ββ€βkββ€β109). The next line contains a list of n distinct positive integers a1,βa2,β...,βan (1ββ€βaiββ€β109). All the numbers in the lines are separated by single spaces. | 1,500 | On the only line of the output print the size of the largest k-multiple free subset of {a1,βa2,β...,βan}. | standard output | |
PASSED | bafa35392206c75603a35b8818ffefee | train_002.jsonl | 1361374200 | A k-multiple free set is a set of integers where there is no pair of integers where one is equal to another integer multiplied by k. That is, there are no two integers x and y (xβ<βy) from the set, such that yβ=βxΒ·k.You're given a set of n distinct positive integers. Your task is to find the size of it's largest k-m... | 256 megabytes | import java.io.BufferedOutputStream;
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.util.Arrays;
import java.util.HashSet;
import java.util.StringTokenizer;
public class Round168C {
public static void main(String[] args) {
// TODO Auto-generated method stub... | Java | ["6 2\n2 3 6 5 4 10"] | 2 seconds | ["3"] | NoteIn the sample input one of the possible maximum 2-multiple free subsets is {4, 5, 6}. | Java 8 | standard input | [
"binary search",
"sortings",
"greedy"
] | 4ea1de740aa131cae632c612e1d582ed | The first line of the input contains two integers n and k (1ββ€βnββ€β105,β1ββ€βkββ€β109). The next line contains a list of n distinct positive integers a1,βa2,β...,βan (1ββ€βaiββ€β109). All the numbers in the lines are separated by single spaces. | 1,500 | On the only line of the output print the size of the largest k-multiple free subset of {a1,βa2,β...,βan}. | standard output | |
PASSED | bbfed8d51f05effc846be7a4b46c5ae8 | train_002.jsonl | 1361374200 | A k-multiple free set is a set of integers where there is no pair of integers where one is equal to another integer multiplied by k. That is, there are no two integers x and y (xβ<βy) from the set, such that yβ=βxΒ·k.You're given a set of n distinct positive integers. Your task is to find the size of it's largest k-m... | 256 megabytes |
/* BY - LAXMIKANT KATRE (laxmikant.katre) */
import java.io.*;
import java.util.*;
public class Main {
public static void main(String[] args) {
MyScanner sc = new MyScanner();
out = new PrintWriter(new BufferedOutputStream(System.out));
int n = sc.nextInt();
... | Java | ["6 2\n2 3 6 5 4 10"] | 2 seconds | ["3"] | NoteIn the sample input one of the possible maximum 2-multiple free subsets is {4, 5, 6}. | Java 8 | standard input | [
"binary search",
"sortings",
"greedy"
] | 4ea1de740aa131cae632c612e1d582ed | The first line of the input contains two integers n and k (1ββ€βnββ€β105,β1ββ€βkββ€β109). The next line contains a list of n distinct positive integers a1,βa2,β...,βan (1ββ€βaiββ€β109). All the numbers in the lines are separated by single spaces. | 1,500 | On the only line of the output print the size of the largest k-multiple free subset of {a1,βa2,β...,βan}. | standard output | |
PASSED | c0a2fdafe8c150a8e33fa63e04d6c4c6 | train_002.jsonl | 1361374200 | A k-multiple free set is a set of integers where there is no pair of integers where one is equal to another integer multiplied by k. That is, there are no two integers x and y (xβ<βy) from the set, such that yβ=βxΒ·k.You're given a set of n distinct positive integers. Your task is to find the size of it's largest k-m... | 256 megabytes |
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.math.BigInteger;
import java.util.*;
import java.lang.Math;
public class ACM {
private static int gcdThing(long a, long b) {
BigInteger b1 = BigInteger.valueOf(a);
BigInteger b2 = BigInteger.valueOf(b... | Java | ["6 2\n2 3 6 5 4 10"] | 2 seconds | ["3"] | NoteIn the sample input one of the possible maximum 2-multiple free subsets is {4, 5, 6}. | Java 8 | standard input | [
"binary search",
"sortings",
"greedy"
] | 4ea1de740aa131cae632c612e1d582ed | The first line of the input contains two integers n and k (1ββ€βnββ€β105,β1ββ€βkββ€β109). The next line contains a list of n distinct positive integers a1,βa2,β...,βan (1ββ€βaiββ€β109). All the numbers in the lines are separated by single spaces. | 1,500 | On the only line of the output print the size of the largest k-multiple free subset of {a1,βa2,β...,βan}. | standard output | |
PASSED | f5d355d9c082203cb6ef7be7c12d95ea | train_002.jsonl | 1361374200 | A k-multiple free set is a set of integers where there is no pair of integers where one is equal to another integer multiplied by k. That is, there are no two integers x and y (xβ<βy) from the set, such that yβ=βxΒ·k.You're given a set of n distinct positive integers. Your task is to find the size of it's largest k-m... | 256 megabytes | import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.*;
public class BOOL {
private static FastReader in = new FastReader();
public static void main(String[] args) {
int n=in.nextInt(),k=in.nextInt();
int a[]=new int[n],ans=0;
HashMap<Long,Long>M=... | Java | ["6 2\n2 3 6 5 4 10"] | 2 seconds | ["3"] | NoteIn the sample input one of the possible maximum 2-multiple free subsets is {4, 5, 6}. | Java 8 | standard input | [
"binary search",
"sortings",
"greedy"
] | 4ea1de740aa131cae632c612e1d582ed | The first line of the input contains two integers n and k (1ββ€βnββ€β105,β1ββ€βkββ€β109). The next line contains a list of n distinct positive integers a1,βa2,β...,βan (1ββ€βaiββ€β109). All the numbers in the lines are separated by single spaces. | 1,500 | On the only line of the output print the size of the largest k-multiple free subset of {a1,βa2,β...,βan}. | standard output | |
PASSED | 05ac2cddfadb473b64b7b4afc20c1954 | train_002.jsonl | 1361374200 | A k-multiple free set is a set of integers where there is no pair of integers where one is equal to another integer multiplied by k. That is, there are no two integers x and y (xβ<βy) from the set, such that yβ=βxΒ·k.You're given a set of n distinct positive integers. Your task is to find the size of it's largest k-m... | 256 megabytes | import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.*;
public class Main {
public static void main(String[] args) throws IOException {
Scanner input = new Scanner(System.in);
int a = input.nextInt();
long b = input.nextL... | Java | ["6 2\n2 3 6 5 4 10"] | 2 seconds | ["3"] | NoteIn the sample input one of the possible maximum 2-multiple free subsets is {4, 5, 6}. | Java 8 | standard input | [
"binary search",
"sortings",
"greedy"
] | 4ea1de740aa131cae632c612e1d582ed | The first line of the input contains two integers n and k (1ββ€βnββ€β105,β1ββ€βkββ€β109). The next line contains a list of n distinct positive integers a1,βa2,β...,βan (1ββ€βaiββ€β109). All the numbers in the lines are separated by single spaces. | 1,500 | On the only line of the output print the size of the largest k-multiple free subset of {a1,βa2,β...,βan}. | standard output | |
PASSED | 0c78103cffa4799d3f91885e3190c9d3 | train_002.jsonl | 1361374200 | A k-multiple free set is a set of integers where there is no pair of integers where one is equal to another integer multiplied by k. That is, there are no two integers x and y (xβ<βy) from the set, such that yβ=βxΒ·k.You're given a set of n distinct positive integers. Your task is to find the size of it's largest k-m... | 256 megabytes | import java.io.*;
import java.math.*;
import java.util.*;
@SuppressWarnings("Duplicates")
// author @mdazmat9
public class Main {
static Scanner sc = new Scanner(System.in);
static PrintWriter out = new PrintWriter(System.out);
public static void main(String[] args) throws IOException {
int test =... | Java | ["6 2\n2 3 6 5 4 10"] | 2 seconds | ["3"] | NoteIn the sample input one of the possible maximum 2-multiple free subsets is {4, 5, 6}. | Java 8 | standard input | [
"binary search",
"sortings",
"greedy"
] | 4ea1de740aa131cae632c612e1d582ed | The first line of the input contains two integers n and k (1ββ€βnββ€β105,β1ββ€βkββ€β109). The next line contains a list of n distinct positive integers a1,βa2,β...,βan (1ββ€βaiββ€β109). All the numbers in the lines are separated by single spaces. | 1,500 | On the only line of the output print the size of the largest k-multiple free subset of {a1,βa2,β...,βan}. | standard output | |
PASSED | 1aea9ebb2480777e7682b4ac8250ca81 | train_002.jsonl | 1361374200 | A k-multiple free set is a set of integers where there is no pair of integers where one is equal to another integer multiplied by k. That is, there are no two integers x and y (xβ<βy) from the set, such that yβ=βxΒ·k.You're given a set of n distinct positive integers. Your task is to find the size of it's largest k-m... | 256 megabytes | import java.util.*;
import java.io.*;
import java.math.*;
public class Main
{
static class Reader
{
private InputStream mIs;private byte[] buf = new byte[1024];private int curChar,numChars;public Reader() { this(System.in); }public Reader(InputStream is) { mIs = is;}
public int read() {if (nu... | Java | ["6 2\n2 3 6 5 4 10"] | 2 seconds | ["3"] | NoteIn the sample input one of the possible maximum 2-multiple free subsets is {4, 5, 6}. | Java 8 | standard input | [
"binary search",
"sortings",
"greedy"
] | 4ea1de740aa131cae632c612e1d582ed | The first line of the input contains two integers n and k (1ββ€βnββ€β105,β1ββ€βkββ€β109). The next line contains a list of n distinct positive integers a1,βa2,β...,βan (1ββ€βaiββ€β109). All the numbers in the lines are separated by single spaces. | 1,500 | On the only line of the output print the size of the largest k-multiple free subset of {a1,βa2,β...,βan}. | standard output | |
PASSED | 14c532b83d5bfb64db1e297165bfba58 | train_002.jsonl | 1361374200 | A k-multiple free set is a set of integers where there is no pair of integers where one is equal to another integer multiplied by k. That is, there are no two integers x and y (xβ<βy) from the set, such that yβ=βxΒ·k.You're given a set of n distinct positive integers. Your task is to find the size of it's largest k-m... | 256 megabytes | import java.io.* ;
import java.util.* ;
public class Solution{
static class FastReader
{
BufferedReader br;
StringTokenizer st;
public FastReader()
{
br = new BufferedReader(new
InputStreamReader(System.in));
}
String next()
... | Java | ["6 2\n2 3 6 5 4 10"] | 2 seconds | ["3"] | NoteIn the sample input one of the possible maximum 2-multiple free subsets is {4, 5, 6}. | Java 8 | standard input | [
"binary search",
"sortings",
"greedy"
] | 4ea1de740aa131cae632c612e1d582ed | The first line of the input contains two integers n and k (1ββ€βnββ€β105,β1ββ€βkββ€β109). The next line contains a list of n distinct positive integers a1,βa2,β...,βan (1ββ€βaiββ€β109). All the numbers in the lines are separated by single spaces. | 1,500 | On the only line of the output print the size of the largest k-multiple free subset of {a1,βa2,β...,βan}. | standard output | |
PASSED | 0dff02b2734014c9be6d6271c130a9b7 | train_002.jsonl | 1361374200 | A k-multiple free set is a set of integers where there is no pair of integers where one is equal to another integer multiplied by k. That is, there are no two integers x and y (xβ<βy) from the set, such that yβ=βxΒ·k.You're given a set of n distinct positive integers. Your task is to find the size of it's largest k-m... | 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 HashMap<Long,Long> hm = new HashMap<>();
public static void main(String[] args) throws Exception {
int n = sc.nextInt();
long k = sc.nextInt();
... | Java | ["6 2\n2 3 6 5 4 10"] | 2 seconds | ["3"] | NoteIn the sample input one of the possible maximum 2-multiple free subsets is {4, 5, 6}. | Java 8 | standard input | [
"binary search",
"sortings",
"greedy"
] | 4ea1de740aa131cae632c612e1d582ed | The first line of the input contains two integers n and k (1ββ€βnββ€β105,β1ββ€βkββ€β109). The next line contains a list of n distinct positive integers a1,βa2,β...,βan (1ββ€βaiββ€β109). All the numbers in the lines are separated by single spaces. | 1,500 | On the only line of the output print the size of the largest k-multiple free subset of {a1,βa2,β...,βan}. | standard output | |
PASSED | 4983c9dd47d8feb26c439313cccf8bdd | train_002.jsonl | 1361374200 | A k-multiple free set is a set of integers where there is no pair of integers where one is equal to another integer multiplied by k. That is, there are no two integers x and y (xβ<βy) from the set, such that yβ=βxΒ·k.You're given a set of n distinct positive integers. Your task is to find the size of it's largest k-m... | 256 megabytes | import java.io.BufferedReader;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.util.Arrays;
import java.util.BitSet;
import java.util.StringTokenizer;
public class Main {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
PrintWrite... | Java | ["6 2\n2 3 6 5 4 10"] | 2 seconds | ["3"] | NoteIn the sample input one of the possible maximum 2-multiple free subsets is {4, 5, 6}. | Java 8 | standard input | [
"binary search",
"sortings",
"greedy"
] | 4ea1de740aa131cae632c612e1d582ed | The first line of the input contains two integers n and k (1ββ€βnββ€β105,β1ββ€βkββ€β109). The next line contains a list of n distinct positive integers a1,βa2,β...,βan (1ββ€βaiββ€β109). All the numbers in the lines are separated by single spaces. | 1,500 | On the only line of the output print the size of the largest k-multiple free subset of {a1,βa2,β...,βan}. | standard output |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.