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
236cf46d0208c1d016a17c21c46dc048
train_001.jsonl
1595342100
You are given two arrays of integers $$$a_1,\ldots,a_n$$$ and $$$b_1,\ldots,b_m$$$.Your task is to find a non-empty array $$$c_1,\ldots,c_k$$$ that is a subsequence of $$$a_1,\ldots,a_n$$$, and also a subsequence of $$$b_1,\ldots,b_m$$$. If there are multiple answers, find one of the smallest possible length. If there ...
256 megabytes
import java.util.*; public class b1 { public static void main(String[] args) { Scanner sc=new Scanner(System.in); int t=sc.nextInt(); while(t-->0) { int n=sc.nextInt(); int m=sc.nextInt(); int arr[]=new int[n]; int brr[]=new int[m]; List<Integer> li=new ArrayList<Integer>(); List<Integer> li...
Java
["5\n4 5\n10 8 6 4\n1 2 3 4 5\n1 1\n3\n3\n1 1\n3\n2\n5 3\n1000 2 2 2 3\n3 1 5\n5 5\n1 2 3 4 5\n1 2 3 4 5"]
1 second
["YES\n1 4\nYES\n1 3\nNO\nYES\n1 3\nYES\n1 2"]
NoteIn the first test case, $$$[4]$$$ is a subsequence of $$$[10, 8, 6, 4]$$$ and $$$[1, 2, 3, 4, 5]$$$. This array has length $$$1$$$, it is the smallest possible length of a subsequence of both $$$a$$$ and $$$b$$$.In the third test case, no non-empty subsequences of both $$$[3]$$$ and $$$[2]$$$ exist, so the answer i...
Java 11
standard input
[ "brute force" ]
776a06c14c6fa3ef8664eec0b4d50824
The first line contains a single integer $$$t$$$ ($$$1\le t\le 1000$$$)  — the number of test cases. Next $$$3t$$$ lines contain descriptions of test cases. The first line of each test case contains two integers $$$n$$$ and $$$m$$$ ($$$1\le n,m\le 1000$$$)  — the lengths of the two arrays. The second line of each test ...
800
For each test case, output "YES" if a solution exists, or "NO" otherwise. If the answer is "YES", on the next line output an integer $$$k$$$ ($$$1\le k\le 1000$$$)  — the length of the array, followed by $$$k$$$ integers $$$c_1,\ldots,c_k$$$ ($$$1\le c_i\le 1000$$$)  — the elements of the array. If there are multiple s...
standard output
PASSED
664c08fd5de05e2b6c549bf7cc0a8d47
train_001.jsonl
1595342100
You are given two arrays of integers $$$a_1,\ldots,a_n$$$ and $$$b_1,\ldots,b_m$$$.Your task is to find a non-empty array $$$c_1,\ldots,c_k$$$ that is a subsequence of $$$a_1,\ldots,a_n$$$, and also a subsequence of $$$b_1,\ldots,b_m$$$. If there are multiple answers, find one of the smallest possible length. If there ...
256 megabytes
import java.util.ArrayList; import java.util.Scanner; public class common_subsequence_codeforces { public static void main(String[] args) { Scanner input = new Scanner(System.in); int t = input.nextInt(); while (t!=0){ t--; int n = input.nextInt(); int m ...
Java
["5\n4 5\n10 8 6 4\n1 2 3 4 5\n1 1\n3\n3\n1 1\n3\n2\n5 3\n1000 2 2 2 3\n3 1 5\n5 5\n1 2 3 4 5\n1 2 3 4 5"]
1 second
["YES\n1 4\nYES\n1 3\nNO\nYES\n1 3\nYES\n1 2"]
NoteIn the first test case, $$$[4]$$$ is a subsequence of $$$[10, 8, 6, 4]$$$ and $$$[1, 2, 3, 4, 5]$$$. This array has length $$$1$$$, it is the smallest possible length of a subsequence of both $$$a$$$ and $$$b$$$.In the third test case, no non-empty subsequences of both $$$[3]$$$ and $$$[2]$$$ exist, so the answer i...
Java 11
standard input
[ "brute force" ]
776a06c14c6fa3ef8664eec0b4d50824
The first line contains a single integer $$$t$$$ ($$$1\le t\le 1000$$$)  — the number of test cases. Next $$$3t$$$ lines contain descriptions of test cases. The first line of each test case contains two integers $$$n$$$ and $$$m$$$ ($$$1\le n,m\le 1000$$$)  — the lengths of the two arrays. The second line of each test ...
800
For each test case, output "YES" if a solution exists, or "NO" otherwise. If the answer is "YES", on the next line output an integer $$$k$$$ ($$$1\le k\le 1000$$$)  — the length of the array, followed by $$$k$$$ integers $$$c_1,\ldots,c_k$$$ ($$$1\le c_i\le 1000$$$)  — the elements of the array. If there are multiple s...
standard output
PASSED
816d1272bdf2095abdc14ee96f61f896
train_001.jsonl
1595342100
You are given two arrays of integers $$$a_1,\ldots,a_n$$$ and $$$b_1,\ldots,b_m$$$.Your task is to find a non-empty array $$$c_1,\ldots,c_k$$$ that is a subsequence of $$$a_1,\ldots,a_n$$$, and also a subsequence of $$$b_1,\ldots,b_m$$$. If there are multiple answers, find one of the smallest possible length. If there ...
256 megabytes
/* ------------------------------------------------------------------- * @Name: 1382A Common Subsequence * @Author: Yanan * @Create Time: 2020/7/23 22:35:46 (UTC+08:00) * @Url: https://codeforces.com/contest/1382/problem/A * @Description: --------------------------------------------...
Java
["5\n4 5\n10 8 6 4\n1 2 3 4 5\n1 1\n3\n3\n1 1\n3\n2\n5 3\n1000 2 2 2 3\n3 1 5\n5 5\n1 2 3 4 5\n1 2 3 4 5"]
1 second
["YES\n1 4\nYES\n1 3\nNO\nYES\n1 3\nYES\n1 2"]
NoteIn the first test case, $$$[4]$$$ is a subsequence of $$$[10, 8, 6, 4]$$$ and $$$[1, 2, 3, 4, 5]$$$. This array has length $$$1$$$, it is the smallest possible length of a subsequence of both $$$a$$$ and $$$b$$$.In the third test case, no non-empty subsequences of both $$$[3]$$$ and $$$[2]$$$ exist, so the answer i...
Java 11
standard input
[ "brute force" ]
776a06c14c6fa3ef8664eec0b4d50824
The first line contains a single integer $$$t$$$ ($$$1\le t\le 1000$$$)  — the number of test cases. Next $$$3t$$$ lines contain descriptions of test cases. The first line of each test case contains two integers $$$n$$$ and $$$m$$$ ($$$1\le n,m\le 1000$$$)  — the lengths of the two arrays. The second line of each test ...
800
For each test case, output "YES" if a solution exists, or "NO" otherwise. If the answer is "YES", on the next line output an integer $$$k$$$ ($$$1\le k\le 1000$$$)  — the length of the array, followed by $$$k$$$ integers $$$c_1,\ldots,c_k$$$ ($$$1\le c_i\le 1000$$$)  — the elements of the array. If there are multiple s...
standard output
PASSED
29f744f3241b0de5632acf0ae5615eb5
train_001.jsonl
1555425300
There are $$$n$$$ students standing in a row. Two coaches are forming two teams — the first coach chooses the first team and the second coach chooses the second team.The $$$i$$$-th student has integer programming skill $$$a_i$$$. All programming skills are distinct and between $$$1$$$ and $$$n$$$, inclusive.Firstly, th...
256 megabytes
import java.io.File; import java.io.FileWriter; import java.io.IOException; import java.util.Scanner; public class E { public static void main(String[] args) throws IOException { Scanner seer = new Scanner(System.in); int n = seer.nextInt(); int k = seer.nextInt(); int[] arr = new ...
Java
["5 2\n2 4 5 3 1", "5 1\n2 1 3 5 4", "7 1\n7 2 1 3 5 4 6", "5 1\n2 4 5 3 1"]
2 seconds
["11111", "22111", "1121122", "21112"]
NoteIn the first example the first coach chooses the student on a position $$$3$$$, and the row becomes empty (all students join the first team).In the second example the first coach chooses the student on position $$$4$$$, and the row becomes $$$[2, 1]$$$ (students with programming skills $$$[3, 4, 5]$$$ join the firs...
Java 8
standard input
[ "data structures", "implementation", "sortings" ]
235131226fee9d04efef4673185c1c9b
The first line of the input contains two integers $$$n$$$ and $$$k$$$ ($$$1 \le k \le n \le 2 \cdot 10^5$$$) — the number of students and the value determining the range of chosen students during each move, respectively. The second line of the input contains $$$n$$$ integers $$$a_1, a_2, \dots, a_n$$$ ($$$1 \le a_i \le...
1,800
Print a string of $$$n$$$ characters; $$$i$$$-th character should be 1 if $$$i$$$-th student joins the first team, or 2 otherwise.
standard output
PASSED
ec351ff38958a1fc018954fe603d1418
train_001.jsonl
1555425300
There are $$$n$$$ students standing in a row. Two coaches are forming two teams — the first coach chooses the first team and the second coach chooses the second team.The $$$i$$$-th student has integer programming skill $$$a_i$$$. All programming skills are distinct and between $$$1$$$ and $$$n$$$, inclusive.Firstly, th...
256 megabytes
import java.util.*; public class Main{ class Node implements Comparable<Node>{ int ord,power; Node nxt,prv; public Node(int a , int b){ ord=a; power=b; } public int compareTo(Node other) { return -this.power+other.power; } } Scanner in = new Scanner(System.in); int n,k; Queue<Node> q = new Priority...
Java
["5 2\n2 4 5 3 1", "5 1\n2 1 3 5 4", "7 1\n7 2 1 3 5 4 6", "5 1\n2 4 5 3 1"]
2 seconds
["11111", "22111", "1121122", "21112"]
NoteIn the first example the first coach chooses the student on a position $$$3$$$, and the row becomes empty (all students join the first team).In the second example the first coach chooses the student on position $$$4$$$, and the row becomes $$$[2, 1]$$$ (students with programming skills $$$[3, 4, 5]$$$ join the firs...
Java 8
standard input
[ "data structures", "implementation", "sortings" ]
235131226fee9d04efef4673185c1c9b
The first line of the input contains two integers $$$n$$$ and $$$k$$$ ($$$1 \le k \le n \le 2 \cdot 10^5$$$) — the number of students and the value determining the range of chosen students during each move, respectively. The second line of the input contains $$$n$$$ integers $$$a_1, a_2, \dots, a_n$$$ ($$$1 \le a_i \le...
1,800
Print a string of $$$n$$$ characters; $$$i$$$-th character should be 1 if $$$i$$$-th student joins the first team, or 2 otherwise.
standard output
PASSED
8e66b6f15bd6a491f23740dafbf4c726
train_001.jsonl
1555425300
There are $$$n$$$ students standing in a row. Two coaches are forming two teams — the first coach chooses the first team and the second coach chooses the second team.The $$$i$$$-th student has integer programming skill $$$a_i$$$. All programming skills are distinct and between $$$1$$$ and $$$n$$$, inclusive.Firstly, th...
256 megabytes
import java.io.*; import java.util.*; public class TwoTeams { public static void main(String[] args) throws IOException { Scanner scan=new Scanner(System.in); PrintWriter pr=new PrintWriter(System.out); int n=scan.nextInt(); int k=scan.nextInt(); int[] idx=new int[n+1]; int[] left=new int...
Java
["5 2\n2 4 5 3 1", "5 1\n2 1 3 5 4", "7 1\n7 2 1 3 5 4 6", "5 1\n2 4 5 3 1"]
2 seconds
["11111", "22111", "1121122", "21112"]
NoteIn the first example the first coach chooses the student on a position $$$3$$$, and the row becomes empty (all students join the first team).In the second example the first coach chooses the student on position $$$4$$$, and the row becomes $$$[2, 1]$$$ (students with programming skills $$$[3, 4, 5]$$$ join the firs...
Java 8
standard input
[ "data structures", "implementation", "sortings" ]
235131226fee9d04efef4673185c1c9b
The first line of the input contains two integers $$$n$$$ and $$$k$$$ ($$$1 \le k \le n \le 2 \cdot 10^5$$$) — the number of students and the value determining the range of chosen students during each move, respectively. The second line of the input contains $$$n$$$ integers $$$a_1, a_2, \dots, a_n$$$ ($$$1 \le a_i \le...
1,800
Print a string of $$$n$$$ characters; $$$i$$$-th character should be 1 if $$$i$$$-th student joins the first team, or 2 otherwise.
standard output
PASSED
35a8cec6b6fa0a672da2da5a68ada9af
train_001.jsonl
1297440000
Marina loves Sasha. But she keeps wondering whether Sasha loves her. Of course, the best way to know it is fortune telling. There are many ways of telling fortune, but Marina has picked the easiest one. She takes in her hand one or several camomiles and tears off the petals one by one. After each petal she pronounces a...
256 megabytes
import java.util.Arrays; import java.util.Scanner; public class B_59_Fortune_Telling { public static void main(String[] args){ Scanner input=new Scanner(System.in); int n=input.nextInt(); int odd=0,even=0,sum=0; int[] num=new int[n]; int i; for(i=0;i<n;i++){ num[i]=input.nextInt(); if(num[i]%2==0) ...
Java
["1\n1", "1\n2", "3\n5 6 7"]
2 seconds
["1", "0", "13"]
null
Java 7
standard input
[ "implementation", "number theory" ]
a5d56056fd66713128616bc7c2de8b22
The first line contains an integer n (1 ≤ n ≤ 100), which is the number of flowers growing in the field. The second line contains n integers ai (1 ≤ ai ≤ 100) which represent the number of petals on a given i-th camomile.
1,200
Print a single number which is the maximal number of petals in the bouquet, the fortune telling on which would result in "Loves". If there are no such bouquet, print 0 instead. The bouquet may consist of a single flower.
standard output
PASSED
cd863d2ffe13ccb6ce87675f72ba3165
train_001.jsonl
1297440000
Marina loves Sasha. But she keeps wondering whether Sasha loves her. Of course, the best way to know it is fortune telling. There are many ways of telling fortune, but Marina has picked the easiest one. She takes in her hand one or several camomiles and tears off the petals one by one. After each petal she pronounces a...
256 megabytes
import java.util.Arrays; import java.util.Scanner; public class B { public static void main(String[] args) { Scanner sc= new Scanner(System.in); int n=sc.nextInt(); int a[]=new int [n]; int x=102; int y=102; int sum=0; for (int i = 0; i < a.length; i++) { a[i]=sc.nextInt(); sum+=a[i]; if(a[i] %2 ==1) x=M...
Java
["1\n1", "1\n2", "3\n5 6 7"]
2 seconds
["1", "0", "13"]
null
Java 7
standard input
[ "implementation", "number theory" ]
a5d56056fd66713128616bc7c2de8b22
The first line contains an integer n (1 ≤ n ≤ 100), which is the number of flowers growing in the field. The second line contains n integers ai (1 ≤ ai ≤ 100) which represent the number of petals on a given i-th camomile.
1,200
Print a single number which is the maximal number of petals in the bouquet, the fortune telling on which would result in "Loves". If there are no such bouquet, print 0 instead. The bouquet may consist of a single flower.
standard output
PASSED
b99a0f3df63426f181d564e715776de6
train_001.jsonl
1297440000
Marina loves Sasha. But she keeps wondering whether Sasha loves her. Of course, the best way to know it is fortune telling. There are many ways of telling fortune, but Marina has picked the easiest one. She takes in her hand one or several camomiles and tears off the petals one by one. After each petal she pronounces a...
256 megabytes
import java.io.*; import java.util.*; public class Main { public static void main(String[] args) throws Exception { PrintWriter out = new PrintWriter(System.out, true); BufferedReader in = new BufferedReader(new InputStreamReader(System.in)); // StringTokenizer st = new StringTokenizer(in.readLine()); // Sca...
Java
["1\n1", "1\n2", "3\n5 6 7"]
2 seconds
["1", "0", "13"]
null
Java 7
standard input
[ "implementation", "number theory" ]
a5d56056fd66713128616bc7c2de8b22
The first line contains an integer n (1 ≤ n ≤ 100), which is the number of flowers growing in the field. The second line contains n integers ai (1 ≤ ai ≤ 100) which represent the number of petals on a given i-th camomile.
1,200
Print a single number which is the maximal number of petals in the bouquet, the fortune telling on which would result in "Loves". If there are no such bouquet, print 0 instead. The bouquet may consist of a single flower.
standard output
PASSED
d81a1a29b385daa084acffe77e6aeb0b
train_001.jsonl
1297440000
Marina loves Sasha. But she keeps wondering whether Sasha loves her. Of course, the best way to know it is fortune telling. There are many ways of telling fortune, but Marina has picked the easiest one. She takes in her hand one or several camomiles and tears off the petals one by one. After each petal she pronounces a...
256 megabytes
import java.util.*; import java.io.*; public class Main{ BufferedReader in; StringTokenizer str = null; PrintWriter out; private String next() throws Exception{ while (str == null || !str.hasMoreElements()) str = new StringTokenizer(in.readLine()); return str.nextToken(); } ...
Java
["1\n1", "1\n2", "3\n5 6 7"]
2 seconds
["1", "0", "13"]
null
Java 7
standard input
[ "implementation", "number theory" ]
a5d56056fd66713128616bc7c2de8b22
The first line contains an integer n (1 ≤ n ≤ 100), which is the number of flowers growing in the field. The second line contains n integers ai (1 ≤ ai ≤ 100) which represent the number of petals on a given i-th camomile.
1,200
Print a single number which is the maximal number of petals in the bouquet, the fortune telling on which would result in "Loves". If there are no such bouquet, print 0 instead. The bouquet may consist of a single flower.
standard output
PASSED
d2c695999664ead674991401aef91aae
train_001.jsonl
1297440000
Marina loves Sasha. But she keeps wondering whether Sasha loves her. Of course, the best way to know it is fortune telling. There are many ways of telling fortune, but Marina has picked the easiest one. She takes in her hand one or several camomiles and tears off the petals one by one. After each petal she pronounces a...
256 megabytes
import java.util.ArrayList; import java.util.Collections; import java.util.Scanner; public class P59B { public P59B() { Scanner sc = new Scanner(System.in); int n = sc.nextInt(); ArrayList<Integer> flowersEven = new ArrayList<>(); ArrayList<Integer> flowersOdd = new ArrayList<>(); ...
Java
["1\n1", "1\n2", "3\n5 6 7"]
2 seconds
["1", "0", "13"]
null
Java 7
standard input
[ "implementation", "number theory" ]
a5d56056fd66713128616bc7c2de8b22
The first line contains an integer n (1 ≤ n ≤ 100), which is the number of flowers growing in the field. The second line contains n integers ai (1 ≤ ai ≤ 100) which represent the number of petals on a given i-th camomile.
1,200
Print a single number which is the maximal number of petals in the bouquet, the fortune telling on which would result in "Loves". If there are no such bouquet, print 0 instead. The bouquet may consist of a single flower.
standard output
PASSED
8af4209614e9dfd29f1633f309f79822
train_001.jsonl
1297440000
Marina loves Sasha. But she keeps wondering whether Sasha loves her. Of course, the best way to know it is fortune telling. There are many ways of telling fortune, but Marina has picked the easiest one. She takes in her hand one or several camomiles and tears off the petals one by one. After each petal she pronounces a...
256 megabytes
import java.io.*; import java.util.*; public class j { public static void main(String a[])throws IOException { BufferedReader b=new BufferedReader(new InputStreamReader(System.in)); int t=0,j=0,p=0,m=105,n=0,k=0,i=0; String s; n=Integer.parseInt(b.readLine()); s=b.readLine(); StringTokenizer c=new StringTokenizer(s); f...
Java
["1\n1", "1\n2", "3\n5 6 7"]
2 seconds
["1", "0", "13"]
null
Java 7
standard input
[ "implementation", "number theory" ]
a5d56056fd66713128616bc7c2de8b22
The first line contains an integer n (1 ≤ n ≤ 100), which is the number of flowers growing in the field. The second line contains n integers ai (1 ≤ ai ≤ 100) which represent the number of petals on a given i-th camomile.
1,200
Print a single number which is the maximal number of petals in the bouquet, the fortune telling on which would result in "Loves". If there are no such bouquet, print 0 instead. The bouquet may consist of a single flower.
standard output
PASSED
221b30468ce9f694631fe6dc87b439fb
train_001.jsonl
1297440000
Marina loves Sasha. But she keeps wondering whether Sasha loves her. Of course, the best way to know it is fortune telling. There are many ways of telling fortune, but Marina has picked the easiest one. She takes in her hand one or several camomiles and tears off the petals one by one. After each petal she pronounces a...
256 megabytes
import java.util.*; import java.io.*; import java.math.*; public class Main { public static boolean bg = true; public static void main(String[] args) throws Exception { ST in = new ST(); int n1 = in.ni(); int[] l1 = new int[n1]; for (int i = 0;i<n1;i++){ l1[i] = in....
Java
["1\n1", "1\n2", "3\n5 6 7"]
2 seconds
["1", "0", "13"]
null
Java 7
standard input
[ "implementation", "number theory" ]
a5d56056fd66713128616bc7c2de8b22
The first line contains an integer n (1 ≤ n ≤ 100), which is the number of flowers growing in the field. The second line contains n integers ai (1 ≤ ai ≤ 100) which represent the number of petals on a given i-th camomile.
1,200
Print a single number which is the maximal number of petals in the bouquet, the fortune telling on which would result in "Loves". If there are no such bouquet, print 0 instead. The bouquet may consist of a single flower.
standard output
PASSED
1ab25d71e33404b3c837842dbdb8b605
train_001.jsonl
1297440000
Marina loves Sasha. But she keeps wondering whether Sasha loves her. Of course, the best way to know it is fortune telling. There are many ways of telling fortune, but Marina has picked the easiest one. She takes in her hand one or several camomiles and tears off the petals one by one. After each petal she pronounces a...
256 megabytes
import java.io.BufferedReader; import java.io.IOException; import java.io.InputStream; import java.io.InputStreamReader; import java.io.OutputStream; import java.io.PrintWriter; import java.util.ArrayList; import java.util.Collections; public class Task059B { public static void main(String... args) throws NumberF...
Java
["1\n1", "1\n2", "3\n5 6 7"]
2 seconds
["1", "0", "13"]
null
Java 7
standard input
[ "implementation", "number theory" ]
a5d56056fd66713128616bc7c2de8b22
The first line contains an integer n (1 ≤ n ≤ 100), which is the number of flowers growing in the field. The second line contains n integers ai (1 ≤ ai ≤ 100) which represent the number of petals on a given i-th camomile.
1,200
Print a single number which is the maximal number of petals in the bouquet, the fortune telling on which would result in "Loves". If there are no such bouquet, print 0 instead. The bouquet may consist of a single flower.
standard output
PASSED
b23a826157232de2868b6283e7e71e73
train_001.jsonl
1297440000
Marina loves Sasha. But she keeps wondering whether Sasha loves her. Of course, the best way to know it is fortune telling. There are many ways of telling fortune, but Marina has picked the easiest one. She takes in her hand one or several camomiles and tears off the petals one by one. After each petal she pronounces a...
256 megabytes
import java.util.Arrays; import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner scan = new Scanner(System.in); do { int times = scan.nextInt(), aux; int[] f = new int[times]; long suma = 0, k = 0; for (int i = ...
Java
["1\n1", "1\n2", "3\n5 6 7"]
2 seconds
["1", "0", "13"]
null
Java 7
standard input
[ "implementation", "number theory" ]
a5d56056fd66713128616bc7c2de8b22
The first line contains an integer n (1 ≤ n ≤ 100), which is the number of flowers growing in the field. The second line contains n integers ai (1 ≤ ai ≤ 100) which represent the number of petals on a given i-th camomile.
1,200
Print a single number which is the maximal number of petals in the bouquet, the fortune telling on which would result in "Loves". If there are no such bouquet, print 0 instead. The bouquet may consist of a single flower.
standard output
PASSED
96b48d97075b6467ceecb7626e1dfe21
train_001.jsonl
1297440000
Marina loves Sasha. But she keeps wondering whether Sasha loves her. Of course, the best way to know it is fortune telling. There are many ways of telling fortune, but Marina has picked the easiest one. She takes in her hand one or several camomiles and tears off the petals one by one. After each petal she pronounces a...
256 megabytes
import java.util.*; public class Main { public static void main(String[] args) { Scanner s = new Scanner(System.in); int n = s.nextInt(),min = 101,sum=0,v; for (int i = 1;i <= n;i++) { v = s.nextInt(); sum += v; if (v % 2 == 1 && v < min) ...
Java
["1\n1", "1\n2", "3\n5 6 7"]
2 seconds
["1", "0", "13"]
null
Java 7
standard input
[ "implementation", "number theory" ]
a5d56056fd66713128616bc7c2de8b22
The first line contains an integer n (1 ≤ n ≤ 100), which is the number of flowers growing in the field. The second line contains n integers ai (1 ≤ ai ≤ 100) which represent the number of petals on a given i-th camomile.
1,200
Print a single number which is the maximal number of petals in the bouquet, the fortune telling on which would result in "Loves". If there are no such bouquet, print 0 instead. The bouquet may consist of a single flower.
standard output
PASSED
7b0202fe9fb7fac2bcca60a4f458e5d2
train_001.jsonl
1297440000
Marina loves Sasha. But she keeps wondering whether Sasha loves her. Of course, the best way to know it is fortune telling. There are many ways of telling fortune, but Marina has picked the easiest one. She takes in her hand one or several camomiles and tears off the petals one by one. After each petal she pronounces a...
256 megabytes
import java.io.IOException; import java.util.Arrays; import java.io.FilterInputStream; import java.util.HashMap; import java.io.OutputStream; import java.io.PrintWriter; import java.util.TreeSet; import java.io.BufferedInputStream; import java.io.InputStream; /** * Built using CHelper plug-in * Actual solution is at...
Java
["1\n1", "1\n2", "3\n5 6 7"]
2 seconds
["1", "0", "13"]
null
Java 7
standard input
[ "implementation", "number theory" ]
a5d56056fd66713128616bc7c2de8b22
The first line contains an integer n (1 ≤ n ≤ 100), which is the number of flowers growing in the field. The second line contains n integers ai (1 ≤ ai ≤ 100) which represent the number of petals on a given i-th camomile.
1,200
Print a single number which is the maximal number of petals in the bouquet, the fortune telling on which would result in "Loves". If there are no such bouquet, print 0 instead. The bouquet may consist of a single flower.
standard output
PASSED
b8ea898e3fdafe9438ed4cb86108c881
train_001.jsonl
1297440000
Marina loves Sasha. But she keeps wondering whether Sasha loves her. Of course, the best way to know it is fortune telling. There are many ways of telling fortune, but Marina has picked the easiest one. She takes in her hand one or several camomiles and tears off the petals one by one. After each petal she pronounces a...
256 megabytes
import java.util.*; public class Amor { /** * @param args */ public static void main(String[] args) { Scanner in=new Scanner(System.in); int casos=in.nextInt(); int[] nros=new int[casos]; int total=0; for(int i=0;i<casos;i++){ nros[i]=in.nextInt(); total+=nros[i]; } Arr...
Java
["1\n1", "1\n2", "3\n5 6 7"]
2 seconds
["1", "0", "13"]
null
Java 7
standard input
[ "implementation", "number theory" ]
a5d56056fd66713128616bc7c2de8b22
The first line contains an integer n (1 ≤ n ≤ 100), which is the number of flowers growing in the field. The second line contains n integers ai (1 ≤ ai ≤ 100) which represent the number of petals on a given i-th camomile.
1,200
Print a single number which is the maximal number of petals in the bouquet, the fortune telling on which would result in "Loves". If there are no such bouquet, print 0 instead. The bouquet may consist of a single flower.
standard output
PASSED
2a5b0b5ab7835cccb2965d139c049083
train_001.jsonl
1297440000
Marina loves Sasha. But she keeps wondering whether Sasha loves her. Of course, the best way to know it is fortune telling. There are many ways of telling fortune, but Marina has picked the easiest one. She takes in her hand one or several camomiles and tears off the petals one by one. After each petal she pronounces a...
256 megabytes
import java.util.Scanner; public class Main { public static void main (String...args){ Scanner input = new Scanner (System.in); String y; int x = Integer.parseInt(input.nextLine()); int n=0,menor=0,j=0; y = input.nextLine(); String [] token = y.split ("\\s+"); ...
Java
["1\n1", "1\n2", "3\n5 6 7"]
2 seconds
["1", "0", "13"]
null
Java 7
standard input
[ "implementation", "number theory" ]
a5d56056fd66713128616bc7c2de8b22
The first line contains an integer n (1 ≤ n ≤ 100), which is the number of flowers growing in the field. The second line contains n integers ai (1 ≤ ai ≤ 100) which represent the number of petals on a given i-th camomile.
1,200
Print a single number which is the maximal number of petals in the bouquet, the fortune telling on which would result in "Loves". If there are no such bouquet, print 0 instead. The bouquet may consist of a single flower.
standard output
PASSED
c2dc80a7e711ce7fdf56ea26d8d1008c
train_001.jsonl
1297440000
Marina loves Sasha. But she keeps wondering whether Sasha loves her. Of course, the best way to know it is fortune telling. There are many ways of telling fortune, but Marina has picked the easiest one. She takes in her hand one or several camomiles and tears off the petals one by one. After each petal she pronounces a...
256 megabytes
import java.util.Scanner; /* * To change this license header, choose License Headers in Project Properties. * To change this template file, choose Tools | Templates * and open the template in the editor. */ /** * * @author KHALED */ public class FortuneTelling { public static void main(String[] args) { ...
Java
["1\n1", "1\n2", "3\n5 6 7"]
2 seconds
["1", "0", "13"]
null
Java 7
standard input
[ "implementation", "number theory" ]
a5d56056fd66713128616bc7c2de8b22
The first line contains an integer n (1 ≤ n ≤ 100), which is the number of flowers growing in the field. The second line contains n integers ai (1 ≤ ai ≤ 100) which represent the number of petals on a given i-th camomile.
1,200
Print a single number which is the maximal number of petals in the bouquet, the fortune telling on which would result in "Loves". If there are no such bouquet, print 0 instead. The bouquet may consist of a single flower.
standard output
PASSED
70f8c0b58572d453190c1c6989518af5
train_001.jsonl
1297440000
Marina loves Sasha. But she keeps wondering whether Sasha loves her. Of course, the best way to know it is fortune telling. There are many ways of telling fortune, but Marina has picked the easiest one. She takes in her hand one or several camomiles and tears off the petals one by one. After each petal she pronounces a...
256 megabytes
import java.util.Scanner; public class B_55 { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int n=sc.nextInt(); int [] a = new int [n+1]; int sum = 0; int min = Integer.MAX_VALUE; for (int i = 1; i <=n; i++) { a[i]=sc.nextInt(); sum+=a[i]; if(a[i]%2==1){ ...
Java
["1\n1", "1\n2", "3\n5 6 7"]
2 seconds
["1", "0", "13"]
null
Java 7
standard input
[ "implementation", "number theory" ]
a5d56056fd66713128616bc7c2de8b22
The first line contains an integer n (1 ≤ n ≤ 100), which is the number of flowers growing in the field. The second line contains n integers ai (1 ≤ ai ≤ 100) which represent the number of petals on a given i-th camomile.
1,200
Print a single number which is the maximal number of petals in the bouquet, the fortune telling on which would result in "Loves". If there are no such bouquet, print 0 instead. The bouquet may consist of a single flower.
standard output
PASSED
2fa87c14a42a714bf92be242db68c95a
train_001.jsonl
1297440000
Marina loves Sasha. But she keeps wondering whether Sasha loves her. Of course, the best way to know it is fortune telling. There are many ways of telling fortune, but Marina has picked the easiest one. She takes in her hand one or several camomiles and tears off the petals one by one. After each petal she pronounces a...
256 megabytes
import java.util.*; public class SinIsh2 { public static void main(String [] args){ Scanner in = new Scanner(System.in); int n=in.nextInt(); int array[]=new int [n]; int a1=0; int a2=0; int min=Integer.MAX_VALUE; for(int i=0;i<n;i++){ int a=in.nextInt(); array[i]=a; if(a%2==0) a1++; else if(a%2==1){ min=Math.min(a,min)...
Java
["1\n1", "1\n2", "3\n5 6 7"]
2 seconds
["1", "0", "13"]
null
Java 7
standard input
[ "implementation", "number theory" ]
a5d56056fd66713128616bc7c2de8b22
The first line contains an integer n (1 ≤ n ≤ 100), which is the number of flowers growing in the field. The second line contains n integers ai (1 ≤ ai ≤ 100) which represent the number of petals on a given i-th camomile.
1,200
Print a single number which is the maximal number of petals in the bouquet, the fortune telling on which would result in "Loves". If there are no such bouquet, print 0 instead. The bouquet may consist of a single flower.
standard output
PASSED
d9bbcb0dd638bd4db89a9c6d13bc2a1e
train_001.jsonl
1297440000
Marina loves Sasha. But she keeps wondering whether Sasha loves her. Of course, the best way to know it is fortune telling. There are many ways of telling fortune, but Marina has picked the easiest one. She takes in her hand one or several camomiles and tears off the petals one by one. After each petal she pronounces a...
256 megabytes
import java.util.Scanner; public class P6 { private static final Scanner IN = new Scanner(System.in); public static void main(String[] args) { long sum = 0; long mi = Long.MAX_VALUE; for (int i = IN.nextInt(); i > 0; i--) { int n = IN.nextInt(); sum+=n; if(n%2!=0) mi = Math.min(mi, n); } if(su...
Java
["1\n1", "1\n2", "3\n5 6 7"]
2 seconds
["1", "0", "13"]
null
Java 7
standard input
[ "implementation", "number theory" ]
a5d56056fd66713128616bc7c2de8b22
The first line contains an integer n (1 ≤ n ≤ 100), which is the number of flowers growing in the field. The second line contains n integers ai (1 ≤ ai ≤ 100) which represent the number of petals on a given i-th camomile.
1,200
Print a single number which is the maximal number of petals in the bouquet, the fortune telling on which would result in "Loves". If there are no such bouquet, print 0 instead. The bouquet may consist of a single flower.
standard output
PASSED
16c501b50f795ad0b5999e3f2e553e20
train_001.jsonl
1297440000
Marina loves Sasha. But she keeps wondering whether Sasha loves her. Of course, the best way to know it is fortune telling. There are many ways of telling fortune, but Marina has picked the easiest one. She takes in her hand one or several camomiles and tears off the petals one by one. After each petal she pronounces a...
256 megabytes
import java.io.PrintWriter; import java.util.Arrays; import java.util.Comparator; import java.util.Scanner; public class Main { public static void main(String[] args) { PrintWriter out = new PrintWriter(System.out, true); Scanner in = new Scanner(System.in); Main solver = new Main(in, out)...
Java
["1\n1", "1\n2", "3\n5 6 7"]
2 seconds
["1", "0", "13"]
null
Java 7
standard input
[ "implementation", "number theory" ]
a5d56056fd66713128616bc7c2de8b22
The first line contains an integer n (1 ≤ n ≤ 100), which is the number of flowers growing in the field. The second line contains n integers ai (1 ≤ ai ≤ 100) which represent the number of petals on a given i-th camomile.
1,200
Print a single number which is the maximal number of petals in the bouquet, the fortune telling on which would result in "Loves". If there are no such bouquet, print 0 instead. The bouquet may consist of a single flower.
standard output
PASSED
c8502dd4fe7ab13176f9e11eabd98a11
train_001.jsonl
1297440000
Marina loves Sasha. But she keeps wondering whether Sasha loves her. Of course, the best way to know it is fortune telling. There are many ways of telling fortune, but Marina has picked the easiest one. She takes in her hand one or several camomiles and tears off the petals one by one. After each petal she pronounces a...
256 megabytes
import java.util.Arrays; import java.util.Scanner; public class FortuneTelling { public static void main(String ad[])throws Exception { Scanner in=new Scanner(System.in); int n=in.nextInt(); int a[]=new int[n]; int sum=0; for(int i=0;i<n;i++) sum+=a[i]=in.ne...
Java
["1\n1", "1\n2", "3\n5 6 7"]
2 seconds
["1", "0", "13"]
null
Java 7
standard input
[ "implementation", "number theory" ]
a5d56056fd66713128616bc7c2de8b22
The first line contains an integer n (1 ≤ n ≤ 100), which is the number of flowers growing in the field. The second line contains n integers ai (1 ≤ ai ≤ 100) which represent the number of petals on a given i-th camomile.
1,200
Print a single number which is the maximal number of petals in the bouquet, the fortune telling on which would result in "Loves". If there are no such bouquet, print 0 instead. The bouquet may consist of a single flower.
standard output
PASSED
0f16f70c2b0beece1a6dc568b18b013d
train_001.jsonl
1297440000
Marina loves Sasha. But she keeps wondering whether Sasha loves her. Of course, the best way to know it is fortune telling. There are many ways of telling fortune, but Marina has picked the easiest one. She takes in her hand one or several camomiles and tears off the petals one by one. After each petal she pronounces a...
256 megabytes
import java.io.*; import java.util.StringTokenizer; /** * * @author Prateep */ public class JavaApplication1 { /** * @param args the command line arguments */ public static void main(String[] args) { // TODO code application logic here InputStream inputStream = System.in; Outp...
Java
["1\n1", "1\n2", "3\n5 6 7"]
2 seconds
["1", "0", "13"]
null
Java 7
standard input
[ "implementation", "number theory" ]
a5d56056fd66713128616bc7c2de8b22
The first line contains an integer n (1 ≤ n ≤ 100), which is the number of flowers growing in the field. The second line contains n integers ai (1 ≤ ai ≤ 100) which represent the number of petals on a given i-th camomile.
1,200
Print a single number which is the maximal number of petals in the bouquet, the fortune telling on which would result in "Loves". If there are no such bouquet, print 0 instead. The bouquet may consist of a single flower.
standard output
PASSED
e01871466482893a963ed5b802aa7793
train_001.jsonl
1297440000
Marina loves Sasha. But she keeps wondering whether Sasha loves her. Of course, the best way to know it is fortune telling. There are many ways of telling fortune, but Marina has picked the easiest one. She takes in her hand one or several camomiles and tears off the petals one by one. After each petal she pronounces a...
256 megabytes
import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; import java.util.Arrays; public class Fortune_Telling { public static void main(String[] args) throws IOException { InputStreamReader isr = new InputStreamReader(System.in); BufferedReader br = new Buffered...
Java
["1\n1", "1\n2", "3\n5 6 7"]
2 seconds
["1", "0", "13"]
null
Java 7
standard input
[ "implementation", "number theory" ]
a5d56056fd66713128616bc7c2de8b22
The first line contains an integer n (1 ≤ n ≤ 100), which is the number of flowers growing in the field. The second line contains n integers ai (1 ≤ ai ≤ 100) which represent the number of petals on a given i-th camomile.
1,200
Print a single number which is the maximal number of petals in the bouquet, the fortune telling on which would result in "Loves". If there are no such bouquet, print 0 instead. The bouquet may consist of a single flower.
standard output
PASSED
235495a0f4d0c1d9a6e8615594dde0a2
train_001.jsonl
1297440000
Marina loves Sasha. But she keeps wondering whether Sasha loves her. Of course, the best way to know it is fortune telling. There are many ways of telling fortune, but Marina has picked the easiest one. She takes in her hand one or several camomiles and tears off the petals one by one. After each petal she pronounces a...
256 megabytes
import java.util.Scanner; public class B { public static void main(String[] args) { Scanner nm = new Scanner(System.in); int n = nm.nextInt(); int a [] = new int[n+1]; int min_t=Integer.MAX_VALUE, min_j=Integer.MAX_VALUE,inc=0; for (int i = 1; i <=n; i++) { int k=nm.nextInt(); if (min_t>k && k%2==1) ...
Java
["1\n1", "1\n2", "3\n5 6 7"]
2 seconds
["1", "0", "13"]
null
Java 7
standard input
[ "implementation", "number theory" ]
a5d56056fd66713128616bc7c2de8b22
The first line contains an integer n (1 ≤ n ≤ 100), which is the number of flowers growing in the field. The second line contains n integers ai (1 ≤ ai ≤ 100) which represent the number of petals on a given i-th camomile.
1,200
Print a single number which is the maximal number of petals in the bouquet, the fortune telling on which would result in "Loves". If there are no such bouquet, print 0 instead. The bouquet may consist of a single flower.
standard output
PASSED
d2ce8ed27ce52f2ca0108c2c35254742
train_001.jsonl
1297440000
Marina loves Sasha. But she keeps wondering whether Sasha loves her. Of course, the best way to know it is fortune telling. There are many ways of telling fortune, but Marina has picked the easiest one. She takes in her hand one or several camomiles and tears off the petals one by one. After each petal she pronounces a...
256 megabytes
import java.io.*; import java.util.*; import java.math.*; import java.nio.charset.StandardCharsets; import java.io.UnsupportedEncodingException; public class Main { public static void main(String[] args) { InputReader in = new InputReader(); PrintWriter out = new PrintWriter(System.out); ...
Java
["1\n1", "1\n2", "3\n5 6 7"]
2 seconds
["1", "0", "13"]
null
Java 7
standard input
[ "implementation", "number theory" ]
a5d56056fd66713128616bc7c2de8b22
The first line contains an integer n (1 ≤ n ≤ 100), which is the number of flowers growing in the field. The second line contains n integers ai (1 ≤ ai ≤ 100) which represent the number of petals on a given i-th camomile.
1,200
Print a single number which is the maximal number of petals in the bouquet, the fortune telling on which would result in "Loves". If there are no such bouquet, print 0 instead. The bouquet may consist of a single flower.
standard output
PASSED
ff2922edd024a1db6f0cd47a9ea2c01b
train_001.jsonl
1297440000
Marina loves Sasha. But she keeps wondering whether Sasha loves her. Of course, the best way to know it is fortune telling. There are many ways of telling fortune, but Marina has picked the easiest one. She takes in her hand one or several camomiles and tears off the petals one by one. After each petal she pronounces a...
256 megabytes
import java.io.*; import java.util.*; public class Main { public static void main(String asdf[])throws IOException { BufferedReader br=new BufferedReader(new InputStreamReader(System.in)); int n=Integer.parseInt(br.readLine()); String inpar[]=(br.readLine()).split(" "); int ar[]=new int[n]; int noe=0,noo=0...
Java
["1\n1", "1\n2", "3\n5 6 7"]
2 seconds
["1", "0", "13"]
null
Java 7
standard input
[ "implementation", "number theory" ]
a5d56056fd66713128616bc7c2de8b22
The first line contains an integer n (1 ≤ n ≤ 100), which is the number of flowers growing in the field. The second line contains n integers ai (1 ≤ ai ≤ 100) which represent the number of petals on a given i-th camomile.
1,200
Print a single number which is the maximal number of petals in the bouquet, the fortune telling on which would result in "Loves". If there are no such bouquet, print 0 instead. The bouquet may consist of a single flower.
standard output
PASSED
269e8f2b9da9b86d3d69d37f502f746c
train_001.jsonl
1297440000
Marina loves Sasha. But she keeps wondering whether Sasha loves her. Of course, the best way to know it is fortune telling. There are many ways of telling fortune, but Marina has picked the easiest one. She takes in her hand one or several camomiles and tears off the petals one by one. After each petal she pronounces a...
256 megabytes
import java.util.Scanner; public class Main { public static void main (String...args){ Scanner input = new Scanner (System.in); String y; int x = Integer.parseInt(input.nextLine()); int n=0,menor=0,j=0; y = input.nextLine(); String [] token = y.split ("\\s+"); ...
Java
["1\n1", "1\n2", "3\n5 6 7"]
2 seconds
["1", "0", "13"]
null
Java 7
standard input
[ "implementation", "number theory" ]
a5d56056fd66713128616bc7c2de8b22
The first line contains an integer n (1 ≤ n ≤ 100), which is the number of flowers growing in the field. The second line contains n integers ai (1 ≤ ai ≤ 100) which represent the number of petals on a given i-th camomile.
1,200
Print a single number which is the maximal number of petals in the bouquet, the fortune telling on which would result in "Loves". If there are no such bouquet, print 0 instead. The bouquet may consist of a single flower.
standard output
PASSED
9b91b0d050af8bbc4e662b615af1e05a
train_001.jsonl
1297440000
Marina loves Sasha. But she keeps wondering whether Sasha loves her. Of course, the best way to know it is fortune telling. There are many ways of telling fortune, but Marina has picked the easiest one. She takes in her hand one or several camomiles and tears off the petals one by one. After each petal she pronounces a...
256 megabytes
import java.util.Scanner; public class Adivinacion { public static void main (String...args){ Scanner input = new Scanner (System.in); String y; int x = Integer.parseInt(input.nextLine()); int n=0,menor=0,j=0; y = input.nextLine(); String [] token = y.split ("\\s+")...
Java
["1\n1", "1\n2", "3\n5 6 7"]
2 seconds
["1", "0", "13"]
null
Java 7
standard input
[ "implementation", "number theory" ]
a5d56056fd66713128616bc7c2de8b22
The first line contains an integer n (1 ≤ n ≤ 100), which is the number of flowers growing in the field. The second line contains n integers ai (1 ≤ ai ≤ 100) which represent the number of petals on a given i-th camomile.
1,200
Print a single number which is the maximal number of petals in the bouquet, the fortune telling on which would result in "Loves". If there are no such bouquet, print 0 instead. The bouquet may consist of a single flower.
standard output
PASSED
46a0011db778cac0543626b665b60540
train_001.jsonl
1297440000
Marina loves Sasha. But she keeps wondering whether Sasha loves her. Of course, the best way to know it is fortune telling. There are many ways of telling fortune, but Marina has picked the easiest one. She takes in her hand one or several camomiles and tears off the petals one by one. After each petal she pronounces a...
256 megabytes
import java.util.Scanner; public class Main { public static void main (String...args){ Scanner input = new Scanner (System.in); String y; int x = Integer.parseInt(input.nextLine()); int n=0,menor=0,j=0; y = input.nextLine(); String [] token = y.split ("\\s+"); ...
Java
["1\n1", "1\n2", "3\n5 6 7"]
2 seconds
["1", "0", "13"]
null
Java 7
standard input
[ "implementation", "number theory" ]
a5d56056fd66713128616bc7c2de8b22
The first line contains an integer n (1 ≤ n ≤ 100), which is the number of flowers growing in the field. The second line contains n integers ai (1 ≤ ai ≤ 100) which represent the number of petals on a given i-th camomile.
1,200
Print a single number which is the maximal number of petals in the bouquet, the fortune telling on which would result in "Loves". If there are no such bouquet, print 0 instead. The bouquet may consist of a single flower.
standard output
PASSED
41121bdabdf864c3dbfc97223d0001b7
train_001.jsonl
1297440000
Marina loves Sasha. But she keeps wondering whether Sasha loves her. Of course, the best way to know it is fortune telling. There are many ways of telling fortune, but Marina has picked the easiest one. She takes in her hand one or several camomiles and tears off the petals one by one. After each petal she pronounces a...
256 megabytes
import java.util.Arrays; import java.util.Scanner; public class Flor { public static void main(String[] args) { // http://codeforces.com/problemset/problem/59/B Scanner sc = new Scanner(System.in); int n = sc.nextInt(); int ans = 0; int a[] = new int[n]; f...
Java
["1\n1", "1\n2", "3\n5 6 7"]
2 seconds
["1", "0", "13"]
null
Java 7
standard input
[ "implementation", "number theory" ]
a5d56056fd66713128616bc7c2de8b22
The first line contains an integer n (1 ≤ n ≤ 100), which is the number of flowers growing in the field. The second line contains n integers ai (1 ≤ ai ≤ 100) which represent the number of petals on a given i-th camomile.
1,200
Print a single number which is the maximal number of petals in the bouquet, the fortune telling on which would result in "Loves". If there are no such bouquet, print 0 instead. The bouquet may consist of a single flower.
standard output
PASSED
ac5e37a32d8fcd183ddfcf493c2e9552
train_001.jsonl
1297440000
Marina loves Sasha. But she keeps wondering whether Sasha loves her. Of course, the best way to know it is fortune telling. There are many ways of telling fortune, but Marina has picked the easiest one. She takes in her hand one or several camomiles and tears off the petals one by one. After each petal she pronounces a...
256 megabytes
import java.io.*; import java.util.*; public class FortuneTelling { public static void main(String[] args) throws IOException { BufferedReader f = new BufferedReader(new InputStreamReader(System.in)); int n = Integer.parseInt(f.readLine()); StringTokenizer st = new StringTokenizer(f.readLin...
Java
["1\n1", "1\n2", "3\n5 6 7"]
2 seconds
["1", "0", "13"]
null
Java 7
standard input
[ "implementation", "number theory" ]
a5d56056fd66713128616bc7c2de8b22
The first line contains an integer n (1 ≤ n ≤ 100), which is the number of flowers growing in the field. The second line contains n integers ai (1 ≤ ai ≤ 100) which represent the number of petals on a given i-th camomile.
1,200
Print a single number which is the maximal number of petals in the bouquet, the fortune telling on which would result in "Loves". If there are no such bouquet, print 0 instead. The bouquet may consist of a single flower.
standard output
PASSED
e66e0a818415a9eabf3e633c55c7b0d2
train_001.jsonl
1297440000
Marina loves Sasha. But she keeps wondering whether Sasha loves her. Of course, the best way to know it is fortune telling. There are many ways of telling fortune, but Marina has picked the easiest one. She takes in her hand one or several camomiles and tears off the petals one by one. After each petal she pronounces a...
256 megabytes
import java.util.Scanner; public class flowers { public static void main (String[] args) { Scanner sc = new Scanner(System.in); int n = sc.nextInt(); int[] c = new int[110]; int i; int contimp = 0; int contpar = 0; int tot= 0; int minimp ...
Java
["1\n1", "1\n2", "3\n5 6 7"]
2 seconds
["1", "0", "13"]
null
Java 7
standard input
[ "implementation", "number theory" ]
a5d56056fd66713128616bc7c2de8b22
The first line contains an integer n (1 ≤ n ≤ 100), which is the number of flowers growing in the field. The second line contains n integers ai (1 ≤ ai ≤ 100) which represent the number of petals on a given i-th camomile.
1,200
Print a single number which is the maximal number of petals in the bouquet, the fortune telling on which would result in "Loves". If there are no such bouquet, print 0 instead. The bouquet may consist of a single flower.
standard output
PASSED
497c1817e645c6bcab52c5979e5a7f49
train_001.jsonl
1284130800
The sequence is called ordered if it is non-decreasing or non-increasing. For example, sequnces [3, 1, 1, 0] and [1, 2, 3, 100] are ordered, but the sequence [1, 3, 3, 1] is not. You are given a sequence of numbers. You are to find it's shortest subsequence which is not ordered.A subsequence is a sequence that can be d...
256 megabytes
import java.util.Scanner; public class C358 { public static void main(String[] args) { Scanner in = new Scanner(System.in); int n = in.nextInt(); int[] array = new int[n]; int[] minPref = new int[n]; int[] maxPref = new int[n]; int[] minSuf = new int[n]; int[] maxSuf = new int[n]; for (int i = 0; i ...
Java
["5\n67 499 600 42 23", "3\n1 2 3", "3\n2 3 1"]
2 seconds
["3\n1 3 5", "0", "3\n1 2 3"]
null
Java 7
standard input
[ "constructive algorithms", "greedy" ]
652c7852f1d0bab64ffd2219af4f59da
The first line of the input contains one integer n (1 ≤ n ≤ 105). The second line contains n space-separated integers — the given sequence. All numbers in this sequence do not exceed 106 by absolute value.
1,900
If the given sequence does not contain any unordered subsequences, output 0. Otherwise, output the length k of the shortest such subsequence. Then output k integers from the range [1..n] — indexes of the elements of this subsequence. If there are several solutions, output any of them.
standard output
PASSED
992ce0bf837d7a5a9663b02bb7b16144
train_001.jsonl
1284130800
The sequence is called ordered if it is non-decreasing or non-increasing. For example, sequnces [3, 1, 1, 0] and [1, 2, 3, 100] are ordered, but the sequence [1, 3, 3, 1] is not. You are given a sequence of numbers. You are to find it's shortest subsequence which is not ordered.A subsequence is a sequence that can be d...
256 megabytes
import java.io.BufferedReader; import java.io.InputStream; import java.io.InputStreamReader; import java.io.PrintWriter; import java.util.StringTokenizer; public class Main { public static void main(String[] arg) { FastScanner scan = new FastScanner(System.in); PrintWriter out = new PrintWriter(System.out); in...
Java
["5\n67 499 600 42 23", "3\n1 2 3", "3\n2 3 1"]
2 seconds
["3\n1 3 5", "0", "3\n1 2 3"]
null
Java 7
standard input
[ "constructive algorithms", "greedy" ]
652c7852f1d0bab64ffd2219af4f59da
The first line of the input contains one integer n (1 ≤ n ≤ 105). The second line contains n space-separated integers — the given sequence. All numbers in this sequence do not exceed 106 by absolute value.
1,900
If the given sequence does not contain any unordered subsequences, output 0. Otherwise, output the length k of the shortest such subsequence. Then output k integers from the range [1..n] — indexes of the elements of this subsequence. If there are several solutions, output any of them.
standard output
PASSED
1b76105d0312a87c5d28612a7a7c0df4
train_001.jsonl
1284130800
The sequence is called ordered if it is non-decreasing or non-increasing. For example, sequnces [3, 1, 1, 0] and [1, 2, 3, 100] are ordered, but the sequence [1, 3, 3, 1] is not. You are given a sequence of numbers. You are to find it's shortest subsequence which is not ordered.A subsequence is a sequence that can be d...
256 megabytes
import java.util.*; import java.io.*; public class C27 { class InputReader { public BufferedReader reader; public StringTokenizer tokenizer; public InputReader(InputStream stream) { reader = new BufferedReader(new InputStreamReader(stream)); tokenizer = null; } public InputReader() throws FileNotFou...
Java
["5\n67 499 600 42 23", "3\n1 2 3", "3\n2 3 1"]
2 seconds
["3\n1 3 5", "0", "3\n1 2 3"]
null
Java 7
standard input
[ "constructive algorithms", "greedy" ]
652c7852f1d0bab64ffd2219af4f59da
The first line of the input contains one integer n (1 ≤ n ≤ 105). The second line contains n space-separated integers — the given sequence. All numbers in this sequence do not exceed 106 by absolute value.
1,900
If the given sequence does not contain any unordered subsequences, output 0. Otherwise, output the length k of the shortest such subsequence. Then output k integers from the range [1..n] — indexes of the elements of this subsequence. If there are several solutions, output any of them.
standard output
PASSED
727dc33a62c03dd559267d59b15bea84
train_001.jsonl
1284130800
The sequence is called ordered if it is non-decreasing or non-increasing. For example, sequnces [3, 1, 1, 0] and [1, 2, 3, 100] are ordered, but the sequence [1, 3, 3, 1] is not. You are given a sequence of numbers. You are to find it's shortest subsequence which is not ordered.A subsequence is a sequence that can be d...
256 megabytes
import java.io.BufferedReader; import java.io.BufferedWriter; import java.io.InputStream; import java.io.InputStreamReader; import java.io.OutputStream; import java.io.OutputStreamWriter; import java.io.PrintWriter; import java.util.StringTokenizer; import java.util.TreeMap; public class cf27c { public static void m...
Java
["5\n67 499 600 42 23", "3\n1 2 3", "3\n2 3 1"]
2 seconds
["3\n1 3 5", "0", "3\n1 2 3"]
null
Java 7
standard input
[ "constructive algorithms", "greedy" ]
652c7852f1d0bab64ffd2219af4f59da
The first line of the input contains one integer n (1 ≤ n ≤ 105). The second line contains n space-separated integers — the given sequence. All numbers in this sequence do not exceed 106 by absolute value.
1,900
If the given sequence does not contain any unordered subsequences, output 0. Otherwise, output the length k of the shortest such subsequence. Then output k integers from the range [1..n] — indexes of the elements of this subsequence. If there are several solutions, output any of them.
standard output
PASSED
3d5c2a793b3bdc81943256b80f14d507
train_001.jsonl
1284130800
The sequence is called ordered if it is non-decreasing or non-increasing. For example, sequnces [3, 1, 1, 0] and [1, 2, 3, 100] are ordered, but the sequence [1, 3, 3, 1] is not. You are given a sequence of numbers. You are to find it's shortest subsequence which is not ordered.A subsequence is a sequence that can be d...
256 megabytes
import java.util.Arrays; import java.util.Scanner; public class c27 { public static void main(String[] args) { Scanner in = new Scanner(System.in); int n = in.nextInt(); int[] arr = new int[n]; int minIdx=0, maxIdx=0; arr[0] = in.nextInt(); for (int i = 1; i < arr.length; i++) { arr[i] = in.nextInt(); if ((...
Java
["5\n67 499 600 42 23", "3\n1 2 3", "3\n2 3 1"]
2 seconds
["3\n1 3 5", "0", "3\n1 2 3"]
null
Java 7
standard input
[ "constructive algorithms", "greedy" ]
652c7852f1d0bab64ffd2219af4f59da
The first line of the input contains one integer n (1 ≤ n ≤ 105). The second line contains n space-separated integers — the given sequence. All numbers in this sequence do not exceed 106 by absolute value.
1,900
If the given sequence does not contain any unordered subsequences, output 0. Otherwise, output the length k of the shortest such subsequence. Then output k integers from the range [1..n] — indexes of the elements of this subsequence. If there are several solutions, output any of them.
standard output
PASSED
2937b9988873000548f2e8bed683efdd
train_001.jsonl
1284130800
The sequence is called ordered if it is non-decreasing or non-increasing. For example, sequnces [3, 1, 1, 0] and [1, 2, 3, 100] are ordered, but the sequence [1, 3, 3, 1] is not. You are given a sequence of numbers. You are to find it's shortest subsequence which is not ordered.A subsequence is a sequence that can be d...
256 megabytes
import java.io.*; import java.util.*; /** * Created by peacefrog on 12/4/15. * Time : 9:57 PM */ public class CF27C { final boolean ONLINE_JUDGE = System.getProperty("ONLINE_JUDGE") != null; PrintWriter out; long timeBegin, timeEnd; public void runIO() throws IOException { timeBegin = System.currentTimeMill...
Java
["5\n67 499 600 42 23", "3\n1 2 3", "3\n2 3 1"]
2 seconds
["3\n1 3 5", "0", "3\n1 2 3"]
null
Java 7
standard input
[ "constructive algorithms", "greedy" ]
652c7852f1d0bab64ffd2219af4f59da
The first line of the input contains one integer n (1 ≤ n ≤ 105). The second line contains n space-separated integers — the given sequence. All numbers in this sequence do not exceed 106 by absolute value.
1,900
If the given sequence does not contain any unordered subsequences, output 0. Otherwise, output the length k of the shortest such subsequence. Then output k integers from the range [1..n] — indexes of the elements of this subsequence. If there are several solutions, output any of them.
standard output
PASSED
bc25fd07c8b5207a67b26a4a1f65c75b
train_001.jsonl
1284130800
The sequence is called ordered if it is non-decreasing or non-increasing. For example, sequnces [3, 1, 1, 0] and [1, 2, 3, 100] are ordered, but the sequence [1, 3, 3, 1] is not. You are given a sequence of numbers. You are to find it's shortest subsequence which is not ordered.A subsequence is a sequence that can be d...
256 megabytes
import java.io.*; import java.util.*; /** * Created by peacefrog on 12/4/15. * Time : 9:57 PM */ public class CF27C { final boolean ONLINE_JUDGE = System.getProperty("ONLINE_JUDGE") != null; PrintWriter out; long timeBegin, timeEnd; public void runIO() throws IOException { timeBegin = Syste...
Java
["5\n67 499 600 42 23", "3\n1 2 3", "3\n2 3 1"]
2 seconds
["3\n1 3 5", "0", "3\n1 2 3"]
null
Java 7
standard input
[ "constructive algorithms", "greedy" ]
652c7852f1d0bab64ffd2219af4f59da
The first line of the input contains one integer n (1 ≤ n ≤ 105). The second line contains n space-separated integers — the given sequence. All numbers in this sequence do not exceed 106 by absolute value.
1,900
If the given sequence does not contain any unordered subsequences, output 0. Otherwise, output the length k of the shortest such subsequence. Then output k integers from the range [1..n] — indexes of the elements of this subsequence. If there are several solutions, output any of them.
standard output
PASSED
ec9809a1ce9f4bd3ffbd596911ac454b
train_001.jsonl
1284130800
The sequence is called ordered if it is non-decreasing or non-increasing. For example, sequnces [3, 1, 1, 0] and [1, 2, 3, 100] are ordered, but the sequence [1, 3, 3, 1] is not. You are given a sequence of numbers. You are to find it's shortest subsequence which is not ordered.A subsequence is a sequence that can be d...
256 megabytes
import java.io.InputStreamReader; import java.io.IOException; import java.io.BufferedReader; import java.io.OutputStream; import java.io.PrintWriter; import java.util.StringTokenizer; import java.io.InputStream; import java.math.BigInteger; import java.util.ArrayList; import java.util.Arrays; import java.util.Stack; im...
Java
["5\n67 499 600 42 23", "3\n1 2 3", "3\n2 3 1"]
2 seconds
["3\n1 3 5", "0", "3\n1 2 3"]
null
Java 7
standard input
[ "constructive algorithms", "greedy" ]
652c7852f1d0bab64ffd2219af4f59da
The first line of the input contains one integer n (1 ≤ n ≤ 105). The second line contains n space-separated integers — the given sequence. All numbers in this sequence do not exceed 106 by absolute value.
1,900
If the given sequence does not contain any unordered subsequences, output 0. Otherwise, output the length k of the shortest such subsequence. Then output k integers from the range [1..n] — indexes of the elements of this subsequence. If there are several solutions, output any of them.
standard output
PASSED
52f5f11a3713677d17822aff29560990
train_001.jsonl
1284130800
The sequence is called ordered if it is non-decreasing or non-increasing. For example, sequnces [3, 1, 1, 0] and [1, 2, 3, 100] are ordered, but the sequence [1, 3, 3, 1] is not. You are given a sequence of numbers. You are to find it's shortest subsequence which is not ordered.A subsequence is a sequence that can be d...
256 megabytes
import java.awt.*; import java.awt.event.*; import java.awt.geom.*; import java.io.*; import java.math.*; import java.text.*; import java.util.*; import java.util.regex.*; /* br = new BufferedReader(new FileReader("input.txt")); pw = new PrintWriter(new BufferedWriter(new FileWriter("output.txt"))); br = new ...
Java
["5\n67 499 600 42 23", "3\n1 2 3", "3\n2 3 1"]
2 seconds
["3\n1 3 5", "0", "3\n1 2 3"]
null
Java 7
standard input
[ "constructive algorithms", "greedy" ]
652c7852f1d0bab64ffd2219af4f59da
The first line of the input contains one integer n (1 ≤ n ≤ 105). The second line contains n space-separated integers — the given sequence. All numbers in this sequence do not exceed 106 by absolute value.
1,900
If the given sequence does not contain any unordered subsequences, output 0. Otherwise, output the length k of the shortest such subsequence. Then output k integers from the range [1..n] — indexes of the elements of this subsequence. If there are several solutions, output any of them.
standard output
PASSED
d3e00a52e0267058f4989c5566d70da9
train_001.jsonl
1284130800
The sequence is called ordered if it is non-decreasing or non-increasing. For example, sequnces [3, 1, 1, 0] and [1, 2, 3, 100] are ordered, but the sequence [1, 3, 3, 1] is not. You are given a sequence of numbers. You are to find it's shortest subsequence which is not ordered.A subsequence is a sequence that can be d...
256 megabytes
import java.math.BigInteger; import java.util.Arrays; import java.util.Collections; import java.util.HashSet; import java.util.Random; import java.util.Scanner; import java.util.Vector; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in...
Java
["5\n67 499 600 42 23", "3\n1 2 3", "3\n2 3 1"]
2 seconds
["3\n1 3 5", "0", "3\n1 2 3"]
null
Java 7
standard input
[ "constructive algorithms", "greedy" ]
652c7852f1d0bab64ffd2219af4f59da
The first line of the input contains one integer n (1 ≤ n ≤ 105). The second line contains n space-separated integers — the given sequence. All numbers in this sequence do not exceed 106 by absolute value.
1,900
If the given sequence does not contain any unordered subsequences, output 0. Otherwise, output the length k of the shortest such subsequence. Then output k integers from the range [1..n] — indexes of the elements of this subsequence. If there are several solutions, output any of them.
standard output
PASSED
aa8298b0c5aa2bed2e8dac6aa5f06c77
train_001.jsonl
1284130800
The sequence is called ordered if it is non-decreasing or non-increasing. For example, sequnces [3, 1, 1, 0] and [1, 2, 3, 100] are ordered, but the sequence [1, 3, 3, 1] is not. You are given a sequence of numbers. You are to find it's shortest subsequence which is not ordered.A subsequence is a sequence that can be d...
256 megabytes
import java.io.IOException; import java.io.InputStreamReader; import java.io.BufferedReader; import java.io.OutputStream; import java.io.PrintWriter; import java.util.StringTokenizer; import java.io.InputStream; /** * Built using CHelper plug-in * Actual solution is at the top * @author Zyflair Griffane */ public ...
Java
["5\n67 499 600 42 23", "3\n1 2 3", "3\n2 3 1"]
2 seconds
["3\n1 3 5", "0", "3\n1 2 3"]
null
Java 7
standard input
[ "constructive algorithms", "greedy" ]
652c7852f1d0bab64ffd2219af4f59da
The first line of the input contains one integer n (1 ≤ n ≤ 105). The second line contains n space-separated integers — the given sequence. All numbers in this sequence do not exceed 106 by absolute value.
1,900
If the given sequence does not contain any unordered subsequences, output 0. Otherwise, output the length k of the shortest such subsequence. Then output k integers from the range [1..n] — indexes of the elements of this subsequence. If there are several solutions, output any of them.
standard output
PASSED
358bb79fdfde936838511f1cf60c1487
train_001.jsonl
1284130800
The sequence is called ordered if it is non-decreasing or non-increasing. For example, sequnces [3, 1, 1, 0] and [1, 2, 3, 100] are ordered, but the sequence [1, 3, 3, 1] is not. You are given a sequence of numbers. You are to find it's shortest subsequence which is not ordered.A subsequence is a sequence that can be d...
256 megabytes
import java.util.*; public class Main { public static void main(String [] args){ Scanner in=new Scanner(System.in); int n=in.nextInt(); int array[]=new int[n+1]; for(int i=1;i<=n;i++)array[i]=in.nextInt(); int left[]=new int[n+1]; int right[]=new int[n+1]; Arrays.fill(left,-1); Arrays.fill(right,-1); int min=I...
Java
["5\n67 499 600 42 23", "3\n1 2 3", "3\n2 3 1"]
2 seconds
["3\n1 3 5", "0", "3\n1 2 3"]
null
Java 7
standard input
[ "constructive algorithms", "greedy" ]
652c7852f1d0bab64ffd2219af4f59da
The first line of the input contains one integer n (1 ≤ n ≤ 105). The second line contains n space-separated integers — the given sequence. All numbers in this sequence do not exceed 106 by absolute value.
1,900
If the given sequence does not contain any unordered subsequences, output 0. Otherwise, output the length k of the shortest such subsequence. Then output k integers from the range [1..n] — indexes of the elements of this subsequence. If there are several solutions, output any of them.
standard output
PASSED
d7d7c928b46b1e8f457ddb9875f7a1b7
train_001.jsonl
1589707200
The statement of this problem is the same as the statement of problem C2. The only difference is that, in problem C1, $$$n$$$ is always even, and in C2, $$$n$$$ is always odd.You are given a regular polygon with $$$2 \cdot n$$$ vertices (it's convex and has equal sides and equal angles) and all its sides have length $$...
256 megabytes
//package goku; import java.io.*; import java.util.*; public class goku { BufferedReader br; PrintWriter out; long mod = (long) (1e9 + 7), inf = (long) (5e18); void spiritBomb() { int t = ni(); while(t-- > 0) { double n = nd() * 2; double radius = 1.0...
Java
["3\n2\n4\n200"]
2 seconds
["1.000000000\n2.414213562\n127.321336469"]
null
Java 8
standard input
[ "binary search", "geometry", "ternary search", "math" ]
0c7a476716445c535a61f4e81edc7f75
The first line contains a single integer $$$T$$$ ($$$1 \le T \le 200$$$) — the number of test cases. Next $$$T$$$ lines contain descriptions of test cases — one per line. Each line contains single even integer $$$n$$$ ($$$2 \le n \le 200$$$). Don't forget you need to embed $$$2n$$$-gon, not an $$$n$$$-gon.
1,400
Print $$$T$$$ real numbers — one per test case. For each test case, print the minimum length of a side of the square $$$2n$$$-gon can be embedded in. Your answer will be considered correct if its absolute or relative error doesn't exceed $$$10^{-6}$$$.
standard output
PASSED
75fe30ad2bf95e23b6608b97d2651283
train_001.jsonl
1589707200
The statement of this problem is the same as the statement of problem C2. The only difference is that, in problem C1, $$$n$$$ is always even, and in C2, $$$n$$$ is always odd.You are given a regular polygon with $$$2 \cdot n$$$ vertices (it's convex and has equal sides and equal angles) and all its sides have length $$...
256 megabytes
import java.util.*; public class Solution{ public static void main(String args[]){ Scanner sc=new Scanner(System.in); int t=sc.nextInt(); while(t-->0){ int n=sc.nextInt(); double s=2*0.5/(Math.tan(Math.PI/(2*n))); System.out.printf("%.9f\n",s); } ...
Java
["3\n2\n4\n200"]
2 seconds
["1.000000000\n2.414213562\n127.321336469"]
null
Java 8
standard input
[ "binary search", "geometry", "ternary search", "math" ]
0c7a476716445c535a61f4e81edc7f75
The first line contains a single integer $$$T$$$ ($$$1 \le T \le 200$$$) — the number of test cases. Next $$$T$$$ lines contain descriptions of test cases — one per line. Each line contains single even integer $$$n$$$ ($$$2 \le n \le 200$$$). Don't forget you need to embed $$$2n$$$-gon, not an $$$n$$$-gon.
1,400
Print $$$T$$$ real numbers — one per test case. For each test case, print the minimum length of a side of the square $$$2n$$$-gon can be embedded in. Your answer will be considered correct if its absolute or relative error doesn't exceed $$$10^{-6}$$$.
standard output
PASSED
d0c49e902af8d206a4c04cb4dd45b146
train_001.jsonl
1589707200
The statement of this problem is the same as the statement of problem C2. The only difference is that, in problem C1, $$$n$$$ is always even, and in C2, $$$n$$$ is always odd.You are given a regular polygon with $$$2 \cdot n$$$ vertices (it's convex and has equal sides and equal angles) and all its sides have length $$...
256 megabytes
import java.io.*; import java.math.BigInteger; import java.util.*; /* procrastinating */ public class Main { static FastReader in; static PrintWriter out; static Random rand = new Random(); static final int INF = (int) (1e9 + 10); static final int MOD = (int) (998244353); static void solve()...
Java
["3\n2\n4\n200"]
2 seconds
["1.000000000\n2.414213562\n127.321336469"]
null
Java 8
standard input
[ "binary search", "geometry", "ternary search", "math" ]
0c7a476716445c535a61f4e81edc7f75
The first line contains a single integer $$$T$$$ ($$$1 \le T \le 200$$$) — the number of test cases. Next $$$T$$$ lines contain descriptions of test cases — one per line. Each line contains single even integer $$$n$$$ ($$$2 \le n \le 200$$$). Don't forget you need to embed $$$2n$$$-gon, not an $$$n$$$-gon.
1,400
Print $$$T$$$ real numbers — one per test case. For each test case, print the minimum length of a side of the square $$$2n$$$-gon can be embedded in. Your answer will be considered correct if its absolute or relative error doesn't exceed $$$10^{-6}$$$.
standard output
PASSED
0598cf6dc5ab5ce958b1e1218be87e87
train_001.jsonl
1589707200
The statement of this problem is the same as the statement of problem C2. The only difference is that, in problem C1, $$$n$$$ is always even, and in C2, $$$n$$$ is always odd.You are given a regular polygon with $$$2 \cdot n$$$ vertices (it's convex and has equal sides and equal angles) and all its sides have length $$...
256 megabytes
//package CodeForces; import java.util.Scanner; public class SimplePolyGonEmbedding { public static void main(String[] args) { // TODO Auto-generated method stub Scanner s=new Scanner(System.in); int t=s.nextInt(); StringBuilder temp=new StringBuilder(); while(t>0) { double n=s.nextDouble(); doubl...
Java
["3\n2\n4\n200"]
2 seconds
["1.000000000\n2.414213562\n127.321336469"]
null
Java 8
standard input
[ "binary search", "geometry", "ternary search", "math" ]
0c7a476716445c535a61f4e81edc7f75
The first line contains a single integer $$$T$$$ ($$$1 \le T \le 200$$$) — the number of test cases. Next $$$T$$$ lines contain descriptions of test cases — one per line. Each line contains single even integer $$$n$$$ ($$$2 \le n \le 200$$$). Don't forget you need to embed $$$2n$$$-gon, not an $$$n$$$-gon.
1,400
Print $$$T$$$ real numbers — one per test case. For each test case, print the minimum length of a side of the square $$$2n$$$-gon can be embedded in. Your answer will be considered correct if its absolute or relative error doesn't exceed $$$10^{-6}$$$.
standard output
PASSED
d9af0cd242a9c384851427de3c401137
train_001.jsonl
1589707200
The statement of this problem is the same as the statement of problem C2. The only difference is that, in problem C1, $$$n$$$ is always even, and in C2, $$$n$$$ is always odd.You are given a regular polygon with $$$2 \cdot n$$$ vertices (it's convex and has equal sides and equal angles) and all its sides have length $$...
256 megabytes
//package CodeForces; import java.util.Scanner; public class SimplePolyGonEmbedding { public static void main(String[] args) { // TODO Auto-generated method stub Scanner s=new Scanner(System.in); int t=s.nextInt(); while(t>0) { double n=s.nextDouble(); double angle=((360/(2*n)))/2; //System.out.p...
Java
["3\n2\n4\n200"]
2 seconds
["1.000000000\n2.414213562\n127.321336469"]
null
Java 8
standard input
[ "binary search", "geometry", "ternary search", "math" ]
0c7a476716445c535a61f4e81edc7f75
The first line contains a single integer $$$T$$$ ($$$1 \le T \le 200$$$) — the number of test cases. Next $$$T$$$ lines contain descriptions of test cases — one per line. Each line contains single even integer $$$n$$$ ($$$2 \le n \le 200$$$). Don't forget you need to embed $$$2n$$$-gon, not an $$$n$$$-gon.
1,400
Print $$$T$$$ real numbers — one per test case. For each test case, print the minimum length of a side of the square $$$2n$$$-gon can be embedded in. Your answer will be considered correct if its absolute or relative error doesn't exceed $$$10^{-6}$$$.
standard output
PASSED
d36a62e2bd638bc37c7e221f4978602a
train_001.jsonl
1589707200
The statement of this problem is the same as the statement of problem C2. The only difference is that, in problem C1, $$$n$$$ is always even, and in C2, $$$n$$$ is always odd.You are given a regular polygon with $$$2 \cdot n$$$ vertices (it's convex and has equal sides and equal angles) and all its sides have length $$...
256 megabytes
import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; import java.io.PrintWriter; import java.util.Comparator; import java.util.List; public class SimplePolygonEmbedding { // Template for CF public static class ListComparator implements Comparator<List<Integer>> { @O...
Java
["3\n2\n4\n200"]
2 seconds
["1.000000000\n2.414213562\n127.321336469"]
null
Java 8
standard input
[ "binary search", "geometry", "ternary search", "math" ]
0c7a476716445c535a61f4e81edc7f75
The first line contains a single integer $$$T$$$ ($$$1 \le T \le 200$$$) — the number of test cases. Next $$$T$$$ lines contain descriptions of test cases — one per line. Each line contains single even integer $$$n$$$ ($$$2 \le n \le 200$$$). Don't forget you need to embed $$$2n$$$-gon, not an $$$n$$$-gon.
1,400
Print $$$T$$$ real numbers — one per test case. For each test case, print the minimum length of a side of the square $$$2n$$$-gon can be embedded in. Your answer will be considered correct if its absolute or relative error doesn't exceed $$$10^{-6}$$$.
standard output
PASSED
ec70c97a96f3365152b4414120de3260
train_001.jsonl
1589707200
The statement of this problem is the same as the statement of problem C2. The only difference is that, in problem C1, $$$n$$$ is always even, and in C2, $$$n$$$ is always odd.You are given a regular polygon with $$$2 \cdot n$$$ vertices (it's convex and has equal sides and equal angles) and all its sides have length $$...
256 megabytes
import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int t = sc.nextInt(); StringBuilder str = new StringBuilder(); while(t != 0) { solve(sc.nextDouble()); // str.append() + "\n"); t--; } //System.out.println(str.toString()); ...
Java
["3\n2\n4\n200"]
2 seconds
["1.000000000\n2.414213562\n127.321336469"]
null
Java 8
standard input
[ "binary search", "geometry", "ternary search", "math" ]
0c7a476716445c535a61f4e81edc7f75
The first line contains a single integer $$$T$$$ ($$$1 \le T \le 200$$$) — the number of test cases. Next $$$T$$$ lines contain descriptions of test cases — one per line. Each line contains single even integer $$$n$$$ ($$$2 \le n \le 200$$$). Don't forget you need to embed $$$2n$$$-gon, not an $$$n$$$-gon.
1,400
Print $$$T$$$ real numbers — one per test case. For each test case, print the minimum length of a side of the square $$$2n$$$-gon can be embedded in. Your answer will be considered correct if its absolute or relative error doesn't exceed $$$10^{-6}$$$.
standard output
PASSED
570ead856916ac80bd5108ce960d3d5a
train_001.jsonl
1589707200
The statement of this problem is the same as the statement of problem C2. The only difference is that, in problem C1, $$$n$$$ is always even, and in C2, $$$n$$$ is always odd.You are given a regular polygon with $$$2 \cdot n$$$ vertices (it's convex and has equal sides and equal angles) and all its sides have length $$...
256 megabytes
import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int t = sc.nextInt(); StringBuilder str = new StringBuilder(); while(t != 0) { str.append(solve(sc.nextDouble()) + "\n"); t--; } System.out.println(str.toString()); } publi...
Java
["3\n2\n4\n200"]
2 seconds
["1.000000000\n2.414213562\n127.321336469"]
null
Java 8
standard input
[ "binary search", "geometry", "ternary search", "math" ]
0c7a476716445c535a61f4e81edc7f75
The first line contains a single integer $$$T$$$ ($$$1 \le T \le 200$$$) — the number of test cases. Next $$$T$$$ lines contain descriptions of test cases — one per line. Each line contains single even integer $$$n$$$ ($$$2 \le n \le 200$$$). Don't forget you need to embed $$$2n$$$-gon, not an $$$n$$$-gon.
1,400
Print $$$T$$$ real numbers — one per test case. For each test case, print the minimum length of a side of the square $$$2n$$$-gon can be embedded in. Your answer will be considered correct if its absolute or relative error doesn't exceed $$$10^{-6}$$$.
standard output
PASSED
6e36270f0fae4732302d080f63ae44ca
train_001.jsonl
1589707200
The statement of this problem is the same as the statement of problem C2. The only difference is that, in problem C1, $$$n$$$ is always even, and in C2, $$$n$$$ is always odd.You are given a regular polygon with $$$2 \cdot n$$$ vertices (it's convex and has equal sides and equal angles) and all its sides have length $$...
256 megabytes
import java.io.OutputStream; import java.io.IOException; import java.io.InputStream; import java.io.PrintWriter; import java.text.DecimalFormat; import java.util.Scanner; import java.text.NumberFormat; import java.math.RoundingMode; /** * Built using CHelper plug-in * Actual solution is at the top */ public class M...
Java
["3\n2\n4\n200"]
2 seconds
["1.000000000\n2.414213562\n127.321336469"]
null
Java 8
standard input
[ "binary search", "geometry", "ternary search", "math" ]
0c7a476716445c535a61f4e81edc7f75
The first line contains a single integer $$$T$$$ ($$$1 \le T \le 200$$$) — the number of test cases. Next $$$T$$$ lines contain descriptions of test cases — one per line. Each line contains single even integer $$$n$$$ ($$$2 \le n \le 200$$$). Don't forget you need to embed $$$2n$$$-gon, not an $$$n$$$-gon.
1,400
Print $$$T$$$ real numbers — one per test case. For each test case, print the minimum length of a side of the square $$$2n$$$-gon can be embedded in. Your answer will be considered correct if its absolute or relative error doesn't exceed $$$10^{-6}$$$.
standard output
PASSED
4e3722f1df621094855e23bc92940604
train_001.jsonl
1589707200
The statement of this problem is the same as the statement of problem C2. The only difference is that, in problem C1, $$$n$$$ is always even, and in C2, $$$n$$$ is always odd.You are given a regular polygon with $$$2 \cdot n$$$ vertices (it's convex and has equal sides and equal angles) and all its sides have length $$...
256 megabytes
import java.text.DecimalFormat; import java.util.*; public class Problem { public static void main(String[] args) { Scanner sc=new Scanner(System.in); int t=sc.nextInt(); while(t-->0) { int n=sc.nextInt(); DecimalFormat df = new DecimalFormat("#.#########...
Java
["3\n2\n4\n200"]
2 seconds
["1.000000000\n2.414213562\n127.321336469"]
null
Java 8
standard input
[ "binary search", "geometry", "ternary search", "math" ]
0c7a476716445c535a61f4e81edc7f75
The first line contains a single integer $$$T$$$ ($$$1 \le T \le 200$$$) — the number of test cases. Next $$$T$$$ lines contain descriptions of test cases — one per line. Each line contains single even integer $$$n$$$ ($$$2 \le n \le 200$$$). Don't forget you need to embed $$$2n$$$-gon, not an $$$n$$$-gon.
1,400
Print $$$T$$$ real numbers — one per test case. For each test case, print the minimum length of a side of the square $$$2n$$$-gon can be embedded in. Your answer will be considered correct if its absolute or relative error doesn't exceed $$$10^{-6}$$$.
standard output
PASSED
b9685e46ced6bbd2e4e7615abe81afcc
train_001.jsonl
1589707200
The statement of this problem is the same as the statement of problem C2. The only difference is that, in problem C1, $$$n$$$ is always even, and in C2, $$$n$$$ is always odd.You are given a regular polygon with $$$2 \cdot n$$$ vertices (it's convex and has equal sides and equal angles) and all its sides have length $$...
256 megabytes
import java.io.*; public class Codec { public static void main(String []args) throws IOException { BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); int tc=Integer.parseInt(br.readLine()); while(tc>0) {tc--; int n=Integer.parseInt(br.readLine()); n=2*n; do...
Java
["3\n2\n4\n200"]
2 seconds
["1.000000000\n2.414213562\n127.321336469"]
null
Java 8
standard input
[ "binary search", "geometry", "ternary search", "math" ]
0c7a476716445c535a61f4e81edc7f75
The first line contains a single integer $$$T$$$ ($$$1 \le T \le 200$$$) — the number of test cases. Next $$$T$$$ lines contain descriptions of test cases — one per line. Each line contains single even integer $$$n$$$ ($$$2 \le n \le 200$$$). Don't forget you need to embed $$$2n$$$-gon, not an $$$n$$$-gon.
1,400
Print $$$T$$$ real numbers — one per test case. For each test case, print the minimum length of a side of the square $$$2n$$$-gon can be embedded in. Your answer will be considered correct if its absolute or relative error doesn't exceed $$$10^{-6}$$$.
standard output
PASSED
9e77a9c381a0b343a2231060a6e6952e
train_001.jsonl
1589707200
The statement of this problem is the same as the statement of problem C2. The only difference is that, in problem C1, $$$n$$$ is always even, and in C2, $$$n$$$ is always odd.You are given a regular polygon with $$$2 \cdot n$$$ vertices (it's convex and has equal sides and equal angles) and all its sides have length $$...
256 megabytes
import java.io.*; import java.util.*; import java.util.stream.*; import static java.util.stream.Collectors.*; public class Main { void solve() { int n = 2*in.nextInt(); int m = (n - 1) / 4; double alpha = Math.PI - Math.PI * (n - 2) / n; double tmp = 1; for (int i = 0; i < ...
Java
["3\n2\n4\n200"]
2 seconds
["1.000000000\n2.414213562\n127.321336469"]
null
Java 8
standard input
[ "binary search", "geometry", "ternary search", "math" ]
0c7a476716445c535a61f4e81edc7f75
The first line contains a single integer $$$T$$$ ($$$1 \le T \le 200$$$) — the number of test cases. Next $$$T$$$ lines contain descriptions of test cases — one per line. Each line contains single even integer $$$n$$$ ($$$2 \le n \le 200$$$). Don't forget you need to embed $$$2n$$$-gon, not an $$$n$$$-gon.
1,400
Print $$$T$$$ real numbers — one per test case. For each test case, print the minimum length of a side of the square $$$2n$$$-gon can be embedded in. Your answer will be considered correct if its absolute or relative error doesn't exceed $$$10^{-6}$$$.
standard output
PASSED
ccabc98c9d4f80f203785d4cb884fa32
train_001.jsonl
1589707200
The statement of this problem is the same as the statement of problem C2. The only difference is that, in problem C1, $$$n$$$ is always even, and in C2, $$$n$$$ is always odd.You are given a regular polygon with $$$2 \cdot n$$$ vertices (it's convex and has equal sides and equal angles) and all its sides have length $$...
256 megabytes
import java.math.*; import java.util.*; public class asol { public static double tan(double sides) { double k = 180.0/sides; double a = Math.toRadians(k); return Math.tan(a); } public static void main(String[] args) { Scanner scan = new Scanner(System.in); int tc = scan.nextInt(); while(tc--!=0) { ...
Java
["3\n2\n4\n200"]
2 seconds
["1.000000000\n2.414213562\n127.321336469"]
null
Java 8
standard input
[ "binary search", "geometry", "ternary search", "math" ]
0c7a476716445c535a61f4e81edc7f75
The first line contains a single integer $$$T$$$ ($$$1 \le T \le 200$$$) — the number of test cases. Next $$$T$$$ lines contain descriptions of test cases — one per line. Each line contains single even integer $$$n$$$ ($$$2 \le n \le 200$$$). Don't forget you need to embed $$$2n$$$-gon, not an $$$n$$$-gon.
1,400
Print $$$T$$$ real numbers — one per test case. For each test case, print the minimum length of a side of the square $$$2n$$$-gon can be embedded in. Your answer will be considered correct if its absolute or relative error doesn't exceed $$$10^{-6}$$$.
standard output
PASSED
cb0d11d3603e8d071b14b01beb000164
train_001.jsonl
1589707200
The statement of this problem is the same as the statement of problem C2. The only difference is that, in problem C1, $$$n$$$ is always even, and in C2, $$$n$$$ is always odd.You are given a regular polygon with $$$2 \cdot n$$$ vertices (it's convex and has equal sides and equal angles) and all its sides have length $$...
256 megabytes
/* package codechef; // don't place package name! */ 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 Mai { public static void main (String[] args) throws java.lang.Exception { Scanner sc=new Scanner(System.in); int t=sc...
Java
["3\n2\n4\n200"]
2 seconds
["1.000000000\n2.414213562\n127.321336469"]
null
Java 8
standard input
[ "binary search", "geometry", "ternary search", "math" ]
0c7a476716445c535a61f4e81edc7f75
The first line contains a single integer $$$T$$$ ($$$1 \le T \le 200$$$) — the number of test cases. Next $$$T$$$ lines contain descriptions of test cases — one per line. Each line contains single even integer $$$n$$$ ($$$2 \le n \le 200$$$). Don't forget you need to embed $$$2n$$$-gon, not an $$$n$$$-gon.
1,400
Print $$$T$$$ real numbers — one per test case. For each test case, print the minimum length of a side of the square $$$2n$$$-gon can be embedded in. Your answer will be considered correct if its absolute or relative error doesn't exceed $$$10^{-6}$$$.
standard output
PASSED
5b98f3e2d6047b30d5d3e63d15382ec9
train_001.jsonl
1589707200
The statement of this problem is the same as the statement of problem C2. The only difference is that, in problem C1, $$$n$$$ is always even, and in C2, $$$n$$$ is always odd.You are given a regular polygon with $$$2 \cdot n$$$ vertices (it's convex and has equal sides and equal angles) and all its sides have length $$...
256 megabytes
import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; import java.io.PrintWriter; import java.util.StringTokenizer; import java.lang.Math; public class Solution{ public static void main(String[] args) throws Exception{ FastScanner fs = new FastScanner(); PrintWriter out = ...
Java
["3\n2\n4\n200"]
2 seconds
["1.000000000\n2.414213562\n127.321336469"]
null
Java 8
standard input
[ "binary search", "geometry", "ternary search", "math" ]
0c7a476716445c535a61f4e81edc7f75
The first line contains a single integer $$$T$$$ ($$$1 \le T \le 200$$$) — the number of test cases. Next $$$T$$$ lines contain descriptions of test cases — one per line. Each line contains single even integer $$$n$$$ ($$$2 \le n \le 200$$$). Don't forget you need to embed $$$2n$$$-gon, not an $$$n$$$-gon.
1,400
Print $$$T$$$ real numbers — one per test case. For each test case, print the minimum length of a side of the square $$$2n$$$-gon can be embedded in. Your answer will be considered correct if its absolute or relative error doesn't exceed $$$10^{-6}$$$.
standard output
PASSED
4e620bfd9c98098a754e3cb821c1c3d7
train_001.jsonl
1589707200
The statement of this problem is the same as the statement of problem C2. The only difference is that, in problem C1, $$$n$$$ is always even, and in C2, $$$n$$$ is always odd.You are given a regular polygon with $$$2 \cdot n$$$ vertices (it's convex and has equal sides and equal angles) and all its sides have length $$...
256 megabytes
import java.util.*; import java.io.*; import java.io.BufferedReader; public class Z_C{ public static final String TASKNAME = ""; public static final long mod= 1000000007; public static void main(String[] args) throws IOException { InputReader in = new InputReader(System.in); PrintWriter out = new PrintWriter(S...
Java
["3\n2\n4\n200"]
2 seconds
["1.000000000\n2.414213562\n127.321336469"]
null
Java 8
standard input
[ "binary search", "geometry", "ternary search", "math" ]
0c7a476716445c535a61f4e81edc7f75
The first line contains a single integer $$$T$$$ ($$$1 \le T \le 200$$$) — the number of test cases. Next $$$T$$$ lines contain descriptions of test cases — one per line. Each line contains single even integer $$$n$$$ ($$$2 \le n \le 200$$$). Don't forget you need to embed $$$2n$$$-gon, not an $$$n$$$-gon.
1,400
Print $$$T$$$ real numbers — one per test case. For each test case, print the minimum length of a side of the square $$$2n$$$-gon can be embedded in. Your answer will be considered correct if its absolute or relative error doesn't exceed $$$10^{-6}$$$.
standard output
PASSED
6993d0ef5f5ef576bc8a1fbadb2229bc
train_001.jsonl
1589707200
The statement of this problem is the same as the statement of problem C2. The only difference is that, in problem C1, $$$n$$$ is always even, and in C2, $$$n$$$ is always odd.You are given a regular polygon with $$$2 \cdot n$$$ vertices (it's convex and has equal sides and equal angles) and all its sides have length $$...
256 megabytes
import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; public class SimplePolygonEmbedding { public static void main(String[] args) throws IOException { BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); int t = Integer.parseInt(br.read...
Java
["3\n2\n4\n200"]
2 seconds
["1.000000000\n2.414213562\n127.321336469"]
null
Java 8
standard input
[ "binary search", "geometry", "ternary search", "math" ]
0c7a476716445c535a61f4e81edc7f75
The first line contains a single integer $$$T$$$ ($$$1 \le T \le 200$$$) — the number of test cases. Next $$$T$$$ lines contain descriptions of test cases — one per line. Each line contains single even integer $$$n$$$ ($$$2 \le n \le 200$$$). Don't forget you need to embed $$$2n$$$-gon, not an $$$n$$$-gon.
1,400
Print $$$T$$$ real numbers — one per test case. For each test case, print the minimum length of a side of the square $$$2n$$$-gon can be embedded in. Your answer will be considered correct if its absolute or relative error doesn't exceed $$$10^{-6}$$$.
standard output
PASSED
d42a957d42a04837d7f77d1757dcb022
train_001.jsonl
1589707200
The statement of this problem is the same as the statement of problem C2. The only difference is that, in problem C1, $$$n$$$ is always even, and in C2, $$$n$$$ is always odd.You are given a regular polygon with $$$2 \cdot n$$$ vertices (it's convex and has equal sides and equal angles) and all its sides have length $$...
256 megabytes
import java.util.*; import java.io.*; public class cf645 { public static void main(String[] args) throws NumberFormatException, IOException { BufferedReader br=new BufferedReader(new InputStreamReader(System.in)); int t=Integer.parseInt(br.readLine().trim()); while(t-->0) { // String str=br.read...
Java
["3\n2\n4\n200"]
2 seconds
["1.000000000\n2.414213562\n127.321336469"]
null
Java 8
standard input
[ "binary search", "geometry", "ternary search", "math" ]
0c7a476716445c535a61f4e81edc7f75
The first line contains a single integer $$$T$$$ ($$$1 \le T \le 200$$$) — the number of test cases. Next $$$T$$$ lines contain descriptions of test cases — one per line. Each line contains single even integer $$$n$$$ ($$$2 \le n \le 200$$$). Don't forget you need to embed $$$2n$$$-gon, not an $$$n$$$-gon.
1,400
Print $$$T$$$ real numbers — one per test case. For each test case, print the minimum length of a side of the square $$$2n$$$-gon can be embedded in. Your answer will be considered correct if its absolute or relative error doesn't exceed $$$10^{-6}$$$.
standard output
PASSED
2cc0751597fce7517d0723ae3d9f2d15
train_001.jsonl
1589707200
The statement of this problem is the same as the statement of problem C2. The only difference is that, in problem C1, $$$n$$$ is always even, and in C2, $$$n$$$ is always odd.You are given a regular polygon with $$$2 \cdot n$$$ vertices (it's convex and has equal sides and equal angles) and all its sides have length $$...
256 megabytes
import java.io.*; import java.util.*; import java.math.*; public class Simple_Polygon_Embedding { static class FastReader { BufferedReader br; StringTokenizer st; public FastReader() { br = new BufferedReader(new InputStreamReader(Sy...
Java
["3\n2\n4\n200"]
2 seconds
["1.000000000\n2.414213562\n127.321336469"]
null
Java 8
standard input
[ "binary search", "geometry", "ternary search", "math" ]
0c7a476716445c535a61f4e81edc7f75
The first line contains a single integer $$$T$$$ ($$$1 \le T \le 200$$$) — the number of test cases. Next $$$T$$$ lines contain descriptions of test cases — one per line. Each line contains single even integer $$$n$$$ ($$$2 \le n \le 200$$$). Don't forget you need to embed $$$2n$$$-gon, not an $$$n$$$-gon.
1,400
Print $$$T$$$ real numbers — one per test case. For each test case, print the minimum length of a side of the square $$$2n$$$-gon can be embedded in. Your answer will be considered correct if its absolute or relative error doesn't exceed $$$10^{-6}$$$.
standard output
PASSED
d48f6e4fb3f0d79c36e029f20c16e848
train_001.jsonl
1589707200
The statement of this problem is the same as the statement of problem C2. The only difference is that, in problem C1, $$$n$$$ is always even, and in C2, $$$n$$$ is always odd.You are given a regular polygon with $$$2 \cdot n$$$ vertices (it's convex and has equal sides and equal angles) and all its sides have length $$...
256 megabytes
import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; import java.util.StringTokenizer; public class q3 { public static void main(String[] args) { FastReader s = new FastReader(); int t = s.nextInt(); while(t-- > 0) { int n = s.nextInt(); System.out.println(...
Java
["3\n2\n4\n200"]
2 seconds
["1.000000000\n2.414213562\n127.321336469"]
null
Java 8
standard input
[ "binary search", "geometry", "ternary search", "math" ]
0c7a476716445c535a61f4e81edc7f75
The first line contains a single integer $$$T$$$ ($$$1 \le T \le 200$$$) — the number of test cases. Next $$$T$$$ lines contain descriptions of test cases — one per line. Each line contains single even integer $$$n$$$ ($$$2 \le n \le 200$$$). Don't forget you need to embed $$$2n$$$-gon, not an $$$n$$$-gon.
1,400
Print $$$T$$$ real numbers — one per test case. For each test case, print the minimum length of a side of the square $$$2n$$$-gon can be embedded in. Your answer will be considered correct if its absolute or relative error doesn't exceed $$$10^{-6}$$$.
standard output
PASSED
6bc4db3ac5d2233c8cfa2054f73158d4
train_001.jsonl
1589707200
The statement of this problem is the same as the statement of problem C2. The only difference is that, in problem C1, $$$n$$$ is always even, and in C2, $$$n$$$ is always odd.You are given a regular polygon with $$$2 \cdot n$$$ vertices (it's convex and has equal sides and equal angles) and all its sides have length $$...
256 megabytes
import java.util.*; import java.lang.*; import java.io.*; public class a { static final int mod = 1000000007; public static void main (String[] args) throws java.lang.Exception { FastReader sc = new FastReader(); PrintWriter out = new PrintWriter(System.out); int t = sc.next...
Java
["3\n2\n4\n200"]
2 seconds
["1.000000000\n2.414213562\n127.321336469"]
null
Java 8
standard input
[ "binary search", "geometry", "ternary search", "math" ]
0c7a476716445c535a61f4e81edc7f75
The first line contains a single integer $$$T$$$ ($$$1 \le T \le 200$$$) — the number of test cases. Next $$$T$$$ lines contain descriptions of test cases — one per line. Each line contains single even integer $$$n$$$ ($$$2 \le n \le 200$$$). Don't forget you need to embed $$$2n$$$-gon, not an $$$n$$$-gon.
1,400
Print $$$T$$$ real numbers — one per test case. For each test case, print the minimum length of a side of the square $$$2n$$$-gon can be embedded in. Your answer will be considered correct if its absolute or relative error doesn't exceed $$$10^{-6}$$$.
standard output
PASSED
90a96d3cd4594b5617245431b1cb6460
train_001.jsonl
1589707200
The statement of this problem is the same as the statement of problem C2. The only difference is that, in problem C1, $$$n$$$ is always even, and in C2, $$$n$$$ is always odd.You are given a regular polygon with $$$2 \cdot n$$$ vertices (it's convex and has equal sides and equal angles) and all its sides have length $$...
256 megabytes
import java.io.*; import java.math.BigInteger; import java.util.*; // written by luchy0120 public class Main { public static void main(String[] args) throws Exception { new Main().run(); } void solve() { // println(1<<30); //it int t = ni(); for(int i=0;i<t;++i){ ...
Java
["3\n2\n4\n200"]
2 seconds
["1.000000000\n2.414213562\n127.321336469"]
null
Java 8
standard input
[ "binary search", "geometry", "ternary search", "math" ]
0c7a476716445c535a61f4e81edc7f75
The first line contains a single integer $$$T$$$ ($$$1 \le T \le 200$$$) — the number of test cases. Next $$$T$$$ lines contain descriptions of test cases — one per line. Each line contains single even integer $$$n$$$ ($$$2 \le n \le 200$$$). Don't forget you need to embed $$$2n$$$-gon, not an $$$n$$$-gon.
1,400
Print $$$T$$$ real numbers — one per test case. For each test case, print the minimum length of a side of the square $$$2n$$$-gon can be embedded in. Your answer will be considered correct if its absolute or relative error doesn't exceed $$$10^{-6}$$$.
standard output
PASSED
c678777ce0ea74ddaadc8e5e279e9052
train_001.jsonl
1589707200
The statement of this problem is the same as the statement of problem C2. The only difference is that, in problem C1, $$$n$$$ is always even, and in C2, $$$n$$$ is always odd.You are given a regular polygon with $$$2 \cdot n$$$ vertices (it's convex and has equal sides and equal angles) and all its sides have length $$...
256 megabytes
import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; import java.io.PrintWriter; import java.util.StringTokenizer; public class Main { public static void main(String[] args) { new Thread(null, new Runnable() { public void run() { solve(); } ...
Java
["3\n2\n4\n200"]
2 seconds
["1.000000000\n2.414213562\n127.321336469"]
null
Java 8
standard input
[ "binary search", "geometry", "ternary search", "math" ]
0c7a476716445c535a61f4e81edc7f75
The first line contains a single integer $$$T$$$ ($$$1 \le T \le 200$$$) — the number of test cases. Next $$$T$$$ lines contain descriptions of test cases — one per line. Each line contains single even integer $$$n$$$ ($$$2 \le n \le 200$$$). Don't forget you need to embed $$$2n$$$-gon, not an $$$n$$$-gon.
1,400
Print $$$T$$$ real numbers — one per test case. For each test case, print the minimum length of a side of the square $$$2n$$$-gon can be embedded in. Your answer will be considered correct if its absolute or relative error doesn't exceed $$$10^{-6}$$$.
standard output
PASSED
da97d813eca43e9cae3c6d31286025e6
train_001.jsonl
1589707200
The statement of this problem is the same as the statement of problem C2. The only difference is that, in problem C1, $$$n$$$ is always even, and in C2, $$$n$$$ is always odd.You are given a regular polygon with $$$2 \cdot n$$$ vertices (it's convex and has equal sides and equal angles) and all its sides have length $$...
256 megabytes
import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; import java.io.PrintWriter; import java.util.StringTokenizer; public class E87_C1 implements Runnable{ public static void main(String[] args) { new Thread(null, new E87_C1(),"Main",1<<27).start(); } @Override...
Java
["3\n2\n4\n200"]
2 seconds
["1.000000000\n2.414213562\n127.321336469"]
null
Java 8
standard input
[ "binary search", "geometry", "ternary search", "math" ]
0c7a476716445c535a61f4e81edc7f75
The first line contains a single integer $$$T$$$ ($$$1 \le T \le 200$$$) — the number of test cases. Next $$$T$$$ lines contain descriptions of test cases — one per line. Each line contains single even integer $$$n$$$ ($$$2 \le n \le 200$$$). Don't forget you need to embed $$$2n$$$-gon, not an $$$n$$$-gon.
1,400
Print $$$T$$$ real numbers — one per test case. For each test case, print the minimum length of a side of the square $$$2n$$$-gon can be embedded in. Your answer will be considered correct if its absolute or relative error doesn't exceed $$$10^{-6}$$$.
standard output
PASSED
d5193f3ea9013e70f976a7b51bc2fc7c
train_001.jsonl
1589707200
The statement of this problem is the same as the statement of problem C2. The only difference is that, in problem C1, $$$n$$$ is always even, and in C2, $$$n$$$ is always odd.You are given a regular polygon with $$$2 \cdot n$$$ vertices (it's convex and has equal sides and equal angles) and all its sides have length $$...
256 megabytes
import java.util.*; public class codfo { public static void main(String[] args) { Scanner s = new Scanner(System.in); int t = s.nextInt(); while(t-->0){ int n = s.nextInt(); double ans = 1 / (Math.tan(Math.PI/(2*n))); System.out.println(ans); }...
Java
["3\n2\n4\n200"]
2 seconds
["1.000000000\n2.414213562\n127.321336469"]
null
Java 8
standard input
[ "binary search", "geometry", "ternary search", "math" ]
0c7a476716445c535a61f4e81edc7f75
The first line contains a single integer $$$T$$$ ($$$1 \le T \le 200$$$) — the number of test cases. Next $$$T$$$ lines contain descriptions of test cases — one per line. Each line contains single even integer $$$n$$$ ($$$2 \le n \le 200$$$). Don't forget you need to embed $$$2n$$$-gon, not an $$$n$$$-gon.
1,400
Print $$$T$$$ real numbers — one per test case. For each test case, print the minimum length of a side of the square $$$2n$$$-gon can be embedded in. Your answer will be considered correct if its absolute or relative error doesn't exceed $$$10^{-6}$$$.
standard output
PASSED
f81c8e40861fdb4326c7cab717f8d28c
train_001.jsonl
1589707200
The statement of this problem is the same as the statement of problem C2. The only difference is that, in problem C1, $$$n$$$ is always even, and in C2, $$$n$$$ is always odd.You are given a regular polygon with $$$2 \cdot n$$$ vertices (it's convex and has equal sides and equal angles) and all its sides have length $$...
256 megabytes
import java.io.*; import java.util.*; import java.math.*; import java.lang.*; import static java.lang.Math.*; public class Main implements Runnable { static class InputReader { private InputStream stream; private byte[] buf = new byte[1024]; private int curChar; private int numChars; private SpaceCharFil...
Java
["3\n2\n4\n200"]
2 seconds
["1.000000000\n2.414213562\n127.321336469"]
null
Java 8
standard input
[ "binary search", "geometry", "ternary search", "math" ]
0c7a476716445c535a61f4e81edc7f75
The first line contains a single integer $$$T$$$ ($$$1 \le T \le 200$$$) — the number of test cases. Next $$$T$$$ lines contain descriptions of test cases — one per line. Each line contains single even integer $$$n$$$ ($$$2 \le n \le 200$$$). Don't forget you need to embed $$$2n$$$-gon, not an $$$n$$$-gon.
1,400
Print $$$T$$$ real numbers — one per test case. For each test case, print the minimum length of a side of the square $$$2n$$$-gon can be embedded in. Your answer will be considered correct if its absolute or relative error doesn't exceed $$$10^{-6}$$$.
standard output
PASSED
3f66cab6443b08c6a80bea45dc042beb
train_001.jsonl
1589707200
The statement of this problem is the same as the statement of problem C2. The only difference is that, in problem C1, $$$n$$$ is always even, and in C2, $$$n$$$ is always odd.You are given a regular polygon with $$$2 \cdot n$$$ vertices (it's convex and has equal sides and equal angles) and all its sides have length $$...
256 megabytes
import java.util.*; import java.io.*; public class Solution{ static int llllll=0; static long mod=998244353 ; static boolean f=true; static class pair implements Comparable<pair>{ int a,b,c; pair(int x,int y,int z){ a=x;b=y;c=z; } public int compareTo(pair t){ ...
Java
["3\n2\n4\n200"]
2 seconds
["1.000000000\n2.414213562\n127.321336469"]
null
Java 8
standard input
[ "binary search", "geometry", "ternary search", "math" ]
0c7a476716445c535a61f4e81edc7f75
The first line contains a single integer $$$T$$$ ($$$1 \le T \le 200$$$) — the number of test cases. Next $$$T$$$ lines contain descriptions of test cases — one per line. Each line contains single even integer $$$n$$$ ($$$2 \le n \le 200$$$). Don't forget you need to embed $$$2n$$$-gon, not an $$$n$$$-gon.
1,400
Print $$$T$$$ real numbers — one per test case. For each test case, print the minimum length of a side of the square $$$2n$$$-gon can be embedded in. Your answer will be considered correct if its absolute or relative error doesn't exceed $$$10^{-6}$$$.
standard output
PASSED
9ae48d848be66e304e4e2a36bb4a6db8
train_001.jsonl
1589707200
The statement of this problem is the same as the statement of problem C2. The only difference is that, in problem C1, $$$n$$$ is always even, and in C2, $$$n$$$ is always odd.You are given a regular polygon with $$$2 \cdot n$$$ vertices (it's convex and has equal sides and equal angles) and all its sides have length $$...
256 megabytes
import java.util.Scanner; public class SimplePolygonEmbedding { /** * @param args */ public static void main(String[] args) { // TODO Auto-generated method stub Scanner sc = new Scanner(System.in); int T = sc.nextInt(); while(T-->0){ double n = sc.nextDouble()*2; System.out.println(Math.tan(Math...
Java
["3\n2\n4\n200"]
2 seconds
["1.000000000\n2.414213562\n127.321336469"]
null
Java 8
standard input
[ "binary search", "geometry", "ternary search", "math" ]
0c7a476716445c535a61f4e81edc7f75
The first line contains a single integer $$$T$$$ ($$$1 \le T \le 200$$$) — the number of test cases. Next $$$T$$$ lines contain descriptions of test cases — one per line. Each line contains single even integer $$$n$$$ ($$$2 \le n \le 200$$$). Don't forget you need to embed $$$2n$$$-gon, not an $$$n$$$-gon.
1,400
Print $$$T$$$ real numbers — one per test case. For each test case, print the minimum length of a side of the square $$$2n$$$-gon can be embedded in. Your answer will be considered correct if its absolute or relative error doesn't exceed $$$10^{-6}$$$.
standard output
PASSED
6a59a281cb240258d536d46e54b56b30
train_001.jsonl
1589707200
The statement of this problem is the same as the statement of problem C2. The only difference is that, in problem C1, $$$n$$$ is always even, and in C2, $$$n$$$ is always odd.You are given a regular polygon with $$$2 \cdot n$$$ vertices (it's convex and has equal sides and equal angles) and all its sides have length $$...
256 megabytes
//package Education87; import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; import java.util.StringTokenizer; import java.util.*; public class typeC { public static void main(String[] args) { FastReader s = new FastReader(); int T = s.nextInt(); for(int t=0;t<T;t++) { ...
Java
["3\n2\n4\n200"]
2 seconds
["1.000000000\n2.414213562\n127.321336469"]
null
Java 8
standard input
[ "binary search", "geometry", "ternary search", "math" ]
0c7a476716445c535a61f4e81edc7f75
The first line contains a single integer $$$T$$$ ($$$1 \le T \le 200$$$) — the number of test cases. Next $$$T$$$ lines contain descriptions of test cases — one per line. Each line contains single even integer $$$n$$$ ($$$2 \le n \le 200$$$). Don't forget you need to embed $$$2n$$$-gon, not an $$$n$$$-gon.
1,400
Print $$$T$$$ real numbers — one per test case. For each test case, print the minimum length of a side of the square $$$2n$$$-gon can be embedded in. Your answer will be considered correct if its absolute or relative error doesn't exceed $$$10^{-6}$$$.
standard output
PASSED
ef7c123cfd1315ef553c80dc15301230
train_001.jsonl
1589707200
The statement of this problem is the same as the statement of problem C2. The only difference is that, in problem C1, $$$n$$$ is always even, and in C2, $$$n$$$ is always odd.You are given a regular polygon with $$$2 \cdot n$$$ vertices (it's convex and has equal sides and equal angles) and all its sides have length $$...
256 megabytes
// package Education87; import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; import java.util.StringTokenizer; import java.util.*; public class typeC { public static void main(String[] args) { FastReader s = new FastReader(); int T = s.nextInt(); for(int t=0;t<T;t++) { ...
Java
["3\n2\n4\n200"]
2 seconds
["1.000000000\n2.414213562\n127.321336469"]
null
Java 8
standard input
[ "binary search", "geometry", "ternary search", "math" ]
0c7a476716445c535a61f4e81edc7f75
The first line contains a single integer $$$T$$$ ($$$1 \le T \le 200$$$) — the number of test cases. Next $$$T$$$ lines contain descriptions of test cases — one per line. Each line contains single even integer $$$n$$$ ($$$2 \le n \le 200$$$). Don't forget you need to embed $$$2n$$$-gon, not an $$$n$$$-gon.
1,400
Print $$$T$$$ real numbers — one per test case. For each test case, print the minimum length of a side of the square $$$2n$$$-gon can be embedded in. Your answer will be considered correct if its absolute or relative error doesn't exceed $$$10^{-6}$$$.
standard output
PASSED
1ed2835b2af73793acc1704b40d38e89
train_001.jsonl
1589707200
The statement of this problem is the same as the statement of problem C2. The only difference is that, in problem C1, $$$n$$$ is always even, and in C2, $$$n$$$ is always odd.You are given a regular polygon with $$$2 \cdot n$$$ vertices (it's convex and has equal sides and equal angles) and all its sides have length $$...
256 megabytes
import java.io.*; import java.math.*; import java.util.*; public class SimplePolygonEmbedding { static PrintWriter pw; static class FastReader { private InputStream mIs; private byte[] buf = new byte[1024]; private int curChar, numChars; public FastReader() { this(System.in); } public FastReader(In...
Java
["3\n2\n4\n200"]
2 seconds
["1.000000000\n2.414213562\n127.321336469"]
null
Java 8
standard input
[ "binary search", "geometry", "ternary search", "math" ]
0c7a476716445c535a61f4e81edc7f75
The first line contains a single integer $$$T$$$ ($$$1 \le T \le 200$$$) — the number of test cases. Next $$$T$$$ lines contain descriptions of test cases — one per line. Each line contains single even integer $$$n$$$ ($$$2 \le n \le 200$$$). Don't forget you need to embed $$$2n$$$-gon, not an $$$n$$$-gon.
1,400
Print $$$T$$$ real numbers — one per test case. For each test case, print the minimum length of a side of the square $$$2n$$$-gon can be embedded in. Your answer will be considered correct if its absolute or relative error doesn't exceed $$$10^{-6}$$$.
standard output
PASSED
5af19e95e51be37f363c243b7ab4c3b5
train_001.jsonl
1589707200
The statement of this problem is the same as the statement of problem C2. The only difference is that, in problem C1, $$$n$$$ is always even, and in C2, $$$n$$$ is always odd.You are given a regular polygon with $$$2 \cdot n$$$ vertices (it's convex and has equal sides and equal angles) and all its sides have length $$...
256 megabytes
import java.util.*; public class q3 { public static void main(String[] args) { Scanner scan = new Scanner(System.in); int test = scan.nextInt(); while(test-->0){ int n = scan.nextInt(); if(n==2){ System.out.println("1.000000000"); conti...
Java
["3\n2\n4\n200"]
2 seconds
["1.000000000\n2.414213562\n127.321336469"]
null
Java 8
standard input
[ "binary search", "geometry", "ternary search", "math" ]
0c7a476716445c535a61f4e81edc7f75
The first line contains a single integer $$$T$$$ ($$$1 \le T \le 200$$$) — the number of test cases. Next $$$T$$$ lines contain descriptions of test cases — one per line. Each line contains single even integer $$$n$$$ ($$$2 \le n \le 200$$$). Don't forget you need to embed $$$2n$$$-gon, not an $$$n$$$-gon.
1,400
Print $$$T$$$ real numbers — one per test case. For each test case, print the minimum length of a side of the square $$$2n$$$-gon can be embedded in. Your answer will be considered correct if its absolute or relative error doesn't exceed $$$10^{-6}$$$.
standard output
PASSED
ae191686f4bf66287a1ec2db71f11505
train_001.jsonl
1589707200
The statement of this problem is the same as the statement of problem C2. The only difference is that, in problem C1, $$$n$$$ is always even, and in C2, $$$n$$$ is always odd.You are given a regular polygon with $$$2 \cdot n$$$ vertices (it's convex and has equal sides and equal angles) and all its sides have length $$...
256 megabytes
import java.util.*; public class q3 { public static void main(String[] args) { Scanner scan = new Scanner(System.in); int test = scan.nextInt(); while(test-->0){ int n = scan.nextInt(); if(n==2){ System.out.println("1.000000000"); conti...
Java
["3\n2\n4\n200"]
2 seconds
["1.000000000\n2.414213562\n127.321336469"]
null
Java 8
standard input
[ "binary search", "geometry", "ternary search", "math" ]
0c7a476716445c535a61f4e81edc7f75
The first line contains a single integer $$$T$$$ ($$$1 \le T \le 200$$$) — the number of test cases. Next $$$T$$$ lines contain descriptions of test cases — one per line. Each line contains single even integer $$$n$$$ ($$$2 \le n \le 200$$$). Don't forget you need to embed $$$2n$$$-gon, not an $$$n$$$-gon.
1,400
Print $$$T$$$ real numbers — one per test case. For each test case, print the minimum length of a side of the square $$$2n$$$-gon can be embedded in. Your answer will be considered correct if its absolute or relative error doesn't exceed $$$10^{-6}$$$.
standard output
PASSED
cfdc53d6f320b55c654cf37d5e18aaef
train_001.jsonl
1589707200
The statement of this problem is the same as the statement of problem C2. The only difference is that, in problem C1, $$$n$$$ is always even, and in C2, $$$n$$$ is always odd.You are given a regular polygon with $$$2 \cdot n$$$ vertices (it's convex and has equal sides and equal angles) and all its sides have length $$...
256 megabytes
import java.io.*; import java.math.*; import java.util.*; public class SimplePolygonEmbedding { //Just brute force problems with small constraints public static void main(String[] args) { Scanner input = new Scanner(System.in); int T = input.nextInt(); for (int i = 1; i <= T; i++) { double N = input.nextDoub...
Java
["3\n2\n4\n200"]
2 seconds
["1.000000000\n2.414213562\n127.321336469"]
null
Java 8
standard input
[ "binary search", "geometry", "ternary search", "math" ]
0c7a476716445c535a61f4e81edc7f75
The first line contains a single integer $$$T$$$ ($$$1 \le T \le 200$$$) — the number of test cases. Next $$$T$$$ lines contain descriptions of test cases — one per line. Each line contains single even integer $$$n$$$ ($$$2 \le n \le 200$$$). Don't forget you need to embed $$$2n$$$-gon, not an $$$n$$$-gon.
1,400
Print $$$T$$$ real numbers — one per test case. For each test case, print the minimum length of a side of the square $$$2n$$$-gon can be embedded in. Your answer will be considered correct if its absolute or relative error doesn't exceed $$$10^{-6}$$$.
standard output
PASSED
7c66e8fc67fa8721e53af0a6c8b4964a
train_001.jsonl
1589707200
The statement of this problem is the same as the statement of problem C2. The only difference is that, in problem C1, $$$n$$$ is always even, and in C2, $$$n$$$ is always odd.You are given a regular polygon with $$$2 \cdot n$$$ vertices (it's convex and has equal sides and equal angles) and all its sides have length $$...
256 megabytes
import java.io.*; import java.math.*; import java.util.*; public class SimplePolygonEmbedding { public static void main(String[] args) { Scanner input = new Scanner(System.in); int T = input.nextInt(); for (int i = 1; i <= T; i++) { double N = input.nextDouble(); N*=2; double theta = 360.0/N; theta...
Java
["3\n2\n4\n200"]
2 seconds
["1.000000000\n2.414213562\n127.321336469"]
null
Java 8
standard input
[ "binary search", "geometry", "ternary search", "math" ]
0c7a476716445c535a61f4e81edc7f75
The first line contains a single integer $$$T$$$ ($$$1 \le T \le 200$$$) — the number of test cases. Next $$$T$$$ lines contain descriptions of test cases — one per line. Each line contains single even integer $$$n$$$ ($$$2 \le n \le 200$$$). Don't forget you need to embed $$$2n$$$-gon, not an $$$n$$$-gon.
1,400
Print $$$T$$$ real numbers — one per test case. For each test case, print the minimum length of a side of the square $$$2n$$$-gon can be embedded in. Your answer will be considered correct if its absolute or relative error doesn't exceed $$$10^{-6}$$$.
standard output
PASSED
e5b026b96096825b50b9122242e790ed
train_001.jsonl
1589707200
The statement of this problem is the same as the statement of problem C2. The only difference is that, in problem C1, $$$n$$$ is always even, and in C2, $$$n$$$ is always odd.You are given a regular polygon with $$$2 \cdot n$$$ vertices (it's convex and has equal sides and equal angles) and all its sides have length $$...
256 megabytes
import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; public class Simple_Polygon_Embedding { public static void main(String[] args) throws IOException { BufferedReader bf=new BufferedReader(new InputStreamReader(System.in)); String test_numS=bf.readLine(); ...
Java
["3\n2\n4\n200"]
2 seconds
["1.000000000\n2.414213562\n127.321336469"]
null
Java 8
standard input
[ "binary search", "geometry", "ternary search", "math" ]
0c7a476716445c535a61f4e81edc7f75
The first line contains a single integer $$$T$$$ ($$$1 \le T \le 200$$$) — the number of test cases. Next $$$T$$$ lines contain descriptions of test cases — one per line. Each line contains single even integer $$$n$$$ ($$$2 \le n \le 200$$$). Don't forget you need to embed $$$2n$$$-gon, not an $$$n$$$-gon.
1,400
Print $$$T$$$ real numbers — one per test case. For each test case, print the minimum length of a side of the square $$$2n$$$-gon can be embedded in. Your answer will be considered correct if its absolute or relative error doesn't exceed $$$10^{-6}$$$.
standard output
PASSED
186a1812da796ee86f71c769d92b9293
train_001.jsonl
1589707200
The statement of this problem is the same as the statement of problem C2. The only difference is that, in problem C1, $$$n$$$ is always even, and in C2, $$$n$$$ is always odd.You are given a regular polygon with $$$2 \cdot n$$$ vertices (it's convex and has equal sides and equal angles) and all its sides have length $$...
256 megabytes
import java.io.BufferedReader; import java.io.IOException; import java.io.InputStream; import java.io.InputStreamReader; import java.util.InputMismatchException; import java.util.*; import java.io.*; public class Main{ public static class InputReader { private InputStream stream; private byte[] buf = new byte[1...
Java
["3\n2\n4\n200"]
2 seconds
["1.000000000\n2.414213562\n127.321336469"]
null
Java 8
standard input
[ "binary search", "geometry", "ternary search", "math" ]
0c7a476716445c535a61f4e81edc7f75
The first line contains a single integer $$$T$$$ ($$$1 \le T \le 200$$$) — the number of test cases. Next $$$T$$$ lines contain descriptions of test cases — one per line. Each line contains single even integer $$$n$$$ ($$$2 \le n \le 200$$$). Don't forget you need to embed $$$2n$$$-gon, not an $$$n$$$-gon.
1,400
Print $$$T$$$ real numbers — one per test case. For each test case, print the minimum length of a side of the square $$$2n$$$-gon can be embedded in. Your answer will be considered correct if its absolute or relative error doesn't exceed $$$10^{-6}$$$.
standard output
PASSED
962de6a6d64e3c6bffecf7805214d4f3
train_001.jsonl
1589707200
The statement of this problem is the same as the statement of problem C2. The only difference is that, in problem C1, $$$n$$$ is always even, and in C2, $$$n$$$ is always odd.You are given a regular polygon with $$$2 \cdot n$$$ vertices (it's convex and has equal sides and equal angles) and all its sides have length $$...
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 Codechef { public static void main (String[] args) throws java.lang.Exception { BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); int itr ...
Java
["3\n2\n4\n200"]
2 seconds
["1.000000000\n2.414213562\n127.321336469"]
null
Java 8
standard input
[ "binary search", "geometry", "ternary search", "math" ]
0c7a476716445c535a61f4e81edc7f75
The first line contains a single integer $$$T$$$ ($$$1 \le T \le 200$$$) — the number of test cases. Next $$$T$$$ lines contain descriptions of test cases — one per line. Each line contains single even integer $$$n$$$ ($$$2 \le n \le 200$$$). Don't forget you need to embed $$$2n$$$-gon, not an $$$n$$$-gon.
1,400
Print $$$T$$$ real numbers — one per test case. For each test case, print the minimum length of a side of the square $$$2n$$$-gon can be embedded in. Your answer will be considered correct if its absolute or relative error doesn't exceed $$$10^{-6}$$$.
standard output
PASSED
3b59d55d6ddd19d5720ef5cd29990665
train_001.jsonl
1589707200
The statement of this problem is the same as the statement of problem C2. The only difference is that, in problem C1, $$$n$$$ is always even, and in C2, $$$n$$$ is always odd.You are given a regular polygon with $$$2 \cdot n$$$ vertices (it's convex and has equal sides and equal angles) and all its sides have length $$...
256 megabytes
import java.io.*; import java.util.*; public class C { static long m = (long) (1e9 + 7); public static void main(String[] args) throws IOException { Scanner scn = new Scanner(System.in); StringBuilder sb = new StringBuilder(); int T = scn.nextInt(), tcs = 0; C: while (tcs++ < T) sb.append(1 / Math.tan(2...
Java
["3\n2\n4\n200"]
2 seconds
["1.000000000\n2.414213562\n127.321336469"]
null
Java 8
standard input
[ "binary search", "geometry", "ternary search", "math" ]
0c7a476716445c535a61f4e81edc7f75
The first line contains a single integer $$$T$$$ ($$$1 \le T \le 200$$$) — the number of test cases. Next $$$T$$$ lines contain descriptions of test cases — one per line. Each line contains single even integer $$$n$$$ ($$$2 \le n \le 200$$$). Don't forget you need to embed $$$2n$$$-gon, not an $$$n$$$-gon.
1,400
Print $$$T$$$ real numbers — one per test case. For each test case, print the minimum length of a side of the square $$$2n$$$-gon can be embedded in. Your answer will be considered correct if its absolute or relative error doesn't exceed $$$10^{-6}$$$.
standard output
PASSED
e671a5372b9da9db20b7ca3c8cdab948
train_001.jsonl
1589707200
The statement of this problem is the same as the statement of problem C2. The only difference is that, in problem C1, $$$n$$$ is always even, and in C2, $$$n$$$ is always odd.You are given a regular polygon with $$$2 \cdot n$$$ vertices (it's convex and has equal sides and equal angles) and all its sides have length $$...
256 megabytes
import java.io.*; import java.util.*; public class C { static long m = (long) (1e9 + 7); public static void main(String[] args) throws IOException { Scanner scn = new Scanner(System.in); StringBuilder sb = new StringBuilder(); int T = scn.nextInt(), tcs = 0; C: while (tcs++ < T) { int n = scn.nextInt();...
Java
["3\n2\n4\n200"]
2 seconds
["1.000000000\n2.414213562\n127.321336469"]
null
Java 8
standard input
[ "binary search", "geometry", "ternary search", "math" ]
0c7a476716445c535a61f4e81edc7f75
The first line contains a single integer $$$T$$$ ($$$1 \le T \le 200$$$) — the number of test cases. Next $$$T$$$ lines contain descriptions of test cases — one per line. Each line contains single even integer $$$n$$$ ($$$2 \le n \le 200$$$). Don't forget you need to embed $$$2n$$$-gon, not an $$$n$$$-gon.
1,400
Print $$$T$$$ real numbers — one per test case. For each test case, print the minimum length of a side of the square $$$2n$$$-gon can be embedded in. Your answer will be considered correct if its absolute or relative error doesn't exceed $$$10^{-6}$$$.
standard output
PASSED
489159d822f17a3f730ea2ab968112e4
train_001.jsonl
1589707200
The statement of this problem is the same as the statement of problem C2. The only difference is that, in problem C1, $$$n$$$ is always even, and in C2, $$$n$$$ is always odd.You are given a regular polygon with $$$2 \cdot n$$$ vertices (it's convex and has equal sides and equal angles) and all its sides have length $$...
256 megabytes
import java.io.*; import java.math.BigDecimal; import java.math.BigInteger; import java.math.RoundingMode; import java.util.*; import java.util.concurrent.LinkedBlockingDeque; public class scratch_25 { // int count=0; //static long count=0; static class Reader { static BufferedReader reader; ...
Java
["3\n2\n4\n200"]
2 seconds
["1.000000000\n2.414213562\n127.321336469"]
null
Java 8
standard input
[ "binary search", "geometry", "ternary search", "math" ]
0c7a476716445c535a61f4e81edc7f75
The first line contains a single integer $$$T$$$ ($$$1 \le T \le 200$$$) — the number of test cases. Next $$$T$$$ lines contain descriptions of test cases — one per line. Each line contains single even integer $$$n$$$ ($$$2 \le n \le 200$$$). Don't forget you need to embed $$$2n$$$-gon, not an $$$n$$$-gon.
1,400
Print $$$T$$$ real numbers — one per test case. For each test case, print the minimum length of a side of the square $$$2n$$$-gon can be embedded in. Your answer will be considered correct if its absolute or relative error doesn't exceed $$$10^{-6}$$$.
standard output
PASSED
3780af90c3c9d440e75c959e398e7681
train_001.jsonl
1589707200
The statement of this problem is the same as the statement of problem C2. The only difference is that, in problem C1, $$$n$$$ is always even, and in C2, $$$n$$$ is always odd.You are given a regular polygon with $$$2 \cdot n$$$ vertices (it's convex and has equal sides and equal angles) and all its sides have length $$...
256 megabytes
import java.io.*; import java.math.*; import java.util.*; import java.lang.*; import java.text.DecimalFormat; import java.text.DecimalFormatSymbols; // Warning: Printing unwanted or ill-formatted data to output will cause the test cases to fail public class TestClass { public static void main(String args[]...
Java
["3\n2\n4\n200"]
2 seconds
["1.000000000\n2.414213562\n127.321336469"]
null
Java 8
standard input
[ "binary search", "geometry", "ternary search", "math" ]
0c7a476716445c535a61f4e81edc7f75
The first line contains a single integer $$$T$$$ ($$$1 \le T \le 200$$$) — the number of test cases. Next $$$T$$$ lines contain descriptions of test cases — one per line. Each line contains single even integer $$$n$$$ ($$$2 \le n \le 200$$$). Don't forget you need to embed $$$2n$$$-gon, not an $$$n$$$-gon.
1,400
Print $$$T$$$ real numbers — one per test case. For each test case, print the minimum length of a side of the square $$$2n$$$-gon can be embedded in. Your answer will be considered correct if its absolute or relative error doesn't exceed $$$10^{-6}$$$.
standard output
PASSED
9114dbc9722ea983ac2229be2b2a02e4
train_001.jsonl
1589707200
The statement of this problem is the same as the statement of problem C2. The only difference is that, in problem C1, $$$n$$$ is always even, and in C2, $$$n$$$ is always odd.You are given a regular polygon with $$$2 \cdot n$$$ vertices (it's convex and has equal sides and equal angles) and all its sides have length $$...
256 megabytes
import java.io.*; import java.util.*; public class C implements Runnable { boolean judge = false; FastReader scn; PrintWriter out; String INPUT = ""; void solve() { int t = scn.nextInt(); while (t-- > 0) { int n = 2 * scn.nextInt(); if (n % 4 == 0) { out.println(1 / Math.tan(Math.PI / n)); } }...
Java
["3\n2\n4\n200"]
2 seconds
["1.000000000\n2.414213562\n127.321336469"]
null
Java 8
standard input
[ "binary search", "geometry", "ternary search", "math" ]
0c7a476716445c535a61f4e81edc7f75
The first line contains a single integer $$$T$$$ ($$$1 \le T \le 200$$$) — the number of test cases. Next $$$T$$$ lines contain descriptions of test cases — one per line. Each line contains single even integer $$$n$$$ ($$$2 \le n \le 200$$$). Don't forget you need to embed $$$2n$$$-gon, not an $$$n$$$-gon.
1,400
Print $$$T$$$ real numbers — one per test case. For each test case, print the minimum length of a side of the square $$$2n$$$-gon can be embedded in. Your answer will be considered correct if its absolute or relative error doesn't exceed $$$10^{-6}$$$.
standard output
PASSED
cceb46ef2dd78de20202ecc6d14a2f9d
train_001.jsonl
1589707200
The statement of this problem is the same as the statement of problem C2. The only difference is that, in problem C1, $$$n$$$ is always even, and in C2, $$$n$$$ is always odd.You are given a regular polygon with $$$2 \cdot n$$$ vertices (it's convex and has equal sides and equal angles) and all its sides have length $$...
256 megabytes
import java.util.*; import java.io.*; import java.lang.*; public class C1 { private static double polyapothem(double n, double a) { // Side and side length cannot be negative if (a < 0 && n < 0) return -1; // Degree converted to radians return (a / (2 * java.lang.Math...
Java
["3\n2\n4\n200"]
2 seconds
["1.000000000\n2.414213562\n127.321336469"]
null
Java 8
standard input
[ "binary search", "geometry", "ternary search", "math" ]
0c7a476716445c535a61f4e81edc7f75
The first line contains a single integer $$$T$$$ ($$$1 \le T \le 200$$$) — the number of test cases. Next $$$T$$$ lines contain descriptions of test cases — one per line. Each line contains single even integer $$$n$$$ ($$$2 \le n \le 200$$$). Don't forget you need to embed $$$2n$$$-gon, not an $$$n$$$-gon.
1,400
Print $$$T$$$ real numbers — one per test case. For each test case, print the minimum length of a side of the square $$$2n$$$-gon can be embedded in. Your answer will be considered correct if its absolute or relative error doesn't exceed $$$10^{-6}$$$.
standard output
PASSED
d39bbdedd779cf8f29f2599579fc1db5
train_001.jsonl
1589707200
The statement of this problem is the same as the statement of problem C2. The only difference is that, in problem C1, $$$n$$$ is always even, and in C2, $$$n$$$ is always odd.You are given a regular polygon with $$$2 \cdot n$$$ vertices (it's convex and has equal sides and equal angles) and all its sides have length $$...
256 megabytes
import java.io.BufferedReader; import java.io.IOException; import java.io.InputStream; import java.io.InputStreamReader; import java.util.InputMismatchException; import java.util.*; import java.io.*; import java.lang.*; public class Main{ public static class InputReader { private InputStream stream; ...
Java
["3\n2\n4\n200"]
2 seconds
["1.000000000\n2.414213562\n127.321336469"]
null
Java 8
standard input
[ "binary search", "geometry", "ternary search", "math" ]
0c7a476716445c535a61f4e81edc7f75
The first line contains a single integer $$$T$$$ ($$$1 \le T \le 200$$$) — the number of test cases. Next $$$T$$$ lines contain descriptions of test cases — one per line. Each line contains single even integer $$$n$$$ ($$$2 \le n \le 200$$$). Don't forget you need to embed $$$2n$$$-gon, not an $$$n$$$-gon.
1,400
Print $$$T$$$ real numbers — one per test case. For each test case, print the minimum length of a side of the square $$$2n$$$-gon can be embedded in. Your answer will be considered correct if its absolute or relative error doesn't exceed $$$10^{-6}$$$.
standard output
PASSED
40a3707a928db6635b0f500532913141
train_001.jsonl
1589707200
The statement of this problem is the same as the statement of problem C2. The only difference is that, in problem C1, $$$n$$$ is always even, and in C2, $$$n$$$ is always odd.You are given a regular polygon with $$$2 \cdot n$$$ vertices (it's convex and has equal sides and equal angles) and all its sides have length $$...
256 megabytes
import java.io.*; import java.util.*; import java.lang.*; import java.math.*; public class D { public void run() throws Exception { FastScanner sc = new FastScanner(); int test = sc.nextInt(); outer: for (int q = 0; q<test; q++) { double n = sc.nextDouble(); if (n == 2) System.out.println(1); els...
Java
["3\n2\n4\n200"]
2 seconds
["1.000000000\n2.414213562\n127.321336469"]
null
Java 8
standard input
[ "binary search", "geometry", "ternary search", "math" ]
0c7a476716445c535a61f4e81edc7f75
The first line contains a single integer $$$T$$$ ($$$1 \le T \le 200$$$) — the number of test cases. Next $$$T$$$ lines contain descriptions of test cases — one per line. Each line contains single even integer $$$n$$$ ($$$2 \le n \le 200$$$). Don't forget you need to embed $$$2n$$$-gon, not an $$$n$$$-gon.
1,400
Print $$$T$$$ real numbers — one per test case. For each test case, print the minimum length of a side of the square $$$2n$$$-gon can be embedded in. Your answer will be considered correct if its absolute or relative error doesn't exceed $$$10^{-6}$$$.
standard output
PASSED
3a69207ba83bfbb7e793cc95d07d8692
train_001.jsonl
1589707200
The statement of this problem is the same as the statement of problem C2. The only difference is that, in problem C1, $$$n$$$ is always even, and in C2, $$$n$$$ is always odd.You are given a regular polygon with $$$2 \cdot n$$$ vertices (it's convex and has equal sides and equal angles) and all its sides have length $$...
256 megabytes
// Working program using Reader Class import java.io.DataInputStream; import java.io.FileInputStream; import java.io.IOException; import java.io.InputStreamReader; import java.util.Scanner; import java.util.*; public class Code { static class Reader { final private int BUFFER_SIZE = 1 << 16; private D...
Java
["3\n2\n4\n200"]
2 seconds
["1.000000000\n2.414213562\n127.321336469"]
null
Java 8
standard input
[ "binary search", "geometry", "ternary search", "math" ]
0c7a476716445c535a61f4e81edc7f75
The first line contains a single integer $$$T$$$ ($$$1 \le T \le 200$$$) — the number of test cases. Next $$$T$$$ lines contain descriptions of test cases — one per line. Each line contains single even integer $$$n$$$ ($$$2 \le n \le 200$$$). Don't forget you need to embed $$$2n$$$-gon, not an $$$n$$$-gon.
1,400
Print $$$T$$$ real numbers — one per test case. For each test case, print the minimum length of a side of the square $$$2n$$$-gon can be embedded in. Your answer will be considered correct if its absolute or relative error doesn't exceed $$$10^{-6}$$$.
standard output
PASSED
bf7b35bc2fc007c60af235ee3e9b7906
train_001.jsonl
1589707200
The statement of this problem is the same as the statement of problem C2. The only difference is that, in problem C1, $$$n$$$ is always even, and in C2, $$$n$$$ is always odd.You are given a regular polygon with $$$2 \cdot n$$$ vertices (it's convex and has equal sides and equal angles) and all its sides have length $$...
256 megabytes
import java.math.*; import java.util.*; public class asol { public static double tan(double sides) { double k = 180.0/sides; double a = Math.toRadians(k); return Math.tan(a); } public static void main(String[] args) { Scanner scan = new Scanner(System.in); int tc = scan.nextInt(); while(tc--!=0) { ...
Java
["3\n2\n4\n200"]
2 seconds
["1.000000000\n2.414213562\n127.321336469"]
null
Java 8
standard input
[ "binary search", "geometry", "ternary search", "math" ]
0c7a476716445c535a61f4e81edc7f75
The first line contains a single integer $$$T$$$ ($$$1 \le T \le 200$$$) — the number of test cases. Next $$$T$$$ lines contain descriptions of test cases — one per line. Each line contains single even integer $$$n$$$ ($$$2 \le n \le 200$$$). Don't forget you need to embed $$$2n$$$-gon, not an $$$n$$$-gon.
1,400
Print $$$T$$$ real numbers — one per test case. For each test case, print the minimum length of a side of the square $$$2n$$$-gon can be embedded in. Your answer will be considered correct if its absolute or relative error doesn't exceed $$$10^{-6}$$$.
standard output
PASSED
a938f6d42dddbafddfd3f0769c69b708
train_001.jsonl
1589707200
The statement of this problem is the same as the statement of problem C2. The only difference is that, in problem C1, $$$n$$$ is always even, and in C2, $$$n$$$ is always odd.You are given a regular polygon with $$$2 \cdot n$$$ vertices (it's convex and has equal sides and equal angles) and all its sides have length $$...
256 megabytes
import java.io.*; import java.util.*; public class E87C1 { static PrintWriter out=new PrintWriter((System.out)); public static void main(String args[])throws IOException { Reader sc=new Reader(); int t=sc.nextInt(); while(t-->0) { int n=sc.nextInt(); s...
Java
["3\n2\n4\n200"]
2 seconds
["1.000000000\n2.414213562\n127.321336469"]
null
Java 8
standard input
[ "binary search", "geometry", "ternary search", "math" ]
0c7a476716445c535a61f4e81edc7f75
The first line contains a single integer $$$T$$$ ($$$1 \le T \le 200$$$) — the number of test cases. Next $$$T$$$ lines contain descriptions of test cases — one per line. Each line contains single even integer $$$n$$$ ($$$2 \le n \le 200$$$). Don't forget you need to embed $$$2n$$$-gon, not an $$$n$$$-gon.
1,400
Print $$$T$$$ real numbers — one per test case. For each test case, print the minimum length of a side of the square $$$2n$$$-gon can be embedded in. Your answer will be considered correct if its absolute or relative error doesn't exceed $$$10^{-6}$$$.
standard output
PASSED
f0c313c1aede5e254e8199683f83a3fe
train_001.jsonl
1589707200
The statement of this problem is the same as the statement of problem C2. The only difference is that, in problem C1, $$$n$$$ is always even, and in C2, $$$n$$$ is always odd.You are given a regular polygon with $$$2 \cdot n$$$ vertices (it's convex and has equal sides and equal angles) and all its sides have length $$...
256 megabytes
import java.util.*; import java.lang.*; import java.io.*; public class Main { public static void main (String[] args) throws java.lang.Exception { MyScanner in = new MyScanner(); out = new PrintWriter(new BufferedOutputStream(System.out)); int T=in.nextInt(); for(int test=0;test<T;test++){ ...
Java
["3\n2\n4\n200"]
2 seconds
["1.000000000\n2.414213562\n127.321336469"]
null
Java 8
standard input
[ "binary search", "geometry", "ternary search", "math" ]
0c7a476716445c535a61f4e81edc7f75
The first line contains a single integer $$$T$$$ ($$$1 \le T \le 200$$$) — the number of test cases. Next $$$T$$$ lines contain descriptions of test cases — one per line. Each line contains single even integer $$$n$$$ ($$$2 \le n \le 200$$$). Don't forget you need to embed $$$2n$$$-gon, not an $$$n$$$-gon.
1,400
Print $$$T$$$ real numbers — one per test case. For each test case, print the minimum length of a side of the square $$$2n$$$-gon can be embedded in. Your answer will be considered correct if its absolute or relative error doesn't exceed $$$10^{-6}$$$.
standard output
PASSED
48df7a630042541dba6696716838c5ae
train_001.jsonl
1589707200
The statement of this problem is the same as the statement of problem C2. The only difference is that, in problem C1, $$$n$$$ is always even, and in C2, $$$n$$$ is always odd.You are given a regular polygon with $$$2 \cdot n$$$ vertices (it's convex and has equal sides and equal angles) and all its sides have length $$...
256 megabytes
import java.io.OutputStream; import java.io.IOException; import java.io.InputStream; import java.io.PrintWriter; import java.util.InputMismatchException; import java.io.IOException; import java.io.InputStream; /** * Built using CHelper plug-in * Actual solution is at the top * * @author Pranay2516 */ public class...
Java
["3\n2\n4\n200"]
2 seconds
["1.000000000\n2.414213562\n127.321336469"]
null
Java 8
standard input
[ "binary search", "geometry", "ternary search", "math" ]
0c7a476716445c535a61f4e81edc7f75
The first line contains a single integer $$$T$$$ ($$$1 \le T \le 200$$$) — the number of test cases. Next $$$T$$$ lines contain descriptions of test cases — one per line. Each line contains single even integer $$$n$$$ ($$$2 \le n \le 200$$$). Don't forget you need to embed $$$2n$$$-gon, not an $$$n$$$-gon.
1,400
Print $$$T$$$ real numbers — one per test case. For each test case, print the minimum length of a side of the square $$$2n$$$-gon can be embedded in. Your answer will be considered correct if its absolute or relative error doesn't exceed $$$10^{-6}$$$.
standard output
PASSED
05e426368db97ea1e9687ce3b63ddfae
train_001.jsonl
1589707200
The statement of this problem is the same as the statement of problem C2. The only difference is that, in problem C1, $$$n$$$ is always even, and in C2, $$$n$$$ is always odd.You are given a regular polygon with $$$2 \cdot n$$$ vertices (it's convex and has equal sides and equal angles) and all its sides have length $$...
256 megabytes
import java.io.*; import java.util.*; public class edr87C1 { public static void main(String[] args) throws Exception { BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); //Scanner sc = new Scanner(System.in); int t = Integer.parseInt(br.readLine()); while(t-- > 0) { double n =...
Java
["3\n2\n4\n200"]
2 seconds
["1.000000000\n2.414213562\n127.321336469"]
null
Java 8
standard input
[ "binary search", "geometry", "ternary search", "math" ]
0c7a476716445c535a61f4e81edc7f75
The first line contains a single integer $$$T$$$ ($$$1 \le T \le 200$$$) — the number of test cases. Next $$$T$$$ lines contain descriptions of test cases — one per line. Each line contains single even integer $$$n$$$ ($$$2 \le n \le 200$$$). Don't forget you need to embed $$$2n$$$-gon, not an $$$n$$$-gon.
1,400
Print $$$T$$$ real numbers — one per test case. For each test case, print the minimum length of a side of the square $$$2n$$$-gon can be embedded in. Your answer will be considered correct if its absolute or relative error doesn't exceed $$$10^{-6}$$$.
standard output