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
b46c8692c1795a32393cc049828a985d
train_000.jsonl
1349623800
One day three best friends Petya, Vasya and Tonya decided to form a team and take part in programming contests. Participants are usually offered several problems during programming contests. Long before the start the friends decided that they will implement a problem if at least two of them are sure about the solution....
256 megabytes
import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; import java.util.ArrayList; import java.util.StringTokenizer; public class teams { public static void main(String[]args) throws NumberFormatException, IOException{ BufferedReader br =new BufferedReader(new InputStreamRe...
Java
["3\n1 1 0\n1 1 1\n1 0 0", "2\n1 0 0\n0 1 1"]
2 seconds
["2", "1"]
NoteIn the first sample Petya and Vasya are sure that they know how to solve the first problem and all three of them know how to solve the second problem. That means that they will write solutions for these problems. Only Petya is sure about the solution for the third problem, but that isn't enough, so the friends won'...
Java 7
standard input
[ "greedy", "brute force" ]
3542adc74a41ccfd72008faf983ffab5
The first input line contains a single integer n (1 ≀ n ≀ 1000) β€” the number of problems in the contest. Then n lines contain three integers each, each integer is either 0 or 1. If the first number in the line equals 1, then Petya is sure about the problem's solution, otherwise he isn't sure. The second number shows Va...
800
Print a single integer β€” the number of problems the friends will implement on the contest.
standard output
PASSED
449b92f39997e17b6b4f69349a5b92c2
train_000.jsonl
1349623800
One day three best friends Petya, Vasya and Tonya decided to form a team and take part in programming contests. Participants are usually offered several problems during programming contests. Long before the start the friends decided that they will implement a problem if at least two of them are sure about the solution....
256 megabytes
import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; import java.util.StringTokenizer; public class Team { public static void main (String[]args) throws NumberFormatException, IOException{ BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); int n...
Java
["3\n1 1 0\n1 1 1\n1 0 0", "2\n1 0 0\n0 1 1"]
2 seconds
["2", "1"]
NoteIn the first sample Petya and Vasya are sure that they know how to solve the first problem and all three of them know how to solve the second problem. That means that they will write solutions for these problems. Only Petya is sure about the solution for the third problem, but that isn't enough, so the friends won'...
Java 7
standard input
[ "greedy", "brute force" ]
3542adc74a41ccfd72008faf983ffab5
The first input line contains a single integer n (1 ≀ n ≀ 1000) β€” the number of problems in the contest. Then n lines contain three integers each, each integer is either 0 or 1. If the first number in the line equals 1, then Petya is sure about the problem's solution, otherwise he isn't sure. The second number shows Va...
800
Print a single integer β€” the number of problems the friends will implement on the contest.
standard output
PASSED
5a8de31ea426257d808794db54dc10c3
train_000.jsonl
1349623800
One day three best friends Petya, Vasya and Tonya decided to form a team and take part in programming contests. Participants are usually offered several problems during programming contests. Long before the start the friends decided that they will implement a problem if at least two of them are sure about the solution....
256 megabytes
//231A import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner input = new Scanner(System.in); int n = input.nextInt(); int P, V, T, res = 0; // if (n >= 1 && n <= 100){ while (n > 0) { P = input.nextIn...
Java
["3\n1 1 0\n1 1 1\n1 0 0", "2\n1 0 0\n0 1 1"]
2 seconds
["2", "1"]
NoteIn the first sample Petya and Vasya are sure that they know how to solve the first problem and all three of them know how to solve the second problem. That means that they will write solutions for these problems. Only Petya is sure about the solution for the third problem, but that isn't enough, so the friends won'...
Java 7
standard input
[ "greedy", "brute force" ]
3542adc74a41ccfd72008faf983ffab5
The first input line contains a single integer n (1 ≀ n ≀ 1000) β€” the number of problems in the contest. Then n lines contain three integers each, each integer is either 0 or 1. If the first number in the line equals 1, then Petya is sure about the problem's solution, otherwise he isn't sure. The second number shows Va...
800
Print a single integer β€” the number of problems the friends will implement on the contest.
standard output
PASSED
d94776c76f0f186b9790e10726f7c70f
train_000.jsonl
1349623800
One day three best friends Petya, Vasya and Tonya decided to form a team and take part in programming contests. Participants are usually offered several problems during programming contests. Long before the start the friends decided that they will implement a problem if at least two of them are sure about the solution....
256 megabytes
import java.io.*; import java.util.*; public class Problem_231A { static public void main(String[] args) throws java.lang.Exception{ BufferedReader in = new BufferedReader(new InputStreamReader(System.in)); int N = Integer.parseInt(in.readLine()); int res = 0; for(int i = 0; i < N; i++){ String[] tem...
Java
["3\n1 1 0\n1 1 1\n1 0 0", "2\n1 0 0\n0 1 1"]
2 seconds
["2", "1"]
NoteIn the first sample Petya and Vasya are sure that they know how to solve the first problem and all three of them know how to solve the second problem. That means that they will write solutions for these problems. Only Petya is sure about the solution for the third problem, but that isn't enough, so the friends won'...
Java 7
standard input
[ "greedy", "brute force" ]
3542adc74a41ccfd72008faf983ffab5
The first input line contains a single integer n (1 ≀ n ≀ 1000) β€” the number of problems in the contest. Then n lines contain three integers each, each integer is either 0 or 1. If the first number in the line equals 1, then Petya is sure about the problem's solution, otherwise he isn't sure. The second number shows Va...
800
Print a single integer β€” the number of problems the friends will implement on the contest.
standard output
PASSED
1261ffb0ee398ad9c691e491c61b9913
train_000.jsonl
1349623800
One day three best friends Petya, Vasya and Tonya decided to form a team and take part in programming contests. Participants are usually offered several problems during programming contests. Long before the start the friends decided that they will implement a problem if at least two of them are sure about the solution....
256 megabytes
import java.util.Scanner; public class Team { public static void main(String args[]){ int a,counter=0; Team t = new Team(); Scanner in = new Scanner(System.in); a=in.nextInt(); int k[][]=new int[a][3]; for(int i=0;i<a;i++) for(int j=0;j<3;j++) k[i][j]=in.nextInt(); for(int i=0;i<a;i++) if((t....
Java
["3\n1 1 0\n1 1 1\n1 0 0", "2\n1 0 0\n0 1 1"]
2 seconds
["2", "1"]
NoteIn the first sample Petya and Vasya are sure that they know how to solve the first problem and all three of them know how to solve the second problem. That means that they will write solutions for these problems. Only Petya is sure about the solution for the third problem, but that isn't enough, so the friends won'...
Java 7
standard input
[ "greedy", "brute force" ]
3542adc74a41ccfd72008faf983ffab5
The first input line contains a single integer n (1 ≀ n ≀ 1000) β€” the number of problems in the contest. Then n lines contain three integers each, each integer is either 0 or 1. If the first number in the line equals 1, then Petya is sure about the problem's solution, otherwise he isn't sure. The second number shows Va...
800
Print a single integer β€” the number of problems the friends will implement on the contest.
standard output
PASSED
6380f25d2f610d2c7c1498077d858254
train_000.jsonl
1349623800
One day three best friends Petya, Vasya and Tonya decided to form a team and take part in programming contests. Participants are usually offered several problems during programming contests. Long before the start the friends decided that they will implement a problem if at least two of them are sure about the solution....
256 megabytes
import java.util.Scanner; public class Team { public static void main(String[] args) { Scanner in = new Scanner(System.in); int n =in.nextInt(); int problemSolved=0; for(int i=1;i<=n;i++){ if(in.nextInt()+in.nextInt()+in.nextInt()>=2){ problemSolved++; } } System.out.println(problemSolved); } ...
Java
["3\n1 1 0\n1 1 1\n1 0 0", "2\n1 0 0\n0 1 1"]
2 seconds
["2", "1"]
NoteIn the first sample Petya and Vasya are sure that they know how to solve the first problem and all three of them know how to solve the second problem. That means that they will write solutions for these problems. Only Petya is sure about the solution for the third problem, but that isn't enough, so the friends won'...
Java 7
standard input
[ "greedy", "brute force" ]
3542adc74a41ccfd72008faf983ffab5
The first input line contains a single integer n (1 ≀ n ≀ 1000) β€” the number of problems in the contest. Then n lines contain three integers each, each integer is either 0 or 1. If the first number in the line equals 1, then Petya is sure about the problem's solution, otherwise he isn't sure. The second number shows Va...
800
Print a single integer β€” the number of problems the friends will implement on the contest.
standard output
PASSED
810b3c6017e6512685cc2ac6afbe0f1b
train_000.jsonl
1349623800
One day three best friends Petya, Vasya and Tonya decided to form a team and take part in programming contests. Participants are usually offered several problems during programming contests. Long before the start the friends decided that they will implement a problem if at least two of them are sure about the solution....
256 megabytes
import java.util.Scanner; public class Team { public static void main(String[] args) { Scanner in = new Scanner(System.in); int n = in.nextInt(); int [] toCheck = new int [3]; int result = 0; int sum = 0; for(int p = 0; p < n; p++){ for(int i = 0; i < 3;...
Java
["3\n1 1 0\n1 1 1\n1 0 0", "2\n1 0 0\n0 1 1"]
2 seconds
["2", "1"]
NoteIn the first sample Petya and Vasya are sure that they know how to solve the first problem and all three of them know how to solve the second problem. That means that they will write solutions for these problems. Only Petya is sure about the solution for the third problem, but that isn't enough, so the friends won'...
Java 7
standard input
[ "greedy", "brute force" ]
3542adc74a41ccfd72008faf983ffab5
The first input line contains a single integer n (1 ≀ n ≀ 1000) β€” the number of problems in the contest. Then n lines contain three integers each, each integer is either 0 or 1. If the first number in the line equals 1, then Petya is sure about the problem's solution, otherwise he isn't sure. The second number shows Va...
800
Print a single integer β€” the number of problems the friends will implement on the contest.
standard output
PASSED
f1402fc9b41caa3290b1fd3efdba00af
train_000.jsonl
1349623800
One day three best friends Petya, Vasya and Tonya decided to form a team and take part in programming contests. Participants are usually offered several problems during programming contests. Long before the start the friends decided that they will implement a problem if at least two of them are sure about the solution....
256 megabytes
import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; import java.io.PrintWriter; import java.util.StringTokenizer; /* * some cheeky quote */ public class Main { FastScanner in; PrintWriter out; public void solve() throws IOException { int test = in....
Java
["3\n1 1 0\n1 1 1\n1 0 0", "2\n1 0 0\n0 1 1"]
2 seconds
["2", "1"]
NoteIn the first sample Petya and Vasya are sure that they know how to solve the first problem and all three of them know how to solve the second problem. That means that they will write solutions for these problems. Only Petya is sure about the solution for the third problem, but that isn't enough, so the friends won'...
Java 7
standard input
[ "greedy", "brute force" ]
3542adc74a41ccfd72008faf983ffab5
The first input line contains a single integer n (1 ≀ n ≀ 1000) β€” the number of problems in the contest. Then n lines contain three integers each, each integer is either 0 or 1. If the first number in the line equals 1, then Petya is sure about the problem's solution, otherwise he isn't sure. The second number shows Va...
800
Print a single integer β€” the number of problems the friends will implement on the contest.
standard output
PASSED
29afbc67bbb08f2782677098d0f375bc
train_000.jsonl
1349623800
One day three best friends Petya, Vasya and Tonya decided to form a team and take part in programming contests. Participants are usually offered several problems during programming contests. Long before the start the friends decided that they will implement a problem if at least two of them are sure about the solution....
256 megabytes
import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; public class Team { public static void main(String arg[]) throws IOException { BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); int numberProblems = Integer.parseInt(br.readLine...
Java
["3\n1 1 0\n1 1 1\n1 0 0", "2\n1 0 0\n0 1 1"]
2 seconds
["2", "1"]
NoteIn the first sample Petya and Vasya are sure that they know how to solve the first problem and all three of them know how to solve the second problem. That means that they will write solutions for these problems. Only Petya is sure about the solution for the third problem, but that isn't enough, so the friends won'...
Java 7
standard input
[ "greedy", "brute force" ]
3542adc74a41ccfd72008faf983ffab5
The first input line contains a single integer n (1 ≀ n ≀ 1000) β€” the number of problems in the contest. Then n lines contain three integers each, each integer is either 0 or 1. If the first number in the line equals 1, then Petya is sure about the problem's solution, otherwise he isn't sure. The second number shows Va...
800
Print a single integer β€” the number of problems the friends will implement on the contest.
standard output
PASSED
c3970f03525897f2434ab05f636cdbe6
train_000.jsonl
1349623800
One day three best friends Petya, Vasya and Tonya decided to form a team and take part in programming contests. Participants are usually offered several problems during programming contests. Long before the start the friends decided that they will implement a problem if at least two of them are sure about the solution....
256 megabytes
import java.util.Scanner; public class Team { public static void main(String[] args) { Scanner teclado = new Scanner(System.in); int num,i,j,total=0; num = teclado.nextInt(); teclado.nextLine(); String[] problemas = new String[num]; int[] ...
Java
["3\n1 1 0\n1 1 1\n1 0 0", "2\n1 0 0\n0 1 1"]
2 seconds
["2", "1"]
NoteIn the first sample Petya and Vasya are sure that they know how to solve the first problem and all three of them know how to solve the second problem. That means that they will write solutions for these problems. Only Petya is sure about the solution for the third problem, but that isn't enough, so the friends won'...
Java 7
standard input
[ "greedy", "brute force" ]
3542adc74a41ccfd72008faf983ffab5
The first input line contains a single integer n (1 ≀ n ≀ 1000) β€” the number of problems in the contest. Then n lines contain three integers each, each integer is either 0 or 1. If the first number in the line equals 1, then Petya is sure about the problem's solution, otherwise he isn't sure. The second number shows Va...
800
Print a single integer β€” the number of problems the friends will implement on the contest.
standard output
PASSED
0c2e787cacfd883d43fe0736bf15b7b0
train_000.jsonl
1349623800
One day three best friends Petya, Vasya and Tonya decided to form a team and take part in programming contests. Participants are usually offered several problems during programming contests. Long before the start the friends decided that they will implement a problem if at least two of them are sure about the solution....
256 megabytes
/* * To change this license header, choose License Headers in Project Properties. * To change this template file, choose Tools | Templates * and open the template in the editor. */ //package Day131215; import java.util.Scanner; /** * * @author Saksham Rastogi */ public class ATeam { public static void mai...
Java
["3\n1 1 0\n1 1 1\n1 0 0", "2\n1 0 0\n0 1 1"]
2 seconds
["2", "1"]
NoteIn the first sample Petya and Vasya are sure that they know how to solve the first problem and all three of them know how to solve the second problem. That means that they will write solutions for these problems. Only Petya is sure about the solution for the third problem, but that isn't enough, so the friends won'...
Java 7
standard input
[ "greedy", "brute force" ]
3542adc74a41ccfd72008faf983ffab5
The first input line contains a single integer n (1 ≀ n ≀ 1000) β€” the number of problems in the contest. Then n lines contain three integers each, each integer is either 0 or 1. If the first number in the line equals 1, then Petya is sure about the problem's solution, otherwise he isn't sure. The second number shows Va...
800
Print a single integer β€” the number of problems the friends will implement on the contest.
standard output
PASSED
5854f909698cd065c1ccfe61a9213fa0
train_000.jsonl
1349623800
One day three best friends Petya, Vasya and Tonya decided to form a team and take part in programming contests. Participants are usually offered several problems during programming contests. Long before the start the friends decided that they will implement a problem if at least two of them are sure about the solution....
256 megabytes
/* * To change this license header, choose License Headers in Project Properties. * To change this template file, choose Tools | Templates * and open the template in the editor. */ //package Day131215; import java.util.Scanner; /** * * @author Saksham Rastogi */ public class ATeam { public static void mai...
Java
["3\n1 1 0\n1 1 1\n1 0 0", "2\n1 0 0\n0 1 1"]
2 seconds
["2", "1"]
NoteIn the first sample Petya and Vasya are sure that they know how to solve the first problem and all three of them know how to solve the second problem. That means that they will write solutions for these problems. Only Petya is sure about the solution for the third problem, but that isn't enough, so the friends won'...
Java 7
standard input
[ "greedy", "brute force" ]
3542adc74a41ccfd72008faf983ffab5
The first input line contains a single integer n (1 ≀ n ≀ 1000) β€” the number of problems in the contest. Then n lines contain three integers each, each integer is either 0 or 1. If the first number in the line equals 1, then Petya is sure about the problem's solution, otherwise he isn't sure. The second number shows Va...
800
Print a single integer β€” the number of problems the friends will implement on the contest.
standard output
PASSED
474cbdef4d1be8b2a617d65a7e1d8847
train_000.jsonl
1349623800
One day three best friends Petya, Vasya and Tonya decided to form a team and take part in programming contests. Participants are usually offered several problems during programming contests. Long before the start the friends decided that they will implement a problem if at least two of them are sure about the solution....
256 megabytes
import java.util.*; public class Team { public static void main(String[] args) { Team t = new Team(); t.go(); } public void go() { Scanner in = new Scanner(System.in); int n = Integer.parseInt(in.nextLine()); int answer = 0; for (int i = 0; i < n; i++) { int c = 0; String[] s = in.nextLine().spl...
Java
["3\n1 1 0\n1 1 1\n1 0 0", "2\n1 0 0\n0 1 1"]
2 seconds
["2", "1"]
NoteIn the first sample Petya and Vasya are sure that they know how to solve the first problem and all three of them know how to solve the second problem. That means that they will write solutions for these problems. Only Petya is sure about the solution for the third problem, but that isn't enough, so the friends won'...
Java 7
standard input
[ "greedy", "brute force" ]
3542adc74a41ccfd72008faf983ffab5
The first input line contains a single integer n (1 ≀ n ≀ 1000) β€” the number of problems in the contest. Then n lines contain three integers each, each integer is either 0 or 1. If the first number in the line equals 1, then Petya is sure about the problem's solution, otherwise he isn't sure. The second number shows Va...
800
Print a single integer β€” the number of problems the friends will implement on the contest.
standard output
PASSED
08a87122d6d997ab8477e112d3d0e15d
train_000.jsonl
1349623800
One day three best friends Petya, Vasya and Tonya decided to form a team and take part in programming contests. Participants are usually offered several problems during programming contests. Long before the start the friends decided that they will implement a problem if at least two of them are sure about the solution....
256 megabytes
import java.io.*; public class team { public static void main(String args[])throws IOException { int a,b,c,i,n,flag=0,count=0; char ch; String p; BufferedReader br=new BufferedReader(new InputStreamReader(System.in)); n=Integer.parseInt(br.readLine()); for(i=1;i<=n;i++) { p=br.readLine(); ch=p.cha...
Java
["3\n1 1 0\n1 1 1\n1 0 0", "2\n1 0 0\n0 1 1"]
2 seconds
["2", "1"]
NoteIn the first sample Petya and Vasya are sure that they know how to solve the first problem and all three of them know how to solve the second problem. That means that they will write solutions for these problems. Only Petya is sure about the solution for the third problem, but that isn't enough, so the friends won'...
Java 7
standard input
[ "greedy", "brute force" ]
3542adc74a41ccfd72008faf983ffab5
The first input line contains a single integer n (1 ≀ n ≀ 1000) β€” the number of problems in the contest. Then n lines contain three integers each, each integer is either 0 or 1. If the first number in the line equals 1, then Petya is sure about the problem's solution, otherwise he isn't sure. The second number shows Va...
800
Print a single integer β€” the number of problems the friends will implement on the contest.
standard output
PASSED
a3e8f5f3c1a32414b7d47523170483f8
train_000.jsonl
1349623800
One day three best friends Petya, Vasya and Tonya decided to form a team and take part in programming contests. Participants are usually offered several problems during programming contests. Long before the start the friends decided that they will implement a problem if at least two of them are sure about the solution....
256 megabytes
import java.util.Scanner; /** * * @author kai */ public class JavaApplication2 { /** * @param args the command line arguments */ public static void main(String[] args) { // TODO code application logic here Scanner in = new Scanner(System.in); int n = in.nextInt(); ...
Java
["3\n1 1 0\n1 1 1\n1 0 0", "2\n1 0 0\n0 1 1"]
2 seconds
["2", "1"]
NoteIn the first sample Petya and Vasya are sure that they know how to solve the first problem and all three of them know how to solve the second problem. That means that they will write solutions for these problems. Only Petya is sure about the solution for the third problem, but that isn't enough, so the friends won'...
Java 7
standard input
[ "greedy", "brute force" ]
3542adc74a41ccfd72008faf983ffab5
The first input line contains a single integer n (1 ≀ n ≀ 1000) β€” the number of problems in the contest. Then n lines contain three integers each, each integer is either 0 or 1. If the first number in the line equals 1, then Petya is sure about the problem's solution, otherwise he isn't sure. The second number shows Va...
800
Print a single integer β€” the number of problems the friends will implement on the contest.
standard output
PASSED
5b2af77c61dfed1c040356837fcdcd4e
train_000.jsonl
1349623800
One day three best friends Petya, Vasya and Tonya decided to form a team and take part in programming contests. Participants are usually offered several problems during programming contests. Long before the start the friends decided that they will implement a problem if at least two of them are sure about the solution....
256 megabytes
import java.util.Scanner; public class CodeForces { static Scanner scanner = new Scanner(System.in); public static boolean sureSolution (){ int x = 0; for (int i = 0; i < 3; i++) { int y = scanner.nextInt(); if (y == 1) x++; } ...
Java
["3\n1 1 0\n1 1 1\n1 0 0", "2\n1 0 0\n0 1 1"]
2 seconds
["2", "1"]
NoteIn the first sample Petya and Vasya are sure that they know how to solve the first problem and all three of them know how to solve the second problem. That means that they will write solutions for these problems. Only Petya is sure about the solution for the third problem, but that isn't enough, so the friends won'...
Java 7
standard input
[ "greedy", "brute force" ]
3542adc74a41ccfd72008faf983ffab5
The first input line contains a single integer n (1 ≀ n ≀ 1000) β€” the number of problems in the contest. Then n lines contain three integers each, each integer is either 0 or 1. If the first number in the line equals 1, then Petya is sure about the problem's solution, otherwise he isn't sure. The second number shows Va...
800
Print a single integer β€” the number of problems the friends will implement on the contest.
standard output
PASSED
662e772fc12de7dd1ee822ddb34707f2
train_000.jsonl
1349623800
One day three best friends Petya, Vasya and Tonya decided to form a team and take part in programming contests. Participants are usually offered several problems during programming contests. Long before the start the friends decided that they will implement a problem if at least two of them are sure about the solution....
256 megabytes
public class Main { public static void main(String[] args) throws java.io.IOException{ java.util.Scanner sc = new java.util.Scanner(new java.io.BufferedInputStream(System.in)); int p=sc.nextInt(); int s=0; for(int i=0;i<=p;i++) { String team=sc.nextLine(); ...
Java
["3\n1 1 0\n1 1 1\n1 0 0", "2\n1 0 0\n0 1 1"]
2 seconds
["2", "1"]
NoteIn the first sample Petya and Vasya are sure that they know how to solve the first problem and all three of them know how to solve the second problem. That means that they will write solutions for these problems. Only Petya is sure about the solution for the third problem, but that isn't enough, so the friends won'...
Java 7
standard input
[ "greedy", "brute force" ]
3542adc74a41ccfd72008faf983ffab5
The first input line contains a single integer n (1 ≀ n ≀ 1000) β€” the number of problems in the contest. Then n lines contain three integers each, each integer is either 0 or 1. If the first number in the line equals 1, then Petya is sure about the problem's solution, otherwise he isn't sure. The second number shows Va...
800
Print a single integer β€” the number of problems the friends will implement on the contest.
standard output
PASSED
a081216035577c3076e300387aa23c75
train_000.jsonl
1349623800
One day three best friends Petya, Vasya and Tonya decided to form a team and take part in programming contests. Participants are usually offered several problems during programming contests. Long before the start the friends decided that they will implement a problem if at least two of them are sure about the solution....
256 megabytes
public class Main { public static void main(String[] args) throws java.io.IOException{ java.util.Scanner sc = new java.util.Scanner(new java.io.BufferedInputStream(System.in)); int p=sc.nextInt(); int s=0; for(int i=0;i<=p;i++) { String team=sc.nextLine(); ...
Java
["3\n1 1 0\n1 1 1\n1 0 0", "2\n1 0 0\n0 1 1"]
2 seconds
["2", "1"]
NoteIn the first sample Petya and Vasya are sure that they know how to solve the first problem and all three of them know how to solve the second problem. That means that they will write solutions for these problems. Only Petya is sure about the solution for the third problem, but that isn't enough, so the friends won'...
Java 7
standard input
[ "greedy", "brute force" ]
3542adc74a41ccfd72008faf983ffab5
The first input line contains a single integer n (1 ≀ n ≀ 1000) β€” the number of problems in the contest. Then n lines contain three integers each, each integer is either 0 or 1. If the first number in the line equals 1, then Petya is sure about the problem's solution, otherwise he isn't sure. The second number shows Va...
800
Print a single integer β€” the number of problems the friends will implement on the contest.
standard output
PASSED
345e4ffd3217e2b61816a0b9f2a09eb4
train_000.jsonl
1349623800
One day three best friends Petya, Vasya and Tonya decided to form a team and take part in programming contests. Participants are usually offered several problems during programming contests. Long before the start the friends decided that they will implement a problem if at least two of them are sure about the solution....
256 megabytes
public class Main { public static void main(String[] args) throws java.io.IOException{ java.util.Scanner sc = new java.util.Scanner(new java.io.BufferedInputStream(System.in)); int p=sc.nextInt(); int s=0; for(int i=0;i<=p;i++) { String team=sc.nextLine(); ...
Java
["3\n1 1 0\n1 1 1\n1 0 0", "2\n1 0 0\n0 1 1"]
2 seconds
["2", "1"]
NoteIn the first sample Petya and Vasya are sure that they know how to solve the first problem and all three of them know how to solve the second problem. That means that they will write solutions for these problems. Only Petya is sure about the solution for the third problem, but that isn't enough, so the friends won'...
Java 7
standard input
[ "greedy", "brute force" ]
3542adc74a41ccfd72008faf983ffab5
The first input line contains a single integer n (1 ≀ n ≀ 1000) β€” the number of problems in the contest. Then n lines contain three integers each, each integer is either 0 or 1. If the first number in the line equals 1, then Petya is sure about the problem's solution, otherwise he isn't sure. The second number shows Va...
800
Print a single integer β€” the number of problems the friends will implement on the contest.
standard output
PASSED
219fdd428b88393455675a6c835cf408
train_000.jsonl
1349623800
One day three best friends Petya, Vasya and Tonya decided to form a team and take part in programming contests. Participants are usually offered several problems during programming contests. Long before the start the friends decided that they will implement a problem if at least two of them are sure about the solution....
256 megabytes
import java.util.*; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int c = Integer.parseInt(sc.nextLine()); int u = 0; for (int i = 0; i < c; i++) { String l = sc.nextLine(); int o = 0; if (l.charA...
Java
["3\n1 1 0\n1 1 1\n1 0 0", "2\n1 0 0\n0 1 1"]
2 seconds
["2", "1"]
NoteIn the first sample Petya and Vasya are sure that they know how to solve the first problem and all three of them know how to solve the second problem. That means that they will write solutions for these problems. Only Petya is sure about the solution for the third problem, but that isn't enough, so the friends won'...
Java 7
standard input
[ "greedy", "brute force" ]
3542adc74a41ccfd72008faf983ffab5
The first input line contains a single integer n (1 ≀ n ≀ 1000) β€” the number of problems in the contest. Then n lines contain three integers each, each integer is either 0 or 1. If the first number in the line equals 1, then Petya is sure about the problem's solution, otherwise he isn't sure. The second number shows Va...
800
Print a single integer β€” the number of problems the friends will implement on the contest.
standard output
PASSED
fdc41f6cd1d0378c1f31b763abe7ed25
train_000.jsonl
1349623800
One day three best friends Petya, Vasya and Tonya decided to form a team and take part in programming contests. Participants are usually offered several problems during programming contests. Long before the start the friends decided that they will implement a problem if at least two of them are sure about the solution....
256 megabytes
import java.util.Scanner; public class Team { static Scanner sc= new Scanner(System.in); public static void main(String args []){ int n =sc.nextInt(); int x,y,z,k=0; for(int i=0;i<n;i++){ x=sc.nextInt(2); y=sc.nextInt(2); z=sc.nextInt(2); if(x+y+z>1) k++; } System.out.println(k); } }...
Java
["3\n1 1 0\n1 1 1\n1 0 0", "2\n1 0 0\n0 1 1"]
2 seconds
["2", "1"]
NoteIn the first sample Petya and Vasya are sure that they know how to solve the first problem and all three of them know how to solve the second problem. That means that they will write solutions for these problems. Only Petya is sure about the solution for the third problem, but that isn't enough, so the friends won'...
Java 7
standard input
[ "greedy", "brute force" ]
3542adc74a41ccfd72008faf983ffab5
The first input line contains a single integer n (1 ≀ n ≀ 1000) β€” the number of problems in the contest. Then n lines contain three integers each, each integer is either 0 or 1. If the first number in the line equals 1, then Petya is sure about the problem's solution, otherwise he isn't sure. The second number shows Va...
800
Print a single integer β€” the number of problems the friends will implement on the contest.
standard output
PASSED
9775e41a8acaf94ba75241e8051b3c5d
train_000.jsonl
1349623800
One day three best friends Petya, Vasya and Tonya decided to form a team and take part in programming contests. Participants are usually offered several problems during programming contests. Long before the start the friends decided that they will implement a problem if at least two of them are sure about the solution....
256 megabytes
import java.io.*; import java.util.*; public class Main { public static void main(String[] args) { Scanner in = new Scanner(System.in); PrintWriter out = new PrintWriter(System.out); int inCount = in.nextInt(); int tNum = 0; int p = 0; int q = 0; int c = 0;...
Java
["3\n1 1 0\n1 1 1\n1 0 0", "2\n1 0 0\n0 1 1"]
2 seconds
["2", "1"]
NoteIn the first sample Petya and Vasya are sure that they know how to solve the first problem and all three of them know how to solve the second problem. That means that they will write solutions for these problems. Only Petya is sure about the solution for the third problem, but that isn't enough, so the friends won'...
Java 7
standard input
[ "greedy", "brute force" ]
3542adc74a41ccfd72008faf983ffab5
The first input line contains a single integer n (1 ≀ n ≀ 1000) β€” the number of problems in the contest. Then n lines contain three integers each, each integer is either 0 or 1. If the first number in the line equals 1, then Petya is sure about the problem's solution, otherwise he isn't sure. The second number shows Va...
800
Print a single integer β€” the number of problems the friends will implement on the contest.
standard output
PASSED
5f6da54ce69d000b3dbf5cc8c34fd2f4
train_000.jsonl
1349623800
One day three best friends Petya, Vasya and Tonya decided to form a team and take part in programming contests. Participants are usually offered several problems during programming contests. Long before the start the friends decided that they will implement a problem if at least two of them are sure about the solution....
256 megabytes
/* package whatever; // don't place package name! */ import java.util.*; import java.lang.*; import java.io.*; /* Name of the class has to be "Main" only if the class is public. */ public class Ideone { public static void main (String[] args) throws java.lang.Exception { Scanner input=new Scanner(Sys...
Java
["3\n1 1 0\n1 1 1\n1 0 0", "2\n1 0 0\n0 1 1"]
2 seconds
["2", "1"]
NoteIn the first sample Petya and Vasya are sure that they know how to solve the first problem and all three of them know how to solve the second problem. That means that they will write solutions for these problems. Only Petya is sure about the solution for the third problem, but that isn't enough, so the friends won'...
Java 7
standard input
[ "greedy", "brute force" ]
3542adc74a41ccfd72008faf983ffab5
The first input line contains a single integer n (1 ≀ n ≀ 1000) β€” the number of problems in the contest. Then n lines contain three integers each, each integer is either 0 or 1. If the first number in the line equals 1, then Petya is sure about the problem's solution, otherwise he isn't sure. The second number shows Va...
800
Print a single integer β€” the number of problems the friends will implement on the contest.
standard output
PASSED
af6eeca0141f9f7ca246fdcbf16ad03c
train_000.jsonl
1349623800
One day three best friends Petya, Vasya and Tonya decided to form a team and take part in programming contests. Participants are usually offered several problems during programming contests. Long before the start the friends decided that they will implement a problem if at least two of them are sure about the solution....
256 megabytes
import java.util.Scanner; /** ** Created by Alik on 10/21/2015. */ public class Problem_231A { public static void main(String args[]){ Scanner in = new Scanner(System.in); int number = in.nextInt(); int first, second, third; int count = 0; for (int i = 0; i < number; i++)...
Java
["3\n1 1 0\n1 1 1\n1 0 0", "2\n1 0 0\n0 1 1"]
2 seconds
["2", "1"]
NoteIn the first sample Petya and Vasya are sure that they know how to solve the first problem and all three of them know how to solve the second problem. That means that they will write solutions for these problems. Only Petya is sure about the solution for the third problem, but that isn't enough, so the friends won'...
Java 7
standard input
[ "greedy", "brute force" ]
3542adc74a41ccfd72008faf983ffab5
The first input line contains a single integer n (1 ≀ n ≀ 1000) β€” the number of problems in the contest. Then n lines contain three integers each, each integer is either 0 or 1. If the first number in the line equals 1, then Petya is sure about the problem's solution, otherwise he isn't sure. The second number shows Va...
800
Print a single integer β€” the number of problems the friends will implement on the contest.
standard output
PASSED
9509fdf266323f932911dbe3c7eb5c1d
train_000.jsonl
1349623800
One day three best friends Petya, Vasya and Tonya decided to form a team and take part in programming contests. Participants are usually offered several problems during programming contests. Long before the start the friends decided that they will implement a problem if at least two of them are sure about the solution....
256 megabytes
import java.util.Scanner; /** ** Created by Alik on 10/21/2015. */ public class Problem_231A { public static void main(String args[]){ Scanner in = new Scanner(System.in); int number = in.nextInt(); int first, second, third; int count = 0; for (int i = 0; i < number; i++)...
Java
["3\n1 1 0\n1 1 1\n1 0 0", "2\n1 0 0\n0 1 1"]
2 seconds
["2", "1"]
NoteIn the first sample Petya and Vasya are sure that they know how to solve the first problem and all three of them know how to solve the second problem. That means that they will write solutions for these problems. Only Petya is sure about the solution for the third problem, but that isn't enough, so the friends won'...
Java 7
standard input
[ "greedy", "brute force" ]
3542adc74a41ccfd72008faf983ffab5
The first input line contains a single integer n (1 ≀ n ≀ 1000) β€” the number of problems in the contest. Then n lines contain three integers each, each integer is either 0 or 1. If the first number in the line equals 1, then Petya is sure about the problem's solution, otherwise he isn't sure. The second number shows Va...
800
Print a single integer β€” the number of problems the friends will implement on the contest.
standard output
PASSED
0fad50f2989c45d1c3d807e8f397e9fb
train_000.jsonl
1349623800
One day three best friends Petya, Vasya and Tonya decided to form a team and take part in programming contests. Participants are usually offered several problems during programming contests. Long before the start the friends decided that they will implement a problem if at least two of them are sure about the solution....
256 megabytes
import java.util.Scanner; public class Team { public static void main(String[] args) { Scanner input = new Scanner(System.in); int problems = input.nextInt(); int membersValue [][] = new int[problems][3]; int count = 0; int sum = 0; // the sum of memberValue to e...
Java
["3\n1 1 0\n1 1 1\n1 0 0", "2\n1 0 0\n0 1 1"]
2 seconds
["2", "1"]
NoteIn the first sample Petya and Vasya are sure that they know how to solve the first problem and all three of them know how to solve the second problem. That means that they will write solutions for these problems. Only Petya is sure about the solution for the third problem, but that isn't enough, so the friends won'...
Java 7
standard input
[ "greedy", "brute force" ]
3542adc74a41ccfd72008faf983ffab5
The first input line contains a single integer n (1 ≀ n ≀ 1000) β€” the number of problems in the contest. Then n lines contain three integers each, each integer is either 0 or 1. If the first number in the line equals 1, then Petya is sure about the problem's solution, otherwise he isn't sure. The second number shows Va...
800
Print a single integer β€” the number of problems the friends will implement on the contest.
standard output
PASSED
7d30245b9d6b44211d88654d78df5fd4
train_000.jsonl
1349623800
One day three best friends Petya, Vasya and Tonya decided to form a team and take part in programming contests. Participants are usually offered several problems during programming contests. Long before the start the friends decided that they will implement a problem if at least two of them are sure about the solution....
256 megabytes
import java.util.Scanner; public class Team { public static void main(String[] args) { Scanner input = new Scanner(System.in); int problems = input.nextInt(); int membersValue [][] = new int[problems][3]; int count = 0; int sum = 0; // the sum of memberValue to ea...
Java
["3\n1 1 0\n1 1 1\n1 0 0", "2\n1 0 0\n0 1 1"]
2 seconds
["2", "1"]
NoteIn the first sample Petya and Vasya are sure that they know how to solve the first problem and all three of them know how to solve the second problem. That means that they will write solutions for these problems. Only Petya is sure about the solution for the third problem, but that isn't enough, so the friends won'...
Java 7
standard input
[ "greedy", "brute force" ]
3542adc74a41ccfd72008faf983ffab5
The first input line contains a single integer n (1 ≀ n ≀ 1000) β€” the number of problems in the contest. Then n lines contain three integers each, each integer is either 0 or 1. If the first number in the line equals 1, then Petya is sure about the problem's solution, otherwise he isn't sure. The second number shows Va...
800
Print a single integer β€” the number of problems the friends will implement on the contest.
standard output
PASSED
e737d558c938d7ca9cb325bc57383c9c
train_000.jsonl
1349623800
One day three best friends Petya, Vasya and Tonya decided to form a team and take part in programming contests. Participants are usually offered several problems during programming contests. Long before the start the friends decided that they will implement a problem if at least two of them are sure about the solution....
256 megabytes
/* package whatever; // don't place package name! */ import java.util.*; import java.lang.*; import java.io.*; /* Name of the class has to be "Main" only if the class is public. */ public class Main { public static void main (String[] args) throws java.lang.Exception { int a,b,c,d,flag=0; Scan...
Java
["3\n1 1 0\n1 1 1\n1 0 0", "2\n1 0 0\n0 1 1"]
2 seconds
["2", "1"]
NoteIn the first sample Petya and Vasya are sure that they know how to solve the first problem and all three of them know how to solve the second problem. That means that they will write solutions for these problems. Only Petya is sure about the solution for the third problem, but that isn't enough, so the friends won'...
Java 7
standard input
[ "greedy", "brute force" ]
3542adc74a41ccfd72008faf983ffab5
The first input line contains a single integer n (1 ≀ n ≀ 1000) β€” the number of problems in the contest. Then n lines contain three integers each, each integer is either 0 or 1. If the first number in the line equals 1, then Petya is sure about the problem's solution, otherwise he isn't sure. The second number shows Va...
800
Print a single integer β€” the number of problems the friends will implement on the contest.
standard output
PASSED
0d9d367f511514fc846c51bde56ddf3f
train_000.jsonl
1349623800
One day three best friends Petya, Vasya and Tonya decided to form a team and take part in programming contests. Participants are usually offered several problems during programming contests. Long before the start the friends decided that they will implement a problem if at least two of them are sure about the solution....
256 megabytes
import java.util.*; import java.lang.*; import java.io.*; public class Main { public static void main (String[] args) throws java.lang.Exception { int a,b,c,d,flag=0; Scanner s= new Scanner(System.in); int n=s.nextInt(); for(int i=0;i<n;i++) { a=s.nextInt(...
Java
["3\n1 1 0\n1 1 1\n1 0 0", "2\n1 0 0\n0 1 1"]
2 seconds
["2", "1"]
NoteIn the first sample Petya and Vasya are sure that they know how to solve the first problem and all three of them know how to solve the second problem. That means that they will write solutions for these problems. Only Petya is sure about the solution for the third problem, but that isn't enough, so the friends won'...
Java 7
standard input
[ "greedy", "brute force" ]
3542adc74a41ccfd72008faf983ffab5
The first input line contains a single integer n (1 ≀ n ≀ 1000) β€” the number of problems in the contest. Then n lines contain three integers each, each integer is either 0 or 1. If the first number in the line equals 1, then Petya is sure about the problem's solution, otherwise he isn't sure. The second number shows Va...
800
Print a single integer β€” the number of problems the friends will implement on the contest.
standard output
PASSED
ef068c133e51549be727039dddd067ef
train_000.jsonl
1349623800
One day three best friends Petya, Vasya and Tonya decided to form a team and take part in programming contests. Participants are usually offered several problems during programming contests. Long before the start the friends decided that they will implement a problem if at least two of them are sure about the solution....
256 megabytes
import java.util.Scanner; public class Rounds { public static void main(String args []){ Scanner rr=new Scanner(System.in); int k=rr.nextInt(); int l=0; int s=0; for(int i=0;i<k;i++){ int a=rr.nextInt(); int b=rr.nextInt(); int c=rr.nextInt(); l++; ...
Java
["3\n1 1 0\n1 1 1\n1 0 0", "2\n1 0 0\n0 1 1"]
2 seconds
["2", "1"]
NoteIn the first sample Petya and Vasya are sure that they know how to solve the first problem and all three of them know how to solve the second problem. That means that they will write solutions for these problems. Only Petya is sure about the solution for the third problem, but that isn't enough, so the friends won'...
Java 7
standard input
[ "greedy", "brute force" ]
3542adc74a41ccfd72008faf983ffab5
The first input line contains a single integer n (1 ≀ n ≀ 1000) β€” the number of problems in the contest. Then n lines contain three integers each, each integer is either 0 or 1. If the first number in the line equals 1, then Petya is sure about the problem's solution, otherwise he isn't sure. The second number shows Va...
800
Print a single integer β€” the number of problems the friends will implement on the contest.
standard output
PASSED
49ac2dac00c74535b43ed256fe780111
train_000.jsonl
1349623800
One day three best friends Petya, Vasya and Tonya decided to form a team and take part in programming contests. Participants are usually offered several problems during programming contests. Long before the start the friends decided that they will implement a problem if at least two of them are sure about the solution....
256 megabytes
import java.util.Scanner; public class A231 { public static void main(String args[]){ Scanner in = new Scanner(System.in); int count,total=0; int n = in.nextInt(); for(int i = 0; i < n; i++){ count=0; for(int j = 0; j<3;j++){ if(in.nextInt()==...
Java
["3\n1 1 0\n1 1 1\n1 0 0", "2\n1 0 0\n0 1 1"]
2 seconds
["2", "1"]
NoteIn the first sample Petya and Vasya are sure that they know how to solve the first problem and all three of them know how to solve the second problem. That means that they will write solutions for these problems. Only Petya is sure about the solution for the third problem, but that isn't enough, so the friends won'...
Java 7
standard input
[ "greedy", "brute force" ]
3542adc74a41ccfd72008faf983ffab5
The first input line contains a single integer n (1 ≀ n ≀ 1000) β€” the number of problems in the contest. Then n lines contain three integers each, each integer is either 0 or 1. If the first number in the line equals 1, then Petya is sure about the problem's solution, otherwise he isn't sure. The second number shows Va...
800
Print a single integer β€” the number of problems the friends will implement on the contest.
standard output
PASSED
250fa532e0862dbf86bf573c35ef5a4f
train_000.jsonl
1349623800
One day three best friends Petya, Vasya and Tonya decided to form a team and take part in programming contests. Participants are usually offered several problems during programming contests. Long before the start the friends decided that they will implement a problem if at least two of them are sure about the solution....
256 megabytes
import java.util.Scanner; public class A231 { public static void main(String args[]){ Scanner in = new Scanner(System.in); int total=0; int n = in.nextInt(); for(int i = 0; i < n; i++){ if((in.nextInt()+in.nextInt()+in.nextInt())>1) total++; } ...
Java
["3\n1 1 0\n1 1 1\n1 0 0", "2\n1 0 0\n0 1 1"]
2 seconds
["2", "1"]
NoteIn the first sample Petya and Vasya are sure that they know how to solve the first problem and all three of them know how to solve the second problem. That means that they will write solutions for these problems. Only Petya is sure about the solution for the third problem, but that isn't enough, so the friends won'...
Java 7
standard input
[ "greedy", "brute force" ]
3542adc74a41ccfd72008faf983ffab5
The first input line contains a single integer n (1 ≀ n ≀ 1000) β€” the number of problems in the contest. Then n lines contain three integers each, each integer is either 0 or 1. If the first number in the line equals 1, then Petya is sure about the problem's solution, otherwise he isn't sure. The second number shows Va...
800
Print a single integer β€” the number of problems the friends will implement on the contest.
standard output
PASSED
dcf32c7f6e07304debf1601bab1af095
train_000.jsonl
1349623800
One day three best friends Petya, Vasya and Tonya decided to form a team and take part in programming contests. Participants are usually offered several problems during programming contests. Long before the start the friends decided that they will implement a problem if at least two of them are sure about the solution....
256 megabytes
import java.io.BufferedReader; import java.io.IOException; import java.io.InputStream; import java.io.InputStreamReader; import java.util.StringTokenizer; public class Problem_231A { public static void main(String[] arge) { new Problem_231A().run(); } void run() { IntReader intReader = new IntReader(System.in...
Java
["3\n1 1 0\n1 1 1\n1 0 0", "2\n1 0 0\n0 1 1"]
2 seconds
["2", "1"]
NoteIn the first sample Petya and Vasya are sure that they know how to solve the first problem and all three of them know how to solve the second problem. That means that they will write solutions for these problems. Only Petya is sure about the solution for the third problem, but that isn't enough, so the friends won'...
Java 7
standard input
[ "greedy", "brute force" ]
3542adc74a41ccfd72008faf983ffab5
The first input line contains a single integer n (1 ≀ n ≀ 1000) β€” the number of problems in the contest. Then n lines contain three integers each, each integer is either 0 or 1. If the first number in the line equals 1, then Petya is sure about the problem's solution, otherwise he isn't sure. The second number shows Va...
800
Print a single integer β€” the number of problems the friends will implement on the contest.
standard output
PASSED
3e0431bab5c1168eaca2847ddb3ec6a3
train_000.jsonl
1349623800
One day three best friends Petya, Vasya and Tonya decided to form a team and take part in programming contests. Participants are usually offered several problems during programming contests. Long before the start the friends decided that they will implement a problem if at least two of them are sure about the solution....
256 megabytes
import java.io.BufferedReader; import java.io.InputStreamReader; import java.util.Scanner; public class Problem_231A { public static void main(String[] arge) { try (Scanner scan = new Scanner(new BufferedReader(new InputStreamReader(System.in)));) { int n = scan.nextInt(); int solvedCount = 0; for (int i =...
Java
["3\n1 1 0\n1 1 1\n1 0 0", "2\n1 0 0\n0 1 1"]
2 seconds
["2", "1"]
NoteIn the first sample Petya and Vasya are sure that they know how to solve the first problem and all three of them know how to solve the second problem. That means that they will write solutions for these problems. Only Petya is sure about the solution for the third problem, but that isn't enough, so the friends won'...
Java 7
standard input
[ "greedy", "brute force" ]
3542adc74a41ccfd72008faf983ffab5
The first input line contains a single integer n (1 ≀ n ≀ 1000) β€” the number of problems in the contest. Then n lines contain three integers each, each integer is either 0 or 1. If the first number in the line equals 1, then Petya is sure about the problem's solution, otherwise he isn't sure. The second number shows Va...
800
Print a single integer β€” the number of problems the friends will implement on the contest.
standard output
PASSED
33f2ceda6161426e0af1b3f12b8c0822
train_000.jsonl
1349623800
One day three best friends Petya, Vasya and Tonya decided to form a team and take part in programming contests. Participants are usually offered several problems during programming contests. Long before the start the friends decided that they will implement a problem if at least two of them are sure about the solution....
256 megabytes
import java.io.BufferedReader; import java.io.InputStreamReader; import java.util.Scanner; public class Problem_231A { public static void main(String[] arge) { try (Scanner scan = new Scanner(new BufferedReader(new InputStreamReader(System.in)));) { int n = scan.nextInt(); int solvedCount = 0; int ansOfPet...
Java
["3\n1 1 0\n1 1 1\n1 0 0", "2\n1 0 0\n0 1 1"]
2 seconds
["2", "1"]
NoteIn the first sample Petya and Vasya are sure that they know how to solve the first problem and all three of them know how to solve the second problem. That means that they will write solutions for these problems. Only Petya is sure about the solution for the third problem, but that isn't enough, so the friends won'...
Java 7
standard input
[ "greedy", "brute force" ]
3542adc74a41ccfd72008faf983ffab5
The first input line contains a single integer n (1 ≀ n ≀ 1000) β€” the number of problems in the contest. Then n lines contain three integers each, each integer is either 0 or 1. If the first number in the line equals 1, then Petya is sure about the problem's solution, otherwise he isn't sure. The second number shows Va...
800
Print a single integer β€” the number of problems the friends will implement on the contest.
standard output
PASSED
c07f51f812f5d1ac74bd5fd80ea6b91f
train_000.jsonl
1349623800
One day three best friends Petya, Vasya and Tonya decided to form a team and take part in programming contests. Participants are usually offered several problems during programming contests. Long before the start the friends decided that they will implement a problem if at least two of them are sure about the solution....
256 megabytes
import java.util.Scanner; public class HelloWorld{ public static void main(String []args){ int a,b,c,d,sum=0; Scanner scann = new Scanner(System.in); a = scann.nextInt(); for(int i = 0; i < a; i++) { b = scann.nextInt(); c =...
Java
["3\n1 1 0\n1 1 1\n1 0 0", "2\n1 0 0\n0 1 1"]
2 seconds
["2", "1"]
NoteIn the first sample Petya and Vasya are sure that they know how to solve the first problem and all three of them know how to solve the second problem. That means that they will write solutions for these problems. Only Petya is sure about the solution for the third problem, but that isn't enough, so the friends won'...
Java 7
standard input
[ "greedy", "brute force" ]
3542adc74a41ccfd72008faf983ffab5
The first input line contains a single integer n (1 ≀ n ≀ 1000) β€” the number of problems in the contest. Then n lines contain three integers each, each integer is either 0 or 1. If the first number in the line equals 1, then Petya is sure about the problem's solution, otherwise he isn't sure. The second number shows Va...
800
Print a single integer β€” the number of problems the friends will implement on the contest.
standard output
PASSED
02ad8d59dcf769f89731825207d5dbe8
train_000.jsonl
1349623800
One day three best friends Petya, Vasya and Tonya decided to form a team and take part in programming contests. Participants are usually offered several problems during programming contests. Long before the start the friends decided that they will implement a problem if at least two of them are sure about the solution....
256 megabytes
import java.util.Scanner; public class Team231A { public static void main(String[] args) { Scanner s = new Scanner(System.in); int n = s.nextInt(); int count=0; for (int i=0; i<n; i++) { int tot = s.nextInt() + s.nextInt() + s.nextInt(); if (tot >= 2) count ++; } System.out.println(count); } }
Java
["3\n1 1 0\n1 1 1\n1 0 0", "2\n1 0 0\n0 1 1"]
2 seconds
["2", "1"]
NoteIn the first sample Petya and Vasya are sure that they know how to solve the first problem and all three of them know how to solve the second problem. That means that they will write solutions for these problems. Only Petya is sure about the solution for the third problem, but that isn't enough, so the friends won'...
Java 7
standard input
[ "greedy", "brute force" ]
3542adc74a41ccfd72008faf983ffab5
The first input line contains a single integer n (1 ≀ n ≀ 1000) β€” the number of problems in the contest. Then n lines contain three integers each, each integer is either 0 or 1. If the first number in the line equals 1, then Petya is sure about the problem's solution, otherwise he isn't sure. The second number shows Va...
800
Print a single integer β€” the number of problems the friends will implement on the contest.
standard output
PASSED
dbb9063e1e98e2163dac07f20de58fc4
train_000.jsonl
1349623800
One day three best friends Petya, Vasya and Tonya decided to form a team and take part in programming contests. Participants are usually offered several problems during programming contests. Long before the start the friends decided that they will implement a problem if at least two of them are sure about the solution....
256 megabytes
import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int t = sc.nextInt(), sum = 0, counter = 0; while (t-- > 0) { sum = sc.nextInt() + sc.nextInt() + sc.nextInt(); if(sum > 1) counter++; } System.out.println(counter); } ...
Java
["3\n1 1 0\n1 1 1\n1 0 0", "2\n1 0 0\n0 1 1"]
2 seconds
["2", "1"]
NoteIn the first sample Petya and Vasya are sure that they know how to solve the first problem and all three of them know how to solve the second problem. That means that they will write solutions for these problems. Only Petya is sure about the solution for the third problem, but that isn't enough, so the friends won'...
Java 7
standard input
[ "greedy", "brute force" ]
3542adc74a41ccfd72008faf983ffab5
The first input line contains a single integer n (1 ≀ n ≀ 1000) β€” the number of problems in the contest. Then n lines contain three integers each, each integer is either 0 or 1. If the first number in the line equals 1, then Petya is sure about the problem's solution, otherwise he isn't sure. The second number shows Va...
800
Print a single integer β€” the number of problems the friends will implement on the contest.
standard output
PASSED
3685b43067ef9cda4236089218264ac1
train_000.jsonl
1349623800
One day three best friends Petya, Vasya and Tonya decided to form a team and take part in programming contests. Participants are usually offered several problems during programming contests. Long before the start the friends decided that they will implement a problem if at least two of them are sure about the solution....
256 megabytes
import java.util.*; public class team { /** * @param args */ private static Scanner in; public static void main(String[] args) { // TODO Auto-generated method stub int[] a=new int[3]; int n,count,op=0; in=new Scanner(System.in); n=in.nextInt(); for(int i=0;i<n;i++) { count=0; for (int j = ...
Java
["3\n1 1 0\n1 1 1\n1 0 0", "2\n1 0 0\n0 1 1"]
2 seconds
["2", "1"]
NoteIn the first sample Petya and Vasya are sure that they know how to solve the first problem and all three of them know how to solve the second problem. That means that they will write solutions for these problems. Only Petya is sure about the solution for the third problem, but that isn't enough, so the friends won'...
Java 7
standard input
[ "greedy", "brute force" ]
3542adc74a41ccfd72008faf983ffab5
The first input line contains a single integer n (1 ≀ n ≀ 1000) β€” the number of problems in the contest. Then n lines contain three integers each, each integer is either 0 or 1. If the first number in the line equals 1, then Petya is sure about the problem's solution, otherwise he isn't sure. The second number shows Va...
800
Print a single integer β€” the number of problems the friends will implement on the contest.
standard output
PASSED
d5fb5fdbe3b311aea6280e8347575a52
train_000.jsonl
1349623800
One day three best friends Petya, Vasya and Tonya decided to form a team and take part in programming contests. Participants are usually offered several problems during programming contests. Long before the start the friends decided that they will implement a problem if at least two of them are sure about the solution....
256 megabytes
import java.util.*; public class A { public static void main(String[] arg) { Scanner sc = new Scanner(System.in); int n = sc.nextInt();sc.nextLine(); int c= 0; for (int i = 0; i < n; i++) { if (sc.nextLine().matches(".*1.*1.*")) c++; } System.out.println(c); } }
Java
["3\n1 1 0\n1 1 1\n1 0 0", "2\n1 0 0\n0 1 1"]
2 seconds
["2", "1"]
NoteIn the first sample Petya and Vasya are sure that they know how to solve the first problem and all three of them know how to solve the second problem. That means that they will write solutions for these problems. Only Petya is sure about the solution for the third problem, but that isn't enough, so the friends won'...
Java 7
standard input
[ "greedy", "brute force" ]
3542adc74a41ccfd72008faf983ffab5
The first input line contains a single integer n (1 ≀ n ≀ 1000) β€” the number of problems in the contest. Then n lines contain three integers each, each integer is either 0 or 1. If the first number in the line equals 1, then Petya is sure about the problem's solution, otherwise he isn't sure. The second number shows Va...
800
Print a single integer β€” the number of problems the friends will implement on the contest.
standard output
PASSED
b29079958bca38c50a55811d65a596de
train_000.jsonl
1349623800
One day three best friends Petya, Vasya and Tonya decided to form a team and take part in programming contests. Participants are usually offered several problems during programming contests. Long before the start the friends decided that they will implement a problem if at least two of them are sure about the solution....
256 megabytes
import java.io.*; import java.util.Scanner; /** * Created by Π’Π°Π»Π΅Π½Ρ‚ΠΈΠ½ on 23.08.2014. */ public class HelloWorld { public static void main(String args[]){ //Scanner in = new Scanner(new File("input.txt")); //PrintWriter out = new PrintWriter(new File("output.txt")); Scanner in = new Scanne...
Java
["3\n1 1 0\n1 1 1\n1 0 0", "2\n1 0 0\n0 1 1"]
2 seconds
["2", "1"]
NoteIn the first sample Petya and Vasya are sure that they know how to solve the first problem and all three of them know how to solve the second problem. That means that they will write solutions for these problems. Only Petya is sure about the solution for the third problem, but that isn't enough, so the friends won'...
Java 7
standard input
[ "greedy", "brute force" ]
3542adc74a41ccfd72008faf983ffab5
The first input line contains a single integer n (1 ≀ n ≀ 1000) β€” the number of problems in the contest. Then n lines contain three integers each, each integer is either 0 or 1. If the first number in the line equals 1, then Petya is sure about the problem's solution, otherwise he isn't sure. The second number shows Va...
800
Print a single integer β€” the number of problems the friends will implement on the contest.
standard output
PASSED
cdcf9462ff69974bb678a90a06694cbe
train_000.jsonl
1349623800
One day three best friends Petya, Vasya and Tonya decided to form a team and take part in programming contests. Participants are usually offered several problems during programming contests. Long before the start the friends decided that they will implement a problem if at least two of them are sure about the solution....
256 megabytes
import java.util.Scanner; public class sample { public static void main(String[] args) { int i,e=0; Scanner sc = new Scanner(System.in); int n = sc.nextInt(); if(0<n && n<1001) {int a[]=new int[n]; int b[]=new int[n]; int c[]=new int[n]; int d[]=new int...
Java
["3\n1 1 0\n1 1 1\n1 0 0", "2\n1 0 0\n0 1 1"]
2 seconds
["2", "1"]
NoteIn the first sample Petya and Vasya are sure that they know how to solve the first problem and all three of them know how to solve the second problem. That means that they will write solutions for these problems. Only Petya is sure about the solution for the third problem, but that isn't enough, so the friends won'...
Java 7
standard input
[ "greedy", "brute force" ]
3542adc74a41ccfd72008faf983ffab5
The first input line contains a single integer n (1 ≀ n ≀ 1000) β€” the number of problems in the contest. Then n lines contain three integers each, each integer is either 0 or 1. If the first number in the line equals 1, then Petya is sure about the problem's solution, otherwise he isn't sure. The second number shows Va...
800
Print a single integer β€” the number of problems the friends will implement on the contest.
standard output
PASSED
77ebdb9850e4929f59a90334ae0abf91
train_000.jsonl
1349623800
One day three best friends Petya, Vasya and Tonya decided to form a team and take part in programming contests. Participants are usually offered several problems during programming contests. Long before the start the friends decided that they will implement a problem if at least two of them are sure about the solution....
256 megabytes
import java.util.Scanner; public class codeforces_team { public static void main(String args[]) { int pro_no,output,count=0,n; int i,j; Scanner s1=new Scanner(System.in); pro_no=s1.nextInt(); n=pro_no; int input[][]=new int[pro_no][3]; if((pro_no>=1)&&(pro_no<=1000)) { for(i=0;i<pro_no;i++) { for(j=0;j<3;j++) { input...
Java
["3\n1 1 0\n1 1 1\n1 0 0", "2\n1 0 0\n0 1 1"]
2 seconds
["2", "1"]
NoteIn the first sample Petya and Vasya are sure that they know how to solve the first problem and all three of them know how to solve the second problem. That means that they will write solutions for these problems. Only Petya is sure about the solution for the third problem, but that isn't enough, so the friends won'...
Java 7
standard input
[ "greedy", "brute force" ]
3542adc74a41ccfd72008faf983ffab5
The first input line contains a single integer n (1 ≀ n ≀ 1000) β€” the number of problems in the contest. Then n lines contain three integers each, each integer is either 0 or 1. If the first number in the line equals 1, then Petya is sure about the problem's solution, otherwise he isn't sure. The second number shows Va...
800
Print a single integer β€” the number of problems the friends will implement on the contest.
standard output
PASSED
952097d378cb4a9d9e70f643b1fd82d6
train_000.jsonl
1468425600
Let's call a string "s-palindrome" if it is symmetric about the middle of the string. For example, the string "oHo" is "s-palindrome", but the string "aa" is not. The string "aa" is not "s-palindrome", because the second half of it is not a mirror reflection of the first half. English alphabet You are given a string s...
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.util.ArrayList; import java.util.Arrays; import java.util.HashMap; import java.util.Iterator; import java.util.List; impo...
Java
["oXoxoXo", "bod", "ER"]
1 second
["TAK", "TAK", "NIE"]
null
Java 8
standard input
[ "implementation", "strings" ]
bec2349631158b7dbfedcaededf65cc2
The only line contains the string s (1 ≀ |s| ≀ 1000) which consists of only English letters.
1,600
Print "TAK" if the string s is "s-palindrome" and "NIE" otherwise.
standard output
PASSED
ba345b8202d522c5399fa265c379a381
train_000.jsonl
1468425600
Let's call a string "s-palindrome" if it is symmetric about the middle of the string. For example, the string "oHo" is "s-palindrome", but the string "aa" is not. The string "aa" is not "s-palindrome", because the second half of it is not a mirror reflection of the first half. English alphabet You are given a string s...
256 megabytes
import java.io.*; //PrintWriter import java.math.*; //BigInteger, BigDecimal import java.util.*; //StringTokenizer, ArrayList public class Ed_2016_R14_B { FastReader in; PrintWriter out; public static void main(String[] args) { new Ed_2016_R14_B().run(); } void run() { in = new FastReader(Syste...
Java
["oXoxoXo", "bod", "ER"]
1 second
["TAK", "TAK", "NIE"]
null
Java 8
standard input
[ "implementation", "strings" ]
bec2349631158b7dbfedcaededf65cc2
The only line contains the string s (1 ≀ |s| ≀ 1000) which consists of only English letters.
1,600
Print "TAK" if the string s is "s-palindrome" and "NIE" otherwise.
standard output
PASSED
48553cf2fe4c48f680b55ec66554c698
train_000.jsonl
1468425600
Let's call a string "s-palindrome" if it is symmetric about the middle of the string. For example, the string "oHo" is "s-palindrome", but the string "aa" is not. The string "aa" is not "s-palindrome", because the second half of it is not a mirror reflection of the first half. English alphabet You are given a string s...
256 megabytes
import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; public class S_palindrome { public static void main(String[] args) throws IOException { BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); String s = br.readLine(); int x = 0; String s1...
Java
["oXoxoXo", "bod", "ER"]
1 second
["TAK", "TAK", "NIE"]
null
Java 8
standard input
[ "implementation", "strings" ]
bec2349631158b7dbfedcaededf65cc2
The only line contains the string s (1 ≀ |s| ≀ 1000) which consists of only English letters.
1,600
Print "TAK" if the string s is "s-palindrome" and "NIE" otherwise.
standard output
PASSED
7e2ed850a826f86db6624543cbf8b413
train_000.jsonl
1468425600
Let's call a string "s-palindrome" if it is symmetric about the middle of the string. For example, the string "oHo" is "s-palindrome", but the string "aa" is not. The string "aa" is not "s-palindrome", because the second half of it is not a mirror reflection of the first half. English alphabet You are given a string s...
256 megabytes
import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; public class S_palindrome { public static void main(String[] args) throws IOException { BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); String s = br.readLine(); int x = 0; String s1 ...
Java
["oXoxoXo", "bod", "ER"]
1 second
["TAK", "TAK", "NIE"]
null
Java 8
standard input
[ "implementation", "strings" ]
bec2349631158b7dbfedcaededf65cc2
The only line contains the string s (1 ≀ |s| ≀ 1000) which consists of only English letters.
1,600
Print "TAK" if the string s is "s-palindrome" and "NIE" otherwise.
standard output
PASSED
6b3a39b3589414b3ac901a86f87ea621
train_000.jsonl
1468425600
Let's call a string "s-palindrome" if it is symmetric about the middle of the string. For example, the string "oHo" is "s-palindrome", but the string "aa" is not. The string "aa" is not "s-palindrome", because the second half of it is not a mirror reflection of the first half. English alphabet You are given a string s...
256 megabytes
import java.io.InputStream; import java.io.PrintWriter; import java.io.BufferedWriter; import java.io.OutputStreamWriter; import java.io.IOException; import java.math.BigInteger; import java.util.*; import java.util.stream.Stream; /** * * @author Pradyumn Agrawal coderbond007 */ public class Codeforces{ public...
Java
["oXoxoXo", "bod", "ER"]
1 second
["TAK", "TAK", "NIE"]
null
Java 8
standard input
[ "implementation", "strings" ]
bec2349631158b7dbfedcaededf65cc2
The only line contains the string s (1 ≀ |s| ≀ 1000) which consists of only English letters.
1,600
Print "TAK" if the string s is "s-palindrome" and "NIE" otherwise.
standard output
PASSED
ed47e273ad7821f972c873a138079933
train_000.jsonl
1468425600
Let's call a string "s-palindrome" if it is symmetric about the middle of the string. For example, the string "oHo" is "s-palindrome", but the string "aa" is not. The string "aa" is not "s-palindrome", because the second half of it is not a mirror reflection of the first half. English alphabet You are given a string s...
256 megabytes
import java.io.InputStream; import java.io.PrintWriter; import java.io.BufferedWriter; import java.io.OutputStreamWriter; import java.io.IOException; import java.math.BigInteger; import java.util.*; import java.util.stream.Stream; /** * * @author Pradyumn Agrawal coderbond007 */ public class Codeforces{ public...
Java
["oXoxoXo", "bod", "ER"]
1 second
["TAK", "TAK", "NIE"]
null
Java 8
standard input
[ "implementation", "strings" ]
bec2349631158b7dbfedcaededf65cc2
The only line contains the string s (1 ≀ |s| ≀ 1000) which consists of only English letters.
1,600
Print "TAK" if the string s is "s-palindrome" and "NIE" otherwise.
standard output
PASSED
31db7c26bcd7a9cd42e83d6e2b72dd31
train_000.jsonl
1468425600
Let's call a string "s-palindrome" if it is symmetric about the middle of the string. For example, the string "oHo" is "s-palindrome", but the string "aa" is not. The string "aa" is not "s-palindrome", because the second half of it is not a mirror reflection of the first half. English alphabet You are given a string s...
256 megabytes
import java.io.OutputStream; import java.io.IOException; import java.io.InputStream; import java.io.PrintWriter; import java.util.Arrays; import java.util.StringTokenizer; import java.io.IOException; import java.io.BufferedReader; import java.io.InputStreamReader; import java.io.InputStream; /* JAVA JAVA JAVA JAVAJAV...
Java
["oXoxoXo", "bod", "ER"]
1 second
["TAK", "TAK", "NIE"]
null
Java 8
standard input
[ "implementation", "strings" ]
bec2349631158b7dbfedcaededf65cc2
The only line contains the string s (1 ≀ |s| ≀ 1000) which consists of only English letters.
1,600
Print "TAK" if the string s is "s-palindrome" and "NIE" otherwise.
standard output
PASSED
973fec00c416336900a4ba34705f5e30
train_000.jsonl
1468425600
Let's call a string "s-palindrome" if it is symmetric about the middle of the string. For example, the string "oHo" is "s-palindrome", but the string "aa" is not. The string "aa" is not "s-palindrome", because the second half of it is not a mirror reflection of the first half. English alphabet You are given a string s...
256 megabytes
import java.io.OutputStream; import java.io.IOException; import java.io.InputStream; import java.io.PrintWriter; import java.util.Arrays; import java.util.StringTokenizer; import java.io.IOException; import java.io.BufferedReader; import java.io.InputStreamReader; import java.io.InputStream; /* JAVA JAVA JAVA JAVAJAV...
Java
["oXoxoXo", "bod", "ER"]
1 second
["TAK", "TAK", "NIE"]
null
Java 8
standard input
[ "implementation", "strings" ]
bec2349631158b7dbfedcaededf65cc2
The only line contains the string s (1 ≀ |s| ≀ 1000) which consists of only English letters.
1,600
Print "TAK" if the string s is "s-palindrome" and "NIE" otherwise.
standard output
PASSED
cd95471a6d15933b4713a24668e3abe8
train_000.jsonl
1468425600
Let's call a string "s-palindrome" if it is symmetric about the middle of the string. For example, the string "oHo" is "s-palindrome", but the string "aa" is not. The string "aa" is not "s-palindrome", because the second half of it is not a mirror reflection of the first half. English alphabet You are given a string s...
256 megabytes
import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; import java.io.PrintWriter; import java.util.ArrayList; import java.util.Arrays; import java.util.HashSet; import java.util.PriorityQueue; import java.util.Scanner; import java.util.Stack; import java.util.StringTokenizer; ...
Java
["oXoxoXo", "bod", "ER"]
1 second
["TAK", "TAK", "NIE"]
null
Java 8
standard input
[ "implementation", "strings" ]
bec2349631158b7dbfedcaededf65cc2
The only line contains the string s (1 ≀ |s| ≀ 1000) which consists of only English letters.
1,600
Print "TAK" if the string s is "s-palindrome" and "NIE" otherwise.
standard output
PASSED
0c7fbc2c0611ed4e2c466eaa7e9313a5
train_000.jsonl
1468425600
Let's call a string "s-palindrome" if it is symmetric about the middle of the string. For example, the string "oHo" is "s-palindrome", but the string "aa" is not. The string "aa" is not "s-palindrome", because the second half of it is not a mirror reflection of the first half. English alphabet You are given a string s...
256 megabytes
//package main; import java.io.*; import java.util.*; import java.math.*; public final class Main { BufferedReader br; StringTokenizer stk; public static void main(String[] args) throws Exception { new Main().run(); } { stk = null; br = new BufferedReader(new Inpu...
Java
["oXoxoXo", "bod", "ER"]
1 second
["TAK", "TAK", "NIE"]
null
Java 8
standard input
[ "implementation", "strings" ]
bec2349631158b7dbfedcaededf65cc2
The only line contains the string s (1 ≀ |s| ≀ 1000) which consists of only English letters.
1,600
Print "TAK" if the string s is "s-palindrome" and "NIE" otherwise.
standard output
PASSED
c24115ca937653e0c7901819eb27195a
train_000.jsonl
1468425600
Let's call a string "s-palindrome" if it is symmetric about the middle of the string. For example, the string "oHo" is "s-palindrome", but the string "aa" is not. The string "aa" is not "s-palindrome", because the second half of it is not a mirror reflection of the first half. English alphabet You are given a string s...
256 megabytes
/** * Created by 1 on 16.07.15. */ import java.io.*; import java.util.*; public class CF1 { private MyScanner in; private PrintWriter out; /* * Solution here */ private CF1 solve() { String s = in.next(); int l = s.length(); int n = s.length() / 2; boolean ...
Java
["oXoxoXo", "bod", "ER"]
1 second
["TAK", "TAK", "NIE"]
null
Java 8
standard input
[ "implementation", "strings" ]
bec2349631158b7dbfedcaededf65cc2
The only line contains the string s (1 ≀ |s| ≀ 1000) which consists of only English letters.
1,600
Print "TAK" if the string s is "s-palindrome" and "NIE" otherwise.
standard output
PASSED
5c291f19b2a17373920a57f5c36b50ac
train_000.jsonl
1468425600
Let's call a string "s-palindrome" if it is symmetric about the middle of the string. For example, the string "oHo" is "s-palindrome", but the string "aa" is not. The string "aa" is not "s-palindrome", because the second half of it is not a mirror reflection of the first half. English alphabet You are given a string s...
256 megabytes
import java .util.Scanner; public class B691 { public static void main (String []args){ Scanner input=new Scanner (System.in); String s= input.nextLine(); int same =0; if (s.length()==1 ) { if (s.charAt(0)!='A'&&s.charAt(0)!='H'&&s.charAt(0)!='I'&&s.charAt(0)!='M'&&s.charAt(0)!='o'&&s.charAt(0)!='O'&&s.cha...
Java
["oXoxoXo", "bod", "ER"]
1 second
["TAK", "TAK", "NIE"]
null
Java 8
standard input
[ "implementation", "strings" ]
bec2349631158b7dbfedcaededf65cc2
The only line contains the string s (1 ≀ |s| ≀ 1000) which consists of only English letters.
1,600
Print "TAK" if the string s is "s-palindrome" and "NIE" otherwise.
standard output
PASSED
9659e6f320734277bc2f1436462ad857
train_000.jsonl
1468425600
Let's call a string "s-palindrome" if it is symmetric about the middle of the string. For example, the string "oHo" is "s-palindrome", but the string "aa" is not. The string "aa" is not "s-palindrome", because the second half of it is not a mirror reflection of the first half. English alphabet You are given a string s...
256 megabytes
import java.io.*; import java.util.*; public class TaskB { public static boolean isSymetric(char a , char b){ if(a == 'p' && b == 'q')return true; if(a == 'b' && b == 'd')return true; if(a == 'A' && b == 'A')return true; if(a == 'H' && b == 'H')return true; if(a == 'Y' && b ...
Java
["oXoxoXo", "bod", "ER"]
1 second
["TAK", "TAK", "NIE"]
null
Java 8
standard input
[ "implementation", "strings" ]
bec2349631158b7dbfedcaededf65cc2
The only line contains the string s (1 ≀ |s| ≀ 1000) which consists of only English letters.
1,600
Print "TAK" if the string s is "s-palindrome" and "NIE" otherwise.
standard output
PASSED
ce7badea57eab75eb174639c7e85d00a
train_000.jsonl
1468425600
Let's call a string "s-palindrome" if it is symmetric about the middle of the string. For example, the string "oHo" is "s-palindrome", but the string "aa" is not. The string "aa" is not "s-palindrome", because the second half of it is not a mirror reflection of the first half. English alphabet You are given a string s...
256 megabytes
import java.io.*; import java.util.*; public class B { InputStream is; int __t__ = 1; int __f__ = 0; int __FILE_DEBUG_FLAG__ = __f__; String __DEBUG_FILE_NAME__ = "src/T"; FastScanner in; PrintWriter out; String P = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz"; String Q = "A------HI---M-O----TUV...
Java
["oXoxoXo", "bod", "ER"]
1 second
["TAK", "TAK", "NIE"]
null
Java 8
standard input
[ "implementation", "strings" ]
bec2349631158b7dbfedcaededf65cc2
The only line contains the string s (1 ≀ |s| ≀ 1000) which consists of only English letters.
1,600
Print "TAK" if the string s is "s-palindrome" and "NIE" otherwise.
standard output
PASSED
db626cdae099d882034d1d51f6a0d69c
train_000.jsonl
1468425600
Let's call a string "s-palindrome" if it is symmetric about the middle of the string. For example, the string "oHo" is "s-palindrome", but the string "aa" is not. The string "aa" is not "s-palindrome", because the second half of it is not a mirror reflection of the first half. English alphabet You are given a string s...
256 megabytes
import java.util.Scanner; public class main { public static void main(String args[]){ Scanner sc=new Scanner(System.in); String str=sc.nextLine(); char arr[]=str.toCharArray(); int f=0,l=arr.length-1; int count=0; while(f<=l){ count=0; if(arr[f]=='A' && arr[l]=='A'){ f++; l--; count=1; ...
Java
["oXoxoXo", "bod", "ER"]
1 second
["TAK", "TAK", "NIE"]
null
Java 8
standard input
[ "implementation", "strings" ]
bec2349631158b7dbfedcaededf65cc2
The only line contains the string s (1 ≀ |s| ≀ 1000) which consists of only English letters.
1,600
Print "TAK" if the string s is "s-palindrome" and "NIE" otherwise.
standard output
PASSED
694a92aac4e64bf18970c33110304cd2
train_000.jsonl
1468425600
Let's call a string "s-palindrome" if it is symmetric about the middle of the string. For example, the string "oHo" is "s-palindrome", but the string "aa" is not. The string "aa" is not "s-palindrome", because the second half of it is not a mirror reflection of the first half. English alphabet You are given a string s...
256 megabytes
import java.util.*; public class test { public static void main(String[] args) { Scanner sc = new Scanner(System.in); String input = sc.next(); int length = input.length(); if(length % 2 == 0){ printOutput(checkNumber(input,length)); } else{ char val = input.charAt(length/2); if(check(val)){ ...
Java
["oXoxoXo", "bod", "ER"]
1 second
["TAK", "TAK", "NIE"]
null
Java 8
standard input
[ "implementation", "strings" ]
bec2349631158b7dbfedcaededf65cc2
The only line contains the string s (1 ≀ |s| ≀ 1000) which consists of only English letters.
1,600
Print "TAK" if the string s is "s-palindrome" and "NIE" otherwise.
standard output
PASSED
1639c29109be83e4695a71267abdc911
train_000.jsonl
1468425600
Let's call a string "s-palindrome" if it is symmetric about the middle of the string. For example, the string "oHo" is "s-palindrome", but the string "aa" is not. The string "aa" is not "s-palindrome", because the second half of it is not a mirror reflection of the first half. English alphabet You are given a string s...
256 megabytes
import java.util.*; public class test { public static void main(String[] args) { Scanner sc = new Scanner(System.in); String input = sc.next(); //System.out.println(input); //System.out.println(input.length()); int length = input.length(); if(length % 2 == 0){ //System.out.println(input.cha...
Java
["oXoxoXo", "bod", "ER"]
1 second
["TAK", "TAK", "NIE"]
null
Java 8
standard input
[ "implementation", "strings" ]
bec2349631158b7dbfedcaededf65cc2
The only line contains the string s (1 ≀ |s| ≀ 1000) which consists of only English letters.
1,600
Print "TAK" if the string s is "s-palindrome" and "NIE" otherwise.
standard output
PASSED
408a75ff332eedc7deaf26890f4db7f5
train_000.jsonl
1468425600
Let's call a string "s-palindrome" if it is symmetric about the middle of the string. For example, the string "oHo" is "s-palindrome", but the string "aa" is not. The string "aa" is not "s-palindrome", because the second half of it is not a mirror reflection of the first half. English alphabet You are given a string s...
256 megabytes
import java.io.OutputStream; import java.io.IOException; import java.io.InputStream; import java.io.PrintWriter; import java.util.StringTokenizer; import java.io.IOException; import java.io.BufferedReader; import java.io.FileReader; import java.io.InputStreamReader; import java.io.File; import java.io.FileNotFoundExcep...
Java
["oXoxoXo", "bod", "ER"]
1 second
["TAK", "TAK", "NIE"]
null
Java 8
standard input
[ "implementation", "strings" ]
bec2349631158b7dbfedcaededf65cc2
The only line contains the string s (1 ≀ |s| ≀ 1000) which consists of only English letters.
1,600
Print "TAK" if the string s is "s-palindrome" and "NIE" otherwise.
standard output
PASSED
49c1b94f76e97c2fe85b33098f43aca5
train_000.jsonl
1468425600
Let's call a string "s-palindrome" if it is symmetric about the middle of the string. For example, the string "oHo" is "s-palindrome", but the string "aa" is not. The string "aa" is not "s-palindrome", because the second half of it is not a mirror reflection of the first half. English alphabet You are given a string s...
256 megabytes
import java.util.ArrayList; import java.util.Scanner; public class SPalindrom { public static void main(String[] args) { // TODO Auto-generated method stub Scanner scan = new Scanner(System.in); String s = scan.next(); ArrayList<Character> letters = new ArrayList<>() ; letters.add('A');letters.add('O'...
Java
["oXoxoXo", "bod", "ER"]
1 second
["TAK", "TAK", "NIE"]
null
Java 8
standard input
[ "implementation", "strings" ]
bec2349631158b7dbfedcaededf65cc2
The only line contains the string s (1 ≀ |s| ≀ 1000) which consists of only English letters.
1,600
Print "TAK" if the string s is "s-palindrome" and "NIE" otherwise.
standard output
PASSED
2ca41bd2264f984fdac2d4b8d0b231f5
train_000.jsonl
1388417400
The New Year is coming! That's why many people today are busy preparing New Year presents. Vasily the Programmer is no exception.Vasily knows that the best present is (no, it's not a contest) money. He's put n empty wallets from left to right in a row and decided how much money to put in what wallet. Vasily decided to ...
256 megabytes
import java.util.*; import java.io.*; public class Main { static BufferedReader br; static FileInputStream fis; static InputStreamReader isr; static FileWriter fw; public static void main(String[] args) throws IOException{ //fis = new FileInputStream("input.txt"); //isr = new InputStreamReader(fis); ...
Java
["2\n1 2", "4\n0 2 0 2"]
1 second
["PRPLRP", "RPRRPLLPLRRRP"]
null
Java 7
standard input
[ "constructive algorithms", "implementation" ]
50e88225d8b081d63eebe446f48057f4
The first line contains integer n (2 ≀ n ≀ 300) β€” the number of wallets. The next line contains n integers a1, a2, ..., an (0 ≀ ai ≀ 300). It is guaranteed that at least one ai is positive.
1,200
Print the sequence that consists of k (1 ≀ k ≀ 106) characters, each of them equals: "L", "R" or "P". Each character of the sequence is an instruction to the robot. Character "L" orders to move to the left, character "R" orders to move to the right, character "P" orders the robot to put a coin in the wallet. The robot ...
standard output
PASSED
2793ea6905f35b98361b5a232282deef
train_000.jsonl
1388417400
The New Year is coming! That's why many people today are busy preparing New Year presents. Vasily the Programmer is no exception.Vasily knows that the best present is (no, it's not a contest) money. He's put n empty wallets from left to right in a row and decided how much money to put in what wallet. Vasily decided to ...
256 megabytes
import java.util.Scanner; import java.io.OutputStream; import java.io.IOException; import java.io.PrintWriter; import java.io.InputStream; /** * Built using CHelper plug-in * Actual solution is at the top * @author Yanhong Wu */ public class B { public static void main(String[] args) { InputStream inputStream =...
Java
["2\n1 2", "4\n0 2 0 2"]
1 second
["PRPLRP", "RPRRPLLPLRRRP"]
null
Java 7
standard input
[ "constructive algorithms", "implementation" ]
50e88225d8b081d63eebe446f48057f4
The first line contains integer n (2 ≀ n ≀ 300) β€” the number of wallets. The next line contains n integers a1, a2, ..., an (0 ≀ ai ≀ 300). It is guaranteed that at least one ai is positive.
1,200
Print the sequence that consists of k (1 ≀ k ≀ 106) characters, each of them equals: "L", "R" or "P". Each character of the sequence is an instruction to the robot. Character "L" orders to move to the left, character "R" orders to move to the right, character "P" orders the robot to put a coin in the wallet. The robot ...
standard output
PASSED
fada42ef7cfa9053f25522f07af7f184
train_000.jsonl
1388417400
The New Year is coming! That's why many people today are busy preparing New Year presents. Vasily the Programmer is no exception.Vasily knows that the best present is (no, it's not a contest) money. He's put n empty wallets from left to right in a row and decided how much money to put in what wallet. Vasily decided to ...
256 megabytes
import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; import java.util.Arrays; public class Main { public static void main(String[] args) { BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); int n = 0; try { n = Inte...
Java
["2\n1 2", "4\n0 2 0 2"]
1 second
["PRPLRP", "RPRRPLLPLRRRP"]
null
Java 7
standard input
[ "constructive algorithms", "implementation" ]
50e88225d8b081d63eebe446f48057f4
The first line contains integer n (2 ≀ n ≀ 300) β€” the number of wallets. The next line contains n integers a1, a2, ..., an (0 ≀ ai ≀ 300). It is guaranteed that at least one ai is positive.
1,200
Print the sequence that consists of k (1 ≀ k ≀ 106) characters, each of them equals: "L", "R" or "P". Each character of the sequence is an instruction to the robot. Character "L" orders to move to the left, character "R" orders to move to the right, character "P" orders the robot to put a coin in the wallet. The robot ...
standard output
PASSED
14c2ed54cbb3a5fcf519526312df3f75
train_000.jsonl
1388417400
The New Year is coming! That's why many people today are busy preparing New Year presents. Vasily the Programmer is no exception.Vasily knows that the best present is (no, it's not a contest) money. He's put n empty wallets from left to right in a row and decided how much money to put in what wallet. Vasily decided to ...
256 megabytes
import java.util.Scanner; /** * Created by Admin on 18.07.2016. */ public class B_379 { public static void main(String[] args) { Scanner in = new Scanner(System.in); int n = in.nextInt(); int a[] = new int[n]; for (int i = 0; i < n; i++) { a[i] = in.nextInt(); ...
Java
["2\n1 2", "4\n0 2 0 2"]
1 second
["PRPLRP", "RPRRPLLPLRRRP"]
null
Java 7
standard input
[ "constructive algorithms", "implementation" ]
50e88225d8b081d63eebe446f48057f4
The first line contains integer n (2 ≀ n ≀ 300) β€” the number of wallets. The next line contains n integers a1, a2, ..., an (0 ≀ ai ≀ 300). It is guaranteed that at least one ai is positive.
1,200
Print the sequence that consists of k (1 ≀ k ≀ 106) characters, each of them equals: "L", "R" or "P". Each character of the sequence is an instruction to the robot. Character "L" orders to move to the left, character "R" orders to move to the right, character "P" orders the robot to put a coin in the wallet. The robot ...
standard output
PASSED
794dd761b4b7bd121a56d310557187ed
train_000.jsonl
1388417400
The New Year is coming! That's why many people today are busy preparing New Year presents. Vasily the Programmer is no exception.Vasily knows that the best present is (no, it's not a contest) money. He's put n empty wallets from left to right in a row and decided how much money to put in what wallet. Vasily decided to ...
256 megabytes
import java.io.BufferedReader; import java.io.BufferedWriter; import java.io.FileWriter; import java.io.InputStreamReader; import java.io.PrintWriter; import java.util.StringTokenizer; public class NYP { public static void main(String[] args) throws Exception { BufferedReader br= new BufferedReader(new InputStrea...
Java
["2\n1 2", "4\n0 2 0 2"]
1 second
["PRPLRP", "RPRRPLLPLRRRP"]
null
Java 7
standard input
[ "constructive algorithms", "implementation" ]
50e88225d8b081d63eebe446f48057f4
The first line contains integer n (2 ≀ n ≀ 300) β€” the number of wallets. The next line contains n integers a1, a2, ..., an (0 ≀ ai ≀ 300). It is guaranteed that at least one ai is positive.
1,200
Print the sequence that consists of k (1 ≀ k ≀ 106) characters, each of them equals: "L", "R" or "P". Each character of the sequence is an instruction to the robot. Character "L" orders to move to the left, character "R" orders to move to the right, character "P" orders the robot to put a coin in the wallet. The robot ...
standard output
PASSED
dce30ebbde870a366158223b67acbd09
train_000.jsonl
1388417400
The New Year is coming! That's why many people today are busy preparing New Year presents. Vasily the Programmer is no exception.Vasily knows that the best present is (no, it's not a contest) money. He's put n empty wallets from left to right in a row and decided how much money to put in what wallet. Vasily decided to ...
256 megabytes
import java.io.*; import java.util.*; public class Main { static BufferedReader reader; static StringTokenizer tokenizer; static PrintWriter writer; static int nextInt() throws IOException { return Integer.parseInt(nextToken()); } static long nextLong() throws IOException { return Long.parseLong(nextToken(...
Java
["2\n1 2", "4\n0 2 0 2"]
1 second
["PRPLRP", "RPRRPLLPLRRRP"]
null
Java 7
standard input
[ "constructive algorithms", "implementation" ]
50e88225d8b081d63eebe446f48057f4
The first line contains integer n (2 ≀ n ≀ 300) β€” the number of wallets. The next line contains n integers a1, a2, ..., an (0 ≀ ai ≀ 300). It is guaranteed that at least one ai is positive.
1,200
Print the sequence that consists of k (1 ≀ k ≀ 106) characters, each of them equals: "L", "R" or "P". Each character of the sequence is an instruction to the robot. Character "L" orders to move to the left, character "R" orders to move to the right, character "P" orders the robot to put a coin in the wallet. The robot ...
standard output
PASSED
1f6b2d056d6d91b30bebfd31c3cd4886
train_000.jsonl
1388417400
The New Year is coming! That's why many people today are busy preparing New Year presents. Vasily the Programmer is no exception.Vasily knows that the best present is (no, it's not a contest) money. He's put n empty wallets from left to right in a row and decided how much money to put in what wallet. Vasily decided to ...
256 megabytes
import java.util.Arrays; import java.util.Scanner; public class CF_Bye2013_II { public static void solve(int[] arr) { int len = arr.length; int[] cur = new int[len]; for(int i=0;i<len;i++) { cur[i] = 0; } int ind = 0; while(!equal(cur,arr)) { while(ind!=len-1) { if(cur[ind]<arr[ind]) { cu...
Java
["2\n1 2", "4\n0 2 0 2"]
1 second
["PRPLRP", "RPRRPLLPLRRRP"]
null
Java 7
standard input
[ "constructive algorithms", "implementation" ]
50e88225d8b081d63eebe446f48057f4
The first line contains integer n (2 ≀ n ≀ 300) β€” the number of wallets. The next line contains n integers a1, a2, ..., an (0 ≀ ai ≀ 300). It is guaranteed that at least one ai is positive.
1,200
Print the sequence that consists of k (1 ≀ k ≀ 106) characters, each of them equals: "L", "R" or "P". Each character of the sequence is an instruction to the robot. Character "L" orders to move to the left, character "R" orders to move to the right, character "P" orders the robot to put a coin in the wallet. The robot ...
standard output
PASSED
e772177349e39243a82e41dad193a216
train_000.jsonl
1388417400
The New Year is coming! That's why many people today are busy preparing New Year presents. Vasily the Programmer is no exception.Vasily knows that the best present is (no, it's not a contest) money. He's put n empty wallets from left to right in a row and decided how much money to put in what wallet. Vasily decided to ...
256 megabytes
import java.io.BufferedReader; import java.io.BufferedWriter; import java.io.File; import java.io.FileWriter; import java.io.IOException; import java.io.InputStream; import java.io.InputStreamReader; import java.io.OutputStream; import java.io.OutputStreamWriter; import java.io.PrintWriter; import java.util.StringToken...
Java
["2\n1 2", "4\n0 2 0 2"]
1 second
["PRPLRP", "RPRRPLLPLRRRP"]
null
Java 7
standard input
[ "constructive algorithms", "implementation" ]
50e88225d8b081d63eebe446f48057f4
The first line contains integer n (2 ≀ n ≀ 300) β€” the number of wallets. The next line contains n integers a1, a2, ..., an (0 ≀ ai ≀ 300). It is guaranteed that at least one ai is positive.
1,200
Print the sequence that consists of k (1 ≀ k ≀ 106) characters, each of them equals: "L", "R" or "P". Each character of the sequence is an instruction to the robot. Character "L" orders to move to the left, character "R" orders to move to the right, character "P" orders the robot to put a coin in the wallet. The robot ...
standard output
PASSED
b7fa3e5014d9ffb339c95390a0da3686
train_000.jsonl
1388417400
The New Year is coming! That's why many people today are busy preparing New Year presents. Vasily the Programmer is no exception.Vasily knows that the best present is (no, it's not a contest) money. He's put n empty wallets from left to right in a row and decided how much money to put in what wallet. Vasily decided to ...
256 megabytes
import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; import java.io.OutputStreamWriter; import java.io.PrintWriter; import java.util.StringTokenizer; public class NewYearPresent { public static void main(String[] args) throws IOException { BufferedReader in = new BufferedRea...
Java
["2\n1 2", "4\n0 2 0 2"]
1 second
["PRPLRP", "RPRRPLLPLRRRP"]
null
Java 7
standard input
[ "constructive algorithms", "implementation" ]
50e88225d8b081d63eebe446f48057f4
The first line contains integer n (2 ≀ n ≀ 300) β€” the number of wallets. The next line contains n integers a1, a2, ..., an (0 ≀ ai ≀ 300). It is guaranteed that at least one ai is positive.
1,200
Print the sequence that consists of k (1 ≀ k ≀ 106) characters, each of them equals: "L", "R" or "P". Each character of the sequence is an instruction to the robot. Character "L" orders to move to the left, character "R" orders to move to the right, character "P" orders the robot to put a coin in the wallet. The robot ...
standard output
PASSED
5c12ccdab494ff033d4435969d62bfbc
train_000.jsonl
1388417400
The New Year is coming! That's why many people today are busy preparing New Year presents. Vasily the Programmer is no exception.Vasily knows that the best present is (no, it's not a contest) money. He's put n empty wallets from left to right in a row and decided how much money to put in what wallet. Vasily decided to ...
256 megabytes
import java.io.BufferedReader; import java.io.InputStreamReader; import java.util.StringTokenizer; public class NewYearPresent { /** * @param args */ public static void main(String[] args) { BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); String line = ""; int n = 0; int[] a = ...
Java
["2\n1 2", "4\n0 2 0 2"]
1 second
["PRPLRP", "RPRRPLLPLRRRP"]
null
Java 7
standard input
[ "constructive algorithms", "implementation" ]
50e88225d8b081d63eebe446f48057f4
The first line contains integer n (2 ≀ n ≀ 300) β€” the number of wallets. The next line contains n integers a1, a2, ..., an (0 ≀ ai ≀ 300). It is guaranteed that at least one ai is positive.
1,200
Print the sequence that consists of k (1 ≀ k ≀ 106) characters, each of them equals: "L", "R" or "P". Each character of the sequence is an instruction to the robot. Character "L" orders to move to the left, character "R" orders to move to the right, character "P" orders the robot to put a coin in the wallet. The robot ...
standard output
PASSED
ed65bc9f2a38c87e5ffbc14e67662cf0
train_000.jsonl
1388417400
The New Year is coming! That's why many people today are busy preparing New Year presents. Vasily the Programmer is no exception.Vasily knows that the best present is (no, it's not a contest) money. He's put n empty wallets from left to right in a row and decided how much money to put in what wallet. Vasily decided to ...
256 megabytes
import java.io.PrintWriter; import java.util.Scanner; /** * <a href="http://codeforces.ru/problemset/problem/379/B"/> * * @author pvasilyev * @since 09 Jan 2014 */ public class Problem087 { public static void main(String[] args) { final Scanner reader = new Scanner(System.in); final PrintWrit...
Java
["2\n1 2", "4\n0 2 0 2"]
1 second
["PRPLRP", "RPRRPLLPLRRRP"]
null
Java 7
standard input
[ "constructive algorithms", "implementation" ]
50e88225d8b081d63eebe446f48057f4
The first line contains integer n (2 ≀ n ≀ 300) β€” the number of wallets. The next line contains n integers a1, a2, ..., an (0 ≀ ai ≀ 300). It is guaranteed that at least one ai is positive.
1,200
Print the sequence that consists of k (1 ≀ k ≀ 106) characters, each of them equals: "L", "R" or "P". Each character of the sequence is an instruction to the robot. Character "L" orders to move to the left, character "R" orders to move to the right, character "P" orders the robot to put a coin in the wallet. The robot ...
standard output
PASSED
1260dbc421636a4055d003056ba02ef8
train_000.jsonl
1388417400
The New Year is coming! That's why many people today are busy preparing New Year presents. Vasily the Programmer is no exception.Vasily knows that the best present is (no, it's not a contest) money. He's put n empty wallets from left to right in a row and decided how much money to put in what wallet. Vasily decided to ...
256 megabytes
import java.io.*; import java.util.*; public class B { public static void main(String[] args) { Scanner input = new Scanner(System.in); int n = input.nextInt(); int[] a = new int[n]; for(int i = 0; i < n; i++) { a[i] = input.nextInt(); } for(int i = 0; i...
Java
["2\n1 2", "4\n0 2 0 2"]
1 second
["PRPLRP", "RPRRPLLPLRRRP"]
null
Java 7
standard input
[ "constructive algorithms", "implementation" ]
50e88225d8b081d63eebe446f48057f4
The first line contains integer n (2 ≀ n ≀ 300) β€” the number of wallets. The next line contains n integers a1, a2, ..., an (0 ≀ ai ≀ 300). It is guaranteed that at least one ai is positive.
1,200
Print the sequence that consists of k (1 ≀ k ≀ 106) characters, each of them equals: "L", "R" or "P". Each character of the sequence is an instruction to the robot. Character "L" orders to move to the left, character "R" orders to move to the right, character "P" orders the robot to put a coin in the wallet. The robot ...
standard output
PASSED
5f7d549d23974ca32b32847a6cce04f2
train_000.jsonl
1388417400
The New Year is coming! That's why many people today are busy preparing New Year presents. Vasily the Programmer is no exception.Vasily knows that the best present is (no, it's not a contest) money. He's put n empty wallets from left to right in a row and decided how much money to put in what wallet. Vasily decided to ...
256 megabytes
import java.io.*; import java.util.*; /** * * @author Altynbek.Nurgaziyev */ public class B { public void solution() throws Exception { int n = in.nextInt(); int f[] = new int[n]; for (int i = 0; i < n; i++) { f[i] = in.nextInt(); ...
Java
["2\n1 2", "4\n0 2 0 2"]
1 second
["PRPLRP", "RPRRPLLPLRRRP"]
null
Java 7
standard input
[ "constructive algorithms", "implementation" ]
50e88225d8b081d63eebe446f48057f4
The first line contains integer n (2 ≀ n ≀ 300) β€” the number of wallets. The next line contains n integers a1, a2, ..., an (0 ≀ ai ≀ 300). It is guaranteed that at least one ai is positive.
1,200
Print the sequence that consists of k (1 ≀ k ≀ 106) characters, each of them equals: "L", "R" or "P". Each character of the sequence is an instruction to the robot. Character "L" orders to move to the left, character "R" orders to move to the right, character "P" orders the robot to put a coin in the wallet. The robot ...
standard output
PASSED
e7451212aa0edac6e50629c3fbc67011
train_000.jsonl
1388417400
The New Year is coming! That's why many people today are busy preparing New Year presents. Vasily the Programmer is no exception.Vasily knows that the best present is (no, it's not a contest) money. He's put n empty wallets from left to right in a row and decided how much money to put in what wallet. Vasily decided to ...
256 megabytes
//package GB2013; import java.io.*; import java.util.*; /** * * @coder Altynbek Nurgaziyev */ public class B { public void solution() throws Exception { int n = in.nextInt(), f[] = new int[n]; for (int i = 0; i < n; i++) { f[i] = in.nextInt(); ...
Java
["2\n1 2", "4\n0 2 0 2"]
1 second
["PRPLRP", "RPRRPLLPLRRRP"]
null
Java 7
standard input
[ "constructive algorithms", "implementation" ]
50e88225d8b081d63eebe446f48057f4
The first line contains integer n (2 ≀ n ≀ 300) β€” the number of wallets. The next line contains n integers a1, a2, ..., an (0 ≀ ai ≀ 300). It is guaranteed that at least one ai is positive.
1,200
Print the sequence that consists of k (1 ≀ k ≀ 106) characters, each of them equals: "L", "R" or "P". Each character of the sequence is an instruction to the robot. Character "L" orders to move to the left, character "R" orders to move to the right, character "P" orders the robot to put a coin in the wallet. The robot ...
standard output
PASSED
52c10dfacb23da4aee6fd466865085f2
train_000.jsonl
1388417400
The New Year is coming! That's why many people today are busy preparing New Year presents. Vasily the Programmer is no exception.Vasily knows that the best present is (no, it's not a contest) money. He's put n empty wallets from left to right in a row and decided how much money to put in what wallet. Vasily decided to ...
256 megabytes
import java.util.Scanner; public class New_Year_Present { public static void main(String args[]){ Scanner in = new Scanner(System.in); int n = in.nextInt(); int a[] = new int[n]; int cnt = 0; for(int i = 0 ; i < n ; i++){ a[i] = in.nextInt...
Java
["2\n1 2", "4\n0 2 0 2"]
1 second
["PRPLRP", "RPRRPLLPLRRRP"]
null
Java 7
standard input
[ "constructive algorithms", "implementation" ]
50e88225d8b081d63eebe446f48057f4
The first line contains integer n (2 ≀ n ≀ 300) β€” the number of wallets. The next line contains n integers a1, a2, ..., an (0 ≀ ai ≀ 300). It is guaranteed that at least one ai is positive.
1,200
Print the sequence that consists of k (1 ≀ k ≀ 106) characters, each of them equals: "L", "R" or "P". Each character of the sequence is an instruction to the robot. Character "L" orders to move to the left, character "R" orders to move to the right, character "P" orders the robot to put a coin in the wallet. The robot ...
standard output
PASSED
7bbed8d54c8e34b07b48c7b6d34ce055
train_000.jsonl
1388417400
The New Year is coming! That's why many people today are busy preparing New Year presents. Vasily the Programmer is no exception.Vasily knows that the best present is (no, it's not a contest) money. He's put n empty wallets from left to right in a row and decided how much money to put in what wallet. Vasily decided to ...
256 megabytes
import java.util.Scanner; public class B2013 { public static void main(String[] args) { Scanner input = new Scanner(System.in); int n = input.nextInt(); int a[] = new int[n]; int zeros = 0; for (int i = 0; i < n; i++) { a[i] = input.nextInt(); if (a[i] == 0) { zeros++; } } int flag = 1; ...
Java
["2\n1 2", "4\n0 2 0 2"]
1 second
["PRPLRP", "RPRRPLLPLRRRP"]
null
Java 7
standard input
[ "constructive algorithms", "implementation" ]
50e88225d8b081d63eebe446f48057f4
The first line contains integer n (2 ≀ n ≀ 300) β€” the number of wallets. The next line contains n integers a1, a2, ..., an (0 ≀ ai ≀ 300). It is guaranteed that at least one ai is positive.
1,200
Print the sequence that consists of k (1 ≀ k ≀ 106) characters, each of them equals: "L", "R" or "P". Each character of the sequence is an instruction to the robot. Character "L" orders to move to the left, character "R" orders to move to the right, character "P" orders the robot to put a coin in the wallet. The robot ...
standard output
PASSED
80aa9412be44c505577d96a6d4901554
train_000.jsonl
1388417400
The New Year is coming! That's why many people today are busy preparing New Year presents. Vasily the Programmer is no exception.Vasily knows that the best present is (no, it's not a contest) money. He's put n empty wallets from left to right in a row and decided how much money to put in what wallet. Vasily decided to ...
256 megabytes
import java.util.Scanner; public class C_379B { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int n = sc.nextInt(); int [] mas = new int[n+1]; int sum = 0; for (int i = 1; i <= n; i++) { mas[i] = sc.nextInt(); sum += mas[i]; } A: while (sum > 0) { if (mas[1] > 0) { ...
Java
["2\n1 2", "4\n0 2 0 2"]
1 second
["PRPLRP", "RPRRPLLPLRRRP"]
null
Java 7
standard input
[ "constructive algorithms", "implementation" ]
50e88225d8b081d63eebe446f48057f4
The first line contains integer n (2 ≀ n ≀ 300) β€” the number of wallets. The next line contains n integers a1, a2, ..., an (0 ≀ ai ≀ 300). It is guaranteed that at least one ai is positive.
1,200
Print the sequence that consists of k (1 ≀ k ≀ 106) characters, each of them equals: "L", "R" or "P". Each character of the sequence is an instruction to the robot. Character "L" orders to move to the left, character "R" orders to move to the right, character "P" orders the robot to put a coin in the wallet. The robot ...
standard output
PASSED
7d024bbe035e6aee6ee830840c0c864b
train_000.jsonl
1388417400
The New Year is coming! That's why many people today are busy preparing New Year presents. Vasily the Programmer is no exception.Vasily knows that the best present is (no, it's not a contest) money. He's put n empty wallets from left to right in a row and decided how much money to put in what wallet. Vasily decided to ...
256 megabytes
//package Codeforces.GoodBye2013_Div2B.Code1; import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; import java.io.PrintWriter; import java.util.StringTokenizer; /* * some cheeky quote */ public class Main { FastScanner in; PrintWriter out; public void solve() th...
Java
["2\n1 2", "4\n0 2 0 2"]
1 second
["PRPLRP", "RPRRPLLPLRRRP"]
null
Java 7
standard input
[ "constructive algorithms", "implementation" ]
50e88225d8b081d63eebe446f48057f4
The first line contains integer n (2 ≀ n ≀ 300) β€” the number of wallets. The next line contains n integers a1, a2, ..., an (0 ≀ ai ≀ 300). It is guaranteed that at least one ai is positive.
1,200
Print the sequence that consists of k (1 ≀ k ≀ 106) characters, each of them equals: "L", "R" or "P". Each character of the sequence is an instruction to the robot. Character "L" orders to move to the left, character "R" orders to move to the right, character "P" orders the robot to put a coin in the wallet. The robot ...
standard output
PASSED
bb336b90e226f4add6d27195f94390e3
train_000.jsonl
1388417400
The New Year is coming! That's why many people today are busy preparing New Year presents. Vasily the Programmer is no exception.Vasily knows that the best present is (no, it's not a contest) money. He's put n empty wallets from left to right in a row and decided how much money to put in what wallet. Vasily decided to ...
256 megabytes
import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; import java.io.OutputStreamWriter; import java.io.PrintWriter; import java.util.StringTokenizer; public class NewYearPresent { public static void main(String [] args) throws IOException { BufferedReader br=new Buffere...
Java
["2\n1 2", "4\n0 2 0 2"]
1 second
["PRPLRP", "RPRRPLLPLRRRP"]
null
Java 7
standard input
[ "constructive algorithms", "implementation" ]
50e88225d8b081d63eebe446f48057f4
The first line contains integer n (2 ≀ n ≀ 300) β€” the number of wallets. The next line contains n integers a1, a2, ..., an (0 ≀ ai ≀ 300). It is guaranteed that at least one ai is positive.
1,200
Print the sequence that consists of k (1 ≀ k ≀ 106) characters, each of them equals: "L", "R" or "P". Each character of the sequence is an instruction to the robot. Character "L" orders to move to the left, character "R" orders to move to the right, character "P" orders the robot to put a coin in the wallet. The robot ...
standard output
PASSED
4bfcfbd651fd21fd3511c7f600af717d
train_000.jsonl
1388417400
The New Year is coming! That's why many people today are busy preparing New Year presents. Vasily the Programmer is no exception.Vasily knows that the best present is (no, it's not a contest) money. He's put n empty wallets from left to right in a row and decided how much money to put in what wallet. Vasily decided to ...
256 megabytes
/******************************************************************* My love has gone away, quietly after a hundered days. This is what's she has always said she won't stay for more than what she can repay. I can still hear her say there that I'm not hearing tender play The day she let me kiss her was a display, of lo...
Java
["2\n1 2", "4\n0 2 0 2"]
1 second
["PRPLRP", "RPRRPLLPLRRRP"]
null
Java 7
standard input
[ "constructive algorithms", "implementation" ]
50e88225d8b081d63eebe446f48057f4
The first line contains integer n (2 ≀ n ≀ 300) β€” the number of wallets. The next line contains n integers a1, a2, ..., an (0 ≀ ai ≀ 300). It is guaranteed that at least one ai is positive.
1,200
Print the sequence that consists of k (1 ≀ k ≀ 106) characters, each of them equals: "L", "R" or "P". Each character of the sequence is an instruction to the robot. Character "L" orders to move to the left, character "R" orders to move to the right, character "P" orders the robot to put a coin in the wallet. The robot ...
standard output
PASSED
ca1ac23efee670de349d2a15fe4c0241
train_000.jsonl
1388417400
The New Year is coming! That's why many people today are busy preparing New Year presents. Vasily the Programmer is no exception.Vasily knows that the best present is (no, it's not a contest) money. He's put n empty wallets from left to right in a row and decided how much money to put in what wallet. Vasily decided to ...
256 megabytes
import java.util.Scanner; public class P379B { static int n; static int[] a; public static void give(int t) { if (t != n - 1) for (int i = 0; i < a[t]; i++) System.out.print("PRL"); else for (int i = 0; i < a[t]; i++) System....
Java
["2\n1 2", "4\n0 2 0 2"]
1 second
["PRPLRP", "RPRRPLLPLRRRP"]
null
Java 7
standard input
[ "constructive algorithms", "implementation" ]
50e88225d8b081d63eebe446f48057f4
The first line contains integer n (2 ≀ n ≀ 300) β€” the number of wallets. The next line contains n integers a1, a2, ..., an (0 ≀ ai ≀ 300). It is guaranteed that at least one ai is positive.
1,200
Print the sequence that consists of k (1 ≀ k ≀ 106) characters, each of them equals: "L", "R" or "P". Each character of the sequence is an instruction to the robot. Character "L" orders to move to the left, character "R" orders to move to the right, character "P" orders the robot to put a coin in the wallet. The robot ...
standard output
PASSED
4ad23a24e9c2d956a3dd3fffe44645a7
train_000.jsonl
1388417400
The New Year is coming! That's why many people today are busy preparing New Year presents. Vasily the Programmer is no exception.Vasily knows that the best present is (no, it's not a contest) money. He's put n empty wallets from left to right in a row and decided how much money to put in what wallet. Vasily decided to ...
256 megabytes
import java.io.PrintWriter; import java.util.Scanner; /** * Created with IntelliJ IDEA. * User: SBerdibekov * Date: 19.11.13 * Time: 15:09 * To change this template use File | Settings | File Templates. */ public class Main { PrintWriter pw; Scanner sc; private void task() throws Exception { ...
Java
["2\n1 2", "4\n0 2 0 2"]
1 second
["PRPLRP", "RPRRPLLPLRRRP"]
null
Java 7
standard input
[ "constructive algorithms", "implementation" ]
50e88225d8b081d63eebe446f48057f4
The first line contains integer n (2 ≀ n ≀ 300) β€” the number of wallets. The next line contains n integers a1, a2, ..., an (0 ≀ ai ≀ 300). It is guaranteed that at least one ai is positive.
1,200
Print the sequence that consists of k (1 ≀ k ≀ 106) characters, each of them equals: "L", "R" or "P". Each character of the sequence is an instruction to the robot. Character "L" orders to move to the left, character "R" orders to move to the right, character "P" orders the robot to put a coin in the wallet. The robot ...
standard output
PASSED
fb58087847f0d4553454c96c79440f5a
train_000.jsonl
1388417400
The New Year is coming! That's why many people today are busy preparing New Year presents. Vasily the Programmer is no exception.Vasily knows that the best present is (no, it's not a contest) money. He's put n empty wallets from left to right in a row and decided how much money to put in what wallet. Vasily decided to ...
256 megabytes
import java.util.Scanner; public class main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); StringBuilder sb = new StringBuilder(""); int n = sc.nextInt(); int[] input = new int[n]; int[] result = new int[n]; for (int i = 0; i < n; i++) { input[i] = sc.nextInt(); ...
Java
["2\n1 2", "4\n0 2 0 2"]
1 second
["PRPLRP", "RPRRPLLPLRRRP"]
null
Java 7
standard input
[ "constructive algorithms", "implementation" ]
50e88225d8b081d63eebe446f48057f4
The first line contains integer n (2 ≀ n ≀ 300) β€” the number of wallets. The next line contains n integers a1, a2, ..., an (0 ≀ ai ≀ 300). It is guaranteed that at least one ai is positive.
1,200
Print the sequence that consists of k (1 ≀ k ≀ 106) characters, each of them equals: "L", "R" or "P". Each character of the sequence is an instruction to the robot. Character "L" orders to move to the left, character "R" orders to move to the right, character "P" orders the robot to put a coin in the wallet. The robot ...
standard output
PASSED
df021be383b5d39d730e008c14de8dd3
train_000.jsonl
1388417400
The New Year is coming! That's why many people today are busy preparing New Year presents. Vasily the Programmer is no exception.Vasily knows that the best present is (no, it's not a contest) money. He's put n empty wallets from left to right in a row and decided how much money to put in what wallet. Vasily decided to ...
256 megabytes
import java.io.BufferedReader; import java.io.FileNotFoundException; import java.io.FileReader; import java.io.IOException; import java.math.BigInteger; import java.util.Scanner; import javax.swing.table.DefaultTableModel; public class Test { static void print(int[] a) { for(int i=0;i<a.length;i++) S...
Java
["2\n1 2", "4\n0 2 0 2"]
1 second
["PRPLRP", "RPRRPLLPLRRRP"]
null
Java 7
standard input
[ "constructive algorithms", "implementation" ]
50e88225d8b081d63eebe446f48057f4
The first line contains integer n (2 ≀ n ≀ 300) β€” the number of wallets. The next line contains n integers a1, a2, ..., an (0 ≀ ai ≀ 300). It is guaranteed that at least one ai is positive.
1,200
Print the sequence that consists of k (1 ≀ k ≀ 106) characters, each of them equals: "L", "R" or "P". Each character of the sequence is an instruction to the robot. Character "L" orders to move to the left, character "R" orders to move to the right, character "P" orders the robot to put a coin in the wallet. The robot ...
standard output
PASSED
13260d16bfeb46dcffb28ca36319d9db
train_000.jsonl
1388417400
The New Year is coming! That's why many people today are busy preparing New Year presents. Vasily the Programmer is no exception.Vasily knows that the best present is (no, it's not a contest) money. He's put n empty wallets from left to right in a row and decided how much money to put in what wallet. Vasily decided to ...
256 megabytes
import java.io.*; import java.math.*; import java.util.*; public class Main { InputReader input; PrintWriter output; void run(){ output = new PrintWriter(new OutputStreamWriter(System.out)); input = new InputReader(System.in); solve(); output.flush(); } public st...
Java
["2\n1 2", "4\n0 2 0 2"]
1 second
["PRPLRP", "RPRRPLLPLRRRP"]
null
Java 7
standard input
[ "constructive algorithms", "implementation" ]
50e88225d8b081d63eebe446f48057f4
The first line contains integer n (2 ≀ n ≀ 300) β€” the number of wallets. The next line contains n integers a1, a2, ..., an (0 ≀ ai ≀ 300). It is guaranteed that at least one ai is positive.
1,200
Print the sequence that consists of k (1 ≀ k ≀ 106) characters, each of them equals: "L", "R" or "P". Each character of the sequence is an instruction to the robot. Character "L" orders to move to the left, character "R" orders to move to the right, character "P" orders the robot to put a coin in the wallet. The robot ...
standard output
PASSED
b1a1409fae961dc38fc27a4590f5febf
train_000.jsonl
1388417400
The New Year is coming! That's why many people today are busy preparing New Year presents. Vasily the Programmer is no exception.Vasily knows that the best present is (no, it's not a contest) money. He's put n empty wallets from left to right in a row and decided how much money to put in what wallet. Vasily decided to ...
256 megabytes
import java.util.*; public class B379 { public static void main(String[] args){ Scanner br = new Scanner(System.in); int n = br.nextInt(); StringBuilder res = new StringBuilder(""); int[] left = new int[n]; for(int i = 0;i<n;i++){ left[i] = br.nextInt(); } int pos = 0; while(true){ if(left[pos] =...
Java
["2\n1 2", "4\n0 2 0 2"]
1 second
["PRPLRP", "RPRRPLLPLRRRP"]
null
Java 7
standard input
[ "constructive algorithms", "implementation" ]
50e88225d8b081d63eebe446f48057f4
The first line contains integer n (2 ≀ n ≀ 300) β€” the number of wallets. The next line contains n integers a1, a2, ..., an (0 ≀ ai ≀ 300). It is guaranteed that at least one ai is positive.
1,200
Print the sequence that consists of k (1 ≀ k ≀ 106) characters, each of them equals: "L", "R" or "P". Each character of the sequence is an instruction to the robot. Character "L" orders to move to the left, character "R" orders to move to the right, character "P" orders the robot to put a coin in the wallet. The robot ...
standard output
PASSED
7648e88badf652c33fd7c8a309a8155d
train_000.jsonl
1388417400
The New Year is coming! That's why many people today are busy preparing New Year presents. Vasily the Programmer is no exception.Vasily knows that the best present is (no, it's not a contest) money. He's put n empty wallets from left to right in a row and decided how much money to put in what wallet. Vasily decided to ...
256 megabytes
import java.io.*; import java.math.BigInteger; import java.util.ArrayDeque; import java.util.ArrayList; import java.util.Arrays; import java.util.Collection; import java.util.Comparator; import java.util.Deque; import java.util.HashMap; import java.util.HashSet; import java.util.Iterator; import java.util.LinkedList; i...
Java
["2\n1 2", "4\n0 2 0 2"]
1 second
["PRPLRP", "RPRRPLLPLRRRP"]
null
Java 7
standard input
[ "constructive algorithms", "implementation" ]
50e88225d8b081d63eebe446f48057f4
The first line contains integer n (2 ≀ n ≀ 300) β€” the number of wallets. The next line contains n integers a1, a2, ..., an (0 ≀ ai ≀ 300). It is guaranteed that at least one ai is positive.
1,200
Print the sequence that consists of k (1 ≀ k ≀ 106) characters, each of them equals: "L", "R" or "P". Each character of the sequence is an instruction to the robot. Character "L" orders to move to the left, character "R" orders to move to the right, character "P" orders the robot to put a coin in the wallet. The robot ...
standard output
PASSED
62f7061e49970ddf4cf7f12b454759b3
train_000.jsonl
1388417400
The New Year is coming! That's why many people today are busy preparing New Year presents. Vasily the Programmer is no exception.Vasily knows that the best present is (no, it's not a contest) money. He's put n empty wallets from left to right in a row and decided how much money to put in what wallet. Vasily decided to ...
256 megabytes
/* * To change this license header, choose License Headers in Project Properties. * To change this template file, choose Tools | Templates * and open the template in the editor. */ import java.util.*; import java.math.*; import java.io.*; /** * * @author magzhankairanbay */ public class Code { public s...
Java
["2\n1 2", "4\n0 2 0 2"]
1 second
["PRPLRP", "RPRRPLLPLRRRP"]
null
Java 7
standard input
[ "constructive algorithms", "implementation" ]
50e88225d8b081d63eebe446f48057f4
The first line contains integer n (2 ≀ n ≀ 300) β€” the number of wallets. The next line contains n integers a1, a2, ..., an (0 ≀ ai ≀ 300). It is guaranteed that at least one ai is positive.
1,200
Print the sequence that consists of k (1 ≀ k ≀ 106) characters, each of them equals: "L", "R" or "P". Each character of the sequence is an instruction to the robot. Character "L" orders to move to the left, character "R" orders to move to the right, character "P" orders the robot to put a coin in the wallet. The robot ...
standard output
PASSED
055e5bc26fd67dd81548a546be3e72ab
train_000.jsonl
1388417400
The New Year is coming! That's why many people today are busy preparing New Year presents. Vasily the Programmer is no exception.Vasily knows that the best present is (no, it's not a contest) money. He's put n empty wallets from left to right in a row and decided how much money to put in what wallet. Vasily decided to ...
256 megabytes
import java.io.*; import java.util.*; import java.math.*; public class Main { public static void main(String args[]) { Scanner cin = new Scanner(System.in); int n = cin.nextInt(); int A[] = new int[n]; for (int i = 0; i < n; i++) { A[i] = cin.nextInt(); } ...
Java
["2\n1 2", "4\n0 2 0 2"]
1 second
["PRPLRP", "RPRRPLLPLRRRP"]
null
Java 7
standard input
[ "constructive algorithms", "implementation" ]
50e88225d8b081d63eebe446f48057f4
The first line contains integer n (2 ≀ n ≀ 300) β€” the number of wallets. The next line contains n integers a1, a2, ..., an (0 ≀ ai ≀ 300). It is guaranteed that at least one ai is positive.
1,200
Print the sequence that consists of k (1 ≀ k ≀ 106) characters, each of them equals: "L", "R" or "P". Each character of the sequence is an instruction to the robot. Character "L" orders to move to the left, character "R" orders to move to the right, character "P" orders the robot to put a coin in the wallet. The robot ...
standard output
PASSED
de49b887bdc0a23d5d4864a361f0f7c7
train_000.jsonl
1388417400
The New Year is coming! That's why many people today are busy preparing New Year presents. Vasily the Programmer is no exception.Vasily knows that the best present is (no, it's not a contest) money. He's put n empty wallets from left to right in a row and decided how much money to put in what wallet. Vasily decided to ...
256 megabytes
import java.util.Scanner; public class ass { public static void main(String args[]) { Scanner in = new Scanner(System.in); int a[]; int n=in.nextInt(); a=new int[n]; for(int i=0;i<n;i++){ a[i] = in.nextInt();} for(int i=0;i<n;i++){ if(a[i]==0&&...
Java
["2\n1 2", "4\n0 2 0 2"]
1 second
["PRPLRP", "RPRRPLLPLRRRP"]
null
Java 7
standard input
[ "constructive algorithms", "implementation" ]
50e88225d8b081d63eebe446f48057f4
The first line contains integer n (2 ≀ n ≀ 300) β€” the number of wallets. The next line contains n integers a1, a2, ..., an (0 ≀ ai ≀ 300). It is guaranteed that at least one ai is positive.
1,200
Print the sequence that consists of k (1 ≀ k ≀ 106) characters, each of them equals: "L", "R" or "P". Each character of the sequence is an instruction to the robot. Character "L" orders to move to the left, character "R" orders to move to the right, character "P" orders the robot to put a coin in the wallet. The robot ...
standard output
PASSED
f18251b9cc192fe2b34dffd3179752fb
train_000.jsonl
1388417400
The New Year is coming! That's why many people today are busy preparing New Year presents. Vasily the Programmer is no exception.Vasily knows that the best present is (no, it's not a contest) money. He's put n empty wallets from left to right in a row and decided how much money to put in what wallet. Vasily decided to ...
256 megabytes
import java.util.*; import java.math.*; public class Main { public static void main(String[] args){ Scanner sc = new Scanner(System.in); int n = sc.nextInt(); int[] t = new int[n]; for (int i=0; i<n; i++) t[i] = sc.nextInt(); StringBuilder sb = new StringBuilder(); int pos =0; while (true){ if(t[pos]>0){ t[pos...
Java
["2\n1 2", "4\n0 2 0 2"]
1 second
["PRPLRP", "RPRRPLLPLRRRP"]
null
Java 7
standard input
[ "constructive algorithms", "implementation" ]
50e88225d8b081d63eebe446f48057f4
The first line contains integer n (2 ≀ n ≀ 300) β€” the number of wallets. The next line contains n integers a1, a2, ..., an (0 ≀ ai ≀ 300). It is guaranteed that at least one ai is positive.
1,200
Print the sequence that consists of k (1 ≀ k ≀ 106) characters, each of them equals: "L", "R" or "P". Each character of the sequence is an instruction to the robot. Character "L" orders to move to the left, character "R" orders to move to the right, character "P" orders the robot to put a coin in the wallet. The robot ...
standard output
PASSED
35a098d6ad70820eb5de9d755facd722
train_000.jsonl
1404651900
DZY loves colors, and he enjoys painting.On a colorful day, DZY gets a colorful ribbon, which consists of n units (they are numbered from 1 to n from left to right). The color of the i-th unit of the ribbon is i at first. It is colorful enough, but we still consider that the colorfulness of each unit is 0 at first.DZY ...
256 megabytes
import java.io.*; import java.util.*; import java.math.BigInteger; import java.util.Collections.*; import static java.lang.Math.*; import static java.util.Arrays.*; import static java.math.BigInteger.*; public class Main{ void run(){ Locale.setDefault(Locale.US); boolean my; try { ...
Java
["3 3\n1 1 2 4\n1 2 3 5\n2 1 3", "3 4\n1 1 3 4\n2 1 1\n2 2 2\n2 3 3", "10 6\n1 1 5 3\n1 2 7 9\n1 10 10 11\n1 3 8 12\n1 1 10 3\n2 1 10"]
2 seconds
["8", "3\n2\n1", "129"]
NoteIn the first sample, the color of each unit is initially [1, 2, 3], and the colorfulness is [0, 0, 0].After the first operation, colors become [4, 4, 3], colorfulness become [3, 2, 0].After the second operation, colors become [4, 5, 5], colorfulness become [3, 3, 2].So the answer to the only operation of type 2 is ...
Java 8
standard input
[ "data structures" ]
562656bfc27b7cf06f7c4a373c6bc029
The first line contains two space-separated integers n, mΒ (1 ≀ n, m ≀ 105). Each of the next m lines begins with a integer typeΒ (1 ≀ type ≀ 2), which represents the type of this operation. If type = 1, there will be 3 more integers l, r, xΒ (1 ≀ l ≀ r ≀ n;Β 1 ≀ x ≀ 108) in this line, describing an operation 1. If type = ...
2,400
For each operation 2, print a line containing the answer β€” sum of colorfulness.
standard output
PASSED
dfbf5a7237180d50769714e22f731e0c
train_000.jsonl
1404651900
DZY loves colors, and he enjoys painting.On a colorful day, DZY gets a colorful ribbon, which consists of n units (they are numbered from 1 to n from left to right). The color of the i-th unit of the ribbon is i at first. It is colorful enough, but we still consider that the colorfulness of each unit is 0 at first.DZY ...
256 megabytes
import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; import java.io.PrintWriter; import java.util.StringTokenizer; /** * @author Don Li */ public class DZYLovesColors { void solve() { int n = in.nextInt(), m = in.nextInt(); SegmentTree seg = n...
Java
["3 3\n1 1 2 4\n1 2 3 5\n2 1 3", "3 4\n1 1 3 4\n2 1 1\n2 2 2\n2 3 3", "10 6\n1 1 5 3\n1 2 7 9\n1 10 10 11\n1 3 8 12\n1 1 10 3\n2 1 10"]
2 seconds
["8", "3\n2\n1", "129"]
NoteIn the first sample, the color of each unit is initially [1, 2, 3], and the colorfulness is [0, 0, 0].After the first operation, colors become [4, 4, 3], colorfulness become [3, 2, 0].After the second operation, colors become [4, 5, 5], colorfulness become [3, 3, 2].So the answer to the only operation of type 2 is ...
Java 8
standard input
[ "data structures" ]
562656bfc27b7cf06f7c4a373c6bc029
The first line contains two space-separated integers n, mΒ (1 ≀ n, m ≀ 105). Each of the next m lines begins with a integer typeΒ (1 ≀ type ≀ 2), which represents the type of this operation. If type = 1, there will be 3 more integers l, r, xΒ (1 ≀ l ≀ r ≀ n;Β 1 ≀ x ≀ 108) in this line, describing an operation 1. If type = ...
2,400
For each operation 2, print a line containing the answer β€” sum of colorfulness.
standard output
PASSED
8a583c0201e9ba0a00695dcfd3d40d6b
train_000.jsonl
1404651900
DZY loves colors, and he enjoys painting.On a colorful day, DZY gets a colorful ribbon, which consists of n units (they are numbered from 1 to n from left to right). The color of the i-th unit of the ribbon is i at first. It is colorful enough, but we still consider that the colorfulness of each unit is 0 at first.DZY ...
256 megabytes
import java.io.BufferedReader; import java.io.FileNotFoundException; import java.io.FileReader; import java.io.IOException; import java.io.InputStream; import java.io.InputStreamReader; import java.io.PrintWriter; import java.util.Arrays; import java.util.StringTokenizer; public class E { static int n, b, bS; stati...
Java
["3 3\n1 1 2 4\n1 2 3 5\n2 1 3", "3 4\n1 1 3 4\n2 1 1\n2 2 2\n2 3 3", "10 6\n1 1 5 3\n1 2 7 9\n1 10 10 11\n1 3 8 12\n1 1 10 3\n2 1 10"]
2 seconds
["8", "3\n2\n1", "129"]
NoteIn the first sample, the color of each unit is initially [1, 2, 3], and the colorfulness is [0, 0, 0].After the first operation, colors become [4, 4, 3], colorfulness become [3, 2, 0].After the second operation, colors become [4, 5, 5], colorfulness become [3, 3, 2].So the answer to the only operation of type 2 is ...
Java 8
standard input
[ "data structures" ]
562656bfc27b7cf06f7c4a373c6bc029
The first line contains two space-separated integers n, mΒ (1 ≀ n, m ≀ 105). Each of the next m lines begins with a integer typeΒ (1 ≀ type ≀ 2), which represents the type of this operation. If type = 1, there will be 3 more integers l, r, xΒ (1 ≀ l ≀ r ≀ n;Β 1 ≀ x ≀ 108) in this line, describing an operation 1. If type = ...
2,400
For each operation 2, print a line containing the answer β€” sum of colorfulness.
standard output
PASSED
b8391e612164eb525881bb9487e3ac12
train_000.jsonl
1291046400
The territory of Berland is represented by a rectangular field n × m in size. The king of Berland lives in the capital, located on the upper left square (1, 1). The lower right square has coordinates (n, m). One day the king decided to travel through the whole country and return back to the capital, having visited ever...
256 megabytes
import java.io.BufferedReader; import java.io.FileInputStream; import java.io.FileNotFoundException; import java.io.FileOutputStream; import java.io.InputStream; import java.io.InputStreamReader; import java.io.PrintWriter; import java.util.ArrayList; import java.util.List; import java.util.StringTokenizer; public cl...
Java
["2 2", "3 3"]
2 seconds
["0\n1 1\n1 2\n2 2\n2 1\n1 1", "1\n3 3 1 1\n1 1\n1 2\n1 3\n2 3\n2 2\n2 1\n3 1\n3 2\n3 3\n1 1"]
null
Java 7
standard input
[ "constructive algorithms", "implementation", "brute force" ]
a98622d5b6d6d139df90b6fee3baa544
The first line contains two space-separated integers n and m (1 ≀ n, m ≀ 100, 2 ≀  n Β· m) β€” the field size. The upper left square has coordinates (1, 1), and the lower right square has coordinates of (n, m).
2,000
On the first line output integer k β€” the minimum number of teleporters. Then output k lines each containing 4 integers x1 y1 x2 y2 (1 ≀ x1, x2 ≀ n, 1 ≀ y1, y2 ≀ m) β€” the coordinates of the square where the teleporter is installed (x1, y1), and the coordinates of the square where the teleporter leads (x2, y2). Then prin...
standard output
PASSED
1c947a3009ec7a1f2500a71cb1f4ecb1
train_000.jsonl
1291046400
The territory of Berland is represented by a rectangular field n × m in size. The king of Berland lives in the capital, located on the upper left square (1, 1). The lower right square has coordinates (n, m). One day the king decided to travel through the whole country and return back to the capital, having visited ever...
256 megabytes
import java.util.Scanner; public class d43 { public static void main(String[] args) { Scanner in = new Scanner(System.in); int x = in.nextInt(); int y = in.nextInt(); if (x == 1 && y !=2) { System.out.printf("1\n1 %d 1 1\n", y); for (int i = 1; i <= y; i++) { System.out.printf("1 %d\n", i); } ...
Java
["2 2", "3 3"]
2 seconds
["0\n1 1\n1 2\n2 2\n2 1\n1 1", "1\n3 3 1 1\n1 1\n1 2\n1 3\n2 3\n2 2\n2 1\n3 1\n3 2\n3 3\n1 1"]
null
Java 7
standard input
[ "constructive algorithms", "implementation", "brute force" ]
a98622d5b6d6d139df90b6fee3baa544
The first line contains two space-separated integers n and m (1 ≀ n, m ≀ 100, 2 ≀  n Β· m) β€” the field size. The upper left square has coordinates (1, 1), and the lower right square has coordinates of (n, m).
2,000
On the first line output integer k β€” the minimum number of teleporters. Then output k lines each containing 4 integers x1 y1 x2 y2 (1 ≀ x1, x2 ≀ n, 1 ≀ y1, y2 ≀ m) β€” the coordinates of the square where the teleporter is installed (x1, y1), and the coordinates of the square where the teleporter leads (x2, y2). Then prin...
standard output
PASSED
87b705868183f22f6f3092b48feb071f
train_000.jsonl
1291046400
The territory of Berland is represented by a rectangular field n × m in size. The king of Berland lives in the capital, located on the upper left square (1, 1). The lower right square has coordinates (n, m). One day the king decided to travel through the whole country and return back to the capital, having visited ever...
256 megabytes
import java.util.Scanner; public class P43D { public P43D() { Scanner sc = new Scanner (System.in); int n = sc.nextInt(); int m = sc.nextInt(); sc.close(); if (n == 1){ if (m == 2){ System.out.println(0); System.out.println(1 + ...
Java
["2 2", "3 3"]
2 seconds
["0\n1 1\n1 2\n2 2\n2 1\n1 1", "1\n3 3 1 1\n1 1\n1 2\n1 3\n2 3\n2 2\n2 1\n3 1\n3 2\n3 3\n1 1"]
null
Java 7
standard input
[ "constructive algorithms", "implementation", "brute force" ]
a98622d5b6d6d139df90b6fee3baa544
The first line contains two space-separated integers n and m (1 ≀ n, m ≀ 100, 2 ≀  n Β· m) β€” the field size. The upper left square has coordinates (1, 1), and the lower right square has coordinates of (n, m).
2,000
On the first line output integer k β€” the minimum number of teleporters. Then output k lines each containing 4 integers x1 y1 x2 y2 (1 ≀ x1, x2 ≀ n, 1 ≀ y1, y2 ≀ m) β€” the coordinates of the square where the teleporter is installed (x1, y1), and the coordinates of the square where the teleporter leads (x2, y2). Then prin...
standard output
PASSED
7642731c12a66741dce5d23c02cf2dcf
train_000.jsonl
1291046400
The territory of Berland is represented by a rectangular field n × m in size. The king of Berland lives in the capital, located on the upper left square (1, 1). The lower right square has coordinates (n, m). One day the king decided to travel through the whole country and return back to the capital, having visited ever...
256 megabytes
import java.io.InputStreamReader; import java.io.IOException; import java.io.BufferedReader; import java.io.OutputStream; import java.io.PrintWriter; import java.util.StringTokenizer; import java.io.InputStream; /** * Built using CHelper plug-in * Actual solution is at the top * @author Zyflair Griffane */ public ...
Java
["2 2", "3 3"]
2 seconds
["0\n1 1\n1 2\n2 2\n2 1\n1 1", "1\n3 3 1 1\n1 1\n1 2\n1 3\n2 3\n2 2\n2 1\n3 1\n3 2\n3 3\n1 1"]
null
Java 7
standard input
[ "constructive algorithms", "implementation", "brute force" ]
a98622d5b6d6d139df90b6fee3baa544
The first line contains two space-separated integers n and m (1 ≀ n, m ≀ 100, 2 ≀  n Β· m) β€” the field size. The upper left square has coordinates (1, 1), and the lower right square has coordinates of (n, m).
2,000
On the first line output integer k β€” the minimum number of teleporters. Then output k lines each containing 4 integers x1 y1 x2 y2 (1 ≀ x1, x2 ≀ n, 1 ≀ y1, y2 ≀ m) β€” the coordinates of the square where the teleporter is installed (x1, y1), and the coordinates of the square where the teleporter leads (x2, y2). Then prin...
standard output