Educational Codeforces Round 170 (Rated for Div. 2)

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
2025 Educational Codeforces Round 170 (Rated for Div. 2) FINISHED False 7200 47489123 Oct. 14, 2024, 2:35 p.m.

Problems

Solved
Index
Name
Type
Tags
Community Tag
Rating
( 2354 ) E Card Game PROGRAMMING combinatorics dp fft greedy math

In the most popular card game in Berland, a deck of (n \times m) cards is used. Each card has two parameters: suit and rank. Suits in the game are numbered from (1) to (n), and ranks are numbered from (1) to (m). There is exactly one card in the deck for each combination of suit and rank. A card with suit (a) and rank (b) can beat a card with suit (c) and rank (d) in one of two cases: (a = 1), (c \ne 1) (a card of suit (1) can beat a card of any other suit); (a = c), (b > d) (a card can beat any other card of the same suit but of a lower rank). Two players play the game. Before the game starts, they receive exactly half of the deck each. The first player wins if for every card of the second player, he can choose his card that can beat it, and there is no card that is chosen twice (i. e. there exists a matching of the first player's cards with the second player's cards such that in each pair the first player's card beats the second player's card). Otherwise, the second player wins. Your task is to calculate the number of ways to distribute the cards so that the first player wins. Two ways are considered different if there exists a card such that in one way it belongs to the first player and in the other way it belongs to the second player. The number of ways can be very large, so print it modulo (998244353). The only line contains two integers (n) and (m) ((1 \le n, m \le 500)). Additional constraint on the input: (m) is even. Print a single integer — the number of ways to distribute the cards so that the first player wins, taken modulo (998244353).

Tutorials

Educational Codeforces Round 170 Editorial

Submissions

Submission Id
Author(s)
Index
Submitted
Verdict
Language
Test Set
Tests Passed
Time taken (ms)
Memory Consumed (bytes)
Tags
Rating
285958628 jmyszka E Oct. 14, 2024, 8:17 p.m. OK C++17 (GCC 7-32) TESTS 50 77 307200
285972818 nuo0918 E Oct. 15, 2024, 1:18 a.m. OK C++17 (GCC 7-32) TESTS 50 77 8601600
285980802 violetctl39 E Oct. 15, 2024, 3:34 a.m. OK C++17 (GCC 7-32) TESTS 50 77 16486400
285958023 abhi-bnsl E Oct. 14, 2024, 8:11 p.m. OK C++17 (GCC 7-32) TESTS 50 140 4096000
285939691 nishant403 E Oct. 14, 2024, 5:33 p.m. OK C++17 (GCC 7-32) TESTS 50 155 2252800
285967197 parag776 E Oct. 14, 2024, 10:50 p.m. OK C++17 (GCC 7-32) TESTS 50 171 102400
285934762 son_and_moon E Oct. 14, 2024, 5:02 p.m. OK C++17 (GCC 7-32) TESTS 50 202 2150400
285931474 t98slider E Oct. 14, 2024, 4:45 p.m. OK C++17 (GCC 7-32) TESTS 50 202 3788800
285935852 HY_Spark E Oct. 14, 2024, 5:08 p.m. OK C++17 (GCC 7-32) TESTS 50 203 32460800
285928189 lazyhash E Oct. 14, 2024, 4:33 p.m. OK C++17 (GCC 7-32) TESTS 50 218 2048000
285968338 Rvess E Oct. 14, 2024, 11:21 p.m. OK C++20 (GCC 13-64) TESTS 50 61 102400
285964360 andycoke E Oct. 14, 2024, 9:43 p.m. OK C++20 (GCC 13-64) TESTS 50 62 102400
285939308 shiven E Oct. 14, 2024, 5:31 p.m. OK C++20 (GCC 13-64) TESTS 50 62 102400
285978642 adam01 E Oct. 15, 2024, 3:05 a.m. OK C++20 (GCC 13-64) TESTS 50 62 716800
285968319 Rvess E Oct. 14, 2024, 11:21 p.m. OK C++20 (GCC 13-64) TESTS 50 62 2457600
285966513 Rvess E Oct. 14, 2024, 10:33 p.m. OK C++20 (GCC 13-64) TESTS 50 62 4096000
285987219 Auroraa_ E Oct. 15, 2024, 4:55 a.m. OK C++20 (GCC 13-64) TESTS 50 77 102400
285967754 Rvess E Oct. 14, 2024, 11:05 p.m. OK C++20 (GCC 13-64) TESTS 50 77 512000
285933934 Ghost_LX E Oct. 14, 2024, 4:57 p.m. OK C++20 (GCC 13-64) TESTS 50 77 1126400
285933736 Ghost_LX E Oct. 14, 2024, 4:56 p.m. OK C++20 (GCC 13-64) TESTS 50 77 1126400
285971586 JoesSR E Oct. 15, 2024, 12:53 a.m. OK C++23 (GCC 14-64, msys2) TESTS 50 61 102400
285956161 nuyoah007 E Oct. 14, 2024, 7:50 p.m. OK C++23 (GCC 14-64, msys2) TESTS 50 62 614400
285975890 RuinGuard E Oct. 15, 2024, 2:20 a.m. OK C++23 (GCC 14-64, msys2) TESTS 50 77 2150400
285975569 RuinGuard E Oct. 15, 2024, 2:13 a.m. OK C++23 (GCC 14-64, msys2) TESTS 50 77 2150400
285968259 wangmingwei E Oct. 14, 2024, 11:19 p.m. OK C++23 (GCC 14-64, msys2) TESTS 50 77 4096000
285982503 RuinGuard E Oct. 15, 2024, 3:58 a.m. OK C++23 (GCC 14-64, msys2) TESTS 50 78 2150400
285951256 F_Rio E Oct. 14, 2024, 7:01 p.m. OK C++23 (GCC 14-64, msys2) TESTS 50 93 102400
285982583 TMM233 E Oct. 15, 2024, 3:58 a.m. OK C++23 (GCC 14-64, msys2) TESTS 50 93 2150400
285981407 RuinGuard E Oct. 15, 2024, 3:43 a.m. OK C++23 (GCC 14-64, msys2) TESTS 50 93 2150400
285975755 RuinGuard E Oct. 15, 2024, 2:17 a.m. OK C++23 (GCC 14-64, msys2) TESTS 50 93 2150400
285968162 Quasicoherent E Oct. 14, 2024, 11:16 p.m. OK Java 21 TESTS 50 327 921600
285932832 arnabmanna E Oct. 14, 2024, 4:52 p.m. OK Java 21 TESTS 50 546 1126400
285924743 Lilypad E Oct. 14, 2024, 4:28 p.m. OK Java 21 TESTS 50 859 2048000
285926880 Lipind E Oct. 14, 2024, 4:31 p.m. OK Java 21 TESTS 50 890 1945600
285982168 yvbf E Oct. 15, 2024, 3:53 a.m. OK Java 8 TESTS 50 514 0
285974424 edugong E Oct. 15, 2024, 1:53 a.m. OK PyPy 3-64 TESTS 50 109 1638400
285972476 edugong E Oct. 15, 2024, 1:12 a.m. OK PyPy 3-64 TESTS 50 155 5734400
285926361 fermion5 E Oct. 14, 2024, 4:30 p.m. OK PyPy 3-64 TESTS 50 187 2457600
285948635 jgs03177 E Oct. 14, 2024, 6:38 p.m. OK PyPy 3-64 TESTS 50 202 2355200
285966555 vwxyz0 E Oct. 14, 2024, 10:34 p.m. OK PyPy 3-64 TESTS 50 202 5734400
285933138 sushmanth.dampur8780 E Oct. 14, 2024, 4:53 p.m. OK PyPy 3-64 TESTS 50 359 2560000
285924599 Joaster E Oct. 14, 2024, 4:27 p.m. OK PyPy 3-64 TESTS 50 405 6451200
285948373 hxu10 E Oct. 14, 2024, 6:36 p.m. OK PyPy 3-64 TESTS 50 452 2662400
285943828 eepsilon E Oct. 14, 2024, 6:02 p.m. OK PyPy 3-64 TESTS 50 452 6553600
285954158 MassimoG E Oct. 14, 2024, 7:28 p.m. OK PyPy 3-64 TESTS 50 1609 33587200
285926922 tifv E Oct. 14, 2024, 4:31 p.m. OK Rust 2021 TESTS 50 108 102400
285926206 PaciukZvichainyi E Oct. 14, 2024, 4:30 p.m. OK Rust 2021 TESTS 50 233 102400
285954484 PaciukZvichainyi E Oct. 14, 2024, 7:32 p.m. OK Rust 2021 TESTS 50 280 102400
285928516 JustifiedGearbox E Oct. 14, 2024, 4:34 p.m. OK Rust 2021 TESTS 50 328 819200
285948019 123gjweq2 E Oct. 14, 2024, 6:33 p.m. OK Rust 2021 TESTS 50 859 102400

remove filters

Back to search problems