Solutions are presented as using the least memory and the fastest execution time. It also takes the top
10 most recent solutions from each language. If you want to limit to a specific index, click the
"Solved" button and go to that problem.
Problems
B"You are given an even integer n and an integer k . Your task is to construct a matrix of size n x n consisting of numbers 0 and 1 in such a way that the following conditions are true, or report that it is impossible: Each test consists of multiple test cases. The first line contains a single integer t ( 1 <= q t <= q 130 ) -- the number of test cases. The description of the test cases follows. Each test case is described by a single line, which contains two integers n and k ( 2 <= q n <= q 1000 , n is even, 0 <= q k <= q n^2 ). It is guaranteed that the sum of n over all test cases does not exceed 2000 . For each test case, output texttt{Yes} if it's possible to construct a matrix that satisfies all of the problem's conditions, and texttt{No} otherwise. If it is possible to construct a matrix, the i -th of the next n lines should contain n integers representing the elements in the i -th row of the matrix. In the first example, all conditions are satisfied: In the third example, it can be shown that it's impossible to find a matrix satisfying all the problem's conditions. "... |
Tutorials
Submissions
Submission Id |
Author(s) |
Index |
Submitted |
Verdict |
Language |
Test Set |
Tests Passed |
Time taken (ms) |
Memory Consumed (bytes) |
Tags |
Rating |
238788418 |
xvzhiming |
E |
Dec. 25, 2023, 5:59 a.m. |
OK |
GNU C++14 |
TESTS |
30 |
156 |
5120000 |
|
|
238763061 |
DAleksa |
E |
Dec. 24, 2023, 8:53 p.m. |
OK |
GNU C++14 |
TESTS |
30 |
156 |
5632000 |
|
|
238777155 |
AFrAYuRmbrM |
E |
Dec. 25, 2023, 3:31 a.m. |
OK |
GNU C++14 |
TESTS |
30 |
171 |
5120000 |
|
|
238777086 |
AFrAYuRmbrM |
E |
Dec. 25, 2023, 3:30 a.m. |
OK |
GNU C++14 |
TESTS |
30 |
171 |
5120000 |
|
|
238769944 |
crescent_yhw |
E |
Dec. 24, 2023, 11:59 p.m. |
OK |
GNU C++14 |
TESTS |
30 |
171 |
5120000 |
|
|
238755780 |
GeoCalibur |
E |
Dec. 24, 2023, 7:07 p.m. |
OK |
GNU C++14 |
TESTS |
30 |
171 |
5120000 |
|
|
238747203 |
boiling_hyta_in_prison |
E |
Dec. 24, 2023, 5:54 p.m. |
OK |
GNU C++14 |
TESTS |
30 |
171 |
17305600 |
|
|
238750310 |
Yzm007 |
E |
Dec. 24, 2023, 6:14 p.m. |
OK |
GNU C++14 |
TESTS |
30 |
187 |
17305600 |
|
|
238783041 |
yd_tz |
E |
Dec. 25, 2023, 5:03 a.m. |
OK |
GNU C++14 |
TESTS |
30 |
202 |
2048000 |
|
|
238754821 |
tahoangquan2 |
E |
Dec. 24, 2023, 6:56 p.m. |
OK |
GNU C++14 |
TESTS |
30 |
202 |
5120000 |
|
|
238745185 |
tsammeow |
E |
Dec. 24, 2023, 5:42 p.m. |
OK |
GNU C++17 |
TESTS |
30 |
155 |
5120000 |
|
|
238744152 |
tsammeow |
E |
Dec. 24, 2023, 5:38 p.m. |
OK |
GNU C++17 |
TESTS |
30 |
155 |
5120000 |
|
|
238736686 |
Boris_Krasnov |
E |
Dec. 24, 2023, 4:31 p.m. |
OK |
GNU C++17 |
TESTS |
30 |
155 |
5632000 |
|
|
238735365 |
sammyuri |
E |
Dec. 24, 2023, 4:28 p.m. |
OK |
GNU C++17 |
TESTS |
30 |
170 |
1228800 |
|
|
238734419 |
Mehdi_Farhadian |
E |
Dec. 24, 2023, 4:26 p.m. |
OK |
GNU C++17 |
TESTS |
30 |
170 |
5120000 |
|
|
238744347 |
GOTKAKO |
E |
Dec. 24, 2023, 5:39 p.m. |
OK |
GNU C++17 |
TESTS |
30 |
170 |
5632000 |
|
|
238758212 |
Vadik2046 |
E |
Dec. 24, 2023, 7:39 p.m. |
OK |
GNU C++17 |
TESTS |
30 |
171 |
1433600 |
|
|
238770819 |
MASTERB4APRIL |
E |
Dec. 25, 2023, 12:34 a.m. |
OK |
GNU C++17 |
TESTS |
30 |
171 |
2048000 |
|
|
238764951 |
Ronnie007 |
E |
Dec. 24, 2023, 9:30 p.m. |
OK |
GNU C++17 |
TESTS |
30 |
171 |
5120000 |
|
|
238748673 |
Ste |
E |
Dec. 24, 2023, 6:03 p.m. |
OK |
GNU C++17 |
TESTS |
30 |
171 |
5120000 |
|
|
238780198 |
GoogleBot |
E |
Dec. 25, 2023, 4:23 a.m. |
OK |
GNU C++17 (64) |
TESTS |
30 |
139 |
5939200 |
|
|
238786875 |
bykem |
E |
Dec. 25, 2023, 5:42 a.m. |
OK |
GNU C++17 (64) |
TESTS |
30 |
140 |
5222400 |
|
|
238748619 |
KanoFans |
E |
Dec. 24, 2023, 6:03 p.m. |
OK |
GNU C++17 (64) |
TESTS |
30 |
140 |
5222400 |
|
|
238772453 |
LxRBS |
E |
Dec. 25, 2023, 1:35 a.m. |
OK |
GNU C++17 (64) |
TESTS |
30 |
140 |
9728000 |
|
|
238775875 |
jackylova_fan_fan_fan |
E |
Dec. 25, 2023, 3:06 a.m. |
OK |
GNU C++17 (64) |
TESTS |
30 |
155 |
5632000 |
|
|
238733885 |
prairie2022 |
E |
Dec. 24, 2023, 4:24 p.m. |
OK |
GNU C++17 (64) |
TESTS |
30 |
156 |
5632000 |
|
|
238743699 |
hamster1580 |
E |
Dec. 24, 2023, 5:36 p.m. |
OK |
GNU C++17 (64) |
TESTS |
30 |
170 |
18534400 |
|
|
238766466 |
Khozhaev |
E |
Dec. 24, 2023, 10:07 p.m. |
OK |
GNU C++17 (64) |
TESTS |
30 |
171 |
10137600 |
|
|
238743176 |
TheLostCookie |
E |
Dec. 24, 2023, 5:34 p.m. |
OK |
GNU C++17 (64) |
TESTS |
30 |
187 |
10137600 |
|
|
238756856 |
Edu175 |
E |
Dec. 24, 2023, 7:21 p.m. |
OK |
GNU C++17 (64) |
TESTS |
30 |
187 |
18534400 |
|
|
238733729 |
hmsscj |
E |
Dec. 24, 2023, 4:24 p.m. |
OK |
GNU C++20 (64) |
TESTS |
30 |
46 |
1536000 |
|
|
238771977 |
zer0- |
E |
Dec. 25, 2023, 1:19 a.m. |
OK |
GNU C++20 (64) |
TESTS |
30 |
62 |
5939200 |
|
|
238746447 |
_Foxxy_ |
E |
Dec. 24, 2023, 5:49 p.m. |
OK |
GNU C++20 (64) |
TESTS |
30 |
62 |
10137600 |
|
|
238744469 |
makcvim |
E |
Dec. 24, 2023, 5:39 p.m. |
OK |
GNU C++20 (64) |
TESTS |
30 |
78 |
2355200 |
|
|
238753047 |
the_hyp0cr1t3 |
E |
Dec. 24, 2023, 6:37 p.m. |
OK |
GNU C++20 (64) |
TESTS |
30 |
93 |
2560000 |
|
|
238741980 |
Mikhango |
E |
Dec. 24, 2023, 5:29 p.m. |
OK |
GNU C++20 (64) |
TESTS |
30 |
108 |
10137600 |
|
|
238748046 |
yud08 |
E |
Dec. 24, 2023, 5:59 p.m. |
OK |
GNU C++20 (64) |
TESTS |
30 |
109 |
1433600 |
|
|
238780142 |
ganeid |
E |
Dec. 25, 2023, 4:22 a.m. |
OK |
GNU C++20 (64) |
TESTS |
30 |
109 |
2355200 |
|
|
238749157 |
Be_dos |
E |
Dec. 24, 2023, 6:06 p.m. |
OK |
GNU C++20 (64) |
TESTS |
30 |
109 |
3481600 |
|
|
238758511 |
enzopsm |
E |
Dec. 24, 2023, 7:44 p.m. |
OK |
GNU C++20 (64) |
TESTS |
30 |
109 |
5324800 |
|
|
238734296 |
MagentaCobra |
E |
Dec. 24, 2023, 4:25 p.m. |
OK |
Java 11 |
TESTS |
30 |
249 |
31334400 |
|
|
238752259 |
CutSandstone |
E |
Dec. 24, 2023, 6:30 p.m. |
OK |
Java 17 |
TESTS |
30 |
420 |
50380800 |
|
|
238742791 |
Dukkha |
E |
Dec. 24, 2023, 5:32 p.m. |
OK |
Java 21 |
TESTS |
30 |
499 |
42496000 |
|
|
238735837 |
alexey.enkov |
E |
Dec. 24, 2023, 4:29 p.m. |
OK |
Kotlin 1.6 |
TESTS |
30 |
467 |
26521600 |
|
|
238764454 |
rsFalse |
E |
Dec. 24, 2023, 9:20 p.m. |
OK |
Perl |
TESTS |
30 |
31 |
1740800 |
|
|
238763798 |
rsFalse |
E |
Dec. 24, 2023, 9:07 p.m. |
OK |
Perl |
TESTS |
30 |
31 |
1740800 |
|
|
238754009 |
lisashi |
E |
Dec. 24, 2023, 6:47 p.m. |
OK |
PyPy 3 |
TESTS |
30 |
498 |
33177600 |
|
|
238742061 |
misorin |
E |
Dec. 24, 2023, 5:29 p.m. |
OK |
PyPy 3-64 |
TESTS |
30 |
124 |
59596800 |
|
|
238736422 |
ct17 |
E |
Dec. 24, 2023, 4:30 p.m. |
OK |
PyPy 3-64 |
TESTS |
30 |
170 |
50892800 |
|
|
238760308 |
AyuAnchor |
E |
Dec. 24, 2023, 8:09 p.m. |
OK |
PyPy 3-64 |
TESTS |
30 |
280 |
68710400 |
|
|
238763602 |
Alex239 |
E |
Dec. 24, 2023, 9:03 p.m. |
OK |
PyPy 3-64 |
TESTS |
30 |
280 |
69324800 |
|
|
238765935 |
dirac_de |
E |
Dec. 24, 2023, 9:54 p.m. |
OK |
PyPy 3-64 |
TESTS |
30 |
311 |
53248000 |
|
|
238744650 |
ManojkumarPatanik |
E |
Dec. 24, 2023, 5:40 p.m. |
OK |
PyPy 3-64 |
TESTS |
30 |
342 |
68710400 |
|
|
238732853 |
gpgpurur |
E |
Dec. 24, 2023, 4:22 p.m. |
OK |
PyPy 3-64 |
TESTS |
30 |
342 |
68710400 |
|
|
238742575 |
huikang |
E |
Dec. 24, 2023, 5:32 p.m. |
OK |
PyPy 3-64 |
TESTS |
30 |
342 |
70246400 |
|
|
remove filters
Back to search problems