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.
ContestId |
Name |
Phase |
Frozen |
Duration (Seconds) |
Relative Time |
Start Time |
---|---|---|---|---|---|---|
1781 | VK Cup 2022 - Отборочный раунд (Engine) | FINISHED | False | 10800 | 58038899 | Jan. 15, 2023, 12:05 p.m. |
Solved$ |
Index |
Name |
Type |
Tags |
Community Tag |
Rating |
---|---|---|---|---|---|---|
( 97 ) | H2 | Window Signals (hard version) | PROGRAMMING |
B'This is the hard version of the problem. In this version, the constraints on h and w are higher. A house at the sea has h floors, all of the same height. The side of the house facing the sea has w windows at equal distances from each other on every floor. Thus, the windows are positioned in cells of a rectangular grid of size h x w . In every window, the light can be turned either on or off, except for the given k (at most 2 ) windows. In these k windows the light can not be turned on, because it is broken. In the dark, we can send a signal to a ship at sea using a configuration of lights turned on and off. However, the ship can not see the position of the lights with respect to the house. Thus, if one configuration of windows with lights on can be transformed into another using parallel translation, these configurations are considered equal. Note that only parallel translation is allowed, but neither rotations nor flips are. Moreover, a configuration without any light at all is not considered valid. Find how many different signals the ship can receive and print this number modulo 998 ,244 ,353 . Each test contains multiple test cases. The first line contains the number of test cases t ( 1 <= t <= 100 ). The description of the test cases follows. The first line of each test case contains three integers h , w , and k ( 1 <= h, w <= 200 ; 0 <= k <= min(h cdot w, 2) ) -- the height of the house, the number of windows on each floor, and the number of windows with broken lights. If k > 0 , each of the next k lines contains two integers r_i and c_i ( 1 <= r_i <= h ; 1 <= c_i <= w ) -- the floor number and the window number with the broken light. The floors are numbered 1 to h from bottom to top, and the windows are numbered 1 to w from left to right. If k = 2 , then either r_1 ne r_2 or $'... |
Tutorial |
No solutions yet.