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 distinct points on a plane with integral coordinates. For each point you can either draw a vertical line through it, draw a horizontal line through it, or do nothing. You consider several coinciding straight lines as a single one. How many distinct pictures you can get? Print the answer modulo 109 xe2 x80 x89+ xe2 x80 x897. The first line contains single integer n (1 xe2 x80 x89 xe2 x89 xa4 xe2 x80 x89n xe2 x80 x89 xe2 x89 xa4 xe2 x80 x89105) -- the number of points. n lines follow. The (i xe2 x80 x89+ xe2 x80 x891)-th of these lines contains two integers xi, yi ( xe2 x80 x89- xe2 x80 x89109 xe2 x80 x89 xe2 x89 xa4 xe2 x80 x89xi, xe2 x80 x89yi xe2 x80 x89 xe2 x89 xa4 xe2 x80 x89109) -- coordinates of the i-th point. It is guaranteed that all points are distinct. Print the number of possible distinct pictures modulo 109 xe2 x80 x89+ xe2 x80 x897. In the first example there are two vertical and two horizontal lines passing through the points. You can get pictures with any subset of these lines. For example, you can get the picture containing all four lines in two ways (each segment represents a line containing it). In the second example you can work with two points independently. The number of pictures is 32 xe2 x80 x89= xe2 x80 x899. '... |
Tutorials
Submissions
Submission Id |
Author(s) |
Index |
Submitted |
Verdict |
Language |
Test Set |
Tests Passed |
Time taken (ms) |
Memory Consumed (bytes) |
Tags |
Rating |
31382188 |
Heaplax |
E |
Oct. 16, 2017, 5:16 a.m. |
OK |
GNU C++ |
TESTS |
33 |
46 |
6348800 |
|
2400 |
31580631 |
shyf1301 |
E |
Oct. 21, 2017, 4:21 p.m. |
OK |
GNU C++ |
TESTS |
33 |
46 |
6553600 |
|
2400 |
35596344 |
Scut82 |
E |
Feb. 23, 2018, 12:32 p.m. |
OK |
GNU C++ |
TESTS |
33 |
61 |
28774400 |
|
2400 |
31466737 |
Icyfox |
E |
Oct. 18, 2017, 2:28 a.m. |
OK |
GNU C++ |
TESTS |
33 |
62 |
6246400 |
|
2400 |
31379046 |
zxyer |
E |
Oct. 15, 2017, 11:44 p.m. |
OK |
GNU C++ |
TESTS |
33 |
62 |
6348800 |
|
2400 |
31386667 |
diaosipan |
E |
Oct. 16, 2017, 9:27 a.m. |
OK |
GNU C++ |
TESTS |
33 |
78 |
10342400 |
|
2400 |
35593790 |
Scut82 |
E |
Feb. 23, 2018, 10:34 a.m. |
OK |
GNU C++ |
TESTS |
33 |
78 |
11264000 |
|
2400 |
34049619 |
vjudge2 |
E |
Jan. 9, 2018, 1:30 p.m. |
OK |
GNU C++ |
TESTS |
33 |
78 |
14131200 |
|
2400 |
35596165 |
Scut82 |
E |
Feb. 23, 2018, 12:24 p.m. |
OK |
GNU C++ |
TESTS |
33 |
78 |
16998400 |
|
2400 |
31379093 |
xuqijie |
E |
Oct. 15, 2017, 11:50 p.m. |
OK |
GNU C++ |
TESTS |
33 |
93 |
7065600 |
|
2400 |
31469259 |
elijahqi |
E |
Oct. 18, 2017, 5:26 a.m. |
OK |
GNU C++11 |
TESTS |
33 |
61 |
6451200 |
|
2400 |
47620078 |
luogu_bot5 |
E |
Dec. 28, 2018, 12:24 p.m. |
OK |
GNU C++11 |
TESTS |
33 |
78 |
4198400 |
|
2400 |
69566900 |
liuweih |
E |
Jan. 26, 2020, 12:45 p.m. |
OK |
GNU C++11 |
TESTS |
33 |
78 |
5222400 |
|
2400 |
33648594 |
kekxy |
E |
Dec. 26, 2017, 2:01 p.m. |
OK |
GNU C++11 |
TESTS |
33 |
78 |
5939200 |
|
2400 |
31433463 |
The_Wolfpack |
E |
Oct. 16, 2017, 9:29 p.m. |
OK |
GNU C++11 |
TESTS |
33 |
78 |
6656000 |
|
2400 |
31379727 |
superguymj |
E |
Oct. 16, 2017, 1:20 a.m. |
OK |
GNU C++11 |
TESTS |
33 |
78 |
6860800 |
|
2400 |
49688071 |
LittleDino |
E |
Feb. 10, 2019, 9:07 a.m. |
OK |
GNU C++11 |
TESTS |
33 |
78 |
7987200 |
|
2400 |
44696367 |
luogu_bot5 |
E |
Oct. 22, 2018, 1:08 p.m. |
OK |
GNU C++11 |
TESTS |
33 |
78 |
8601600 |
|
2400 |
35568414 |
ACcepted_automaton |
E |
Feb. 22, 2018, 8:49 a.m. |
OK |
GNU C++11 |
TESTS |
33 |
78 |
9216000 |
|
2400 |
31385724 |
Never_See |
E |
Oct. 16, 2017, 8:37 a.m. |
OK |
GNU C++11 |
TESTS |
33 |
78 |
16281600 |
|
2400 |
40979530 |
ReaLNero1 |
E |
July 30, 2018, 5:07 p.m. |
OK |
GNU C++14 |
TESTS |
33 |
62 |
47206400 |
|
2400 |
31365832 |
cookyy |
E |
Oct. 15, 2017, 1:03 p.m. |
OK |
GNU C++14 |
TESTS |
33 |
93 |
5836800 |
|
2400 |
31496817 |
cxh007 |
E |
Oct. 19, 2017, 3:22 a.m. |
OK |
GNU C++14 |
TESTS |
33 |
93 |
12492800 |
|
2400 |
45150615 |
Amoo_Safar |
E |
Oct. 31, 2018, 7:36 p.m. |
OK |
GNU C++14 |
TESTS |
33 |
109 |
5632000 |
|
2400 |
45144936 |
ye_div_2_e |
E |
Oct. 31, 2018, 4:21 p.m. |
OK |
GNU C++14 |
TESTS |
33 |
109 |
5632000 |
|
2400 |
45222836 |
linkfqy |
E |
Nov. 2, 2018, 11:19 p.m. |
OK |
GNU C++14 |
TESTS |
33 |
109 |
6758400 |
|
2400 |
34096796 |
Zxyelf |
E |
Jan. 11, 2018, 9:14 p.m. |
OK |
GNU C++14 |
TESTS |
33 |
109 |
15257600 |
|
2400 |
31447312 |
Dewdis |
E |
Oct. 17, 2017, noon |
OK |
GNU C++14 |
TESTS |
33 |
124 |
7168000 |
|
2400 |
31537191 |
Eson |
E |
Oct. 20, 2017, 2:52 p.m. |
OK |
GNU C++14 |
TESTS |
33 |
124 |
10137600 |
|
2400 |
48699831 |
black_horse2014 |
E |
Jan. 22, 2019, 1:58 a.m. |
OK |
GNU C++14 |
TESTS |
33 |
124 |
12800000 |
|
2400 |
41657961 |
w446506278 |
E |
Aug. 16, 2018, 4:01 p.m. |
OK |
GNU C++17 |
TESTS |
33 |
124 |
10137600 |
|
2400 |
56707015 |
cheetose |
E |
July 8, 2019, 11:25 a.m. |
OK |
GNU C++17 |
TESTS |
33 |
187 |
17817600 |
|
2400 |
40979881 |
crathva |
E |
July 30, 2018, 5:17 p.m. |
OK |
GNU C++17 |
TESTS |
33 |
217 |
16281600 |
|
2400 |
51465864 |
yuma_ |
E |
March 19, 2019, 1:20 a.m. |
OK |
GNU C++17 |
TESTS |
33 |
218 |
19353600 |
|
2400 |
42833283 |
Akulyat |
E |
Sept. 13, 2018, 2:06 p.m. |
OK |
GNU C++17 |
TESTS |
33 |
343 |
31129600 |
|
2400 |
44829386 |
redotter |
E |
Oct. 25, 2018, 7:49 a.m. |
OK |
GNU C++17 |
TESTS |
33 |
373 |
31232000 |
|
2400 |
46527804 |
AngusRitossa |
E |
Dec. 3, 2018, 12:49 a.m. |
OK |
GNU C++17 |
TESTS |
33 |
405 |
23756800 |
|
2400 |
44829107 |
redotter |
E |
Oct. 25, 2018, 7:42 a.m. |
OK |
GNU C++17 |
TESTS |
33 |
405 |
31232000 |
|
2400 |
44829400 |
redotter |
E |
Oct. 25, 2018, 7:49 a.m. |
OK |
GNU C++17 |
TESTS |
33 |
405 |
31436800 |
|
2400 |
60277035 |
Arianfk |
E |
Sept. 8, 2019, 6:23 p.m. |
OK |
GNU C++17 |
TESTS |
33 |
483 |
16076800 |
|
2400 |
67573516 |
dell_ |
E |
Dec. 24, 2019, 11 p.m. |
OK |
MS C++ 2017 |
TESTS |
33 |
296 |
5324800 |
|
2400 |
51375945 |
aleonov |
E |
March 16, 2019, 2:05 p.m. |
OK |
PyPy 3 |
TESTS |
33 |
498 |
27750400 |
|
2400 |
38712006 |
Ali_Pi |
E |
May 29, 2018, 7:33 a.m. |
OK |
Python 2 |
TESTS |
33 |
1107 |
19763200 |
|
2400 |
51366414 |
r57shell |
E |
March 16, 2019, 9:53 a.m. |
OK |
Python 3 |
TESTS |
33 |
685 |
22528000 |
|
2400 |
32761045 |
nathantheinventor |
E |
Nov. 28, 2017, 9:11 p.m. |
OK |
Python 3 |
TESTS |
33 |
1153 |
23449600 |
|
2400 |
remove filters
Back to search problems