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 |
|---|---|---|---|---|---|---|
| 2178 | Good Bye 2025 | FINISHED | False | 10800 | 9559523 | Dec. 27, 2025, 2:35 p.m. |
Solved |
Index |
Name |
Type |
Tags |
Community Tag |
Rating |
|---|---|---|---|---|---|---|
| ( 215 ) | I | Numbers or Fireworks | PROGRAMMING | combinatorics dp |
Now that all the presents have been delivered, the North Pole is finally at peace — and it's time to celebrate with a spectacular New Year's fireworks show! The North Pole is modeled as the Cartesian plane, with (n) cities located at distinct lattice points. You are also given an integer (k). For a proper subset(^{\text{∗}}) (T) of the cities ((T) may be empty), we define its explosiveness as follows: A firework is launched from every city in (T). For each city (c) not in (T), let (f) be the number of fireworks launched from cities that are exactly (\sqrt{k}) Euclidean distance(^{\text{†}}) away from (c). Assign the number ((f+1)) to this city (c). The explosiveness of (T) is the product of all numbers assigned in Step 2. Compute the sum of the explosiveness of (T) over all (2^n-1) proper subsets (T) of the cities. Since the answer may be large, output it modulo (998\,244\,353). (^{\text{∗}})A proper subset is any subset which is not equal to the whole set. (^{\text{†}})The Euclidean distance between two points ((x, y)) and ((p, q)) is defined as (\sqrt{(x - p)^2 + (y - q)^2}). Each test contains multiple test cases. The first line contains the number of test cases (t) ((1 \le t \le 1000)). The description of the test cases follows. The first line of each test case contains two integers (n) and (k) ((2\le n\le 31), (1\leq k \leq2\cdot 10^4)). Then (n) lines follow, the (i)-th line containing two integers (x_i) and (y_i) ((1\leq x_i, y_i\leq 100)) — the (x) and (y) coordinates of the (i)-th city, respectively. It is guaranteed that the coordinates of the cities are pairwise distinct. It is guaranteed that the sum of (n^3) over all test cases does not exceed (31^3). For each test case, print a single integer — the sum, modulo (998\,244\,353), of the explosiveness over all proper subsets (T) of |
Submission Id |
Author(s) |
Index |
Submitted |
Verdict |
Language |
Test Set |
Tests Passed |
Time taken (ms) |
Memory Consumed (bytes) |
Tags |
Rating |
|---|---|---|---|---|---|---|---|---|---|---|---|
| 355406497 | LiFar | I | Dec. 27, 2025, 5:30 p.m. | OK | C++17 (GCC 7-32) | TESTS | 51 | 3531 | 307200 | ||
| 355404165 | Swistakk | I | Dec. 27, 2025, 5:24 p.m. | OK | C++17 (GCC 7-32) | TESTS | 51 | 5156 | 0 | ||
| 355417944 | rand | I | Dec. 27, 2025, 8:24 p.m. | OK | C++20 (GCC 13-64) | TESTS | 51 | 921 | 307200 | ||
| 355400151 | tourist | I | Dec. 27, 2025, 5:12 p.m. | OK | C++20 (GCC 13-64) | TESTS | 51 | 953 | 102400 | ||
| 355401337 | EnofTaiPeople | I | Dec. 27, 2025, 5:16 p.m. | OK | C++20 (GCC 13-64) | TESTS | 51 | 1031 | 116326400 | ||
| 355397518 | 244mhq | I | Dec. 27, 2025, 5:04 p.m. | OK | C++20 (GCC 13-64) | TESTS | 51 | 1187 | 307200 | ||
| 355395932 | strapple | I | Dec. 27, 2025, 4:59 p.m. | OK | C++20 (GCC 13-64) | TESTS | 51 | 1593 | 614400 | ||
| 355429586 | qiuzx | I | Dec. 28, 2025, 1:03 a.m. | OK | C++20 (GCC 13-64) | TESTS | 51 | 1828 | 307200 | ||
| 355442191 | operator_ | I | Dec. 28, 2025, 5:16 a.m. | OK | C++20 (GCC 13-64) | TESTS | 51 | 2031 | 614400 | ||
| 355402809 | umbrella-leaf | I | Dec. 27, 2025, 5:20 p.m. | OK | C++20 (GCC 13-64) | TESTS | 51 | 6593 | 172646400 | ||
| 355402292 | turmax | I | Dec. 27, 2025, 5:18 p.m. | OK | C++20 (GCC 13-64) | TESTS | 51 | 8312 | 345907200 | ||
| 355436532 | Chenly | I | Dec. 28, 2025, 3:39 a.m. | OK | C++20 (GCC 13-64) | TESTS | 51 | 10484 | 354201600 |
Back to search problems