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 | 03d9a80d593fdb926014618fcb9d612c | train_002.jsonl | 1474119900 | ZS the Coder is coding on a crazy computer. If you don't type in a word for a c consecutive seconds, everything you typed disappear! More formally, if you typed a word at second a and then the next word at second b, then if bβ-βaββ€βc, just the new word is appended to other words on the screen. If bβ-βaβ>βc, then eve... | 256 megabytes | import java.util.Scanner;
public class NewMain5 {
public static void main(String[] args) {
// TODO code application logic here
Scanner s = new Scanner(System.in);
int n = s.nextInt();
long c = s.nextLong();
long[] sec = new long[n];
for (int i = 0; i < n; i++) {
... | Java | ["6 5\n1 3 8 14 19 20", "6 1\n1 3 5 7 9 10"] | 2 seconds | ["3", "2"] | NoteThe first sample is already explained in the problem statement.For the second sample, after typing the first word at the second 1, it disappears because the next word is typed at the second 3 and 3β-β1β>β1. Similarly, only 1 word will remain at the second 9. Then, a word is typed at the second 10, so there will ... | Java 8 | standard input | [
"implementation"
] | fb58bc3be4a7a78bdc001298d35c6b21 | The first line contains two integers n and c (1ββ€βnββ€β100β000,β1ββ€βcββ€β109)Β β the number of words ZS the Coder typed and the crazy computer delay respectively. The next line contains n integers t1,βt2,β...,βtn (1ββ€βt1β<βt2β<β...β<βtnββ€β109), where ti denotes the second when ZS the Coder typed the i-th word. | 800 | Print a single positive integer, the number of words that remain on the screen after all n words was typed, in other words, at the second tn. | standard output | |
PASSED | 162e7de556f76efbac7ae2e4eea4eff6 | train_002.jsonl | 1474119900 | ZS the Coder is coding on a crazy computer. If you don't type in a word for a c consecutive seconds, everything you typed disappear! More formally, if you typed a word at second a and then the next word at second b, then if bβ-βaββ€βc, just the new word is appended to other words on the screen. If bβ-βaβ>βc, then eve... | 256 megabytes | import java.util.Scanner;;
public class CrazyComputer_716A {
public static void main(String... args) {
Scanner input = new Scanner(System.in);
int n = input.nextInt();
int c = input.nextInt();
int total = 0;
int prev = 0;
for (int i = 0; i < n; i++) {
int curr = input.nextInt();
if (curr - prev > c)... | Java | ["6 5\n1 3 8 14 19 20", "6 1\n1 3 5 7 9 10"] | 2 seconds | ["3", "2"] | NoteThe first sample is already explained in the problem statement.For the second sample, after typing the first word at the second 1, it disappears because the next word is typed at the second 3 and 3β-β1β>β1. Similarly, only 1 word will remain at the second 9. Then, a word is typed at the second 10, so there will ... | Java 8 | standard input | [
"implementation"
] | fb58bc3be4a7a78bdc001298d35c6b21 | The first line contains two integers n and c (1ββ€βnββ€β100β000,β1ββ€βcββ€β109)Β β the number of words ZS the Coder typed and the crazy computer delay respectively. The next line contains n integers t1,βt2,β...,βtn (1ββ€βt1β<βt2β<β...β<βtnββ€β109), where ti denotes the second when ZS the Coder typed the i-th word. | 800 | Print a single positive integer, the number of words that remain on the screen after all n words was typed, in other words, at the second tn. | standard output | |
PASSED | ff84859aabd89e43134597f6a171ad60 | train_002.jsonl | 1474119900 | ZS the Coder is coding on a crazy computer. If you don't type in a word for a c consecutive seconds, everything you typed disappear! More formally, if you typed a word at second a and then the next word at second b, then if bβ-βaββ€βc, just the new word is appended to other words on the screen. If bβ-βaβ>βc, then eve... | 256 megabytes | import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.StringTokenizer;
public class C372 {
public static void main(String[] args) throws IOException{
BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
StringTokenizer st ... | Java | ["6 5\n1 3 8 14 19 20", "6 1\n1 3 5 7 9 10"] | 2 seconds | ["3", "2"] | NoteThe first sample is already explained in the problem statement.For the second sample, after typing the first word at the second 1, it disappears because the next word is typed at the second 3 and 3β-β1β>β1. Similarly, only 1 word will remain at the second 9. Then, a word is typed at the second 10, so there will ... | Java 8 | standard input | [
"implementation"
] | fb58bc3be4a7a78bdc001298d35c6b21 | The first line contains two integers n and c (1ββ€βnββ€β100β000,β1ββ€βcββ€β109)Β β the number of words ZS the Coder typed and the crazy computer delay respectively. The next line contains n integers t1,βt2,β...,βtn (1ββ€βt1β<βt2β<β...β<βtnββ€β109), where ti denotes the second when ZS the Coder typed the i-th word. | 800 | Print a single positive integer, the number of words that remain on the screen after all n words was typed, in other words, at the second tn. | standard output | |
PASSED | 1118c9a148e42180fe5b2d07cd46ddd1 | train_002.jsonl | 1474119900 | ZS the Coder is coding on a crazy computer. If you don't type in a word for a c consecutive seconds, everything you typed disappear! More formally, if you typed a word at second a and then the next word at second b, then if bβ-βaββ€βc, just the new word is appended to other words on the screen. If bβ-βaβ>βc, then eve... | 256 megabytes | import java.io.OutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.util.StringTokenizer;
import java.io.IOException;
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.io.InputStream;
/**
* Built using CHelper plug-in
* Actual soluti... | Java | ["6 5\n1 3 8 14 19 20", "6 1\n1 3 5 7 9 10"] | 2 seconds | ["3", "2"] | NoteThe first sample is already explained in the problem statement.For the second sample, after typing the first word at the second 1, it disappears because the next word is typed at the second 3 and 3β-β1β>β1. Similarly, only 1 word will remain at the second 9. Then, a word is typed at the second 10, so there will ... | Java 8 | standard input | [
"implementation"
] | fb58bc3be4a7a78bdc001298d35c6b21 | The first line contains two integers n and c (1ββ€βnββ€β100β000,β1ββ€βcββ€β109)Β β the number of words ZS the Coder typed and the crazy computer delay respectively. The next line contains n integers t1,βt2,β...,βtn (1ββ€βt1β<βt2β<β...β<βtnββ€β109), where ti denotes the second when ZS the Coder typed the i-th word. | 800 | Print a single positive integer, the number of words that remain on the screen after all n words was typed, in other words, at the second tn. | standard output | |
PASSED | 8e0f2414b218b1e12de4405e79ed25fa | train_002.jsonl | 1474119900 | ZS the Coder is coding on a crazy computer. If you don't type in a word for a c consecutive seconds, everything you typed disappear! More formally, if you typed a word at second a and then the next word at second b, then if bβ-βaββ€βc, just the new word is appended to other words on the screen. If bβ-βaβ>βc, then eve... | 256 megabytes | import java.util.Scanner;
public class kk {
public static void main(String args[])
{
int n,c;
Scanner sc=new Scanner(System.in);
n=sc.nextInt();
c=sc.nextInt();
// System.out.println(n+" "+c);
int arr[]=new int[n];
int words=1;
for(int k=0;k<n;k++)... | Java | ["6 5\n1 3 8 14 19 20", "6 1\n1 3 5 7 9 10"] | 2 seconds | ["3", "2"] | NoteThe first sample is already explained in the problem statement.For the second sample, after typing the first word at the second 1, it disappears because the next word is typed at the second 3 and 3β-β1β>β1. Similarly, only 1 word will remain at the second 9. Then, a word is typed at the second 10, so there will ... | Java 8 | standard input | [
"implementation"
] | fb58bc3be4a7a78bdc001298d35c6b21 | The first line contains two integers n and c (1ββ€βnββ€β100β000,β1ββ€βcββ€β109)Β β the number of words ZS the Coder typed and the crazy computer delay respectively. The next line contains n integers t1,βt2,β...,βtn (1ββ€βt1β<βt2β<β...β<βtnββ€β109), where ti denotes the second when ZS the Coder typed the i-th word. | 800 | Print a single positive integer, the number of words that remain on the screen after all n words was typed, in other words, at the second tn. | standard output | |
PASSED | 4211f4085cf5f58c50e0053607085f60 | train_002.jsonl | 1474119900 | ZS the Coder is coding on a crazy computer. If you don't type in a word for a c consecutive seconds, everything you typed disappear! More formally, if you typed a word at second a and then the next word at second b, then if bβ-βaββ€βc, just the new word is appended to other words on the screen. If bβ-βaβ>βc, then eve... | 256 megabytes | import java.util.Scanner;
public class Test {
public static void main(String[] args) {
Scanner in = new Scanner(System.in);
int n = in.nextInt();
int c = in.nextInt();
int[] arr = new int[n];
for (int i = 0; i < n; i++) {
arr[i] = in.nextInt();
}
int count = 1;
for (int i = 1; i < n; i++) {
if... | Java | ["6 5\n1 3 8 14 19 20", "6 1\n1 3 5 7 9 10"] | 2 seconds | ["3", "2"] | NoteThe first sample is already explained in the problem statement.For the second sample, after typing the first word at the second 1, it disappears because the next word is typed at the second 3 and 3β-β1β>β1. Similarly, only 1 word will remain at the second 9. Then, a word is typed at the second 10, so there will ... | Java 8 | standard input | [
"implementation"
] | fb58bc3be4a7a78bdc001298d35c6b21 | The first line contains two integers n and c (1ββ€βnββ€β100β000,β1ββ€βcββ€β109)Β β the number of words ZS the Coder typed and the crazy computer delay respectively. The next line contains n integers t1,βt2,β...,βtn (1ββ€βt1β<βt2β<β...β<βtnββ€β109), where ti denotes the second when ZS the Coder typed the i-th word. | 800 | Print a single positive integer, the number of words that remain on the screen after all n words was typed, in other words, at the second tn. | standard output | |
PASSED | e7123ade342e644a36f3b8efb2507a27 | train_002.jsonl | 1474119900 | ZS the Coder is coding on a crazy computer. If you don't type in a word for a c consecutive seconds, everything you typed disappear! More formally, if you typed a word at second a and then the next word at second b, then if bβ-βaββ€βc, just the new word is appended to other words on the screen. If bβ-βaβ>βc, then eve... | 256 megabytes | import java.util.Scanner;
public class Game{
public static void main(String arg[]){
Scanner sc=new Scanner(System.in);
int n=sc.nextInt();
int c=sc.nextInt();
int[] arr=new int[n];
arr[0]=sc.nextInt();
int count=1;
for(int i=1;i<n;i++){
arr[i]=sc.nextInt();
int temp=arr[i]-arr[i-1];
count++;
if(temp>c)... | Java | ["6 5\n1 3 8 14 19 20", "6 1\n1 3 5 7 9 10"] | 2 seconds | ["3", "2"] | NoteThe first sample is already explained in the problem statement.For the second sample, after typing the first word at the second 1, it disappears because the next word is typed at the second 3 and 3β-β1β>β1. Similarly, only 1 word will remain at the second 9. Then, a word is typed at the second 10, so there will ... | Java 8 | standard input | [
"implementation"
] | fb58bc3be4a7a78bdc001298d35c6b21 | The first line contains two integers n and c (1ββ€βnββ€β100β000,β1ββ€βcββ€β109)Β β the number of words ZS the Coder typed and the crazy computer delay respectively. The next line contains n integers t1,βt2,β...,βtn (1ββ€βt1β<βt2β<β...β<βtnββ€β109), where ti denotes the second when ZS the Coder typed the i-th word. | 800 | Print a single positive integer, the number of words that remain on the screen after all n words was typed, in other words, at the second tn. | standard output | |
PASSED | 94cf9de35891b31dc535e3b28893e071 | train_002.jsonl | 1474119900 | ZS the Coder is coding on a crazy computer. If you don't type in a word for a c consecutive seconds, everything you typed disappear! More formally, if you typed a word at second a and then the next word at second b, then if bβ-βaββ€βc, just the new word is appended to other words on the screen. If bβ-βaβ>βc, then eve... | 256 megabytes | import java.util.*;
import java.lang.*;
public class JavaApplication4 {
public static void main(String[] args){
Scanner sc = new Scanner(System.in);
int a= sc.nextInt();
int b=sc.nextInt();
int[] c= new int[a];
for(int i=0;i<a;i++){
c[i]=sc.nextInt();
}
... | Java | ["6 5\n1 3 8 14 19 20", "6 1\n1 3 5 7 9 10"] | 2 seconds | ["3", "2"] | NoteThe first sample is already explained in the problem statement.For the second sample, after typing the first word at the second 1, it disappears because the next word is typed at the second 3 and 3β-β1β>β1. Similarly, only 1 word will remain at the second 9. Then, a word is typed at the second 10, so there will ... | Java 8 | standard input | [
"implementation"
] | fb58bc3be4a7a78bdc001298d35c6b21 | The first line contains two integers n and c (1ββ€βnββ€β100β000,β1ββ€βcββ€β109)Β β the number of words ZS the Coder typed and the crazy computer delay respectively. The next line contains n integers t1,βt2,β...,βtn (1ββ€βt1β<βt2β<β...β<βtnββ€β109), where ti denotes the second when ZS the Coder typed the i-th word. | 800 | Print a single positive integer, the number of words that remain on the screen after all n words was typed, in other words, at the second tn. | standard output | |
PASSED | 29028c15c9c67e4bfb0ce1f8726af811 | train_002.jsonl | 1474119900 | ZS the Coder is coding on a crazy computer. If you don't type in a word for a c consecutive seconds, everything you typed disappear! More formally, if you typed a word at second a and then the next word at second b, then if bβ-βaββ€βc, just the new word is appended to other words on the screen. If bβ-βaβ>βc, then eve... | 256 megabytes |
import java.util.Scanner;
public class Main {
public static void main(String[] args) {
Scanner sc=new Scanner(System.in);
int a=sc.nextInt();
int b=sc.nextInt();
int A[]=new int[a];
int count=1;
for (int i... | Java | ["6 5\n1 3 8 14 19 20", "6 1\n1 3 5 7 9 10"] | 2 seconds | ["3", "2"] | NoteThe first sample is already explained in the problem statement.For the second sample, after typing the first word at the second 1, it disappears because the next word is typed at the second 3 and 3β-β1β>β1. Similarly, only 1 word will remain at the second 9. Then, a word is typed at the second 10, so there will ... | Java 8 | standard input | [
"implementation"
] | fb58bc3be4a7a78bdc001298d35c6b21 | The first line contains two integers n and c (1ββ€βnββ€β100β000,β1ββ€βcββ€β109)Β β the number of words ZS the Coder typed and the crazy computer delay respectively. The next line contains n integers t1,βt2,β...,βtn (1ββ€βt1β<βt2β<β...β<βtnββ€β109), where ti denotes the second when ZS the Coder typed the i-th word. | 800 | Print a single positive integer, the number of words that remain on the screen after all n words was typed, in other words, at the second tn. | standard output | |
PASSED | 0a15011c8564d6c58c8ec7e4ff51135c | train_002.jsonl | 1474119900 | ZS the Coder is coding on a crazy computer. If you don't type in a word for a c consecutive seconds, everything you typed disappear! More formally, if you typed a word at second a and then the next word at second b, then if bβ-βaββ€βc, just the new word is appended to other words on the screen. If bβ-βaβ>βc, then eve... | 256 megabytes | import java.util.Scanner;
public class Main {
public static void main(String[] args) {
Scanner sc=new Scanner(System.in);
int a=sc.nextInt();
int b=sc.nextInt();
int A[]=new int[a];
int count=1;
for (int i = ... | Java | ["6 5\n1 3 8 14 19 20", "6 1\n1 3 5 7 9 10"] | 2 seconds | ["3", "2"] | NoteThe first sample is already explained in the problem statement.For the second sample, after typing the first word at the second 1, it disappears because the next word is typed at the second 3 and 3β-β1β>β1. Similarly, only 1 word will remain at the second 9. Then, a word is typed at the second 10, so there will ... | Java 8 | standard input | [
"implementation"
] | fb58bc3be4a7a78bdc001298d35c6b21 | The first line contains two integers n and c (1ββ€βnββ€β100β000,β1ββ€βcββ€β109)Β β the number of words ZS the Coder typed and the crazy computer delay respectively. The next line contains n integers t1,βt2,β...,βtn (1ββ€βt1β<βt2β<β...β<βtnββ€β109), where ti denotes the second when ZS the Coder typed the i-th word. | 800 | Print a single positive integer, the number of words that remain on the screen after all n words was typed, in other words, at the second tn. | standard output | |
PASSED | 485a7a5be071859d3e228c44ef7337fd | train_002.jsonl | 1474119900 | ZS the Coder is coding on a crazy computer. If you don't type in a word for a c consecutive seconds, everything you typed disappear! More formally, if you typed a word at second a and then the next word at second b, then if bβ-βaββ€βc, just the new word is appended to other words on the screen. If bβ-βaβ>βc, then eve... | 256 megabytes | import java.util.Scanner;
public class R372A {
public static void main(String[] args) {
Scanner scan = new Scanner(System.in);
int x = scan.nextInt(), k = scan.nextInt();
int[] nums = new int[x];
for (int i = 0; i < nums.length; ++i) {
nums[i] = scan.nextInt();
}
int count = 0;
for (int i = 0; i < n... | Java | ["6 5\n1 3 8 14 19 20", "6 1\n1 3 5 7 9 10"] | 2 seconds | ["3", "2"] | NoteThe first sample is already explained in the problem statement.For the second sample, after typing the first word at the second 1, it disappears because the next word is typed at the second 3 and 3β-β1β>β1. Similarly, only 1 word will remain at the second 9. Then, a word is typed at the second 10, so there will ... | Java 8 | standard input | [
"implementation"
] | fb58bc3be4a7a78bdc001298d35c6b21 | The first line contains two integers n and c (1ββ€βnββ€β100β000,β1ββ€βcββ€β109)Β β the number of words ZS the Coder typed and the crazy computer delay respectively. The next line contains n integers t1,βt2,β...,βtn (1ββ€βt1β<βt2β<β...β<βtnββ€β109), where ti denotes the second when ZS the Coder typed the i-th word. | 800 | Print a single positive integer, the number of words that remain on the screen after all n words was typed, in other words, at the second tn. | standard output | |
PASSED | ae8bd22a93302666da376e1923e80171 | train_002.jsonl | 1474119900 | ZS the Coder is coding on a crazy computer. If you don't type in a word for a c consecutive seconds, everything you typed disappear! More formally, if you typed a word at second a and then the next word at second b, then if bβ-βaββ€βc, just the new word is appended to other words on the screen. If bβ-βaβ>βc, then eve... | 256 megabytes |
import java.io.*;
import java.util.StringTokenizer;
public class CrazyComputer {
public static void main(String[] args) throws IOException {
BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
StringTokenizer st = new StringTokenizer(br.readLine());
int n = Integer.parseInt(st.nextToken());
... | Java | ["6 5\n1 3 8 14 19 20", "6 1\n1 3 5 7 9 10"] | 2 seconds | ["3", "2"] | NoteThe first sample is already explained in the problem statement.For the second sample, after typing the first word at the second 1, it disappears because the next word is typed at the second 3 and 3β-β1β>β1. Similarly, only 1 word will remain at the second 9. Then, a word is typed at the second 10, so there will ... | Java 8 | standard input | [
"implementation"
] | fb58bc3be4a7a78bdc001298d35c6b21 | The first line contains two integers n and c (1ββ€βnββ€β100β000,β1ββ€βcββ€β109)Β β the number of words ZS the Coder typed and the crazy computer delay respectively. The next line contains n integers t1,βt2,β...,βtn (1ββ€βt1β<βt2β<β...β<βtnββ€β109), where ti denotes the second when ZS the Coder typed the i-th word. | 800 | Print a single positive integer, the number of words that remain on the screen after all n words was typed, in other words, at the second tn. | standard output | |
PASSED | 94133779472d960643cbf422c93d6167 | train_002.jsonl | 1474119900 | ZS the Coder is coding on a crazy computer. If you don't type in a word for a c consecutive seconds, everything you typed disappear! More formally, if you typed a word at second a and then the next word at second b, then if bβ-βaββ€βc, just the new word is appended to other words on the screen. If bβ-βaβ>βc, then eve... | 256 megabytes |
import java.util.Scanner;
public class Main {
public static void main(String[] args) {
Scanner s = new Scanner(System.in);
int c = s.nextInt();
int se = s.nextInt();
int coun = 1;
int[] a = new int[c];
for (int i = 0; i < c; i++) {
a[i] = s.nextInt();... | Java | ["6 5\n1 3 8 14 19 20", "6 1\n1 3 5 7 9 10"] | 2 seconds | ["3", "2"] | NoteThe first sample is already explained in the problem statement.For the second sample, after typing the first word at the second 1, it disappears because the next word is typed at the second 3 and 3β-β1β>β1. Similarly, only 1 word will remain at the second 9. Then, a word is typed at the second 10, so there will ... | Java 8 | standard input | [
"implementation"
] | fb58bc3be4a7a78bdc001298d35c6b21 | The first line contains two integers n and c (1ββ€βnββ€β100β000,β1ββ€βcββ€β109)Β β the number of words ZS the Coder typed and the crazy computer delay respectively. The next line contains n integers t1,βt2,β...,βtn (1ββ€βt1β<βt2β<β...β<βtnββ€β109), where ti denotes the second when ZS the Coder typed the i-th word. | 800 | Print a single positive integer, the number of words that remain on the screen after all n words was typed, in other words, at the second tn. | standard output | |
PASSED | 032b6d678f33621d2cdd3f31b0286540 | train_002.jsonl | 1533307500 | Now Vasya is taking an exam in mathematics. In order to get a good mark, Vasya needs to guess the matrix that the teacher has constructed!Vasya knows that the matrix consists of n rows and m columns. For each row, he knows the xor (bitwise excluding or) of the elements in this row. The sequence a1,βa2,β...,βan denotes ... | 256 megabytes | import java.io.*;
import java.math.BigInteger;
import java.util.*;
public class Main implements Runnable {
int maxn = (int)1e2+111;
int n,m,k;
int a[][] = new int[maxn][maxn];
int row[] = new int[maxn];
int col[] = new int[maxn];
void solve() throws Exception {
n = in.nextInt();
... | Java | ["2 3\n2 9\n5 3 13", "3 3\n1 7 6\n2 15 12"] | 2 seconds | ["YES\n3 4 5\n6 7 8", "NO"] | null | Java 8 | standard input | [
"constructive algorithms",
"flows",
"math"
] | 3815d18843dbd15a73383d69eb6880dd | The first line contains two numbers n and mΒ (2ββ€βn,βmββ€β100) β the dimensions of the matrix. The second line contains n numbers a1,βa2,β...,βanΒ (0ββ€βaiββ€β109), where ai is the xor of all elements in row i. The third line contains m numbers b1,βb2,β...,βbmΒ (0ββ€βbiββ€β109), where bi is the xor of all elements in column i. | 1,800 | If there is no matrix satisfying the given constraints in the first line, output "NO". Otherwise, on the first line output "YES", and then n rows of m numbers in each ci1,βci2,β... ,βcimΒ (0ββ€βcijββ€β2Β·109) β the description of the matrix. If there are several suitable matrices, it is allowed to print any of them. | standard output | |
PASSED | 5ab7e736edc9a2e59ec3f2c1501c0cfe | train_002.jsonl | 1533307500 | Now Vasya is taking an exam in mathematics. In order to get a good mark, Vasya needs to guess the matrix that the teacher has constructed!Vasya knows that the matrix consists of n rows and m columns. For each row, he knows the xor (bitwise excluding or) of the elements in this row. The sequence a1,βa2,β...,βan denotes ... | 256 megabytes | import java.io.OutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import java.io.PrintWriter;
import java.io.BufferedWriter;
import java.io.Writer;
import java.io.OutputStreamWriter;
import java.util.InputMismatchException;
import java.io.IOException;
import java.io.Input... | Java | ["2 3\n2 9\n5 3 13", "3 3\n1 7 6\n2 15 12"] | 2 seconds | ["YES\n3 4 5\n6 7 8", "NO"] | null | Java 8 | standard input | [
"constructive algorithms",
"flows",
"math"
] | 3815d18843dbd15a73383d69eb6880dd | The first line contains two numbers n and mΒ (2ββ€βn,βmββ€β100) β the dimensions of the matrix. The second line contains n numbers a1,βa2,β...,βanΒ (0ββ€βaiββ€β109), where ai is the xor of all elements in row i. The third line contains m numbers b1,βb2,β...,βbmΒ (0ββ€βbiββ€β109), where bi is the xor of all elements in column i. | 1,800 | If there is no matrix satisfying the given constraints in the first line, output "NO". Otherwise, on the first line output "YES", and then n rows of m numbers in each ci1,βci2,β... ,βcimΒ (0ββ€βcijββ€β2Β·109) β the description of the matrix. If there are several suitable matrices, it is allowed to print any of them. | standard output | |
PASSED | 111e9adbb3cbe28cbabf47f2a5f8c568 | train_002.jsonl | 1533307500 | Now Vasya is taking an exam in mathematics. In order to get a good mark, Vasya needs to guess the matrix that the teacher has constructed!Vasya knows that the matrix consists of n rows and m columns. For each row, he knows the xor (bitwise excluding or) of the elements in this row. The sequence a1,βa2,β...,βan denotes ... | 256 megabytes | import java.io.*;
import java.util.*;
public class Main {
public static void main(String[] args) throws Exception {
BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
PrintWriter out = new PrintWriter(System.out);
StringTokenizer st = new StringTokenizer(in.readLine(... | Java | ["2 3\n2 9\n5 3 13", "3 3\n1 7 6\n2 15 12"] | 2 seconds | ["YES\n3 4 5\n6 7 8", "NO"] | null | Java 8 | standard input | [
"constructive algorithms",
"flows",
"math"
] | 3815d18843dbd15a73383d69eb6880dd | The first line contains two numbers n and mΒ (2ββ€βn,βmββ€β100) β the dimensions of the matrix. The second line contains n numbers a1,βa2,β...,βanΒ (0ββ€βaiββ€β109), where ai is the xor of all elements in row i. The third line contains m numbers b1,βb2,β...,βbmΒ (0ββ€βbiββ€β109), where bi is the xor of all elements in column i. | 1,800 | If there is no matrix satisfying the given constraints in the first line, output "NO". Otherwise, on the first line output "YES", and then n rows of m numbers in each ci1,βci2,β... ,βcimΒ (0ββ€βcijββ€β2Β·109) β the description of the matrix. If there are several suitable matrices, it is allowed to print any of them. | standard output | |
PASSED | f066a532a67bdcb04e8485487943645a | train_002.jsonl | 1533307500 | Now Vasya is taking an exam in mathematics. In order to get a good mark, Vasya needs to guess the matrix that the teacher has constructed!Vasya knows that the matrix consists of n rows and m columns. For each row, he knows the xor (bitwise excluding or) of the elements in this row. The sequence a1,βa2,β...,βan denotes ... | 256 megabytes | import java.util.*;
import java.io.*;
import java.lang.*;
import java.math.*;
import static java.lang.Math.*;
import java.util.concurrent.ThreadLocalRandom;
public class Sol implements Runnable {
long mod = (long)1e9 + 7;
void solve(InputReader in, PrintWriter w) {
int n = in.nextInt();
int ... | Java | ["2 3\n2 9\n5 3 13", "3 3\n1 7 6\n2 15 12"] | 2 seconds | ["YES\n3 4 5\n6 7 8", "NO"] | null | Java 8 | standard input | [
"constructive algorithms",
"flows",
"math"
] | 3815d18843dbd15a73383d69eb6880dd | The first line contains two numbers n and mΒ (2ββ€βn,βmββ€β100) β the dimensions of the matrix. The second line contains n numbers a1,βa2,β...,βanΒ (0ββ€βaiββ€β109), where ai is the xor of all elements in row i. The third line contains m numbers b1,βb2,β...,βbmΒ (0ββ€βbiββ€β109), where bi is the xor of all elements in column i. | 1,800 | If there is no matrix satisfying the given constraints in the first line, output "NO". Otherwise, on the first line output "YES", and then n rows of m numbers in each ci1,βci2,β... ,βcimΒ (0ββ€βcijββ€β2Β·109) β the description of the matrix. If there are several suitable matrices, it is allowed to print any of them. | standard output | |
PASSED | 659b422cce3b2f04a7ac0457fa471af1 | train_002.jsonl | 1533307500 | Now Vasya is taking an exam in mathematics. In order to get a good mark, Vasya needs to guess the matrix that the teacher has constructed!Vasya knows that the matrix consists of n rows and m columns. For each row, he knows the xor (bitwise excluding or) of the elements in this row. The sequence a1,βa2,β...,βan denotes ... | 256 megabytes | import java.io.*;
import java.math.*;
import java.util.*;
import static java.util.Arrays.fill;
import static java.lang.Math.*;
import static java.util.Arrays.sort;
import static java.util.Collections.sort;
public class D {
public static int mod = 1000000007;
public static long INF = (1L << 60);
static FastScanner... | Java | ["2 3\n2 9\n5 3 13", "3 3\n1 7 6\n2 15 12"] | 2 seconds | ["YES\n3 4 5\n6 7 8", "NO"] | null | Java 8 | standard input | [
"constructive algorithms",
"flows",
"math"
] | 3815d18843dbd15a73383d69eb6880dd | The first line contains two numbers n and mΒ (2ββ€βn,βmββ€β100) β the dimensions of the matrix. The second line contains n numbers a1,βa2,β...,βanΒ (0ββ€βaiββ€β109), where ai is the xor of all elements in row i. The third line contains m numbers b1,βb2,β...,βbmΒ (0ββ€βbiββ€β109), where bi is the xor of all elements in column i. | 1,800 | If there is no matrix satisfying the given constraints in the first line, output "NO". Otherwise, on the first line output "YES", and then n rows of m numbers in each ci1,βci2,β... ,βcimΒ (0ββ€βcijββ€β2Β·109) β the description of the matrix. If there are several suitable matrices, it is allowed to print any of them. | standard output | |
PASSED | ab1a297feb028e50767fae054df498fa | train_002.jsonl | 1533307500 | Now Vasya is taking an exam in mathematics. In order to get a good mark, Vasya needs to guess the matrix that the teacher has constructed!Vasya knows that the matrix consists of n rows and m columns. For each row, he knows the xor (bitwise excluding or) of the elements in this row. The sequence a1,βa2,β...,βan denotes ... | 256 megabytes | import java.util.*;
public class myClass{
public static void main(String[] args) {
// Use the Scanner class
Scanner sc = new Scanner(System.in);
/*
int n = sc.nextInt(); // read input as integer
long k = sc.nextLong(); // read input as long
double d = s... | Java | ["2 3\n2 9\n5 3 13", "3 3\n1 7 6\n2 15 12"] | 2 seconds | ["YES\n3 4 5\n6 7 8", "NO"] | null | Java 8 | standard input | [
"constructive algorithms",
"flows",
"math"
] | 3815d18843dbd15a73383d69eb6880dd | The first line contains two numbers n and mΒ (2ββ€βn,βmββ€β100) β the dimensions of the matrix. The second line contains n numbers a1,βa2,β...,βanΒ (0ββ€βaiββ€β109), where ai is the xor of all elements in row i. The third line contains m numbers b1,βb2,β...,βbmΒ (0ββ€βbiββ€β109), where bi is the xor of all elements in column i. | 1,800 | If there is no matrix satisfying the given constraints in the first line, output "NO". Otherwise, on the first line output "YES", and then n rows of m numbers in each ci1,βci2,β... ,βcimΒ (0ββ€βcijββ€β2Β·109) β the description of the matrix. If there are several suitable matrices, it is allowed to print any of them. | standard output | |
PASSED | 07fdd94ed1d1e299e3e577ca5913d710 | train_002.jsonl | 1533307500 | Now Vasya is taking an exam in mathematics. In order to get a good mark, Vasya needs to guess the matrix that the teacher has constructed!Vasya knows that the matrix consists of n rows and m columns. For each row, he knows the xor (bitwise excluding or) of the elements in this row. The sequence a1,βa2,β...,βan denotes ... | 256 megabytes | import java.io.*;
import java.util.*;
public class Main {
static InputReader in = new InputReader(System.in);
static PrintWriter out = new PrintWriter(System.out);
static long oo = (long)1e15;
public static void main(String[] args) throws IOException {
int n = in.nextInt();
int m = in.nextInt();
... | Java | ["2 3\n2 9\n5 3 13", "3 3\n1 7 6\n2 15 12"] | 2 seconds | ["YES\n3 4 5\n6 7 8", "NO"] | null | Java 8 | standard input | [
"constructive algorithms",
"flows",
"math"
] | 3815d18843dbd15a73383d69eb6880dd | The first line contains two numbers n and mΒ (2ββ€βn,βmββ€β100) β the dimensions of the matrix. The second line contains n numbers a1,βa2,β...,βanΒ (0ββ€βaiββ€β109), where ai is the xor of all elements in row i. The third line contains m numbers b1,βb2,β...,βbmΒ (0ββ€βbiββ€β109), where bi is the xor of all elements in column i. | 1,800 | If there is no matrix satisfying the given constraints in the first line, output "NO". Otherwise, on the first line output "YES", and then n rows of m numbers in each ci1,βci2,β... ,βcimΒ (0ββ€βcijββ€β2Β·109) β the description of the matrix. If there are several suitable matrices, it is allowed to print any of them. | standard output | |
PASSED | 98391adcb3d261512596cf65da6018e5 | train_002.jsonl | 1533307500 | Now Vasya is taking an exam in mathematics. In order to get a good mark, Vasya needs to guess the matrix that the teacher has constructed!Vasya knows that the matrix consists of n rows and m columns. For each row, he knows the xor (bitwise excluding or) of the elements in this row. The sequence a1,βa2,β...,βan denotes ... | 256 megabytes | import java.util.*;
import java.io.*;
public class A
{
public static void main(String ar[]) throws Exception
{
BufferedReader br=new BufferedReader(new InputStreamReader(System.in));
String s1[]=br.readLine().split(" ");
int n=Integer.parseInt(s1[0]);
int m=In... | Java | ["2 3\n2 9\n5 3 13", "3 3\n1 7 6\n2 15 12"] | 2 seconds | ["YES\n3 4 5\n6 7 8", "NO"] | null | Java 8 | standard input | [
"constructive algorithms",
"flows",
"math"
] | 3815d18843dbd15a73383d69eb6880dd | The first line contains two numbers n and mΒ (2ββ€βn,βmββ€β100) β the dimensions of the matrix. The second line contains n numbers a1,βa2,β...,βanΒ (0ββ€βaiββ€β109), where ai is the xor of all elements in row i. The third line contains m numbers b1,βb2,β...,βbmΒ (0ββ€βbiββ€β109), where bi is the xor of all elements in column i. | 1,800 | If there is no matrix satisfying the given constraints in the first line, output "NO". Otherwise, on the first line output "YES", and then n rows of m numbers in each ci1,βci2,β... ,βcimΒ (0ββ€βcijββ€β2Β·109) β the description of the matrix. If there are several suitable matrices, it is allowed to print any of them. | standard output | |
PASSED | 8646e96c238d04b444d2b2fc9e23d15d | train_002.jsonl | 1533307500 | Now Vasya is taking an exam in mathematics. In order to get a good mark, Vasya needs to guess the matrix that the teacher has constructed!Vasya knows that the matrix consists of n rows and m columns. For each row, he knows the xor (bitwise excluding or) of the elements in this row. The sequence a1,βa2,β...,βan denotes ... | 256 megabytes | import java.lang.*;
import java.util.*;
import java.io.*;
import java.math.*;
public class Main {
private static FastReader sc = new FastReader(System.in);
private static OutputWriter out = new OutputWriter(System.out);
public static void main(String[] args) {
int r = sc.nextInt();
int c =... | Java | ["2 3\n2 9\n5 3 13", "3 3\n1 7 6\n2 15 12"] | 2 seconds | ["YES\n3 4 5\n6 7 8", "NO"] | null | Java 8 | standard input | [
"constructive algorithms",
"flows",
"math"
] | 3815d18843dbd15a73383d69eb6880dd | The first line contains two numbers n and mΒ (2ββ€βn,βmββ€β100) β the dimensions of the matrix. The second line contains n numbers a1,βa2,β...,βanΒ (0ββ€βaiββ€β109), where ai is the xor of all elements in row i. The third line contains m numbers b1,βb2,β...,βbmΒ (0ββ€βbiββ€β109), where bi is the xor of all elements in column i. | 1,800 | If there is no matrix satisfying the given constraints in the first line, output "NO". Otherwise, on the first line output "YES", and then n rows of m numbers in each ci1,βci2,β... ,βcimΒ (0ββ€βcijββ€β2Β·109) β the description of the matrix. If there are several suitable matrices, it is allowed to print any of them. | standard output | |
PASSED | 82340ba846c20a60c12fb901a138574b | train_002.jsonl | 1533307500 | Now Vasya is taking an exam in mathematics. In order to get a good mark, Vasya needs to guess the matrix that the teacher has constructed!Vasya knows that the matrix consists of n rows and m columns. For each row, he knows the xor (bitwise excluding or) of the elements in this row. The sequence a1,βa2,β...,βan denotes ... | 256 megabytes | import java.util.*;
public class D {
public Object solve() {
int N = sc.nextInt(), M = sc.nextInt();
long [] R = sc.nextLongs(), C = sc.nextLongs();
long [][] res = new long [N][M];
for (int b : rep(50)) {
int [] r = new int [N], c = new int[M];
for (int i : rep(N))
r[i] = has(R[i], b) ? 1 : 0;
... | Java | ["2 3\n2 9\n5 3 13", "3 3\n1 7 6\n2 15 12"] | 2 seconds | ["YES\n3 4 5\n6 7 8", "NO"] | null | Java 8 | standard input | [
"constructive algorithms",
"flows",
"math"
] | 3815d18843dbd15a73383d69eb6880dd | The first line contains two numbers n and mΒ (2ββ€βn,βmββ€β100) β the dimensions of the matrix. The second line contains n numbers a1,βa2,β...,βanΒ (0ββ€βaiββ€β109), where ai is the xor of all elements in row i. The third line contains m numbers b1,βb2,β...,βbmΒ (0ββ€βbiββ€β109), where bi is the xor of all elements in column i. | 1,800 | If there is no matrix satisfying the given constraints in the first line, output "NO". Otherwise, on the first line output "YES", and then n rows of m numbers in each ci1,βci2,β... ,βcimΒ (0ββ€βcijββ€β2Β·109) β the description of the matrix. If there are several suitable matrices, it is allowed to print any of them. | standard output | |
PASSED | 0e20a752cada3cfa3496c68803de0f98 | train_002.jsonl | 1533307500 | Now Vasya is taking an exam in mathematics. In order to get a good mark, Vasya needs to guess the matrix that the teacher has constructed!Vasya knows that the matrix consists of n rows and m columns. For each row, he knows the xor (bitwise excluding or) of the elements in this row. The sequence a1,βa2,β...,βan denotes ... | 256 megabytes | import java.io.*;
import java.util.*;
public class problemB {
public static void main(String[] args) throws IOException{
// TODO Auto-generated method stub
BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
StringTokenizer st = new StringTokenizer(br.readLine());
int n = Integer.parse... | Java | ["2 3\n2 9\n5 3 13", "3 3\n1 7 6\n2 15 12"] | 2 seconds | ["YES\n3 4 5\n6 7 8", "NO"] | null | Java 8 | standard input | [
"constructive algorithms",
"flows",
"math"
] | 3815d18843dbd15a73383d69eb6880dd | The first line contains two numbers n and mΒ (2ββ€βn,βmββ€β100) β the dimensions of the matrix. The second line contains n numbers a1,βa2,β...,βanΒ (0ββ€βaiββ€β109), where ai is the xor of all elements in row i. The third line contains m numbers b1,βb2,β...,βbmΒ (0ββ€βbiββ€β109), where bi is the xor of all elements in column i. | 1,800 | If there is no matrix satisfying the given constraints in the first line, output "NO". Otherwise, on the first line output "YES", and then n rows of m numbers in each ci1,βci2,β... ,βcimΒ (0ββ€βcijββ€β2Β·109) β the description of the matrix. If there are several suitable matrices, it is allowed to print any of them. | standard output | |
PASSED | d16eced79b024ceaf9eae30ad5858e26 | train_002.jsonl | 1533307500 | Now Vasya is taking an exam in mathematics. In order to get a good mark, Vasya needs to guess the matrix that the teacher has constructed!Vasya knows that the matrix consists of n rows and m columns. For each row, he knows the xor (bitwise excluding or) of the elements in this row. The sequence a1,βa2,β...,βan denotes ... | 256 megabytes | import java.util.*;
import java.io.*;
import java.io.FileWriter;
// Solution
public class Main
{
public static void main (String[] argv)
{
new Main();
}
boolean test = false;
final int[][] dirs8 = {{0,1}, {0,-1}, {-1,0}, {1,0}, {1,1},{1,-1},{-1,1},{-1,-1}};
final int MOD = 998244353;... | Java | ["2 3\n2 9\n5 3 13", "3 3\n1 7 6\n2 15 12"] | 2 seconds | ["YES\n3 4 5\n6 7 8", "NO"] | null | Java 8 | standard input | [
"constructive algorithms",
"flows",
"math"
] | 3815d18843dbd15a73383d69eb6880dd | The first line contains two numbers n and mΒ (2ββ€βn,βmββ€β100) β the dimensions of the matrix. The second line contains n numbers a1,βa2,β...,βanΒ (0ββ€βaiββ€β109), where ai is the xor of all elements in row i. The third line contains m numbers b1,βb2,β...,βbmΒ (0ββ€βbiββ€β109), where bi is the xor of all elements in column i. | 1,800 | If there is no matrix satisfying the given constraints in the first line, output "NO". Otherwise, on the first line output "YES", and then n rows of m numbers in each ci1,βci2,β... ,βcimΒ (0ββ€βcijββ€β2Β·109) β the description of the matrix. If there are several suitable matrices, it is allowed to print any of them. | standard output | |
PASSED | 562448231629167ebe0c98afb191e191 | train_002.jsonl | 1533307500 | Now Vasya is taking an exam in mathematics. In order to get a good mark, Vasya needs to guess the matrix that the teacher has constructed!Vasya knows that the matrix consists of n rows and m columns. For each row, he knows the xor (bitwise excluding or) of the elements in this row. The sequence a1,βa2,β...,βan denotes ... | 256 megabytes | import java.util.*;
import java.io.*;
public class A {
public static void main(String[] args) {
FastScanner fs=new FastScanner();
int height=fs.nextInt();
int width=fs.nextInt();
int[] rowXors=fs.readArray(height);
int[] colXors=fs.readArray(width);
int[][] matrix=new int[width][height];
for (int i=0;... | Java | ["2 3\n2 9\n5 3 13", "3 3\n1 7 6\n2 15 12"] | 2 seconds | ["YES\n3 4 5\n6 7 8", "NO"] | null | Java 8 | standard input | [
"constructive algorithms",
"flows",
"math"
] | 3815d18843dbd15a73383d69eb6880dd | The first line contains two numbers n and mΒ (2ββ€βn,βmββ€β100) β the dimensions of the matrix. The second line contains n numbers a1,βa2,β...,βanΒ (0ββ€βaiββ€β109), where ai is the xor of all elements in row i. The third line contains m numbers b1,βb2,β...,βbmΒ (0ββ€βbiββ€β109), where bi is the xor of all elements in column i. | 1,800 | If there is no matrix satisfying the given constraints in the first line, output "NO". Otherwise, on the first line output "YES", and then n rows of m numbers in each ci1,βci2,β... ,βcimΒ (0ββ€βcijββ€β2Β·109) β the description of the matrix. If there are several suitable matrices, it is allowed to print any of them. | standard output | |
PASSED | dd61bcfbb89fe222ae6d51c41f2ec9f1 | train_002.jsonl | 1533307500 | Now Vasya is taking an exam in mathematics. In order to get a good mark, Vasya needs to guess the matrix that the teacher has constructed!Vasya knows that the matrix consists of n rows and m columns. For each row, he knows the xor (bitwise excluding or) of the elements in this row. The sequence a1,βa2,β...,βan denotes ... | 256 megabytes |
import java.util.*;
import java.io.*;
public class Matrix {
static int N, M, K;
static String s;
static StringTokenizer st;
static int[] d;
public static void main(String[] args) throws Exception {
BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
PrintWri... | Java | ["2 3\n2 9\n5 3 13", "3 3\n1 7 6\n2 15 12"] | 2 seconds | ["YES\n3 4 5\n6 7 8", "NO"] | null | Java 8 | standard input | [
"constructive algorithms",
"flows",
"math"
] | 3815d18843dbd15a73383d69eb6880dd | The first line contains two numbers n and mΒ (2ββ€βn,βmββ€β100) β the dimensions of the matrix. The second line contains n numbers a1,βa2,β...,βanΒ (0ββ€βaiββ€β109), where ai is the xor of all elements in row i. The third line contains m numbers b1,βb2,β...,βbmΒ (0ββ€βbiββ€β109), where bi is the xor of all elements in column i. | 1,800 | If there is no matrix satisfying the given constraints in the first line, output "NO". Otherwise, on the first line output "YES", and then n rows of m numbers in each ci1,βci2,β... ,βcimΒ (0ββ€βcijββ€β2Β·109) β the description of the matrix. If there are several suitable matrices, it is allowed to print any of them. | standard output | |
PASSED | 05119bb3aae7fa0e03dc5a0b3e4b97a8 | train_002.jsonl | 1533307500 | Now Vasya is taking an exam in mathematics. In order to get a good mark, Vasya needs to guess the matrix that the teacher has constructed!Vasya knows that the matrix consists of n rows and m columns. For each row, he knows the xor (bitwise excluding or) of the elements in this row. The sequence a1,βa2,β...,βan denotes ... | 256 megabytes | import java.util.*;
import java.io.*;
public class CF
{
static InputReader in;
static PrintWriter out;
public static void main(String[] args)
{
in = new InputReader(System.in);
out = new PrintWriter(System.out);
int n = in.nextInt();
int m = in.nextInt();... | Java | ["2 3\n2 9\n5 3 13", "3 3\n1 7 6\n2 15 12"] | 2 seconds | ["YES\n3 4 5\n6 7 8", "NO"] | null | Java 8 | standard input | [
"constructive algorithms",
"flows",
"math"
] | 3815d18843dbd15a73383d69eb6880dd | The first line contains two numbers n and mΒ (2ββ€βn,βmββ€β100) β the dimensions of the matrix. The second line contains n numbers a1,βa2,β...,βanΒ (0ββ€βaiββ€β109), where ai is the xor of all elements in row i. The third line contains m numbers b1,βb2,β...,βbmΒ (0ββ€βbiββ€β109), where bi is the xor of all elements in column i. | 1,800 | If there is no matrix satisfying the given constraints in the first line, output "NO". Otherwise, on the first line output "YES", and then n rows of m numbers in each ci1,βci2,β... ,βcimΒ (0ββ€βcijββ€β2Β·109) β the description of the matrix. If there are several suitable matrices, it is allowed to print any of them. | standard output | |
PASSED | fff4ca11a3fb51e69cb60af2c4da44de | train_002.jsonl | 1533307500 | Now Vasya is taking an exam in mathematics. In order to get a good mark, Vasya needs to guess the matrix that the teacher has constructed!Vasya knows that the matrix consists of n rows and m columns. For each row, he knows the xor (bitwise excluding or) of the elements in this row. The sequence a1,βa2,β...,βan denotes ... | 256 megabytes | import java.io.*;
import java.math.BigInteger;
import java.util.*;
public class Main implements Runnable {
int maxn = (int)1e2+111;
int n,m,k;
int a[][] = new int[maxn][maxn];
int row[] = new int[maxn];
int col[] = new int[maxn];
void solve() throws Exception {
n = in.nextInt();
... | Java | ["2 3\n2 9\n5 3 13", "3 3\n1 7 6\n2 15 12"] | 2 seconds | ["YES\n3 4 5\n6 7 8", "NO"] | null | Java 8 | standard input | [
"constructive algorithms",
"flows",
"math"
] | 3815d18843dbd15a73383d69eb6880dd | The first line contains two numbers n and mΒ (2ββ€βn,βmββ€β100) β the dimensions of the matrix. The second line contains n numbers a1,βa2,β...,βanΒ (0ββ€βaiββ€β109), where ai is the xor of all elements in row i. The third line contains m numbers b1,βb2,β...,βbmΒ (0ββ€βbiββ€β109), where bi is the xor of all elements in column i. | 1,800 | If there is no matrix satisfying the given constraints in the first line, output "NO". Otherwise, on the first line output "YES", and then n rows of m numbers in each ci1,βci2,β... ,βcimΒ (0ββ€βcijββ€β2Β·109) β the description of the matrix. If there are several suitable matrices, it is allowed to print any of them. | standard output | |
PASSED | a3a8c3f55e60ae2cc4a951542ac1cb24 | train_002.jsonl | 1533307500 | Now Vasya is taking an exam in mathematics. In order to get a good mark, Vasya needs to guess the matrix that the teacher has constructed!Vasya knows that the matrix consists of n rows and m columns. For each row, he knows the xor (bitwise excluding or) of the elements in this row. The sequence a1,βa2,β...,βan denotes ... | 256 megabytes |
import java.io.BufferedInputStream;
import java.util.Scanner;
/**
*
*/
public class VasyaAndTheMatrix {
public static void main(String[] args) {
Scanner in = new Scanner(new BufferedInputStream(System.in));
while (in.hasNext()) {
int n = in.nextInt();
int m = in.nextInt... | Java | ["2 3\n2 9\n5 3 13", "3 3\n1 7 6\n2 15 12"] | 2 seconds | ["YES\n3 4 5\n6 7 8", "NO"] | null | Java 8 | standard input | [
"constructive algorithms",
"flows",
"math"
] | 3815d18843dbd15a73383d69eb6880dd | The first line contains two numbers n and mΒ (2ββ€βn,βmββ€β100) β the dimensions of the matrix. The second line contains n numbers a1,βa2,β...,βanΒ (0ββ€βaiββ€β109), where ai is the xor of all elements in row i. The third line contains m numbers b1,βb2,β...,βbmΒ (0ββ€βbiββ€β109), where bi is the xor of all elements in column i. | 1,800 | If there is no matrix satisfying the given constraints in the first line, output "NO". Otherwise, on the first line output "YES", and then n rows of m numbers in each ci1,βci2,β... ,βcimΒ (0ββ€βcijββ€β2Β·109) β the description of the matrix. If there are several suitable matrices, it is allowed to print any of them. | standard output | |
PASSED | 92eb1f6bdf7d05ce4c8d12bef2c14a5f | train_002.jsonl | 1533307500 | Now Vasya is taking an exam in mathematics. In order to get a good mark, Vasya needs to guess the matrix that the teacher has constructed!Vasya knows that the matrix consists of n rows and m columns. For each row, he knows the xor (bitwise excluding or) of the elements in this row. The sequence a1,βa2,β...,βan denotes ... | 256 megabytes | //package contese_476;
import java.util.*;
public class q1
{
int m=(int)1e9+7;
public class Node
{
int a;
int b;
public void Node(int a,int b)
{
this.a=a;
this.b=b;
}
}
public int mul(int a ,int b)
{
a=a%m;
b=b%m;
return((a*b)%m);
}
public int pow(int a,int b)
{
int x=1;
while(b>0)
{
if(b%2!=0)
x=mul... | Java | ["2 3\n2 9\n5 3 13", "3 3\n1 7 6\n2 15 12"] | 2 seconds | ["YES\n3 4 5\n6 7 8", "NO"] | null | Java 8 | standard input | [
"constructive algorithms",
"flows",
"math"
] | 3815d18843dbd15a73383d69eb6880dd | The first line contains two numbers n and mΒ (2ββ€βn,βmββ€β100) β the dimensions of the matrix. The second line contains n numbers a1,βa2,β...,βanΒ (0ββ€βaiββ€β109), where ai is the xor of all elements in row i. The third line contains m numbers b1,βb2,β...,βbmΒ (0ββ€βbiββ€β109), where bi is the xor of all elements in column i. | 1,800 | If there is no matrix satisfying the given constraints in the first line, output "NO". Otherwise, on the first line output "YES", and then n rows of m numbers in each ci1,βci2,β... ,βcimΒ (0ββ€βcijββ€β2Β·109) β the description of the matrix. If there are several suitable matrices, it is allowed to print any of them. | standard output | |
PASSED | 021b5e4079402d44c12cced9e929b397 | train_002.jsonl | 1533307500 | Now Vasya is taking an exam in mathematics. In order to get a good mark, Vasya needs to guess the matrix that the teacher has constructed!Vasya knows that the matrix consists of n rows and m columns. For each row, he knows the xor (bitwise excluding or) of the elements in this row. The sequence a1,βa2,β...,βan denotes ... | 256 megabytes |
//package que_b;
import java.io.*;
import java.util.*;
import java.math.*;
public class utkarsh {
InputStream is;
PrintWriter out;
long mod = (long) (1e9 + 7);
boolean SHOW_TIME;
void solve() {
//Enter code here utkarsh
//SHOW_TIME = true;
int n = ni(), m = ni()... | Java | ["2 3\n2 9\n5 3 13", "3 3\n1 7 6\n2 15 12"] | 2 seconds | ["YES\n3 4 5\n6 7 8", "NO"] | null | Java 8 | standard input | [
"constructive algorithms",
"flows",
"math"
] | 3815d18843dbd15a73383d69eb6880dd | The first line contains two numbers n and mΒ (2ββ€βn,βmββ€β100) β the dimensions of the matrix. The second line contains n numbers a1,βa2,β...,βanΒ (0ββ€βaiββ€β109), where ai is the xor of all elements in row i. The third line contains m numbers b1,βb2,β...,βbmΒ (0ββ€βbiββ€β109), where bi is the xor of all elements in column i. | 1,800 | If there is no matrix satisfying the given constraints in the first line, output "NO". Otherwise, on the first line output "YES", and then n rows of m numbers in each ci1,βci2,β... ,βcimΒ (0ββ€βcijββ€β2Β·109) β the description of the matrix. If there are several suitable matrices, it is allowed to print any of them. | standard output | |
PASSED | 9502094638acb9558f507551c6f9933b | train_002.jsonl | 1533307500 | Now Vasya is taking an exam in mathematics. In order to get a good mark, Vasya needs to guess the matrix that the teacher has constructed!Vasya knows that the matrix consists of n rows and m columns. For each row, he knows the xor (bitwise excluding or) of the elements in this row. The sequence a1,βa2,β...,βan denotes ... | 256 megabytes | import java.util.Scanner;
public class Main {
private static boolean check(int n , int m) {
long value = 0;
for (int i = 0;i < n;i ++) {
value ^= row[i];
}
for (int i = 0;i < m;i ++) {
value ^= col[i];
}
return value == 0;
}
private static long[] row = new long[200];
private static long[... | Java | ["2 3\n2 9\n5 3 13", "3 3\n1 7 6\n2 15 12"] | 2 seconds | ["YES\n3 4 5\n6 7 8", "NO"] | null | Java 8 | standard input | [
"constructive algorithms",
"flows",
"math"
] | 3815d18843dbd15a73383d69eb6880dd | The first line contains two numbers n and mΒ (2ββ€βn,βmββ€β100) β the dimensions of the matrix. The second line contains n numbers a1,βa2,β...,βanΒ (0ββ€βaiββ€β109), where ai is the xor of all elements in row i. The third line contains m numbers b1,βb2,β...,βbmΒ (0ββ€βbiββ€β109), where bi is the xor of all elements in column i. | 1,800 | If there is no matrix satisfying the given constraints in the first line, output "NO". Otherwise, on the first line output "YES", and then n rows of m numbers in each ci1,βci2,β... ,βcimΒ (0ββ€βcijββ€β2Β·109) β the description of the matrix. If there are several suitable matrices, it is allowed to print any of them. | standard output | |
PASSED | d5896503a2dec4bfdf2f71b7e71b4344 | train_002.jsonl | 1533307500 | Now Vasya is taking an exam in mathematics. In order to get a good mark, Vasya needs to guess the matrix that the teacher has constructed!Vasya knows that the matrix consists of n rows and m columns. For each row, he knows the xor (bitwise excluding or) of the elements in this row. The sequence a1,βa2,β...,βan denotes ... | 256 megabytes | import java.io.OutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.util.InputMismatchException;
import java.io.IOException;
import java.io.InputStream;
/**
* Built using CHelper plug-in
* Actual solution is at the top
*/
public class Main {
public static... | Java | ["2 3\n2 9\n5 3 13", "3 3\n1 7 6\n2 15 12"] | 2 seconds | ["YES\n3 4 5\n6 7 8", "NO"] | null | Java 8 | standard input | [
"constructive algorithms",
"flows",
"math"
] | 3815d18843dbd15a73383d69eb6880dd | The first line contains two numbers n and mΒ (2ββ€βn,βmββ€β100) β the dimensions of the matrix. The second line contains n numbers a1,βa2,β...,βanΒ (0ββ€βaiββ€β109), where ai is the xor of all elements in row i. The third line contains m numbers b1,βb2,β...,βbmΒ (0ββ€βbiββ€β109), where bi is the xor of all elements in column i. | 1,800 | If there is no matrix satisfying the given constraints in the first line, output "NO". Otherwise, on the first line output "YES", and then n rows of m numbers in each ci1,βci2,β... ,βcimΒ (0ββ€βcijββ€β2Β·109) β the description of the matrix. If there are several suitable matrices, it is allowed to print any of them. | standard output | |
PASSED | b413f64c02f1e2a5dd62adf4e6b562e9 | train_002.jsonl | 1533307500 | Now Vasya is taking an exam in mathematics. In order to get a good mark, Vasya needs to guess the matrix that the teacher has constructed!Vasya knows that the matrix consists of n rows and m columns. For each row, he knows the xor (bitwise excluding or) of the elements in this row. The sequence a1,βa2,β...,βan denotes ... | 256 megabytes | import java.io.*;
import java.util.*;
public class CF1016D {
static int[] aa, bb, ii, jj;
static int[][] cc;
static void solve(int n, int m, int k) {
int n1 = 0, m1 = 0;
for (int i = 0; i < n; i++)
if ((aa[i] & 1 << k) != 0)
ii[n1++] = i;
for (int j = 0; j < m; j++)
if ((bb[j] & 1 << k) != 0)
jj... | Java | ["2 3\n2 9\n5 3 13", "3 3\n1 7 6\n2 15 12"] | 2 seconds | ["YES\n3 4 5\n6 7 8", "NO"] | null | Java 8 | standard input | [
"constructive algorithms",
"flows",
"math"
] | 3815d18843dbd15a73383d69eb6880dd | The first line contains two numbers n and mΒ (2ββ€βn,βmββ€β100) β the dimensions of the matrix. The second line contains n numbers a1,βa2,β...,βanΒ (0ββ€βaiββ€β109), where ai is the xor of all elements in row i. The third line contains m numbers b1,βb2,β...,βbmΒ (0ββ€βbiββ€β109), where bi is the xor of all elements in column i. | 1,800 | If there is no matrix satisfying the given constraints in the first line, output "NO". Otherwise, on the first line output "YES", and then n rows of m numbers in each ci1,βci2,β... ,βcimΒ (0ββ€βcijββ€β2Β·109) β the description of the matrix. If there are several suitable matrices, it is allowed to print any of them. | standard output | |
PASSED | 6979104a1ab0a113eb84f6092140818c | train_002.jsonl | 1533307500 | Now Vasya is taking an exam in mathematics. In order to get a good mark, Vasya needs to guess the matrix that the teacher has constructed!Vasya knows that the matrix consists of n rows and m columns. For each row, he knows the xor (bitwise excluding or) of the elements in this row. The sequence a1,βa2,β...,βan denotes ... | 256 megabytes | import java.util.*;
/**
*
* @author user
*/
public class JavaApplication8 {
public static void main(String[] args) {
Scanner in = new Scanner(System.in) ;
int n = in.nextInt() ;
int m = in.nextInt() ;
int[] a = new int[n] ;
int[] b = new int[m] ;
... | Java | ["2 3\n2 9\n5 3 13", "3 3\n1 7 6\n2 15 12"] | 2 seconds | ["YES\n3 4 5\n6 7 8", "NO"] | null | Java 8 | standard input | [
"constructive algorithms",
"flows",
"math"
] | 3815d18843dbd15a73383d69eb6880dd | The first line contains two numbers n and mΒ (2ββ€βn,βmββ€β100) β the dimensions of the matrix. The second line contains n numbers a1,βa2,β...,βanΒ (0ββ€βaiββ€β109), where ai is the xor of all elements in row i. The third line contains m numbers b1,βb2,β...,βbmΒ (0ββ€βbiββ€β109), where bi is the xor of all elements in column i. | 1,800 | If there is no matrix satisfying the given constraints in the first line, output "NO". Otherwise, on the first line output "YES", and then n rows of m numbers in each ci1,βci2,β... ,βcimΒ (0ββ€βcijββ€β2Β·109) β the description of the matrix. If there are several suitable matrices, it is allowed to print any of them. | standard output | |
PASSED | fc4105ab70cdd5c6af47be343e2a3bd0 | train_002.jsonl | 1533307500 | Now Vasya is taking an exam in mathematics. In order to get a good mark, Vasya needs to guess the matrix that the teacher has constructed!Vasya knows that the matrix consists of n rows and m columns. For each row, he knows the xor (bitwise excluding or) of the elements in this row. The sequence a1,βa2,β...,βan denotes ... | 256 megabytes | import java.io.BufferedInputStream;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.PrintWriter;
import java.util.ArrayDeque;
public class D {
static int R,C;
static long xR[], xC[];
static long b[][];
public static void main(String[] args) {
JS in = new... | Java | ["2 3\n2 9\n5 3 13", "3 3\n1 7 6\n2 15 12"] | 2 seconds | ["YES\n3 4 5\n6 7 8", "NO"] | null | Java 8 | standard input | [
"constructive algorithms",
"flows",
"math"
] | 3815d18843dbd15a73383d69eb6880dd | The first line contains two numbers n and mΒ (2ββ€βn,βmββ€β100) β the dimensions of the matrix. The second line contains n numbers a1,βa2,β...,βanΒ (0ββ€βaiββ€β109), where ai is the xor of all elements in row i. The third line contains m numbers b1,βb2,β...,βbmΒ (0ββ€βbiββ€β109), where bi is the xor of all elements in column i. | 1,800 | If there is no matrix satisfying the given constraints in the first line, output "NO". Otherwise, on the first line output "YES", and then n rows of m numbers in each ci1,βci2,β... ,βcimΒ (0ββ€βcijββ€β2Β·109) β the description of the matrix. If there are several suitable matrices, it is allowed to print any of them. | standard output | |
PASSED | 407f72e104bed97412ebc369b3d35802 | train_002.jsonl | 1533307500 | Now Vasya is taking an exam in mathematics. In order to get a good mark, Vasya needs to guess the matrix that the teacher has constructed!Vasya knows that the matrix consists of n rows and m columns. For each row, he knows the xor (bitwise excluding or) of the elements in this row. The sequence a1,βa2,β...,βan denotes ... | 256 megabytes | /*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
/**
*
* @author SNEHITH
*/
import java.util.*;
public class problem_D {
public static void main(String[] args){
Scanne... | Java | ["2 3\n2 9\n5 3 13", "3 3\n1 7 6\n2 15 12"] | 2 seconds | ["YES\n3 4 5\n6 7 8", "NO"] | null | Java 8 | standard input | [
"constructive algorithms",
"flows",
"math"
] | 3815d18843dbd15a73383d69eb6880dd | The first line contains two numbers n and mΒ (2ββ€βn,βmββ€β100) β the dimensions of the matrix. The second line contains n numbers a1,βa2,β...,βanΒ (0ββ€βaiββ€β109), where ai is the xor of all elements in row i. The third line contains m numbers b1,βb2,β...,βbmΒ (0ββ€βbiββ€β109), where bi is the xor of all elements in column i. | 1,800 | If there is no matrix satisfying the given constraints in the first line, output "NO". Otherwise, on the first line output "YES", and then n rows of m numbers in each ci1,βci2,β... ,βcimΒ (0ββ€βcijββ€β2Β·109) β the description of the matrix. If there are several suitable matrices, it is allowed to print any of them. | standard output | |
PASSED | df924b4986c622516e08029abe4f03d8 | train_002.jsonl | 1533307500 | Now Vasya is taking an exam in mathematics. In order to get a good mark, Vasya needs to guess the matrix that the teacher has constructed!Vasya knows that the matrix consists of n rows and m columns. For each row, he knows the xor (bitwise excluding or) of the elements in this row. The sequence a1,βa2,β...,βan denotes ... | 256 megabytes | //package math_codet;
import java.io.*;
import java.util.*;
import java.math.*;
/******************************************
* AUTHOR: AMAN KUMAR SINGH *
* INSTITUITION: KALYANI GOVERNMENT ENGINEERING COLLEGE *
******************************************/
public class lets_do {
InputReader in... | Java | ["2 3\n2 9\n5 3 13", "3 3\n1 7 6\n2 15 12"] | 2 seconds | ["YES\n3 4 5\n6 7 8", "NO"] | null | Java 8 | standard input | [
"constructive algorithms",
"flows",
"math"
] | 3815d18843dbd15a73383d69eb6880dd | The first line contains two numbers n and mΒ (2ββ€βn,βmββ€β100) β the dimensions of the matrix. The second line contains n numbers a1,βa2,β...,βanΒ (0ββ€βaiββ€β109), where ai is the xor of all elements in row i. The third line contains m numbers b1,βb2,β...,βbmΒ (0ββ€βbiββ€β109), where bi is the xor of all elements in column i. | 1,800 | If there is no matrix satisfying the given constraints in the first line, output "NO". Otherwise, on the first line output "YES", and then n rows of m numbers in each ci1,βci2,β... ,βcimΒ (0ββ€βcijββ€β2Β·109) β the description of the matrix. If there are several suitable matrices, it is allowed to print any of them. | standard output | |
PASSED | 8ded0a2a749b36072af8688a0cceec74 | train_002.jsonl | 1533307500 | Now Vasya is taking an exam in mathematics. In order to get a good mark, Vasya needs to guess the matrix that the teacher has constructed!Vasya knows that the matrix consists of n rows and m columns. For each row, he knows the xor (bitwise excluding or) of the elements in this row. The sequence a1,βa2,β...,βan denotes ... | 256 megabytes | import java.io.*;
import java.util.*;
public class CF1016_D {
public static void main(String[] args)throws Throwable {
MyScanner sc=new MyScanner();
PrintWriter pw=new PrintWriter(System.out);
int n=sc.nextInt();
int m=sc.nextInt();
int [] a=new int [n];
int [] b=new... | Java | ["2 3\n2 9\n5 3 13", "3 3\n1 7 6\n2 15 12"] | 2 seconds | ["YES\n3 4 5\n6 7 8", "NO"] | null | Java 8 | standard input | [
"constructive algorithms",
"flows",
"math"
] | 3815d18843dbd15a73383d69eb6880dd | The first line contains two numbers n and mΒ (2ββ€βn,βmββ€β100) β the dimensions of the matrix. The second line contains n numbers a1,βa2,β...,βanΒ (0ββ€βaiββ€β109), where ai is the xor of all elements in row i. The third line contains m numbers b1,βb2,β...,βbmΒ (0ββ€βbiββ€β109), where bi is the xor of all elements in column i. | 1,800 | If there is no matrix satisfying the given constraints in the first line, output "NO". Otherwise, on the first line output "YES", and then n rows of m numbers in each ci1,βci2,β... ,βcimΒ (0ββ€βcijββ€β2Β·109) β the description of the matrix. If there are several suitable matrices, it is allowed to print any of them. | standard output | |
PASSED | b7d481fb03aa8a4939afe87eeddd35d7 | train_002.jsonl | 1533307500 | Now Vasya is taking an exam in mathematics. In order to get a good mark, Vasya needs to guess the matrix that the teacher has constructed!Vasya knows that the matrix consists of n rows and m columns. For each row, he knows the xor (bitwise excluding or) of the elements in this row. The sequence a1,βa2,β...,βan denotes ... | 256 megabytes | import java.io.OutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.io.FilterInputStream;
import java.io.BufferedInputStream;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.File;
import java.io.InputStream;
/**
* Built usin... | Java | ["2 3\n2 9\n5 3 13", "3 3\n1 7 6\n2 15 12"] | 2 seconds | ["YES\n3 4 5\n6 7 8", "NO"] | null | Java 8 | standard input | [
"constructive algorithms",
"flows",
"math"
] | 3815d18843dbd15a73383d69eb6880dd | The first line contains two numbers n and mΒ (2ββ€βn,βmββ€β100) β the dimensions of the matrix. The second line contains n numbers a1,βa2,β...,βanΒ (0ββ€βaiββ€β109), where ai is the xor of all elements in row i. The third line contains m numbers b1,βb2,β...,βbmΒ (0ββ€βbiββ€β109), where bi is the xor of all elements in column i. | 1,800 | If there is no matrix satisfying the given constraints in the first line, output "NO". Otherwise, on the first line output "YES", and then n rows of m numbers in each ci1,βci2,β... ,βcimΒ (0ββ€βcijββ€β2Β·109) β the description of the matrix. If there are several suitable matrices, it is allowed to print any of them. | standard output | |
PASSED | 89f7c92fd8fdfa6d70e9ce62576bd188 | train_002.jsonl | 1533307500 | Now Vasya is taking an exam in mathematics. In order to get a good mark, Vasya needs to guess the matrix that the teacher has constructed!Vasya knows that the matrix consists of n rows and m columns. For each row, he knows the xor (bitwise excluding or) of the elements in this row. The sequence a1,βa2,β...,βan denotes ... | 256 megabytes | import java.util.Scanner;
public class Codeforces {
public static void main(String[] args) {
Scanner in = new Scanner(System.in);
int[] x = new int[111], y = new int[111];
int[][] a = new int[111][111];
int n = in.nextInt(), m = in.nextInt();
int all = 0;
f... | Java | ["2 3\n2 9\n5 3 13", "3 3\n1 7 6\n2 15 12"] | 2 seconds | ["YES\n3 4 5\n6 7 8", "NO"] | null | Java 8 | standard input | [
"constructive algorithms",
"flows",
"math"
] | 3815d18843dbd15a73383d69eb6880dd | The first line contains two numbers n and mΒ (2ββ€βn,βmββ€β100) β the dimensions of the matrix. The second line contains n numbers a1,βa2,β...,βanΒ (0ββ€βaiββ€β109), where ai is the xor of all elements in row i. The third line contains m numbers b1,βb2,β...,βbmΒ (0ββ€βbiββ€β109), where bi is the xor of all elements in column i. | 1,800 | If there is no matrix satisfying the given constraints in the first line, output "NO". Otherwise, on the first line output "YES", and then n rows of m numbers in each ci1,βci2,β... ,βcimΒ (0ββ€βcijββ€β2Β·109) β the description of the matrix. If there are several suitable matrices, it is allowed to print any of them. | standard output | |
PASSED | a848a4dad89ddacf641cdc9df8430d0c | train_002.jsonl | 1533307500 | Now Vasya is taking an exam in mathematics. In order to get a good mark, Vasya needs to guess the matrix that the teacher has constructed!Vasya knows that the matrix consists of n rows and m columns. For each row, he knows the xor (bitwise excluding or) of the elements in this row. The sequence a1,βa2,β...,βan denotes ... | 256 megabytes | import java.util.*;
import java.io.*;
public class Main implements Runnable{
FastScanner sc;
PrintWriter pw;
final class FastScanner {
BufferedReader br;
StringTokenizer st;
public FastScanner() {
try {
br = new BufferedReader(new InputStreamReader(Syste... | Java | ["2 3\n2 9\n5 3 13", "3 3\n1 7 6\n2 15 12"] | 2 seconds | ["YES\n3 4 5\n6 7 8", "NO"] | null | Java 8 | standard input | [
"constructive algorithms",
"flows",
"math"
] | 3815d18843dbd15a73383d69eb6880dd | The first line contains two numbers n and mΒ (2ββ€βn,βmββ€β100) β the dimensions of the matrix. The second line contains n numbers a1,βa2,β...,βanΒ (0ββ€βaiββ€β109), where ai is the xor of all elements in row i. The third line contains m numbers b1,βb2,β...,βbmΒ (0ββ€βbiββ€β109), where bi is the xor of all elements in column i. | 1,800 | If there is no matrix satisfying the given constraints in the first line, output "NO". Otherwise, on the first line output "YES", and then n rows of m numbers in each ci1,βci2,β... ,βcimΒ (0ββ€βcijββ€β2Β·109) β the description of the matrix. If there are several suitable matrices, it is allowed to print any of them. | standard output | |
PASSED | 8cd1c6a665e76290347377c51c44e7bb | train_002.jsonl | 1533307500 | Now Vasya is taking an exam in mathematics. In order to get a good mark, Vasya needs to guess the matrix that the teacher has constructed!Vasya knows that the matrix consists of n rows and m columns. For each row, he knows the xor (bitwise excluding or) of the elements in this row. The sequence a1,βa2,β...,βan denotes ... | 256 megabytes | import java.io.*;
import java.util.*;
public class Main {
FastReader scn;
PrintWriter out;
String INPUT = "";
void solve() {
int n = scn.nextInt(), m = scn.nextInt();
int[] row = new int[n], col = new int[m];
int x1 = 0, x2 = 0;
for(int i = 0; i < n; i++) {
x1 ^= row[i] = scn.nextInt();
}
for(int i... | Java | ["2 3\n2 9\n5 3 13", "3 3\n1 7 6\n2 15 12"] | 2 seconds | ["YES\n3 4 5\n6 7 8", "NO"] | null | Java 8 | standard input | [
"constructive algorithms",
"flows",
"math"
] | 3815d18843dbd15a73383d69eb6880dd | The first line contains two numbers n and mΒ (2ββ€βn,βmββ€β100) β the dimensions of the matrix. The second line contains n numbers a1,βa2,β...,βanΒ (0ββ€βaiββ€β109), where ai is the xor of all elements in row i. The third line contains m numbers b1,βb2,β...,βbmΒ (0ββ€βbiββ€β109), where bi is the xor of all elements in column i. | 1,800 | If there is no matrix satisfying the given constraints in the first line, output "NO". Otherwise, on the first line output "YES", and then n rows of m numbers in each ci1,βci2,β... ,βcimΒ (0ββ€βcijββ€β2Β·109) β the description of the matrix. If there are several suitable matrices, it is allowed to print any of them. | standard output | |
PASSED | 24891958c6def1602704b67a78dfe1d5 | train_002.jsonl | 1533307500 | Now Vasya is taking an exam in mathematics. In order to get a good mark, Vasya needs to guess the matrix that the teacher has constructed!Vasya knows that the matrix consists of n rows and m columns. For each row, he knows the xor (bitwise excluding or) of the elements in this row. The sequence a1,βa2,β...,βan denotes ... | 256 megabytes | import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
public class d{
static void solve(){
int n = ni(), m=ni();
int[] a = nia(n);
int[] b = nia(m);
int x = 0;
for(int i=0;i<n;++i)x^=a[i];
int y = 0;
for(int i=0;i<m;++i)y^=b[i];
if(x==y){
out.println("YES");
... | Java | ["2 3\n2 9\n5 3 13", "3 3\n1 7 6\n2 15 12"] | 2 seconds | ["YES\n3 4 5\n6 7 8", "NO"] | null | Java 8 | standard input | [
"constructive algorithms",
"flows",
"math"
] | 3815d18843dbd15a73383d69eb6880dd | The first line contains two numbers n and mΒ (2ββ€βn,βmββ€β100) β the dimensions of the matrix. The second line contains n numbers a1,βa2,β...,βanΒ (0ββ€βaiββ€β109), where ai is the xor of all elements in row i. The third line contains m numbers b1,βb2,β...,βbmΒ (0ββ€βbiββ€β109), where bi is the xor of all elements in column i. | 1,800 | If there is no matrix satisfying the given constraints in the first line, output "NO". Otherwise, on the first line output "YES", and then n rows of m numbers in each ci1,βci2,β... ,βcimΒ (0ββ€βcijββ€β2Β·109) β the description of the matrix. If there are several suitable matrices, it is allowed to print any of them. | standard output | |
PASSED | 15268f528f5137fa3346c88be0b4d5b9 | train_002.jsonl | 1533307500 | Now Vasya is taking an exam in mathematics. In order to get a good mark, Vasya needs to guess the matrix that the teacher has constructed!Vasya knows that the matrix consists of n rows and m columns. For each row, he knows the xor (bitwise excluding or) of the elements in this row. The sequence a1,βa2,β...,βan denotes ... | 256 megabytes | import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
public class d{
static void solve(){
int n = ni(), m=ni();
int[] a = nia(n);
int[] b = nia(m);
int x = 0;
for(int i=0;i<n;++i)x^=a[i];
int y = 0;
for(int i=0;i<m;++i)y^=b[i];
if(x==y){
out.println("YES");
... | Java | ["2 3\n2 9\n5 3 13", "3 3\n1 7 6\n2 15 12"] | 2 seconds | ["YES\n3 4 5\n6 7 8", "NO"] | null | Java 8 | standard input | [
"constructive algorithms",
"flows",
"math"
] | 3815d18843dbd15a73383d69eb6880dd | The first line contains two numbers n and mΒ (2ββ€βn,βmββ€β100) β the dimensions of the matrix. The second line contains n numbers a1,βa2,β...,βanΒ (0ββ€βaiββ€β109), where ai is the xor of all elements in row i. The third line contains m numbers b1,βb2,β...,βbmΒ (0ββ€βbiββ€β109), where bi is the xor of all elements in column i. | 1,800 | If there is no matrix satisfying the given constraints in the first line, output "NO". Otherwise, on the first line output "YES", and then n rows of m numbers in each ci1,βci2,β... ,βcimΒ (0ββ€βcijββ€β2Β·109) β the description of the matrix. If there are several suitable matrices, it is allowed to print any of them. | standard output | |
PASSED | 4dd0f8d7524aa90d77327a5476a887c5 | train_002.jsonl | 1533307500 | Now Vasya is taking an exam in mathematics. In order to get a good mark, Vasya needs to guess the matrix that the teacher has constructed!Vasya knows that the matrix consists of n rows and m columns. For each row, he knows the xor (bitwise excluding or) of the elements in this row. The sequence a1,βa2,β...,βan denotes ... | 256 megabytes | import java.util.*;
import java.lang.*;
public class Solution {
static Scanner in = new Scanner(System.in);
public static void main(String []args){
int m = in.nextInt();
int n = in.nextInt();
int a[] = new int[m];
int b[] = new int[n];
int xm = 0, xn = 0;
for(int i = 0; i < m; i++){
a[i] = in.nextInt... | Java | ["2 3\n2 9\n5 3 13", "3 3\n1 7 6\n2 15 12"] | 2 seconds | ["YES\n3 4 5\n6 7 8", "NO"] | null | Java 8 | standard input | [
"constructive algorithms",
"flows",
"math"
] | 3815d18843dbd15a73383d69eb6880dd | The first line contains two numbers n and mΒ (2ββ€βn,βmββ€β100) β the dimensions of the matrix. The second line contains n numbers a1,βa2,β...,βanΒ (0ββ€βaiββ€β109), where ai is the xor of all elements in row i. The third line contains m numbers b1,βb2,β...,βbmΒ (0ββ€βbiββ€β109), where bi is the xor of all elements in column i. | 1,800 | If there is no matrix satisfying the given constraints in the first line, output "NO". Otherwise, on the first line output "YES", and then n rows of m numbers in each ci1,βci2,β... ,βcimΒ (0ββ€βcijββ€β2Β·109) β the description of the matrix. If there are several suitable matrices, it is allowed to print any of them. | standard output | |
PASSED | 8b44df8d88f56ea7f21f50a917eea8c3 | train_002.jsonl | 1533307500 | Now Vasya is taking an exam in mathematics. In order to get a good mark, Vasya needs to guess the matrix that the teacher has constructed!Vasya knows that the matrix consists of n rows and m columns. For each row, he knows the xor (bitwise excluding or) of the elements in this row. The sequence a1,βa2,β...,βan denotes ... | 256 megabytes |
import java.io.*;
import java.lang.reflect.Array;
import java.math.BigInteger;
import java.util.*;
import java.util.Random;
import java.util.StringTokenizer;
public class Main {
final long b = 31;
String fileName = "";
////////////////////// SOLUTION SOLUTION SOLUTION /////////////////////////... | Java | ["2 3\n2 9\n5 3 13", "3 3\n1 7 6\n2 15 12"] | 2 seconds | ["YES\n3 4 5\n6 7 8", "NO"] | null | Java 8 | standard input | [
"constructive algorithms",
"flows",
"math"
] | 3815d18843dbd15a73383d69eb6880dd | The first line contains two numbers n and mΒ (2ββ€βn,βmββ€β100) β the dimensions of the matrix. The second line contains n numbers a1,βa2,β...,βanΒ (0ββ€βaiββ€β109), where ai is the xor of all elements in row i. The third line contains m numbers b1,βb2,β...,βbmΒ (0ββ€βbiββ€β109), where bi is the xor of all elements in column i. | 1,800 | If there is no matrix satisfying the given constraints in the first line, output "NO". Otherwise, on the first line output "YES", and then n rows of m numbers in each ci1,βci2,β... ,βcimΒ (0ββ€βcijββ€β2Β·109) β the description of the matrix. If there are several suitable matrices, it is allowed to print any of them. | standard output | |
PASSED | dd1cd336a2567b5491dfce8a9fde1662 | train_002.jsonl | 1533307500 | Now Vasya is taking an exam in mathematics. In order to get a good mark, Vasya needs to guess the matrix that the teacher has constructed!Vasya knows that the matrix consists of n rows and m columns. For each row, he knows the xor (bitwise excluding or) of the elements in this row. The sequence a1,βa2,β...,βan denotes ... | 256 megabytes | import java.io.OutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.util.StringTokenizer;
import java.io.IOException;
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.io.InputStream;
/**
* Built using CHelper plug-in
* Actual soluti... | Java | ["2 3\n2 9\n5 3 13", "3 3\n1 7 6\n2 15 12"] | 2 seconds | ["YES\n3 4 5\n6 7 8", "NO"] | null | Java 8 | standard input | [
"constructive algorithms",
"flows",
"math"
] | 3815d18843dbd15a73383d69eb6880dd | The first line contains two numbers n and mΒ (2ββ€βn,βmββ€β100) β the dimensions of the matrix. The second line contains n numbers a1,βa2,β...,βanΒ (0ββ€βaiββ€β109), where ai is the xor of all elements in row i. The third line contains m numbers b1,βb2,β...,βbmΒ (0ββ€βbiββ€β109), where bi is the xor of all elements in column i. | 1,800 | If there is no matrix satisfying the given constraints in the first line, output "NO". Otherwise, on the first line output "YES", and then n rows of m numbers in each ci1,βci2,β... ,βcimΒ (0ββ€βcijββ€β2Β·109) β the description of the matrix. If there are several suitable matrices, it is allowed to print any of them. | standard output | |
PASSED | cef09da8fd6f61bd5fa57614085073e9 | train_002.jsonl | 1533307500 | Now Vasya is taking an exam in mathematics. In order to get a good mark, Vasya needs to guess the matrix that the teacher has constructed!Vasya knows that the matrix consists of n rows and m columns. For each row, he knows the xor (bitwise excluding or) of the elements in this row. The sequence a1,βa2,β...,βan denotes ... | 256 megabytes | import java.util.InputMismatchException;
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
public class r48p4{
public static void main(String args[]) {
InputReader sc = new InputReader(System.in);
PrintWriter pw = new PrintWriter(System.out);
int row = sc... | Java | ["2 3\n2 9\n5 3 13", "3 3\n1 7 6\n2 15 12"] | 2 seconds | ["YES\n3 4 5\n6 7 8", "NO"] | null | Java 8 | standard input | [
"constructive algorithms",
"flows",
"math"
] | 3815d18843dbd15a73383d69eb6880dd | The first line contains two numbers n and mΒ (2ββ€βn,βmββ€β100) β the dimensions of the matrix. The second line contains n numbers a1,βa2,β...,βanΒ (0ββ€βaiββ€β109), where ai is the xor of all elements in row i. The third line contains m numbers b1,βb2,β...,βbmΒ (0ββ€βbiββ€β109), where bi is the xor of all elements in column i. | 1,800 | If there is no matrix satisfying the given constraints in the first line, output "NO". Otherwise, on the first line output "YES", and then n rows of m numbers in each ci1,βci2,β... ,βcimΒ (0ββ€βcijββ€β2Β·109) β the description of the matrix. If there are several suitable matrices, it is allowed to print any of them. | standard output | |
PASSED | 70f23c60ab8186dcc137219936931e76 | train_002.jsonl | 1533307500 | Now Vasya is taking an exam in mathematics. In order to get a good mark, Vasya needs to guess the matrix that the teacher has constructed!Vasya knows that the matrix consists of n rows and m columns. For each row, he knows the xor (bitwise excluding or) of the elements in this row. The sequence a1,βa2,β...,βan denotes ... | 256 megabytes |
import java.io.PrintWriter;
import java.util.Arrays;
import java.util.Scanner;
public class Vasya_And_The_Matrix {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
PrintWriter pw = new PrintWriter(System.out);
int n=sc.nextInt();
int m=sc.nextInt();
int [] a=new int [n];
int ... | Java | ["2 3\n2 9\n5 3 13", "3 3\n1 7 6\n2 15 12"] | 2 seconds | ["YES\n3 4 5\n6 7 8", "NO"] | null | Java 8 | standard input | [
"constructive algorithms",
"flows",
"math"
] | 3815d18843dbd15a73383d69eb6880dd | The first line contains two numbers n and mΒ (2ββ€βn,βmββ€β100) β the dimensions of the matrix. The second line contains n numbers a1,βa2,β...,βanΒ (0ββ€βaiββ€β109), where ai is the xor of all elements in row i. The third line contains m numbers b1,βb2,β...,βbmΒ (0ββ€βbiββ€β109), where bi is the xor of all elements in column i. | 1,800 | If there is no matrix satisfying the given constraints in the first line, output "NO". Otherwise, on the first line output "YES", and then n rows of m numbers in each ci1,βci2,β... ,βcimΒ (0ββ€βcijββ€β2Β·109) β the description of the matrix. If there are several suitable matrices, it is allowed to print any of them. | standard output | |
PASSED | 6438a26b4b1a5257331beea5b459d07a | train_002.jsonl | 1533307500 | Now Vasya is taking an exam in mathematics. In order to get a good mark, Vasya needs to guess the matrix that the teacher has constructed!Vasya knows that the matrix consists of n rows and m columns. For each row, he knows the xor (bitwise excluding or) of the elements in this row. The sequence a1,βa2,β...,βan denotes ... | 256 megabytes | import java.io.*;
import java.util.*;
public class Main {
private static class Solver {
private void Solve() {
int n = inp.nextInt();
int m = inp.nextInt();
int[] a = inp.nextIntArray(n);
int[] b = inp.nextIntArray(m);
int[][] ans = new int[n][m... | Java | ["2 3\n2 9\n5 3 13", "3 3\n1 7 6\n2 15 12"] | 2 seconds | ["YES\n3 4 5\n6 7 8", "NO"] | null | Java 8 | standard input | [
"constructive algorithms",
"flows",
"math"
] | 3815d18843dbd15a73383d69eb6880dd | The first line contains two numbers n and mΒ (2ββ€βn,βmββ€β100) β the dimensions of the matrix. The second line contains n numbers a1,βa2,β...,βanΒ (0ββ€βaiββ€β109), where ai is the xor of all elements in row i. The third line contains m numbers b1,βb2,β...,βbmΒ (0ββ€βbiββ€β109), where bi is the xor of all elements in column i. | 1,800 | If there is no matrix satisfying the given constraints in the first line, output "NO". Otherwise, on the first line output "YES", and then n rows of m numbers in each ci1,βci2,β... ,βcimΒ (0ββ€βcijββ€β2Β·109) β the description of the matrix. If there are several suitable matrices, it is allowed to print any of them. | standard output | |
PASSED | c6ea475a080dbaa853d718eb54ea55e8 | train_002.jsonl | 1533307500 | Now Vasya is taking an exam in mathematics. In order to get a good mark, Vasya needs to guess the matrix that the teacher has constructed!Vasya knows that the matrix consists of n rows and m columns. For each row, he knows the xor (bitwise excluding or) of the elements in this row. The sequence a1,βa2,β...,βan denotes ... | 256 megabytes | import java.util.*;
import java.io.*;
public class D1016{
public static void main(String args[])throws IOException{
Scanner sc=new Scanner(new BufferedReader(new InputStreamReader(System.in)));
PrintWriter pw=new PrintWriter(System.out);
int n=sc.nextInt();
int m=sc.nextInt();
int row[]=new int[n];
int x... | Java | ["2 3\n2 9\n5 3 13", "3 3\n1 7 6\n2 15 12"] | 2 seconds | ["YES\n3 4 5\n6 7 8", "NO"] | null | Java 8 | standard input | [
"constructive algorithms",
"flows",
"math"
] | 3815d18843dbd15a73383d69eb6880dd | The first line contains two numbers n and mΒ (2ββ€βn,βmββ€β100) β the dimensions of the matrix. The second line contains n numbers a1,βa2,β...,βanΒ (0ββ€βaiββ€β109), where ai is the xor of all elements in row i. The third line contains m numbers b1,βb2,β...,βbmΒ (0ββ€βbiββ€β109), where bi is the xor of all elements in column i. | 1,800 | If there is no matrix satisfying the given constraints in the first line, output "NO". Otherwise, on the first line output "YES", and then n rows of m numbers in each ci1,βci2,β... ,βcimΒ (0ββ€βcijββ€β2Β·109) β the description of the matrix. If there are several suitable matrices, it is allowed to print any of them. | standard output | |
PASSED | 674ace273f1af2652c15d55e6ce88aa1 | train_002.jsonl | 1533307500 | Now Vasya is taking an exam in mathematics. In order to get a good mark, Vasya needs to guess the matrix that the teacher has constructed!Vasya knows that the matrix consists of n rows and m columns. For each row, he knows the xor (bitwise excluding or) of the elements in this row. The sequence a1,βa2,β...,βan denotes ... | 256 megabytes |
import java.io.FileInputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import java.nio.charset.Charset;
import java.util.Comparator;
public class ECF48A {
public static void main(String[] args) throws Exception {
boolean local = System.getProperty("ONLINE_JUDG... | Java | ["2 3\n2 9\n5 3 13", "3 3\n1 7 6\n2 15 12"] | 2 seconds | ["YES\n3 4 5\n6 7 8", "NO"] | null | Java 8 | standard input | [
"constructive algorithms",
"flows",
"math"
] | 3815d18843dbd15a73383d69eb6880dd | The first line contains two numbers n and mΒ (2ββ€βn,βmββ€β100) β the dimensions of the matrix. The second line contains n numbers a1,βa2,β...,βanΒ (0ββ€βaiββ€β109), where ai is the xor of all elements in row i. The third line contains m numbers b1,βb2,β...,βbmΒ (0ββ€βbiββ€β109), where bi is the xor of all elements in column i. | 1,800 | If there is no matrix satisfying the given constraints in the first line, output "NO". Otherwise, on the first line output "YES", and then n rows of m numbers in each ci1,βci2,β... ,βcimΒ (0ββ€βcijββ€β2Β·109) β the description of the matrix. If there are several suitable matrices, it is allowed to print any of them. | standard output | |
PASSED | cba66e09fe9e9880c9389baccf02b216 | train_002.jsonl | 1533307500 | Now Vasya is taking an exam in mathematics. In order to get a good mark, Vasya needs to guess the matrix that the teacher has constructed!Vasya knows that the matrix consists of n rows and m columns. For each row, he knows the xor (bitwise excluding or) of the elements in this row. The sequence a1,βa2,β...,βan denotes ... | 256 megabytes | import java.io.*;
import java.util.*;
public class D {
static long mod = (long)1e9+7;
public static void main(String[] args) {
FastScanner sc=new FastScanner();
int n = sc.nextInt();
int m = sc.nextInt();
int ar[] = sc.readArray(n);
int br[] = sc.readArray(m);
int xor = 0;
for(int i : ar)
xor^= i;
... | Java | ["2 3\n2 9\n5 3 13", "3 3\n1 7 6\n2 15 12"] | 2 seconds | ["YES\n3 4 5\n6 7 8", "NO"] | null | Java 8 | standard input | [
"constructive algorithms",
"flows",
"math"
] | 3815d18843dbd15a73383d69eb6880dd | The first line contains two numbers n and mΒ (2ββ€βn,βmββ€β100) β the dimensions of the matrix. The second line contains n numbers a1,βa2,β...,βanΒ (0ββ€βaiββ€β109), where ai is the xor of all elements in row i. The third line contains m numbers b1,βb2,β...,βbmΒ (0ββ€βbiββ€β109), where bi is the xor of all elements in column i. | 1,800 | If there is no matrix satisfying the given constraints in the first line, output "NO". Otherwise, on the first line output "YES", and then n rows of m numbers in each ci1,βci2,β... ,βcimΒ (0ββ€βcijββ€β2Β·109) β the description of the matrix. If there are several suitable matrices, it is allowed to print any of them. | standard output | |
PASSED | df0fb6b11e3260b5184bd9a43863fdbe | train_002.jsonl | 1533307500 | Now Vasya is taking an exam in mathematics. In order to get a good mark, Vasya needs to guess the matrix that the teacher has constructed!Vasya knows that the matrix consists of n rows and m columns. For each row, he knows the xor (bitwise excluding or) of the elements in this row. The sequence a1,βa2,β...,βan denotes ... | 256 megabytes | import java.io.OutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.util.StringTokenizer;
import java.io.IOException;
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.io.InputStream;
/**
* Built using CHelper plug-in
* Actual soluti... | Java | ["2 3\n2 9\n5 3 13", "3 3\n1 7 6\n2 15 12"] | 2 seconds | ["YES\n3 4 5\n6 7 8", "NO"] | null | Java 8 | standard input | [
"constructive algorithms",
"flows",
"math"
] | 3815d18843dbd15a73383d69eb6880dd | The first line contains two numbers n and mΒ (2ββ€βn,βmββ€β100) β the dimensions of the matrix. The second line contains n numbers a1,βa2,β...,βanΒ (0ββ€βaiββ€β109), where ai is the xor of all elements in row i. The third line contains m numbers b1,βb2,β...,βbmΒ (0ββ€βbiββ€β109), where bi is the xor of all elements in column i. | 1,800 | If there is no matrix satisfying the given constraints in the first line, output "NO". Otherwise, on the first line output "YES", and then n rows of m numbers in each ci1,βci2,β... ,βcimΒ (0ββ€βcijββ€β2Β·109) β the description of the matrix. If there are several suitable matrices, it is allowed to print any of them. | standard output | |
PASSED | a4a1ac6f7c104817e892712f1644e282 | train_002.jsonl | 1533307500 | Now Vasya is taking an exam in mathematics. In order to get a good mark, Vasya needs to guess the matrix that the teacher has constructed!Vasya knows that the matrix consists of n rows and m columns. For each row, he knows the xor (bitwise excluding or) of the elements in this row. The sequence a1,βa2,β...,βan denotes ... | 256 megabytes | import java.util.*;
import java.io.*;
public class A {
public static void main(String[] args) {
FastScanner fs=new FastScanner();
int height=fs.nextInt();
int width=fs.nextInt();
int[] rowXors=fs.readArray(height);
int[] colXors=fs.readArray(width);
int[][] matrix=new int[width][height];
for (int i=0;... | Java | ["2 3\n2 9\n5 3 13", "3 3\n1 7 6\n2 15 12"] | 2 seconds | ["YES\n3 4 5\n6 7 8", "NO"] | null | Java 8 | standard input | [
"constructive algorithms",
"flows",
"math"
] | 3815d18843dbd15a73383d69eb6880dd | The first line contains two numbers n and mΒ (2ββ€βn,βmββ€β100) β the dimensions of the matrix. The second line contains n numbers a1,βa2,β...,βanΒ (0ββ€βaiββ€β109), where ai is the xor of all elements in row i. The third line contains m numbers b1,βb2,β...,βbmΒ (0ββ€βbiββ€β109), where bi is the xor of all elements in column i. | 1,800 | If there is no matrix satisfying the given constraints in the first line, output "NO". Otherwise, on the first line output "YES", and then n rows of m numbers in each ci1,βci2,β... ,βcimΒ (0ββ€βcijββ€β2Β·109) β the description of the matrix. If there are several suitable matrices, it is allowed to print any of them. | standard output | |
PASSED | f548fdce74cd660f54db00d419683e09 | train_002.jsonl | 1533307500 | Now Vasya is taking an exam in mathematics. In order to get a good mark, Vasya needs to guess the matrix that the teacher has constructed!Vasya knows that the matrix consists of n rows and m columns. For each row, he knows the xor (bitwise excluding or) of the elements in this row. The sequence a1,βa2,β...,βan denotes ... | 256 megabytes | import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.util.Random;
import java.util.StringTokenizer;
public class Main implements Runnable {
int INF = (int) 1e9 + 7;
static class Pair {
long a;
long b;
public Pair(long a, long b)... | Java | ["2 3\n2 9\n5 3 13", "3 3\n1 7 6\n2 15 12"] | 2 seconds | ["YES\n3 4 5\n6 7 8", "NO"] | null | Java 8 | standard input | [
"constructive algorithms",
"flows",
"math"
] | 3815d18843dbd15a73383d69eb6880dd | The first line contains two numbers n and mΒ (2ββ€βn,βmββ€β100) β the dimensions of the matrix. The second line contains n numbers a1,βa2,β...,βanΒ (0ββ€βaiββ€β109), where ai is the xor of all elements in row i. The third line contains m numbers b1,βb2,β...,βbmΒ (0ββ€βbiββ€β109), where bi is the xor of all elements in column i. | 1,800 | If there is no matrix satisfying the given constraints in the first line, output "NO". Otherwise, on the first line output "YES", and then n rows of m numbers in each ci1,βci2,β... ,βcimΒ (0ββ€βcijββ€β2Β·109) β the description of the matrix. If there are several suitable matrices, it is allowed to print any of them. | standard output | |
PASSED | 5ffbbbe44dc8ac61a4cda8b10f300f76 | train_002.jsonl | 1533307500 | Now Vasya is taking an exam in mathematics. In order to get a good mark, Vasya needs to guess the matrix that the teacher has constructed!Vasya knows that the matrix consists of n rows and m columns. For each row, he knows the xor (bitwise excluding or) of the elements in this row. The sequence a1,βa2,β...,βan denotes ... | 256 megabytes | import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.util.Random;
import java.util.StringTokenizer;
public class Main implements Runnable {
int INF = (int) 1e9 + 7;
static class Pair {
long a;
long b;
public Pair(long a, long b)... | Java | ["2 3\n2 9\n5 3 13", "3 3\n1 7 6\n2 15 12"] | 2 seconds | ["YES\n3 4 5\n6 7 8", "NO"] | null | Java 8 | standard input | [
"constructive algorithms",
"flows",
"math"
] | 3815d18843dbd15a73383d69eb6880dd | The first line contains two numbers n and mΒ (2ββ€βn,βmββ€β100) β the dimensions of the matrix. The second line contains n numbers a1,βa2,β...,βanΒ (0ββ€βaiββ€β109), where ai is the xor of all elements in row i. The third line contains m numbers b1,βb2,β...,βbmΒ (0ββ€βbiββ€β109), where bi is the xor of all elements in column i. | 1,800 | If there is no matrix satisfying the given constraints in the first line, output "NO". Otherwise, on the first line output "YES", and then n rows of m numbers in each ci1,βci2,β... ,βcimΒ (0ββ€βcijββ€β2Β·109) β the description of the matrix. If there are several suitable matrices, it is allowed to print any of them. | standard output | |
PASSED | b7772e58b472acecd3baf3079742365a | train_002.jsonl | 1533307500 | Now Vasya is taking an exam in mathematics. In order to get a good mark, Vasya needs to guess the matrix that the teacher has constructed!Vasya knows that the matrix consists of n rows and m columns. For each row, he knows the xor (bitwise excluding or) of the elements in this row. The sequence a1,βa2,β...,βan denotes ... | 256 megabytes | import java.util.*;
import java.io.*;
public class Main
{
public static void main(String[] args)
{
FastReader reader = new FastReader();
PrintWriter writer = new PrintWriter(System.out);
int n = reader.nextInt();
int m = reader.nextInt();
long[] a = new long[n];
long[] b = new long[m];
long xor = 0;... | Java | ["2 3\n2 9\n5 3 13", "3 3\n1 7 6\n2 15 12"] | 2 seconds | ["YES\n3 4 5\n6 7 8", "NO"] | null | Java 8 | standard input | [
"constructive algorithms",
"flows",
"math"
] | 3815d18843dbd15a73383d69eb6880dd | The first line contains two numbers n and mΒ (2ββ€βn,βmββ€β100) β the dimensions of the matrix. The second line contains n numbers a1,βa2,β...,βanΒ (0ββ€βaiββ€β109), where ai is the xor of all elements in row i. The third line contains m numbers b1,βb2,β...,βbmΒ (0ββ€βbiββ€β109), where bi is the xor of all elements in column i. | 1,800 | If there is no matrix satisfying the given constraints in the first line, output "NO". Otherwise, on the first line output "YES", and then n rows of m numbers in each ci1,βci2,β... ,βcimΒ (0ββ€βcijββ€β2Β·109) β the description of the matrix. If there are several suitable matrices, it is allowed to print any of them. | standard output | |
PASSED | cd7e9d9b3fdc11d676d2e2a63bae81df | train_002.jsonl | 1533307500 | Now Vasya is taking an exam in mathematics. In order to get a good mark, Vasya needs to guess the matrix that the teacher has constructed!Vasya knows that the matrix consists of n rows and m columns. For each row, he knows the xor (bitwise excluding or) of the elements in this row. The sequence a1,βa2,β...,βan denotes ... | 256 megabytes | import java.util.*;
import java.io.*;
public class Main
{
public static void main(String[] args)
{
FastReader reader = new FastReader();
PrintWriter writer = new PrintWriter(System.out);
//maybe
int n = reader.nextInt();
int m = reader.nextInt();
long[] a = new long[n];
long[] b = new long[m];... | Java | ["2 3\n2 9\n5 3 13", "3 3\n1 7 6\n2 15 12"] | 2 seconds | ["YES\n3 4 5\n6 7 8", "NO"] | null | Java 8 | standard input | [
"constructive algorithms",
"flows",
"math"
] | 3815d18843dbd15a73383d69eb6880dd | The first line contains two numbers n and mΒ (2ββ€βn,βmββ€β100) β the dimensions of the matrix. The second line contains n numbers a1,βa2,β...,βanΒ (0ββ€βaiββ€β109), where ai is the xor of all elements in row i. The third line contains m numbers b1,βb2,β...,βbmΒ (0ββ€βbiββ€β109), where bi is the xor of all elements in column i. | 1,800 | If there is no matrix satisfying the given constraints in the first line, output "NO". Otherwise, on the first line output "YES", and then n rows of m numbers in each ci1,βci2,β... ,βcimΒ (0ββ€βcijββ€β2Β·109) β the description of the matrix. If there are several suitable matrices, it is allowed to print any of them. | standard output | |
PASSED | c49393956e63ff48a0ee547e03365d24 | train_002.jsonl | 1533307500 | Now Vasya is taking an exam in mathematics. In order to get a good mark, Vasya needs to guess the matrix that the teacher has constructed!Vasya knows that the matrix consists of n rows and m columns. For each row, he knows the xor (bitwise excluding or) of the elements in this row. The sequence a1,βa2,β...,βan denotes ... | 256 megabytes | import java.util.*;
import java.io.*;
public class Main
{
public static void main(String[] args)
{
FastReader reader = new FastReader();
PrintWriter writer = new PrintWriter(System.out);
//sample
int n = reader.nextInt();
int m = reader.nextInt();
long[] a = new long[n];
long[] b = new long[m]... | Java | ["2 3\n2 9\n5 3 13", "3 3\n1 7 6\n2 15 12"] | 2 seconds | ["YES\n3 4 5\n6 7 8", "NO"] | null | Java 8 | standard input | [
"constructive algorithms",
"flows",
"math"
] | 3815d18843dbd15a73383d69eb6880dd | The first line contains two numbers n and mΒ (2ββ€βn,βmββ€β100) β the dimensions of the matrix. The second line contains n numbers a1,βa2,β...,βanΒ (0ββ€βaiββ€β109), where ai is the xor of all elements in row i. The third line contains m numbers b1,βb2,β...,βbmΒ (0ββ€βbiββ€β109), where bi is the xor of all elements in column i. | 1,800 | If there is no matrix satisfying the given constraints in the first line, output "NO". Otherwise, on the first line output "YES", and then n rows of m numbers in each ci1,βci2,β... ,βcimΒ (0ββ€βcijββ€β2Β·109) β the description of the matrix. If there are several suitable matrices, it is allowed to print any of them. | standard output | |
PASSED | dfaf916bd763fa7cf63961852577c166 | train_002.jsonl | 1533307500 | Now Vasya is taking an exam in mathematics. In order to get a good mark, Vasya needs to guess the matrix that the teacher has constructed!Vasya knows that the matrix consists of n rows and m columns. For each row, he knows the xor (bitwise excluding or) of the elements in this row. The sequence a1,βa2,β...,βan denotes ... | 256 megabytes | import java.io.*;
import java.util.Arrays;
import java.util.BitSet;
import java.util.Scanner;
public class Main {
static int N=1010;
static int[][] map=new int[110][110];
static int[] a=new int[110];
static int[] b=new int[110];
static int n,m,k,q,tot,root;
static Strea... | Java | ["2 3\n2 9\n5 3 13", "3 3\n1 7 6\n2 15 12"] | 2 seconds | ["YES\n3 4 5\n6 7 8", "NO"] | null | Java 8 | standard input | [
"constructive algorithms",
"flows",
"math"
] | 3815d18843dbd15a73383d69eb6880dd | The first line contains two numbers n and mΒ (2ββ€βn,βmββ€β100) β the dimensions of the matrix. The second line contains n numbers a1,βa2,β...,βanΒ (0ββ€βaiββ€β109), where ai is the xor of all elements in row i. The third line contains m numbers b1,βb2,β...,βbmΒ (0ββ€βbiββ€β109), where bi is the xor of all elements in column i. | 1,800 | If there is no matrix satisfying the given constraints in the first line, output "NO". Otherwise, on the first line output "YES", and then n rows of m numbers in each ci1,βci2,β... ,βcimΒ (0ββ€βcijββ€β2Β·109) β the description of the matrix. If there are several suitable matrices, it is allowed to print any of them. | standard output | |
PASSED | bf9dae07b3bab71caa6a5ca98cadf604 | train_002.jsonl | 1533307500 | Now Vasya is taking an exam in mathematics. In order to get a good mark, Vasya needs to guess the matrix that the teacher has constructed!Vasya knows that the matrix consists of n rows and m columns. For each row, he knows the xor (bitwise excluding or) of the elements in this row. The sequence a1,βa2,β...,βan denotes ... | 256 megabytes | //package pack;
import java.util.*;
public class second
{
public static void main(String[] args)
{
Scanner sc=new Scanner(System.in);
int n=sc.nextInt();
int m=sc.nextInt();
int[][] arr=new int[n][m];
int[] rowarr=new int[n];
int[] colarr=new int[m];
int xor=0;
int xor1=0;
int xor2=0;
... | Java | ["2 3\n2 9\n5 3 13", "3 3\n1 7 6\n2 15 12"] | 2 seconds | ["YES\n3 4 5\n6 7 8", "NO"] | null | Java 8 | standard input | [
"constructive algorithms",
"flows",
"math"
] | 3815d18843dbd15a73383d69eb6880dd | The first line contains two numbers n and mΒ (2ββ€βn,βmββ€β100) β the dimensions of the matrix. The second line contains n numbers a1,βa2,β...,βanΒ (0ββ€βaiββ€β109), where ai is the xor of all elements in row i. The third line contains m numbers b1,βb2,β...,βbmΒ (0ββ€βbiββ€β109), where bi is the xor of all elements in column i. | 1,800 | If there is no matrix satisfying the given constraints in the first line, output "NO". Otherwise, on the first line output "YES", and then n rows of m numbers in each ci1,βci2,β... ,βcimΒ (0ββ€βcijββ€β2Β·109) β the description of the matrix. If there are several suitable matrices, it is allowed to print any of them. | standard output | |
PASSED | 6b5ef134dbdf762deccfbf867e4bd021 | train_002.jsonl | 1533307500 | Now Vasya is taking an exam in mathematics. In order to get a good mark, Vasya needs to guess the matrix that the teacher has constructed!Vasya knows that the matrix consists of n rows and m columns. For each row, he knows the xor (bitwise excluding or) of the elements in this row. The sequence a1,βa2,β...,βan denotes ... | 256 megabytes | /*
*
* @Author Ajudiya_13(Bhargav Girdharbhai Ajudiya)
* Dhirubhai Ambani Institute of Information And Communication Technology
*
*/
import java.util.*;
import java.io.*;
import java.lang.*;
public class Code330
{
public static void main(String[] args)
{
InputReader in = new InputReader(System.in);
... | Java | ["2 3\n2 9\n5 3 13", "3 3\n1 7 6\n2 15 12"] | 2 seconds | ["YES\n3 4 5\n6 7 8", "NO"] | null | Java 8 | standard input | [
"constructive algorithms",
"flows",
"math"
] | 3815d18843dbd15a73383d69eb6880dd | The first line contains two numbers n and mΒ (2ββ€βn,βmββ€β100) β the dimensions of the matrix. The second line contains n numbers a1,βa2,β...,βanΒ (0ββ€βaiββ€β109), where ai is the xor of all elements in row i. The third line contains m numbers b1,βb2,β...,βbmΒ (0ββ€βbiββ€β109), where bi is the xor of all elements in column i. | 1,800 | If there is no matrix satisfying the given constraints in the first line, output "NO". Otherwise, on the first line output "YES", and then n rows of m numbers in each ci1,βci2,β... ,βcimΒ (0ββ€βcijββ€β2Β·109) β the description of the matrix. If there are several suitable matrices, it is allowed to print any of them. | standard output | |
PASSED | 969450e1d0d0ddf25a4bb9b6b146a435 | train_002.jsonl | 1533307500 | Now Vasya is taking an exam in mathematics. In order to get a good mark, Vasya needs to guess the matrix that the teacher has constructed!Vasya knows that the matrix consists of n rows and m columns. For each row, he knows the xor (bitwise excluding or) of the elements in this row. The sequence a1,βa2,β...,βan denotes ... | 256 megabytes | import java.io.*;
import java.util.StringTokenizer;
public class Solution {
public static void main(String[] args) throws IOException {
FastScanner in = new FastScanner(System.in);
PrintWriter out = new PrintWriter(System.out);
int n = in.nextInt();
int m = in.nextInt();
int... | Java | ["2 3\n2 9\n5 3 13", "3 3\n1 7 6\n2 15 12"] | 2 seconds | ["YES\n3 4 5\n6 7 8", "NO"] | null | Java 8 | standard input | [
"constructive algorithms",
"flows",
"math"
] | 3815d18843dbd15a73383d69eb6880dd | The first line contains two numbers n and mΒ (2ββ€βn,βmββ€β100) β the dimensions of the matrix. The second line contains n numbers a1,βa2,β...,βanΒ (0ββ€βaiββ€β109), where ai is the xor of all elements in row i. The third line contains m numbers b1,βb2,β...,βbmΒ (0ββ€βbiββ€β109), where bi is the xor of all elements in column i. | 1,800 | If there is no matrix satisfying the given constraints in the first line, output "NO". Otherwise, on the first line output "YES", and then n rows of m numbers in each ci1,βci2,β... ,βcimΒ (0ββ€βcijββ€β2Β·109) β the description of the matrix. If there are several suitable matrices, it is allowed to print any of them. | standard output | |
PASSED | 9fde1df890fa3e436f47938687540305 | train_002.jsonl | 1533307500 | Now Vasya is taking an exam in mathematics. In order to get a good mark, Vasya needs to guess the matrix that the teacher has constructed!Vasya knows that the matrix consists of n rows and m columns. For each row, he knows the xor (bitwise excluding or) of the elements in this row. The sequence a1,βa2,β...,βan denotes ... | 256 megabytes | //package aug;
import java.io.*;
import java.util.*;
public class EdRnd48D {
InputStream is;
PrintWriter out;
String INPUT = "";
//boolean codechef=true;
boolean codechef=true;
void solve()
{
int n=ni(),m=ni();
int[] a=na(n);
int[] b=na(m);
int k1=0,k2=0,x=0,y=0;
for(int i=0;i<m-... | Java | ["2 3\n2 9\n5 3 13", "3 3\n1 7 6\n2 15 12"] | 2 seconds | ["YES\n3 4 5\n6 7 8", "NO"] | null | Java 8 | standard input | [
"constructive algorithms",
"flows",
"math"
] | 3815d18843dbd15a73383d69eb6880dd | The first line contains two numbers n and mΒ (2ββ€βn,βmββ€β100) β the dimensions of the matrix. The second line contains n numbers a1,βa2,β...,βanΒ (0ββ€βaiββ€β109), where ai is the xor of all elements in row i. The third line contains m numbers b1,βb2,β...,βbmΒ (0ββ€βbiββ€β109), where bi is the xor of all elements in column i. | 1,800 | If there is no matrix satisfying the given constraints in the first line, output "NO". Otherwise, on the first line output "YES", and then n rows of m numbers in each ci1,βci2,β... ,βcimΒ (0ββ€βcijββ€β2Β·109) β the description of the matrix. If there are several suitable matrices, it is allowed to print any of them. | standard output | |
PASSED | 86be406653957cab7d232002a434fee1 | train_002.jsonl | 1533307500 | Now Vasya is taking an exam in mathematics. In order to get a good mark, Vasya needs to guess the matrix that the teacher has constructed!Vasya knows that the matrix consists of n rows and m columns. For each row, he knows the xor (bitwise excluding or) of the elements in this row. The sequence a1,βa2,β...,βan denotes ... | 256 megabytes | /* Author: Ronak Agarwal, reader part not written by me*/
import java.io.* ; import java.util.* ;
import static java.lang.Math.min ; import static java.lang.Math.max ;
import static java.lang.Math.abs ; import static java.lang.Math.log ;
import static java.lang.Math.pow ; import static java.lang.Math.sqrt ;
/* Thread i... | Java | ["2 3\n2 9\n5 3 13", "3 3\n1 7 6\n2 15 12"] | 2 seconds | ["YES\n3 4 5\n6 7 8", "NO"] | null | Java 8 | standard input | [
"constructive algorithms",
"flows",
"math"
] | 3815d18843dbd15a73383d69eb6880dd | The first line contains two numbers n and mΒ (2ββ€βn,βmββ€β100) β the dimensions of the matrix. The second line contains n numbers a1,βa2,β...,βanΒ (0ββ€βaiββ€β109), where ai is the xor of all elements in row i. The third line contains m numbers b1,βb2,β...,βbmΒ (0ββ€βbiββ€β109), where bi is the xor of all elements in column i. | 1,800 | If there is no matrix satisfying the given constraints in the first line, output "NO". Otherwise, on the first line output "YES", and then n rows of m numbers in each ci1,βci2,β... ,βcimΒ (0ββ€βcijββ€β2Β·109) β the description of the matrix. If there are several suitable matrices, it is allowed to print any of them. | standard output | |
PASSED | aed27f82b096d78d587faea7d5ab616e | train_002.jsonl | 1533307500 | Now Vasya is taking an exam in mathematics. In order to get a good mark, Vasya needs to guess the matrix that the teacher has constructed!Vasya knows that the matrix consists of n rows and m columns. For each row, he knows the xor (bitwise excluding or) of the elements in this row. The sequence a1,βa2,β...,βan denotes ... | 256 megabytes | import java.io.OutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.util.InputMismatchException;
import java.io.IOException;
import java.io.InputStream;
/**
* Built using CHelper plug-in Actual solution is at the top
*
* @author MaxHeap
*/
public class Main ... | Java | ["2 3\n2 9\n5 3 13", "3 3\n1 7 6\n2 15 12"] | 2 seconds | ["YES\n3 4 5\n6 7 8", "NO"] | null | Java 8 | standard input | [
"constructive algorithms",
"flows",
"math"
] | 3815d18843dbd15a73383d69eb6880dd | The first line contains two numbers n and mΒ (2ββ€βn,βmββ€β100) β the dimensions of the matrix. The second line contains n numbers a1,βa2,β...,βanΒ (0ββ€βaiββ€β109), where ai is the xor of all elements in row i. The third line contains m numbers b1,βb2,β...,βbmΒ (0ββ€βbiββ€β109), where bi is the xor of all elements in column i. | 1,800 | If there is no matrix satisfying the given constraints in the first line, output "NO". Otherwise, on the first line output "YES", and then n rows of m numbers in each ci1,βci2,β... ,βcimΒ (0ββ€βcijββ€β2Β·109) β the description of the matrix. If there are several suitable matrices, it is allowed to print any of them. | standard output | |
PASSED | 808507d8424ef5cdedd0dae4effa22a5 | train_002.jsonl | 1533307500 | Now Vasya is taking an exam in mathematics. In order to get a good mark, Vasya needs to guess the matrix that the teacher has constructed!Vasya knows that the matrix consists of n rows and m columns. For each row, he knows the xor (bitwise excluding or) of the elements in this row. The sequence a1,βa2,β...,βan denotes ... | 256 megabytes | import java.io.BufferedReader;
// import java.io.FileInputStream;
// import java.io.FileOutputStream;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.IOException;
import java.io.PrintWriter;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.StringTokenizer;
import stati... | Java | ["2 3\n2 9\n5 3 13", "3 3\n1 7 6\n2 15 12"] | 2 seconds | ["YES\n3 4 5\n6 7 8", "NO"] | null | Java 8 | standard input | [
"constructive algorithms",
"flows",
"math"
] | 3815d18843dbd15a73383d69eb6880dd | The first line contains two numbers n and mΒ (2ββ€βn,βmββ€β100) β the dimensions of the matrix. The second line contains n numbers a1,βa2,β...,βanΒ (0ββ€βaiββ€β109), where ai is the xor of all elements in row i. The third line contains m numbers b1,βb2,β...,βbmΒ (0ββ€βbiββ€β109), where bi is the xor of all elements in column i. | 1,800 | If there is no matrix satisfying the given constraints in the first line, output "NO". Otherwise, on the first line output "YES", and then n rows of m numbers in each ci1,βci2,β... ,βcimΒ (0ββ€βcijββ€β2Β·109) β the description of the matrix. If there are several suitable matrices, it is allowed to print any of them. | standard output | |
PASSED | 391ec56e71323549237f840eab3a92b1 | train_002.jsonl | 1533307500 | Now Vasya is taking an exam in mathematics. In order to get a good mark, Vasya needs to guess the matrix that the teacher has constructed!Vasya knows that the matrix consists of n rows and m columns. For each row, he knows the xor (bitwise excluding or) of the elements in this row. The sequence a1,βa2,β...,βan denotes ... | 256 megabytes | import java.io.BufferedReader;
import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.IOException;
import java.io.PrintWriter;
import java.math.BigInteger;
import java.util.ArrayList;
import java.util.StringTokenizer;
import java.uti... | Java | ["2 3\n2 9\n5 3 13", "3 3\n1 7 6\n2 15 12"] | 2 seconds | ["YES\n3 4 5\n6 7 8", "NO"] | null | Java 8 | standard input | [
"constructive algorithms",
"flows",
"math"
] | 3815d18843dbd15a73383d69eb6880dd | The first line contains two numbers n and mΒ (2ββ€βn,βmββ€β100) β the dimensions of the matrix. The second line contains n numbers a1,βa2,β...,βanΒ (0ββ€βaiββ€β109), where ai is the xor of all elements in row i. The third line contains m numbers b1,βb2,β...,βbmΒ (0ββ€βbiββ€β109), where bi is the xor of all elements in column i. | 1,800 | If there is no matrix satisfying the given constraints in the first line, output "NO". Otherwise, on the first line output "YES", and then n rows of m numbers in each ci1,βci2,β... ,βcimΒ (0ββ€βcijββ€β2Β·109) β the description of the matrix. If there are several suitable matrices, it is allowed to print any of them. | standard output | |
PASSED | 0f7b9c8c052bbef07f46794fa21cbf0c | train_002.jsonl | 1533307500 | Now Vasya is taking an exam in mathematics. In order to get a good mark, Vasya needs to guess the matrix that the teacher has constructed!Vasya knows that the matrix consists of n rows and m columns. For each row, he knows the xor (bitwise excluding or) of the elements in this row. The sequence a1,βa2,β...,βan denotes ... | 256 megabytes | import java.io.*;
import java.util.*;
public class MainClass
{
public static void main(String[] args)throws IOException
{
Reader in = new Reader();
int n = in.nextInt();
int m = in.nextInt();
long[] rows = new long[n];
long[] cols = new long[m];
long xor = 0L;
... | Java | ["2 3\n2 9\n5 3 13", "3 3\n1 7 6\n2 15 12"] | 2 seconds | ["YES\n3 4 5\n6 7 8", "NO"] | null | Java 8 | standard input | [
"constructive algorithms",
"flows",
"math"
] | 3815d18843dbd15a73383d69eb6880dd | The first line contains two numbers n and mΒ (2ββ€βn,βmββ€β100) β the dimensions of the matrix. The second line contains n numbers a1,βa2,β...,βanΒ (0ββ€βaiββ€β109), where ai is the xor of all elements in row i. The third line contains m numbers b1,βb2,β...,βbmΒ (0ββ€βbiββ€β109), where bi is the xor of all elements in column i. | 1,800 | If there is no matrix satisfying the given constraints in the first line, output "NO". Otherwise, on the first line output "YES", and then n rows of m numbers in each ci1,βci2,β... ,βcimΒ (0ββ€βcijββ€β2Β·109) β the description of the matrix. If there are several suitable matrices, it is allowed to print any of them. | standard output | |
PASSED | 804b34fac0c0338d807aa2f3a941b1ce | train_002.jsonl | 1533307500 | Now Vasya is taking an exam in mathematics. In order to get a good mark, Vasya needs to guess the matrix that the teacher has constructed!Vasya knows that the matrix consists of n rows and m columns. For each row, he knows the xor (bitwise excluding or) of the elements in this row. The sequence a1,βa2,β...,βan denotes ... | 256 megabytes | import java.io.BufferedReader;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.math.BigInteger;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.BitS... | Java | ["2 3\n2 9\n5 3 13", "3 3\n1 7 6\n2 15 12"] | 2 seconds | ["YES\n3 4 5\n6 7 8", "NO"] | null | Java 8 | standard input | [
"constructive algorithms",
"flows",
"math"
] | 3815d18843dbd15a73383d69eb6880dd | The first line contains two numbers n and mΒ (2ββ€βn,βmββ€β100) β the dimensions of the matrix. The second line contains n numbers a1,βa2,β...,βanΒ (0ββ€βaiββ€β109), where ai is the xor of all elements in row i. The third line contains m numbers b1,βb2,β...,βbmΒ (0ββ€βbiββ€β109), where bi is the xor of all elements in column i. | 1,800 | If there is no matrix satisfying the given constraints in the first line, output "NO". Otherwise, on the first line output "YES", and then n rows of m numbers in each ci1,βci2,β... ,βcimΒ (0ββ€βcijββ€β2Β·109) β the description of the matrix. If there are several suitable matrices, it is allowed to print any of them. | standard output | |
PASSED | 5406f4218878367a99bf7d5b90ff27d0 | train_002.jsonl | 1533307500 | Now Vasya is taking an exam in mathematics. In order to get a good mark, Vasya needs to guess the matrix that the teacher has constructed!Vasya knows that the matrix consists of n rows and m columns. For each row, he knows the xor (bitwise excluding or) of the elements in this row. The sequence a1,βa2,β...,βan denotes ... | 256 megabytes | import java.util.*;
import java.io.BufferedReader;
import java.io.BufferedWriter;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.OutputStreamWriter;
import java.util.Scanner;
import java.util.StringTokenizer;
public class temp {
void solve() throws IOException
{
FastRea... | Java | ["2 3\n2 9\n5 3 13", "3 3\n1 7 6\n2 15 12"] | 2 seconds | ["YES\n3 4 5\n6 7 8", "NO"] | null | Java 8 | standard input | [
"constructive algorithms",
"flows",
"math"
] | 3815d18843dbd15a73383d69eb6880dd | The first line contains two numbers n and mΒ (2ββ€βn,βmββ€β100) β the dimensions of the matrix. The second line contains n numbers a1,βa2,β...,βanΒ (0ββ€βaiββ€β109), where ai is the xor of all elements in row i. The third line contains m numbers b1,βb2,β...,βbmΒ (0ββ€βbiββ€β109), where bi is the xor of all elements in column i. | 1,800 | If there is no matrix satisfying the given constraints in the first line, output "NO". Otherwise, on the first line output "YES", and then n rows of m numbers in each ci1,βci2,β... ,βcimΒ (0ββ€βcijββ€β2Β·109) β the description of the matrix. If there are several suitable matrices, it is allowed to print any of them. | standard output | |
PASSED | eed3ea1e69213e526a3f2235740c2512 | train_002.jsonl | 1533307500 | Now Vasya is taking an exam in mathematics. In order to get a good mark, Vasya needs to guess the matrix that the teacher has constructed!Vasya knows that the matrix consists of n rows and m columns. For each row, he knows the xor (bitwise excluding or) of the elements in this row. The sequence a1,βa2,β...,βan denotes ... | 256 megabytes | import java.io.*;
import java.util.*;
import java.text.*;
import java.lang.*;
import java.math.BigInteger;
import java.util.regex.*;
public class Myclass {
/*public static ArrayList a[]=new ArrayList[200001];
static boolean visited[]=new boolean [200001];
static long value[];
static long maxi[];
static long d... | Java | ["2 3\n2 9\n5 3 13", "3 3\n1 7 6\n2 15 12"] | 2 seconds | ["YES\n3 4 5\n6 7 8", "NO"] | null | Java 8 | standard input | [
"constructive algorithms",
"flows",
"math"
] | 3815d18843dbd15a73383d69eb6880dd | The first line contains two numbers n and mΒ (2ββ€βn,βmββ€β100) β the dimensions of the matrix. The second line contains n numbers a1,βa2,β...,βanΒ (0ββ€βaiββ€β109), where ai is the xor of all elements in row i. The third line contains m numbers b1,βb2,β...,βbmΒ (0ββ€βbiββ€β109), where bi is the xor of all elements in column i. | 1,800 | If there is no matrix satisfying the given constraints in the first line, output "NO". Otherwise, on the first line output "YES", and then n rows of m numbers in each ci1,βci2,β... ,βcimΒ (0ββ€βcijββ€β2Β·109) β the description of the matrix. If there are several suitable matrices, it is allowed to print any of them. | standard output | |
PASSED | cf578ff4672d6544de057eab7d47122c | train_002.jsonl | 1533307500 | Now Vasya is taking an exam in mathematics. In order to get a good mark, Vasya needs to guess the matrix that the teacher has constructed!Vasya knows that the matrix consists of n rows and m columns. For each row, he knows the xor (bitwise excluding or) of the elements in this row. The sequence a1,βa2,β...,βan denotes ... | 256 megabytes | import java.util.Scanner;
public class VasyaMatrix {
public static void main(String[] args) {
/*
*/
Scanner in = new Scanner(System.in);
int n = in.nextInt();
int m = in.nextInt();
int[] a = new int[n];
int[] b = new int[m];
int aXor = 0;
i... | Java | ["2 3\n2 9\n5 3 13", "3 3\n1 7 6\n2 15 12"] | 2 seconds | ["YES\n3 4 5\n6 7 8", "NO"] | null | Java 8 | standard input | [
"constructive algorithms",
"flows",
"math"
] | 3815d18843dbd15a73383d69eb6880dd | The first line contains two numbers n and mΒ (2ββ€βn,βmββ€β100) β the dimensions of the matrix. The second line contains n numbers a1,βa2,β...,βanΒ (0ββ€βaiββ€β109), where ai is the xor of all elements in row i. The third line contains m numbers b1,βb2,β...,βbmΒ (0ββ€βbiββ€β109), where bi is the xor of all elements in column i. | 1,800 | If there is no matrix satisfying the given constraints in the first line, output "NO". Otherwise, on the first line output "YES", and then n rows of m numbers in each ci1,βci2,β... ,βcimΒ (0ββ€βcijββ€β2Β·109) β the description of the matrix. If there are several suitable matrices, it is allowed to print any of them. | standard output | |
PASSED | e86447f575827d90c02c46993dfd6539 | train_002.jsonl | 1533307500 | Now Vasya is taking an exam in mathematics. In order to get a good mark, Vasya needs to guess the matrix that the teacher has constructed!Vasya knows that the matrix consists of n rows and m columns. For each row, he knows the xor (bitwise excluding or) of the elements in this row. The sequence a1,βa2,β...,βan denotes ... | 256 megabytes | import java.util.*;
import java.io.*;
public class codeforces
{
public static void main(String[] args)
{
InputReader in = new InputReader(System.in);
PrintWriter pw = new PrintWriter(System.out);
int n = in.nextInt();
int m = in.nextInt();
int[] a = in.nextIntArray(n);
in... | Java | ["2 3\n2 9\n5 3 13", "3 3\n1 7 6\n2 15 12"] | 2 seconds | ["YES\n3 4 5\n6 7 8", "NO"] | null | Java 8 | standard input | [
"constructive algorithms",
"flows",
"math"
] | 3815d18843dbd15a73383d69eb6880dd | The first line contains two numbers n and mΒ (2ββ€βn,βmββ€β100) β the dimensions of the matrix. The second line contains n numbers a1,βa2,β...,βanΒ (0ββ€βaiββ€β109), where ai is the xor of all elements in row i. The third line contains m numbers b1,βb2,β...,βbmΒ (0ββ€βbiββ€β109), where bi is the xor of all elements in column i. | 1,800 | If there is no matrix satisfying the given constraints in the first line, output "NO". Otherwise, on the first line output "YES", and then n rows of m numbers in each ci1,βci2,β... ,βcimΒ (0ββ€βcijββ€β2Β·109) β the description of the matrix. If there are several suitable matrices, it is allowed to print any of them. | standard output | |
PASSED | 287d7be068b8c522eceef06213467940 | train_002.jsonl | 1533307500 | Now Vasya is taking an exam in mathematics. In order to get a good mark, Vasya needs to guess the matrix that the teacher has constructed!Vasya knows that the matrix consists of n rows and m columns. For each row, he knows the xor (bitwise excluding or) of the elements in this row. The sequence a1,βa2,β...,βan denotes ... | 256 megabytes | import java.util.*;
import java.io.*;
import static java.lang.Math.*;
public class Main
{
static MyScanner scan;
static PrintWriter pw;
public static void main(String[] args) {
new Thread(null,null,"_",1<<25)
{
public void run()
{
try
{
... | Java | ["2 3\n2 9\n5 3 13", "3 3\n1 7 6\n2 15 12"] | 2 seconds | ["YES\n3 4 5\n6 7 8", "NO"] | null | Java 8 | standard input | [
"constructive algorithms",
"flows",
"math"
] | 3815d18843dbd15a73383d69eb6880dd | The first line contains two numbers n and mΒ (2ββ€βn,βmββ€β100) β the dimensions of the matrix. The second line contains n numbers a1,βa2,β...,βanΒ (0ββ€βaiββ€β109), where ai is the xor of all elements in row i. The third line contains m numbers b1,βb2,β...,βbmΒ (0ββ€βbiββ€β109), where bi is the xor of all elements in column i. | 1,800 | If there is no matrix satisfying the given constraints in the first line, output "NO". Otherwise, on the first line output "YES", and then n rows of m numbers in each ci1,βci2,β... ,βcimΒ (0ββ€βcijββ€β2Β·109) β the description of the matrix. If there are several suitable matrices, it is allowed to print any of them. | standard output | |
PASSED | 268cb0673c61126c6be03b19d900fcf4 | train_002.jsonl | 1533307500 | Now Vasya is taking an exam in mathematics. In order to get a good mark, Vasya needs to guess the matrix that the teacher has constructed!Vasya knows that the matrix consists of n rows and m columns. For each row, he knows the xor (bitwise excluding or) of the elements in this row. The sequence a1,βa2,β...,βan denotes ... | 256 megabytes | import java.io.OutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import java.io.PrintWriter;
import java.io.BufferedWriter;
import java.io.Writer;
import java.io.OutputStreamWriter;
import java.util.InputMismatchException;
import java.io.IOException;
import java.io.Input... | Java | ["2 3\n2 9\n5 3 13", "3 3\n1 7 6\n2 15 12"] | 2 seconds | ["YES\n3 4 5\n6 7 8", "NO"] | null | Java 8 | standard input | [
"constructive algorithms",
"flows",
"math"
] | 3815d18843dbd15a73383d69eb6880dd | The first line contains two numbers n and mΒ (2ββ€βn,βmββ€β100) β the dimensions of the matrix. The second line contains n numbers a1,βa2,β...,βanΒ (0ββ€βaiββ€β109), where ai is the xor of all elements in row i. The third line contains m numbers b1,βb2,β...,βbmΒ (0ββ€βbiββ€β109), where bi is the xor of all elements in column i. | 1,800 | If there is no matrix satisfying the given constraints in the first line, output "NO". Otherwise, on the first line output "YES", and then n rows of m numbers in each ci1,βci2,β... ,βcimΒ (0ββ€βcijββ€β2Β·109) β the description of the matrix. If there are several suitable matrices, it is allowed to print any of them. | standard output | |
PASSED | 7022d02a39a20857415b8b13c148f8ca | train_002.jsonl | 1533307500 | Now Vasya is taking an exam in mathematics. In order to get a good mark, Vasya needs to guess the matrix that the teacher has constructed!Vasya knows that the matrix consists of n rows and m columns. For each row, he knows the xor (bitwise excluding or) of the elements in this row. The sequence a1,βa2,β...,βan denotes ... | 256 megabytes | import java.util.*;
import java.io.*;
import java.text.*;
public class Main{
long mod = (int)1e9+7, IINF = (long)1e17;
final int MAX = (int)1e6+1, INF = (int)1e9, root = 3;
DecimalFormat df = new DecimalFormat("0.00000000");
double PI = 3.141592653589793238462643383279502884197169399375105820974944;
... | Java | ["2 3\n2 9\n5 3 13", "3 3\n1 7 6\n2 15 12"] | 2 seconds | ["YES\n3 4 5\n6 7 8", "NO"] | null | Java 8 | standard input | [
"constructive algorithms",
"flows",
"math"
] | 3815d18843dbd15a73383d69eb6880dd | The first line contains two numbers n and mΒ (2ββ€βn,βmββ€β100) β the dimensions of the matrix. The second line contains n numbers a1,βa2,β...,βanΒ (0ββ€βaiββ€β109), where ai is the xor of all elements in row i. The third line contains m numbers b1,βb2,β...,βbmΒ (0ββ€βbiββ€β109), where bi is the xor of all elements in column i. | 1,800 | If there is no matrix satisfying the given constraints in the first line, output "NO". Otherwise, on the first line output "YES", and then n rows of m numbers in each ci1,βci2,β... ,βcimΒ (0ββ€βcijββ€β2Β·109) β the description of the matrix. If there are several suitable matrices, it is allowed to print any of them. | standard output | |
PASSED | 6abbc40f8dd20bbe042e693b3301fc77 | train_002.jsonl | 1533307500 | Now Vasya is taking an exam in mathematics. In order to get a good mark, Vasya needs to guess the matrix that the teacher has constructed!Vasya knows that the matrix consists of n rows and m columns. For each row, he knows the xor (bitwise excluding or) of the elements in this row. The sequence a1,βa2,β...,βan denotes ... | 256 megabytes | import java.io.*;
import java.util.*;
import static java.lang.Math.exp;
import static java.lang.Math.max;
import static java.lang.Math.min;
public class Main {
private static FastScanner in = new FastScanner();
private static FastOutput out = new FastOutput();
public void run() {
int n = in.nextI... | Java | ["2 3\n2 9\n5 3 13", "3 3\n1 7 6\n2 15 12"] | 2 seconds | ["YES\n3 4 5\n6 7 8", "NO"] | null | Java 8 | standard input | [
"constructive algorithms",
"flows",
"math"
] | 3815d18843dbd15a73383d69eb6880dd | The first line contains two numbers n and mΒ (2ββ€βn,βmββ€β100) β the dimensions of the matrix. The second line contains n numbers a1,βa2,β...,βanΒ (0ββ€βaiββ€β109), where ai is the xor of all elements in row i. The third line contains m numbers b1,βb2,β...,βbmΒ (0ββ€βbiββ€β109), where bi is the xor of all elements in column i. | 1,800 | If there is no matrix satisfying the given constraints in the first line, output "NO". Otherwise, on the first line output "YES", and then n rows of m numbers in each ci1,βci2,β... ,βcimΒ (0ββ€βcijββ€β2Β·109) β the description of the matrix. If there are several suitable matrices, it is allowed to print any of them. | standard output | |
PASSED | 2659aa61d427182d3b909cd83124c130 | train_002.jsonl | 1533307500 | Now Vasya is taking an exam in mathematics. In order to get a good mark, Vasya needs to guess the matrix that the teacher has constructed!Vasya knows that the matrix consists of n rows and m columns. For each row, he knows the xor (bitwise excluding or) of the elements in this row. The sequence a1,βa2,β...,βan denotes ... | 256 megabytes | import java.io.*;
import java.util.*;
import java.text.*;
import java.math.*;
import java.util.regex.*;
public class Solution
{
static class InputReader
{
private final InputStream stream;
private final byte[] buf = new byte[8192];
private int curChar, snumChars;
public InputReader(InputStream s... | Java | ["2 3\n2 9\n5 3 13", "3 3\n1 7 6\n2 15 12"] | 2 seconds | ["YES\n3 4 5\n6 7 8", "NO"] | null | Java 8 | standard input | [
"constructive algorithms",
"flows",
"math"
] | 3815d18843dbd15a73383d69eb6880dd | The first line contains two numbers n and mΒ (2ββ€βn,βmββ€β100) β the dimensions of the matrix. The second line contains n numbers a1,βa2,β...,βanΒ (0ββ€βaiββ€β109), where ai is the xor of all elements in row i. The third line contains m numbers b1,βb2,β...,βbmΒ (0ββ€βbiββ€β109), where bi is the xor of all elements in column i. | 1,800 | If there is no matrix satisfying the given constraints in the first line, output "NO". Otherwise, on the first line output "YES", and then n rows of m numbers in each ci1,βci2,β... ,βcimΒ (0ββ€βcijββ€β2Β·109) β the description of the matrix. If there are several suitable matrices, it is allowed to print any of them. | standard output | |
PASSED | b5e3becd1f225b78757aeb0a6e1c4a0e | train_002.jsonl | 1533307500 | Now Vasya is taking an exam in mathematics. In order to get a good mark, Vasya needs to guess the matrix that the teacher has constructed!Vasya knows that the matrix consists of n rows and m columns. For each row, he knows the xor (bitwise excluding or) of the elements in this row. The sequence a1,βa2,β...,βan denotes ... | 256 megabytes | //package Contest501div2;
import java.util.Scanner;
public class main501D {
public static Scanner enter = new Scanner(System.in);
public static void main(String[] args) {
int n=enter.nextInt();
int m=enter.nextInt();
int[] a = new int[n];
int[] b = new int[m];
int[][] m... | Java | ["2 3\n2 9\n5 3 13", "3 3\n1 7 6\n2 15 12"] | 2 seconds | ["YES\n3 4 5\n6 7 8", "NO"] | null | Java 8 | standard input | [
"constructive algorithms",
"flows",
"math"
] | 3815d18843dbd15a73383d69eb6880dd | The first line contains two numbers n and mΒ (2ββ€βn,βmββ€β100) β the dimensions of the matrix. The second line contains n numbers a1,βa2,β...,βanΒ (0ββ€βaiββ€β109), where ai is the xor of all elements in row i. The third line contains m numbers b1,βb2,β...,βbmΒ (0ββ€βbiββ€β109), where bi is the xor of all elements in column i. | 1,800 | If there is no matrix satisfying the given constraints in the first line, output "NO". Otherwise, on the first line output "YES", and then n rows of m numbers in each ci1,βci2,β... ,βcimΒ (0ββ€βcijββ€β2Β·109) β the description of the matrix. If there are several suitable matrices, it is allowed to print any of them. | standard output | |
PASSED | 99e4db51078ed82b3eb1d61323228d17 | train_002.jsonl | 1533307500 | Now Vasya is taking an exam in mathematics. In order to get a good mark, Vasya needs to guess the matrix that the teacher has constructed!Vasya knows that the matrix consists of n rows and m columns. For each row, he knows the xor (bitwise excluding or) of the elements in this row. The sequence a1,βa2,β...,βan denotes ... | 256 megabytes |
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import java.io.PrintWriter;
import java.io.Writer;
import java.util.InputMismatchException;
/**
* @author thesparkboy
*
*/
public class A3 {
public static void main(String[] args) {
InputReader in = new InputReader(System.in);... | Java | ["2 3\n2 9\n5 3 13", "3 3\n1 7 6\n2 15 12"] | 2 seconds | ["YES\n3 4 5\n6 7 8", "NO"] | null | Java 8 | standard input | [
"constructive algorithms",
"flows",
"math"
] | 3815d18843dbd15a73383d69eb6880dd | The first line contains two numbers n and mΒ (2ββ€βn,βmββ€β100) β the dimensions of the matrix. The second line contains n numbers a1,βa2,β...,βanΒ (0ββ€βaiββ€β109), where ai is the xor of all elements in row i. The third line contains m numbers b1,βb2,β...,βbmΒ (0ββ€βbiββ€β109), where bi is the xor of all elements in column i. | 1,800 | If there is no matrix satisfying the given constraints in the first line, output "NO". Otherwise, on the first line output "YES", and then n rows of m numbers in each ci1,βci2,β... ,βcimΒ (0ββ€βcijββ€β2Β·109) β the description of the matrix. If there are several suitable matrices, it is allowed to print any of them. | standard output | |
PASSED | 7f1cfa7b084e98a950319612d99bf2ac | train_002.jsonl | 1533307500 | Now Vasya is taking an exam in mathematics. In order to get a good mark, Vasya needs to guess the matrix that the teacher has constructed!Vasya knows that the matrix consists of n rows and m columns. For each row, he knows the xor (bitwise excluding or) of the elements in this row. The sequence a1,βa2,β...,βan denotes ... | 256 megabytes | import java.io.*;
import java.util.*;
public class D implements Runnable{
public static void main (String[] args) {new Thread(null, new D(), "_cf", 1 << 28).start();}
public void run() {
FastScanner fs = new FastScanner();
PrintWriter out = new PrintWriter(System.out);
System.err.println("Go!");
int n = fs... | Java | ["2 3\n2 9\n5 3 13", "3 3\n1 7 6\n2 15 12"] | 2 seconds | ["YES\n3 4 5\n6 7 8", "NO"] | null | Java 8 | standard input | [
"constructive algorithms",
"flows",
"math"
] | 3815d18843dbd15a73383d69eb6880dd | The first line contains two numbers n and mΒ (2ββ€βn,βmββ€β100) β the dimensions of the matrix. The second line contains n numbers a1,βa2,β...,βanΒ (0ββ€βaiββ€β109), where ai is the xor of all elements in row i. The third line contains m numbers b1,βb2,β...,βbmΒ (0ββ€βbiββ€β109), where bi is the xor of all elements in column i. | 1,800 | If there is no matrix satisfying the given constraints in the first line, output "NO". Otherwise, on the first line output "YES", and then n rows of m numbers in each ci1,βci2,β... ,βcimΒ (0ββ€βcijββ€β2Β·109) β the description of the matrix. If there are several suitable matrices, it is allowed to print any of them. | standard output | |
PASSED | abf32b2eab723a2a758e7a381d56c01b | train_002.jsonl | 1533307500 | Now Vasya is taking an exam in mathematics. In order to get a good mark, Vasya needs to guess the matrix that the teacher has constructed!Vasya knows that the matrix consists of n rows and m columns. For each row, he knows the xor (bitwise excluding or) of the elements in this row. The sequence a1,βa2,β...,βan denotes ... | 256 megabytes | import java.io.BufferedOutputStream;
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.util.StringTokenizer;
//XOR of any number by 0 will give number itself
//when we XOR two same numbers we will get ans 0
public class EducationalRound48D {
public static vo... | Java | ["2 3\n2 9\n5 3 13", "3 3\n1 7 6\n2 15 12"] | 2 seconds | ["YES\n3 4 5\n6 7 8", "NO"] | null | Java 8 | standard input | [
"constructive algorithms",
"flows",
"math"
] | 3815d18843dbd15a73383d69eb6880dd | The first line contains two numbers n and mΒ (2ββ€βn,βmββ€β100) β the dimensions of the matrix. The second line contains n numbers a1,βa2,β...,βanΒ (0ββ€βaiββ€β109), where ai is the xor of all elements in row i. The third line contains m numbers b1,βb2,β...,βbmΒ (0ββ€βbiββ€β109), where bi is the xor of all elements in column i. | 1,800 | If there is no matrix satisfying the given constraints in the first line, output "NO". Otherwise, on the first line output "YES", and then n rows of m numbers in each ci1,βci2,β... ,βcimΒ (0ββ€βcijββ€β2Β·109) β the description of the matrix. If there are several suitable matrices, it is allowed to print any of them. | standard output | |
PASSED | 0d029febaae670ee88e6f278c56dcf6d | train_002.jsonl | 1538750100 | Vasya has recently got a job as a cashier at a local store. His day at work is $$$L$$$ minutes long. Vasya has already memorized $$$n$$$ regular customers, the $$$i$$$-th of which comes after $$$t_{i}$$$ minutes after the beginning of the day, and his service consumes $$$l_{i}$$$ minutes. It is guaranteed that no custo... | 256 megabytes | import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.StringTokenizer;
public class pre215
{
static class FastReader {
BufferedReader br;
StringTokenizer st;
public FastReader() {
br = new BufferedReader(new
... | Java | ["2 11 3\n0 1\n1 1", "0 5 2", "1 3 2\n1 2"] | 2 seconds | ["3", "2", "0"] | NoteIn the first sample Vasya can take $$$3$$$ breaks starting after $$$2$$$, $$$5$$$ and $$$8$$$ minutes after the beginning of the day.In the second sample Vasya can take $$$2$$$ breaks starting after $$$0$$$ and $$$2$$$ minutes after the beginning of the day.In the third sample Vasya can't take any breaks. | Java 8 | standard input | [
"implementation"
] | 00acb3b54975820989a788b9389c7c0b | The first line contains three integers $$$n$$$, $$$L$$$ and $$$a$$$ ($$$0 \le n \le 10^{5}$$$, $$$1 \le L \le 10^{9}$$$, $$$1 \le a \le L$$$). The $$$i$$$-th of the next $$$n$$$ lines contains two integers $$$t_{i}$$$ and $$$l_{i}$$$ ($$$0 \le t_{i} \le L - 1$$$, $$$1 \le l_{i} \le L$$$). It is guaranteed that $$$t_{i}... | 1,000 | Output one integer Β β the maximum number of breaks. | standard output | |
PASSED | fd4c37cb03174bb1d8c76d1b25b81ab2 | train_002.jsonl | 1538750100 | Vasya has recently got a job as a cashier at a local store. His day at work is $$$L$$$ minutes long. Vasya has already memorized $$$n$$$ regular customers, the $$$i$$$-th of which comes after $$$t_{i}$$$ minutes after the beginning of the day, and his service consumes $$$l_{i}$$$ minutes. It is guaranteed that no custo... | 256 megabytes | import java.io.*;
import java.util.*;
public class ku {
public static void main(String[] args) throws IOException {
Scanner sc=new Scanner(System.in);
int n=sc.nextInt();
int l=sc.nextInt();
int a=sc.nextInt();
Queue <cus> q=new LinkedList();
for(int i=0;i<n;i++) {
int f=sc.nextInt(); int t=sc.nextInt(... | Java | ["2 11 3\n0 1\n1 1", "0 5 2", "1 3 2\n1 2"] | 2 seconds | ["3", "2", "0"] | NoteIn the first sample Vasya can take $$$3$$$ breaks starting after $$$2$$$, $$$5$$$ and $$$8$$$ minutes after the beginning of the day.In the second sample Vasya can take $$$2$$$ breaks starting after $$$0$$$ and $$$2$$$ minutes after the beginning of the day.In the third sample Vasya can't take any breaks. | Java 8 | standard input | [
"implementation"
] | 00acb3b54975820989a788b9389c7c0b | The first line contains three integers $$$n$$$, $$$L$$$ and $$$a$$$ ($$$0 \le n \le 10^{5}$$$, $$$1 \le L \le 10^{9}$$$, $$$1 \le a \le L$$$). The $$$i$$$-th of the next $$$n$$$ lines contains two integers $$$t_{i}$$$ and $$$l_{i}$$$ ($$$0 \le t_{i} \le L - 1$$$, $$$1 \le l_{i} \le L$$$). It is guaranteed that $$$t_{i}... | 1,000 | Output one integer Β β the maximum number of breaks. | standard output | |
PASSED | da590885d34697db330e9d474dca38a3 | train_002.jsonl | 1538750100 | Vasya has recently got a job as a cashier at a local store. His day at work is $$$L$$$ minutes long. Vasya has already memorized $$$n$$$ regular customers, the $$$i$$$-th of which comes after $$$t_{i}$$$ minutes after the beginning of the day, and his service consumes $$$l_{i}$$$ minutes. It is guaranteed that no custo... | 256 megabytes |
import static java.lang.System.exit;
import java.util.ArrayList;
import java.util.LinkedList;
import java.util.List;
import java.util.Scanner;
import java.util.*;
/**
*
* @author abdelmagied
*/
import java.util.ArrayList;
import java.util.Collections;
import java.... | Java | ["2 11 3\n0 1\n1 1", "0 5 2", "1 3 2\n1 2"] | 2 seconds | ["3", "2", "0"] | NoteIn the first sample Vasya can take $$$3$$$ breaks starting after $$$2$$$, $$$5$$$ and $$$8$$$ minutes after the beginning of the day.In the second sample Vasya can take $$$2$$$ breaks starting after $$$0$$$ and $$$2$$$ minutes after the beginning of the day.In the third sample Vasya can't take any breaks. | Java 8 | standard input | [
"implementation"
] | 00acb3b54975820989a788b9389c7c0b | The first line contains three integers $$$n$$$, $$$L$$$ and $$$a$$$ ($$$0 \le n \le 10^{5}$$$, $$$1 \le L \le 10^{9}$$$, $$$1 \le a \le L$$$). The $$$i$$$-th of the next $$$n$$$ lines contains two integers $$$t_{i}$$$ and $$$l_{i}$$$ ($$$0 \le t_{i} \le L - 1$$$, $$$1 \le l_{i} \le L$$$). It is guaranteed that $$$t_{i}... | 1,000 | Output one integer Β β the maximum number of breaks. | standard output | |
PASSED | f0b03ca51c31b2fcbc14700f5dcecfad | train_002.jsonl | 1538750100 | Vasya has recently got a job as a cashier at a local store. His day at work is $$$L$$$ minutes long. Vasya has already memorized $$$n$$$ regular customers, the $$$i$$$-th of which comes after $$$t_{i}$$$ minutes after the beginning of the day, and his service consumes $$$l_{i}$$$ minutes. It is guaranteed that no custo... | 256 megabytes |
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.BitSet;
import java.util.Collections;
import java.util.Comparator;
import java.util.Map;
import jav... | Java | ["2 11 3\n0 1\n1 1", "0 5 2", "1 3 2\n1 2"] | 2 seconds | ["3", "2", "0"] | NoteIn the first sample Vasya can take $$$3$$$ breaks starting after $$$2$$$, $$$5$$$ and $$$8$$$ minutes after the beginning of the day.In the second sample Vasya can take $$$2$$$ breaks starting after $$$0$$$ and $$$2$$$ minutes after the beginning of the day.In the third sample Vasya can't take any breaks. | Java 8 | standard input | [
"implementation"
] | 00acb3b54975820989a788b9389c7c0b | The first line contains three integers $$$n$$$, $$$L$$$ and $$$a$$$ ($$$0 \le n \le 10^{5}$$$, $$$1 \le L \le 10^{9}$$$, $$$1 \le a \le L$$$). The $$$i$$$-th of the next $$$n$$$ lines contains two integers $$$t_{i}$$$ and $$$l_{i}$$$ ($$$0 \le t_{i} \le L - 1$$$, $$$1 \le l_{i} \le L$$$). It is guaranteed that $$$t_{i}... | 1,000 | Output one integer Β β the maximum number of breaks. | standard output | |
PASSED | 6bcd686c351e4abf5159379b3d74d819 | train_002.jsonl | 1538750100 | Vasya has recently got a job as a cashier at a local store. His day at work is $$$L$$$ minutes long. Vasya has already memorized $$$n$$$ regular customers, the $$$i$$$-th of which comes after $$$t_{i}$$$ minutes after the beginning of the day, and his service consumes $$$l_{i}$$$ minutes. It is guaranteed that no custo... | 256 megabytes | import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.util.Scanner;
public class CodeForces
{
public static void main(String[] args)
{
Scanner input = new Scanner(new BufferedReader(new InputStreamReader(System.in)));
int n = input.nextInt();
int L = input.nextInt();
int a = input.ne... | Java | ["2 11 3\n0 1\n1 1", "0 5 2", "1 3 2\n1 2"] | 2 seconds | ["3", "2", "0"] | NoteIn the first sample Vasya can take $$$3$$$ breaks starting after $$$2$$$, $$$5$$$ and $$$8$$$ minutes after the beginning of the day.In the second sample Vasya can take $$$2$$$ breaks starting after $$$0$$$ and $$$2$$$ minutes after the beginning of the day.In the third sample Vasya can't take any breaks. | Java 8 | standard input | [
"implementation"
] | 00acb3b54975820989a788b9389c7c0b | The first line contains three integers $$$n$$$, $$$L$$$ and $$$a$$$ ($$$0 \le n \le 10^{5}$$$, $$$1 \le L \le 10^{9}$$$, $$$1 \le a \le L$$$). The $$$i$$$-th of the next $$$n$$$ lines contains two integers $$$t_{i}$$$ and $$$l_{i}$$$ ($$$0 \le t_{i} \le L - 1$$$, $$$1 \le l_{i} \le L$$$). It is guaranteed that $$$t_{i}... | 1,000 | Output one integer Β β the maximum number of breaks. | standard output | |
PASSED | 3755a31c39ef23be03f95a4b1647cfa3 | train_002.jsonl | 1538750100 | Vasya has recently got a job as a cashier at a local store. His day at work is $$$L$$$ minutes long. Vasya has already memorized $$$n$$$ regular customers, the $$$i$$$-th of which comes after $$$t_{i}$$$ minutes after the beginning of the day, and his service consumes $$$l_{i}$$$ minutes. It is guaranteed that no custo... | 256 megabytes |
import java.util.Scanner;
public class Cashier {
public static void main(String[] args) {
Scanner s = new Scanner(System.in);
int m = s.nextInt(), n = s.nextInt(), a = s.nextInt(),arr[][]=new int[m][2],sec=0;
long FinalAns=0;
for (int i = 0; i < m; i++) {
int first=... | Java | ["2 11 3\n0 1\n1 1", "0 5 2", "1 3 2\n1 2"] | 2 seconds | ["3", "2", "0"] | NoteIn the first sample Vasya can take $$$3$$$ breaks starting after $$$2$$$, $$$5$$$ and $$$8$$$ minutes after the beginning of the day.In the second sample Vasya can take $$$2$$$ breaks starting after $$$0$$$ and $$$2$$$ minutes after the beginning of the day.In the third sample Vasya can't take any breaks. | Java 8 | standard input | [
"implementation"
] | 00acb3b54975820989a788b9389c7c0b | The first line contains three integers $$$n$$$, $$$L$$$ and $$$a$$$ ($$$0 \le n \le 10^{5}$$$, $$$1 \le L \le 10^{9}$$$, $$$1 \le a \le L$$$). The $$$i$$$-th of the next $$$n$$$ lines contains two integers $$$t_{i}$$$ and $$$l_{i}$$$ ($$$0 \le t_{i} \le L - 1$$$, $$$1 \le l_{i} \le L$$$). It is guaranteed that $$$t_{i}... | 1,000 | Output one integer Β β the maximum number of breaks. | standard output | |
PASSED | a9c44958d0734ad0504dfd9a05a7385e | train_002.jsonl | 1538750100 | Vasya has recently got a job as a cashier at a local store. His day at work is $$$L$$$ minutes long. Vasya has already memorized $$$n$$$ regular customers, the $$$i$$$-th of which comes after $$$t_{i}$$$ minutes after the beginning of the day, and his service consumes $$$l_{i}$$$ minutes. It is guaranteed that no custo... | 256 megabytes | import java.util.*;
public class vasya
{
public static void main(String args[])
{
Scanner sc=new Scanner(System.in);
int n=sc.nextInt();
int l=sc.nextInt();
int a=sc.nextInt();
long psum=0,ans=0;
for(int i=0;i<n;i++)
... | Java | ["2 11 3\n0 1\n1 1", "0 5 2", "1 3 2\n1 2"] | 2 seconds | ["3", "2", "0"] | NoteIn the first sample Vasya can take $$$3$$$ breaks starting after $$$2$$$, $$$5$$$ and $$$8$$$ minutes after the beginning of the day.In the second sample Vasya can take $$$2$$$ breaks starting after $$$0$$$ and $$$2$$$ minutes after the beginning of the day.In the third sample Vasya can't take any breaks. | Java 8 | standard input | [
"implementation"
] | 00acb3b54975820989a788b9389c7c0b | The first line contains three integers $$$n$$$, $$$L$$$ and $$$a$$$ ($$$0 \le n \le 10^{5}$$$, $$$1 \le L \le 10^{9}$$$, $$$1 \le a \le L$$$). The $$$i$$$-th of the next $$$n$$$ lines contains two integers $$$t_{i}$$$ and $$$l_{i}$$$ ($$$0 \le t_{i} \le L - 1$$$, $$$1 \le l_{i} \le L$$$). It is guaranteed that $$$t_{i}... | 1,000 | Output one integer Β β the maximum number of breaks. | standard output | |
PASSED | a44a6222ec1b0f3805752696eb7a441b | train_002.jsonl | 1538750100 | Vasya has recently got a job as a cashier at a local store. His day at work is $$$L$$$ minutes long. Vasya has already memorized $$$n$$$ regular customers, the $$$i$$$-th of which comes after $$$t_{i}$$$ minutes after the beginning of the day, and his service consumes $$$l_{i}$$$ minutes. It is guaranteed that no custo... | 256 megabytes | import java.io.IOException;
import java.util.Scanner;
public class P3 {
public static void main(String[] args) {
Scanner scanner = new Scanner(System.in);
try {
System.out.println(solve(scanner));
} catch (IOException e) {
e.printStackTrace();
}
}
public static int solve(Scanner scanner) throws IOE... | Java | ["2 11 3\n0 1\n1 1", "0 5 2", "1 3 2\n1 2"] | 2 seconds | ["3", "2", "0"] | NoteIn the first sample Vasya can take $$$3$$$ breaks starting after $$$2$$$, $$$5$$$ and $$$8$$$ minutes after the beginning of the day.In the second sample Vasya can take $$$2$$$ breaks starting after $$$0$$$ and $$$2$$$ minutes after the beginning of the day.In the third sample Vasya can't take any breaks. | Java 8 | standard input | [
"implementation"
] | 00acb3b54975820989a788b9389c7c0b | The first line contains three integers $$$n$$$, $$$L$$$ and $$$a$$$ ($$$0 \le n \le 10^{5}$$$, $$$1 \le L \le 10^{9}$$$, $$$1 \le a \le L$$$). The $$$i$$$-th of the next $$$n$$$ lines contains two integers $$$t_{i}$$$ and $$$l_{i}$$$ ($$$0 \le t_{i} \le L - 1$$$, $$$1 \le l_{i} \le L$$$). It is guaranteed that $$$t_{i}... | 1,000 | Output one integer Β β the maximum number of breaks. | standard output | |
PASSED | 8838455ed6b3ace5bdbc33135698af40 | train_002.jsonl | 1538750100 | Vasya has recently got a job as a cashier at a local store. His day at work is $$$L$$$ minutes long. Vasya has already memorized $$$n$$$ regular customers, the $$$i$$$-th of which comes after $$$t_{i}$$$ minutes after the beginning of the day, and his service consumes $$$l_{i}$$$ minutes. It is guaranteed that no custo... | 256 megabytes | import java.util.Scanner;
public class Main {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
int n = sc.nextInt();
int L = sc.nextInt();
int a = sc.nextInt();
int[] customerTime = new int[n];
int[] serviceTime = new int[n];
for (int i = 0; i < n; i++) {
custom... | Java | ["2 11 3\n0 1\n1 1", "0 5 2", "1 3 2\n1 2"] | 2 seconds | ["3", "2", "0"] | NoteIn the first sample Vasya can take $$$3$$$ breaks starting after $$$2$$$, $$$5$$$ and $$$8$$$ minutes after the beginning of the day.In the second sample Vasya can take $$$2$$$ breaks starting after $$$0$$$ and $$$2$$$ minutes after the beginning of the day.In the third sample Vasya can't take any breaks. | Java 8 | standard input | [
"implementation"
] | 00acb3b54975820989a788b9389c7c0b | The first line contains three integers $$$n$$$, $$$L$$$ and $$$a$$$ ($$$0 \le n \le 10^{5}$$$, $$$1 \le L \le 10^{9}$$$, $$$1 \le a \le L$$$). The $$$i$$$-th of the next $$$n$$$ lines contains two integers $$$t_{i}$$$ and $$$l_{i}$$$ ($$$0 \le t_{i} \le L - 1$$$, $$$1 \le l_{i} \le L$$$). It is guaranteed that $$$t_{i}... | 1,000 | Output one integer Β β the maximum number of breaks. | standard output | |
PASSED | c73e63f1dd5db294660dc72d721803c4 | train_002.jsonl | 1538750100 | Vasya has recently got a job as a cashier at a local store. His day at work is $$$L$$$ minutes long. Vasya has already memorized $$$n$$$ regular customers, the $$$i$$$-th of which comes after $$$t_{i}$$$ minutes after the beginning of the day, and his service consumes $$$l_{i}$$$ minutes. It is guaranteed that no custo... | 256 megabytes | import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.util.StringTokenizer;
public class Main {
static class Reader {
static BufferedReader br;
static StringTokenizer st;
public Reader() {
this.br = new BufferedReader(new InputStreamReader(System.in));
... | Java | ["2 11 3\n0 1\n1 1", "0 5 2", "1 3 2\n1 2"] | 2 seconds | ["3", "2", "0"] | NoteIn the first sample Vasya can take $$$3$$$ breaks starting after $$$2$$$, $$$5$$$ and $$$8$$$ minutes after the beginning of the day.In the second sample Vasya can take $$$2$$$ breaks starting after $$$0$$$ and $$$2$$$ minutes after the beginning of the day.In the third sample Vasya can't take any breaks. | Java 8 | standard input | [
"implementation"
] | 00acb3b54975820989a788b9389c7c0b | The first line contains three integers $$$n$$$, $$$L$$$ and $$$a$$$ ($$$0 \le n \le 10^{5}$$$, $$$1 \le L \le 10^{9}$$$, $$$1 \le a \le L$$$). The $$$i$$$-th of the next $$$n$$$ lines contains two integers $$$t_{i}$$$ and $$$l_{i}$$$ ($$$0 \le t_{i} \le L - 1$$$, $$$1 \le l_{i} \le L$$$). It is guaranteed that $$$t_{i}... | 1,000 | Output one integer Β β the maximum number of breaks. | standard output | |
PASSED | 7c363b293963ae5656059bdc33949484 | train_002.jsonl | 1538750100 | Vasya has recently got a job as a cashier at a local store. His day at work is $$$L$$$ minutes long. Vasya has already memorized $$$n$$$ regular customers, the $$$i$$$-th of which comes after $$$t_{i}$$$ minutes after the beginning of the day, and his service consumes $$$l_{i}$$$ minutes. It is guaranteed that no custo... | 256 megabytes | /*package whatever //do not write package name here */
import java.util.*;
import java.lang.*;
import java.io.*;
public class first {
public static void main (String[] args) {
Scanner sc = new Scanner(System.in);
int n = sc.nextInt();
int L = sc.nextInt();
int a = sc.nextInt();
int[] t = new int[n];
int[... | Java | ["2 11 3\n0 1\n1 1", "0 5 2", "1 3 2\n1 2"] | 2 seconds | ["3", "2", "0"] | NoteIn the first sample Vasya can take $$$3$$$ breaks starting after $$$2$$$, $$$5$$$ and $$$8$$$ minutes after the beginning of the day.In the second sample Vasya can take $$$2$$$ breaks starting after $$$0$$$ and $$$2$$$ minutes after the beginning of the day.In the third sample Vasya can't take any breaks. | Java 8 | standard input | [
"implementation"
] | 00acb3b54975820989a788b9389c7c0b | The first line contains three integers $$$n$$$, $$$L$$$ and $$$a$$$ ($$$0 \le n \le 10^{5}$$$, $$$1 \le L \le 10^{9}$$$, $$$1 \le a \le L$$$). The $$$i$$$-th of the next $$$n$$$ lines contains two integers $$$t_{i}$$$ and $$$l_{i}$$$ ($$$0 \le t_{i} \le L - 1$$$, $$$1 \le l_{i} \le L$$$). It is guaranteed that $$$t_{i}... | 1,000 | Output one integer Β β the maximum number of breaks. | standard output | |
PASSED | efb7f2cdff2b9b4e00b7a90fb31f9b88 | train_002.jsonl | 1538750100 | Vasya has recently got a job as a cashier at a local store. His day at work is $$$L$$$ minutes long. Vasya has already memorized $$$n$$$ regular customers, the $$$i$$$-th of which comes after $$$t_{i}$$$ minutes after the beginning of the day, and his service consumes $$$l_{i}$$$ minutes. It is guaranteed that no custo... | 256 megabytes | import java.util.ArrayList;
import java.util.Scanner;
public class Main {
static Scanner sc = new Scanner(System.in);
static long n, l, a;
static ArrayList<Consumer> consumers = new ArrayList<>();
static boolean hasCons = false;
static long sumLi;
public static void main(String[] args) {
... | Java | ["2 11 3\n0 1\n1 1", "0 5 2", "1 3 2\n1 2"] | 2 seconds | ["3", "2", "0"] | NoteIn the first sample Vasya can take $$$3$$$ breaks starting after $$$2$$$, $$$5$$$ and $$$8$$$ minutes after the beginning of the day.In the second sample Vasya can take $$$2$$$ breaks starting after $$$0$$$ and $$$2$$$ minutes after the beginning of the day.In the third sample Vasya can't take any breaks. | Java 8 | standard input | [
"implementation"
] | 00acb3b54975820989a788b9389c7c0b | The first line contains three integers $$$n$$$, $$$L$$$ and $$$a$$$ ($$$0 \le n \le 10^{5}$$$, $$$1 \le L \le 10^{9}$$$, $$$1 \le a \le L$$$). The $$$i$$$-th of the next $$$n$$$ lines contains two integers $$$t_{i}$$$ and $$$l_{i}$$$ ($$$0 \le t_{i} \le L - 1$$$, $$$1 \le l_{i} \le L$$$). It is guaranteed that $$$t_{i}... | 1,000 | Output one integer Β β the maximum number of breaks. | standard output | |
PASSED | 9cdcb2f0247e6d9ec2435c93af77b385 | train_002.jsonl | 1538750100 | Vasya has recently got a job as a cashier at a local store. His day at work is $$$L$$$ minutes long. Vasya has already memorized $$$n$$$ regular customers, the $$$i$$$-th of which comes after $$$t_{i}$$$ minutes after the beginning of the day, and his service consumes $$$l_{i}$$$ minutes. It is guaranteed that no custo... | 256 megabytes | import java.util.*;
public class Main
{
public static void main(String[] args)
{
Scanner s=new Scanner(System.in);
int n=s.nextInt();
int l=s.nextInt();
int a=s.nextInt();
int ct=0;
int prev=0;
for(int i=0;i<n;i++)
{
int x=s.nextInt();
... | Java | ["2 11 3\n0 1\n1 1", "0 5 2", "1 3 2\n1 2"] | 2 seconds | ["3", "2", "0"] | NoteIn the first sample Vasya can take $$$3$$$ breaks starting after $$$2$$$, $$$5$$$ and $$$8$$$ minutes after the beginning of the day.In the second sample Vasya can take $$$2$$$ breaks starting after $$$0$$$ and $$$2$$$ minutes after the beginning of the day.In the third sample Vasya can't take any breaks. | Java 8 | standard input | [
"implementation"
] | 00acb3b54975820989a788b9389c7c0b | The first line contains three integers $$$n$$$, $$$L$$$ and $$$a$$$ ($$$0 \le n \le 10^{5}$$$, $$$1 \le L \le 10^{9}$$$, $$$1 \le a \le L$$$). The $$$i$$$-th of the next $$$n$$$ lines contains two integers $$$t_{i}$$$ and $$$l_{i}$$$ ($$$0 \le t_{i} \le L - 1$$$, $$$1 \le l_{i} \le L$$$). It is guaranteed that $$$t_{i}... | 1,000 | Output one integer Β β the maximum number of breaks. | standard output | |
PASSED | 9a753f405cf11941c1be6faabfb9bcb4 | train_002.jsonl | 1538750100 | Vasya has recently got a job as a cashier at a local store. His day at work is $$$L$$$ minutes long. Vasya has already memorized $$$n$$$ regular customers, the $$$i$$$-th of which comes after $$$t_{i}$$$ minutes after the beginning of the day, and his service consumes $$$l_{i}$$$ minutes. It is guaranteed that no custo... | 256 megabytes | import java.io.OutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.util.InputMismatchException;
import java.io.IOException;
import java.io.InputStream;
/**
* Built using CHelper plug-in
* Actual solution is at the top
*/
public class Main {
public static... | Java | ["2 11 3\n0 1\n1 1", "0 5 2", "1 3 2\n1 2"] | 2 seconds | ["3", "2", "0"] | NoteIn the first sample Vasya can take $$$3$$$ breaks starting after $$$2$$$, $$$5$$$ and $$$8$$$ minutes after the beginning of the day.In the second sample Vasya can take $$$2$$$ breaks starting after $$$0$$$ and $$$2$$$ minutes after the beginning of the day.In the third sample Vasya can't take any breaks. | Java 8 | standard input | [
"implementation"
] | 00acb3b54975820989a788b9389c7c0b | The first line contains three integers $$$n$$$, $$$L$$$ and $$$a$$$ ($$$0 \le n \le 10^{5}$$$, $$$1 \le L \le 10^{9}$$$, $$$1 \le a \le L$$$). The $$$i$$$-th of the next $$$n$$$ lines contains two integers $$$t_{i}$$$ and $$$l_{i}$$$ ($$$0 \le t_{i} \le L - 1$$$, $$$1 \le l_{i} \le L$$$). It is guaranteed that $$$t_{i}... | 1,000 | Output one integer Β β the maximum number of breaks. | standard output |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.