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
864367890b7084c47f5fdac7732913e6
train_000.jsonl
1370619000
Sereja has got an array, consisting of n integers, a1, a2, ..., an. Sereja is an active boy, so he is now going to complete m operations. Each operation will have one of the three forms: Make vi-th array element equal to xi. In other words, perform the assignment avi = xi. Increase each array element by yi. In other ...
256 megabytes
import java.io.*; import java.util.*; public class C315B { void solution() throws Exception { int n = in.nextInt(), m = in.nextInt(), y = 0; long[] f = new long[n]; for (int i = 0; i < n; i++) { f[i] = in.nextInt(); } ...
Java
["10 11\n1 2 3 4 5 6 7 8 9 10\n3 2\n3 9\n2 10\n3 1\n3 10\n1 1 10\n2 10\n2 10\n3 1\n3 10\n3 9"]
1 second
["2\n9\n11\n20\n30\n40\n39"]
null
Java 7
standard input
[ "implementation" ]
48f3ff32a11770f3b168d6e15c0df813
The first line contains integers n, m (1 ≀ n, m ≀ 105). The second line contains n space-separated integers a1, a2, ..., an (1 ≀ ai ≀ 109) β€” the original array. Next m lines describe operations, the i-th line describes the i-th operation. The first number in the i-th line is integer ti (1 ≀ ti ≀ 3) that represents the ...
1,200
For each third type operation print value aqi. Print the values in the order, in which the corresponding queries follow in the input.
standard output
PASSED
470e05859132598ffb64f4aa8a4a1883
train_000.jsonl
1370619000
Sereja has got an array, consisting of n integers, a1, a2, ..., an. Sereja is an active boy, so he is now going to complete m operations. Each operation will have one of the three forms: Make vi-th array element equal to xi. In other words, perform the assignment avi = xi. Increase each array element by yi. In other ...
256 megabytes
import java.io.BufferedReader; import java.io.File; import java.io.FileNotFoundException; import java.io.FileReader; import java.io.IOException; import java.io.InputStream; import java.io.InputStreamReader; import java.io.PrintWriter; import java.util.StringTokenizer; public class B315 { public static void main (Str...
Java
["10 11\n1 2 3 4 5 6 7 8 9 10\n3 2\n3 9\n2 10\n3 1\n3 10\n1 1 10\n2 10\n2 10\n3 1\n3 10\n3 9"]
1 second
["2\n9\n11\n20\n30\n40\n39"]
null
Java 7
standard input
[ "implementation" ]
48f3ff32a11770f3b168d6e15c0df813
The first line contains integers n, m (1 ≀ n, m ≀ 105). The second line contains n space-separated integers a1, a2, ..., an (1 ≀ ai ≀ 109) β€” the original array. Next m lines describe operations, the i-th line describes the i-th operation. The first number in the i-th line is integer ti (1 ≀ ti ≀ 3) that represents the ...
1,200
For each third type operation print value aqi. Print the values in the order, in which the corresponding queries follow in the input.
standard output
PASSED
d7ebbafa4b2b638fe3ce36d0ea3f39b2
train_000.jsonl
1370619000
Sereja has got an array, consisting of n integers, a1, a2, ..., an. Sereja is an active boy, so he is now going to complete m operations. Each operation will have one of the three forms: Make vi-th array element equal to xi. In other words, perform the assignment avi = xi. Increase each array element by yi. In other ...
256 megabytes
import java.io.*; import java.util.*; /** * * @coder Altynbek Nurgaziyev */ public class C315B { void solution() throws Exception { int n = in.nextInt(), m = in.nextInt(), y = 0; long[] f = new long[n]; for (int i = 0; i < n; i++) { f...
Java
["10 11\n1 2 3 4 5 6 7 8 9 10\n3 2\n3 9\n2 10\n3 1\n3 10\n1 1 10\n2 10\n2 10\n3 1\n3 10\n3 9"]
1 second
["2\n9\n11\n20\n30\n40\n39"]
null
Java 7
standard input
[ "implementation" ]
48f3ff32a11770f3b168d6e15c0df813
The first line contains integers n, m (1 ≀ n, m ≀ 105). The second line contains n space-separated integers a1, a2, ..., an (1 ≀ ai ≀ 109) β€” the original array. Next m lines describe operations, the i-th line describes the i-th operation. The first number in the i-th line is integer ti (1 ≀ ti ≀ 3) that represents the ...
1,200
For each third type operation print value aqi. Print the values in the order, in which the corresponding queries follow in the input.
standard output
PASSED
61fc6fc222c5ca69dc50bcd5cec31a09
train_000.jsonl
1370619000
Sereja has got an array, consisting of n integers, a1, a2, ..., an. Sereja is an active boy, so he is now going to complete m operations. Each operation will have one of the three forms: Make vi-th array element equal to xi. In other words, perform the assignment avi = xi. Increase each array element by yi. In other ...
256 megabytes
import java.io.*; import java.util.*; public class SerejaAndArray { public static void main(String[] args) throws IOException { BufferedReader f = new BufferedReader(new InputStreamReader(System.in)); StringTokenizer st = new StringTokenizer(f.readLine()); int n = Integer.parseInt(st.nextTo...
Java
["10 11\n1 2 3 4 5 6 7 8 9 10\n3 2\n3 9\n2 10\n3 1\n3 10\n1 1 10\n2 10\n2 10\n3 1\n3 10\n3 9"]
1 second
["2\n9\n11\n20\n30\n40\n39"]
null
Java 7
standard input
[ "implementation" ]
48f3ff32a11770f3b168d6e15c0df813
The first line contains integers n, m (1 ≀ n, m ≀ 105). The second line contains n space-separated integers a1, a2, ..., an (1 ≀ ai ≀ 109) β€” the original array. Next m lines describe operations, the i-th line describes the i-th operation. The first number in the i-th line is integer ti (1 ≀ ti ≀ 3) that represents the ...
1,200
For each third type operation print value aqi. Print the values in the order, in which the corresponding queries follow in the input.
standard output
PASSED
78a3b58cd5ce9a58fc39df92494db5d3
train_000.jsonl
1370619000
Sereja has got an array, consisting of n integers, a1, a2, ..., an. Sereja is an active boy, so he is now going to complete m operations. Each operation will have one of the three forms: Make vi-th array element equal to xi. In other words, perform the assignment avi = xi. Increase each array element by yi. In other ...
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.ArrayList; import java.util.Arrays; import java.util.StringTokenizer; public class SerejaAndArray { public static void main(String []arg...
Java
["10 11\n1 2 3 4 5 6 7 8 9 10\n3 2\n3 9\n2 10\n3 1\n3 10\n1 1 10\n2 10\n2 10\n3 1\n3 10\n3 9"]
1 second
["2\n9\n11\n20\n30\n40\n39"]
null
Java 7
standard input
[ "implementation" ]
48f3ff32a11770f3b168d6e15c0df813
The first line contains integers n, m (1 ≀ n, m ≀ 105). The second line contains n space-separated integers a1, a2, ..., an (1 ≀ ai ≀ 109) β€” the original array. Next m lines describe operations, the i-th line describes the i-th operation. The first number in the i-th line is integer ti (1 ≀ ti ≀ 3) that represents the ...
1,200
For each third type operation print value aqi. Print the values in the order, in which the corresponding queries follow in the input.
standard output
PASSED
13ebe8219d5b58c196f3c861686bde46
train_000.jsonl
1370619000
Sereja has got an array, consisting of n integers, a1, a2, ..., an. Sereja is an active boy, so he is now going to complete m operations. Each operation will have one of the three forms: Make vi-th array element equal to xi. In other words, perform the assignment avi = xi. Increase each array element by yi. In other ...
256 megabytes
/* * To change this template, choose Tools | Templates and open the template in * the editor. */ import java.io.*; import java.util.*; public class Task extends ASolver { int[] a; int n; int m; int y = 0; StringBuilder result; public static void main(String[] args) throws IOException { ...
Java
["10 11\n1 2 3 4 5 6 7 8 9 10\n3 2\n3 9\n2 10\n3 1\n3 10\n1 1 10\n2 10\n2 10\n3 1\n3 10\n3 9"]
1 second
["2\n9\n11\n20\n30\n40\n39"]
null
Java 7
standard input
[ "implementation" ]
48f3ff32a11770f3b168d6e15c0df813
The first line contains integers n, m (1 ≀ n, m ≀ 105). The second line contains n space-separated integers a1, a2, ..., an (1 ≀ ai ≀ 109) β€” the original array. Next m lines describe operations, the i-th line describes the i-th operation. The first number in the i-th line is integer ti (1 ≀ ti ≀ 3) that represents the ...
1,200
For each third type operation print value aqi. Print the values in the order, in which the corresponding queries follow in the input.
standard output
PASSED
4d7311c6bda479fb87974570522b6102
train_000.jsonl
1370619000
Sereja has got an array, consisting of n integers, a1, a2, ..., an. Sereja is an active boy, so he is now going to complete m operations. Each operation will have one of the three forms: Make vi-th array element equal to xi. In other words, perform the assignment avi = xi. Increase each array element by yi. In other ...
256 megabytes
import java.io.*; public class R187D2PB { private static final int ASSIGNMENT = 1; private static final int INCREMENT = 2; private static final int PRINTING = 3; private static StreamTokenizer in = new StreamTokenizer(new BufferedReader(new InputStreamReader(System.in))); private static int next...
Java
["10 11\n1 2 3 4 5 6 7 8 9 10\n3 2\n3 9\n2 10\n3 1\n3 10\n1 1 10\n2 10\n2 10\n3 1\n3 10\n3 9"]
1 second
["2\n9\n11\n20\n30\n40\n39"]
null
Java 7
standard input
[ "implementation" ]
48f3ff32a11770f3b168d6e15c0df813
The first line contains integers n, m (1 ≀ n, m ≀ 105). The second line contains n space-separated integers a1, a2, ..., an (1 ≀ ai ≀ 109) β€” the original array. Next m lines describe operations, the i-th line describes the i-th operation. The first number in the i-th line is integer ti (1 ≀ ti ≀ 3) that represents the ...
1,200
For each third type operation print value aqi. Print the values in the order, in which the corresponding queries follow in the input.
standard output
PASSED
f4db0d609a017626e59ad5f24d195c69
train_000.jsonl
1370619000
Sereja has got an array, consisting of n integers, a1, a2, ..., an. Sereja is an active boy, so he is now going to complete m operations. Each operation will have one of the three forms: Make vi-th array element equal to xi. In other words, perform the assignment avi = xi. Increase each array element by yi. In other ...
256 megabytes
import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; import java.io.PrintWriter; import java.util.StringTokenizer; public class B { public static void main(String[] args) throws IOException { PrintWriter out = new PrintWriter(System.out); sc = new StringTokenizer(br.readLi...
Java
["10 11\n1 2 3 4 5 6 7 8 9 10\n3 2\n3 9\n2 10\n3 1\n3 10\n1 1 10\n2 10\n2 10\n3 1\n3 10\n3 9"]
1 second
["2\n9\n11\n20\n30\n40\n39"]
null
Java 7
standard input
[ "implementation" ]
48f3ff32a11770f3b168d6e15c0df813
The first line contains integers n, m (1 ≀ n, m ≀ 105). The second line contains n space-separated integers a1, a2, ..., an (1 ≀ ai ≀ 109) β€” the original array. Next m lines describe operations, the i-th line describes the i-th operation. The first number in the i-th line is integer ti (1 ≀ ti ≀ 3) that represents the ...
1,200
For each third type operation print value aqi. Print the values in the order, in which the corresponding queries follow in the input.
standard output
PASSED
5f2e908365543e48e476bb2471b8c03c
train_000.jsonl
1370619000
Sereja has got an array, consisting of n integers, a1, a2, ..., an. Sereja is an active boy, so he is now going to complete m operations. Each operation will have one of the three forms: Make vi-th array element equal to xi. In other words, perform the assignment avi = xi. Increase each array element by yi. In other ...
256 megabytes
import java.io.*; import java.util.*; public class Main { public static void main(String args[]) throws FileNotFoundException, IOException { Scanner Reader = new Scanner(System.in); int n = Reader.nextInt(); int m = Reader.nextInt(); long[] a = new long[n]; for (int i = 0...
Java
["10 11\n1 2 3 4 5 6 7 8 9 10\n3 2\n3 9\n2 10\n3 1\n3 10\n1 1 10\n2 10\n2 10\n3 1\n3 10\n3 9"]
1 second
["2\n9\n11\n20\n30\n40\n39"]
null
Java 7
standard input
[ "implementation" ]
48f3ff32a11770f3b168d6e15c0df813
The first line contains integers n, m (1 ≀ n, m ≀ 105). The second line contains n space-separated integers a1, a2, ..., an (1 ≀ ai ≀ 109) β€” the original array. Next m lines describe operations, the i-th line describes the i-th operation. The first number in the i-th line is integer ti (1 ≀ ti ≀ 3) that represents the ...
1,200
For each third type operation print value aqi. Print the values in the order, in which the corresponding queries follow in the input.
standard output
PASSED
1fda8e1bc2703ddd00b69b88596fc0ae
train_000.jsonl
1370619000
Sereja has got an array, consisting of n integers, a1, a2, ..., an. Sereja is an active boy, so he is now going to complete m operations. Each operation will have one of the three forms: Make vi-th array element equal to xi. In other words, perform the assignment avi = xi. Increase each array element by yi. In other ...
256 megabytes
import java.io.BufferedReader; import java.io.InputStreamReader; /* * To change this template, choose Tools | Templates * and open the template in the editor. */ /** * * @author Trung Pham */ public class Code1 { public static void main(String[] args) { try { BufferedReader in = new Buf...
Java
["10 11\n1 2 3 4 5 6 7 8 9 10\n3 2\n3 9\n2 10\n3 1\n3 10\n1 1 10\n2 10\n2 10\n3 1\n3 10\n3 9"]
1 second
["2\n9\n11\n20\n30\n40\n39"]
null
Java 7
standard input
[ "implementation" ]
48f3ff32a11770f3b168d6e15c0df813
The first line contains integers n, m (1 ≀ n, m ≀ 105). The second line contains n space-separated integers a1, a2, ..., an (1 ≀ ai ≀ 109) β€” the original array. Next m lines describe operations, the i-th line describes the i-th operation. The first number in the i-th line is integer ti (1 ≀ ti ≀ 3) that represents the ...
1,200
For each third type operation print value aqi. Print the values in the order, in which the corresponding queries follow in the input.
standard output
PASSED
2f8b40f3d5ba9ba1837de1fd38fe1e03
train_000.jsonl
1370619000
Sereja has got an array, consisting of n integers, a1, a2, ..., an. Sereja is an active boy, so he is now going to complete m operations. Each operation will have one of the three forms: Make vi-th array element equal to xi. In other words, perform the assignment avi = xi. Increase each array element by yi. In other ...
256 megabytes
import java.io.BufferedReader; import java.io.FileInputStream; import java.io.IOException; import java.io.InputStream; import java.io.InputStreamReader; import java.io.PrintWriter; import java.util.StringTokenizer; public class B315 { FastScanner in; PrintWriter out; public void solve() throws IOException { int ...
Java
["10 11\n1 2 3 4 5 6 7 8 9 10\n3 2\n3 9\n2 10\n3 1\n3 10\n1 1 10\n2 10\n2 10\n3 1\n3 10\n3 9"]
1 second
["2\n9\n11\n20\n30\n40\n39"]
null
Java 7
standard input
[ "implementation" ]
48f3ff32a11770f3b168d6e15c0df813
The first line contains integers n, m (1 ≀ n, m ≀ 105). The second line contains n space-separated integers a1, a2, ..., an (1 ≀ ai ≀ 109) β€” the original array. Next m lines describe operations, the i-th line describes the i-th operation. The first number in the i-th line is integer ti (1 ≀ ti ≀ 3) that represents the ...
1,200
For each third type operation print value aqi. Print the values in the order, in which the corresponding queries follow in the input.
standard output
PASSED
c8736807bfdbf8530910abe332719338
train_000.jsonl
1370619000
Sereja has got an array, consisting of n integers, a1, a2, ..., an. Sereja is an active boy, so he is now going to complete m operations. Each operation will have one of the three forms: Make vi-th array element equal to xi. In other words, perform the assignment avi = xi. Increase each array element by yi. In other ...
256 megabytes
import java.io.*; public class problemBcf { public static void main(String args[]) throws IOException { BufferedReader in = new BufferedReader(new InputStreamReader(System.in)); /* String str = in.readLine(); // int n = Integer.parseInt(str.split(" ")[0]); int m = Integer.parseInt(str.split(" ")[1]); String[...
Java
["10 11\n1 2 3 4 5 6 7 8 9 10\n3 2\n3 9\n2 10\n3 1\n3 10\n1 1 10\n2 10\n2 10\n3 1\n3 10\n3 9"]
1 second
["2\n9\n11\n20\n30\n40\n39"]
null
Java 7
standard input
[ "implementation" ]
48f3ff32a11770f3b168d6e15c0df813
The first line contains integers n, m (1 ≀ n, m ≀ 105). The second line contains n space-separated integers a1, a2, ..., an (1 ≀ ai ≀ 109) β€” the original array. Next m lines describe operations, the i-th line describes the i-th operation. The first number in the i-th line is integer ti (1 ≀ ti ≀ 3) that represents the ...
1,200
For each third type operation print value aqi. Print the values in the order, in which the corresponding queries follow in the input.
standard output
PASSED
b5b8e083c1f61475fa1635c2c49b7d54
train_000.jsonl
1370619000
Sereja has got an array, consisting of n integers, a1, a2, ..., an. Sereja is an active boy, so he is now going to complete m operations. Each operation will have one of the three forms: Make vi-th array element equal to xi. In other words, perform the assignment avi = xi. Increase each array element by yi. In other ...
256 megabytes
import java.io.*; import java.math.*; import java.util.*; public class SolutionA{ public static void main(String[] args){ new SolutionA().run(); } int n, m, d1, d2, x, t; int a[]; int cnt[]; int last[]; void solve(){ try{ n = in.nextInt(); m = in.nex...
Java
["10 11\n1 2 3 4 5 6 7 8 9 10\n3 2\n3 9\n2 10\n3 1\n3 10\n1 1 10\n2 10\n2 10\n3 1\n3 10\n3 9"]
1 second
["2\n9\n11\n20\n30\n40\n39"]
null
Java 7
standard input
[ "implementation" ]
48f3ff32a11770f3b168d6e15c0df813
The first line contains integers n, m (1 ≀ n, m ≀ 105). The second line contains n space-separated integers a1, a2, ..., an (1 ≀ ai ≀ 109) β€” the original array. Next m lines describe operations, the i-th line describes the i-th operation. The first number in the i-th line is integer ti (1 ≀ ti ≀ 3) that represents the ...
1,200
For each third type operation print value aqi. Print the values in the order, in which the corresponding queries follow in the input.
standard output
PASSED
269990f275eba11588df7f260932c71f
train_000.jsonl
1370619000
Sereja has got an array, consisting of n integers, a1, a2, ..., an. Sereja is an active boy, so he is now going to complete m operations. Each operation will have one of the three forms: Make vi-th array element equal to xi. In other words, perform the assignment avi = xi. Increase each array element by yi. In other ...
256 megabytes
import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; import java.util.StringTokenizer; public class B { public static void main(String[] args) { MyScanner sc = new MyScanner(); int n = sc.nextInt(); int m = sc.nextInt(); int[] a = new int[n]...
Java
["10 11\n1 2 3 4 5 6 7 8 9 10\n3 2\n3 9\n2 10\n3 1\n3 10\n1 1 10\n2 10\n2 10\n3 1\n3 10\n3 9"]
1 second
["2\n9\n11\n20\n30\n40\n39"]
null
Java 7
standard input
[ "implementation" ]
48f3ff32a11770f3b168d6e15c0df813
The first line contains integers n, m (1 ≀ n, m ≀ 105). The second line contains n space-separated integers a1, a2, ..., an (1 ≀ ai ≀ 109) β€” the original array. Next m lines describe operations, the i-th line describes the i-th operation. The first number in the i-th line is integer ti (1 ≀ ti ≀ 3) that represents the ...
1,200
For each third type operation print value aqi. Print the values in the order, in which the corresponding queries follow in the input.
standard output
PASSED
c1cbeb060686c9496631475c46a5a823
train_000.jsonl
1370619000
Sereja has got an array, consisting of n integers, a1, a2, ..., an. Sereja is an active boy, so he is now going to complete m operations. Each operation will have one of the three forms: Make vi-th array element equal to xi. In other words, perform the assignment avi = xi. Increase each array element by yi. In other ...
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.StringTokenizer; public class B { static BufferedReader in; static StringTokenizer st; static PrintWri...
Java
["10 11\n1 2 3 4 5 6 7 8 9 10\n3 2\n3 9\n2 10\n3 1\n3 10\n1 1 10\n2 10\n2 10\n3 1\n3 10\n3 9"]
1 second
["2\n9\n11\n20\n30\n40\n39"]
null
Java 7
standard input
[ "implementation" ]
48f3ff32a11770f3b168d6e15c0df813
The first line contains integers n, m (1 ≀ n, m ≀ 105). The second line contains n space-separated integers a1, a2, ..., an (1 ≀ ai ≀ 109) β€” the original array. Next m lines describe operations, the i-th line describes the i-th operation. The first number in the i-th line is integer ti (1 ≀ ti ≀ 3) that represents the ...
1,200
For each third type operation print value aqi. Print the values in the order, in which the corresponding queries follow in the input.
standard output
PASSED
3edb8cf732b493ee8c510bedce83fe29
train_000.jsonl
1370619000
Sereja has got an array, consisting of n integers, a1, a2, ..., an. Sereja is an active boy, so he is now going to complete m operations. Each operation will have one of the three forms: Make vi-th array element equal to xi. In other words, perform the assignment avi = xi. Increase each array element by yi. In other ...
256 megabytes
import java.util.*; import java.io.*; import java.math.*; public class Main{ public static void main(String... args)throws IOException{ BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); String[] temp = br.readLine().split(" "); int n = Integer.parseInt(temp[0]); int m = Integer.parseInt(temp[1])...
Java
["10 11\n1 2 3 4 5 6 7 8 9 10\n3 2\n3 9\n2 10\n3 1\n3 10\n1 1 10\n2 10\n2 10\n3 1\n3 10\n3 9"]
1 second
["2\n9\n11\n20\n30\n40\n39"]
null
Java 7
standard input
[ "implementation" ]
48f3ff32a11770f3b168d6e15c0df813
The first line contains integers n, m (1 ≀ n, m ≀ 105). The second line contains n space-separated integers a1, a2, ..., an (1 ≀ ai ≀ 109) β€” the original array. Next m lines describe operations, the i-th line describes the i-th operation. The first number in the i-th line is integer ti (1 ≀ ti ≀ 3) that represents the ...
1,200
For each third type operation print value aqi. Print the values in the order, in which the corresponding queries follow in the input.
standard output
PASSED
d3edb18162fecc4d64d1015dbaa08067
train_000.jsonl
1370619000
Sereja has got an array, consisting of n integers, a1, a2, ..., an. Sereja is an active boy, so he is now going to complete m operations. Each operation will have one of the three forms: Make vi-th array element equal to xi. In other words, perform the assignment avi = xi. Increase each array element by yi. In other ...
256 megabytes
import java.io.BufferedReader; import java.io.FileInputStream; import java.io.IOException; import java.io.InputStream; import java.io.InputStreamReader; import java.io.PrintStream; import java.util.ArrayList; import java.util.Arrays; import java.util.Collections; import java.util.Scanner; import java.util.StringTokeniz...
Java
["10 11\n1 2 3 4 5 6 7 8 9 10\n3 2\n3 9\n2 10\n3 1\n3 10\n1 1 10\n2 10\n2 10\n3 1\n3 10\n3 9"]
1 second
["2\n9\n11\n20\n30\n40\n39"]
null
Java 7
standard input
[ "implementation" ]
48f3ff32a11770f3b168d6e15c0df813
The first line contains integers n, m (1 ≀ n, m ≀ 105). The second line contains n space-separated integers a1, a2, ..., an (1 ≀ ai ≀ 109) β€” the original array. Next m lines describe operations, the i-th line describes the i-th operation. The first number in the i-th line is integer ti (1 ≀ ti ≀ 3) that represents the ...
1,200
For each third type operation print value aqi. Print the values in the order, in which the corresponding queries follow in the input.
standard output
PASSED
ead9220f8a2bebc0342e149d16ff2457
train_000.jsonl
1370619000
Sereja has got an array, consisting of n integers, a1, a2, ..., an. Sereja is an active boy, so he is now going to complete m operations. Each operation will have one of the three forms: Make vi-th array element equal to xi. In other words, perform the assignment avi = xi. Increase each array element by yi. In other ...
256 megabytes
import java.io.BufferedReader; import java.io.InputStreamReader; import java.io.PrintWriter; import java.util.Arrays; import java.util.HashSet; import java.util.Set; import java.util.StringTokenizer; public class CR187TaskB implements Runnable { private BufferedReader reader; private PrintWriter writer; pr...
Java
["10 11\n1 2 3 4 5 6 7 8 9 10\n3 2\n3 9\n2 10\n3 1\n3 10\n1 1 10\n2 10\n2 10\n3 1\n3 10\n3 9"]
1 second
["2\n9\n11\n20\n30\n40\n39"]
null
Java 7
standard input
[ "implementation" ]
48f3ff32a11770f3b168d6e15c0df813
The first line contains integers n, m (1 ≀ n, m ≀ 105). The second line contains n space-separated integers a1, a2, ..., an (1 ≀ ai ≀ 109) β€” the original array. Next m lines describe operations, the i-th line describes the i-th operation. The first number in the i-th line is integer ti (1 ≀ ti ≀ 3) that represents the ...
1,200
For each third type operation print value aqi. Print the values in the order, in which the corresponding queries follow in the input.
standard output
PASSED
fabb8d7a6acf43b3e501f473baf6c955
train_000.jsonl
1370619000
Sereja has got an array, consisting of n integers, a1, a2, ..., an. Sereja is an active boy, so he is now going to complete m operations. Each operation will have one of the three forms: Make vi-th array element equal to xi. In other words, perform the assignment avi = xi. Increase each array element by yi. In other ...
256 megabytes
import java.io.*; import java.util.*; public class SerejaAndArray{ public static void main(String[] Args)throws Exception{ FastScanner sc = new FastScanner(System.in); int n = sc.nextInt(); int q = sc.nextInt(); long sum = 0; long[] vals = new long[n]; for(int k =0;k<n;k++){ ...
Java
["10 11\n1 2 3 4 5 6 7 8 9 10\n3 2\n3 9\n2 10\n3 1\n3 10\n1 1 10\n2 10\n2 10\n3 1\n3 10\n3 9"]
1 second
["2\n9\n11\n20\n30\n40\n39"]
null
Java 7
standard input
[ "implementation" ]
48f3ff32a11770f3b168d6e15c0df813
The first line contains integers n, m (1 ≀ n, m ≀ 105). The second line contains n space-separated integers a1, a2, ..., an (1 ≀ ai ≀ 109) β€” the original array. Next m lines describe operations, the i-th line describes the i-th operation. The first number in the i-th line is integer ti (1 ≀ ti ≀ 3) that represents the ...
1,200
For each third type operation print value aqi. Print the values in the order, in which the corresponding queries follow in the input.
standard output
PASSED
5bba2fdd05d404d64e7e0cab403c4fa4
train_000.jsonl
1370619000
Sereja has got an array, consisting of n integers, a1, a2, ..., an. Sereja is an active boy, so he is now going to complete m operations. Each operation will have one of the three forms: Make vi-th array element equal to xi. In other words, perform the assignment avi = xi. Increase each array element by yi. In other ...
256 megabytes
import java.io.BufferedReader; import java.io.InputStreamReader; import java.io.IOException; import java.util.StringTokenizer; public class SerejaAndArray { public static void main(String[] args) { MyScanner sc = new MyScanner(); int N = sc.nextInt(); int M = sc.nextInt(); ...
Java
["10 11\n1 2 3 4 5 6 7 8 9 10\n3 2\n3 9\n2 10\n3 1\n3 10\n1 1 10\n2 10\n2 10\n3 1\n3 10\n3 9"]
1 second
["2\n9\n11\n20\n30\n40\n39"]
null
Java 7
standard input
[ "implementation" ]
48f3ff32a11770f3b168d6e15c0df813
The first line contains integers n, m (1 ≀ n, m ≀ 105). The second line contains n space-separated integers a1, a2, ..., an (1 ≀ ai ≀ 109) β€” the original array. Next m lines describe operations, the i-th line describes the i-th operation. The first number in the i-th line is integer ti (1 ≀ ti ≀ 3) that represents the ...
1,200
For each third type operation print value aqi. Print the values in the order, in which the corresponding queries follow in the input.
standard output
PASSED
1ee27cd11e7e05bc914f839442b6d546
train_000.jsonl
1370619000
Sereja has got an array, consisting of n integers, a1, a2, ..., an. Sereja is an active boy, so he is now going to complete m operations. Each operation will have one of the three forms: Make vi-th array element equal to xi. In other words, perform the assignment avi = xi. Increase each array element by yi. In other ...
256 megabytes
import java.io.*; import java.util.Arrays; public class Main { public static void main(String[] args) throws Exception { BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); StringBuilder out = new StringBuilder(); String [] sp = br.readLine().split(" "); int ...
Java
["10 11\n1 2 3 4 5 6 7 8 9 10\n3 2\n3 9\n2 10\n3 1\n3 10\n1 1 10\n2 10\n2 10\n3 1\n3 10\n3 9"]
1 second
["2\n9\n11\n20\n30\n40\n39"]
null
Java 7
standard input
[ "implementation" ]
48f3ff32a11770f3b168d6e15c0df813
The first line contains integers n, m (1 ≀ n, m ≀ 105). The second line contains n space-separated integers a1, a2, ..., an (1 ≀ ai ≀ 109) β€” the original array. Next m lines describe operations, the i-th line describes the i-th operation. The first number in the i-th line is integer ti (1 ≀ ti ≀ 3) that represents the ...
1,200
For each third type operation print value aqi. Print the values in the order, in which the corresponding queries follow in the input.
standard output
PASSED
3d649bb250e61a1062821bca42df1b79
train_000.jsonl
1370619000
Sereja has got an array, consisting of n integers, a1, a2, ..., an. Sereja is an active boy, so he is now going to complete m operations. Each operation will have one of the three forms: Make vi-th array element equal to xi. In other words, perform the assignment avi = xi. Increase each array element by yi. In other ...
256 megabytes
import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; import java.util.StringTokenizer; public class SerejaAndArray { public static void main(String... args) throws IOException{ MyScanner sc = new MyScanner(); int n = sc.nextInt(); int m = s...
Java
["10 11\n1 2 3 4 5 6 7 8 9 10\n3 2\n3 9\n2 10\n3 1\n3 10\n1 1 10\n2 10\n2 10\n3 1\n3 10\n3 9"]
1 second
["2\n9\n11\n20\n30\n40\n39"]
null
Java 7
standard input
[ "implementation" ]
48f3ff32a11770f3b168d6e15c0df813
The first line contains integers n, m (1 ≀ n, m ≀ 105). The second line contains n space-separated integers a1, a2, ..., an (1 ≀ ai ≀ 109) β€” the original array. Next m lines describe operations, the i-th line describes the i-th operation. The first number in the i-th line is integer ti (1 ≀ ti ≀ 3) that represents the ...
1,200
For each third type operation print value aqi. Print the values in the order, in which the corresponding queries follow in the input.
standard output
PASSED
23a14285ef566447e75ac7f23a979680
train_000.jsonl
1370619000
Sereja has got an array, consisting of n integers, a1, a2, ..., an. Sereja is an active boy, so he is now going to complete m operations. Each operation will have one of the three forms: Make vi-th array element equal to xi. In other words, perform the assignment avi = xi. Increase each array element by yi. In other ...
256 megabytes
import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; import java.util.StringTokenizer; public class SerejaAndArray { public static void main(String... args) throws IOException{ MyScanner sc = new MyScanner(); int n = sc.nextInt(); int m = s...
Java
["10 11\n1 2 3 4 5 6 7 8 9 10\n3 2\n3 9\n2 10\n3 1\n3 10\n1 1 10\n2 10\n2 10\n3 1\n3 10\n3 9"]
1 second
["2\n9\n11\n20\n30\n40\n39"]
null
Java 7
standard input
[ "implementation" ]
48f3ff32a11770f3b168d6e15c0df813
The first line contains integers n, m (1 ≀ n, m ≀ 105). The second line contains n space-separated integers a1, a2, ..., an (1 ≀ ai ≀ 109) β€” the original array. Next m lines describe operations, the i-th line describes the i-th operation. The first number in the i-th line is integer ti (1 ≀ ti ≀ 3) that represents the ...
1,200
For each third type operation print value aqi. Print the values in the order, in which the corresponding queries follow in the input.
standard output
PASSED
f90f48a47c82c27144361c43267474e6
train_000.jsonl
1370619000
Sereja has got an array, consisting of n integers, a1, a2, ..., an. Sereja is an active boy, so he is now going to complete m operations. Each operation will have one of the three forms: Make vi-th array element equal to xi. In other words, perform the assignment avi = xi. Increase each array element by yi. In other ...
256 megabytes
import java.util.*; import java.io.*; import java.awt.Point; import java.math.BigDecimal; import java.math.BigInteger; import static java.lang.Math.*; // Solution is at the bottom of code public class B implements Runnable{ final boolean ONLINE_JUDGE = System.getProperty("ONLINE_JUDGE") != null; BufferedReader...
Java
["10 11\n1 2 3 4 5 6 7 8 9 10\n3 2\n3 9\n2 10\n3 1\n3 10\n1 1 10\n2 10\n2 10\n3 1\n3 10\n3 9"]
1 second
["2\n9\n11\n20\n30\n40\n39"]
null
Java 7
standard input
[ "implementation" ]
48f3ff32a11770f3b168d6e15c0df813
The first line contains integers n, m (1 ≀ n, m ≀ 105). The second line contains n space-separated integers a1, a2, ..., an (1 ≀ ai ≀ 109) β€” the original array. Next m lines describe operations, the i-th line describes the i-th operation. The first number in the i-th line is integer ti (1 ≀ ti ≀ 3) that represents the ...
1,200
For each third type operation print value aqi. Print the values in the order, in which the corresponding queries follow in the input.
standard output
PASSED
48458f373f4c66e96c3752b4fac8cac5
train_000.jsonl
1284735600
There are n students living in the campus. Every morning all students wake up at the same time and go to wash. There are m rooms with wash basins. The i-th of these rooms contains ai wash basins. Every student independently select one the rooms with equal probability and goes to it. After all students selected their ro...
256 megabytes
import java.io.BufferedReader; import java.io.FileNotFoundException; import java.io.FileReader; import java.io.IOException; import java.io.InputStreamReader; import java.io.PrintWriter; import java.util.Arrays; import java.util.StringTokenizer; public class Solve8 { public static void main(String[] args) throws I...
Java
["1 1\n2", "2 2\n1 1", "2 3\n1 1 1", "7 5\n1 1 2 3 1"]
2 seconds
["1.00000000000000000000", "1.50000000000000000000", "1.33333333333333350000", "2.50216960000000070000"]
null
Java 11
standard input
[ "dp", "combinatorics", "probabilities" ]
c2b3b577c2bcb3a2a8cb48700c637270
The first line contains two positive integers n and m (1 ≀ n, m ≀ 50) β€” the amount of students and the amount of rooms. The second line contains m integers a1, a2, ... , am (1 ≀ ai ≀ 50). ai means the amount of wash basins in the i-th room.
2,200
Output single number: the expected value of the size of the largest queue. Your answer must have an absolute or relative error less than 10 - 9.
standard output
PASSED
a8313cf6e9bdac5250c2093bff13e0a4
train_000.jsonl
1384102800
Levko loves tables that consist of n rows and n columns very much. He especially loves beautiful tables. A table is beautiful to Levko if the sum of elements in each row and column of the table equals k.Unfortunately, he doesn't know any such table. Your task is to help him to find at least one of them.
256 megabytes
import java.util.*; import java.lang.*; import java.io.*; 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 Exception { // your code goes here Scanner sc = new Scanner(System.in); int...
Java
["2 4", "4 7"]
1 second
["1 3\n3 1", "2 1 0 4\n4 0 2 1\n1 3 3 0\n0 3 2 2"]
NoteIn the first sample the sum in the first row is 1 + 3 = 4, in the second row β€” 3 + 1 = 4, in the first column β€” 1 + 3 = 4 and in the second column β€” 3 + 1 = 4. There are other beautiful tables for this sample.In the second sample the sum of elements in each row and each column equals 7. Besides, there are other tab...
Java 8
standard input
[ "constructive algorithms", "implementation" ]
e80088bee9c0df6adf280f8ffbeaa4a9
The single line contains two integers, n and k (1 ≀ n ≀ 100, 1 ≀ k ≀ 1000).
800
Print any beautiful table. Levko doesn't like too big numbers, so all elements of the table mustn't exceed 1000 in their absolute value. If there are multiple suitable tables, you are allowed to print any of them.
standard output
PASSED
08f5a9735083b2c6562fffe15a879a25
train_000.jsonl
1384102800
Levko loves tables that consist of n rows and n columns very much. He especially loves beautiful tables. A table is beautiful to Levko if the sum of elements in each row and column of the table equals k.Unfortunately, he doesn't know any such table. Your task is to help him to find at least one of them.
256 megabytes
import java.io.*; import java.util.*; public class practice361a { public static void main(String[] args) throws Exception { // BufferedReader f = new BufferedReader(new FileReader (new File("sample.txt"))); // PrintWriter out = new PrintWriter(new BufferedWriter(new FileWriter("sample.txt"))); // StringToken...
Java
["2 4", "4 7"]
1 second
["1 3\n3 1", "2 1 0 4\n4 0 2 1\n1 3 3 0\n0 3 2 2"]
NoteIn the first sample the sum in the first row is 1 + 3 = 4, in the second row β€” 3 + 1 = 4, in the first column β€” 1 + 3 = 4 and in the second column β€” 3 + 1 = 4. There are other beautiful tables for this sample.In the second sample the sum of elements in each row and each column equals 7. Besides, there are other tab...
Java 8
standard input
[ "constructive algorithms", "implementation" ]
e80088bee9c0df6adf280f8ffbeaa4a9
The single line contains two integers, n and k (1 ≀ n ≀ 100, 1 ≀ k ≀ 1000).
800
Print any beautiful table. Levko doesn't like too big numbers, so all elements of the table mustn't exceed 1000 in their absolute value. If there are multiple suitable tables, you are allowed to print any of them.
standard output
PASSED
b770035b105e48827eac8dc859acc033
train_000.jsonl
1384102800
Levko loves tables that consist of n rows and n columns very much. He especially loves beautiful tables. A table is beautiful to Levko if the sum of elements in each row and column of the table equals k.Unfortunately, he doesn't know any such table. Your task is to help him to find at least one of them.
256 megabytes
import java.util.*; public class Main { public static void main(String[] args) { Scanner in = new Scanner(System.in); int n=in.nextInt(); int k=in.nextInt(); int arr[][]=new int[n][n]; ; for(int i=0;i<n;i++) { for(int j=0;j<n;j++) { if(i==j) ar...
Java
["2 4", "4 7"]
1 second
["1 3\n3 1", "2 1 0 4\n4 0 2 1\n1 3 3 0\n0 3 2 2"]
NoteIn the first sample the sum in the first row is 1 + 3 = 4, in the second row β€” 3 + 1 = 4, in the first column β€” 1 + 3 = 4 and in the second column β€” 3 + 1 = 4. There are other beautiful tables for this sample.In the second sample the sum of elements in each row and each column equals 7. Besides, there are other tab...
Java 8
standard input
[ "constructive algorithms", "implementation" ]
e80088bee9c0df6adf280f8ffbeaa4a9
The single line contains two integers, n and k (1 ≀ n ≀ 100, 1 ≀ k ≀ 1000).
800
Print any beautiful table. Levko doesn't like too big numbers, so all elements of the table mustn't exceed 1000 in their absolute value. If there are multiple suitable tables, you are allowed to print any of them.
standard output
PASSED
e13e65a4e42cf66a6b36dc8afb2b385e
train_000.jsonl
1384102800
Levko loves tables that consist of n rows and n columns very much. He especially loves beautiful tables. A table is beautiful to Levko if the sum of elements in each row and column of the table equals k.Unfortunately, he doesn't know any such table. Your task is to help him to find at least one of them.
256 megabytes
import java.util.Scanner; public class oci2 { /** * @param args */ public static void main(String[] args) { // TODO Auto-generated method stub Scanner sc = new Scanner(System.in); int n = sc.nextInt(); int k = sc.nextInt(); int[][] lista = new int[n][n]; for(int i = 0;i < n;i++){ for(int j = 0;j <...
Java
["2 4", "4 7"]
1 second
["1 3\n3 1", "2 1 0 4\n4 0 2 1\n1 3 3 0\n0 3 2 2"]
NoteIn the first sample the sum in the first row is 1 + 3 = 4, in the second row β€” 3 + 1 = 4, in the first column β€” 1 + 3 = 4 and in the second column β€” 3 + 1 = 4. There are other beautiful tables for this sample.In the second sample the sum of elements in each row and each column equals 7. Besides, there are other tab...
Java 8
standard input
[ "constructive algorithms", "implementation" ]
e80088bee9c0df6adf280f8ffbeaa4a9
The single line contains two integers, n and k (1 ≀ n ≀ 100, 1 ≀ k ≀ 1000).
800
Print any beautiful table. Levko doesn't like too big numbers, so all elements of the table mustn't exceed 1000 in their absolute value. If there are multiple suitable tables, you are allowed to print any of them.
standard output
PASSED
1da05da89bb12603339d7927a27b16d4
train_000.jsonl
1384102800
Levko loves tables that consist of n rows and n columns very much. He especially loves beautiful tables. A table is beautiful to Levko if the sum of elements in each row and column of the table equals k.Unfortunately, he doesn't know any such table. Your task is to help him to find at least one of them.
256 megabytes
import org.w3c.dom.css.CSSUnknownRule; import java.lang.reflect.Array; import java.util.*; public class geek { public static void main(String[] args) { Scanner s = new Scanner(System.in); int n=s.nextInt(); int k=s.nextInt(); StringBuffer sb=new StringBuffer(); for(int i=0;i<n;...
Java
["2 4", "4 7"]
1 second
["1 3\n3 1", "2 1 0 4\n4 0 2 1\n1 3 3 0\n0 3 2 2"]
NoteIn the first sample the sum in the first row is 1 + 3 = 4, in the second row β€” 3 + 1 = 4, in the first column β€” 1 + 3 = 4 and in the second column β€” 3 + 1 = 4. There are other beautiful tables for this sample.In the second sample the sum of elements in each row and each column equals 7. Besides, there are other tab...
Java 8
standard input
[ "constructive algorithms", "implementation" ]
e80088bee9c0df6adf280f8ffbeaa4a9
The single line contains two integers, n and k (1 ≀ n ≀ 100, 1 ≀ k ≀ 1000).
800
Print any beautiful table. Levko doesn't like too big numbers, so all elements of the table mustn't exceed 1000 in their absolute value. If there are multiple suitable tables, you are allowed to print any of them.
standard output
PASSED
c02dbf3807920b89603f8ccaf078b3a9
train_000.jsonl
1384102800
Levko loves tables that consist of n rows and n columns very much. He especially loves beautiful tables. A table is beautiful to Levko if the sum of elements in each row and column of the table equals k.Unfortunately, he doesn't know any such table. Your task is to help him to find at least one of them.
256 megabytes
import java.util.Scanner; public class jeje { /** * @param args */ public static void main(String[] args) { // TODO Auto-generated method stub Scanner scan = new Scanner(System.in); int n = scan.nextInt(); int k = scan.nextInt(); //suma int[][] table = new int[n][n]; for(int i=0; i<n; i++){ ta...
Java
["2 4", "4 7"]
1 second
["1 3\n3 1", "2 1 0 4\n4 0 2 1\n1 3 3 0\n0 3 2 2"]
NoteIn the first sample the sum in the first row is 1 + 3 = 4, in the second row β€” 3 + 1 = 4, in the first column β€” 1 + 3 = 4 and in the second column β€” 3 + 1 = 4. There are other beautiful tables for this sample.In the second sample the sum of elements in each row and each column equals 7. Besides, there are other tab...
Java 8
standard input
[ "constructive algorithms", "implementation" ]
e80088bee9c0df6adf280f8ffbeaa4a9
The single line contains two integers, n and k (1 ≀ n ≀ 100, 1 ≀ k ≀ 1000).
800
Print any beautiful table. Levko doesn't like too big numbers, so all elements of the table mustn't exceed 1000 in their absolute value. If there are multiple suitable tables, you are allowed to print any of them.
standard output
PASSED
e736de24ba97a326ab0f8353e02fa7f7
train_000.jsonl
1384102800
Levko loves tables that consist of n rows and n columns very much. He especially loves beautiful tables. A table is beautiful to Levko if the sum of elements in each row and column of the table equals k.Unfortunately, he doesn't know any such table. Your task is to help him to find at least one of them.
256 megabytes
import java.util.Scanner; /** * * @author Krolos */ public class ALevkoAndTable { /** * @param args the command line arguments */ public static void main(String[] args) { Scanner k=new Scanner(System.in); int x=k.nextInt(); int y=k.nextInt(); int arr[][]=new int[x][...
Java
["2 4", "4 7"]
1 second
["1 3\n3 1", "2 1 0 4\n4 0 2 1\n1 3 3 0\n0 3 2 2"]
NoteIn the first sample the sum in the first row is 1 + 3 = 4, in the second row β€” 3 + 1 = 4, in the first column β€” 1 + 3 = 4 and in the second column β€” 3 + 1 = 4. There are other beautiful tables for this sample.In the second sample the sum of elements in each row and each column equals 7. Besides, there are other tab...
Java 8
standard input
[ "constructive algorithms", "implementation" ]
e80088bee9c0df6adf280f8ffbeaa4a9
The single line contains two integers, n and k (1 ≀ n ≀ 100, 1 ≀ k ≀ 1000).
800
Print any beautiful table. Levko doesn't like too big numbers, so all elements of the table mustn't exceed 1000 in their absolute value. If there are multiple suitable tables, you are allowed to print any of them.
standard output
PASSED
3d746115321854339a242b2bc8c312ca
train_000.jsonl
1384102800
Levko loves tables that consist of n rows and n columns very much. He especially loves beautiful tables. A table is beautiful to Levko if the sum of elements in each row and column of the table equals k.Unfortunately, he doesn't know any such table. Your task is to help him to find at least one of them.
256 megabytes
import java.io.PrintWriter; import java.util.Scanner; public class LevkoAndTable { static Scanner in = new Scanner(System.in); static PrintWriter out = new PrintWriter(System.out); public static void main (String args[]){ int n = in.nextInt() , k = in.nextInt(); for (int i = 0; i < n; i++) ...
Java
["2 4", "4 7"]
1 second
["1 3\n3 1", "2 1 0 4\n4 0 2 1\n1 3 3 0\n0 3 2 2"]
NoteIn the first sample the sum in the first row is 1 + 3 = 4, in the second row β€” 3 + 1 = 4, in the first column β€” 1 + 3 = 4 and in the second column β€” 3 + 1 = 4. There are other beautiful tables for this sample.In the second sample the sum of elements in each row and each column equals 7. Besides, there are other tab...
Java 8
standard input
[ "constructive algorithms", "implementation" ]
e80088bee9c0df6adf280f8ffbeaa4a9
The single line contains two integers, n and k (1 ≀ n ≀ 100, 1 ≀ k ≀ 1000).
800
Print any beautiful table. Levko doesn't like too big numbers, so all elements of the table mustn't exceed 1000 in their absolute value. If there are multiple suitable tables, you are allowed to print any of them.
standard output
PASSED
5c9216a1ec4a155e2b7e6e9373cf7c61
train_000.jsonl
1384102800
Levko loves tables that consist of n rows and n columns very much. He especially loves beautiful tables. A table is beautiful to Levko if the sum of elements in each row and column of the table equals k.Unfortunately, he doesn't know any such table. Your task is to help him to find at least one of them.
256 megabytes
import java.io.OutputStream; import java.io.IOException; import java.io.InputStream; import java.io.PrintWriter; import java.io.BufferedWriter; import java.io.Writer; import java.io.OutputStreamWriter; import java.util.InputMismatchException; /** * Built using CHelper plug-in * Actual solution is at the top * * ...
Java
["2 4", "4 7"]
1 second
["1 3\n3 1", "2 1 0 4\n4 0 2 1\n1 3 3 0\n0 3 2 2"]
NoteIn the first sample the sum in the first row is 1 + 3 = 4, in the second row β€” 3 + 1 = 4, in the first column β€” 1 + 3 = 4 and in the second column β€” 3 + 1 = 4. There are other beautiful tables for this sample.In the second sample the sum of elements in each row and each column equals 7. Besides, there are other tab...
Java 8
standard input
[ "constructive algorithms", "implementation" ]
e80088bee9c0df6adf280f8ffbeaa4a9
The single line contains two integers, n and k (1 ≀ n ≀ 100, 1 ≀ k ≀ 1000).
800
Print any beautiful table. Levko doesn't like too big numbers, so all elements of the table mustn't exceed 1000 in their absolute value. If there are multiple suitable tables, you are allowed to print any of them.
standard output
PASSED
b621a3000d177cf8b48090b74d52ce59
train_000.jsonl
1384102800
Levko loves tables that consist of n rows and n columns very much. He especially loves beautiful tables. A table is beautiful to Levko if the sum of elements in each row and column of the table equals k.Unfortunately, he doesn't know any such table. Your task is to help him to find at least one of them.
256 megabytes
import java.util.HashMap; import java.util.Scanner; public class football { public static void main(String[] args) { // TODO Auto-generated method stub Scanner scn = new Scanner(System.in); int n = scn.nextInt(); int k = scn.nextInt(); int[][] mat = new int[n][n]; for (int i = 0; i < n; i++) { for (...
Java
["2 4", "4 7"]
1 second
["1 3\n3 1", "2 1 0 4\n4 0 2 1\n1 3 3 0\n0 3 2 2"]
NoteIn the first sample the sum in the first row is 1 + 3 = 4, in the second row β€” 3 + 1 = 4, in the first column β€” 1 + 3 = 4 and in the second column β€” 3 + 1 = 4. There are other beautiful tables for this sample.In the second sample the sum of elements in each row and each column equals 7. Besides, there are other tab...
Java 8
standard input
[ "constructive algorithms", "implementation" ]
e80088bee9c0df6adf280f8ffbeaa4a9
The single line contains two integers, n and k (1 ≀ n ≀ 100, 1 ≀ k ≀ 1000).
800
Print any beautiful table. Levko doesn't like too big numbers, so all elements of the table mustn't exceed 1000 in their absolute value. If there are multiple suitable tables, you are allowed to print any of them.
standard output
PASSED
980c81ca34914879f73c80116c3197d7
train_000.jsonl
1384102800
Levko loves tables that consist of n rows and n columns very much. He especially loves beautiful tables. A table is beautiful to Levko if the sum of elements in each row and column of the table equals k.Unfortunately, he doesn't know any such table. Your task is to help him to find at least one of them.
256 megabytes
import java.io.IOException; import java.util.Scanner; public class Main{ public static Scanner input = new Scanner(System.in); public static void main(String[] args) throws IOException { // BufferedReader buffer=new BufferedReader(new InputStreamReader(System.in)); // Strin...
Java
["2 4", "4 7"]
1 second
["1 3\n3 1", "2 1 0 4\n4 0 2 1\n1 3 3 0\n0 3 2 2"]
NoteIn the first sample the sum in the first row is 1 + 3 = 4, in the second row β€” 3 + 1 = 4, in the first column β€” 1 + 3 = 4 and in the second column β€” 3 + 1 = 4. There are other beautiful tables for this sample.In the second sample the sum of elements in each row and each column equals 7. Besides, there are other tab...
Java 8
standard input
[ "constructive algorithms", "implementation" ]
e80088bee9c0df6adf280f8ffbeaa4a9
The single line contains two integers, n and k (1 ≀ n ≀ 100, 1 ≀ k ≀ 1000).
800
Print any beautiful table. Levko doesn't like too big numbers, so all elements of the table mustn't exceed 1000 in their absolute value. If there are multiple suitable tables, you are allowed to print any of them.
standard output
PASSED
e7825f56757d0d3e5192767bd394b063
train_000.jsonl
1384102800
Levko loves tables that consist of n rows and n columns very much. He especially loves beautiful tables. A table is beautiful to Levko if the sum of elements in each row and column of the table equals k.Unfortunately, he doesn't know any such table. Your task is to help him to find at least one of them.
256 megabytes
import java.util.Scanner; public class Solution { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int n = sc.nextInt(), k = sc.nextInt(); for (int i = 0; i < n; i++) { for (int j = 0; j < n; j++) { if (i == j) { System.out.print(k + " "); } else { System.out...
Java
["2 4", "4 7"]
1 second
["1 3\n3 1", "2 1 0 4\n4 0 2 1\n1 3 3 0\n0 3 2 2"]
NoteIn the first sample the sum in the first row is 1 + 3 = 4, in the second row β€” 3 + 1 = 4, in the first column β€” 1 + 3 = 4 and in the second column β€” 3 + 1 = 4. There are other beautiful tables for this sample.In the second sample the sum of elements in each row and each column equals 7. Besides, there are other tab...
Java 8
standard input
[ "constructive algorithms", "implementation" ]
e80088bee9c0df6adf280f8ffbeaa4a9
The single line contains two integers, n and k (1 ≀ n ≀ 100, 1 ≀ k ≀ 1000).
800
Print any beautiful table. Levko doesn't like too big numbers, so all elements of the table mustn't exceed 1000 in their absolute value. If there are multiple suitable tables, you are allowed to print any of them.
standard output
PASSED
c3f99f98f2f5c698ba916d9c9e3f6c55
train_000.jsonl
1384102800
Levko loves tables that consist of n rows and n columns very much. He especially loves beautiful tables. A table is beautiful to Levko if the sum of elements in each row and column of the table equals k.Unfortunately, he doesn't know any such table. Your task is to help him to find at least one of them.
256 megabytes
import java.util.*;import java.io.*;import java.math.*; public class Main { public static void process()throws IOException { int n=ni(); int k=ni(); int[][]A=new int[n][n]; for(int i=0;i<n;i++) for(int j=0;j<n;j++) A[i][j]=k/n; for(int i=0;i<n;...
Java
["2 4", "4 7"]
1 second
["1 3\n3 1", "2 1 0 4\n4 0 2 1\n1 3 3 0\n0 3 2 2"]
NoteIn the first sample the sum in the first row is 1 + 3 = 4, in the second row β€” 3 + 1 = 4, in the first column β€” 1 + 3 = 4 and in the second column β€” 3 + 1 = 4. There are other beautiful tables for this sample.In the second sample the sum of elements in each row and each column equals 7. Besides, there are other tab...
Java 8
standard input
[ "constructive algorithms", "implementation" ]
e80088bee9c0df6adf280f8ffbeaa4a9
The single line contains two integers, n and k (1 ≀ n ≀ 100, 1 ≀ k ≀ 1000).
800
Print any beautiful table. Levko doesn't like too big numbers, so all elements of the table mustn't exceed 1000 in their absolute value. If there are multiple suitable tables, you are allowed to print any of them.
standard output
PASSED
c5c9c188f2e73354561eddcb9ad1fc47
train_000.jsonl
1384102800
Levko loves tables that consist of n rows and n columns very much. He especially loves beautiful tables. A table is beautiful to Levko if the sum of elements in each row and column of the table equals k.Unfortunately, he doesn't know any such table. Your task is to help him to find at least one of them.
256 megabytes
import java.util.Arrays; import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner sc=new Scanner(System.in); int n=sc.nextInt(); int k=sc.nextInt(); int[] a=new int[n]; int[] b=new int[n]; a[0]=k; for(int i=0;i<n;i...
Java
["2 4", "4 7"]
1 second
["1 3\n3 1", "2 1 0 4\n4 0 2 1\n1 3 3 0\n0 3 2 2"]
NoteIn the first sample the sum in the first row is 1 + 3 = 4, in the second row β€” 3 + 1 = 4, in the first column β€” 1 + 3 = 4 and in the second column β€” 3 + 1 = 4. There are other beautiful tables for this sample.In the second sample the sum of elements in each row and each column equals 7. Besides, there are other tab...
Java 8
standard input
[ "constructive algorithms", "implementation" ]
e80088bee9c0df6adf280f8ffbeaa4a9
The single line contains two integers, n and k (1 ≀ n ≀ 100, 1 ≀ k ≀ 1000).
800
Print any beautiful table. Levko doesn't like too big numbers, so all elements of the table mustn't exceed 1000 in their absolute value. If there are multiple suitable tables, you are allowed to print any of them.
standard output
PASSED
9ca8987dffee885b28e1b7fdb760051e
train_000.jsonl
1384102800
Levko loves tables that consist of n rows and n columns very much. He especially loves beautiful tables. A table is beautiful to Levko if the sum of elements in each row and column of the table equals k.Unfortunately, he doesn't know any such table. Your task is to help him to find at least one of them.
256 megabytes
/* @Rohan Basic Template key->brahmastra */ import java.io.*; import java.util.*; import java.math.*; import java.lang.*; import java.lang.Math.*; public class Main { public static void main(String[] args) { InputStream inputStream = System.in; OutputStream outputStream = System.out; ...
Java
["2 4", "4 7"]
1 second
["1 3\n3 1", "2 1 0 4\n4 0 2 1\n1 3 3 0\n0 3 2 2"]
NoteIn the first sample the sum in the first row is 1 + 3 = 4, in the second row β€” 3 + 1 = 4, in the first column β€” 1 + 3 = 4 and in the second column β€” 3 + 1 = 4. There are other beautiful tables for this sample.In the second sample the sum of elements in each row and each column equals 7. Besides, there are other tab...
Java 8
standard input
[ "constructive algorithms", "implementation" ]
e80088bee9c0df6adf280f8ffbeaa4a9
The single line contains two integers, n and k (1 ≀ n ≀ 100, 1 ≀ k ≀ 1000).
800
Print any beautiful table. Levko doesn't like too big numbers, so all elements of the table mustn't exceed 1000 in their absolute value. If there are multiple suitable tables, you are allowed to print any of them.
standard output
PASSED
9be7da7f0e3bee7bf3f739401e262487
train_000.jsonl
1384102800
Levko loves tables that consist of n rows and n columns very much. He especially loves beautiful tables. A table is beautiful to Levko if the sum of elements in each row and column of the table equals k.Unfortunately, he doesn't know any such table. Your task is to help him to find at least one of them.
256 megabytes
import java.util.Scanner; public class J361A { public static void main(String[] args) { Scanner in = new Scanner(System.in); int n = in.nextInt(); int k = in.nextInt(); for (int i = 0; i < n; i++) { for (int j = 0; j < n; j++) { System.out.pri...
Java
["2 4", "4 7"]
1 second
["1 3\n3 1", "2 1 0 4\n4 0 2 1\n1 3 3 0\n0 3 2 2"]
NoteIn the first sample the sum in the first row is 1 + 3 = 4, in the second row β€” 3 + 1 = 4, in the first column β€” 1 + 3 = 4 and in the second column β€” 3 + 1 = 4. There are other beautiful tables for this sample.In the second sample the sum of elements in each row and each column equals 7. Besides, there are other tab...
Java 8
standard input
[ "constructive algorithms", "implementation" ]
e80088bee9c0df6adf280f8ffbeaa4a9
The single line contains two integers, n and k (1 ≀ n ≀ 100, 1 ≀ k ≀ 1000).
800
Print any beautiful table. Levko doesn't like too big numbers, so all elements of the table mustn't exceed 1000 in their absolute value. If there are multiple suitable tables, you are allowed to print any of them.
standard output
PASSED
6309e671f66bcced72359f2cbc8c9aa5
train_000.jsonl
1384102800
Levko loves tables that consist of n rows and n columns very much. He especially loves beautiful tables. A table is beautiful to Levko if the sum of elements in each row and column of the table equals k.Unfortunately, he doesn't know any such table. Your task is to help him to find at least one of them.
256 megabytes
import java.util.Scanner; public class J361A { public static void main(String[] args) { Scanner in = new Scanner(System.in); int n = in.nextInt(); int k = in.nextInt(); for (int i = 0; i < n; i++) { for (int j = 0; j < n; j++) { System.out.pri...
Java
["2 4", "4 7"]
1 second
["1 3\n3 1", "2 1 0 4\n4 0 2 1\n1 3 3 0\n0 3 2 2"]
NoteIn the first sample the sum in the first row is 1 + 3 = 4, in the second row β€” 3 + 1 = 4, in the first column β€” 1 + 3 = 4 and in the second column β€” 3 + 1 = 4. There are other beautiful tables for this sample.In the second sample the sum of elements in each row and each column equals 7. Besides, there are other tab...
Java 8
standard input
[ "constructive algorithms", "implementation" ]
e80088bee9c0df6adf280f8ffbeaa4a9
The single line contains two integers, n and k (1 ≀ n ≀ 100, 1 ≀ k ≀ 1000).
800
Print any beautiful table. Levko doesn't like too big numbers, so all elements of the table mustn't exceed 1000 in their absolute value. If there are multiple suitable tables, you are allowed to print any of them.
standard output
PASSED
badde2694351465133e87612a012d6f9
train_000.jsonl
1384102800
Levko loves tables that consist of n rows and n columns very much. He especially loves beautiful tables. A table is beautiful to Levko if the sum of elements in each row and column of the table equals k.Unfortunately, he doesn't know any such table. Your task is to help him to find at least one of them.
256 megabytes
import java.util.Arrays; import java.util.Scanner; public class threesixone { public static void main (String args[]) { Scanner sc = new Scanner(System.in); int n = sc.nextInt(); int k = sc.nextInt(); int table [][] = new int [n][n]; for (int i = 0; i < n; i ++) { Arrays.fill(table [i], 0); } fo...
Java
["2 4", "4 7"]
1 second
["1 3\n3 1", "2 1 0 4\n4 0 2 1\n1 3 3 0\n0 3 2 2"]
NoteIn the first sample the sum in the first row is 1 + 3 = 4, in the second row β€” 3 + 1 = 4, in the first column β€” 1 + 3 = 4 and in the second column β€” 3 + 1 = 4. There are other beautiful tables for this sample.In the second sample the sum of elements in each row and each column equals 7. Besides, there are other tab...
Java 8
standard input
[ "constructive algorithms", "implementation" ]
e80088bee9c0df6adf280f8ffbeaa4a9
The single line contains two integers, n and k (1 ≀ n ≀ 100, 1 ≀ k ≀ 1000).
800
Print any beautiful table. Levko doesn't like too big numbers, so all elements of the table mustn't exceed 1000 in their absolute value. If there are multiple suitable tables, you are allowed to print any of them.
standard output
PASSED
eac75de2d834165fbe1a4fcc78a991d4
train_000.jsonl
1384102800
Levko loves tables that consist of n rows and n columns very much. He especially loves beautiful tables. A table is beautiful to Levko if the sum of elements in each row and column of the table equals k.Unfortunately, he doesn't know any such table. Your task is to help him to find at least one of them.
256 megabytes
import java.util.Scanner; public class LevkoandTable { public static void main(String[] args) { Scanner sc=new Scanner(System.in); int n=sc.nextInt(); int k=sc.nextInt(); for(int i=0;i<n;i++) { for(int j=0;j<n;j++) { if(i==j) System.out.print(k+" "); else System.out.print("0 "); } S...
Java
["2 4", "4 7"]
1 second
["1 3\n3 1", "2 1 0 4\n4 0 2 1\n1 3 3 0\n0 3 2 2"]
NoteIn the first sample the sum in the first row is 1 + 3 = 4, in the second row β€” 3 + 1 = 4, in the first column β€” 1 + 3 = 4 and in the second column β€” 3 + 1 = 4. There are other beautiful tables for this sample.In the second sample the sum of elements in each row and each column equals 7. Besides, there are other tab...
Java 8
standard input
[ "constructive algorithms", "implementation" ]
e80088bee9c0df6adf280f8ffbeaa4a9
The single line contains two integers, n and k (1 ≀ n ≀ 100, 1 ≀ k ≀ 1000).
800
Print any beautiful table. Levko doesn't like too big numbers, so all elements of the table mustn't exceed 1000 in their absolute value. If there are multiple suitable tables, you are allowed to print any of them.
standard output
PASSED
1dbdd8cbb948576c466efc3e31c17af5
train_000.jsonl
1384102800
Levko loves tables that consist of n rows and n columns very much. He especially loves beautiful tables. A table is beautiful to Levko if the sum of elements in each row and column of the table equals k.Unfortunately, he doesn't know any such table. Your task is to help him to find at least one of them.
256 megabytes
import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; import java.io.PrintWriter; import java.util.ArrayList; import java.util.StringTokenizer; public class CF361A { public static void main(String[] args) { FastReader input = new FastReader(); PrintWriter pw =...
Java
["2 4", "4 7"]
1 second
["1 3\n3 1", "2 1 0 4\n4 0 2 1\n1 3 3 0\n0 3 2 2"]
NoteIn the first sample the sum in the first row is 1 + 3 = 4, in the second row β€” 3 + 1 = 4, in the first column β€” 1 + 3 = 4 and in the second column β€” 3 + 1 = 4. There are other beautiful tables for this sample.In the second sample the sum of elements in each row and each column equals 7. Besides, there are other tab...
Java 8
standard input
[ "constructive algorithms", "implementation" ]
e80088bee9c0df6adf280f8ffbeaa4a9
The single line contains two integers, n and k (1 ≀ n ≀ 100, 1 ≀ k ≀ 1000).
800
Print any beautiful table. Levko doesn't like too big numbers, so all elements of the table mustn't exceed 1000 in their absolute value. If there are multiple suitable tables, you are allowed to print any of them.
standard output
PASSED
51fb6983f9238d199941546bdf7ee7f1
train_000.jsonl
1384102800
Levko loves tables that consist of n rows and n columns very much. He especially loves beautiful tables. A table is beautiful to Levko if the sum of elements in each row and column of the table equals k.Unfortunately, he doesn't know any such table. Your task is to help him to find at least one of them.
256 megabytes
import java.util.*; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int n=sc.nextInt(); int k =sc.nextInt(); for (int i = 0; i <n ; i++) { for (int j = 0; j <n ; j++) { System.out.print(i==j?k+ " ":0+" ");...
Java
["2 4", "4 7"]
1 second
["1 3\n3 1", "2 1 0 4\n4 0 2 1\n1 3 3 0\n0 3 2 2"]
NoteIn the first sample the sum in the first row is 1 + 3 = 4, in the second row β€” 3 + 1 = 4, in the first column β€” 1 + 3 = 4 and in the second column β€” 3 + 1 = 4. There are other beautiful tables for this sample.In the second sample the sum of elements in each row and each column equals 7. Besides, there are other tab...
Java 8
standard input
[ "constructive algorithms", "implementation" ]
e80088bee9c0df6adf280f8ffbeaa4a9
The single line contains two integers, n and k (1 ≀ n ≀ 100, 1 ≀ k ≀ 1000).
800
Print any beautiful table. Levko doesn't like too big numbers, so all elements of the table mustn't exceed 1000 in their absolute value. If there are multiple suitable tables, you are allowed to print any of them.
standard output
PASSED
47b00431709a326fbd0f43627576ca6a
train_000.jsonl
1384102800
Levko loves tables that consist of n rows and n columns very much. He especially loves beautiful tables. A table is beautiful to Levko if the sum of elements in each row and column of the table equals k.Unfortunately, he doesn't know any such table. Your task is to help him to find at least one of them.
256 megabytes
import java.io.*; import java.util.*; public class CF361A_LevkoAndTable { private void solve() { int n = readInt(); int k = readInt(); for (int i = 0; i < n; i++) { for (int j = 0; j < n; j++) { if (i == j) out.print(k + " "); ...
Java
["2 4", "4 7"]
1 second
["1 3\n3 1", "2 1 0 4\n4 0 2 1\n1 3 3 0\n0 3 2 2"]
NoteIn the first sample the sum in the first row is 1 + 3 = 4, in the second row β€” 3 + 1 = 4, in the first column β€” 1 + 3 = 4 and in the second column β€” 3 + 1 = 4. There are other beautiful tables for this sample.In the second sample the sum of elements in each row and each column equals 7. Besides, there are other tab...
Java 8
standard input
[ "constructive algorithms", "implementation" ]
e80088bee9c0df6adf280f8ffbeaa4a9
The single line contains two integers, n and k (1 ≀ n ≀ 100, 1 ≀ k ≀ 1000).
800
Print any beautiful table. Levko doesn't like too big numbers, so all elements of the table mustn't exceed 1000 in their absolute value. If there are multiple suitable tables, you are allowed to print any of them.
standard output
PASSED
6d1341a61dd7b68af3cb12dc4756fead
train_000.jsonl
1384102800
Levko loves tables that consist of n rows and n columns very much. He especially loves beautiful tables. A table is beautiful to Levko if the sum of elements in each row and column of the table equals k.Unfortunately, he doesn't know any such table. Your task is to help him to find at least one of them.
256 megabytes
import java.io.*; import java.util.*; public class Table { public static void main(String[] args) throws IOException { BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); StringTokenizer st = new StringTokenizer(br.readLine()); int n, k; n = Integer.pa...
Java
["2 4", "4 7"]
1 second
["1 3\n3 1", "2 1 0 4\n4 0 2 1\n1 3 3 0\n0 3 2 2"]
NoteIn the first sample the sum in the first row is 1 + 3 = 4, in the second row β€” 3 + 1 = 4, in the first column β€” 1 + 3 = 4 and in the second column β€” 3 + 1 = 4. There are other beautiful tables for this sample.In the second sample the sum of elements in each row and each column equals 7. Besides, there are other tab...
Java 8
standard input
[ "constructive algorithms", "implementation" ]
e80088bee9c0df6adf280f8ffbeaa4a9
The single line contains two integers, n and k (1 ≀ n ≀ 100, 1 ≀ k ≀ 1000).
800
Print any beautiful table. Levko doesn't like too big numbers, so all elements of the table mustn't exceed 1000 in their absolute value. If there are multiple suitable tables, you are allowed to print any of them.
standard output
PASSED
0f4506631f76afd824d536cdd01a8ae6
train_000.jsonl
1384102800
Levko loves tables that consist of n rows and n columns very much. He especially loves beautiful tables. A table is beautiful to Levko if the sum of elements in each row and column of the table equals k.Unfortunately, he doesn't know any such table. Your task is to help him to find at least one of them.
256 megabytes
import java.util.Scanner; public class Levko_and_Table { public static void main(String[] args) { // TODO Auto-generated method stub Scanner in=new Scanner(System.in); int n=in.nextInt(); int k=in.nextInt(); int arr[][]=new int[n][n]; for(int i=0;i<n;i++){ for(int j=0;j<n;j++){ if(j==i)arr[i][j]=k...
Java
["2 4", "4 7"]
1 second
["1 3\n3 1", "2 1 0 4\n4 0 2 1\n1 3 3 0\n0 3 2 2"]
NoteIn the first sample the sum in the first row is 1 + 3 = 4, in the second row β€” 3 + 1 = 4, in the first column β€” 1 + 3 = 4 and in the second column β€” 3 + 1 = 4. There are other beautiful tables for this sample.In the second sample the sum of elements in each row and each column equals 7. Besides, there are other tab...
Java 8
standard input
[ "constructive algorithms", "implementation" ]
e80088bee9c0df6adf280f8ffbeaa4a9
The single line contains two integers, n and k (1 ≀ n ≀ 100, 1 ≀ k ≀ 1000).
800
Print any beautiful table. Levko doesn't like too big numbers, so all elements of the table mustn't exceed 1000 in their absolute value. If there are multiple suitable tables, you are allowed to print any of them.
standard output
PASSED
5b8cad932837b6f84bc025c964f0f6d8
train_000.jsonl
1384102800
Levko loves tables that consist of n rows and n columns very much. He especially loves beautiful tables. A table is beautiful to Levko if the sum of elements in each row and column of the table equals k.Unfortunately, he doesn't know any such table. Your task is to help him to find at least one of them.
256 megabytes
import java.io.IOException; import java.util.Scanner; public class Solutions { public static void main(String[] args) throws IOException { Scanner sc = new Scanner(System.in); int n = sc.nextInt(); int k = sc.nextInt(); int p = k / n; int r = k - p * (n-1); for(int i = 0; i < n; i++) { for(int j = 0...
Java
["2 4", "4 7"]
1 second
["1 3\n3 1", "2 1 0 4\n4 0 2 1\n1 3 3 0\n0 3 2 2"]
NoteIn the first sample the sum in the first row is 1 + 3 = 4, in the second row β€” 3 + 1 = 4, in the first column β€” 1 + 3 = 4 and in the second column β€” 3 + 1 = 4. There are other beautiful tables for this sample.In the second sample the sum of elements in each row and each column equals 7. Besides, there are other tab...
Java 8
standard input
[ "constructive algorithms", "implementation" ]
e80088bee9c0df6adf280f8ffbeaa4a9
The single line contains two integers, n and k (1 ≀ n ≀ 100, 1 ≀ k ≀ 1000).
800
Print any beautiful table. Levko doesn't like too big numbers, so all elements of the table mustn't exceed 1000 in their absolute value. If there are multiple suitable tables, you are allowed to print any of them.
standard output
PASSED
e558eeedea2e1c7a594836a062e07b4b
train_000.jsonl
1384102800
Levko loves tables that consist of n rows and n columns very much. He especially loves beautiful tables. A table is beautiful to Levko if the sum of elements in each row and column of the table equals k.Unfortunately, he doesn't know any such table. Your task is to help him to find at least one of them.
256 megabytes
import java.util.Scanner; public class LevkoAndTable { public static void main(String[] args) { Scanner sc = new Scanner(System.in); StringBuilder sb = new StringBuilder(); int n = sc.nextInt(), k = sc.nextInt(); for (int i = 0; i < n; i++) { for (int j = 0; j < n; j++) { if(i == j) sb.append(k...
Java
["2 4", "4 7"]
1 second
["1 3\n3 1", "2 1 0 4\n4 0 2 1\n1 3 3 0\n0 3 2 2"]
NoteIn the first sample the sum in the first row is 1 + 3 = 4, in the second row β€” 3 + 1 = 4, in the first column β€” 1 + 3 = 4 and in the second column β€” 3 + 1 = 4. There are other beautiful tables for this sample.In the second sample the sum of elements in each row and each column equals 7. Besides, there are other tab...
Java 8
standard input
[ "constructive algorithms", "implementation" ]
e80088bee9c0df6adf280f8ffbeaa4a9
The single line contains two integers, n and k (1 ≀ n ≀ 100, 1 ≀ k ≀ 1000).
800
Print any beautiful table. Levko doesn't like too big numbers, so all elements of the table mustn't exceed 1000 in their absolute value. If there are multiple suitable tables, you are allowed to print any of them.
standard output
PASSED
caf950c4ef2a575817b37a4b9edc64f9
train_000.jsonl
1384102800
Levko loves tables that consist of n rows and n columns very much. He especially loves beautiful tables. A table is beautiful to Levko if the sum of elements in each row and column of the table equals k.Unfortunately, he doesn't know any such table. Your task is to help him to find at least one of them.
256 megabytes
import java.util.Scanner; public class solve { public static void main(String args[]){ Scanner sc= new Scanner(System.in); int n = sc.nextInt(); int arr[][] = new int[n][n]; int k =sc.nextInt(); int y= k ; int t= 0 ; for(int i = 0 ; i<n ; i ++) { for(int j=0 ;j<n;j++) if(i==j)arr[i][j]=...
Java
["2 4", "4 7"]
1 second
["1 3\n3 1", "2 1 0 4\n4 0 2 1\n1 3 3 0\n0 3 2 2"]
NoteIn the first sample the sum in the first row is 1 + 3 = 4, in the second row β€” 3 + 1 = 4, in the first column β€” 1 + 3 = 4 and in the second column β€” 3 + 1 = 4. There are other beautiful tables for this sample.In the second sample the sum of elements in each row and each column equals 7. Besides, there are other tab...
Java 8
standard input
[ "constructive algorithms", "implementation" ]
e80088bee9c0df6adf280f8ffbeaa4a9
The single line contains two integers, n and k (1 ≀ n ≀ 100, 1 ≀ k ≀ 1000).
800
Print any beautiful table. Levko doesn't like too big numbers, so all elements of the table mustn't exceed 1000 in their absolute value. If there are multiple suitable tables, you are allowed to print any of them.
standard output
PASSED
1b02ed661f5526f9d2dc21475bc8dc19
train_000.jsonl
1384102800
Levko loves tables that consist of n rows and n columns very much. He especially loves beautiful tables. A table is beautiful to Levko if the sum of elements in each row and column of the table equals k.Unfortunately, he doesn't know any such table. Your task is to help him to find at least one of them.
256 megabytes
import java.util.Scanner; public class Main{ public static void main(String[] args){ Scanner in = new Scanner(System.in); int n = in.nextInt(); int k = in.nextInt(); for(int i=0; i<n; i++){ for(int j=0; j<n; j++){ if(i == j){ System.out...
Java
["2 4", "4 7"]
1 second
["1 3\n3 1", "2 1 0 4\n4 0 2 1\n1 3 3 0\n0 3 2 2"]
NoteIn the first sample the sum in the first row is 1 + 3 = 4, in the second row β€” 3 + 1 = 4, in the first column β€” 1 + 3 = 4 and in the second column β€” 3 + 1 = 4. There are other beautiful tables for this sample.In the second sample the sum of elements in each row and each column equals 7. Besides, there are other tab...
Java 8
standard input
[ "constructive algorithms", "implementation" ]
e80088bee9c0df6adf280f8ffbeaa4a9
The single line contains two integers, n and k (1 ≀ n ≀ 100, 1 ≀ k ≀ 1000).
800
Print any beautiful table. Levko doesn't like too big numbers, so all elements of the table mustn't exceed 1000 in their absolute value. If there are multiple suitable tables, you are allowed to print any of them.
standard output
PASSED
542880d159fbf7dfc85b5e53e03a2856
train_000.jsonl
1384102800
Levko loves tables that consist of n rows and n columns very much. He especially loves beautiful tables. A table is beautiful to Levko if the sum of elements in each row and column of the table equals k.Unfortunately, he doesn't know any such table. Your task is to help him to find at least one of them.
256 megabytes
import java.io.*; import java.util.StringTokenizer; import java.util.*; import java.math.*; public class Solution{ public static void main(String[] args) throws Exception { FastScanner cin = new FastScanner(System.in); StringBuffer ans = new StringBuffer(); int n = cin.nextInt(); ...
Java
["2 4", "4 7"]
1 second
["1 3\n3 1", "2 1 0 4\n4 0 2 1\n1 3 3 0\n0 3 2 2"]
NoteIn the first sample the sum in the first row is 1 + 3 = 4, in the second row β€” 3 + 1 = 4, in the first column β€” 1 + 3 = 4 and in the second column β€” 3 + 1 = 4. There are other beautiful tables for this sample.In the second sample the sum of elements in each row and each column equals 7. Besides, there are other tab...
Java 8
standard input
[ "constructive algorithms", "implementation" ]
e80088bee9c0df6adf280f8ffbeaa4a9
The single line contains two integers, n and k (1 ≀ n ≀ 100, 1 ≀ k ≀ 1000).
800
Print any beautiful table. Levko doesn't like too big numbers, so all elements of the table mustn't exceed 1000 in their absolute value. If there are multiple suitable tables, you are allowed to print any of them.
standard output
PASSED
69a7418f3ca8449af3e25c390b6ce20c
train_000.jsonl
1384102800
Levko loves tables that consist of n rows and n columns very much. He especially loves beautiful tables. A table is beautiful to Levko if the sum of elements in each row and column of the table equals k.Unfortunately, he doesn't know any such table. Your task is to help him to find at least one of them.
256 megabytes
import java.util.Scanner; public class LevkoAndTable { public static void main(String[] args) { // TODO code application logic here Scanner in = new Scanner(System.in); int s,c; c = in.nextInt(); s = in.nextInt(); int[][] dim = new in...
Java
["2 4", "4 7"]
1 second
["1 3\n3 1", "2 1 0 4\n4 0 2 1\n1 3 3 0\n0 3 2 2"]
NoteIn the first sample the sum in the first row is 1 + 3 = 4, in the second row β€” 3 + 1 = 4, in the first column β€” 1 + 3 = 4 and in the second column β€” 3 + 1 = 4. There are other beautiful tables for this sample.In the second sample the sum of elements in each row and each column equals 7. Besides, there are other tab...
Java 8
standard input
[ "constructive algorithms", "implementation" ]
e80088bee9c0df6adf280f8ffbeaa4a9
The single line contains two integers, n and k (1 ≀ n ≀ 100, 1 ≀ k ≀ 1000).
800
Print any beautiful table. Levko doesn't like too big numbers, so all elements of the table mustn't exceed 1000 in their absolute value. If there are multiple suitable tables, you are allowed to print any of them.
standard output
PASSED
413a72be4aff5668929fb3675244a35c
train_000.jsonl
1384102800
Levko loves tables that consist of n rows and n columns very much. He especially loves beautiful tables. A table is beautiful to Levko if the sum of elements in each row and column of the table equals k.Unfortunately, he doesn't know any such table. Your task is to help him to find at least one of them.
256 megabytes
import java.util.Scanner; public class JavaApplication1 { public static Scanner in = new Scanner(System.in); public static void main(String[] args) { int n,k; n = in.nextInt(); k = in.nextInt(); int a[][] = new int[n][n]; for(int i=0; i<n; i++) { fo...
Java
["2 4", "4 7"]
1 second
["1 3\n3 1", "2 1 0 4\n4 0 2 1\n1 3 3 0\n0 3 2 2"]
NoteIn the first sample the sum in the first row is 1 + 3 = 4, in the second row β€” 3 + 1 = 4, in the first column β€” 1 + 3 = 4 and in the second column β€” 3 + 1 = 4. There are other beautiful tables for this sample.In the second sample the sum of elements in each row and each column equals 7. Besides, there are other tab...
Java 8
standard input
[ "constructive algorithms", "implementation" ]
e80088bee9c0df6adf280f8ffbeaa4a9
The single line contains two integers, n and k (1 ≀ n ≀ 100, 1 ≀ k ≀ 1000).
800
Print any beautiful table. Levko doesn't like too big numbers, so all elements of the table mustn't exceed 1000 in their absolute value. If there are multiple suitable tables, you are allowed to print any of them.
standard output
PASSED
348c6fa9c20cf3d1ea40c15fc26beeaa
train_000.jsonl
1384102800
Levko loves tables that consist of n rows and n columns very much. He especially loves beautiful tables. A table is beautiful to Levko if the sum of elements in each row and column of the table equals k.Unfortunately, he doesn't know any such table. Your task is to help him to find at least one of them.
256 megabytes
import java.util.Scanner; public class table { public static void main(String[] args) { Scanner scanner = new Scanner (System.in); int n = scanner.nextInt(); int k = scanner.nextInt(); int x = k/n,m=k%n; int [][] a;a=new int [n][n]; for (int i=0;i<n;i++) { for (int j=0;j<n;j++) { a[i][j]=x; } } for (int...
Java
["2 4", "4 7"]
1 second
["1 3\n3 1", "2 1 0 4\n4 0 2 1\n1 3 3 0\n0 3 2 2"]
NoteIn the first sample the sum in the first row is 1 + 3 = 4, in the second row β€” 3 + 1 = 4, in the first column β€” 1 + 3 = 4 and in the second column β€” 3 + 1 = 4. There are other beautiful tables for this sample.In the second sample the sum of elements in each row and each column equals 7. Besides, there are other tab...
Java 8
standard input
[ "constructive algorithms", "implementation" ]
e80088bee9c0df6adf280f8ffbeaa4a9
The single line contains two integers, n and k (1 ≀ n ≀ 100, 1 ≀ k ≀ 1000).
800
Print any beautiful table. Levko doesn't like too big numbers, so all elements of the table mustn't exceed 1000 in their absolute value. If there are multiple suitable tables, you are allowed to print any of them.
standard output
PASSED
3228cbdea0beaddce272c175a75c7ad1
train_000.jsonl
1384102800
Levko loves tables that consist of n rows and n columns very much. He especially loves beautiful tables. A table is beautiful to Levko if the sum of elements in each row and column of the table equals k.Unfortunately, he doesn't know any such table. Your task is to help him to find at least one of them.
256 megabytes
//package round210; import java.util.Scanner; public class Table { public static void main(String[] args) { Scanner leer=new Scanner(System.in); int n= leer.nextInt(); int k=leer.nextInt(); int mat[][]=new int[n][n]; int res[]=new int[n]; int suma=0; int auxk=k; for (int i = 0; i < res.length; i++) ...
Java
["2 4", "4 7"]
1 second
["1 3\n3 1", "2 1 0 4\n4 0 2 1\n1 3 3 0\n0 3 2 2"]
NoteIn the first sample the sum in the first row is 1 + 3 = 4, in the second row β€” 3 + 1 = 4, in the first column β€” 1 + 3 = 4 and in the second column β€” 3 + 1 = 4. There are other beautiful tables for this sample.In the second sample the sum of elements in each row and each column equals 7. Besides, there are other tab...
Java 6
standard input
[ "constructive algorithms", "implementation" ]
e80088bee9c0df6adf280f8ffbeaa4a9
The single line contains two integers, n and k (1 ≀ n ≀ 100, 1 ≀ k ≀ 1000).
800
Print any beautiful table. Levko doesn't like too big numbers, so all elements of the table mustn't exceed 1000 in their absolute value. If there are multiple suitable tables, you are allowed to print any of them.
standard output
PASSED
6895887ea7e8ff8d0534a8d514550c48
train_000.jsonl
1384102800
Levko loves tables that consist of n rows and n columns very much. He especially loves beautiful tables. A table is beautiful to Levko if the sum of elements in each row and column of the table equals k.Unfortunately, he doesn't know any such table. Your task is to help him to find at least one of them.
256 megabytes
import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; /* * To change this template, choose Tools | Templates * and open the template in the editor. */ /** * * @author a.bogdanov */ public class LevkoTable { public static void main(String[] args) throws IOException { ...
Java
["2 4", "4 7"]
1 second
["1 3\n3 1", "2 1 0 4\n4 0 2 1\n1 3 3 0\n0 3 2 2"]
NoteIn the first sample the sum in the first row is 1 + 3 = 4, in the second row β€” 3 + 1 = 4, in the first column β€” 1 + 3 = 4 and in the second column β€” 3 + 1 = 4. There are other beautiful tables for this sample.In the second sample the sum of elements in each row and each column equals 7. Besides, there are other tab...
Java 6
standard input
[ "constructive algorithms", "implementation" ]
e80088bee9c0df6adf280f8ffbeaa4a9
The single line contains two integers, n and k (1 ≀ n ≀ 100, 1 ≀ k ≀ 1000).
800
Print any beautiful table. Levko doesn't like too big numbers, so all elements of the table mustn't exceed 1000 in their absolute value. If there are multiple suitable tables, you are allowed to print any of them.
standard output
PASSED
b0070ac73d2e68d079c0d037062356f5
train_000.jsonl
1384102800
Levko loves tables that consist of n rows and n columns very much. He especially loves beautiful tables. A table is beautiful to Levko if the sum of elements in each row and column of the table equals k.Unfortunately, he doesn't know any such table. Your task is to help him to find at least one of them.
256 megabytes
import java.io.*; import java.util.*; public class LevkoAndTable { public static void main(String[] args) throws IOException { Scanner input = new Scanner(System.in); //Scanner input = new Scanner(new File("Sample Input.txt")); StringBuilder output = new StringBuilder(); int re...
Java
["2 4", "4 7"]
1 second
["1 3\n3 1", "2 1 0 4\n4 0 2 1\n1 3 3 0\n0 3 2 2"]
NoteIn the first sample the sum in the first row is 1 + 3 = 4, in the second row β€” 3 + 1 = 4, in the first column β€” 1 + 3 = 4 and in the second column β€” 3 + 1 = 4. There are other beautiful tables for this sample.In the second sample the sum of elements in each row and each column equals 7. Besides, there are other tab...
Java 6
standard input
[ "constructive algorithms", "implementation" ]
e80088bee9c0df6adf280f8ffbeaa4a9
The single line contains two integers, n and k (1 ≀ n ≀ 100, 1 ≀ k ≀ 1000).
800
Print any beautiful table. Levko doesn't like too big numbers, so all elements of the table mustn't exceed 1000 in their absolute value. If there are multiple suitable tables, you are allowed to print any of them.
standard output
PASSED
4911d073bc40942ae2ad5068603d89b4
train_000.jsonl
1384102800
Levko loves tables that consist of n rows and n columns very much. He especially loves beautiful tables. A table is beautiful to Levko if the sum of elements in each row and column of the table equals k.Unfortunately, he doesn't know any such table. Your task is to help him to find at least one of them.
256 megabytes
import java.io.BufferedReader; import java.io.FileNotFoundException; import java.io.FileReader; import java.io.IOException; import java.io.InputStreamReader; import java.util.StringTokenizer; public class T361A { public void solve(int n, int k) { StringBuffer[] ans = new StringBuffer[n]; for (int i = 0; i < n...
Java
["2 4", "4 7"]
1 second
["1 3\n3 1", "2 1 0 4\n4 0 2 1\n1 3 3 0\n0 3 2 2"]
NoteIn the first sample the sum in the first row is 1 + 3 = 4, in the second row β€” 3 + 1 = 4, in the first column β€” 1 + 3 = 4 and in the second column β€” 3 + 1 = 4. There are other beautiful tables for this sample.In the second sample the sum of elements in each row and each column equals 7. Besides, there are other tab...
Java 6
standard input
[ "constructive algorithms", "implementation" ]
e80088bee9c0df6adf280f8ffbeaa4a9
The single line contains two integers, n and k (1 ≀ n ≀ 100, 1 ≀ k ≀ 1000).
800
Print any beautiful table. Levko doesn't like too big numbers, so all elements of the table mustn't exceed 1000 in their absolute value. If there are multiple suitable tables, you are allowed to print any of them.
standard output
PASSED
d6fd25ddc8161bf811ce57114ba72d4d
train_000.jsonl
1384102800
Levko loves tables that consist of n rows and n columns very much. He especially loves beautiful tables. A table is beautiful to Levko if the sum of elements in each row and column of the table equals k.Unfortunately, he doesn't know any such table. Your task is to help him to find at least one of them.
256 megabytes
import java.util.HashSet; import java.util.Scanner; import java.util.Set; public class Brackets { /** * @param args */ public static void main(String[] args) { Scanner console = new Scanner(System.in); int count = 0; while (console.hasNext()) { ...
Java
["2 4", "4 7"]
1 second
["1 3\n3 1", "2 1 0 4\n4 0 2 1\n1 3 3 0\n0 3 2 2"]
NoteIn the first sample the sum in the first row is 1 + 3 = 4, in the second row β€” 3 + 1 = 4, in the first column β€” 1 + 3 = 4 and in the second column β€” 3 + 1 = 4. There are other beautiful tables for this sample.In the second sample the sum of elements in each row and each column equals 7. Besides, there are other tab...
Java 6
standard input
[ "constructive algorithms", "implementation" ]
e80088bee9c0df6adf280f8ffbeaa4a9
The single line contains two integers, n and k (1 ≀ n ≀ 100, 1 ≀ k ≀ 1000).
800
Print any beautiful table. Levko doesn't like too big numbers, so all elements of the table mustn't exceed 1000 in their absolute value. If there are multiple suitable tables, you are allowed to print any of them.
standard output
PASSED
75ceb927e7d7d5a32c747a3b77785070
train_000.jsonl
1384102800
Levko loves tables that consist of n rows and n columns very much. He especially loves beautiful tables. A table is beautiful to Levko if the sum of elements in each row and column of the table equals k.Unfortunately, he doesn't know any such table. Your task is to help him to find at least one of them.
256 megabytes
import java.io.PrintStream; import java.util.Scanner; /** * Created with IntelliJ IDEA. * User: ekrylov * Date: 11/10/13 * Time: 8:59 PM * To change this template use File | Settings | File Templates. */ public class A { public static void main(String[] arg) { new A().solve(); } private vo...
Java
["2 4", "4 7"]
1 second
["1 3\n3 1", "2 1 0 4\n4 0 2 1\n1 3 3 0\n0 3 2 2"]
NoteIn the first sample the sum in the first row is 1 + 3 = 4, in the second row β€” 3 + 1 = 4, in the first column β€” 1 + 3 = 4 and in the second column β€” 3 + 1 = 4. There are other beautiful tables for this sample.In the second sample the sum of elements in each row and each column equals 7. Besides, there are other tab...
Java 6
standard input
[ "constructive algorithms", "implementation" ]
e80088bee9c0df6adf280f8ffbeaa4a9
The single line contains two integers, n and k (1 ≀ n ≀ 100, 1 ≀ k ≀ 1000).
800
Print any beautiful table. Levko doesn't like too big numbers, so all elements of the table mustn't exceed 1000 in their absolute value. If there are multiple suitable tables, you are allowed to print any of them.
standard output
PASSED
562f0d60ce4a0e02598d9ef8dbec3fc1
train_000.jsonl
1384102800
Levko loves tables that consist of n rows and n columns very much. He especially loves beautiful tables. A table is beautiful to Levko if the sum of elements in each row and column of the table equals k.Unfortunately, he doesn't know any such table. Your task is to help him to find at least one of them.
256 megabytes
/* http://codeforces.com/problemset/problem/361/A Levko and table */ import java.util.*; import java.io.*; public class Main { static BufferedReader reader = new BufferedReader(new InputStreamReader(System.in)); // sum (the sum of numbers in each row and each column) static int N; //...
Java
["2 4", "4 7"]
1 second
["1 3\n3 1", "2 1 0 4\n4 0 2 1\n1 3 3 0\n0 3 2 2"]
NoteIn the first sample the sum in the first row is 1 + 3 = 4, in the second row β€” 3 + 1 = 4, in the first column β€” 1 + 3 = 4 and in the second column β€” 3 + 1 = 4. There are other beautiful tables for this sample.In the second sample the sum of elements in each row and each column equals 7. Besides, there are other tab...
Java 6
standard input
[ "constructive algorithms", "implementation" ]
e80088bee9c0df6adf280f8ffbeaa4a9
The single line contains two integers, n and k (1 ≀ n ≀ 100, 1 ≀ k ≀ 1000).
800
Print any beautiful table. Levko doesn't like too big numbers, so all elements of the table mustn't exceed 1000 in their absolute value. If there are multiple suitable tables, you are allowed to print any of them.
standard output
PASSED
c527a3a93f4b9664e9e74adabf7dd472
train_000.jsonl
1384102800
Levko loves tables that consist of n rows and n columns very much. He especially loves beautiful tables. A table is beautiful to Levko if the sum of elements in each row and column of the table equals k.Unfortunately, he doesn't know any such table. Your task is to help him to find at least one of them.
256 megabytes
import java.util.*; public class test{ public static void main(String args[]){ Scanner cin=new Scanner (System.in); while (cin.hasNextInt()){ int n=cin.nextInt(); int k=cin.nextInt(); for (int i=0;i<n;i++){ for (int j=0;j<n;j++){ ...
Java
["2 4", "4 7"]
1 second
["1 3\n3 1", "2 1 0 4\n4 0 2 1\n1 3 3 0\n0 3 2 2"]
NoteIn the first sample the sum in the first row is 1 + 3 = 4, in the second row β€” 3 + 1 = 4, in the first column β€” 1 + 3 = 4 and in the second column β€” 3 + 1 = 4. There are other beautiful tables for this sample.In the second sample the sum of elements in each row and each column equals 7. Besides, there are other tab...
Java 6
standard input
[ "constructive algorithms", "implementation" ]
e80088bee9c0df6adf280f8ffbeaa4a9
The single line contains two integers, n and k (1 ≀ n ≀ 100, 1 ≀ k ≀ 1000).
800
Print any beautiful table. Levko doesn't like too big numbers, so all elements of the table mustn't exceed 1000 in their absolute value. If there are multiple suitable tables, you are allowed to print any of them.
standard output
PASSED
471d0bb1753dc2b201b03f2924398be6
train_000.jsonl
1384102800
Levko loves tables that consist of n rows and n columns very much. He especially loves beautiful tables. A table is beautiful to Levko if the sum of elements in each row and column of the table equals k.Unfortunately, he doesn't know any such table. Your task is to help him to find at least one of them.
256 megabytes
import java.util.Scanner; public class LevkoandTable { public static void main(String[] args) { Scanner scanner = new Scanner(System.in); // while (scanner.hasNext()) { int n = scanner.nextInt(); int k = scanner.nextInt(); for (int i = 0; i < n; i++) { ...
Java
["2 4", "4 7"]
1 second
["1 3\n3 1", "2 1 0 4\n4 0 2 1\n1 3 3 0\n0 3 2 2"]
NoteIn the first sample the sum in the first row is 1 + 3 = 4, in the second row β€” 3 + 1 = 4, in the first column β€” 1 + 3 = 4 and in the second column β€” 3 + 1 = 4. There are other beautiful tables for this sample.In the second sample the sum of elements in each row and each column equals 7. Besides, there are other tab...
Java 6
standard input
[ "constructive algorithms", "implementation" ]
e80088bee9c0df6adf280f8ffbeaa4a9
The single line contains two integers, n and k (1 ≀ n ≀ 100, 1 ≀ k ≀ 1000).
800
Print any beautiful table. Levko doesn't like too big numbers, so all elements of the table mustn't exceed 1000 in their absolute value. If there are multiple suitable tables, you are allowed to print any of them.
standard output
PASSED
49de7729b68223424742947dccecc2d0
train_000.jsonl
1384102800
Levko loves tables that consist of n rows and n columns very much. He especially loves beautiful tables. A table is beautiful to Levko if the sum of elements in each row and column of the table equals k.Unfortunately, he doesn't know any such table. Your task is to help him to find at least one of them.
256 megabytes
import java.util.Scanner; public class Main{ public static void main (String[] args){ Scanner numeros=new Scanner(System.in); int a=numeros.nextInt(); int b=numeros.nextInt(); int num1; int num2; int ver=0; if(b%2==0) { num1=b/2; num2=b/2; } else { ...
Java
["2 4", "4 7"]
1 second
["1 3\n3 1", "2 1 0 4\n4 0 2 1\n1 3 3 0\n0 3 2 2"]
NoteIn the first sample the sum in the first row is 1 + 3 = 4, in the second row β€” 3 + 1 = 4, in the first column β€” 1 + 3 = 4 and in the second column β€” 3 + 1 = 4. There are other beautiful tables for this sample.In the second sample the sum of elements in each row and each column equals 7. Besides, there are other tab...
Java 6
standard input
[ "constructive algorithms", "implementation" ]
e80088bee9c0df6adf280f8ffbeaa4a9
The single line contains two integers, n and k (1 ≀ n ≀ 100, 1 ≀ k ≀ 1000).
800
Print any beautiful table. Levko doesn't like too big numbers, so all elements of the table mustn't exceed 1000 in their absolute value. If there are multiple suitable tables, you are allowed to print any of them.
standard output
PASSED
7e5477649c9af3535bb814e62495b76c
train_000.jsonl
1384102800
Levko loves tables that consist of n rows and n columns very much. He especially loves beautiful tables. A table is beautiful to Levko if the sum of elements in each row and column of the table equals k.Unfortunately, he doesn't know any such table. Your task is to help him to find at least one of them.
256 megabytes
import java.util.Arrays; import java.util.Scanner; public class LevkoTable { static Scanner input = new Scanner(System.in); public static void main(String[] args) { int n = input.nextInt(), K = input.nextInt(); int q = K / n, r = K % n; int[] row = new int[n]; Arrays.fill(row, q); ...
Java
["2 4", "4 7"]
1 second
["1 3\n3 1", "2 1 0 4\n4 0 2 1\n1 3 3 0\n0 3 2 2"]
NoteIn the first sample the sum in the first row is 1 + 3 = 4, in the second row β€” 3 + 1 = 4, in the first column β€” 1 + 3 = 4 and in the second column β€” 3 + 1 = 4. There are other beautiful tables for this sample.In the second sample the sum of elements in each row and each column equals 7. Besides, there are other tab...
Java 6
standard input
[ "constructive algorithms", "implementation" ]
e80088bee9c0df6adf280f8ffbeaa4a9
The single line contains two integers, n and k (1 ≀ n ≀ 100, 1 ≀ k ≀ 1000).
800
Print any beautiful table. Levko doesn't like too big numbers, so all elements of the table mustn't exceed 1000 in their absolute value. If there are multiple suitable tables, you are allowed to print any of them.
standard output
PASSED
7696c207166672153b43c9fd07232f7d
train_000.jsonl
1384102800
Levko loves tables that consist of n rows and n columns very much. He especially loves beautiful tables. A table is beautiful to Levko if the sum of elements in each row and column of the table equals k.Unfortunately, he doesn't know any such table. Your task is to help him to find at least one of them.
256 megabytes
import java.util.Scanner; public class Main{ // public static void Print(Object... O) { // System.out.println(Arrays.deepToString(O).replaceAll("],", "]\n")); // } public static void main(String[] args) { Scanner in = new Scanner(System.in); int n = in.nextInt(); int k = in....
Java
["2 4", "4 7"]
1 second
["1 3\n3 1", "2 1 0 4\n4 0 2 1\n1 3 3 0\n0 3 2 2"]
NoteIn the first sample the sum in the first row is 1 + 3 = 4, in the second row β€” 3 + 1 = 4, in the first column β€” 1 + 3 = 4 and in the second column β€” 3 + 1 = 4. There are other beautiful tables for this sample.In the second sample the sum of elements in each row and each column equals 7. Besides, there are other tab...
Java 6
standard input
[ "constructive algorithms", "implementation" ]
e80088bee9c0df6adf280f8ffbeaa4a9
The single line contains two integers, n and k (1 ≀ n ≀ 100, 1 ≀ k ≀ 1000).
800
Print any beautiful table. Levko doesn't like too big numbers, so all elements of the table mustn't exceed 1000 in their absolute value. If there are multiple suitable tables, you are allowed to print any of them.
standard output
PASSED
6442b4e0ffc82795b638b5aa4132d4f7
train_000.jsonl
1384102800
Levko loves tables that consist of n rows and n columns very much. He especially loves beautiful tables. A table is beautiful to Levko if the sum of elements in each row and column of the table equals k.Unfortunately, he doesn't know any such table. Your task is to help him to find at least one of them.
256 megabytes
import java.util.Scanner; public class LevkoandTable { public static void main(String[] args) { Scanner reader = new Scanner(System.in); int n = reader.nextInt(); int k = reader.nextInt(); for (int i = 0; i < n; i++) { for (int j = 0; j < n; j++) { if(i == j) { System.out.print(k); } else { ...
Java
["2 4", "4 7"]
1 second
["1 3\n3 1", "2 1 0 4\n4 0 2 1\n1 3 3 0\n0 3 2 2"]
NoteIn the first sample the sum in the first row is 1 + 3 = 4, in the second row β€” 3 + 1 = 4, in the first column β€” 1 + 3 = 4 and in the second column β€” 3 + 1 = 4. There are other beautiful tables for this sample.In the second sample the sum of elements in each row and each column equals 7. Besides, there are other tab...
Java 6
standard input
[ "constructive algorithms", "implementation" ]
e80088bee9c0df6adf280f8ffbeaa4a9
The single line contains two integers, n and k (1 ≀ n ≀ 100, 1 ≀ k ≀ 1000).
800
Print any beautiful table. Levko doesn't like too big numbers, so all elements of the table mustn't exceed 1000 in their absolute value. If there are multiple suitable tables, you are allowed to print any of them.
standard output
PASSED
ef28a19815c1b01c94482a8cf7da7ca2
train_000.jsonl
1384102800
Levko loves tables that consist of n rows and n columns very much. He especially loves beautiful tables. A table is beautiful to Levko if the sum of elements in each row and column of the table equals k.Unfortunately, he doesn't know any such table. Your task is to help him to find at least one of them.
256 megabytes
import java.awt.*; import java.awt.event.*; import java.awt.geom.*; import java.io.*; import java.math.*; import java.text.*; import java.util.*; /* br = new BufferedReader(new FileReader("input.txt")); pw = new PrintWriter(new BufferedWriter(new FileWriter("output.txt"))); br = new BufferedReader(new InputStreamReade...
Java
["2 4", "4 7"]
1 second
["1 3\n3 1", "2 1 0 4\n4 0 2 1\n1 3 3 0\n0 3 2 2"]
NoteIn the first sample the sum in the first row is 1 + 3 = 4, in the second row β€” 3 + 1 = 4, in the first column β€” 1 + 3 = 4 and in the second column β€” 3 + 1 = 4. There are other beautiful tables for this sample.In the second sample the sum of elements in each row and each column equals 7. Besides, there are other tab...
Java 6
standard input
[ "constructive algorithms", "implementation" ]
e80088bee9c0df6adf280f8ffbeaa4a9
The single line contains two integers, n and k (1 ≀ n ≀ 100, 1 ≀ k ≀ 1000).
800
Print any beautiful table. Levko doesn't like too big numbers, so all elements of the table mustn't exceed 1000 in their absolute value. If there are multiple suitable tables, you are allowed to print any of them.
standard output
PASSED
8fd8a7ef6a05cea424a432dfb20efe3c
train_000.jsonl
1384102800
Levko loves tables that consist of n rows and n columns very much. He especially loves beautiful tables. A table is beautiful to Levko if the sum of elements in each row and column of the table equals k.Unfortunately, he doesn't know any such table. Your task is to help him to find at least one of them.
256 megabytes
import java.util.*; import java.io.*; public class Solution { public static void main(String args[]) { Scanner sc = new Scanner(System.in); int n = sc.nextInt(); int k = sc.nextInt(); int[][] mat = new int[n][n]; int diag = k; for (int i = 0; i < n; i++...
Java
["2 4", "4 7"]
1 second
["1 3\n3 1", "2 1 0 4\n4 0 2 1\n1 3 3 0\n0 3 2 2"]
NoteIn the first sample the sum in the first row is 1 + 3 = 4, in the second row β€” 3 + 1 = 4, in the first column β€” 1 + 3 = 4 and in the second column β€” 3 + 1 = 4. There are other beautiful tables for this sample.In the second sample the sum of elements in each row and each column equals 7. Besides, there are other tab...
Java 6
standard input
[ "constructive algorithms", "implementation" ]
e80088bee9c0df6adf280f8ffbeaa4a9
The single line contains two integers, n and k (1 ≀ n ≀ 100, 1 ≀ k ≀ 1000).
800
Print any beautiful table. Levko doesn't like too big numbers, so all elements of the table mustn't exceed 1000 in their absolute value. If there are multiple suitable tables, you are allowed to print any of them.
standard output
PASSED
bb9470948c8592635ee011dc61d8f429
train_000.jsonl
1384102800
Levko loves tables that consist of n rows and n columns very much. He especially loves beautiful tables. A table is beautiful to Levko if the sum of elements in each row and column of the table equals k.Unfortunately, he doesn't know any such table. Your task is to help him to find at least one of them.
256 megabytes
import java.util.Scanner; public class p1_210 { public static void main(String[] args) { Scanner in = new Scanner(System.in); int n = in.nextInt(); int k = in.nextInt(); for (int i = 0; i < n; i++) { for (int j = 0; j < n; j++) { if (i == j) { ...
Java
["2 4", "4 7"]
1 second
["1 3\n3 1", "2 1 0 4\n4 0 2 1\n1 3 3 0\n0 3 2 2"]
NoteIn the first sample the sum in the first row is 1 + 3 = 4, in the second row β€” 3 + 1 = 4, in the first column β€” 1 + 3 = 4 and in the second column β€” 3 + 1 = 4. There are other beautiful tables for this sample.In the second sample the sum of elements in each row and each column equals 7. Besides, there are other tab...
Java 6
standard input
[ "constructive algorithms", "implementation" ]
e80088bee9c0df6adf280f8ffbeaa4a9
The single line contains two integers, n and k (1 ≀ n ≀ 100, 1 ≀ k ≀ 1000).
800
Print any beautiful table. Levko doesn't like too big numbers, so all elements of the table mustn't exceed 1000 in their absolute value. If there are multiple suitable tables, you are allowed to print any of them.
standard output
PASSED
386dcd6d2260a3d8c6f829624a32c17b
train_000.jsonl
1384102800
Levko loves tables that consist of n rows and n columns very much. He especially loves beautiful tables. A table is beautiful to Levko if the sum of elements in each row and column of the table equals k.Unfortunately, he doesn't know any such table. Your task is to help him to find at least one of them.
256 megabytes
import java.io.BufferedReader; import java.io.File; import java.io.FileNotFoundException; import java.io.FileReader; import java.io.IOException; import java.io.InputStreamReader; import java.io.OutputStream; import java.io.PrintStream; import java.util.StringTokenizer; /** * * @author baha */ public class Main { ...
Java
["2 4", "4 7"]
1 second
["1 3\n3 1", "2 1 0 4\n4 0 2 1\n1 3 3 0\n0 3 2 2"]
NoteIn the first sample the sum in the first row is 1 + 3 = 4, in the second row β€” 3 + 1 = 4, in the first column β€” 1 + 3 = 4 and in the second column β€” 3 + 1 = 4. There are other beautiful tables for this sample.In the second sample the sum of elements in each row and each column equals 7. Besides, there are other tab...
Java 6
standard input
[ "constructive algorithms", "implementation" ]
e80088bee9c0df6adf280f8ffbeaa4a9
The single line contains two integers, n and k (1 ≀ n ≀ 100, 1 ≀ k ≀ 1000).
800
Print any beautiful table. Levko doesn't like too big numbers, so all elements of the table mustn't exceed 1000 in their absolute value. If there are multiple suitable tables, you are allowed to print any of them.
standard output
PASSED
b592a0c7515667835ded926db2b652fa
train_000.jsonl
1384102800
Levko loves tables that consist of n rows and n columns very much. He especially loves beautiful tables. A table is beautiful to Levko if the sum of elements in each row and column of the table equals k.Unfortunately, he doesn't know any such table. Your task is to help him to find at least one of them.
256 megabytes
import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; import java.io.PrintWriter; import java.util.Arrays; import java.util.StringTokenizer; public class Main implements Runnable { private void solve() throws IOException { int n = nextInt(); int k = nextInt()...
Java
["2 4", "4 7"]
1 second
["1 3\n3 1", "2 1 0 4\n4 0 2 1\n1 3 3 0\n0 3 2 2"]
NoteIn the first sample the sum in the first row is 1 + 3 = 4, in the second row β€” 3 + 1 = 4, in the first column β€” 1 + 3 = 4 and in the second column β€” 3 + 1 = 4. There are other beautiful tables for this sample.In the second sample the sum of elements in each row and each column equals 7. Besides, there are other tab...
Java 6
standard input
[ "constructive algorithms", "implementation" ]
e80088bee9c0df6adf280f8ffbeaa4a9
The single line contains two integers, n and k (1 ≀ n ≀ 100, 1 ≀ k ≀ 1000).
800
Print any beautiful table. Levko doesn't like too big numbers, so all elements of the table mustn't exceed 1000 in their absolute value. If there are multiple suitable tables, you are allowed to print any of them.
standard output
PASSED
7c97896fef9a417abe18c10191597e35
train_000.jsonl
1384102800
Levko loves tables that consist of n rows and n columns very much. He especially loves beautiful tables. A table is beautiful to Levko if the sum of elements in each row and column of the table equals k.Unfortunately, he doesn't know any such table. Your task is to help him to find at least one of them.
256 megabytes
import java.util.Scanner; public class Table { public static void main(String[] args) { Scanner in = new Scanner(System.in); int n = in.nextInt(); int k = in.nextInt(); for(int i = 0; i < n; i++) { for(int j = 0; j < n; j++) { if(j == i) System.out.print(k + " "); ...
Java
["2 4", "4 7"]
1 second
["1 3\n3 1", "2 1 0 4\n4 0 2 1\n1 3 3 0\n0 3 2 2"]
NoteIn the first sample the sum in the first row is 1 + 3 = 4, in the second row β€” 3 + 1 = 4, in the first column β€” 1 + 3 = 4 and in the second column β€” 3 + 1 = 4. There are other beautiful tables for this sample.In the second sample the sum of elements in each row and each column equals 7. Besides, there are other tab...
Java 6
standard input
[ "constructive algorithms", "implementation" ]
e80088bee9c0df6adf280f8ffbeaa4a9
The single line contains two integers, n and k (1 ≀ n ≀ 100, 1 ≀ k ≀ 1000).
800
Print any beautiful table. Levko doesn't like too big numbers, so all elements of the table mustn't exceed 1000 in their absolute value. If there are multiple suitable tables, you are allowed to print any of them.
standard output
PASSED
42e95e1064d53e239126b11a5e309775
train_000.jsonl
1384102800
Levko loves tables that consist of n rows and n columns very much. He especially loves beautiful tables. A table is beautiful to Levko if the sum of elements in each row and column of the table equals k.Unfortunately, he doesn't know any such table. Your task is to help him to find at least one of them.
256 megabytes
import java.io.*; import java.util.ArrayList; import java.util.Arrays; import java.util.Scanner; import static java.lang.Math.*; import java.math.BigDecimal; import java.util.Locale; /** * * @author таня */ public class Timus { /** * @param args the command line arguments */ public static void ...
Java
["2 4", "4 7"]
1 second
["1 3\n3 1", "2 1 0 4\n4 0 2 1\n1 3 3 0\n0 3 2 2"]
NoteIn the first sample the sum in the first row is 1 + 3 = 4, in the second row β€” 3 + 1 = 4, in the first column β€” 1 + 3 = 4 and in the second column β€” 3 + 1 = 4. There are other beautiful tables for this sample.In the second sample the sum of elements in each row and each column equals 7. Besides, there are other tab...
Java 6
standard input
[ "constructive algorithms", "implementation" ]
e80088bee9c0df6adf280f8ffbeaa4a9
The single line contains two integers, n and k (1 ≀ n ≀ 100, 1 ≀ k ≀ 1000).
800
Print any beautiful table. Levko doesn't like too big numbers, so all elements of the table mustn't exceed 1000 in their absolute value. If there are multiple suitable tables, you are allowed to print any of them.
standard output
PASSED
f2df5b340507583e52c8403ccd99cbc4
train_000.jsonl
1384102800
Levko loves tables that consist of n rows and n columns very much. He especially loves beautiful tables. A table is beautiful to Levko if the sum of elements in each row and column of the table equals k.Unfortunately, he doesn't know any such table. Your task is to help him to find at least one of them.
256 megabytes
import java.util.Scanner; public class LevkTable { Scanner in =new Scanner(System.in); public static void main(String args[]){ new LevkTable().go(); } public void go(){ int n=in.nextInt(); int k=in.nextInt(); int common = k/n; int last = common...
Java
["2 4", "4 7"]
1 second
["1 3\n3 1", "2 1 0 4\n4 0 2 1\n1 3 3 0\n0 3 2 2"]
NoteIn the first sample the sum in the first row is 1 + 3 = 4, in the second row β€” 3 + 1 = 4, in the first column β€” 1 + 3 = 4 and in the second column β€” 3 + 1 = 4. There are other beautiful tables for this sample.In the second sample the sum of elements in each row and each column equals 7. Besides, there are other tab...
Java 6
standard input
[ "constructive algorithms", "implementation" ]
e80088bee9c0df6adf280f8ffbeaa4a9
The single line contains two integers, n and k (1 ≀ n ≀ 100, 1 ≀ k ≀ 1000).
800
Print any beautiful table. Levko doesn't like too big numbers, so all elements of the table mustn't exceed 1000 in their absolute value. If there are multiple suitable tables, you are allowed to print any of them.
standard output
PASSED
08b1b37f16ae570e40920f34679d581b
train_000.jsonl
1384102800
Levko loves tables that consist of n rows and n columns very much. He especially loves beautiful tables. A table is beautiful to Levko if the sum of elements in each row and column of the table equals k.Unfortunately, he doesn't know any such table. Your task is to help him to find at least one of them.
256 megabytes
//package a; import java.util.Arrays; import java.util.Scanner; public class Main { public static void main(String... args) { Scanner scanner = new Scanner(System.in); while (scanner.hasNext()) { short n = scanner.nextShort(); short k = scanner.nextShort(); pr...
Java
["2 4", "4 7"]
1 second
["1 3\n3 1", "2 1 0 4\n4 0 2 1\n1 3 3 0\n0 3 2 2"]
NoteIn the first sample the sum in the first row is 1 + 3 = 4, in the second row β€” 3 + 1 = 4, in the first column β€” 1 + 3 = 4 and in the second column β€” 3 + 1 = 4. There are other beautiful tables for this sample.In the second sample the sum of elements in each row and each column equals 7. Besides, there are other tab...
Java 6
standard input
[ "constructive algorithms", "implementation" ]
e80088bee9c0df6adf280f8ffbeaa4a9
The single line contains two integers, n and k (1 ≀ n ≀ 100, 1 ≀ k ≀ 1000).
800
Print any beautiful table. Levko doesn't like too big numbers, so all elements of the table mustn't exceed 1000 in their absolute value. If there are multiple suitable tables, you are allowed to print any of them.
standard output
PASSED
090b953cf9aaf38e3698e51af773ec91
train_000.jsonl
1384102800
Levko loves tables that consist of n rows and n columns very much. He especially loves beautiful tables. A table is beautiful to Levko if the sum of elements in each row and column of the table equals k.Unfortunately, he doesn't know any such table. Your task is to help him to find at least one of them.
256 megabytes
import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; import java.util.StringTokenizer; /** * Created by 875k on 12/27/13. */ public class CF210B { public static void main(String[] args) throws IOException { BufferedReader br = new BufferedReader(new InputStreamRead...
Java
["2 4", "4 7"]
1 second
["1 3\n3 1", "2 1 0 4\n4 0 2 1\n1 3 3 0\n0 3 2 2"]
NoteIn the first sample the sum in the first row is 1 + 3 = 4, in the second row β€” 3 + 1 = 4, in the first column β€” 1 + 3 = 4 and in the second column β€” 3 + 1 = 4. There are other beautiful tables for this sample.In the second sample the sum of elements in each row and each column equals 7. Besides, there are other tab...
Java 6
standard input
[ "constructive algorithms", "implementation" ]
e80088bee9c0df6adf280f8ffbeaa4a9
The single line contains two integers, n and k (1 ≀ n ≀ 100, 1 ≀ k ≀ 1000).
800
Print any beautiful table. Levko doesn't like too big numbers, so all elements of the table mustn't exceed 1000 in their absolute value. If there are multiple suitable tables, you are allowed to print any of them.
standard output
PASSED
bb9ccc7c626ca2407cdea1d92e7c488a
train_000.jsonl
1384102800
Levko loves tables that consist of n rows and n columns very much. He especially loves beautiful tables. A table is beautiful to Levko if the sum of elements in each row and column of the table equals k.Unfortunately, he doesn't know any such table. Your task is to help him to find at least one of them.
256 megabytes
import java.io.BufferedReader; import java.io.InputStreamReader; import java.io.PrintWriter; public class A { public static void main(String[] args) throws Exception{ BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); PrintWriter pw = new PrintWriter(System.out); String[] arS = br.readL...
Java
["2 4", "4 7"]
1 second
["1 3\n3 1", "2 1 0 4\n4 0 2 1\n1 3 3 0\n0 3 2 2"]
NoteIn the first sample the sum in the first row is 1 + 3 = 4, in the second row β€” 3 + 1 = 4, in the first column β€” 1 + 3 = 4 and in the second column β€” 3 + 1 = 4. There are other beautiful tables for this sample.In the second sample the sum of elements in each row and each column equals 7. Besides, there are other tab...
Java 6
standard input
[ "constructive algorithms", "implementation" ]
e80088bee9c0df6adf280f8ffbeaa4a9
The single line contains two integers, n and k (1 ≀ n ≀ 100, 1 ≀ k ≀ 1000).
800
Print any beautiful table. Levko doesn't like too big numbers, so all elements of the table mustn't exceed 1000 in their absolute value. If there are multiple suitable tables, you are allowed to print any of them.
standard output
PASSED
b7dff1f80a92f196144e1c1f9d72c80b
train_000.jsonl
1384102800
Levko loves tables that consist of n rows and n columns very much. He especially loves beautiful tables. A table is beautiful to Levko if the sum of elements in each row and column of the table equals k.Unfortunately, he doesn't know any such table. Your task is to help him to find at least one of them.
256 megabytes
import java.io.*; import java.util.*; public class A210 { public static void main(String[] args) throws Exception { BufferedReader in = new BufferedReader(new InputStreamReader(System.in)); StringTokenizer st = new StringTokenizer(in.readLine()); int n = Integer.parseInt(st.nextToken()); int k = Integer.pa...
Java
["2 4", "4 7"]
1 second
["1 3\n3 1", "2 1 0 4\n4 0 2 1\n1 3 3 0\n0 3 2 2"]
NoteIn the first sample the sum in the first row is 1 + 3 = 4, in the second row β€” 3 + 1 = 4, in the first column β€” 1 + 3 = 4 and in the second column β€” 3 + 1 = 4. There are other beautiful tables for this sample.In the second sample the sum of elements in each row and each column equals 7. Besides, there are other tab...
Java 6
standard input
[ "constructive algorithms", "implementation" ]
e80088bee9c0df6adf280f8ffbeaa4a9
The single line contains two integers, n and k (1 ≀ n ≀ 100, 1 ≀ k ≀ 1000).
800
Print any beautiful table. Levko doesn't like too big numbers, so all elements of the table mustn't exceed 1000 in their absolute value. If there are multiple suitable tables, you are allowed to print any of them.
standard output
PASSED
170d80b600d4f9c0c94a579e90fea276
train_000.jsonl
1384102800
Levko loves tables that consist of n rows and n columns very much. He especially loves beautiful tables. A table is beautiful to Levko if the sum of elements in each row and column of the table equals k.Unfortunately, he doesn't know any such table. Your task is to help him to find at least one of them.
256 megabytes
import java.util.*; public class aa { public static void main(String[] args) { Scanner input = new Scanner(System.in); int n = input.nextInt(), k = input.nextInt(); for(int i = 0; i<n; i++) { for(int j = 0; j<n; j++) { System.out.print((i==j ? k : 0) + " "); } ...
Java
["2 4", "4 7"]
1 second
["1 3\n3 1", "2 1 0 4\n4 0 2 1\n1 3 3 0\n0 3 2 2"]
NoteIn the first sample the sum in the first row is 1 + 3 = 4, in the second row β€” 3 + 1 = 4, in the first column β€” 1 + 3 = 4 and in the second column β€” 3 + 1 = 4. There are other beautiful tables for this sample.In the second sample the sum of elements in each row and each column equals 7. Besides, there are other tab...
Java 6
standard input
[ "constructive algorithms", "implementation" ]
e80088bee9c0df6adf280f8ffbeaa4a9
The single line contains two integers, n and k (1 ≀ n ≀ 100, 1 ≀ k ≀ 1000).
800
Print any beautiful table. Levko doesn't like too big numbers, so all elements of the table mustn't exceed 1000 in their absolute value. If there are multiple suitable tables, you are allowed to print any of them.
standard output
PASSED
805ca46fb27eda3c6521e7e2ca8af94b
train_000.jsonl
1384102800
Levko loves tables that consist of n rows and n columns very much. He especially loves beautiful tables. A table is beautiful to Levko if the sum of elements in each row and column of the table equals k.Unfortunately, he doesn't know any such table. Your task is to help him to find at least one of them.
256 megabytes
import java.io.BufferedReader; import java.io.File; import java.io.FileNotFoundException; import java.io.FileReader; import java.io.IOException; import java.io.InputStream; import java.io.InputStreamReader; import java.io.PrintWriter; import java.util.Locale; import java.util.StringTokenizer; public class ProblemA { ...
Java
["2 4", "4 7"]
1 second
["1 3\n3 1", "2 1 0 4\n4 0 2 1\n1 3 3 0\n0 3 2 2"]
NoteIn the first sample the sum in the first row is 1 + 3 = 4, in the second row β€” 3 + 1 = 4, in the first column β€” 1 + 3 = 4 and in the second column β€” 3 + 1 = 4. There are other beautiful tables for this sample.In the second sample the sum of elements in each row and each column equals 7. Besides, there are other tab...
Java 6
standard input
[ "constructive algorithms", "implementation" ]
e80088bee9c0df6adf280f8ffbeaa4a9
The single line contains two integers, n and k (1 ≀ n ≀ 100, 1 ≀ k ≀ 1000).
800
Print any beautiful table. Levko doesn't like too big numbers, so all elements of the table mustn't exceed 1000 in their absolute value. If there are multiple suitable tables, you are allowed to print any of them.
standard output
PASSED
b231e9d441ab86e4bfd2c7f3c37b27be
train_000.jsonl
1384102800
Levko loves tables that consist of n rows and n columns very much. He especially loves beautiful tables. A table is beautiful to Levko if the sum of elements in each row and column of the table equals k.Unfortunately, he doesn't know any such table. Your task is to help him to find at least one of them.
256 megabytes
import java.util.*; public class MainClass {public static void main(String[] args) throws Exception { //codeforces 361A Scanner input=new Scanner(System.in); int n=1; n=input.nextInt(); int k=input.nextInt(); int[][] arr = new int[n][n]; for( int i= 0; i<n; i++){ for(int j =0; j<n; j++)...
Java
["2 4", "4 7"]
1 second
["1 3\n3 1", "2 1 0 4\n4 0 2 1\n1 3 3 0\n0 3 2 2"]
NoteIn the first sample the sum in the first row is 1 + 3 = 4, in the second row β€” 3 + 1 = 4, in the first column β€” 1 + 3 = 4 and in the second column β€” 3 + 1 = 4. There are other beautiful tables for this sample.In the second sample the sum of elements in each row and each column equals 7. Besides, there are other tab...
Java 6
standard input
[ "constructive algorithms", "implementation" ]
e80088bee9c0df6adf280f8ffbeaa4a9
The single line contains two integers, n and k (1 ≀ n ≀ 100, 1 ≀ k ≀ 1000).
800
Print any beautiful table. Levko doesn't like too big numbers, so all elements of the table mustn't exceed 1000 in their absolute value. If there are multiple suitable tables, you are allowed to print any of them.
standard output
PASSED
3c0df22a973ab3f21e1e65c38451db44
train_000.jsonl
1384102800
Levko loves tables that consist of n rows and n columns very much. He especially loves beautiful tables. A table is beautiful to Levko if the sum of elements in each row and column of the table equals k.Unfortunately, he doesn't know any such table. Your task is to help him to find at least one of them.
256 megabytes
import java.io.BufferedReader; import java.io.DataInputStream; import java.io.IOException; import java.io.InputStream; import java.io.InputStreamReader; import java.math.BigInteger; import java.util.Arrays; /* * To change this template, choose Tools | Templates * and open the template in the editor. */ /** * * @...
Java
["2 4", "4 7"]
1 second
["1 3\n3 1", "2 1 0 4\n4 0 2 1\n1 3 3 0\n0 3 2 2"]
NoteIn the first sample the sum in the first row is 1 + 3 = 4, in the second row β€” 3 + 1 = 4, in the first column β€” 1 + 3 = 4 and in the second column β€” 3 + 1 = 4. There are other beautiful tables for this sample.In the second sample the sum of elements in each row and each column equals 7. Besides, there are other tab...
Java 6
standard input
[ "constructive algorithms", "implementation" ]
e80088bee9c0df6adf280f8ffbeaa4a9
The single line contains two integers, n and k (1 ≀ n ≀ 100, 1 ≀ k ≀ 1000).
800
Print any beautiful table. Levko doesn't like too big numbers, so all elements of the table mustn't exceed 1000 in their absolute value. If there are multiple suitable tables, you are allowed to print any of them.
standard output
PASSED
6db5916cfca1d32249cb698f8d5e46eb
train_000.jsonl
1384102800
Levko loves tables that consist of n rows and n columns very much. He especially loves beautiful tables. A table is beautiful to Levko if the sum of elements in each row and column of the table equals k.Unfortunately, he doesn't know any such table. Your task is to help him to find at least one of them.
256 megabytes
import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; import java.io.PrintWriter; import java.math.BigInteger; import java.util.*; public class A implements Runnable { private void solve() throws IOException { int n = nextInt(); int k = nextInt(); int...
Java
["2 4", "4 7"]
1 second
["1 3\n3 1", "2 1 0 4\n4 0 2 1\n1 3 3 0\n0 3 2 2"]
NoteIn the first sample the sum in the first row is 1 + 3 = 4, in the second row β€” 3 + 1 = 4, in the first column β€” 1 + 3 = 4 and in the second column β€” 3 + 1 = 4. There are other beautiful tables for this sample.In the second sample the sum of elements in each row and each column equals 7. Besides, there are other tab...
Java 6
standard input
[ "constructive algorithms", "implementation" ]
e80088bee9c0df6adf280f8ffbeaa4a9
The single line contains two integers, n and k (1 ≀ n ≀ 100, 1 ≀ k ≀ 1000).
800
Print any beautiful table. Levko doesn't like too big numbers, so all elements of the table mustn't exceed 1000 in their absolute value. If there are multiple suitable tables, you are allowed to print any of them.
standard output
PASSED
e821b2ae04c37121e0ea3fa376d5b8b4
train_000.jsonl
1426610700
Ford Prefect got a job as a web developer for a small company that makes towels. His current work task is to create a search engine for the website of the company. During the development process, he needs to write a subroutine for comparing strings S and T of equal length to be "similar". After a brief search on the In...
256 megabytes
/** * Created by Anna on 18.03.2015. */ /** * Created by Anna on 08.03.2014. */ import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; import java.io.PrintWriter; import java.util.HashMap; import java.util.StringTokenizer; public class TaskB { StringTokenizer st; Buf...
Java
["9\npergament\npermanent", "6\nwookie\ncookie", "4\npetr\negor", "6\ndouble\nbundle"]
2 seconds
["1\n4 6", "1\n-1 -1", "2\n1 2", "2\n4 1"]
NoteIn the second test it is acceptable to print i = 2, j = 3.
Java 7
standard input
[ "greedy" ]
2fa543c8b8f9dc500c36cf719800a6b0
The first line contains integer n (1 ≀ n ≀ 200 000) β€” the length of strings S and T. The second line contains string S. The third line contains string T. Each of the lines only contains lowercase Latin letters.
1,500
In the first line, print number x β€” the minimum possible Hamming distance between strings S and T if you swap at most one pair of letters in S. In the second line, either print the indexes i and j (1 ≀ i, j ≀ n, i ≠ j), if reaching the minimum possible distance is possible by swapping letters on positions i and j, or p...
standard output
PASSED
9e43f69141a553ce4089fcc28df85b26
train_000.jsonl
1426610700
Ford Prefect got a job as a web developer for a small company that makes towels. His current work task is to create a search engine for the website of the company. During the development process, he needs to write a subroutine for comparing strings S and T of equal length to be "similar". After a brief search on the In...
256 megabytes
import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; import java.util.HashMap; import java.util.HashSet; import java.util.LinkedList; import java.util.Map; import java.util.StringTokenizer; public class B { /** * @param args */ public static void main(String[...
Java
["9\npergament\npermanent", "6\nwookie\ncookie", "4\npetr\negor", "6\ndouble\nbundle"]
2 seconds
["1\n4 6", "1\n-1 -1", "2\n1 2", "2\n4 1"]
NoteIn the second test it is acceptable to print i = 2, j = 3.
Java 7
standard input
[ "greedy" ]
2fa543c8b8f9dc500c36cf719800a6b0
The first line contains integer n (1 ≀ n ≀ 200 000) β€” the length of strings S and T. The second line contains string S. The third line contains string T. Each of the lines only contains lowercase Latin letters.
1,500
In the first line, print number x β€” the minimum possible Hamming distance between strings S and T if you swap at most one pair of letters in S. In the second line, either print the indexes i and j (1 ≀ i, j ≀ n, i ≠ j), if reaching the minimum possible distance is possible by swapping letters on positions i and j, or p...
standard output
PASSED
e52582a082779aa8ea5ddd37d82a56f7
train_000.jsonl
1426610700
Ford Prefect got a job as a web developer for a small company that makes towels. His current work task is to create a search engine for the website of the company. During the development process, he needs to write a subroutine for comparing strings S and T of equal length to be "similar". After a brief search on the In...
256 megabytes
import java.io.BufferedReader; import java.io.File; import java.io.FileNotFoundException; import java.io.FileReader; import java.io.IOException; import java.io.InputStreamReader; import java.io.PrintWriter; import java.util.ArrayList; import java.util.Arrays; import java.util.Collection; import java.util.StringTokenize...
Java
["9\npergament\npermanent", "6\nwookie\ncookie", "4\npetr\negor", "6\ndouble\nbundle"]
2 seconds
["1\n4 6", "1\n-1 -1", "2\n1 2", "2\n4 1"]
NoteIn the second test it is acceptable to print i = 2, j = 3.
Java 7
standard input
[ "greedy" ]
2fa543c8b8f9dc500c36cf719800a6b0
The first line contains integer n (1 ≀ n ≀ 200 000) β€” the length of strings S and T. The second line contains string S. The third line contains string T. Each of the lines only contains lowercase Latin letters.
1,500
In the first line, print number x β€” the minimum possible Hamming distance between strings S and T if you swap at most one pair of letters in S. In the second line, either print the indexes i and j (1 ≀ i, j ≀ n, i ≠ j), if reaching the minimum possible distance is possible by swapping letters on positions i and j, or p...
standard output
PASSED
92a206c8f40ee3c1f0b27dcf45f314a7
train_000.jsonl
1426610700
Ford Prefect got a job as a web developer for a small company that makes towels. His current work task is to create a search engine for the website of the company. During the development process, he needs to write a subroutine for comparing strings S and T of equal length to be "similar". After a brief search on the In...
256 megabytes
import java.io.*; import java.util.*; public class Program { BufferedReader br; PrintWriter out; StringTokenizer st; boolean eof; static final int Mod = 1000000007; static final double inf = 10000000000.0; void solve() throws IOException { int n = nextInt(), error = 0; Stri...
Java
["9\npergament\npermanent", "6\nwookie\ncookie", "4\npetr\negor", "6\ndouble\nbundle"]
2 seconds
["1\n4 6", "1\n-1 -1", "2\n1 2", "2\n4 1"]
NoteIn the second test it is acceptable to print i = 2, j = 3.
Java 7
standard input
[ "greedy" ]
2fa543c8b8f9dc500c36cf719800a6b0
The first line contains integer n (1 ≀ n ≀ 200 000) β€” the length of strings S and T. The second line contains string S. The third line contains string T. Each of the lines only contains lowercase Latin letters.
1,500
In the first line, print number x β€” the minimum possible Hamming distance between strings S and T if you swap at most one pair of letters in S. In the second line, either print the indexes i and j (1 ≀ i, j ≀ n, i ≠ j), if reaching the minimum possible distance is possible by swapping letters on positions i and j, or p...
standard output
PASSED
9d0c05412b69ac645b8fb71e3138152e
train_000.jsonl
1426610700
Ford Prefect got a job as a web developer for a small company that makes towels. His current work task is to create a search engine for the website of the company. During the development process, he needs to write a subroutine for comparing strings S and T of equal length to be "similar". After a brief search on the In...
256 megabytes
import java.io.*; import java.util.*; public class I { public static void main(String[] args)throws IOException { BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); BufferedWriter bw = new BufferedWriter(new OutputStreamWriter(System.out)); int n = Integer.parseInt(br.readLine()); Stri...
Java
["9\npergament\npermanent", "6\nwookie\ncookie", "4\npetr\negor", "6\ndouble\nbundle"]
2 seconds
["1\n4 6", "1\n-1 -1", "2\n1 2", "2\n4 1"]
NoteIn the second test it is acceptable to print i = 2, j = 3.
Java 7
standard input
[ "greedy" ]
2fa543c8b8f9dc500c36cf719800a6b0
The first line contains integer n (1 ≀ n ≀ 200 000) β€” the length of strings S and T. The second line contains string S. The third line contains string T. Each of the lines only contains lowercase Latin letters.
1,500
In the first line, print number x β€” the minimum possible Hamming distance between strings S and T if you swap at most one pair of letters in S. In the second line, either print the indexes i and j (1 ≀ i, j ≀ n, i ≠ j), if reaching the minimum possible distance is possible by swapping letters on positions i and j, or p...
standard output
PASSED
fe48f7fd6793a0d5df02df9a370763e6
train_000.jsonl
1426610700
Ford Prefect got a job as a web developer for a small company that makes towels. His current work task is to create a search engine for the website of the company. During the development process, he needs to write a subroutine for comparing strings S and T of equal length to be "similar". After a brief search on the In...
256 megabytes
import java.io.BufferedReader; import java.io.InputStreamReader; import java.util.Arrays; import java.util.StringTokenizer; public class TB { public static void main(String[] args) { FastScanner in=new FastScanner(); int i,j,k,n=in.nextInt(); char[] s=in.nextToken().toCharArray(); char[] t=in.nextToken().toC...
Java
["9\npergament\npermanent", "6\nwookie\ncookie", "4\npetr\negor", "6\ndouble\nbundle"]
2 seconds
["1\n4 6", "1\n-1 -1", "2\n1 2", "2\n4 1"]
NoteIn the second test it is acceptable to print i = 2, j = 3.
Java 7
standard input
[ "greedy" ]
2fa543c8b8f9dc500c36cf719800a6b0
The first line contains integer n (1 ≀ n ≀ 200 000) β€” the length of strings S and T. The second line contains string S. The third line contains string T. Each of the lines only contains lowercase Latin letters.
1,500
In the first line, print number x β€” the minimum possible Hamming distance between strings S and T if you swap at most one pair of letters in S. In the second line, either print the indexes i and j (1 ≀ i, j ≀ n, i ≠ j), if reaching the minimum possible distance is possible by swapping letters on positions i and j, or p...
standard output
PASSED
b6cbfcafdac8e408d6c39f9d00bdb75a
train_000.jsonl
1426610700
Ford Prefect got a job as a web developer for a small company that makes towels. His current work task is to create a search engine for the website of the company. During the development process, he needs to write a subroutine for comparing strings S and T of equal length to be "similar". After a brief search on the In...
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 sc = new Scanner(System.in); int...
Java
["9\npergament\npermanent", "6\nwookie\ncookie", "4\npetr\negor", "6\ndouble\nbundle"]
2 seconds
["1\n4 6", "1\n-1 -1", "2\n1 2", "2\n4 1"]
NoteIn the second test it is acceptable to print i = 2, j = 3.
Java 7
standard input
[ "greedy" ]
2fa543c8b8f9dc500c36cf719800a6b0
The first line contains integer n (1 ≀ n ≀ 200 000) β€” the length of strings S and T. The second line contains string S. The third line contains string T. Each of the lines only contains lowercase Latin letters.
1,500
In the first line, print number x β€” the minimum possible Hamming distance between strings S and T if you swap at most one pair of letters in S. In the second line, either print the indexes i and j (1 ≀ i, j ≀ n, i ≠ j), if reaching the minimum possible distance is possible by swapping letters on positions i and j, or p...
standard output
PASSED
5d8657ea175d4e3da619e1855ccf6eda
train_000.jsonl
1426610700
Ford Prefect got a job as a web developer for a small company that makes towels. His current work task is to create a search engine for the website of the company. During the development process, he needs to write a subroutine for comparing strings S and T of equal length to be "similar". After a brief search on the In...
256 megabytes
import java.util.ArrayList; import java.util.Arrays; import java.util.HashMap; import java.util.HashSet; import java.util.Scanner; public class MainB { MyScanner sc = new MyScanner(); Scanner sc2 = new Scanner(System.in); long start = System.currentTimeMillis(); long fin = System.currentTimeMillis(); final int MO...
Java
["9\npergament\npermanent", "6\nwookie\ncookie", "4\npetr\negor", "6\ndouble\nbundle"]
2 seconds
["1\n4 6", "1\n-1 -1", "2\n1 2", "2\n4 1"]
NoteIn the second test it is acceptable to print i = 2, j = 3.
Java 7
standard input
[ "greedy" ]
2fa543c8b8f9dc500c36cf719800a6b0
The first line contains integer n (1 ≀ n ≀ 200 000) β€” the length of strings S and T. The second line contains string S. The third line contains string T. Each of the lines only contains lowercase Latin letters.
1,500
In the first line, print number x β€” the minimum possible Hamming distance between strings S and T if you swap at most one pair of letters in S. In the second line, either print the indexes i and j (1 ≀ i, j ≀ n, i ≠ j), if reaching the minimum possible distance is possible by swapping letters on positions i and j, or p...
standard output
PASSED
1b8184d5c5ce4444908872283a367578
train_000.jsonl
1426610700
Ford Prefect got a job as a web developer for a small company that makes towels. His current work task is to create a search engine for the website of the company. During the development process, he needs to write a subroutine for comparing strings S and T of equal length to be "similar". After a brief search on the In...
256 megabytes
import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; import java.util.HashMap; public class B_Div2_296{ public static void main(String[]arg) throws IOException { new B_Div2_296().solve(); } public void solve() throws IOException { /*HashMap m...
Java
["9\npergament\npermanent", "6\nwookie\ncookie", "4\npetr\negor", "6\ndouble\nbundle"]
2 seconds
["1\n4 6", "1\n-1 -1", "2\n1 2", "2\n4 1"]
NoteIn the second test it is acceptable to print i = 2, j = 3.
Java 7
standard input
[ "greedy" ]
2fa543c8b8f9dc500c36cf719800a6b0
The first line contains integer n (1 ≀ n ≀ 200 000) β€” the length of strings S and T. The second line contains string S. The third line contains string T. Each of the lines only contains lowercase Latin letters.
1,500
In the first line, print number x β€” the minimum possible Hamming distance between strings S and T if you swap at most one pair of letters in S. In the second line, either print the indexes i and j (1 ≀ i, j ≀ n, i ≠ j), if reaching the minimum possible distance is possible by swapping letters on positions i and j, or p...
standard output
PASSED
05b2c2cbb04bdcae12d29f570b5c6795
train_000.jsonl
1426610700
Ford Prefect got a job as a web developer for a small company that makes towels. His current work task is to create a search engine for the website of the company. During the development process, he needs to write a subroutine for comparing strings S and T of equal length to be "similar". After a brief search on the In...
256 megabytes
import java.util.*; import java.io.*; import java.math.*; import java.text.*; public class b { static FastScanner in = new FastScanner(System.in); static StringBuilder sb = new StringBuilder(); static DecimalFormat df = new DecimalFormat(); public static void main(String[] args) { df.setMaximumFractionD...
Java
["9\npergament\npermanent", "6\nwookie\ncookie", "4\npetr\negor", "6\ndouble\nbundle"]
2 seconds
["1\n4 6", "1\n-1 -1", "2\n1 2", "2\n4 1"]
NoteIn the second test it is acceptable to print i = 2, j = 3.
Java 7
standard input
[ "greedy" ]
2fa543c8b8f9dc500c36cf719800a6b0
The first line contains integer n (1 ≀ n ≀ 200 000) β€” the length of strings S and T. The second line contains string S. The third line contains string T. Each of the lines only contains lowercase Latin letters.
1,500
In the first line, print number x β€” the minimum possible Hamming distance between strings S and T if you swap at most one pair of letters in S. In the second line, either print the indexes i and j (1 ≀ i, j ≀ n, i ≠ j), if reaching the minimum possible distance is possible by swapping letters on positions i and j, or p...
standard output
PASSED
bf046da05f031165ebfac669951a605f
train_000.jsonl
1426610700
Ford Prefect got a job as a web developer for a small company that makes towels. His current work task is to create a search engine for the website of the company. During the development process, he needs to write a subroutine for comparing strings S and T of equal length to be "similar". After a brief search on the In...
256 megabytes
//################################################################################################################ import java.io.BufferedWriter; import java.io.IOException; import java.io.InputStream; import java.io.OutputStream; import java.io.OutputStreamWriter; import java.io.PrintWriter; import java.io.Unsupported...
Java
["9\npergament\npermanent", "6\nwookie\ncookie", "4\npetr\negor", "6\ndouble\nbundle"]
2 seconds
["1\n4 6", "1\n-1 -1", "2\n1 2", "2\n4 1"]
NoteIn the second test it is acceptable to print i = 2, j = 3.
Java 7
standard input
[ "greedy" ]
2fa543c8b8f9dc500c36cf719800a6b0
The first line contains integer n (1 ≀ n ≀ 200 000) β€” the length of strings S and T. The second line contains string S. The third line contains string T. Each of the lines only contains lowercase Latin letters.
1,500
In the first line, print number x β€” the minimum possible Hamming distance between strings S and T if you swap at most one pair of letters in S. In the second line, either print the indexes i and j (1 ≀ i, j ≀ n, i ≠ j), if reaching the minimum possible distance is possible by swapping letters on positions i and j, or p...
standard output
PASSED
341d06fc46846cf937e3ab201b6ef27e
train_000.jsonl
1426610700
Ford Prefect got a job as a web developer for a small company that makes towels. His current work task is to create a search engine for the website of the company. During the development process, he needs to write a subroutine for comparing strings S and T of equal length to be "similar". After a brief search on the In...
256 megabytes
import java.io.BufferedReader; import java.io.File; import java.io.FileNotFoundException; import java.io.FileReader; import java.io.IOException; import java.io.InputStream; import java.io.InputStreamReader; import java.io.OutputStream; import java.io.OutputStreamWriter; import java.io.PrintWriter; import java.math.BigI...
Java
["9\npergament\npermanent", "6\nwookie\ncookie", "4\npetr\negor", "6\ndouble\nbundle"]
2 seconds
["1\n4 6", "1\n-1 -1", "2\n1 2", "2\n4 1"]
NoteIn the second test it is acceptable to print i = 2, j = 3.
Java 7
standard input
[ "greedy" ]
2fa543c8b8f9dc500c36cf719800a6b0
The first line contains integer n (1 ≀ n ≀ 200 000) β€” the length of strings S and T. The second line contains string S. The third line contains string T. Each of the lines only contains lowercase Latin letters.
1,500
In the first line, print number x β€” the minimum possible Hamming distance between strings S and T if you swap at most one pair of letters in S. In the second line, either print the indexes i and j (1 ≀ i, j ≀ n, i ≠ j), if reaching the minimum possible distance is possible by swapping letters on positions i and j, or p...
standard output
PASSED
cd6f17bae5d9aeacee09e43ddffb89c7
train_000.jsonl
1426610700
Ford Prefect got a job as a web developer for a small company that makes towels. His current work task is to create a search engine for the website of the company. During the development process, he needs to write a subroutine for comparing strings S and T of equal length to be "similar". After a brief search on the In...
256 megabytes
import java.io.BufferedReader; import java.io.File; import java.io.FileNotFoundException; import java.io.FileReader; import java.io.IOException; import java.io.InputStream; import java.io.InputStreamReader; import java.io.OutputStream; import java.io.OutputStreamWriter; import java.io.PrintWriter; import java.math.BigI...
Java
["9\npergament\npermanent", "6\nwookie\ncookie", "4\npetr\negor", "6\ndouble\nbundle"]
2 seconds
["1\n4 6", "1\n-1 -1", "2\n1 2", "2\n4 1"]
NoteIn the second test it is acceptable to print i = 2, j = 3.
Java 7
standard input
[ "greedy" ]
2fa543c8b8f9dc500c36cf719800a6b0
The first line contains integer n (1 ≀ n ≀ 200 000) β€” the length of strings S and T. The second line contains string S. The third line contains string T. Each of the lines only contains lowercase Latin letters.
1,500
In the first line, print number x β€” the minimum possible Hamming distance between strings S and T if you swap at most one pair of letters in S. In the second line, either print the indexes i and j (1 ≀ i, j ≀ n, i ≠ j), if reaching the minimum possible distance is possible by swapping letters on positions i and j, or p...
standard output