Codeforces Global Round 3

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
1148 Codeforces Global Round 3 FINISHED False 8100 172423499 June 1, 2019, 2:35 p.m.

Problems

Solved$
Index
Name
Type
Tags
Community Tag
Rating
( 1046 ) F Foo Fighters PROGRAMMING bitmasks constructive algorithms 2500

B'You are given n objects. Each object has two integer properties: val_i -- its price -- and mask_i . It is guaranteed that the sum of all prices is initially non-zero. You want to select a positive integer s . All objects will be modified after that. The i -th object will be modified using the following procedure: You need to find such an integer s that when the modification above is done the sum of all prices changes sign (if it was negative, it should become positive, and vice-versa; it is not allowed for it to become zero). The absolute value of the sum can be arbitrary. The first line contains a single integer n ( 1 <= q n <= q 3 cdot 10^5 ) -- the number of objects. The i -th of next n lines contains integers val_i and mask_i ( -10^9 <= q val_i <= q 10^9 , 1 <= mask_i <= 2^{62} - 1 ) -- the price of the object and its mask. It is guaranteed that the sum of val_i is initially non-zero. Print an integer s ( 1 <= s <= 2^{62} - 1 ), such that if we modify the objects as described above, the sign of the sum of val_i changes its sign. If there are multiple such s , print any of them. One can show that there is always at least one valid s . In the first test sample all objects will change their prices except for the object with mask 151 . So their total sum will change its sign: initially 24 , after modifications -- -28 . In the second test sample the only object will change its price. So the total sum will change its sign. '...

Tutorials

Codeforces Global Round 3 Editorial

Submissions

Submission Id
Author(s)
Index
Submitted
Verdict
Language
Test Set
Tests Passed
Time taken (ms)
Memory Consumed (bytes)
Tags
Rating
55067173 jiangly F June 4, 2019, 4:20 a.m. OK Clang++17 Diagnostics TESTS 54 451 3072000 2500
55202492 Denor F June 6, 2019, 11:11 a.m. OK Delphi TESTS 54 342 4812800 2500
55202188 Denor F June 6, 2019, 11:04 a.m. OK Delphi TESTS 54 389 4915200 2500
55201092 Denor F June 6, 2019, 10:37 a.m. OK Delphi TESTS 54 404 5734400 2500
55201726 Denor F June 6, 2019, 10:52 a.m. OK Delphi TESTS 54 498 6451200 2500
67035142 rainboy F Dec. 16, 2019, 5:09 p.m. OK GNU C11 TESTS 58 233 3584000 2500
60225781 11235813213455 F Sept. 7, 2019, 3:04 p.m. OK GNU C++11 TESTS 58 46 7270400 2500
55183130 lwhlwh F June 6, 2019, 1:08 a.m. OK GNU C++11 TESTS 54 62 5836800 2500
55610335 ReaLNero1 F June 16, 2019, 5:16 a.m. OK GNU C++11 TESTS 58 77 16076800 2500
59650874 chenyewei_1234 F Aug. 29, 2019, 8:09 a.m. OK GNU C++11 TESTS 58 78 3481600 2500
55225795 DQS F June 7, 2019, 1:08 a.m. OK GNU C++11 TESTS 54 78 16076800 2500
55015920 xgzepto F June 3, 2019, 12:19 p.m. OK GNU C++11 TESTS 54 93 3584000 2500
54976383 dazade_8 F June 2, 2019, 11:03 a.m. OK GNU C++11 TESTS 54 93 4608000 2500
55400528 Big_black_jujube F June 10, 2019, 1:51 p.m. OK GNU C++11 TESTS 58 93 4812800 2500
66296004 Wangxuye F Dec. 5, 2019, 4:22 a.m. OK GNU C++11 TESTS 58 93 9625600 2500
66296107 vjudge4 F Dec. 5, 2019, 4:28 a.m. OK GNU C++11 TESTS 58 93 9625600 2500
61777804 idxcalcal F Oct. 3, 2019, 12:14 p.m. OK GNU C++14 TESTS 58 155 3891200 2500
55107893 xdu_lhz F June 5, 2019, 4:24 a.m. OK GNU C++14 TESTS 54 186 9011200 2500
54945167 lumibons F June 1, 2019, 4:40 p.m. OK GNU C++14 TESTS 51 186 9113600 2500
55273526 pr3pony F June 7, 2019, 5:39 p.m. OK GNU C++14 TESTS 54 186 9113600 2500
55128342 Mlxa F June 5, 2019, 1:58 p.m. OK GNU C++14 TESTS 54 186 10444800 2500
54950112 _Ash__ F June 1, 2019, 6:52 p.m. OK GNU C++14 TESTS 51 187 25804800 2500
67666665 acm F Dec. 26, 2019, 6:10 p.m. OK GNU C++14 TESTS 58 202 3891200 2500
67666402 acm F Dec. 26, 2019, 6:03 p.m. OK GNU C++14 TESTS 58 202 3891200 2500
67666855 acm F Dec. 26, 2019, 6:15 p.m. OK GNU C++14 TESTS 58 202 3891200 2500
61088505 Jester F Sept. 22, 2019, 7:28 p.m. OK GNU C++14 TESTS 58 202 4812800 2500
54996359 interestingLSY F June 3, 2019, 12:16 a.m. OK GNU C++17 TESTS 54 108 5836800 2500
55180519 RCG F June 5, 2019, 9:44 p.m. OK GNU C++17 TESTS 54 186 4812800 2500
54957653 Elegia F June 2, 2019, 1:21 a.m. OK GNU C++17 TESTS 52 186 9830400 2500
63039481 ericxu0 F Oct. 20, 2019, 11:16 p.m. OK GNU C++17 TESTS 58 202 6041600 2500
54942943 fedoseev.timofey F June 1, 2019, 4:29 p.m. OK GNU C++17 TESTS 51 202 6553600 2500
54968204 tyler F June 2, 2019, 7:24 a.m. OK GNU C++17 TESTS 52 202 7680000 2500
58404798 Fortin F Aug. 6, 2019, 7:50 p.m. OK GNU C++17 TESTS 58 217 4812800 2500
60490847 Pa.Nic F Sept. 13, 2019, 2:28 p.m. OK GNU C++17 TESTS 58 217 6860800 2500
56760290 kidddddddddddddddddddddd F July 9, 2019, 3:34 p.m. OK GNU C++17 TESTS 58 217 14643200 2500
58404842 Fortin F Aug. 6, 2019, 7:51 p.m. OK GNU C++17 TESTS 58 218 4812800 2500
67035141 Dukkha F Dec. 16, 2019, 5:09 p.m. OK Java 11 TESTS 58 1263 0 2500
55002886 dalt F June 3, 2019, 5:48 a.m. OK Java 8 TESTS 54 233 5734400 2500
56249157 mbfeci F June 29, 2019, 1:08 a.m. OK Java 8 TESTS 58 280 0 2500
55009031 darnley F June 3, 2019, 9:09 a.m. OK Java 8 TESTS 54 326 0 2500
55009137 darnley F June 3, 2019, 9:11 a.m. OK Java 8 TESTS 54 343 0 2500
54933120 eatmore F June 1, 2019, 3:38 p.m. OK Java 8 TESTS 51 358 0 2500
54932030 Egor F June 1, 2019, 3:33 p.m. OK Java 8 TESTS 51 389 0 2500
54955454 fetetriste F June 1, 2019, 10:23 p.m. OK Java 8 TESTS 52 436 0 2500
54955476 fetetriste F June 1, 2019, 10:24 p.m. OK Java 8 TESTS 52 467 0 2500
56286698 happybelly F June 29, 2019, 8:05 p.m. OK Java 8 TESTS 58 514 0 2500
54954210 SpargelTarzan F June 1, 2019, 9:11 p.m. OK Java 8 TESTS 52 716 3891200 2500
65624133 vjudge3 F Nov. 24, 2019, 7:18 a.m. OK MS C++ TESTS 58 280 7270400 2500
55090834 hld67890 F June 4, 2019, 2:27 p.m. OK MS C++ 2017 TESTS 54 233 6758400 2500
54958107 pajenegod F June 2, 2019, 1:46 a.m. OK PyPy 2 TESTS 52 686 45875200 2500
58968697 -Morass- F Aug. 17, 2019, 7:05 p.m. OK PyPy 2 TESTS 58 1777 24166400 2500
54999367 kobae964 F June 3, 2019, 3:15 a.m. OK Rust TESTS 54 483 5120000 2500

remove filters

Back to search problems