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 n points on the plane, the coordinates of the i -th point are (x_i, y_i) . No two points have the same coordinates. The distance between points i and j is defined as d(i,j) = |x_i - x_j| + |y_i - y_j| . For each point, you have to choose a color, represented by an integer from 1 to n . For every ordered triple of different points (a,b,c) , the following constraints should be met: Calculate the number of different ways to choose the colors that meet these constraints. The first line contains one integer n ( 2 <= n <= 100 ) -- the number of points. Then n lines follow. The i -th of them contains two integers x_i and y_i ( 0 <= x_i, y_i <= 10^8 ). No two points have the same coordinates (i. xe2 x80 x89e. if i ne j , then either x_i ne x_j or y_i ne y_j ). Print one integer -- the number of ways to choose the colors for the points. Since it can be large, print it modulo 998244353 . In the first test, the following ways to choose the colors are suitable: '... |
Tutorials
Submissions
Submission Id |
Author(s) |
Index |
Submitted |
Verdict |
Language |
Test Set |
Tests Passed |
Time taken (ms) |
Memory Consumed (bytes) |
Tags |
Rating |
160367813 |
rainboy |
E |
June 12, 2022, 5:33 p.m. |
OK |
GNU C11 |
TESTS |
38 |
15 |
102400 |
|
|
160359789 |
rainboy |
E |
June 12, 2022, 4:38 p.m. |
OK |
GNU C11 |
TESTS |
38 |
15 |
102400 |
|
|
160387471 |
peiwenjun |
E |
June 13, 2022, 1:27 a.m. |
OK |
GNU C++14 |
TESTS |
38 |
15 |
102400 |
|
|
160361017 |
_martynas |
E |
June 12, 2022, 4:44 p.m. |
OK |
GNU C++14 |
TESTS |
38 |
15 |
102400 |
|
|
160367972 |
LinkZelda |
E |
June 12, 2022, 5:35 p.m. |
OK |
GNU C++14 |
TESTS |
38 |
15 |
204800 |
|
|
160362269 |
getchar123 |
E |
June 12, 2022, 4:51 p.m. |
OK |
GNU C++14 |
TESTS |
38 |
15 |
204800 |
|
|
160360227 |
_Prakhar_ |
E |
June 12, 2022, 4:40 p.m. |
OK |
GNU C++14 |
TESTS |
38 |
15 |
204800 |
|
|
160395754 |
zhangshaojia |
E |
June 13, 2022, 4:51 a.m. |
OK |
GNU C++14 |
TESTS |
38 |
15 |
204800 |
|
|
160391120 |
DangPhuDuy |
E |
June 13, 2022, 3:12 a.m. |
OK |
GNU C++14 |
TESTS |
38 |
15 |
204800 |
|
|
160388061 |
expecting |
E |
June 13, 2022, 1:47 a.m. |
OK |
GNU C++14 |
TESTS |
38 |
15 |
204800 |
|
|
160374885 |
xing89qs |
E |
June 12, 2022, 7 p.m. |
OK |
GNU C++14 |
TESTS |
38 |
15 |
204800 |
|
|
160397410 |
BARBARIANNNNN |
E |
June 13, 2022, 5:22 a.m. |
OK |
GNU C++14 |
TESTS |
38 |
15 |
204800 |
|
|
160369181 |
lddlinan |
E |
June 12, 2022, 5:47 p.m. |
OK |
GNU C++17 |
TESTS |
38 |
15 |
0 |
|
|
160363056 |
ki0apa |
E |
June 12, 2022, 4:56 p.m. |
OK |
GNU C++17 |
TESTS |
38 |
15 |
102400 |
|
|
160357971 |
forgothandle |
E |
June 12, 2022, 4:33 p.m. |
OK |
GNU C++17 |
TESTS |
38 |
15 |
102400 |
|
|
160374998 |
Bobocan |
E |
June 12, 2022, 7:02 p.m. |
OK |
GNU C++17 |
TESTS |
38 |
15 |
102400 |
|
|
160387464 |
luyuanfei |
E |
June 13, 2022, 1:26 a.m. |
OK |
GNU C++17 |
TESTS |
38 |
15 |
102400 |
|
|
160398245 |
kamalsharmaa9 |
E |
June 13, 2022, 5:37 a.m. |
OK |
GNU C++17 |
TESTS |
38 |
15 |
204800 |
|
|
160385348 |
stark2002 |
E |
June 12, 2022, 11:49 p.m. |
OK |
GNU C++17 |
TESTS |
38 |
15 |
204800 |
|
|
160377552 |
lotusblume |
E |
June 12, 2022, 7:44 p.m. |
OK |
GNU C++17 |
TESTS |
38 |
15 |
204800 |
|
|
160384929 |
igoroogle |
E |
June 12, 2022, 11:27 p.m. |
OK |
GNU C++17 |
TESTS |
38 |
15 |
204800 |
|
|
160381315 |
tykkipeli |
E |
June 12, 2022, 9:10 p.m. |
OK |
GNU C++17 |
TESTS |
38 |
15 |
204800 |
|
|
160394560 |
hokarikanae |
E |
June 13, 2022, 4:28 a.m. |
OK |
GNU C++17 (64) |
TESTS |
38 |
15 |
0 |
|
|
160364368 |
kotatsugame |
E |
June 12, 2022, 5:05 p.m. |
OK |
GNU C++17 (64) |
TESTS |
38 |
15 |
0 |
|
|
160365050 |
vipjml |
E |
June 12, 2022, 5:09 p.m. |
OK |
GNU C++17 (64) |
TESTS |
38 |
15 |
102400 |
|
|
160384575 |
CodigoL |
E |
June 12, 2022, 11:09 p.m. |
OK |
GNU C++17 (64) |
TESTS |
38 |
15 |
102400 |
|
|
160381925 |
prokopton |
E |
June 12, 2022, 9:26 p.m. |
OK |
GNU C++17 (64) |
TESTS |
38 |
15 |
102400 |
|
|
160375369 |
naman1601 |
E |
June 12, 2022, 7:08 p.m. |
OK |
GNU C++17 (64) |
TESTS |
38 |
15 |
102400 |
|
|
160367410 |
thiago_bastos |
E |
June 12, 2022, 5:30 p.m. |
OK |
GNU C++17 (64) |
TESTS |
38 |
15 |
102400 |
|
|
160364816 |
guud222 |
E |
June 12, 2022, 5:08 p.m. |
OK |
GNU C++17 (64) |
TESTS |
38 |
15 |
102400 |
|
|
160361213 |
tsukiko_tsutsukakushi |
E |
June 12, 2022, 4:45 p.m. |
OK |
GNU C++17 (64) |
TESTS |
38 |
15 |
102400 |
|
|
160356983 |
Xylenox |
E |
June 12, 2022, 4:32 p.m. |
OK |
GNU C++17 (64) |
TESTS |
38 |
15 |
102400 |
|
|
160363620 |
guperman |
E |
June 12, 2022, 5 p.m. |
OK |
GNU C++20 (64) |
TESTS |
38 |
0 |
0 |
|
|
160389178 |
gongkoufadongji |
E |
June 13, 2022, 2:20 a.m. |
OK |
GNU C++20 (64) |
TESTS |
38 |
0 |
102400 |
|
|
160384271 |
silxi |
E |
June 12, 2022, 10:53 p.m. |
OK |
GNU C++20 (64) |
TESTS |
38 |
15 |
0 |
|
|
160381896 |
JKadirov |
E |
June 12, 2022, 9:25 p.m. |
OK |
GNU C++20 (64) |
TESTS |
38 |
15 |
0 |
|
|
160373518 |
Brutality |
E |
June 12, 2022, 6:40 p.m. |
OK |
GNU C++20 (64) |
TESTS |
38 |
15 |
0 |
|
|
160391047 |
brobat |
E |
June 13, 2022, 3:10 a.m. |
OK |
GNU C++20 (64) |
TESTS |
38 |
15 |
0 |
|
|
160373193 |
emorgan5289 |
E |
June 12, 2022, 6:36 p.m. |
OK |
GNU C++20 (64) |
TESTS |
38 |
15 |
0 |
|
|
160372250 |
DerekYeh |
E |
June 12, 2022, 6:23 p.m. |
OK |
GNU C++20 (64) |
TESTS |
38 |
15 |
0 |
|
|
160373209 |
DerekYeh |
E |
June 12, 2022, 6:36 p.m. |
OK |
GNU C++20 (64) |
TESTS |
38 |
15 |
0 |
|
|
160390041 |
clause |
E |
June 13, 2022, 2:44 a.m. |
OK |
GNU C++20 (64) |
TESTS |
38 |
15 |
0 |
|
|
160389267 |
freehandle |
E |
June 13, 2022, 2:23 a.m. |
OK |
Java 11 |
TESTS |
38 |
171 |
0 |
|
|
160386605 |
dzhi |
E |
June 13, 2022, 12:49 a.m. |
OK |
Java 11 |
TESTS |
38 |
171 |
0 |
|
|
160386515 |
dzhi |
E |
June 13, 2022, 12:45 a.m. |
OK |
Java 11 |
TESTS |
38 |
186 |
0 |
|
|
160374508 |
Dukkha |
E |
June 12, 2022, 6:55 p.m. |
OK |
Java 11 |
TESTS |
38 |
187 |
102400 |
|
|
160364952 |
cc4414 |
E |
June 12, 2022, 5:09 p.m. |
OK |
Java 8 |
TESTS |
38 |
156 |
0 |
|
|
160381859 |
Alexey |
E |
June 12, 2022, 9:24 p.m. |
OK |
MS C++ 2017 |
TESTS |
38 |
15 |
0 |
|
|
160365365 |
misorin |
E |
June 12, 2022, 5:12 p.m. |
OK |
PyPy 3 |
TESTS |
38 |
155 |
5222400 |
|
|
160369113 |
siganai |
E |
June 12, 2022, 5:47 p.m. |
OK |
PyPy 3-64 |
TESTS |
38 |
124 |
6656000 |
|
|
160373398 |
FlakeLCR |
E |
June 12, 2022, 6:39 p.m. |
OK |
PyPy 3-64 |
TESTS |
38 |
155 |
10649600 |
|
|
160367778 |
huikang |
E |
June 12, 2022, 5:33 p.m. |
OK |
PyPy 3-64 |
TESTS |
38 |
202 |
12697600 |
|
|
160396773 |
MistaAsh |
E |
June 13, 2022, 5:11 a.m. |
OK |
Python 3 |
TESTS |
38 |
62 |
204800 |
|
|
remove filters
Back to search problems