Codeforces Round 781 (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
1665 Codeforces Round 781 (Div. 2) FINISHED False 7200 82394699 April 8, 2022, 2:35 p.m.

Problems

Solved$
Index
Name
Type
Tags
Community Tag
Rating
( 23729 ) A GCD vs LCM PROGRAMMING constructive algorithms math

B'You are given a positive integer n . You have to find 4 positive integers a, b, c, d such that If there are several possible answers you can output any of them. It is possible to show that the answer always exists. In this problem gcd(a, b) denotes the greatest common divisor of a and b , and operatorname{lcm}(c, d) denotes the least common multiple of c and d . The input consists of multiple test cases. The first line contains a single integer t ( 1 <= t <= 10^4 ) -- the number of test cases. Description of the test cases follows. Each test case contains a single line with integer n ( 4 <= n <= 10^9 ) -- the sum of a , b , c , and d . For each test case output 4 positive integers a , b , c , d such that a + b + c + d = n and gcd(a, b) = operatorname{lcm}(c, d) . In the first test case gcd(1, 1) = operatorname{lcm}(1, 1) = 1 , 1 + 1 + 1 + 1 = 4 . In the second test case gcd(2, 2) = operatorname{lcm}(2, 1) = 2 , 2 + 2 + 2 + 1 = 7 . In the third test case gcd(2, 2) = operatorname{lcm}(2, 2) = 2 , 2 + 2 + 2 + 2 = 8 . In the fourth test case gcd(2, 4) = operatorname{lcm}(2, 1) = 2 , 2 + 4 + 2 + 1 = 9 . In the fifth test case gcd(3, 5) = operatorname{lcm}(1, 1) = 1 , 3 + 5 + 1 + 1 = 10 . '...

Tutorials

Codeforces Round #781 (Div. 2) Editorial

Submissions

Submission Id
Author(s)
Index
Submitted
Verdict
Language
Test Set
Tests Passed
Time taken (ms)
Memory Consumed (bytes)
Tags
Rating
153075335 SadiaAfrinAnika A April 8, 2022, 5:07 p.m. OK Clang++17 Diagnostics TESTS 4 233 0
153099144 hiragana A April 8, 2022, 11:40 p.m. OK FPC TESTS 4 30 0
153065401 thanhhoang090497 A April 8, 2022, 4:13 p.m. OK FPC TESTS 4 46 0
153079907 triedbest A April 8, 2022, 5:47 p.m. OK GNU C11 TESTS 4 15 0
153078110 Tasbeh A April 8, 2022, 5:29 p.m. OK GNU C11 TESTS 4 46 0
153076483 Sarwar82 A April 8, 2022, 5:16 p.m. OK GNU C11 TESTS 4 46 0
153076688 Pockerman20 A April 8, 2022, 5:18 p.m. OK GNU C11 TESTS 4 46 0
153112767 VedKrishna A April 9, 2022, 5:14 a.m. OK GNU C11 TESTS 4 46 0
153101100 coisini6 A April 9, 2022, 12:32 a.m. OK GNU C11 TESTS 4 46 0
153085184 triedbest A April 8, 2022, 6:53 p.m. OK GNU C11 TESTS 4 46 0
153081583 abdur52 A April 8, 2022, 6:06 p.m. OK GNU C11 TESTS 4 46 0
153081307 SaifSeiam A April 8, 2022, 6:02 p.m. OK GNU C11 TESTS 4 46 0
153080001 Gold_Dragon A April 8, 2022, 5:48 p.m. OK GNU C11 TESTS 4 46 0
153094177 ItsAboudTime A April 8, 2022, 9:27 p.m. OK GNU C++14 TESTS 4 0 0
153079943 patidarujjawal A April 8, 2022, 5:47 p.m. OK GNU C++14 TESTS 4 0 0
153082720 moocpp A April 8, 2022, 6:19 p.m. OK GNU C++14 TESTS 4 0 0
153109122 hardy_9795 A April 9, 2022, 4:05 a.m. OK GNU C++14 TESTS 4 0 0
153101737 PCC A April 9, 2022, 12:52 a.m. OK GNU C++14 TESTS 4 0 0
153101102 liangruichen A April 9, 2022, 12:32 a.m. OK GNU C++14 TESTS 4 0 0
153100428 Tx_Lcy A April 9, 2022, 12:14 a.m. OK GNU C++14 TESTS 4 0 0
153100190 luohanzhao1 A April 9, 2022, 12:08 a.m. OK GNU C++14 TESTS 4 0 0
153096910 mahmoudkhalid112 A April 8, 2022, 10:33 p.m. OK GNU C++14 TESTS 4 0 0
153097702 putongdeyibai A April 8, 2022, 10:58 p.m. OK GNU C++14 TESTS 4 0 3993600
153089752 GEEK_NIKHIL A April 8, 2022, 8:07 p.m. OK GNU C++17 TESTS 4 0 0
153086945 Mazen.Ali A April 8, 2022, 7:22 p.m. OK GNU C++17 TESTS 4 0 0
153085895 Crime_and_Punishment A April 8, 2022, 7:04 p.m. OK GNU C++17 TESTS 4 0 0
153092825 High__Hopes A April 8, 2022, 8:59 p.m. OK GNU C++17 TESTS 4 0 0
153113333 srijay A April 9, 2022, 5:23 a.m. OK GNU C++17 TESTS 4 0 0
153105535 Bharat_986 A April 9, 2022, 2:44 a.m. OK GNU C++17 TESTS 4 0 0
153105454 absolutely_gutted A April 9, 2022, 2:42 a.m. OK GNU C++17 TESTS 4 0 0
153103390 Ngminh A April 9, 2022, 1:43 a.m. OK GNU C++17 TESTS 4 0 0
153101108 rishit_30g A April 9, 2022, 12:33 a.m. OK GNU C++17 TESTS 4 0 0
153100196 pjshwa A April 9, 2022, 12:08 a.m. OK GNU C++17 TESTS 4 0 0
153077871 RohitRKS A April 8, 2022, 5:27 p.m. OK GNU C++17 (64) TESTS 4 0 0
153101151 VecTest A April 9, 2022, 12:34 a.m. OK GNU C++17 (64) TESTS 4 0 0
153115584 EricQian A April 9, 2022, 5:54 a.m. OK GNU C++17 (64) TESTS 4 0 0
153076996 virt_contest_taker A April 8, 2022, 5:20 p.m. OK GNU C++17 (64) TESTS 4 0 0
153088762 MohamedRefat A April 8, 2022, 7:51 p.m. OK GNU C++17 (64) TESTS 4 0 204800
153113057 Batyrkhan A April 9, 2022, 5:19 a.m. OK GNU C++17 (64) TESTS 4 15 0
153109797 kuzuma A April 9, 2022, 4:19 a.m. OK GNU C++17 (64) TESTS 4 15 0
153107738 julianferres A April 9, 2022, 3:36 a.m. OK GNU C++17 (64) TESTS 4 15 0
153114930 suryam35 A April 9, 2022, 5:45 a.m. OK GNU C++17 (64) TESTS 4 15 0
153113158 rav_ish A April 9, 2022, 5:20 a.m. OK GNU C++17 (64) TESTS 4 15 0
153102285 return20071007 A April 9, 2022, 1:08 a.m. OK GNU C++20 (64) TESTS 4 0 0
153101714 paris_geller A April 9, 2022, 12:51 a.m. OK GNU C++20 (64) TESTS 4 0 0
153100972 Chy_Shahrear A April 9, 2022, 12:29 a.m. OK GNU C++20 (64) TESTS 4 0 0
153110638 ak149159 A April 9, 2022, 4:37 a.m. OK GNU C++20 (64) TESTS 4 0 0
153111839 jigyansu_nanda A April 9, 2022, 4:59 a.m. OK GNU C++20 (64) TESTS 4 0 0
153112922 mohit_ahirwar A April 9, 2022, 5:17 a.m. OK GNU C++20 (64) TESTS 4 0 0
153113003 Shashank_Pathak A April 9, 2022, 5:18 a.m. OK GNU C++20 (64) TESTS 4 0 0
153115112 animesh328 A April 9, 2022, 5:48 a.m. OK GNU C++20 (64) TESTS 4 0 0
153104983 bin_s A April 9, 2022, 2:30 a.m. OK GNU C++20 (64) TESTS 4 0 0
153104333 ElectroMaster3 A April 9, 2022, 2:14 a.m. OK GNU C++20 (64) TESTS 4 0 0
153103043 018429 A April 9, 2022, 1:32 a.m. OK Go TESTS 4 15 204800
153082274 vijender_8601 A April 8, 2022, 6:14 p.m. OK Java 11 TESTS 4 171 0
153074821 suhas5979 A April 8, 2022, 5:04 p.m. OK Java 11 TESTS 4 171 0
153080985 shubhig226 A April 8, 2022, 5:59 p.m. OK Java 11 TESTS 4 171 0
153088585 DEMO23 A April 8, 2022, 7:48 p.m. OK Java 11 TESTS 4 171 0
153084864 deepaksach A April 8, 2022, 6:49 p.m. OK Java 11 TESTS 4 171 0
153078334 SaberXpro A April 8, 2022, 5:31 p.m. OK Java 11 TESTS 4 186 0
153101662 __Serendipity A April 9, 2022, 12:50 a.m. OK Java 11 TESTS 4 186 0
153079970 _ryan18_ A April 8, 2022, 5:48 p.m. OK Java 11 TESTS 4 202 0
153105477 kartikpapney A April 9, 2022, 2:43 a.m. OK Java 11 TESTS 4 202 0
153092751 mohamedsamirtkd A April 8, 2022, 8:58 p.m. OK Java 11 TESTS 4 202 0
153097736 Abdallah_Ragab00 A April 8, 2022, 10:59 p.m. OK Java 8 TESTS 4 93 0
153105068 ved20 A April 9, 2022, 2:32 a.m. OK Java 8 TESTS 4 93 0
153085627 Diaa12360 A April 8, 2022, 7 p.m. OK Java 8 TESTS 4 93 0
153083101 g906360 A April 8, 2022, 6:24 p.m. OK Java 8 TESTS 4 108 0
153080161 var_hash A April 8, 2022, 5:50 p.m. OK Java 8 TESTS 4 108 0
153090497 Koka A April 8, 2022, 8:20 p.m. OK Java 8 TESTS 4 109 0
153093419 AbdulazizHassan A April 8, 2022, 9:12 p.m. OK Java 8 TESTS 4 109 0
153093355 Ah86543 A April 8, 2022, 9:10 p.m. OK Java 8 TESTS 4 109 0
153085560 VishuTomar A April 8, 2022, 6:59 p.m. OK Java 8 TESTS 4 124 0
153076451 toufique_husein A April 8, 2022, 5:15 p.m. OK Java 8 TESTS 4 140 0
153099367 meinego A April 8, 2022, 11:46 p.m. OK Kotlin 1.4 TESTS 4 124 1024000
153114687 Aayush5sep A April 9, 2022, 5:42 a.m. OK MS C++ 2017 TESTS 4 61 0
153082978 Viktor36 A April 8, 2022, 6:22 p.m. OK MS C++ 2017 TESTS 4 62 0
153089896 Tadhg A April 8, 2022, 8:10 p.m. OK MS C++ 2017 TESTS 4 62 0
153110153 guptaAbhi07 A April 9, 2022, 4:26 a.m. OK MS C++ 2017 TESTS 4 77 0
153070823 McAndreech A April 8, 2022, 4:30 p.m. OK MS C++ 2017 TESTS 4 92 0
153097887 Olasiliksizci A April 8, 2022, 11:04 p.m. OK .NET Core C# TESTS 4 92 2048000
153097402 MoNasr A April 8, 2022, 10:50 p.m. OK .NET Core C# TESTS 4 93 1228800
153076842 h210107039 A April 8, 2022, 5:19 p.m. OK .NET Core C# TESTS 4 93 1433600
153094285 1_2_3_4_5_9 A April 8, 2022, 9:29 p.m. OK PyPy 2 TESTS 4 77 2048000
153085951 navjordj A April 8, 2022, 7:05 p.m. OK PyPy 3 TESTS 4 108 5836800
153086920 minm A April 8, 2022, 7:21 p.m. OK PyPy 3 TESTS 4 109 3481600
153076351 ambs_ A April 8, 2022, 5:15 p.m. OK PyPy 3 TESTS 4 124 5734400
153106996 Dream_weavers2009 A April 9, 2022, 3:19 a.m. OK PyPy 3 TESTS 4 249 5017600
153103201 Israr_Ahmed A April 9, 2022, 1:37 a.m. OK PyPy 3 TESTS 4 249 5017600
153102979 __J__ A April 9, 2022, 1:30 a.m. OK PyPy 3 TESTS 4 249 5222400
153110708 notTehlka A April 9, 2022, 4:38 a.m. OK PyPy 3-64 TESTS 4 93 5324800
153100312 _MADARA_ A April 9, 2022, 12:11 a.m. OK PyPy 3-64 TESTS 4 93 5324800
153082972 skp_r A April 8, 2022, 6:22 p.m. OK PyPy 3-64 TESTS 4 93 5529600
153097216 Liberator187 A April 8, 2022, 10:43 p.m. OK PyPy 3-64 TESTS 4 93 9830400
153080406 nealzane A April 8, 2022, 5:52 p.m. OK PyPy 3-64 TESTS 4 108 9318400
153076705 krishnam_omar A April 8, 2022, 5:18 p.m. OK PyPy 3-64 TESTS 4 124 8294400
153087476 RANK1ZEN A April 8, 2022, 7:31 p.m. OK PyPy 3-64 TESTS 4 155 9523200
153086115 Shivamk21 A April 8, 2022, 7:08 p.m. OK PyPy 3-64 TESTS 4 186 10752000
153075760 Nick444 A April 8, 2022, 5:10 p.m. OK PyPy 3-64 TESTS 4 202 10752000
153113526 Ayushman_123 A April 9, 2022, 5:25 a.m. OK PyPy 3-64 TESTS 4 202 12083200
153088921 OLOGY A April 8, 2022, 7:54 p.m. OK Python 2 TESTS 4 46 512000
153091891 dxdy A April 8, 2022, 8:43 p.m. OK Python 3 TESTS 4 62 0
153089987 shovik2020 A April 8, 2022, 8:11 p.m. OK Python 3 TESTS 4 93 0
153079529 SamuelGoober A April 8, 2022, 5:43 p.m. OK Python 3 TESTS 4 93 0
153068054 nicolasrodriguezlucena A April 8, 2022, 4:22 p.m. OK Python 3 TESTS 4 93 0
153111902 abhijeet.panihar.cse20 A April 9, 2022, 5 a.m. OK Python 3 TESTS 4 93 1024000
153104880 Muhammad.Daniyal A April 9, 2022, 2:27 a.m. OK Python 3 TESTS 4 108 0
153115492 Grill_murder A April 9, 2022, 5:52 a.m. OK Python 3 TESTS 4 109 0
153108511 NAVEEDAHMED A April 9, 2022, 3:53 a.m. OK Python 3 TESTS 4 109 0
153113810 Alhambra_007 A April 9, 2022, 5:30 a.m. OK Python 3 TESTS 4 124 0
153113540 azaraks A April 9, 2022, 5:26 a.m. OK Python 3 TESTS 4 124 0
153108977 Raffle A April 9, 2022, 4:02 a.m. OK Rust 2021 TESTS 4 93 102400

remove filters

Back to search problems