Codeforces Round 959 sponsored by NEAR (Div. 1 + 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
1994 Codeforces Round 959 sponsored by NEAR (Div. 1 + Div. 2) FINISHED False 7200 10509899 July 18, 2024, 2:35 p.m.

Problems

Solved$
Index
Name
Type
Tags
Community Tag
Rating
( 705 ) H Fortnite PROGRAMMING interactive math

B"This is an interactive problem! Timofey is writing a competition called Capture the Flag (or CTF for short). He has one task left, which involves hacking a security system. The entire system is based on polynomial hashes ^{ text{ xe2 x88 x97}} . Timofey can input a string consisting of lowercase Latin letters into the system, and the system will return its polynomial hash. To hack the system, Timofey needs to find the polynomial hash parameters ( p and m ) that the system uses. Timofey doesn't have much time left, so he will only be able to make 3 queries. Help him solve the task. ^{ text{ xe2 x88 x97}} The polynomial hash of a string s , consisting of lowercase Latin letters of length n , based on p and modulo m is ( mathrm{ord}(s_1) cdot p ^ 0 + mathrm{ord}(s_2) cdot p ^ 1 + mathrm{ord}(s_3) cdot p ^ 2 + ldots + mathrm{ord}(s_n) cdot p ^ {n - 1}) bmod m . Where s_i denotes the i -th character of the string s , mathrm{ord}( mathrm{chr}) denotes the ordinal number of the character mathrm{chr} in the English alphabet, and x bmod m is the remainder of x when divided by m . Each test consists of multiple test cases. The first line contains an integer t ( 1 <= q t <= q 10^3 ) -- the number of test cases. It is guaranteed that the p and m used by the system satisfy the conditions: 26 < p <= q 50 and p + 1 < m <= q 2 cdot 10^9 . To make a query to the system, output ? s , where s is a string of no more than 50 characters in length, the hash of which you want to know. In response to this query, you will receive the polynomial hash of the string s . To output the answer, output ! p m , where p is the base of the hash, and m is the modulus. After that, immediately proceed to the next test case. You have to make not more than 3 queries ?, otherwise you will get verdict Wrong Answer. After o"...

Tutorials

Video Tutorial

Submissions

Submission Id
Author(s)
Index
Submitted
Verdict
Language
Test Set
Tests Passed
Time taken (ms)
Memory Consumed (bytes)
Tags
Rating
271257146 JohnVictor H July 18, 2024, 4:17 p.m. OK C++14 (GCC 6-32) TESTS 20 77 0
271319497 seanlsy H July 19, 2024, 3:59 a.m. OK C++14 (GCC 6-32) TESTS 21 124 0
271294995 regain0002 H July 18, 2024, 10:21 p.m. OK C++17 (GCC 7-32) TESTS 21 92 16076800
271256333 orzdevinwang H July 18, 2024, 4:15 p.m. OK C++17 (GCC 7-32) TESTS 20 92 16076800
271308536 Sparkle_Twilight H July 19, 2024, 2:11 a.m. OK C++17 (GCC 7-32) TESTS 21 93 0
271280084 pixelpilgrims H July 18, 2024, 7:03 p.m. OK C++17 (GCC 7-32) TESTS 21 93 0
271267941 mango_lassi H July 18, 2024, 5:24 p.m. OK C++17 (GCC 7-32) TESTS 20 93 0
271271975 mario.locaus H July 18, 2024, 5:50 p.m. OK C++17 (GCC 7-32) TESTS 21 108 0
271304958 tranlamvinh H July 19, 2024, 1:29 a.m. OK C++17 (GCC 7-32) TESTS 21 109 0
271294974 regain0002 H July 18, 2024, 10:21 p.m. OK C++17 (GCC 7-32) TESTS 21 125 0
271273549 Ronak122 H July 18, 2024, 6:02 p.m. OK C++17 (GCC 7-32) TESTS 21 125 0
271320362 lfc_andy26 H July 19, 2024, 4:09 a.m. OK C++20 (GCC 13-64) TESTS 21 77 0
271283359 neal H July 18, 2024, 7:39 p.m. OK C++20 (GCC 13-64) TESTS 21 77 0
271257398 ecnerwala H July 18, 2024, 4:18 p.m. OK C++20 (GCC 13-64) TESTS 20 77 0
271302515 ahmedsalah66848 H July 19, 2024, 12:57 a.m. OK C++20 (GCC 13-64) TESTS 21 78 0
271283377 neal H July 18, 2024, 7:39 p.m. OK C++20 (GCC 13-64) TESTS 21 78 0
271277430 BernatP H July 18, 2024, 6:35 p.m. OK C++20 (GCC 13-64) TESTS 21 78 0
271320161 ETO_leader H July 19, 2024, 4:06 a.m. OK C++20 (GCC 13-64) TESTS 21 93 0
271313433 jiangbowen_ H July 19, 2024, 3:01 a.m. OK C++20 (GCC 13-64) TESTS 21 93 0
271313298 ikaurov H July 19, 2024, 3 a.m. OK C++20 (GCC 13-64) TESTS 21 93 0
271311959 physics0523 H July 19, 2024, 2:47 a.m. OK C++20 (GCC 13-64) TESTS 21 93 0
271296427 rainboy H July 18, 2024, 10:51 p.m. OK GNU C11 TESTS 21 109 8396800
271283105 Alex_Toppo_06 H July 18, 2024, 7:36 p.m. OK Kotlin 1.9 TESTS 21 265 0
271270941 shade34 H July 18, 2024, 5:43 p.m. OK PyPy 3-64 TESTS 21 264 6860800
271294902 supersonicdandelion H July 18, 2024, 10:19 p.m. OK PyPy 3-64 TESTS 21 453 8908800
271320867 SnowballSH H July 19, 2024, 4:15 a.m. OK Rust 2021 TESTS 21 93 0
271261830 Egor H July 18, 2024, 4:30 p.m. OK Rust 2021 TESTS 20 93 0

remove filters

Back to search problems