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 |
---|---|---|---|---|---|---|
1795 | Educational Codeforces Round 143 (Rated for Div. 2) | FINISHED | False | 7200 | 60708263 | Feb. 16, 2023, 2:35 p.m. |
Solved$ |
Index |
Name |
Type |
Tags |
Community Tag |
Rating |
---|---|---|---|---|---|---|
( 697 ) | G | Removal Sequences | PROGRAMMING | bitmasks graphs |
B"You are given a simple undirected graph, consisting of n vertices and m edges. The vertices are numbered from 1 to n . The i -th vertex has a value a_i written on it. You will be removing vertices from that graph. You are allowed to remove vertex i only if its degree is equal to a_i . When a vertex is removed, all edges incident to it are also removed, thus, decreasing the degree of adjacent non-removed vertices. A valid sequence of removals is a permutation p_1, p_2, ... , p_n (1 <= p_i <= n) such that the i -th vertex to be removed is p_i , and every removal is allowed. A pair (x, y) of vertices is nice if there exist two valid sequences of removals such that x is removed before y in one of them and y is removed before x in the other one. Count the number of nice pairs (x, y) such that x < y . The first line contains a single integer t ( 1 <= t <= 10^4 ) -- the number of testcases. The first line of each testcase contains two integers n and m ( 1 <= n <= 10^5 ; 0 <= m <= min(10^5, frac{n cdot (n - 1)}{2}) ) -- the number of vertices and the number of edges of the graph. The second line contains n integers a_1, a_2, ... , a_n ( 0 <= a_i <= n - 1 ) -- the degree requirements for each removal. Each of the next m lines contains two integers v and u ( 1 <= v, u <= n ; v neq u ) -- the description of an edge. The graph doesn't contain any self-loops or multiple edges. The sum of n over all testcases doesn't exceed 10^5 . The sum of m over all testcases doesn't exceed 10^5 . Additional constraint on the input: there always exists at least one valid sequence of removals. For each testcase, print a single integer -- the number of nice pairs of vertices. "... |
112963 |
Submission Id |
Author(s) |
Index |
Submitted |
Verdict |
Language |
Test Set |
Tests Passed |
Time taken (ms) |
Memory Consumed (bytes) |
Tags |
Rating |
---|---|---|---|---|---|---|---|---|---|---|---|
193900708 | sjzezoj | G | Feb. 16, 2023, 4:23 p.m. | OK | GNU C++14 | TESTS | 83 | 1403 | 259174400 | ||
193946415 | JoesSR | G | Feb. 17, 2023, 2:43 a.m. | OK | GNU C++14 | TESTS | 83 | 1591 | 133222400 | ||
193945974 | Yakumo_Ran | G | Feb. 17, 2023, 2:32 a.m. | OK | GNU C++14 | TESTS | 83 | 1622 | 134963200 | ||
193908233 | thecold | G | Feb. 16, 2023, 4:47 p.m. | OK | GNU C++14 | TESTS | 83 | 1669 | 256819200 | ||
193946559 | Oscaryang | G | Feb. 17, 2023, 2:46 a.m. | OK | GNU C++14 | TESTS | 83 | 1731 | 109875200 | ||
193945936 | OccDreamer | G | Feb. 17, 2023, 2:31 a.m. | OK | GNU C++14 | TESTS | 83 | 1746 | 125644800 | ||
193946451 | Pointy | G | Feb. 17, 2023, 2:44 a.m. | OK | GNU C++14 | TESTS | 83 | 1778 | 132812800 | ||
193946500 | Oscaryang | G | Feb. 17, 2023, 2:45 a.m. | OK | GNU C++14 | TESTS | 83 | 1825 | 109875200 | ||
193945289 | KbltQaQ | G | Feb. 17, 2023, 2:13 a.m. | OK | GNU C++14 | TESTS | 83 | 1871 | 133529600 | ||
193946227 | JoesSR | G | Feb. 17, 2023, 2:38 a.m. | OK | GNU C++14 | TESTS | 83 | 1903 | 130969600 | ||
193938669 | vsinitsynav | G | Feb. 16, 2023, 11:05 p.m. | OK | GNU C++17 | TESTS | 83 | 1153 | 11264000 | ||
193912914 | marinareda | G | Feb. 16, 2023, 5:16 p.m. | OK | GNU C++17 | TESTS | 83 | 1200 | 6758400 | ||
193903534 | arthur.nascimento | G | Feb. 16, 2023, 4:30 p.m. | OK | GNU C++17 | TESTS | 83 | 1279 | 133632000 | ||
193910352 | maspy | G | Feb. 16, 2023, 4:59 p.m. | OK | GNU C++17 | TESTS | 83 | 1356 | 16896000 | ||
193905421 | arthur.nascimento | G | Feb. 16, 2023, 4:34 p.m. | OK | GNU C++17 | TESTS | 83 | 1357 | 196403200 | ||
193956821 | TwelveThread | G | Feb. 17, 2023, 6:01 a.m. | OK | GNU C++17 | TESTS | 84 | 1450 | 135782400 | ||
193911372 | liympanda | G | Feb. 16, 2023, 5:06 p.m. | OK | GNU C++17 | TESTS | 83 | 1528 | 7475200 | ||
193943051 | ctsrt | G | Feb. 17, 2023, 1:11 a.m. | OK | GNU C++17 | TESTS | 83 | 1544 | 32256000 | ||
193914175 | sleep__ | G | Feb. 16, 2023, 5:27 p.m. | OK | GNU C++17 | TESTS | 83 | 1637 | 109465600 | ||
193929053 | orangecalculator | G | Feb. 16, 2023, 8:13 p.m. | OK | GNU C++17 | TESTS | 83 | 1746 | 58880000 | ||
193914764 | DeadlyPillow | G | Feb. 16, 2023, 5:32 p.m. | OK | GNU C++17 (64) | TESTS | 83 | 514 | 60723200 | ||
193909446 | DeadlyPillow | G | Feb. 16, 2023, 4:54 p.m. | OK | GNU C++17 (64) | TESTS | 83 | 858 | 22220800 | ||
193922126 | kotatsugame | G | Feb. 16, 2023, 6:47 p.m. | OK | GNU C++17 (64) | TESTS | 83 | 873 | 12390400 | ||
193907905 | DeadlyPillow | G | Feb. 16, 2023, 4:45 p.m. | OK | GNU C++17 (64) | TESTS | 83 | 1123 | 10240000 | ||
193907982 | Nyaan | G | Feb. 16, 2023, 4:45 p.m. | OK | GNU C++17 (64) | TESTS | 83 | 1216 | 29286400 | ||
193907256 | Nyaan | G | Feb. 16, 2023, 4:41 p.m. | OK | GNU C++17 (64) | TESTS | 83 | 1341 | 32460800 | ||
193912050 | hitonanode | G | Feb. 16, 2023, 5:10 p.m. | OK | GNU C++17 (64) | TESTS | 83 | 1356 | 26726400 | ||
193943773 | vjudge3 | G | Feb. 17, 2023, 1:31 a.m. | OK | GNU C++17 (64) | TESTS | 83 | 1403 | 76083200 | ||
193912145 | hitonanode | G | Feb. 16, 2023, 5:11 p.m. | OK | GNU C++17 (64) | TESTS | 83 | 1435 | 26726400 | ||
193909039 | Nyaan | G | Feb. 16, 2023, 4:51 p.m. | OK | GNU C++17 (64) | TESTS | 83 | 1512 | 29286400 | ||
193927858 | jeroenodb | G | Feb. 16, 2023, 7:56 p.m. | OK | GNU C++20 (64) | TESTS | 83 | 358 | 17100800 | ||
193932588 | jeroenodb | G | Feb. 16, 2023, 9:02 p.m. | OK | GNU C++20 (64) | TESTS | 83 | 451 | 15257600 | ||
193927708 | jeroenodb | G | Feb. 16, 2023, 7:55 p.m. | OK | GNU C++20 (64) | TESTS | 83 | 468 | 17920000 | ||
193927779 | jeroenodb | G | Feb. 16, 2023, 7:55 p.m. | OK | GNU C++20 (64) | TESTS | 83 | 499 | 30720000 | ||
193932675 | jeroenodb | G | Feb. 16, 2023, 9:03 p.m. | OK | GNU C++20 (64) | TESTS | 83 | 514 | 17100800 | ||
193932614 | jeroenodb | G | Feb. 16, 2023, 9:03 p.m. | OK | GNU C++20 (64) | TESTS | 83 | 592 | 15257600 | ||
193932698 | jeroenodb | G | Feb. 16, 2023, 9:04 p.m. | OK | GNU C++20 (64) | TESTS | 83 | 592 | 17100800 | ||
193927293 | jeroenodb | G | Feb. 16, 2023, 7:49 p.m. | OK | GNU C++20 (64) | TESTS | 83 | 748 | 10137600 | ||
193909678 | maspy | G | Feb. 16, 2023, 4:55 p.m. | OK | GNU C++20 (64) | TESTS | 83 | 936 | 16179200 | ||
193941871 | dXqwq | G | Feb. 17, 2023, 12:36 a.m. | OK | GNU C++20 (64) | TESTS | 83 | 1075 | 131686400 | ||
193899039 | arvindf232 | G | Feb. 16, 2023, 4:19 p.m. | OK | Kotlin 1.7 | TESTS | 83 | 3649 | 268390400 | ||
193901327 | arvindf232 | G | Feb. 16, 2023, 4:25 p.m. | OK | Kotlin 1.7 | TESTS | 83 | 3728 | 268390400 | ||
193936444 | arvindf232 | G | Feb. 16, 2023, 10:10 p.m. | OK | Kotlin 1.7 | TESTS | 83 | 3790 | 268390400 | ||
193900753 | arvindf232 | G | Feb. 16, 2023, 4:23 p.m. | OK | Kotlin 1.7 | TESTS | 83 | 3821 | 224153600 | ||
193918653 | misorin | G | Feb. 16, 2023, 6:09 p.m. | OK | PyPy 3-64 | TESTS | 83 | 2074 | 40550400 |
Back to search problems