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
3bdbefb45e4a304d8144af75b6f17742
train_001.jsonl
1366385400
You are fishing with polar bears Alice and Bob. While waiting for the fish to bite, the polar bears get bored. They come up with a game. First Alice and Bob each writes a 01-string (strings that only contain character "0" and "1") a and b. Then you try to turn a into b using two types of operations: Write parity(a) to...
256 megabytes
import java.io.*; import java.util.StringTokenizer; /** * 297A * ΞΈ(|a| + |b|) time * ΞΈ(|a| + |b|) space * * @author artyom */ public class _297A implements Runnable { private BufferedReader in; private StringTokenizer tok; private Object solve() throws IOException { String a = nextToken(), b...
Java
["01011\n0110", "0011\n1110"]
1 second
["YES", "NO"]
NoteIn the first sample, the steps are as follows: 01011 → 1011 → 011 → 0110
Java 8
standard input
[ "constructive algorithms" ]
cf86add6c92fa8a72b8e23efbdb38613
The first line contains the string a and the second line contains the string b (1 ≀ |a|, |b| ≀ 1000). Both strings contain only the characters "0" and "1". Here |x| denotes the length of the string x.
1,700
Print "YES" (without quotes) if it is possible to turn a into b, and "NO" (without quotes) otherwise.
standard output
PASSED
7e3d7d14f667c4673790f59f77907517
train_001.jsonl
1366385400
You are fishing with polar bears Alice and Bob. While waiting for the fish to bite, the polar bears get bored. They come up with a game. First Alice and Bob each writes a 01-string (strings that only contain character "0" and "1") a and b. Then you try to turn a into b using two types of operations: Write parity(a) to...
256 megabytes
import java.util.Scanner; public class ParityGame1 { public static void main(String[] args) { // TODO Auto-generated method stub Scanner input = new Scanner(System.in); char[] a = input.next().toCharArray(); char[] b = input.next().toCharArray(); int count=0; for(int i=0; i<a.length;i++){ if(a[i]==...
Java
["01011\n0110", "0011\n1110"]
1 second
["YES", "NO"]
NoteIn the first sample, the steps are as follows: 01011 → 1011 → 011 → 0110
Java 8
standard input
[ "constructive algorithms" ]
cf86add6c92fa8a72b8e23efbdb38613
The first line contains the string a and the second line contains the string b (1 ≀ |a|, |b| ≀ 1000). Both strings contain only the characters "0" and "1". Here |x| denotes the length of the string x.
1,700
Print "YES" (without quotes) if it is possible to turn a into b, and "NO" (without quotes) otherwise.
standard output
PASSED
2b139312eb08d70f79030cd537b70265
train_001.jsonl
1366385400
You are fishing with polar bears Alice and Bob. While waiting for the fish to bite, the polar bears get bored. They come up with a game. First Alice and Bob each writes a 01-string (strings that only contain character "0" and "1") a and b. Then you try to turn a into b using two types of operations: Write parity(a) to...
256 megabytes
//package codeforces; import java.util.Scanner; /** * Created by nitin.s on 09/10/16. */ public class ParityGame { public static void main(String[] args) { Scanner in = new Scanner(System.in); String a = in.nextLine(); String b = in.nextLine(); int onesA = 0, onesB = 0; f...
Java
["01011\n0110", "0011\n1110"]
1 second
["YES", "NO"]
NoteIn the first sample, the steps are as follows: 01011 → 1011 → 011 → 0110
Java 8
standard input
[ "constructive algorithms" ]
cf86add6c92fa8a72b8e23efbdb38613
The first line contains the string a and the second line contains the string b (1 ≀ |a|, |b| ≀ 1000). Both strings contain only the characters "0" and "1". Here |x| denotes the length of the string x.
1,700
Print "YES" (without quotes) if it is possible to turn a into b, and "NO" (without quotes) otherwise.
standard output
PASSED
643f8141c09e833e401426119b39f85c
train_001.jsonl
1366385400
You are fishing with polar bears Alice and Bob. While waiting for the fish to bite, the polar bears get bored. They come up with a game. First Alice and Bob each writes a 01-string (strings that only contain character "0" and "1") a and b. Then you try to turn a into b using two types of operations: Write parity(a) to...
256 megabytes
import java.util.*; public class Parity { public static void main(String[] args) { Scanner in = new Scanner(System.in); String a = in.next(); String b = in.next(); int a1 = a.length() - a.replace("1", "").length(); if (a1 % 2 != 0) a1++; int b1 = b.length() - b.replace("1", "").length(); System.out.p...
Java
["01011\n0110", "0011\n1110"]
1 second
["YES", "NO"]
NoteIn the first sample, the steps are as follows: 01011 → 1011 → 011 → 0110
Java 8
standard input
[ "constructive algorithms" ]
cf86add6c92fa8a72b8e23efbdb38613
The first line contains the string a and the second line contains the string b (1 ≀ |a|, |b| ≀ 1000). Both strings contain only the characters "0" and "1". Here |x| denotes the length of the string x.
1,700
Print "YES" (without quotes) if it is possible to turn a into b, and "NO" (without quotes) otherwise.
standard output
PASSED
e3bdc247c49df5024de24505a605c61e
train_001.jsonl
1366385400
You are fishing with polar bears Alice and Bob. While waiting for the fish to bite, the polar bears get bored. They come up with a game. First Alice and Bob each writes a 01-string (strings that only contain character "0" and "1") a and b. Then you try to turn a into b using two types of operations: Write parity(a) to...
256 megabytes
import java.io.*; import java.util.*; import java.lang.*; public class templ { public static int a[]=new int[1000000]; int binarySearch(int arr[], int l, int r, int x) { if (r >= l) { int mid = l + (r - l)/2; if (arr[mid] == x) return mid; ...
Java
["01011\n0110", "0011\n1110"]
1 second
["YES", "NO"]
NoteIn the first sample, the steps are as follows: 01011 → 1011 → 011 → 0110
Java 8
standard input
[ "constructive algorithms" ]
cf86add6c92fa8a72b8e23efbdb38613
The first line contains the string a and the second line contains the string b (1 ≀ |a|, |b| ≀ 1000). Both strings contain only the characters "0" and "1". Here |x| denotes the length of the string x.
1,700
Print "YES" (without quotes) if it is possible to turn a into b, and "NO" (without quotes) otherwise.
standard output
PASSED
f521ded2be88f09c17039855eb583891
train_001.jsonl
1366385400
You are fishing with polar bears Alice and Bob. While waiting for the fish to bite, the polar bears get bored. They come up with a game. First Alice and Bob each writes a 01-string (strings that only contain character "0" and "1") a and b. Then you try to turn a into b using two types of operations: Write parity(a) to...
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; public class Main { public static void main(String[] args) { InputStream inputStream = System.i...
Java
["01011\n0110", "0011\n1110"]
1 second
["YES", "NO"]
NoteIn the first sample, the steps are as follows: 01011 → 1011 → 011 → 0110
Java 8
standard input
[ "constructive algorithms" ]
cf86add6c92fa8a72b8e23efbdb38613
The first line contains the string a and the second line contains the string b (1 ≀ |a|, |b| ≀ 1000). Both strings contain only the characters "0" and "1". Here |x| denotes the length of the string x.
1,700
Print "YES" (without quotes) if it is possible to turn a into b, and "NO" (without quotes) otherwise.
standard output
PASSED
e90f55fcc84a3a786e3e7e29b3696af5
train_001.jsonl
1366385400
You are fishing with polar bears Alice and Bob. While waiting for the fish to bite, the polar bears get bored. They come up with a game. First Alice and Bob each writes a 01-string (strings that only contain character "0" and "1") a and b. Then you try to turn a into b using two types of operations: Write parity(a) to...
256 megabytes
import java.util.*; import java.io.*; import java.math.*; public class A{ class Node implements Comparable<Node>{ int id; long st; public Node(int id,long st){ this.id=id; } public int compareTo(Node c){ return Long.compare(this.st,c.st); } ...
Java
["01011\n0110", "0011\n1110"]
1 second
["YES", "NO"]
NoteIn the first sample, the steps are as follows: 01011 → 1011 → 011 → 0110
Java 8
standard input
[ "constructive algorithms" ]
cf86add6c92fa8a72b8e23efbdb38613
The first line contains the string a and the second line contains the string b (1 ≀ |a|, |b| ≀ 1000). Both strings contain only the characters "0" and "1". Here |x| denotes the length of the string x.
1,700
Print "YES" (without quotes) if it is possible to turn a into b, and "NO" (without quotes) otherwise.
standard output
PASSED
11caf61e8e5877c17a1c49fbd8ed7001
train_001.jsonl
1366385400
You are fishing with polar bears Alice and Bob. While waiting for the fish to bite, the polar bears get bored. They come up with a game. First Alice and Bob each writes a 01-string (strings that only contain character "0" and "1") a and b. Then you try to turn a into b using two types of operations: Write parity(a) to...
256 megabytes
import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; public class Main { /** * @param args * @throws IOException */ public static void main(String[] args) throws IOException { // TODO Auto-generated method stub BufferedReader br=new BufferedReader(new InputStreamR...
Java
["01011\n0110", "0011\n1110"]
1 second
["YES", "NO"]
NoteIn the first sample, the steps are as follows: 01011 → 1011 → 011 → 0110
Java 6
standard input
[ "constructive algorithms" ]
cf86add6c92fa8a72b8e23efbdb38613
The first line contains the string a and the second line contains the string b (1 ≀ |a|, |b| ≀ 1000). Both strings contain only the characters "0" and "1". Here |x| denotes the length of the string x.
1,700
Print "YES" (without quotes) if it is possible to turn a into b, and "NO" (without quotes) otherwise.
standard output
PASSED
4b20a4de81937515e877555c82140df5
train_001.jsonl
1366385400
You are fishing with polar bears Alice and Bob. While waiting for the fish to bite, the polar bears get bored. They come up with a game. First Alice and Bob each writes a 01-string (strings that only contain character "0" and "1") a and b. Then you try to turn a into b using two types of operations: Write parity(a) to...
256 megabytes
import java.io.*; import java.math.BigInteger; import java.util.*; import java.text.*; public class cf297A_parityGame { static BufferedReader br; static Scanner sc; static PrintWriter out; public static void initA() { try { br = new BufferedReader(new InputStreamReader(System.in)...
Java
["01011\n0110", "0011\n1110"]
1 second
["YES", "NO"]
NoteIn the first sample, the steps are as follows: 01011 → 1011 → 011 → 0110
Java 6
standard input
[ "constructive algorithms" ]
cf86add6c92fa8a72b8e23efbdb38613
The first line contains the string a and the second line contains the string b (1 ≀ |a|, |b| ≀ 1000). Both strings contain only the characters "0" and "1". Here |x| denotes the length of the string x.
1,700
Print "YES" (without quotes) if it is possible to turn a into b, and "NO" (without quotes) otherwise.
standard output
PASSED
43fa147552384ccb0b2a4dd2db4ff382
train_001.jsonl
1366385400
You are fishing with polar bears Alice and Bob. While waiting for the fish to bite, the polar bears get bored. They come up with a game. First Alice and Bob each writes a 01-string (strings that only contain character "0" and "1") a and b. Then you try to turn a into b using two types of operations: Write parity(a) to...
256 megabytes
import java.util.*; public class cf297a { public static void main(String[] args) { Scanner in = new Scanner(System.in); int a = 0, b = 0; for(char c : in.next().trim().toCharArray()) if(c == '1') a++; for(char c : in.next().trim().toCharArray()) if(c == '1') b++; if(a +...
Java
["01011\n0110", "0011\n1110"]
1 second
["YES", "NO"]
NoteIn the first sample, the steps are as follows: 01011 → 1011 → 011 → 0110
Java 6
standard input
[ "constructive algorithms" ]
cf86add6c92fa8a72b8e23efbdb38613
The first line contains the string a and the second line contains the string b (1 ≀ |a|, |b| ≀ 1000). Both strings contain only the characters "0" and "1". Here |x| denotes the length of the string x.
1,700
Print "YES" (without quotes) if it is possible to turn a into b, and "NO" (without quotes) otherwise.
standard output
PASSED
513831ac8fc5b4368a7bc1e338e2947f
train_001.jsonl
1366385400
You are fishing with polar bears Alice and Bob. While waiting for the fish to bite, the polar bears get bored. They come up with a game. First Alice and Bob each writes a 01-string (strings that only contain character "0" and "1") a and b. Then you try to turn a into b using two types of operations: Write parity(a) to...
256 megabytes
import java.io.*; import java.util.*; import java.math.*; public class A implements Runnable { public void run() { long startTime = System.nanoTime(); char[] p = nextToken().toCharArray(); char[] q = nextToken().toCharArray(); println(count(p) + count(p) % 2 >= count(q) ? "YES" :...
Java
["01011\n0110", "0011\n1110"]
1 second
["YES", "NO"]
NoteIn the first sample, the steps are as follows: 01011 → 1011 → 011 → 0110
Java 6
standard input
[ "constructive algorithms" ]
cf86add6c92fa8a72b8e23efbdb38613
The first line contains the string a and the second line contains the string b (1 ≀ |a|, |b| ≀ 1000). Both strings contain only the characters "0" and "1". Here |x| denotes the length of the string x.
1,700
Print "YES" (without quotes) if it is possible to turn a into b, and "NO" (without quotes) otherwise.
standard output
PASSED
60b5fff68a581f94e296d626718a1b91
train_001.jsonl
1366385400
You are fishing with polar bears Alice and Bob. While waiting for the fish to bite, the polar bears get bored. They come up with a game. First Alice and Bob each writes a 01-string (strings that only contain character "0" and "1") a and b. Then you try to turn a into b using two types of operations: Write parity(a) to...
256 megabytes
import java.awt.*; import java.awt.event.*; import java.awt.geom.*; import java.io.*; import java.math.*; import java.text.*; import java.util.*; /* br = new BufferedReader(new FileReader("input.txt")); pw = new PrintWriter(new BufferedWriter(new FileWriter("output.txt"))); br = new BufferedReader(new InputS...
Java
["01011\n0110", "0011\n1110"]
1 second
["YES", "NO"]
NoteIn the first sample, the steps are as follows: 01011 → 1011 → 011 → 0110
Java 6
standard input
[ "constructive algorithms" ]
cf86add6c92fa8a72b8e23efbdb38613
The first line contains the string a and the second line contains the string b (1 ≀ |a|, |b| ≀ 1000). Both strings contain only the characters "0" and "1". Here |x| denotes the length of the string x.
1,700
Print "YES" (without quotes) if it is possible to turn a into b, and "NO" (without quotes) otherwise.
standard output
PASSED
0217590d377de41628ecd78bae1b2f95
train_001.jsonl
1366385400
You are fishing with polar bears Alice and Bob. While waiting for the fish to bite, the polar bears get bored. They come up with a game. First Alice and Bob each writes a 01-string (strings that only contain character "0" and "1") a and b. Then you try to turn a into b using two types of operations: Write parity(a) to...
256 megabytes
import java.util.*; import java.io.*; public class Contest180C { public static void main(String[] args)throws IOException { BufferedReader rd = new BufferedReader(new InputStreamReader(System.in)); String a = rd.readLine(); String b = rd.readLine(); int one = 0; fo...
Java
["01011\n0110", "0011\n1110"]
1 second
["YES", "NO"]
NoteIn the first sample, the steps are as follows: 01011 → 1011 → 011 → 0110
Java 6
standard input
[ "constructive algorithms" ]
cf86add6c92fa8a72b8e23efbdb38613
The first line contains the string a and the second line contains the string b (1 ≀ |a|, |b| ≀ 1000). Both strings contain only the characters "0" and "1". Here |x| denotes the length of the string x.
1,700
Print "YES" (without quotes) if it is possible to turn a into b, and "NO" (without quotes) otherwise.
standard output
PASSED
2c4385c69a1d3c4c91f9394fcd2626ae
train_001.jsonl
1366385400
You are fishing with polar bears Alice and Bob. While waiting for the fish to bite, the polar bears get bored. They come up with a game. First Alice and Bob each writes a 01-string (strings that only contain character "0" and "1") a and b. Then you try to turn a into b using two types of operations: Write parity(a) to...
256 megabytes
/** * Created with IntelliJ IDEA. * User: yuantian * Date: 4/19/13 * Time: 12:01 PM * Copyright (c) 2013 All Right Reserved, http://github.com/tyuan73 */ import java.util.*; public class ParityGame { public static void main(String[] args) { Scanner in = new Scanner(System.in); String a = in...
Java
["01011\n0110", "0011\n1110"]
1 second
["YES", "NO"]
NoteIn the first sample, the steps are as follows: 01011 → 1011 → 011 → 0110
Java 6
standard input
[ "constructive algorithms" ]
cf86add6c92fa8a72b8e23efbdb38613
The first line contains the string a and the second line contains the string b (1 ≀ |a|, |b| ≀ 1000). Both strings contain only the characters "0" and "1". Here |x| denotes the length of the string x.
1,700
Print "YES" (without quotes) if it is possible to turn a into b, and "NO" (without quotes) otherwise.
standard output
PASSED
756306ab11b91b15fa202974d5a3df56
train_001.jsonl
1366385400
You are fishing with polar bears Alice and Bob. While waiting for the fish to bite, the polar bears get bored. They come up with a game. First Alice and Bob each writes a 01-string (strings that only contain character "0" and "1") a and b. Then you try to turn a into b using two types of operations: Write parity(a) to...
256 megabytes
import java.io.*; import java.util.*; public class Main { // static Scanner in; static PrintWriter out; // static StreamTokenizer in; static int next() throws Exception {in.nextToken(); return (int) in.nval;} static BufferedReader in; public static void main(String[] args) throws Exception { // in = new Scanner(S...
Java
["01011\n0110", "0011\n1110"]
1 second
["YES", "NO"]
NoteIn the first sample, the steps are as follows: 01011 → 1011 → 011 → 0110
Java 6
standard input
[ "constructive algorithms" ]
cf86add6c92fa8a72b8e23efbdb38613
The first line contains the string a and the second line contains the string b (1 ≀ |a|, |b| ≀ 1000). Both strings contain only the characters "0" and "1". Here |x| denotes the length of the string x.
1,700
Print "YES" (without quotes) if it is possible to turn a into b, and "NO" (without quotes) otherwise.
standard output
PASSED
1856d9413e3b3a7baca1bcc87067182b
train_001.jsonl
1366385400
You are fishing with polar bears Alice and Bob. While waiting for the fish to bite, the polar bears get bored. They come up with a game. First Alice and Bob each writes a 01-string (strings that only contain character "0" and "1") a and b. Then you try to turn a into b using two types of operations: Write parity(a) to...
256 megabytes
import java.io.*; import java.util.*; public class parity { static String a, b; static int count[]; public static void main(String[] args) throws IOException { BufferedReader in = new BufferedReader(new InputStreamReader(System.in)); //BufferedReader in = new BufferedReader(new FileRea...
Java
["01011\n0110", "0011\n1110"]
1 second
["YES", "NO"]
NoteIn the first sample, the steps are as follows: 01011 → 1011 → 011 → 0110
Java 6
standard input
[ "constructive algorithms" ]
cf86add6c92fa8a72b8e23efbdb38613
The first line contains the string a and the second line contains the string b (1 ≀ |a|, |b| ≀ 1000). Both strings contain only the characters "0" and "1". Here |x| denotes the length of the string x.
1,700
Print "YES" (without quotes) if it is possible to turn a into b, and "NO" (without quotes) otherwise.
standard output
PASSED
7e888af294e4e4fcfa5a452e65884b13
train_001.jsonl
1366385400
You are fishing with polar bears Alice and Bob. While waiting for the fish to bite, the polar bears get bored. They come up with a game. First Alice and Bob each writes a 01-string (strings that only contain character "0" and "1") a and b. Then you try to turn a into b using two types of operations: Write parity(a) to...
256 megabytes
import java.util.*; import java.io.*; public class a { public static void main(String[] args) throws IOException { input.init(System.in); PrintWriter out = new PrintWriter(new OutputStreamWriter(System.out)); String s1 = input.next(), s2 = input.next(); int a = 0, b = 0; for(int i = 0; i<s1.length(); i++) if...
Java
["01011\n0110", "0011\n1110"]
1 second
["YES", "NO"]
NoteIn the first sample, the steps are as follows: 01011 → 1011 → 011 → 0110
Java 6
standard input
[ "constructive algorithms" ]
cf86add6c92fa8a72b8e23efbdb38613
The first line contains the string a and the second line contains the string b (1 ≀ |a|, |b| ≀ 1000). Both strings contain only the characters "0" and "1". Here |x| denotes the length of the string x.
1,700
Print "YES" (without quotes) if it is possible to turn a into b, and "NO" (without quotes) otherwise.
standard output
PASSED
96769fe13c4ac8ce4818c65e89368075
train_001.jsonl
1366385400
You are fishing with polar bears Alice and Bob. While waiting for the fish to bite, the polar bears get bored. They come up with a game. First Alice and Bob each writes a 01-string (strings that only contain character "0" and "1") a and b. Then you try to turn a into b using two types of operations: Write parity(a) to...
256 megabytes
import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; import java.util.StringTokenizer; public class A { static class Scanner{ BufferedReader br=null; StringTokenizer tk=null; public Scanner(){ br=new BufferedReader(new InputStreamReader(System.in)); } public Str...
Java
["01011\n0110", "0011\n1110"]
1 second
["YES", "NO"]
NoteIn the first sample, the steps are as follows: 01011 → 1011 → 011 → 0110
Java 6
standard input
[ "constructive algorithms" ]
cf86add6c92fa8a72b8e23efbdb38613
The first line contains the string a and the second line contains the string b (1 ≀ |a|, |b| ≀ 1000). Both strings contain only the characters "0" and "1". Here |x| denotes the length of the string x.
1,700
Print "YES" (without quotes) if it is possible to turn a into b, and "NO" (without quotes) otherwise.
standard output
PASSED
b649b9b24e73478a30d515995b7650db
train_001.jsonl
1366385400
You are fishing with polar bears Alice and Bob. While waiting for the fish to bite, the polar bears get bored. They come up with a game. First Alice and Bob each writes a 01-string (strings that only contain character "0" and "1") a and b. Then you try to turn a into b using two types of operations: Write parity(a) to...
256 megabytes
import java.util.Scanner; public class Prob297A { public static void main(String[] Args) { Scanner scan = new Scanner(System.in); String s1 = scan.next(); char[] c1 = s1.toCharArray(); int ones1 = numOnes(c1); String s2 = scan.next(); char[] c2 = s2.toCharArray(); int ones2 = numOnes(c2); if ((((ones...
Java
["01011\n0110", "0011\n1110"]
1 second
["YES", "NO"]
NoteIn the first sample, the steps are as follows: 01011 → 1011 → 011 → 0110
Java 6
standard input
[ "constructive algorithms" ]
cf86add6c92fa8a72b8e23efbdb38613
The first line contains the string a and the second line contains the string b (1 ≀ |a|, |b| ≀ 1000). Both strings contain only the characters "0" and "1". Here |x| denotes the length of the string x.
1,700
Print "YES" (without quotes) if it is possible to turn a into b, and "NO" (without quotes) otherwise.
standard output
PASSED
886c09ebf13b1e799762549515fee3f2
train_001.jsonl
1366385400
You are fishing with polar bears Alice and Bob. While waiting for the fish to bite, the polar bears get bored. They come up with a game. First Alice and Bob each writes a 01-string (strings that only contain character "0" and "1") a and b. Then you try to turn a into b using two types of operations: Write parity(a) to...
256 megabytes
import java.io.IOException; import java.io.OutputStreamWriter; import java.io.BufferedWriter; import java.util.InputMismatchException; import java.io.OutputStream; import java.io.PrintWriter; import java.io.Writer; import java.math.BigInteger; import java.io.InputStream; /** * Built using CHelper plug-in * Actual so...
Java
["01011\n0110", "0011\n1110"]
1 second
["YES", "NO"]
NoteIn the first sample, the steps are as follows: 01011 → 1011 → 011 → 0110
Java 6
standard input
[ "constructive algorithms" ]
cf86add6c92fa8a72b8e23efbdb38613
The first line contains the string a and the second line contains the string b (1 ≀ |a|, |b| ≀ 1000). Both strings contain only the characters "0" and "1". Here |x| denotes the length of the string x.
1,700
Print "YES" (without quotes) if it is possible to turn a into b, and "NO" (without quotes) otherwise.
standard output
PASSED
9e9ced3af34214b570f33d1f5a12455a
train_001.jsonl
1366385400
You are fishing with polar bears Alice and Bob. While waiting for the fish to bite, the polar bears get bored. They come up with a game. First Alice and Bob each writes a 01-string (strings that only contain character "0" and "1") a and b. Then you try to turn a into b using two types of operations: Write parity(a) to...
256 megabytes
import java.util.*; import java.io.*; public class A { public static void main(String[] args) { Scanner sc = new Scanner(System.in); String a = sc.next(); String b = sc.next(); int na = 0; int nb = 0; for (int i = 0; i < a.length(); i++) { if (a.charAt(i)...
Java
["01011\n0110", "0011\n1110"]
1 second
["YES", "NO"]
NoteIn the first sample, the steps are as follows: 01011 → 1011 → 011 → 0110
Java 6
standard input
[ "constructive algorithms" ]
cf86add6c92fa8a72b8e23efbdb38613
The first line contains the string a and the second line contains the string b (1 ≀ |a|, |b| ≀ 1000). Both strings contain only the characters "0" and "1". Here |x| denotes the length of the string x.
1,700
Print "YES" (without quotes) if it is possible to turn a into b, and "NO" (without quotes) otherwise.
standard output
PASSED
e9a73360d88717ca309fb8e9846a241b
train_001.jsonl
1366385400
You are fishing with polar bears Alice and Bob. While waiting for the fish to bite, the polar bears get bored. They come up with a game. First Alice and Bob each writes a 01-string (strings that only contain character "0" and "1") a and b. Then you try to turn a into b using two types of operations: Write parity(a) to...
256 megabytes
import java.io.*; import java.util.*; public class A { MyScanner in; PrintWriter out; public static void main(String[] args) throws Exception { new A().run(); } public void run() throws Exception { in = new MyScanner(); out = new PrintWriter(System.out); solve();...
Java
["01011\n0110", "0011\n1110"]
1 second
["YES", "NO"]
NoteIn the first sample, the steps are as follows: 01011 → 1011 → 011 → 0110
Java 6
standard input
[ "constructive algorithms" ]
cf86add6c92fa8a72b8e23efbdb38613
The first line contains the string a and the second line contains the string b (1 ≀ |a|, |b| ≀ 1000). Both strings contain only the characters "0" and "1". Here |x| denotes the length of the string x.
1,700
Print "YES" (without quotes) if it is possible to turn a into b, and "NO" (without quotes) otherwise.
standard output
PASSED
8ad30343091856eec4f9c0a2123c92d9
train_001.jsonl
1366385400
You are fishing with polar bears Alice and Bob. While waiting for the fish to bite, the polar bears get bored. They come up with a game. First Alice and Bob each writes a 01-string (strings that only contain character "0" and "1") a and b. Then you try to turn a into b using two types of operations: Write parity(a) to...
256 megabytes
import java.math.*; import java.util.*; import java.io.*; public class Main { public static void main(String[] args) { Scanner cin = new Scanner(System.in); String s1 = cin.next(); String s2 = cin.next(); int z1 = 0, z2 = 0; for (int i = 0; i < s1.length(); i++) if (s1.charAt(i) == '1') z1++; if ...
Java
["01011\n0110", "0011\n1110"]
1 second
["YES", "NO"]
NoteIn the first sample, the steps are as follows: 01011 → 1011 → 011 → 0110
Java 6
standard input
[ "constructive algorithms" ]
cf86add6c92fa8a72b8e23efbdb38613
The first line contains the string a and the second line contains the string b (1 ≀ |a|, |b| ≀ 1000). Both strings contain only the characters "0" and "1". Here |x| denotes the length of the string x.
1,700
Print "YES" (without quotes) if it is possible to turn a into b, and "NO" (without quotes) otherwise.
standard output
PASSED
1d952e488258f9a56be34f52f837a014
train_001.jsonl
1366385400
You are fishing with polar bears Alice and Bob. While waiting for the fish to bite, the polar bears get bored. They come up with a game. First Alice and Bob each writes a 01-string (strings that only contain character "0" and "1") a and b. Then you try to turn a into b using two types of operations: Write parity(a) to...
256 megabytes
import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; import java.io.PrintWriter; import java.util.Arrays; public class ProblemA { public static void main(String[] args) throws IOException { BufferedReader in = new BufferedReader(new InputStreamReader(System.in)); PrintWrite...
Java
["01011\n0110", "0011\n1110"]
1 second
["YES", "NO"]
NoteIn the first sample, the steps are as follows: 01011 → 1011 → 011 → 0110
Java 6
standard input
[ "constructive algorithms" ]
cf86add6c92fa8a72b8e23efbdb38613
The first line contains the string a and the second line contains the string b (1 ≀ |a|, |b| ≀ 1000). Both strings contain only the characters "0" and "1". Here |x| denotes the length of the string x.
1,700
Print "YES" (without quotes) if it is possible to turn a into b, and "NO" (without quotes) otherwise.
standard output
PASSED
2595f70deda6d48d0fdb8d0fad279f31
train_001.jsonl
1366385400
You are fishing with polar bears Alice and Bob. While waiting for the fish to bite, the polar bears get bored. They come up with a game. First Alice and Bob each writes a 01-string (strings that only contain character "0" and "1") a and b. Then you try to turn a into b using two types of operations: Write parity(a) to...
256 megabytes
//package round180; import java.io.ByteArrayInputStream; import java.io.IOException; import java.io.InputStream; import java.io.PrintWriter; import java.util.Arrays; import java.util.InputMismatchException; public class A { InputStream is; PrintWriter out; String INPUT = ""; void solve() { char[] a = ns(1001)...
Java
["01011\n0110", "0011\n1110"]
1 second
["YES", "NO"]
NoteIn the first sample, the steps are as follows: 01011 → 1011 → 011 → 0110
Java 6
standard input
[ "constructive algorithms" ]
cf86add6c92fa8a72b8e23efbdb38613
The first line contains the string a and the second line contains the string b (1 ≀ |a|, |b| ≀ 1000). Both strings contain only the characters "0" and "1". Here |x| denotes the length of the string x.
1,700
Print "YES" (without quotes) if it is possible to turn a into b, and "NO" (without quotes) otherwise.
standard output
PASSED
2d01be3de6bca72beb388c79961282a9
train_001.jsonl
1370619000
Sereja and his friends went to a picnic. The guys had n soda bottles just for it. Sereja forgot the bottle opener as usual, so the guys had to come up with another way to open bottles.Sereja knows that the i-th bottle is from brand ai, besides, you can use it to open other bottles of brand bi. You can use one bottle to...
256 megabytes
import java.util.Arrays; import java.util.Scanner; public class Main { public static void main(String args[]) { Scanner sc = new Scanner(System.in); int n = sc.nextInt(); int a[]=new int[n]; int b[]=new int[n]; for(int i=0;i<a.length;i++) { a[i]=sc.nextInt(); b[i]=sc.nextInt();} for(int i=0;i<a....
Java
["4\n1 1\n2 2\n3 3\n4 4", "4\n1 2\n2 3\n3 4\n4 1"]
2 seconds
["4", "0"]
null
Java 8
standard input
[ "brute force" ]
84bd49becca69e126606d5a2f764dd91
The first line contains integer n (1 ≀ n ≀ 100) β€” the number of bottles. The next n lines contain the bottles' description. The i-th line contains two integers ai, bi (1 ≀ ai, bi ≀ 1000) β€” the description of the i-th bottle.
1,400
In a single line print a single integer β€” the answer to the problem.
standard output
PASSED
39f2f21ddc9c3d8332a83ab1a441351b
train_001.jsonl
1370619000
Sereja and his friends went to a picnic. The guys had n soda bottles just for it. Sereja forgot the bottle opener as usual, so the guys had to come up with another way to open bottles.Sereja knows that the i-th bottle is from brand ai, besides, you can use it to open other bottles of brand bi. You can use one bottle to...
256 megabytes
import java.util.Scanner; public class SerejaAndBottles { public static void main(String[] args) { Scanner input = new Scanner (System.in); int n = input.nextInt(); int [] a = new int [n]; int [] b = new int [n]; for (int i = 0 ; i...
Java
["4\n1 1\n2 2\n3 3\n4 4", "4\n1 2\n2 3\n3 4\n4 1"]
2 seconds
["4", "0"]
null
Java 8
standard input
[ "brute force" ]
84bd49becca69e126606d5a2f764dd91
The first line contains integer n (1 ≀ n ≀ 100) β€” the number of bottles. The next n lines contain the bottles' description. The i-th line contains two integers ai, bi (1 ≀ ai, bi ≀ 1000) β€” the description of the i-th bottle.
1,400
In a single line print a single integer β€” the answer to the problem.
standard output
PASSED
f49a379180efaed546192551b6545d22
train_001.jsonl
1370619000
Sereja and his friends went to a picnic. The guys had n soda bottles just for it. Sereja forgot the bottle opener as usual, so the guys had to come up with another way to open bottles.Sereja knows that the i-th bottle is from brand ai, besides, you can use it to open other bottles of brand bi. You can use one bottle to...
256 megabytes
//package Competitive; import java.io.*; import java.util.*; public class Main { public static void main(String[] args) throws IOException{ String[] arr= {"a"}; code3 obj=new code3(); obj.main(arr); } } class code3{ static int ans; public static void main(String[] args) throws IOException{ //Reader sc=new R...
Java
["4\n1 1\n2 2\n3 3\n4 4", "4\n1 2\n2 3\n3 4\n4 1"]
2 seconds
["4", "0"]
null
Java 8
standard input
[ "brute force" ]
84bd49becca69e126606d5a2f764dd91
The first line contains integer n (1 ≀ n ≀ 100) β€” the number of bottles. The next n lines contain the bottles' description. The i-th line contains two integers ai, bi (1 ≀ ai, bi ≀ 1000) β€” the description of the i-th bottle.
1,400
In a single line print a single integer β€” the answer to the problem.
standard output
PASSED
9b7e4195ba24740e52086a1c2d3675cf
train_001.jsonl
1370619000
Sereja and his friends went to a picnic. The guys had n soda bottles just for it. Sereja forgot the bottle opener as usual, so the guys had to come up with another way to open bottles.Sereja knows that the i-th bottle is from brand ai, besides, you can use it to open other bottles of brand bi. You can use one bottle to...
256 megabytes
import java.util.*; public class A315 { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int n=sc.nextInt(); int []f=new int[n]; int []s=new int[n]; for (int i = 0; i < n; i++) { f[i]=sc.nextInt(); s[i]=sc.nextInt(); } int cnt=n; for (int i = 0; i...
Java
["4\n1 1\n2 2\n3 3\n4 4", "4\n1 2\n2 3\n3 4\n4 1"]
2 seconds
["4", "0"]
null
Java 8
standard input
[ "brute force" ]
84bd49becca69e126606d5a2f764dd91
The first line contains integer n (1 ≀ n ≀ 100) β€” the number of bottles. The next n lines contain the bottles' description. The i-th line contains two integers ai, bi (1 ≀ ai, bi ≀ 1000) β€” the description of the i-th bottle.
1,400
In a single line print a single integer β€” the answer to the problem.
standard output
PASSED
dce89be079bba2d72832317fd0fdbb2e
train_001.jsonl
1370619000
Sereja and his friends went to a picnic. The guys had n soda bottles just for it. Sereja forgot the bottle opener as usual, so the guys had to come up with another way to open bottles.Sereja knows that the i-th bottle is from brand ai, besides, you can use it to open other bottles of brand bi. You can use one bottle to...
256 megabytes
import java.util.*; public class bottles { public static void main(String args[]) { Scanner sc = new Scanner(System.in); int n = sc.nextInt(); int a[]=new int[n]; int b[]=new int[n]; for(int i=0;i<a.length;i++) { a[i]=sc.nextInt(); // for(int i=0;i<b.length;i++) b[i]=sc.nextInt();} for(int i=0;i<...
Java
["4\n1 1\n2 2\n3 3\n4 4", "4\n1 2\n2 3\n3 4\n4 1"]
2 seconds
["4", "0"]
null
Java 8
standard input
[ "brute force" ]
84bd49becca69e126606d5a2f764dd91
The first line contains integer n (1 ≀ n ≀ 100) β€” the number of bottles. The next n lines contain the bottles' description. The i-th line contains two integers ai, bi (1 ≀ ai, bi ≀ 1000) β€” the description of the i-th bottle.
1,400
In a single line print a single integer β€” the answer to the problem.
standard output
PASSED
beba8bc30d62e3bb1644fff88bd93ce0
train_001.jsonl
1370619000
Sereja and his friends went to a picnic. The guys had n soda bottles just for it. Sereja forgot the bottle opener as usual, so the guys had to come up with another way to open bottles.Sereja knows that the i-th bottle is from brand ai, besides, you can use it to open other bottles of brand bi. You can use one bottle to...
256 megabytes
import java.util.Scanner; public class SerejaAndBottles { public static void main(String[] args) { Scanner in=new Scanner(System.in); int n=in.nextInt();int[] a=new int[n];int[] b=new int[n]; for(int i=0;i<n;i++){ a[i]=in.nextInt();b[i]=in.nextInt(); } for(int i...
Java
["4\n1 1\n2 2\n3 3\n4 4", "4\n1 2\n2 3\n3 4\n4 1"]
2 seconds
["4", "0"]
null
Java 8
standard input
[ "brute force" ]
84bd49becca69e126606d5a2f764dd91
The first line contains integer n (1 ≀ n ≀ 100) β€” the number of bottles. The next n lines contain the bottles' description. The i-th line contains two integers ai, bi (1 ≀ ai, bi ≀ 1000) β€” the description of the i-th bottle.
1,400
In a single line print a single integer β€” the answer to the problem.
standard output
PASSED
038bc4d95294b28a33641d6e88087c0d
train_001.jsonl
1370619000
Sereja and his friends went to a picnic. The guys had n soda bottles just for it. Sereja forgot the bottle opener as usual, so the guys had to come up with another way to open bottles.Sereja knows that the i-th bottle is from brand ai, besides, you can use it to open other bottles of brand bi. You can use one bottle to...
256 megabytes
import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; import java.io.PrintWriter; import java.util.ArrayList; import java.util.StringTokenizer; public class CF315A { static class Info{ int ai; int bi; Info(int ai,int bi){ this.ai = ai; ...
Java
["4\n1 1\n2 2\n3 3\n4 4", "4\n1 2\n2 3\n3 4\n4 1"]
2 seconds
["4", "0"]
null
Java 8
standard input
[ "brute force" ]
84bd49becca69e126606d5a2f764dd91
The first line contains integer n (1 ≀ n ≀ 100) β€” the number of bottles. The next n lines contain the bottles' description. The i-th line contains two integers ai, bi (1 ≀ ai, bi ≀ 1000) β€” the description of the i-th bottle.
1,400
In a single line print a single integer β€” the answer to the problem.
standard output
PASSED
e37f30e16fb492174413fe16133f9f4d
train_001.jsonl
1370619000
Sereja and his friends went to a picnic. The guys had n soda bottles just for it. Sereja forgot the bottle opener as usual, so the guys had to come up with another way to open bottles.Sereja knows that the i-th bottle is from brand ai, besides, you can use it to open other bottles of brand bi. You can use one bottle to...
256 megabytes
import java.util.Arrays; import java.util.HashMap; import java.util.HashSet; import java.util.Map; import java.util.Scanner; import java.util.Set; public class tbuttons { public static void main(String[] args) { Scanner in = new Scanner(System.in); int cnt=0; int t=in.nextInt(); S...
Java
["4\n1 1\n2 2\n3 3\n4 4", "4\n1 2\n2 3\n3 4\n4 1"]
2 seconds
["4", "0"]
null
Java 8
standard input
[ "brute force" ]
84bd49becca69e126606d5a2f764dd91
The first line contains integer n (1 ≀ n ≀ 100) β€” the number of bottles. The next n lines contain the bottles' description. The i-th line contains two integers ai, bi (1 ≀ ai, bi ≀ 1000) β€” the description of the i-th bottle.
1,400
In a single line print a single integer β€” the answer to the problem.
standard output
PASSED
eccfecb7d4bfd58e12095dc80510ea23
train_001.jsonl
1370619000
Sereja and his friends went to a picnic. The guys had n soda bottles just for it. Sereja forgot the bottle opener as usual, so the guys had to come up with another way to open bottles.Sereja knows that the i-th bottle is from brand ai, besides, you can use it to open other bottles of brand bi. You can use one bottle to...
256 megabytes
import java.util.*; public class Main{ public static void main(String[] args) { Scanner input=new Scanner(System.in); int n=input.nextInt(); int a[]=new int[n], b[]=new int[n]; int ans=0,i,j; for(i=0;i<n;i++) { a[i]=input.nextInt(); b[i]=inpu...
Java
["4\n1 1\n2 2\n3 3\n4 4", "4\n1 2\n2 3\n3 4\n4 1"]
2 seconds
["4", "0"]
null
Java 8
standard input
[ "brute force" ]
84bd49becca69e126606d5a2f764dd91
The first line contains integer n (1 ≀ n ≀ 100) β€” the number of bottles. The next n lines contain the bottles' description. The i-th line contains two integers ai, bi (1 ≀ ai, bi ≀ 1000) β€” the description of the i-th bottle.
1,400
In a single line print a single integer β€” the answer to the problem.
standard output
PASSED
0c19d8d478273a867fc3f944b4ac03d8
train_001.jsonl
1370619000
Sereja and his friends went to a picnic. The guys had n soda bottles just for it. Sereja forgot the bottle opener as usual, so the guys had to come up with another way to open bottles.Sereja knows that the i-th bottle is from brand ai, besides, you can use it to open other bottles of brand bi. You can use one bottle to...
256 megabytes
import java.util.Scanner; public class SerejaAndBottles { private static Scanner input; public static void main(String[] args) { input = new Scanner(System.in); int bottleN, openableBottles = 0; bottleN = input.nextInt(); int[] mainBottle = new int[bottleN]; int[] openableBottle = new int[bottleN]; ...
Java
["4\n1 1\n2 2\n3 3\n4 4", "4\n1 2\n2 3\n3 4\n4 1"]
2 seconds
["4", "0"]
null
Java 8
standard input
[ "brute force" ]
84bd49becca69e126606d5a2f764dd91
The first line contains integer n (1 ≀ n ≀ 100) β€” the number of bottles. The next n lines contain the bottles' description. The i-th line contains two integers ai, bi (1 ≀ ai, bi ≀ 1000) β€” the description of the i-th bottle.
1,400
In a single line print a single integer β€” the answer to the problem.
standard output
PASSED
ba80f5b4064ed9451b9bdbe75b6365ea
train_001.jsonl
1370619000
Sereja and his friends went to a picnic. The guys had n soda bottles just for it. Sereja forgot the bottle opener as usual, so the guys had to come up with another way to open bottles.Sereja knows that the i-th bottle is from brand ai, besides, you can use it to open other bottles of brand bi. You can use one bottle to...
256 megabytes
import java.io.*; import java.util.StringTokenizer; //solution classes here public class Code { //main solution here static Scanner sc = new Scanner(System.in); static PrintWriter out = new PrintWriter(System.out); public static void main(String[] args) throws IOException { int n=sc.nextI...
Java
["4\n1 1\n2 2\n3 3\n4 4", "4\n1 2\n2 3\n3 4\n4 1"]
2 seconds
["4", "0"]
null
Java 8
standard input
[ "brute force" ]
84bd49becca69e126606d5a2f764dd91
The first line contains integer n (1 ≀ n ≀ 100) β€” the number of bottles. The next n lines contain the bottles' description. The i-th line contains two integers ai, bi (1 ≀ ai, bi ≀ 1000) β€” the description of the i-th bottle.
1,400
In a single line print a single integer β€” the answer to the problem.
standard output
PASSED
3c966c2d4ac7b454a0a12c4164c42e38
train_001.jsonl
1370619000
Sereja and his friends went to a picnic. The guys had n soda bottles just for it. Sereja forgot the bottle opener as usual, so the guys had to come up with another way to open bottles.Sereja knows that the i-th bottle is from brand ai, besides, you can use it to open other bottles of brand bi. You can use one bottle to...
256 megabytes
import java.util.Arrays; import java.util.Scanner; public class Main{ public static void main(String args[]){ Scanner pew = new Scanner(System.in); int n = pew.nextInt(); int a[] = new int[n]; int b[] = new int[n]; for(int i = 0 ; i<n; i++){ a[i] = pew.nextInt(); b[i] = pew.nextInt()...
Java
["4\n1 1\n2 2\n3 3\n4 4", "4\n1 2\n2 3\n3 4\n4 1"]
2 seconds
["4", "0"]
null
Java 8
standard input
[ "brute force" ]
84bd49becca69e126606d5a2f764dd91
The first line contains integer n (1 ≀ n ≀ 100) β€” the number of bottles. The next n lines contain the bottles' description. The i-th line contains two integers ai, bi (1 ≀ ai, bi ≀ 1000) β€” the description of the i-th bottle.
1,400
In a single line print a single integer β€” the answer to the problem.
standard output
PASSED
7f44a7450d2ac145ad535f662368da0b
train_001.jsonl
1370619000
Sereja and his friends went to a picnic. The guys had n soda bottles just for it. Sereja forgot the bottle opener as usual, so the guys had to come up with another way to open bottles.Sereja knows that the i-th bottle is from brand ai, besides, you can use it to open other bottles of brand bi. You can use one bottle to...
256 megabytes
import java.util.Scanner; public class SerejaBottles { public static void main(String[] args) { Scanner in = new Scanner(System.in); int n=in.nextInt(); int a[] = new int[n]; int b[] = new int[n]; int open[] = new int[1001]; for (int i = 0; i < n; i++) { a[i] = in.nextInt();...
Java
["4\n1 1\n2 2\n3 3\n4 4", "4\n1 2\n2 3\n3 4\n4 1"]
2 seconds
["4", "0"]
null
Java 8
standard input
[ "brute force" ]
84bd49becca69e126606d5a2f764dd91
The first line contains integer n (1 ≀ n ≀ 100) β€” the number of bottles. The next n lines contain the bottles' description. The i-th line contains two integers ai, bi (1 ≀ ai, bi ≀ 1000) β€” the description of the i-th bottle.
1,400
In a single line print a single integer β€” the answer to the problem.
standard output
PASSED
5e0258524b18360c815e3e1539409064
train_001.jsonl
1370619000
Sereja and his friends went to a picnic. The guys had n soda bottles just for it. Sereja forgot the bottle opener as usual, so the guys had to come up with another way to open bottles.Sereja knows that the i-th bottle is from brand ai, besides, you can use it to open other bottles of brand bi. You can use one bottle to...
256 megabytes
import java.util.*; public class Sol1 { public static void main(String args[]) { Scanner in=new Scanner(System.in); int n,i,j,count; count=n=in.nextInt(); int a[]=new int[n]; int b[]=new int[n]; boolean visited[]=new boolean[n]; for(i=0;i<n;i++) { a[i]=in.nextInt(); b[i]=in.nextInt(); } for(...
Java
["4\n1 1\n2 2\n3 3\n4 4", "4\n1 2\n2 3\n3 4\n4 1"]
2 seconds
["4", "0"]
null
Java 8
standard input
[ "brute force" ]
84bd49becca69e126606d5a2f764dd91
The first line contains integer n (1 ≀ n ≀ 100) β€” the number of bottles. The next n lines contain the bottles' description. The i-th line contains two integers ai, bi (1 ≀ ai, bi ≀ 1000) β€” the description of the i-th bottle.
1,400
In a single line print a single integer β€” the answer to the problem.
standard output
PASSED
15a466ca18f3678c82f8d8d952429ce8
train_001.jsonl
1370619000
Sereja and his friends went to a picnic. The guys had n soda bottles just for it. Sereja forgot the bottle opener as usual, so the guys had to come up with another way to open bottles.Sereja knows that the i-th bottle is from brand ai, besides, you can use it to open other bottles of brand bi. You can use one bottle to...
256 megabytes
import java.io.BufferedReader; import java.io.BufferedWriter; import java.io.IOException; import java.io.InputStream; import java.util.ArrayList; import java.util.Arrays; import java.util.Collections; import java.util.HashMap; import java.util.LinkedList; import java.util.Queue; import java.io.InputStreamReader; import...
Java
["4\n1 1\n2 2\n3 3\n4 4", "4\n1 2\n2 3\n3 4\n4 1"]
2 seconds
["4", "0"]
null
Java 8
standard input
[ "brute force" ]
84bd49becca69e126606d5a2f764dd91
The first line contains integer n (1 ≀ n ≀ 100) β€” the number of bottles. The next n lines contain the bottles' description. The i-th line contains two integers ai, bi (1 ≀ ai, bi ≀ 1000) β€” the description of the i-th bottle.
1,400
In a single line print a single integer β€” the answer to the problem.
standard output
PASSED
33140eb7fb37d0b8137158d291aa4077
train_001.jsonl
1370619000
Sereja and his friends went to a picnic. The guys had n soda bottles just for it. Sereja forgot the bottle opener as usual, so the guys had to come up with another way to open bottles.Sereja knows that the i-th bottle is from brand ai, besides, you can use it to open other bottles of brand bi. You can use one bottle to...
256 megabytes
// package Practice.CF315; import java.util.ArrayList; import java.util.HashMap; import java.util.Scanner; public class CF315A { public static void main(String[] args) { Scanner s = new Scanner(System.in); int n = s.nextInt(); HashMap<Integer, ArrayList<Integer>> map = new HashMap<>(); ...
Java
["4\n1 1\n2 2\n3 3\n4 4", "4\n1 2\n2 3\n3 4\n4 1"]
2 seconds
["4", "0"]
null
Java 8
standard input
[ "brute force" ]
84bd49becca69e126606d5a2f764dd91
The first line contains integer n (1 ≀ n ≀ 100) β€” the number of bottles. The next n lines contain the bottles' description. The i-th line contains two integers ai, bi (1 ≀ ai, bi ≀ 1000) β€” the description of the i-th bottle.
1,400
In a single line print a single integer β€” the answer to the problem.
standard output
PASSED
ac01b58ab3a157d3181833284262cba7
train_001.jsonl
1370619000
Sereja and his friends went to a picnic. The guys had n soda bottles just for it. Sereja forgot the bottle opener as usual, so the guys had to come up with another way to open bottles.Sereja knows that the i-th bottle is from brand ai, besides, you can use it to open other bottles of brand bi. You can use one bottle to...
256 megabytes
import java.io.BufferedReader; import java.io.IOException; import java.io.InputStream; import java.io.InputStreamReader; import java.util.StringTokenizer; public class CodeForce187A { public static void main(String[] args) throws IOException { InputStream inputStream = System.in; BufferedReader in = new Buffer...
Java
["4\n1 1\n2 2\n3 3\n4 4", "4\n1 2\n2 3\n3 4\n4 1"]
2 seconds
["4", "0"]
null
Java 6
standard input
[ "brute force" ]
84bd49becca69e126606d5a2f764dd91
The first line contains integer n (1 ≀ n ≀ 100) β€” the number of bottles. The next n lines contain the bottles' description. The i-th line contains two integers ai, bi (1 ≀ ai, bi ≀ 1000) β€” the description of the i-th bottle.
1,400
In a single line print a single integer β€” the answer to the problem.
standard output
PASSED
553bebc950cae3b3f09fee0bd67f75fa
train_001.jsonl
1370619000
Sereja and his friends went to a picnic. The guys had n soda bottles just for it. Sereja forgot the bottle opener as usual, so the guys had to come up with another way to open bottles.Sereja knows that the i-th bottle is from brand ai, besides, you can use it to open other bottles of brand bi. You can use one bottle to...
256 megabytes
import java.io.BufferedReader; import java.io.InputStreamReader; public class Main { public static void main(String[] args) throws Exception { InputStreamReader in = new InputStreamReader(System.in); BufferedReader reader = new BufferedReader(in); int n = Integer.parseInt(reader.readLine()); int[] openabl...
Java
["4\n1 1\n2 2\n3 3\n4 4", "4\n1 2\n2 3\n3 4\n4 1"]
2 seconds
["4", "0"]
null
Java 6
standard input
[ "brute force" ]
84bd49becca69e126606d5a2f764dd91
The first line contains integer n (1 ≀ n ≀ 100) β€” the number of bottles. The next n lines contain the bottles' description. The i-th line contains two integers ai, bi (1 ≀ ai, bi ≀ 1000) β€” the description of the i-th bottle.
1,400
In a single line print a single integer β€” the answer to the problem.
standard output
PASSED
3b73c8a87326c1e8a712434a738c5767
train_001.jsonl
1370619000
Sereja and his friends went to a picnic. The guys had n soda bottles just for it. Sereja forgot the bottle opener as usual, so the guys had to come up with another way to open bottles.Sereja knows that the i-th bottle is from brand ai, besides, you can use it to open other bottles of brand bi. You can use one bottle to...
256 megabytes
import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner lectura = new Scanner(System.in); int[] type; int[] canopen; int[] opened; while(lectura.hasNext()) { int number = lectura.nextInt(); type = new int...
Java
["4\n1 1\n2 2\n3 3\n4 4", "4\n1 2\n2 3\n3 4\n4 1"]
2 seconds
["4", "0"]
null
Java 6
standard input
[ "brute force" ]
84bd49becca69e126606d5a2f764dd91
The first line contains integer n (1 ≀ n ≀ 100) β€” the number of bottles. The next n lines contain the bottles' description. The i-th line contains two integers ai, bi (1 ≀ ai, bi ≀ 1000) β€” the description of the i-th bottle.
1,400
In a single line print a single integer β€” the answer to the problem.
standard output
PASSED
e71817261a0ffcaf7c610d8f03777e76
train_001.jsonl
1370619000
Sereja and his friends went to a picnic. The guys had n soda bottles just for it. Sereja forgot the bottle opener as usual, so the guys had to come up with another way to open bottles.Sereja knows that the i-th bottle is from brand ai, besides, you can use it to open other bottles of brand bi. You can use one bottle to...
256 megabytes
import java.io.BufferedReader; import java.io.InputStreamReader; public class P315A { public static void main(String[] args) { try { BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); int n = Integer.parseInt(br.readLine().trim()); //1-100 ...
Java
["4\n1 1\n2 2\n3 3\n4 4", "4\n1 2\n2 3\n3 4\n4 1"]
2 seconds
["4", "0"]
null
Java 6
standard input
[ "brute force" ]
84bd49becca69e126606d5a2f764dd91
The first line contains integer n (1 ≀ n ≀ 100) β€” the number of bottles. The next n lines contain the bottles' description. The i-th line contains two integers ai, bi (1 ≀ ai, bi ≀ 1000) β€” the description of the i-th bottle.
1,400
In a single line print a single integer β€” the answer to the problem.
standard output
PASSED
d46fa03db9e1274a42decf8d95378ea9
train_001.jsonl
1370619000
Sereja and his friends went to a picnic. The guys had n soda bottles just for it. Sereja forgot the bottle opener as usual, so the guys had to come up with another way to open bottles.Sereja knows that the i-th bottle is from brand ai, besides, you can use it to open other bottles of brand bi. You can use one bottle to...
256 megabytes
import java.io.PrintWriter; import java.util.ArrayList; import java.util.List; import java.util.Scanner; public class C187D2A { public static void main(String[] args) { Scanner in = new Scanner(System.in); PrintWriter out = new PrintWriter(System.out); int n = in.nextInt(); ...
Java
["4\n1 1\n2 2\n3 3\n4 4", "4\n1 2\n2 3\n3 4\n4 1"]
2 seconds
["4", "0"]
null
Java 6
standard input
[ "brute force" ]
84bd49becca69e126606d5a2f764dd91
The first line contains integer n (1 ≀ n ≀ 100) β€” the number of bottles. The next n lines contain the bottles' description. The i-th line contains two integers ai, bi (1 ≀ ai, bi ≀ 1000) β€” the description of the i-th bottle.
1,400
In a single line print a single integer β€” the answer to the problem.
standard output
PASSED
49ed5b4d8f82fed30e76b888eb427ef7
train_001.jsonl
1370619000
Sereja and his friends went to a picnic. The guys had n soda bottles just for it. Sereja forgot the bottle opener as usual, so the guys had to come up with another way to open bottles.Sereja knows that the i-th bottle is from brand ai, besides, you can use it to open other bottles of brand bi. You can use one bottle to...
256 megabytes
import java.util.Scanner; public class SerejaAndBottles { public static void main(String[] args) { Scanner scanner = new Scanner(System.in); int n = scanner.nextInt(); int a[] = new int[n]; int b[] = new int[n]; for (int i = 0; i < n; i++) { a[i] = scanner....
Java
["4\n1 1\n2 2\n3 3\n4 4", "4\n1 2\n2 3\n3 4\n4 1"]
2 seconds
["4", "0"]
null
Java 6
standard input
[ "brute force" ]
84bd49becca69e126606d5a2f764dd91
The first line contains integer n (1 ≀ n ≀ 100) β€” the number of bottles. The next n lines contain the bottles' description. The i-th line contains two integers ai, bi (1 ≀ ai, bi ≀ 1000) β€” the description of the i-th bottle.
1,400
In a single line print a single integer β€” the answer to the problem.
standard output
PASSED
9143c8f1a364b52c02eb92b1d2e27bb3
train_001.jsonl
1370619000
Sereja and his friends went to a picnic. The guys had n soda bottles just for it. Sereja forgot the bottle opener as usual, so the guys had to come up with another way to open bottles.Sereja knows that the i-th bottle is from brand ai, besides, you can use it to open other bottles of brand bi. You can use one bottle to...
256 megabytes
import java.io.InputStream; import java.io.PrintStream; import java.util.Scanner; public class ProblemA { public static void main(String[] args) { ProblemA problem = new ProblemA(); problem.solve(System.in, System.out); } public void solve(InputStream in, PrintStream out) { Scanner scan = new Scanner(in); ...
Java
["4\n1 1\n2 2\n3 3\n4 4", "4\n1 2\n2 3\n3 4\n4 1"]
2 seconds
["4", "0"]
null
Java 6
standard input
[ "brute force" ]
84bd49becca69e126606d5a2f764dd91
The first line contains integer n (1 ≀ n ≀ 100) β€” the number of bottles. The next n lines contain the bottles' description. The i-th line contains two integers ai, bi (1 ≀ ai, bi ≀ 1000) β€” the description of the i-th bottle.
1,400
In a single line print a single integer β€” the answer to the problem.
standard output
PASSED
20ed282f430b8c7c2288042f63c41a11
train_001.jsonl
1370619000
Sereja and his friends went to a picnic. The guys had n soda bottles just for it. Sereja forgot the bottle opener as usual, so the guys had to come up with another way to open bottles.Sereja knows that the i-th bottle is from brand ai, besides, you can use it to open other bottles of brand bi. You can use one bottle to...
256 megabytes
import java.util.ArrayList; import java.util.HashMap; import java.util.HashSet; import java.util.Iterator; import java.util.Map; import java.util.Scanner; public class A { public static void main(String[] args) { Scanner s = new Scanner(System.in); int n = s.nextInt(); int[] x = new int[n...
Java
["4\n1 1\n2 2\n3 3\n4 4", "4\n1 2\n2 3\n3 4\n4 1"]
2 seconds
["4", "0"]
null
Java 6
standard input
[ "brute force" ]
84bd49becca69e126606d5a2f764dd91
The first line contains integer n (1 ≀ n ≀ 100) β€” the number of bottles. The next n lines contain the bottles' description. The i-th line contains two integers ai, bi (1 ≀ ai, bi ≀ 1000) β€” the description of the i-th bottle.
1,400
In a single line print a single integer β€” the answer to the problem.
standard output
PASSED
68591b43f537358d5e7668be4cb9c2fc
train_001.jsonl
1370619000
Sereja and his friends went to a picnic. The guys had n soda bottles just for it. Sereja forgot the bottle opener as usual, so the guys had to come up with another way to open bottles.Sereja knows that the i-th bottle is from brand ai, besides, you can use it to open other bottles of brand bi. You can use one bottle to...
256 megabytes
import java.util.HashSet; import java.util.Scanner; import java.util.Set; public class SerejaAndBottles { public int solve(int[][] input) { Set<Integer> cur = new HashSet<Integer>(); int count = 0 ; for(int i = 0 ; i < input.length ; i++){ for(int j = 0 ; j < input.le...
Java
["4\n1 1\n2 2\n3 3\n4 4", "4\n1 2\n2 3\n3 4\n4 1"]
2 seconds
["4", "0"]
null
Java 6
standard input
[ "brute force" ]
84bd49becca69e126606d5a2f764dd91
The first line contains integer n (1 ≀ n ≀ 100) β€” the number of bottles. The next n lines contain the bottles' description. The i-th line contains two integers ai, bi (1 ≀ ai, bi ≀ 1000) β€” the description of the i-th bottle.
1,400
In a single line print a single integer β€” the answer to the problem.
standard output
PASSED
82f511b79187b5a33c5fc2935d64874a
train_001.jsonl
1370619000
Sereja and his friends went to a picnic. The guys had n soda bottles just for it. Sereja forgot the bottle opener as usual, so the guys had to come up with another way to open bottles.Sereja knows that the i-th bottle is from brand ai, besides, you can use it to open other bottles of brand bi. You can use one bottle to...
256 megabytes
import java.util.*; public class cf315a { public static void main(String[] args) { Scanner in = new Scanner(System.in); int n = in.nextInt(); int[] a = new int[n]; int[] b = new int[n]; int[] v = new int[n]; Arrays.fill(v, 1); for(int i=0; i<n; i++) { a[i] = in.nextInt(); b[i] ...
Java
["4\n1 1\n2 2\n3 3\n4 4", "4\n1 2\n2 3\n3 4\n4 1"]
2 seconds
["4", "0"]
null
Java 6
standard input
[ "brute force" ]
84bd49becca69e126606d5a2f764dd91
The first line contains integer n (1 ≀ n ≀ 100) β€” the number of bottles. The next n lines contain the bottles' description. The i-th line contains two integers ai, bi (1 ≀ ai, bi ≀ 1000) β€” the description of the i-th bottle.
1,400
In a single line print a single integer β€” the answer to the problem.
standard output
PASSED
e98bfd1a1ca203a5f0935972823b05fa
train_001.jsonl
1370619000
Sereja and his friends went to a picnic. The guys had n soda bottles just for it. Sereja forgot the bottle opener as usual, so the guys had to come up with another way to open bottles.Sereja knows that the i-th bottle is from brand ai, besides, you can use it to open other bottles of brand bi. You can use one bottle to...
256 megabytes
import java.awt.*; import java.awt.event.*; import java.awt.geom.*; import java.io.*; import java.math.*; import java.text.*; import java.util.*; /* br = new BufferedReader(new FileReader("input.txt")); pw = new PrintWriter(new BufferedWriter(new FileWriter("output.txt"))); br = new BufferedReader(new InputStreamReade...
Java
["4\n1 1\n2 2\n3 3\n4 4", "4\n1 2\n2 3\n3 4\n4 1"]
2 seconds
["4", "0"]
null
Java 6
standard input
[ "brute force" ]
84bd49becca69e126606d5a2f764dd91
The first line contains integer n (1 ≀ n ≀ 100) β€” the number of bottles. The next n lines contain the bottles' description. The i-th line contains two integers ai, bi (1 ≀ ai, bi ≀ 1000) β€” the description of the i-th bottle.
1,400
In a single line print a single integer β€” the answer to the problem.
standard output
PASSED
3d3c7480af074237ec2d5341194b4273
train_001.jsonl
1370619000
Sereja and his friends went to a picnic. The guys had n soda bottles just for it. Sereja forgot the bottle opener as usual, so the guys had to come up with another way to open bottles.Sereja knows that the i-th bottle is from brand ai, besides, you can use it to open other bottles of brand bi. You can use one bottle to...
256 megabytes
import java.util.*; import java.io.*; public class Main { BufferedReader in; StringTokenizer str = null; PrintWriter out; private String next() throws Exception{ if (str == null || !str.hasMoreElements()) str = new StringTokenizer(in.readLine()); return str.nextToken(); } private int nextInt() throws...
Java
["4\n1 1\n2 2\n3 3\n4 4", "4\n1 2\n2 3\n3 4\n4 1"]
2 seconds
["4", "0"]
null
Java 6
standard input
[ "brute force" ]
84bd49becca69e126606d5a2f764dd91
The first line contains integer n (1 ≀ n ≀ 100) β€” the number of bottles. The next n lines contain the bottles' description. The i-th line contains two integers ai, bi (1 ≀ ai, bi ≀ 1000) β€” the description of the i-th bottle.
1,400
In a single line print a single integer β€” the answer to the problem.
standard output
PASSED
59c394f24333cf9fc5d39111c5cdb01d
train_001.jsonl
1370619000
Sereja and his friends went to a picnic. The guys had n soda bottles just for it. Sereja forgot the bottle opener as usual, so the guys had to come up with another way to open bottles.Sereja knows that the i-th bottle is from brand ai, besides, you can use it to open other bottles of brand bi. You can use one bottle to...
256 megabytes
import java.util.Scanner; public class A { static Scanner sc=new Scanner(System.in); public static void main(String[] args) { int n=sc.nextInt(); int v[][]=new int [n][2]; for (int i = 0; i < n; i++) { v[i][0]=sc.nextInt(); v[i][1]=sc.nextInt(); } int res[]=new int[n]; int r=n; for (int i...
Java
["4\n1 1\n2 2\n3 3\n4 4", "4\n1 2\n2 3\n3 4\n4 1"]
2 seconds
["4", "0"]
null
Java 6
standard input
[ "brute force" ]
84bd49becca69e126606d5a2f764dd91
The first line contains integer n (1 ≀ n ≀ 100) β€” the number of bottles. The next n lines contain the bottles' description. The i-th line contains two integers ai, bi (1 ≀ ai, bi ≀ 1000) β€” the description of the i-th bottle.
1,400
In a single line print a single integer β€” the answer to the problem.
standard output
PASSED
35495c9eac4fd420ba8bc5f712e9a603
train_001.jsonl
1370619000
Sereja and his friends went to a picnic. The guys had n soda bottles just for it. Sereja forgot the bottle opener as usual, so the guys had to come up with another way to open bottles.Sereja knows that the i-th bottle is from brand ai, besides, you can use it to open other bottles of brand bi. You can use one bottle to...
256 megabytes
import static java.lang.Math.*; import static java.util.Arrays.*; import static java.util.Collections.*; import java.io.*; import java.math.*; import java.util.*; @SuppressWarnings("unused") public class A { public static void main(String[] args) throws Exception { Scanner in = new Scanner(System.in); int n = in....
Java
["4\n1 1\n2 2\n3 3\n4 4", "4\n1 2\n2 3\n3 4\n4 1"]
2 seconds
["4", "0"]
null
Java 6
standard input
[ "brute force" ]
84bd49becca69e126606d5a2f764dd91
The first line contains integer n (1 ≀ n ≀ 100) β€” the number of bottles. The next n lines contain the bottles' description. The i-th line contains two integers ai, bi (1 ≀ ai, bi ≀ 1000) β€” the description of the i-th bottle.
1,400
In a single line print a single integer β€” the answer to the problem.
standard output
PASSED
a9a973d603406545c3bd89da05a34e4b
train_001.jsonl
1370619000
Sereja and his friends went to a picnic. The guys had n soda bottles just for it. Sereja forgot the bottle opener as usual, so the guys had to come up with another way to open bottles.Sereja knows that the i-th bottle is from brand ai, besides, you can use it to open other bottles of brand bi. You can use one bottle to...
256 megabytes
import java.util.Scanner; public class probA { public static void main (String []args) { Scanner bahy = new Scanner(System.in); int n=bahy.nextInt(); int [][]a=new int[n][2]; boolean []b=new boolean[n]; for(int i=0;i<n;i++) { a[i][0]=bahy.nextInt(); a[i][1]=bahy.nextInt(); } for(int i=0;i<n;i++...
Java
["4\n1 1\n2 2\n3 3\n4 4", "4\n1 2\n2 3\n3 4\n4 1"]
2 seconds
["4", "0"]
null
Java 6
standard input
[ "brute force" ]
84bd49becca69e126606d5a2f764dd91
The first line contains integer n (1 ≀ n ≀ 100) β€” the number of bottles. The next n lines contain the bottles' description. The i-th line contains two integers ai, bi (1 ≀ ai, bi ≀ 1000) β€” the description of the i-th bottle.
1,400
In a single line print a single integer β€” the answer to the problem.
standard output
PASSED
ad984c04206f6c688a11768245ab743b
train_001.jsonl
1474119900
ZS the Coder is playing a game. There is a number displayed on the screen and there are two buttons, ' + ' (plus) and '' (square root). Initially, the number 2 is displayed on the screen. There are n + 1 levels in the game and ZS the Coder start at the level 1.When ZS the Coder is at level k, he can : Press the ' + ' ...
256 megabytes
import java.io.*; import java.util.StringTokenizer; public class Main { public static void main(String[] args) { InputReader in = new InputReader(System.in); PrintWriter out = new PrintWriter(System.out); Solution solver = new Solution(); solver.solve(in, out); out.close(); ...
Java
["3", "2", "4"]
2 seconds
["14\n16\n46", "999999999999999998\n44500000000", "2\n17\n46\n97"]
NoteIn the first sample case:On the first level, ZS the Coder pressed the ' + ' button 14 times (and the number on screen is initially 2), so the number became 2 + 14Β·1 = 16. Then, ZS the Coder pressed the '' button, and the number became . After that, on the second level, ZS pressed the ' + ' button 16 times, so the n...
Java 8
standard input
[ "constructive algorithms", "math" ]
6264405c66b2690ada9f8cc6cff55f0b
The first and only line of the input contains a single integer n (1 ≀ n ≀ 100 000), denoting that ZS the Coder wants to reach level n + 1.
1,600
Print n non-negative integers, one per line. i-th of them should be equal to the number of times that ZS the Coder needs to press the ' + ' button before pressing the '' button at level i. Each number in the output should not exceed 1018. However, the number on the screen can be greater than 1018. It is guaranteed tha...
standard output
PASSED
aa91e7ed6e9a0f7362dac5a1e0c938de
train_001.jsonl
1474119900
ZS the Coder is playing a game. There is a number displayed on the screen and there are two buttons, ' + ' (plus) and '' (square root). Initially, the number 2 is displayed on the screen. There are n + 1 levels in the game and ZS the Coder start at the level 1.When ZS the Coder is at level k, he can : Press the ' + ' ...
256 megabytes
import java.io.*; import java.math.BigInteger; import java.util.*; public class A { public static void solution(BufferedReader reader, PrintWriter out) throws IOException { In in = new In(reader); BigInteger N = new BigInteger(in.next()); BigInteger num = new BigInteger("2"); ...
Java
["3", "2", "4"]
2 seconds
["14\n16\n46", "999999999999999998\n44500000000", "2\n17\n46\n97"]
NoteIn the first sample case:On the first level, ZS the Coder pressed the ' + ' button 14 times (and the number on screen is initially 2), so the number became 2 + 14Β·1 = 16. Then, ZS the Coder pressed the '' button, and the number became . After that, on the second level, ZS pressed the ' + ' button 16 times, so the n...
Java 8
standard input
[ "constructive algorithms", "math" ]
6264405c66b2690ada9f8cc6cff55f0b
The first and only line of the input contains a single integer n (1 ≀ n ≀ 100 000), denoting that ZS the Coder wants to reach level n + 1.
1,600
Print n non-negative integers, one per line. i-th of them should be equal to the number of times that ZS the Coder needs to press the ' + ' button before pressing the '' button at level i. Each number in the output should not exceed 1018. However, the number on the screen can be greater than 1018. It is guaranteed tha...
standard output
PASSED
4b5bc27fc4bb64a0032b385ef1b15fa6
train_001.jsonl
1474119900
ZS the Coder is playing a game. There is a number displayed on the screen and there are two buttons, ' + ' (plus) and '' (square root). Initially, the number 2 is displayed on the screen. There are n + 1 levels in the game and ZS the Coder start at the level 1.When ZS the Coder is at level k, he can : Press the ' + ' ...
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 */ public class Main { public static...
Java
["3", "2", "4"]
2 seconds
["14\n16\n46", "999999999999999998\n44500000000", "2\n17\n46\n97"]
NoteIn the first sample case:On the first level, ZS the Coder pressed the ' + ' button 14 times (and the number on screen is initially 2), so the number became 2 + 14Β·1 = 16. Then, ZS the Coder pressed the '' button, and the number became . After that, on the second level, ZS pressed the ' + ' button 16 times, so the n...
Java 8
standard input
[ "constructive algorithms", "math" ]
6264405c66b2690ada9f8cc6cff55f0b
The first and only line of the input contains a single integer n (1 ≀ n ≀ 100 000), denoting that ZS the Coder wants to reach level n + 1.
1,600
Print n non-negative integers, one per line. i-th of them should be equal to the number of times that ZS the Coder needs to press the ' + ' button before pressing the '' button at level i. Each number in the output should not exceed 1018. However, the number on the screen can be greater than 1018. It is guaranteed tha...
standard output
PASSED
ecc5b25eb87ce5378b3e1d07bda4ac5d
train_001.jsonl
1474119900
ZS the Coder is playing a game. There is a number displayed on the screen and there are two buttons, ' + ' (plus) and '' (square root). Initially, the number 2 is displayed on the screen. There are n + 1 levels in the game and ZS the Coder start at the level 1.When ZS the Coder is at level k, he can : Press the ' + ' ...
256 megabytes
import java.util.Scanner; /** * Created by anna on 17.09.16. */ public class cf3 { private static Scanner is = new Scanner(System.in); public static long isSquare(long n) { double sq = Math.sqrt(n); if ((long)sq*(long)sq == n) return (long)sq; else return -1; } public static ...
Java
["3", "2", "4"]
2 seconds
["14\n16\n46", "999999999999999998\n44500000000", "2\n17\n46\n97"]
NoteIn the first sample case:On the first level, ZS the Coder pressed the ' + ' button 14 times (and the number on screen is initially 2), so the number became 2 + 14Β·1 = 16. Then, ZS the Coder pressed the '' button, and the number became . After that, on the second level, ZS pressed the ' + ' button 16 times, so the n...
Java 8
standard input
[ "constructive algorithms", "math" ]
6264405c66b2690ada9f8cc6cff55f0b
The first and only line of the input contains a single integer n (1 ≀ n ≀ 100 000), denoting that ZS the Coder wants to reach level n + 1.
1,600
Print n non-negative integers, one per line. i-th of them should be equal to the number of times that ZS the Coder needs to press the ' + ' button before pressing the '' button at level i. Each number in the output should not exceed 1018. However, the number on the screen can be greater than 1018. It is guaranteed tha...
standard output
PASSED
0db70187a6b6726498bdfb2aa290c66c
train_001.jsonl
1474119900
ZS the Coder is playing a game. There is a number displayed on the screen and there are two buttons, ' + ' (plus) and '' (square root). Initially, the number 2 is displayed on the screen. There are n + 1 levels in the game and ZS the Coder start at the level 1.When ZS the Coder is at level k, he can : Press the ' + ' ...
256 megabytes
import java.util.Scanner; /** * Created by anna on 17.09.16. */ public class cf3 { private static Scanner is = new Scanner(System.in); public static long isSquare(long n) { double sq = Math.sqrt(n); if ((long)sq*(long)sq == n) return (long)sq; else return -1; } public static ...
Java
["3", "2", "4"]
2 seconds
["14\n16\n46", "999999999999999998\n44500000000", "2\n17\n46\n97"]
NoteIn the first sample case:On the first level, ZS the Coder pressed the ' + ' button 14 times (and the number on screen is initially 2), so the number became 2 + 14Β·1 = 16. Then, ZS the Coder pressed the '' button, and the number became . After that, on the second level, ZS pressed the ' + ' button 16 times, so the n...
Java 8
standard input
[ "constructive algorithms", "math" ]
6264405c66b2690ada9f8cc6cff55f0b
The first and only line of the input contains a single integer n (1 ≀ n ≀ 100 000), denoting that ZS the Coder wants to reach level n + 1.
1,600
Print n non-negative integers, one per line. i-th of them should be equal to the number of times that ZS the Coder needs to press the ' + ' button before pressing the '' button at level i. Each number in the output should not exceed 1018. However, the number on the screen can be greater than 1018. It is guaranteed tha...
standard output
PASSED
c1c2695e795bf8b3f2e0f9f6f3d25c48
train_001.jsonl
1474119900
ZS the Coder is playing a game. There is a number displayed on the screen and there are two buttons, ' + ' (plus) and '' (square root). Initially, the number 2 is displayed on the screen. There are n + 1 levels in the game and ZS the Coder start at the level 1.When ZS the Coder is at level k, he can : Press the ' + ' ...
256 megabytes
//package codeForces; import java.util.*; public class codeTest { public static void main(String args[]){ Scanner sc = new Scanner(System.in); long n = sc.nextInt(); System.out.println("2"); for(long i=2;i<=n;i++){ System.out.println(i*(i+1)*(i+1)-i+1); } } }
Java
["3", "2", "4"]
2 seconds
["14\n16\n46", "999999999999999998\n44500000000", "2\n17\n46\n97"]
NoteIn the first sample case:On the first level, ZS the Coder pressed the ' + ' button 14 times (and the number on screen is initially 2), so the number became 2 + 14Β·1 = 16. Then, ZS the Coder pressed the '' button, and the number became . After that, on the second level, ZS pressed the ' + ' button 16 times, so the n...
Java 8
standard input
[ "constructive algorithms", "math" ]
6264405c66b2690ada9f8cc6cff55f0b
The first and only line of the input contains a single integer n (1 ≀ n ≀ 100 000), denoting that ZS the Coder wants to reach level n + 1.
1,600
Print n non-negative integers, one per line. i-th of them should be equal to the number of times that ZS the Coder needs to press the ' + ' button before pressing the '' button at level i. Each number in the output should not exceed 1018. However, the number on the screen can be greater than 1018. It is guaranteed tha...
standard output
PASSED
d5bca24c91440cf365044c0799a0a009
train_001.jsonl
1474119900
ZS the Coder is playing a game. There is a number displayed on the screen and there are two buttons, ' + ' (plus) and '' (square root). Initially, the number 2 is displayed on the screen. There are n + 1 levels in the game and ZS the Coder start at the level 1.When ZS the Coder is at level k, he can : Press the ' + ' ...
256 megabytes
import java.io.*; import java.math.*; import java.util.*; import static java.util.Arrays.*; public class A { private static final int mod = (int)1e9+7; final Random random = new Random(0); final IOFast io = new IOFast(); /// MAIN CODE public void run() throws IOException { // int TEST_CASE = Integer.parseInt...
Java
["3", "2", "4"]
2 seconds
["14\n16\n46", "999999999999999998\n44500000000", "2\n17\n46\n97"]
NoteIn the first sample case:On the first level, ZS the Coder pressed the ' + ' button 14 times (and the number on screen is initially 2), so the number became 2 + 14Β·1 = 16. Then, ZS the Coder pressed the '' button, and the number became . After that, on the second level, ZS pressed the ' + ' button 16 times, so the n...
Java 8
standard input
[ "constructive algorithms", "math" ]
6264405c66b2690ada9f8cc6cff55f0b
The first and only line of the input contains a single integer n (1 ≀ n ≀ 100 000), denoting that ZS the Coder wants to reach level n + 1.
1,600
Print n non-negative integers, one per line. i-th of them should be equal to the number of times that ZS the Coder needs to press the ' + ' button before pressing the '' button at level i. Each number in the output should not exceed 1018. However, the number on the screen can be greater than 1018. It is guaranteed tha...
standard output
PASSED
ae494f1909d30164ca926c680437ebfa
train_001.jsonl
1474119900
ZS the Coder is playing a game. There is a number displayed on the screen and there are two buttons, ' + ' (plus) and '' (square root). Initially, the number 2 is displayed on the screen. There are n + 1 levels in the game and ZS the Coder start at the level 1.When ZS the Coder is at level k, he can : Press the ' + ' ...
256 megabytes
import java.util.*; import java.io.*; import java.math.BigInteger; public class mat { static class InputReader { private InputStream stream; private byte[] inbuf = new byte[1024]; private int start= 0; private int end = 0; public InputReader(InputStream stream) { ...
Java
["3", "2", "4"]
2 seconds
["14\n16\n46", "999999999999999998\n44500000000", "2\n17\n46\n97"]
NoteIn the first sample case:On the first level, ZS the Coder pressed the ' + ' button 14 times (and the number on screen is initially 2), so the number became 2 + 14Β·1 = 16. Then, ZS the Coder pressed the '' button, and the number became . After that, on the second level, ZS pressed the ' + ' button 16 times, so the n...
Java 8
standard input
[ "constructive algorithms", "math" ]
6264405c66b2690ada9f8cc6cff55f0b
The first and only line of the input contains a single integer n (1 ≀ n ≀ 100 000), denoting that ZS the Coder wants to reach level n + 1.
1,600
Print n non-negative integers, one per line. i-th of them should be equal to the number of times that ZS the Coder needs to press the ' + ' button before pressing the '' button at level i. Each number in the output should not exceed 1018. However, the number on the screen can be greater than 1018. It is guaranteed tha...
standard output
PASSED
197c43e83e15c949da6d4331aecb4778
train_001.jsonl
1474119900
ZS the Coder is playing a game. There is a number displayed on the screen and there are two buttons, ' + ' (plus) and '' (square root). Initially, the number 2 is displayed on the screen. There are n + 1 levels in the game and ZS the Coder start at the level 1.When ZS the Coder is at level k, he can : Press the ' + ' ...
256 megabytes
import java.io.PrintWriter; import java.math.BigInteger; import java.util.Scanner; public class A { public static void main(String[] args) { Scanner in = new Scanner(System.in); PrintWriter out = new PrintWriter(System.out); long n = in.nextInt(); long k = 1; long val = 2; while(k <= n) { //long sqrt =...
Java
["3", "2", "4"]
2 seconds
["14\n16\n46", "999999999999999998\n44500000000", "2\n17\n46\n97"]
NoteIn the first sample case:On the first level, ZS the Coder pressed the ' + ' button 14 times (and the number on screen is initially 2), so the number became 2 + 14Β·1 = 16. Then, ZS the Coder pressed the '' button, and the number became . After that, on the second level, ZS pressed the ' + ' button 16 times, so the n...
Java 8
standard input
[ "constructive algorithms", "math" ]
6264405c66b2690ada9f8cc6cff55f0b
The first and only line of the input contains a single integer n (1 ≀ n ≀ 100 000), denoting that ZS the Coder wants to reach level n + 1.
1,600
Print n non-negative integers, one per line. i-th of them should be equal to the number of times that ZS the Coder needs to press the ' + ' button before pressing the '' button at level i. Each number in the output should not exceed 1018. However, the number on the screen can be greater than 1018. It is guaranteed tha...
standard output
PASSED
51a9d00dd20a3a733c4d05067c36b657
train_001.jsonl
1474119900
ZS the Coder is playing a game. There is a number displayed on the screen and there are two buttons, ' + ' (plus) and '' (square root). Initially, the number 2 is displayed on the screen. There are n + 1 levels in the game and ZS the Coder start at the level 1.When ZS the Coder is at level k, he can : Press the ' + ' ...
256 megabytes
import java.io.*; import java.math.*; import java.util.*; import java.util.stream.*; @SuppressWarnings("unchecked") public class P715A { public void run() throws Exception { BigInteger n = BigInteger.valueOf(nextInt()), v = BigInteger.valueOf(2); for (BigInteger l = BigInteger.ONE; l.compareTo(n) <= 0; l =...
Java
["3", "2", "4"]
2 seconds
["14\n16\n46", "999999999999999998\n44500000000", "2\n17\n46\n97"]
NoteIn the first sample case:On the first level, ZS the Coder pressed the ' + ' button 14 times (and the number on screen is initially 2), so the number became 2 + 14Β·1 = 16. Then, ZS the Coder pressed the '' button, and the number became . After that, on the second level, ZS pressed the ' + ' button 16 times, so the n...
Java 8
standard input
[ "constructive algorithms", "math" ]
6264405c66b2690ada9f8cc6cff55f0b
The first and only line of the input contains a single integer n (1 ≀ n ≀ 100 000), denoting that ZS the Coder wants to reach level n + 1.
1,600
Print n non-negative integers, one per line. i-th of them should be equal to the number of times that ZS the Coder needs to press the ' + ' button before pressing the '' button at level i. Each number in the output should not exceed 1018. However, the number on the screen can be greater than 1018. It is guaranteed tha...
standard output
PASSED
eac1758890fa72d0b24ff7971a594f92
train_001.jsonl
1474119900
ZS the Coder is playing a game. There is a number displayed on the screen and there are two buttons, ' + ' (plus) and '' (square root). Initially, the number 2 is displayed on the screen. There are n + 1 levels in the game and ZS the Coder start at the level 1.When ZS the Coder is at level k, he can : Press the ' + ' ...
256 megabytes
/* package whatever; // don't place package name! */ import java.util.*; import java.lang.*; import java.io.*; import java.math.*; /* Name of the class has to be "Main" only if the class is public. */ public class Main { public static void main (String[] args) throws java.lang.Exception { Scanner in = new Scanner...
Java
["3", "2", "4"]
2 seconds
["14\n16\n46", "999999999999999998\n44500000000", "2\n17\n46\n97"]
NoteIn the first sample case:On the first level, ZS the Coder pressed the ' + ' button 14 times (and the number on screen is initially 2), so the number became 2 + 14Β·1 = 16. Then, ZS the Coder pressed the '' button, and the number became . After that, on the second level, ZS pressed the ' + ' button 16 times, so the n...
Java 8
standard input
[ "constructive algorithms", "math" ]
6264405c66b2690ada9f8cc6cff55f0b
The first and only line of the input contains a single integer n (1 ≀ n ≀ 100 000), denoting that ZS the Coder wants to reach level n + 1.
1,600
Print n non-negative integers, one per line. i-th of them should be equal to the number of times that ZS the Coder needs to press the ' + ' button before pressing the '' button at level i. Each number in the output should not exceed 1018. However, the number on the screen can be greater than 1018. It is guaranteed tha...
standard output
PASSED
b6e3bb9d33ce63d933cd2076b631a184
train_001.jsonl
1474119900
ZS the Coder is playing a game. There is a number displayed on the screen and there are two buttons, ' + ' (plus) and '' (square root). Initially, the number 2 is displayed on the screen. There are n + 1 levels in the game and ZS the Coder start at the level 1.When ZS the Coder is at level k, he can : Press the ' + ' ...
256 megabytes
import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; import java.io.PrintWriter; import java.util.*; public class C { private static final boolean TEST_CASES = false; private static class Solver { void solve(int testCaseNo) { int n = IO.nextInt(); for (int i = 1;...
Java
["3", "2", "4"]
2 seconds
["14\n16\n46", "999999999999999998\n44500000000", "2\n17\n46\n97"]
NoteIn the first sample case:On the first level, ZS the Coder pressed the ' + ' button 14 times (and the number on screen is initially 2), so the number became 2 + 14Β·1 = 16. Then, ZS the Coder pressed the '' button, and the number became . After that, on the second level, ZS pressed the ' + ' button 16 times, so the n...
Java 8
standard input
[ "constructive algorithms", "math" ]
6264405c66b2690ada9f8cc6cff55f0b
The first and only line of the input contains a single integer n (1 ≀ n ≀ 100 000), denoting that ZS the Coder wants to reach level n + 1.
1,600
Print n non-negative integers, one per line. i-th of them should be equal to the number of times that ZS the Coder needs to press the ' + ' button before pressing the '' button at level i. Each number in the output should not exceed 1018. However, the number on the screen can be greater than 1018. It is guaranteed tha...
standard output
PASSED
bc88a61ffb4a062c09f7adc402c519b1
train_001.jsonl
1474119900
ZS the Coder is playing a game. There is a number displayed on the screen and there are two buttons, ' + ' (plus) and '' (square root). Initially, the number 2 is displayed on the screen. There are n + 1 levels in the game and ZS the Coder start at the level 1.When ZS the Coder is at level k, he can : Press the ' + ' ...
256 megabytes
import java.io.*; import java.math.*; import java.util.*; /** * * @author Saju * */ public class Main { private static int dx[] = { 1, 0, -1, 0 }; private static int dy[] = { 0, -1, 0, 1 }; private static final long INF = (long) Math.pow(10, 16); private static final int INT_INF = Integer.MAX_VA...
Java
["3", "2", "4"]
2 seconds
["14\n16\n46", "999999999999999998\n44500000000", "2\n17\n46\n97"]
NoteIn the first sample case:On the first level, ZS the Coder pressed the ' + ' button 14 times (and the number on screen is initially 2), so the number became 2 + 14Β·1 = 16. Then, ZS the Coder pressed the '' button, and the number became . After that, on the second level, ZS pressed the ' + ' button 16 times, so the n...
Java 8
standard input
[ "constructive algorithms", "math" ]
6264405c66b2690ada9f8cc6cff55f0b
The first and only line of the input contains a single integer n (1 ≀ n ≀ 100 000), denoting that ZS the Coder wants to reach level n + 1.
1,600
Print n non-negative integers, one per line. i-th of them should be equal to the number of times that ZS the Coder needs to press the ' + ' button before pressing the '' button at level i. Each number in the output should not exceed 1018. However, the number on the screen can be greater than 1018. It is guaranteed tha...
standard output
PASSED
bc49592ab4815ad2cabe2add442572a3
train_001.jsonl
1474119900
ZS the Coder is playing a game. There is a number displayed on the screen and there are two buttons, ' + ' (plus) and '' (square root). Initially, the number 2 is displayed on the screen. There are n + 1 levels in the game and ZS the Coder start at the level 1.When ZS the Coder is at level k, he can : Press the ' + ' ...
256 megabytes
import java.util.Scanner; import java.math.*; public class Main { public static void main(String[] args) { Scanner sin = new Scanner(System.in); int n = sin.nextInt(); BigInteger plus; System.out.println(2); for(int i = 2; i < n + 1; i++){ plus = BigInteger.valueOf(i + 1); ...
Java
["3", "2", "4"]
2 seconds
["14\n16\n46", "999999999999999998\n44500000000", "2\n17\n46\n97"]
NoteIn the first sample case:On the first level, ZS the Coder pressed the ' + ' button 14 times (and the number on screen is initially 2), so the number became 2 + 14Β·1 = 16. Then, ZS the Coder pressed the '' button, and the number became . After that, on the second level, ZS pressed the ' + ' button 16 times, so the n...
Java 8
standard input
[ "constructive algorithms", "math" ]
6264405c66b2690ada9f8cc6cff55f0b
The first and only line of the input contains a single integer n (1 ≀ n ≀ 100 000), denoting that ZS the Coder wants to reach level n + 1.
1,600
Print n non-negative integers, one per line. i-th of them should be equal to the number of times that ZS the Coder needs to press the ' + ' button before pressing the '' button at level i. Each number in the output should not exceed 1018. However, the number on the screen can be greater than 1018. It is guaranteed tha...
standard output
PASSED
02c66c8bb8fab8ee96731e08a8eb74d9
train_001.jsonl
1474119900
ZS the Coder is playing a game. There is a number displayed on the screen and there are two buttons, ' + ' (plus) and '' (square root). Initially, the number 2 is displayed on the screen. There are n + 1 levels in the game and ZS the Coder start at the level 1.When ZS the Coder is at level k, he can : Press the ' + ' ...
256 megabytes
import java.awt.Point; import java.awt.geom.Line2D; import java.io.BufferedReader; import java.io.File; import java.io.FileInputStream; import java.io.FileReader; import java.io.OutputStream; import java.io.IOException; import java.io.InputStreamReader; import java.io.PrintWriter; import java.security.GuardedObject; im...
Java
["3", "2", "4"]
2 seconds
["14\n16\n46", "999999999999999998\n44500000000", "2\n17\n46\n97"]
NoteIn the first sample case:On the first level, ZS the Coder pressed the ' + ' button 14 times (and the number on screen is initially 2), so the number became 2 + 14Β·1 = 16. Then, ZS the Coder pressed the '' button, and the number became . After that, on the second level, ZS pressed the ' + ' button 16 times, so the n...
Java 8
standard input
[ "constructive algorithms", "math" ]
6264405c66b2690ada9f8cc6cff55f0b
The first and only line of the input contains a single integer n (1 ≀ n ≀ 100 000), denoting that ZS the Coder wants to reach level n + 1.
1,600
Print n non-negative integers, one per line. i-th of them should be equal to the number of times that ZS the Coder needs to press the ' + ' button before pressing the '' button at level i. Each number in the output should not exceed 1018. However, the number on the screen can be greater than 1018. It is guaranteed tha...
standard output
PASSED
2b821714f2c1880769308c6f553531ab
train_001.jsonl
1474119900
ZS the Coder is playing a game. There is a number displayed on the screen and there are two buttons, ' + ' (plus) and '' (square root). Initially, the number 2 is displayed on the screen. There are n + 1 levels in the game and ZS the Coder start at the level 1.When ZS the Coder is at level k, he can : Press the ' + ' ...
256 megabytes
import java.io.BufferedOutputStream; import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; import java.io.PrintWriter; import java.util.StringTokenizer; public class CF715A { public static void main(String []args) { MyScanner in = new MyScanner(); out = new PrintWrit...
Java
["3", "2", "4"]
2 seconds
["14\n16\n46", "999999999999999998\n44500000000", "2\n17\n46\n97"]
NoteIn the first sample case:On the first level, ZS the Coder pressed the ' + ' button 14 times (and the number on screen is initially 2), so the number became 2 + 14Β·1 = 16. Then, ZS the Coder pressed the '' button, and the number became . After that, on the second level, ZS pressed the ' + ' button 16 times, so the n...
Java 8
standard input
[ "constructive algorithms", "math" ]
6264405c66b2690ada9f8cc6cff55f0b
The first and only line of the input contains a single integer n (1 ≀ n ≀ 100 000), denoting that ZS the Coder wants to reach level n + 1.
1,600
Print n non-negative integers, one per line. i-th of them should be equal to the number of times that ZS the Coder needs to press the ' + ' button before pressing the '' button at level i. Each number in the output should not exceed 1018. However, the number on the screen can be greater than 1018. It is guaranteed tha...
standard output
PASSED
32a5c8104f5b9538a5e2e5bc6c56c3aa
train_001.jsonl
1474119900
ZS the Coder is playing a game. There is a number displayed on the screen and there are two buttons, ' + ' (plus) and '' (square root). Initially, the number 2 is displayed on the screen. There are n + 1 levels in the game and ZS the Coder start at the level 1.When ZS the Coder is at level k, he can : Press the ' + ' ...
256 megabytes
import java.util.*; import java.io.*; import java.math.*; public class CF_A { static BufferedReader in = new BufferedReader(new InputStreamReader(System.in)); static StringTokenizer st; static void newST() throws IOException {st = new StringTokenizer(in.readLine());} static int stInt() {return Integer.parseInt(st....
Java
["3", "2", "4"]
2 seconds
["14\n16\n46", "999999999999999998\n44500000000", "2\n17\n46\n97"]
NoteIn the first sample case:On the first level, ZS the Coder pressed the ' + ' button 14 times (and the number on screen is initially 2), so the number became 2 + 14Β·1 = 16. Then, ZS the Coder pressed the '' button, and the number became . After that, on the second level, ZS pressed the ' + ' button 16 times, so the n...
Java 8
standard input
[ "constructive algorithms", "math" ]
6264405c66b2690ada9f8cc6cff55f0b
The first and only line of the input contains a single integer n (1 ≀ n ≀ 100 000), denoting that ZS the Coder wants to reach level n + 1.
1,600
Print n non-negative integers, one per line. i-th of them should be equal to the number of times that ZS the Coder needs to press the ' + ' button before pressing the '' button at level i. Each number in the output should not exceed 1018. However, the number on the screen can be greater than 1018. It is guaranteed tha...
standard output
PASSED
a34dff9cd5cd4ba8e1609dc4e039b89f
train_001.jsonl
1474119900
ZS the Coder is playing a game. There is a number displayed on the screen and there are two buttons, ' + ' (plus) and '' (square root). Initially, the number 2 is displayed on the screen. There are n + 1 levels in the game and ZS the Coder start at the level 1.When ZS the Coder is at level k, he can : Press the ' + ' ...
256 megabytes
import java.util.*; public class PlusAndSquareRoot{ public static void main (String[] args) { Scanner kbd = new Scanner (System.in); long x = kbd.nextLong(); for(long i = 1; i <= x; i++){ if(i == 1){ System.out.println("2"); }else{ System.out.println((i+1)*(i+1)*i-(i-1)); } } } }
Java
["3", "2", "4"]
2 seconds
["14\n16\n46", "999999999999999998\n44500000000", "2\n17\n46\n97"]
NoteIn the first sample case:On the first level, ZS the Coder pressed the ' + ' button 14 times (and the number on screen is initially 2), so the number became 2 + 14Β·1 = 16. Then, ZS the Coder pressed the '' button, and the number became . After that, on the second level, ZS pressed the ' + ' button 16 times, so the n...
Java 8
standard input
[ "constructive algorithms", "math" ]
6264405c66b2690ada9f8cc6cff55f0b
The first and only line of the input contains a single integer n (1 ≀ n ≀ 100 000), denoting that ZS the Coder wants to reach level n + 1.
1,600
Print n non-negative integers, one per line. i-th of them should be equal to the number of times that ZS the Coder needs to press the ' + ' button before pressing the '' button at level i. Each number in the output should not exceed 1018. However, the number on the screen can be greater than 1018. It is guaranteed tha...
standard output
PASSED
1f89d9f611f036207a0bc1c03ff92540
train_001.jsonl
1474119900
ZS the Coder is playing a game. There is a number displayed on the screen and there are two buttons, ' + ' (plus) and '' (square root). Initially, the number 2 is displayed on the screen. There are n + 1 levels in the game and ZS the Coder start at the level 1.When ZS the Coder is at level k, he can : Press the ' + ' ...
256 megabytes
import java.io.*; import java.math.*; import java.util.*; public class A { private Scanner in = new Scanner(System.in); private PrintWriter out = new PrintWriter(System.out); long f(int k) { long res = 1; for (int i = 2; i * i <= k; ++i) { int i2 = i * i; while (k % i2 == 0) { res *=...
Java
["3", "2", "4"]
2 seconds
["14\n16\n46", "999999999999999998\n44500000000", "2\n17\n46\n97"]
NoteIn the first sample case:On the first level, ZS the Coder pressed the ' + ' button 14 times (and the number on screen is initially 2), so the number became 2 + 14Β·1 = 16. Then, ZS the Coder pressed the '' button, and the number became . After that, on the second level, ZS pressed the ' + ' button 16 times, so the n...
Java 8
standard input
[ "constructive algorithms", "math" ]
6264405c66b2690ada9f8cc6cff55f0b
The first and only line of the input contains a single integer n (1 ≀ n ≀ 100 000), denoting that ZS the Coder wants to reach level n + 1.
1,600
Print n non-negative integers, one per line. i-th of them should be equal to the number of times that ZS the Coder needs to press the ' + ' button before pressing the '' button at level i. Each number in the output should not exceed 1018. However, the number on the screen can be greater than 1018. It is guaranteed tha...
standard output
PASSED
5effa162d4c412f46ff2a125bb6bc5f8
train_001.jsonl
1474119900
ZS the Coder is playing a game. There is a number displayed on the screen and there are two buttons, ' + ' (plus) and '' (square root). Initially, the number 2 is displayed on the screen. There are n + 1 levels in the game and ZS the Coder start at the level 1.When ZS the Coder is at level k, he can : Press the ' + ' ...
256 megabytes
import java.io.OutputStream; import java.io.IOException; import java.io.InputStream; import java.io.OutputStream; import java.io.IOException; import java.io.UncheckedIOException; import java.io.Closeable; import java.io.Writer; import java.io.OutputStreamWriter; import java.io.InputStream; /** * Built using CHelper p...
Java
["3", "2", "4"]
2 seconds
["14\n16\n46", "999999999999999998\n44500000000", "2\n17\n46\n97"]
NoteIn the first sample case:On the first level, ZS the Coder pressed the ' + ' button 14 times (and the number on screen is initially 2), so the number became 2 + 14Β·1 = 16. Then, ZS the Coder pressed the '' button, and the number became . After that, on the second level, ZS pressed the ' + ' button 16 times, so the n...
Java 8
standard input
[ "constructive algorithms", "math" ]
6264405c66b2690ada9f8cc6cff55f0b
The first and only line of the input contains a single integer n (1 ≀ n ≀ 100 000), denoting that ZS the Coder wants to reach level n + 1.
1,600
Print n non-negative integers, one per line. i-th of them should be equal to the number of times that ZS the Coder needs to press the ' + ' button before pressing the '' button at level i. Each number in the output should not exceed 1018. However, the number on the screen can be greater than 1018. It is guaranteed tha...
standard output
PASSED
9c1ed2c02df09ed90364e42a6f05ce31
train_001.jsonl
1474119900
ZS the Coder is playing a game. There is a number displayed on the screen and there are two buttons, ' + ' (plus) and '' (square root). Initially, the number 2 is displayed on the screen. There are n + 1 levels in the game and ZS the Coder start at the level 1.When ZS the Coder is at level k, he can : Press the ' + ' ...
256 megabytes
import java.io.*; import java.util.*; import java.math.*; public class A implements Runnable { public void run() { long startTime = System.nanoTime(); int n = nextInt(); for (int i = 1; i <= n; i++) { println(i == 1 ? 2 : 1L * i * (i + 1) * (i + 1) - (i - 1)); } ...
Java
["3", "2", "4"]
2 seconds
["14\n16\n46", "999999999999999998\n44500000000", "2\n17\n46\n97"]
NoteIn the first sample case:On the first level, ZS the Coder pressed the ' + ' button 14 times (and the number on screen is initially 2), so the number became 2 + 14Β·1 = 16. Then, ZS the Coder pressed the '' button, and the number became . After that, on the second level, ZS pressed the ' + ' button 16 times, so the n...
Java 8
standard input
[ "constructive algorithms", "math" ]
6264405c66b2690ada9f8cc6cff55f0b
The first and only line of the input contains a single integer n (1 ≀ n ≀ 100 000), denoting that ZS the Coder wants to reach level n + 1.
1,600
Print n non-negative integers, one per line. i-th of them should be equal to the number of times that ZS the Coder needs to press the ' + ' button before pressing the '' button at level i. Each number in the output should not exceed 1018. However, the number on the screen can be greater than 1018. It is guaranteed tha...
standard output
PASSED
68691fe69ff4c3ec7f4f0c71dc55e12b
train_001.jsonl
1474119900
ZS the Coder is playing a game. There is a number displayed on the screen and there are two buttons, ' + ' (plus) and '' (square root). Initially, the number 2 is displayed on the screen. There are n + 1 levels in the game and ZS the Coder start at the level 1.When ZS the Coder is at level k, he can : Press the ' + ' ...
256 megabytes
import java.io.*; import java.util.*; import static java.lang.Math.*; public class Main { FastScanner in; PrintWriter out; static final String FILE = ""; void solve() { int n = in.nextInt(); long cur = 2; for (long k = 1; k < n + 1; k++) { out.println(k * (k + 1) ...
Java
["3", "2", "4"]
2 seconds
["14\n16\n46", "999999999999999998\n44500000000", "2\n17\n46\n97"]
NoteIn the first sample case:On the first level, ZS the Coder pressed the ' + ' button 14 times (and the number on screen is initially 2), so the number became 2 + 14Β·1 = 16. Then, ZS the Coder pressed the '' button, and the number became . After that, on the second level, ZS pressed the ' + ' button 16 times, so the n...
Java 8
standard input
[ "constructive algorithms", "math" ]
6264405c66b2690ada9f8cc6cff55f0b
The first and only line of the input contains a single integer n (1 ≀ n ≀ 100 000), denoting that ZS the Coder wants to reach level n + 1.
1,600
Print n non-negative integers, one per line. i-th of them should be equal to the number of times that ZS the Coder needs to press the ' + ' button before pressing the '' button at level i. Each number in the output should not exceed 1018. However, the number on the screen can be greater than 1018. It is guaranteed tha...
standard output
PASSED
9883670f4504cbb5656bf3032e4e9a95
train_001.jsonl
1474119900
ZS the Coder is playing a game. There is a number displayed on the screen and there are two buttons, ' + ' (plus) and '' (square root). Initially, the number 2 is displayed on the screen. There are n + 1 levels in the game and ZS the Coder start at the level 1.When ZS the Coder is at level k, he can : Press the ' + ' ...
256 megabytes
import java.io.IOException; import java.io.InputStream; import java.util.NoSuchElementException; import java.math.BigInteger; public class C { public static void main(String[] args) { FS r = new FS(); // write reader int n = r.nextInt(); solver(n); } public static void solver(int n) { BigInteger answer =...
Java
["3", "2", "4"]
2 seconds
["14\n16\n46", "999999999999999998\n44500000000", "2\n17\n46\n97"]
NoteIn the first sample case:On the first level, ZS the Coder pressed the ' + ' button 14 times (and the number on screen is initially 2), so the number became 2 + 14Β·1 = 16. Then, ZS the Coder pressed the '' button, and the number became . After that, on the second level, ZS pressed the ' + ' button 16 times, so the n...
Java 8
standard input
[ "constructive algorithms", "math" ]
6264405c66b2690ada9f8cc6cff55f0b
The first and only line of the input contains a single integer n (1 ≀ n ≀ 100 000), denoting that ZS the Coder wants to reach level n + 1.
1,600
Print n non-negative integers, one per line. i-th of them should be equal to the number of times that ZS the Coder needs to press the ' + ' button before pressing the '' button at level i. Each number in the output should not exceed 1018. However, the number on the screen can be greater than 1018. It is guaranteed tha...
standard output
PASSED
c79022027095d8d778e5a790deb9d54c
train_001.jsonl
1474119900
ZS the Coder is playing a game. There is a number displayed on the screen and there are two buttons, ' + ' (plus) and '' (square root). Initially, the number 2 is displayed on the screen. There are n + 1 levels in the game and ZS the Coder start at the level 1.When ZS the Coder is at level k, he can : Press the ' + ' ...
256 megabytes
import java.util.Scanner; public class Problem_715A { public static void main(String[] args) { Scanner input = new Scanner(System.in); long n = input.nextInt(); for(long i = 1; i < n + 1; i++) { if(i == 1) { System.out.println(2); } else { System.out.println(i * (i + 1) * (i + 1)...
Java
["3", "2", "4"]
2 seconds
["14\n16\n46", "999999999999999998\n44500000000", "2\n17\n46\n97"]
NoteIn the first sample case:On the first level, ZS the Coder pressed the ' + ' button 14 times (and the number on screen is initially 2), so the number became 2 + 14Β·1 = 16. Then, ZS the Coder pressed the '' button, and the number became . After that, on the second level, ZS pressed the ' + ' button 16 times, so the n...
Java 8
standard input
[ "constructive algorithms", "math" ]
6264405c66b2690ada9f8cc6cff55f0b
The first and only line of the input contains a single integer n (1 ≀ n ≀ 100 000), denoting that ZS the Coder wants to reach level n + 1.
1,600
Print n non-negative integers, one per line. i-th of them should be equal to the number of times that ZS the Coder needs to press the ' + ' button before pressing the '' button at level i. Each number in the output should not exceed 1018. However, the number on the screen can be greater than 1018. It is guaranteed tha...
standard output
PASSED
cda0890c64bea924adc60742fdd69bff
train_001.jsonl
1474119900
ZS the Coder is playing a game. There is a number displayed on the screen and there are two buttons, ' + ' (plus) and '' (square root). Initially, the number 2 is displayed on the screen. There are n + 1 levels in the game and ZS the Coder start at the level 1.When ZS the Coder is at level k, he can : Press the ' + ' ...
256 megabytes
import java.io.*; import java.util.*; import java.math.*; public class A { public static void main(String[] args) throws IOException { /**/ Scanner sc = new Scanner(new BufferedReader(new InputStreamReader(System.in))); /*/ Scanner sc = new Scanner(new BufferedReader(new InputStreamReader(new FileInputStream...
Java
["3", "2", "4"]
2 seconds
["14\n16\n46", "999999999999999998\n44500000000", "2\n17\n46\n97"]
NoteIn the first sample case:On the first level, ZS the Coder pressed the ' + ' button 14 times (and the number on screen is initially 2), so the number became 2 + 14Β·1 = 16. Then, ZS the Coder pressed the '' button, and the number became . After that, on the second level, ZS pressed the ' + ' button 16 times, so the n...
Java 8
standard input
[ "constructive algorithms", "math" ]
6264405c66b2690ada9f8cc6cff55f0b
The first and only line of the input contains a single integer n (1 ≀ n ≀ 100 000), denoting that ZS the Coder wants to reach level n + 1.
1,600
Print n non-negative integers, one per line. i-th of them should be equal to the number of times that ZS the Coder needs to press the ' + ' button before pressing the '' button at level i. Each number in the output should not exceed 1018. However, the number on the screen can be greater than 1018. It is guaranteed tha...
standard output
PASSED
706030854fbfa1075b2633c4c6baa664
train_001.jsonl
1474119900
ZS the Coder is playing a game. There is a number displayed on the screen and there are two buttons, ' + ' (plus) and '' (square root). Initially, the number 2 is displayed on the screen. There are n + 1 levels in the game and ZS the Coder start at the level 1.When ZS the Coder is at level k, he can : Press the ' + ' ...
256 megabytes
import java.io.*; import java.math.BigInteger; import java.util.*; public class Solution { static MyScanner sc; private static PrintWriter out; static long M2 = 1_000_000_000L + 7; public static void main(String[] s) throws Exception { StringBuilder stringBuilder = new StringBuilder(); // ...
Java
["3", "2", "4"]
2 seconds
["14\n16\n46", "999999999999999998\n44500000000", "2\n17\n46\n97"]
NoteIn the first sample case:On the first level, ZS the Coder pressed the ' + ' button 14 times (and the number on screen is initially 2), so the number became 2 + 14Β·1 = 16. Then, ZS the Coder pressed the '' button, and the number became . After that, on the second level, ZS pressed the ' + ' button 16 times, so the n...
Java 8
standard input
[ "constructive algorithms", "math" ]
6264405c66b2690ada9f8cc6cff55f0b
The first and only line of the input contains a single integer n (1 ≀ n ≀ 100 000), denoting that ZS the Coder wants to reach level n + 1.
1,600
Print n non-negative integers, one per line. i-th of them should be equal to the number of times that ZS the Coder needs to press the ' + ' button before pressing the '' button at level i. Each number in the output should not exceed 1018. However, the number on the screen can be greater than 1018. It is guaranteed tha...
standard output
PASSED
37a942d0769b9de264f532b2ccf2f530
train_001.jsonl
1474119900
ZS the Coder is playing a game. There is a number displayed on the screen and there are two buttons, ' + ' (plus) and '' (square root). Initially, the number 2 is displayed on the screen. There are n + 1 levels in the game and ZS the Coder start at the level 1.When ZS the Coder is at level k, he can : Press the ' + ' ...
256 megabytes
import java.math.BigInteger; import java.util.Scanner; public class Main { public static void main(String[] args) { int n; n = new Scanner(System.in).nextInt(); BigInteger num = new BigInteger("2"); BigInteger diff = new BigInteger("1"); BigInteger it = new BigInteger("1"); BigInteger itN = new BigInteg...
Java
["3", "2", "4"]
2 seconds
["14\n16\n46", "999999999999999998\n44500000000", "2\n17\n46\n97"]
NoteIn the first sample case:On the first level, ZS the Coder pressed the ' + ' button 14 times (and the number on screen is initially 2), so the number became 2 + 14Β·1 = 16. Then, ZS the Coder pressed the '' button, and the number became . After that, on the second level, ZS pressed the ' + ' button 16 times, so the n...
Java 8
standard input
[ "constructive algorithms", "math" ]
6264405c66b2690ada9f8cc6cff55f0b
The first and only line of the input contains a single integer n (1 ≀ n ≀ 100 000), denoting that ZS the Coder wants to reach level n + 1.
1,600
Print n non-negative integers, one per line. i-th of them should be equal to the number of times that ZS the Coder needs to press the ' + ' button before pressing the '' button at level i. Each number in the output should not exceed 1018. However, the number on the screen can be greater than 1018. It is guaranteed tha...
standard output
PASSED
0648adc7c778ca4be33a9b8abe0a7ada
train_001.jsonl
1474119900
ZS the Coder is playing a game. There is a number displayed on the screen and there are two buttons, ' + ' (plus) and '' (square root). Initially, the number 2 is displayed on the screen. There are n + 1 levels in the game and ZS the Coder start at the level 1.When ZS the Coder is at level k, he can : Press the ' + ' ...
256 megabytes
import java.math.BigInteger; import java.util.Scanner; public class EUQWxC { public static void main(String [] args){ Scanner scan=new Scanner(System.in); long input=scan.nextLong(); BigInteger screen=new BigInteger ("2"); BigInteger level=new BigInteger ("1"); BigInteger target=new BigInteger("1"); BigIn...
Java
["3", "2", "4"]
2 seconds
["14\n16\n46", "999999999999999998\n44500000000", "2\n17\n46\n97"]
NoteIn the first sample case:On the first level, ZS the Coder pressed the ' + ' button 14 times (and the number on screen is initially 2), so the number became 2 + 14Β·1 = 16. Then, ZS the Coder pressed the '' button, and the number became . After that, on the second level, ZS pressed the ' + ' button 16 times, so the n...
Java 8
standard input
[ "constructive algorithms", "math" ]
6264405c66b2690ada9f8cc6cff55f0b
The first and only line of the input contains a single integer n (1 ≀ n ≀ 100 000), denoting that ZS the Coder wants to reach level n + 1.
1,600
Print n non-negative integers, one per line. i-th of them should be equal to the number of times that ZS the Coder needs to press the ' + ' button before pressing the '' button at level i. Each number in the output should not exceed 1018. However, the number on the screen can be greater than 1018. It is guaranteed tha...
standard output
PASSED
0fcd08732e517e66f53469bbc86ac7c5
train_001.jsonl
1474119900
ZS the Coder is playing a game. There is a number displayed on the screen and there are two buttons, ' + ' (plus) and '' (square root). Initially, the number 2 is displayed on the screen. There are n + 1 levels in the game and ZS the Coder start at the level 1.When ZS the Coder is at level k, he can : Press the ' + ' ...
256 megabytes
/* package whatever; // don't place package name! */ import java.util.*; import java.lang.*; import java.io.*; import java.io.BufferedReader; import java.io.File; import java.io.FileReader; import java.io.IOException; import java.io.BufferedReader; import java.io.BufferedWriter; import java.io.InputStreamReader;impo...
Java
["3", "2", "4"]
2 seconds
["14\n16\n46", "999999999999999998\n44500000000", "2\n17\n46\n97"]
NoteIn the first sample case:On the first level, ZS the Coder pressed the ' + ' button 14 times (and the number on screen is initially 2), so the number became 2 + 14Β·1 = 16. Then, ZS the Coder pressed the '' button, and the number became . After that, on the second level, ZS pressed the ' + ' button 16 times, so the n...
Java 8
standard input
[ "constructive algorithms", "math" ]
6264405c66b2690ada9f8cc6cff55f0b
The first and only line of the input contains a single integer n (1 ≀ n ≀ 100 000), denoting that ZS the Coder wants to reach level n + 1.
1,600
Print n non-negative integers, one per line. i-th of them should be equal to the number of times that ZS the Coder needs to press the ' + ' button before pressing the '' button at level i. Each number in the output should not exceed 1018. However, the number on the screen can be greater than 1018. It is guaranteed tha...
standard output
PASSED
9214a3b510baba0b21a8bee06d6a7660
train_001.jsonl
1474119900
ZS the Coder is playing a game. There is a number displayed on the screen and there are two buttons, ' + ' (plus) and '' (square root). Initially, the number 2 is displayed on the screen. There are n + 1 levels in the game and ZS the Coder start at the level 1.When ZS the Coder is at level k, he can : Press the ' + ' ...
256 megabytes
import java.util.*; public class CF715A { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int n = sc.nextInt(); System.out.println("2"); for (long i = 3; i <= n+1; i++) System.out.println((i*i-1)*(i-1) + 1); } }
Java
["3", "2", "4"]
2 seconds
["14\n16\n46", "999999999999999998\n44500000000", "2\n17\n46\n97"]
NoteIn the first sample case:On the first level, ZS the Coder pressed the ' + ' button 14 times (and the number on screen is initially 2), so the number became 2 + 14Β·1 = 16. Then, ZS the Coder pressed the '' button, and the number became . After that, on the second level, ZS pressed the ' + ' button 16 times, so the n...
Java 8
standard input
[ "constructive algorithms", "math" ]
6264405c66b2690ada9f8cc6cff55f0b
The first and only line of the input contains a single integer n (1 ≀ n ≀ 100 000), denoting that ZS the Coder wants to reach level n + 1.
1,600
Print n non-negative integers, one per line. i-th of them should be equal to the number of times that ZS the Coder needs to press the ' + ' button before pressing the '' button at level i. Each number in the output should not exceed 1018. However, the number on the screen can be greater than 1018. It is guaranteed tha...
standard output
PASSED
189e118b2b1e41960b8eec6234657a81
train_001.jsonl
1474119900
ZS the Coder is playing a game. There is a number displayed on the screen and there are two buttons, ' + ' (plus) and '' (square root). Initially, the number 2 is displayed on the screen. There are n + 1 levels in the game and ZS the Coder start at the level 1.When ZS the Coder is at level k, he can : Press the ' + ' ...
256 megabytes
import java.util.*; public class Main { public static void main(String[] args) { Scanner sc=new Scanner(System.in); long n=sc.nextLong(); for (long i=1; i<=n; i++) { if (i==1) System.out.println(2); else System.out.println((i+1)*(i+1)*i-(i-1)); } } }
Java
["3", "2", "4"]
2 seconds
["14\n16\n46", "999999999999999998\n44500000000", "2\n17\n46\n97"]
NoteIn the first sample case:On the first level, ZS the Coder pressed the ' + ' button 14 times (and the number on screen is initially 2), so the number became 2 + 14Β·1 = 16. Then, ZS the Coder pressed the '' button, and the number became . After that, on the second level, ZS pressed the ' + ' button 16 times, so the n...
Java 8
standard input
[ "constructive algorithms", "math" ]
6264405c66b2690ada9f8cc6cff55f0b
The first and only line of the input contains a single integer n (1 ≀ n ≀ 100 000), denoting that ZS the Coder wants to reach level n + 1.
1,600
Print n non-negative integers, one per line. i-th of them should be equal to the number of times that ZS the Coder needs to press the ' + ' button before pressing the '' button at level i. Each number in the output should not exceed 1018. However, the number on the screen can be greater than 1018. It is guaranteed tha...
standard output
PASSED
7b9f94f3e14048b5da3cb270616c680c
train_001.jsonl
1474119900
ZS the Coder is playing a game. There is a number displayed on the screen and there are two buttons, ' + ' (plus) and '' (square root). Initially, the number 2 is displayed on the screen. There are n + 1 levels in the game and ZS the Coder start at the level 1.When ZS the Coder is at level k, he can : Press the ' + ' ...
256 megabytes
import java.util.*; public class Main { public static void main(String[] args) { Scanner kbd = new Scanner(System.in); long n = kbd.nextLong(); for (long i=1; i<=n; i++) { if (i==1) { System.out.println(2); } else System.out.println((i+1)*(i+1)*i-(i-1)); } } }
Java
["3", "2", "4"]
2 seconds
["14\n16\n46", "999999999999999998\n44500000000", "2\n17\n46\n97"]
NoteIn the first sample case:On the first level, ZS the Coder pressed the ' + ' button 14 times (and the number on screen is initially 2), so the number became 2 + 14Β·1 = 16. Then, ZS the Coder pressed the '' button, and the number became . After that, on the second level, ZS pressed the ' + ' button 16 times, so the n...
Java 8
standard input
[ "constructive algorithms", "math" ]
6264405c66b2690ada9f8cc6cff55f0b
The first and only line of the input contains a single integer n (1 ≀ n ≀ 100 000), denoting that ZS the Coder wants to reach level n + 1.
1,600
Print n non-negative integers, one per line. i-th of them should be equal to the number of times that ZS the Coder needs to press the ' + ' button before pressing the '' button at level i. Each number in the output should not exceed 1018. However, the number on the screen can be greater than 1018. It is guaranteed tha...
standard output
PASSED
2c2879be58eb2cba0b390ec60ad4ab77
train_001.jsonl
1474119900
ZS the Coder is playing a game. There is a number displayed on the screen and there are two buttons, ' + ' (plus) and '' (square root). Initially, the number 2 is displayed on the screen. There are n + 1 levels in the game and ZS the Coder start at the level 1.When ZS the Coder is at level k, he can : Press the ' + ' ...
256 megabytes
import java.util.*; public class Main { public static void main(String[] args) { Scanner sc=new Scanner(System.in); long n=sc.nextLong(); for (long i=1; i<=n; i++) { if (i==1) { System.out.println(2); } else System.out.println((i+1)*(i+1)*i-(i-1)); } } }
Java
["3", "2", "4"]
2 seconds
["14\n16\n46", "999999999999999998\n44500000000", "2\n17\n46\n97"]
NoteIn the first sample case:On the first level, ZS the Coder pressed the ' + ' button 14 times (and the number on screen is initially 2), so the number became 2 + 14Β·1 = 16. Then, ZS the Coder pressed the '' button, and the number became . After that, on the second level, ZS pressed the ' + ' button 16 times, so the n...
Java 8
standard input
[ "constructive algorithms", "math" ]
6264405c66b2690ada9f8cc6cff55f0b
The first and only line of the input contains a single integer n (1 ≀ n ≀ 100 000), denoting that ZS the Coder wants to reach level n + 1.
1,600
Print n non-negative integers, one per line. i-th of them should be equal to the number of times that ZS the Coder needs to press the ' + ' button before pressing the '' button at level i. Each number in the output should not exceed 1018. However, the number on the screen can be greater than 1018. It is guaranteed tha...
standard output
PASSED
443b68adf54cd6e664374d189b63ca27
train_001.jsonl
1474119900
ZS the Coder is playing a game. There is a number displayed on the screen and there are two buttons, ' + ' (plus) and '' (square root). Initially, the number 2 is displayed on the screen. There are n + 1 levels in the game and ZS the Coder start at the level 1.When ZS the Coder is at level k, he can : Press the ' + ' ...
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 */ public class Main { public static...
Java
["3", "2", "4"]
2 seconds
["14\n16\n46", "999999999999999998\n44500000000", "2\n17\n46\n97"]
NoteIn the first sample case:On the first level, ZS the Coder pressed the ' + ' button 14 times (and the number on screen is initially 2), so the number became 2 + 14Β·1 = 16. Then, ZS the Coder pressed the '' button, and the number became . After that, on the second level, ZS pressed the ' + ' button 16 times, so the n...
Java 8
standard input
[ "constructive algorithms", "math" ]
6264405c66b2690ada9f8cc6cff55f0b
The first and only line of the input contains a single integer n (1 ≀ n ≀ 100 000), denoting that ZS the Coder wants to reach level n + 1.
1,600
Print n non-negative integers, one per line. i-th of them should be equal to the number of times that ZS the Coder needs to press the ' + ' button before pressing the '' button at level i. Each number in the output should not exceed 1018. However, the number on the screen can be greater than 1018. It is guaranteed tha...
standard output
PASSED
b91d31ada33c21abf165ac98a04f9b51
train_001.jsonl
1474119900
ZS the Coder is playing a game. There is a number displayed on the screen and there are two buttons, ' + ' (plus) and '' (square root). Initially, the number 2 is displayed on the screen. There are n + 1 levels in the game and ZS the Coder start at the level 1.When ZS the Coder is at level k, he can : Press the ' + ' ...
256 megabytes
// package Mathematical; import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; import java.math.BigInteger; public class PlusAndSquareRoot { public static void main(String[] args)throws IOException { BufferedReader br=new BufferedReader(new InputStreamReader(System.i...
Java
["3", "2", "4"]
2 seconds
["14\n16\n46", "999999999999999998\n44500000000", "2\n17\n46\n97"]
NoteIn the first sample case:On the first level, ZS the Coder pressed the ' + ' button 14 times (and the number on screen is initially 2), so the number became 2 + 14Β·1 = 16. Then, ZS the Coder pressed the '' button, and the number became . After that, on the second level, ZS pressed the ' + ' button 16 times, so the n...
Java 8
standard input
[ "constructive algorithms", "math" ]
6264405c66b2690ada9f8cc6cff55f0b
The first and only line of the input contains a single integer n (1 ≀ n ≀ 100 000), denoting that ZS the Coder wants to reach level n + 1.
1,600
Print n non-negative integers, one per line. i-th of them should be equal to the number of times that ZS the Coder needs to press the ' + ' button before pressing the '' button at level i. Each number in the output should not exceed 1018. However, the number on the screen can be greater than 1018. It is guaranteed tha...
standard output
PASSED
582e0d8b5874a96634a06c106fc4279f
train_001.jsonl
1327215600
Petya loves lucky numbers very much. Everybody knows that lucky numbers are positive integers whose decimal record contains only the lucky digits 4 and 7. For example, numbers 47, 744, 4 are lucky and 5, 17, 467 are not.Petya has sequence a consisting of n integers.The subsequence of the sequence a is such subsequence ...
256 megabytes
import java.util.Arrays; import java.util.InputMismatchException; import java.io.InputStream; import java.util.HashMap; import java.util.Collection; import java.io.OutputStream; import java.io.PrintWriter; import java.io.IOException; /** * Built using CHelper plug-in * Actual solution is at the top */ public class ...
Java
["3 2\n10 10 10", "4 2\n4 4 7 7"]
2 seconds
["3", "4"]
NoteIn the first sample all 3 subsequences of the needed length are considered lucky.In the second sample there are 4 lucky subsequences. For them the sets of indexes equal (the indexation starts from 1): {1, 3}, {1, 4}, {2, 3} and {2, 4}.
Java 8
standard input
[ "dp", "combinatorics" ]
c421f47149e70240a02903d9d47de429
The first line contains two integers n and k (1 ≀ k ≀ n ≀ 105). The next line contains n integers ai (1 ≀ ai ≀ 109) β€” the sequence a.
2,100
On the single line print the single number β€” the answer to the problem modulo prime number 1000000007 (109 + 7).
standard output
PASSED
3d4ecc4eda5d9103a553202587217b25
train_001.jsonl
1327215600
Petya loves lucky numbers very much. Everybody knows that lucky numbers are positive integers whose decimal record contains only the lucky digits 4 and 7. For example, numbers 47, 744, 4 are lucky and 5, 17, 467 are not.Petya has sequence a consisting of n integers.The subsequence of the sequence a is such subsequence ...
256 megabytes
import java.io.BufferedReader; import java.io.IOException; import java.io.InputStream; import java.io.InputStreamReader; import java.io.PrintWriter; import java.util.Arrays; import java.util.HashMap; import java.util.Map.Entry; import java.util.StringTokenizer; public class Abood2D { static int occ[]; static int[...
Java
["3 2\n10 10 10", "4 2\n4 4 7 7"]
2 seconds
["3", "4"]
NoteIn the first sample all 3 subsequences of the needed length are considered lucky.In the second sample there are 4 lucky subsequences. For them the sets of indexes equal (the indexation starts from 1): {1, 3}, {1, 4}, {2, 3} and {2, 4}.
Java 8
standard input
[ "dp", "combinatorics" ]
c421f47149e70240a02903d9d47de429
The first line contains two integers n and k (1 ≀ k ≀ n ≀ 105). The next line contains n integers ai (1 ≀ ai ≀ 109) β€” the sequence a.
2,100
On the single line print the single number β€” the answer to the problem modulo prime number 1000000007 (109 + 7).
standard output
PASSED
da49b7884b7e34d093068fd9324edb5c
train_001.jsonl
1327215600
Petya loves lucky numbers very much. Everybody knows that lucky numbers are positive integers whose decimal record contains only the lucky digits 4 and 7. For example, numbers 47, 744, 4 are lucky and 5, 17, 467 are not.Petya has sequence a consisting of n integers.The subsequence of the sequence a is such subsequence ...
256 megabytes
import java.math.BigInteger; import java.util.Arrays; import java.util.HashMap; import java.util.Scanner; import java.util.Map.Entry; public class E { static int[] a; static int[] sh; static int n, k; static int mod = 1000000007; static int[] freq; static int cnt; static long[][] dp; public static void main(S...
Java
["3 2\n10 10 10", "4 2\n4 4 7 7"]
2 seconds
["3", "4"]
NoteIn the first sample all 3 subsequences of the needed length are considered lucky.In the second sample there are 4 lucky subsequences. For them the sets of indexes equal (the indexation starts from 1): {1, 3}, {1, 4}, {2, 3} and {2, 4}.
Java 6
standard input
[ "dp", "combinatorics" ]
c421f47149e70240a02903d9d47de429
The first line contains two integers n and k (1 ≀ k ≀ n ≀ 105). The next line contains n integers ai (1 ≀ ai ≀ 109) β€” the sequence a.
2,100
On the single line print the single number β€” the answer to the problem modulo prime number 1000000007 (109 + 7).
standard output
PASSED
1f44138e33f0960da315b27b3b24de30
train_001.jsonl
1327215600
Petya loves lucky numbers very much. Everybody knows that lucky numbers are positive integers whose decimal record contains only the lucky digits 4 and 7. For example, numbers 47, 744, 4 are lucky and 5, 17, 467 are not.Petya has sequence a consisting of n integers.The subsequence of the sequence a is such subsequence ...
256 megabytes
import java.math.BigInteger; import java.util.Arrays; import java.util.HashMap; import java.util.Scanner; import java.util.Map.Entry; public class E { static int[] a; static int[] sh; static int n, k; static int mod = 1000000007; static int[] freq; static int cnt; static long[][] dp; p...
Java
["3 2\n10 10 10", "4 2\n4 4 7 7"]
2 seconds
["3", "4"]
NoteIn the first sample all 3 subsequences of the needed length are considered lucky.In the second sample there are 4 lucky subsequences. For them the sets of indexes equal (the indexation starts from 1): {1, 3}, {1, 4}, {2, 3} and {2, 4}.
Java 6
standard input
[ "dp", "combinatorics" ]
c421f47149e70240a02903d9d47de429
The first line contains two integers n and k (1 ≀ k ≀ n ≀ 105). The next line contains n integers ai (1 ≀ ai ≀ 109) β€” the sequence a.
2,100
On the single line print the single number β€” the answer to the problem modulo prime number 1000000007 (109 + 7).
standard output
PASSED
965756c4664b15bd04b337a22e69d6f8
train_001.jsonl
1327215600
Petya loves lucky numbers very much. Everybody knows that lucky numbers are positive integers whose decimal record contains only the lucky digits 4 and 7. For example, numbers 47, 744, 4 are lucky and 5, 17, 467 are not.Petya has sequence a consisting of n integers.The subsequence of the sequence a is such subsequence ...
256 megabytes
import java.io.*; import java.lang.Math; import java.util.*; import java.math.BigInteger; public class Main { public BufferedReader in; public PrintStream out; public int index(int x) { int res = 0; while (x>0) { res *= 3; switch (x % 10) { case 4: res += 1; break; case 7: ...
Java
["3 2\n10 10 10", "4 2\n4 4 7 7"]
2 seconds
["3", "4"]
NoteIn the first sample all 3 subsequences of the needed length are considered lucky.In the second sample there are 4 lucky subsequences. For them the sets of indexes equal (the indexation starts from 1): {1, 3}, {1, 4}, {2, 3} and {2, 4}.
Java 6
standard input
[ "dp", "combinatorics" ]
c421f47149e70240a02903d9d47de429
The first line contains two integers n and k (1 ≀ k ≀ n ≀ 105). The next line contains n integers ai (1 ≀ ai ≀ 109) β€” the sequence a.
2,100
On the single line print the single number β€” the answer to the problem modulo prime number 1000000007 (109 + 7).
standard output
PASSED
8b8e1cf4801c314812eb5cec937b71d8
train_001.jsonl
1327215600
Petya loves lucky numbers very much. Everybody knows that lucky numbers are positive integers whose decimal record contains only the lucky digits 4 and 7. For example, numbers 47, 744, 4 are lucky and 5, 17, 467 are not.Petya has sequence a consisting of n integers.The subsequence of the sequence a is such subsequence ...
256 megabytes
import java.io.BufferedReader; import java.io.FileReader; import java.io.IOException; import java.io.InputStreamReader; import java.io.PrintStream; import java.util.*; public class E { BufferedReader in; PrintStream out; StringTokenizer tok; public E() throws NumberFormatException, IOException { in = new Buffe...
Java
["3 2\n10 10 10", "4 2\n4 4 7 7"]
2 seconds
["3", "4"]
NoteIn the first sample all 3 subsequences of the needed length are considered lucky.In the second sample there are 4 lucky subsequences. For them the sets of indexes equal (the indexation starts from 1): {1, 3}, {1, 4}, {2, 3} and {2, 4}.
Java 6
standard input
[ "dp", "combinatorics" ]
c421f47149e70240a02903d9d47de429
The first line contains two integers n and k (1 ≀ k ≀ n ≀ 105). The next line contains n integers ai (1 ≀ ai ≀ 109) β€” the sequence a.
2,100
On the single line print the single number β€” the answer to the problem modulo prime number 1000000007 (109 + 7).
standard output
PASSED
46d355b9f3af6dea359e911f65778dd5
train_001.jsonl
1327215600
Petya loves lucky numbers very much. Everybody knows that lucky numbers are positive integers whose decimal record contains only the lucky digits 4 and 7. For example, numbers 47, 744, 4 are lucky and 5, 17, 467 are not.Petya has sequence a consisting of n integers.The subsequence of the sequence a is such subsequence ...
256 megabytes
import java.io.BufferedReader; import java.io.BufferedWriter; import java.io.IOException; import java.io.InputStreamReader; import java.io.OutputStreamWriter; import java.io.PrintWriter; import java.io.StreamTokenizer; import java.util.Map; import java.util.TreeMap; public class E { static StreamTokenizer st; stati...
Java
["3 2\n10 10 10", "4 2\n4 4 7 7"]
2 seconds
["3", "4"]
NoteIn the first sample all 3 subsequences of the needed length are considered lucky.In the second sample there are 4 lucky subsequences. For them the sets of indexes equal (the indexation starts from 1): {1, 3}, {1, 4}, {2, 3} and {2, 4}.
Java 6
standard input
[ "dp", "combinatorics" ]
c421f47149e70240a02903d9d47de429
The first line contains two integers n and k (1 ≀ k ≀ n ≀ 105). The next line contains n integers ai (1 ≀ ai ≀ 109) β€” the sequence a.
2,100
On the single line print the single number β€” the answer to the problem modulo prime number 1000000007 (109 + 7).
standard output
PASSED
145830f0748a0123c5445313dcecfc3e
train_001.jsonl
1327215600
Petya loves lucky numbers very much. Everybody knows that lucky numbers are positive integers whose decimal record contains only the lucky digits 4 and 7. For example, numbers 47, 744, 4 are lucky and 5, 17, 467 are not.Petya has sequence a consisting of n integers.The subsequence of the sequence a is such subsequence ...
256 megabytes
import java.io.PrintStream; import java.util.ArrayList; import java.util.Arrays; import java.util.List; import java.util.Scanner; /** * @author Roman Elizarov */ public class Round_104_E { private static final int MOD = 1000000007; public static void main(String[] args) { new Round_104_E().go(); } int n; in...
Java
["3 2\n10 10 10", "4 2\n4 4 7 7"]
2 seconds
["3", "4"]
NoteIn the first sample all 3 subsequences of the needed length are considered lucky.In the second sample there are 4 lucky subsequences. For them the sets of indexes equal (the indexation starts from 1): {1, 3}, {1, 4}, {2, 3} and {2, 4}.
Java 6
standard input
[ "dp", "combinatorics" ]
c421f47149e70240a02903d9d47de429
The first line contains two integers n and k (1 ≀ k ≀ n ≀ 105). The next line contains n integers ai (1 ≀ ai ≀ 109) β€” the sequence a.
2,100
On the single line print the single number β€” the answer to the problem modulo prime number 1000000007 (109 + 7).
standard output
PASSED
91757b6c16ac4cf18ae99dc2457428e4
train_001.jsonl
1327215600
Petya loves lucky numbers very much. Everybody knows that lucky numbers are positive integers whose decimal record contains only the lucky digits 4 and 7. For example, numbers 47, 744, 4 are lucky and 5, 17, 467 are not.Petya has sequence a consisting of n integers.The subsequence of the sequence a is such subsequence ...
256 megabytes
import java.util.*; import java.io.*; import java.lang.reflect.Array; import java.math.*; public class Main implements Runnable{ static final Boolean fromFile = false; static final Boolean isDebug = false; static final String fileName = "input"; BufferedReader reader; PrintWriter out; ...
Java
["3 2\n10 10 10", "4 2\n4 4 7 7"]
2 seconds
["3", "4"]
NoteIn the first sample all 3 subsequences of the needed length are considered lucky.In the second sample there are 4 lucky subsequences. For them the sets of indexes equal (the indexation starts from 1): {1, 3}, {1, 4}, {2, 3} and {2, 4}.
Java 6
standard input
[ "dp", "combinatorics" ]
c421f47149e70240a02903d9d47de429
The first line contains two integers n and k (1 ≀ k ≀ n ≀ 105). The next line contains n integers ai (1 ≀ ai ≀ 109) β€” the sequence a.
2,100
On the single line print the single number β€” the answer to the problem modulo prime number 1000000007 (109 + 7).
standard output