### Errichto's blog

By Errichto, 2 months ago,

Target audience: newbies and pupils (rating up to 1400).
Group link: https://codeforces.com/group/yg7WhsFsAp/contests (hit "join" on the right).

Hi. Enjoy a series of 8 problem lists for beginners. The example topics are strings, arrays, math, and binary search. You are allowed to discuss anything with others, or just look up solutions online. There are also 3 exams, each recommended for a 2-hour individual virtual participation. Use the displayed order, e.g. take exam 1 after day 3. It all should take you 2 weeks of intense bootcamp-like work (or a few months if you take your time).

The problems were originally used two years ago in a Saudi Arabia camp. It's a mix of around 70 existing CF problems and 30 new original problems, mainly prepared by kostka, with some help from me and mustafabar. I asked them for permission to publish everything.

I will put hints to some problems in this blog (or in the group? not sure). Expect a few videos and/or streams for beginners too. You should also read two first chapters of Competitive Programmer's Handbook.

UPD: On Sunday evening I'm making a stream with explanations to a few hard problems: P8, P11, P18, P30, P31, P33. You can try it with hints first:

P08. Cashier
P11. Queens attack!
P18. Mountain peaks
P30. Temporarily unavailable
P31. Shuffle Hashing
P31. Shuffle Hashing, hint 2
P33. Thanos Sort

• +251

 » 2 months ago, # |   +19 Thanks a lot :D I'll try to solve all of them in the upcoming days
 » 2 months ago, # |   +7 It is really usefull
 » 2 months ago, # | ← Rev. 2 →   +1 Can those not in the rating range specified above not submit ? Edit : Just checked, they can
•  » » 2 months ago, # ^ |   +25 You are allowed, but the problems should be easy and boring for you.
 » 2 months ago, # |   0 Awesome!!!!
 » 2 months ago, # |   -8 you mind putting some more tough questions in there .
•  » » 2 months ago, # ^ |   +11 These are problems from a camp two years ago. The participants were beginners just after learning basic C++.
•  » » » 2 months ago, # ^ |   0 ohk i got it
 » 2 months ago, # |   0 This will help me a lot!
 » 2 months ago, # |   0 thanks a lot
 » 2 months ago, # |   -28 Can you prepare another one for 1400 to 1600? I will be very helpful! And thanks for preparing this one. I will submit these problems.
 » 2 months ago, # |   0 Awesome
 » 2 months ago, # |   0 There is no problem numbered P17 in day 2
•  » » 2 months ago, # ^ | ← Rev. 2 →   +16 Oh, you are right. I see now that we removed it back then because it required an algorithm that participants didn't know yet. It was 1041B - Buying a TV Set.I've renumerated problems.
 » 2 months ago, # |   0 Thanks for this bootcamp Errichto , Can we expect more such bootcamps with a certain level up anytime :) .
 » 2 months ago, # |   +14 Reminds me of whenever I say I should start over competitive programming from the beginning since I am not good at the basics.
 » 2 months ago, # |   0 Hey!! Thanks a lot, it will surely help a lot.
 » 2 months ago, # |   0 Great , it will help us a lot.
 » 2 months ago, # |   0 I have just finished the basics of java and solved 100 URI basic problems and some hackerrank easy problems. need to read the first two chapters of "Competitive Programmer's Handbook". it will take some time. I will try it.I have a question. if someone wants to try it after 3/4 months will these problems will be there?
•  » » 2 months ago, # ^ |   +12 Sure. I don't plan to ever hide these problems.
•  » » » 2 months ago, # ^ |   0 Hi It says "You are not allowed to take part in the group contest" if i click register.
•  » » » » 2 months ago, # ^ |   0 You have to join the group first. See the page's right side and you'll see "Join Group" in this (https://codeforces.com/group/yg7WhsFsAp/contests) link.
•  » » » » » 2 months ago, # ^ |   0 thank you
•  » » » 2 months ago, # ^ |   0 thank you so much
 » 2 months ago, # |   0 Thanks a lot. Please arrange more Bootcamp or practice sessions like this for newbies.
 » 2 months ago, # |   0 Really awesome. I hope I enjoy and learn.I am really grateful for it.
 » 2 months ago, # |   0 When I try to register it says "you are not allowed to enter", I am new to this platform. how to register for this.
•  » » 2 months ago, # ^ |   0 Actually it says " You are not allowed to take part in the group contest "
•  » » » 2 months ago, # ^ |   +12 Come on. Read the top of the blog. Or just scroll up by a few comments.
•  » » » 2 months ago, # ^ | ← Rev. 2 →   0 First you gotta join the group using this -> https://codeforces.com/group/yg7WhsFsAp/contests. Then you can register!
 » 2 months ago, # |   0 where will i find the editorial of practice problem of day 1
 » 2 months ago, # |   0 Any hints/tips on how to solve P48 The line problem
•  » » 2 months ago, # ^ | ← Rev. 2 →   0 The hint is in the original question already. It gave an unnecessary/redundant information which could have been omitted.
 » 2 months ago, # |   0 hey there i am trying to solve Day 2 P13 lost rectangle problem for almost a day now and ain't able to come up with a possible solution nor could find anything on the interent to help, coud anyone please help my with some possible idea . I would be realy helpful.https://codeforces.com/group/yg7WhsFsAp/contest/355493/problem/P13
•  » » 2 months ago, # ^ |   0 Hint 1Prime is a big hint in itself. Hint 2The Area A is made by two integer (as given) sides. So, using this fact you can determine that for any integer to be the height or breadth of rectangle, It should evenly divide the A. Hint 3Just find all the prime factors of A, and then say for any factor p, we can treat it as 1 of the side of rectangle. Therefore, the other side is A/p. Now, you have both the side. Find the Perimeter using the same idea for all the factors of A, and print minimum one to the result.
•  » » » 2 months ago, # ^ |   0 You use one word incorrectly: Spoiler"prime" -> "divisor"If the area is 100, possible shorter side lengths are 1, 2, 4, 5, 10. These are divisors, not primes.
•  » » » » 2 months ago, # ^ |   0 Oh yes, I meant the same thing just got confused with right terminology.Thanks for the correction.
•  » » » » 2 months ago, # ^ |   0 I cant solve it... :(
 » 2 months ago, # |   0 This bootcamp will last for how many days?
•  » » 2 months ago, # ^ |   0 2 weeks from the day of start of each section
•  » » » 2 months ago, # ^ |   0 And what about topics? Only strings, arrays, math, and binary search?
•  » » » » 2 months ago, # ^ |   0 Yes most of them are observation based as far as what i have seen so far
 » 2 months ago, # |   0 How much time would you recommend to try to solve one problem by yourself, before moving to editorials (stuck on p48)
 » 2 months ago, # |   0 How can I get all the solution of this boot camp problems ?? I would be very helpful for me... Thank you
 » 2 months ago, # |   0 I don't know if it is right to discuss it here, but it is related to a question in this bootcamp. do let me know if I am not supposed to ask or post anything here. I am new to this platform.In a particular problem if I use. for(size_t i=0; i * i <= n ; i++) //I get TLE where n is upto 10e12. for(size_t i =0; i<=sqrt(n) ; i++) //The answer gets accepted is there any difference(in performance)? if yes then an explanation will be helpful.
•  » » 2 months ago, # ^ |   +11 i * i overflows. You need to use (long long) i * i.
 » 2 months ago, # |   0 good joob errichto thanks bro for questions
 » 2 months ago, # |   0 can any one help me slove primes question 1(lost rectangle)
•  » » 7 weeks ago, # ^ | ← Rev. 2 →   0 SpoilerA= l*b; safe to assume one of sides 1<=l<=10^6. so other side will be A/l. l has to divide A. Solutionll a; cin >> a; // 2(l+b) = p , l.b = a, 2*(l+ a/l)=p ll p=1e18,pmin=1e18; for(int l=1e6;l>=1; l--) { if(a%l==0) pmin = min(2*(l+ a/l),pmin); } cout <
•  » » » 7 weeks ago, # ^ |   0 thanks alot man
•  » » » » 7 weeks ago, # ^ |   0 How do u take minimum of something in C++? any idea?
•  » » » » » 7 weeks ago, # ^ |   0 i use java but in c++ just use min keyword in java it is Math.min(a,b) like wise in c++ just remove math
•  » » » » » » 7 weeks ago, # ^ |   0 thanks bro
•  » » » » » » » 7 weeks ago, # ^ |   0 happy to help
 » 7 weeks ago, # |   0 can some one help me p22 divior count
•  » » 7 weeks ago, # ^ |   0 since n is quite large, so we have to take care of the time complexity in this question. you can make use of this fact, example: 6 = 2^1 * 3^1 total number of factors of 6 = (power of 2 +1)*(power of 3 +1) 6={1,2,3,6} so in this question calculate the powers of prime factors of each number and use this formula. you can do prime factorisation through seive it will take O(log n) operations and the loop which we you will run from 1 to n is O(n). so total time complexity will be O(n*log(n)). if you have any doubt then you can ask. and if anyone has a better approach then this then please tell me I would be greatly thankful. 
•  » » » 7 weeks ago, # ^ |   0 You are correct but if you implement this you will get TLE :)here is what I have done int64_t ans=0; for (size_t i = 1 ; i <= n ; i++) ans += n/i; This works it was just after 10-12 submission I realized, I didn't gave hint as it is useless here it is direct solution, Now you should think why this works.I have also implemented what you said but it gave TLE.
•  » » » » 7 weeks ago, # ^ |   0 damn, this works and it is too small. please tell why it works. this method is so good.
•  » » » » 6 weeks ago, # ^ |   0 NICEE
•  » » » 6 weeks ago, # ^ |   0 THANKS MAN
•  » » 6 weeks ago, # ^ |   0 Solutionconst int N = (int)1e6; vector div(N+1, 0); for(int i=1;i<=N;i++) { for(int j=1;j*i<=N;j++) { div[i*j]++; } } for(int i=1;i<=N;i++) { div[i] += div[i-1]; } int n; cin >> n; cout << div[n] << endl; 
•  » » 6 weeks ago, # ^ |   0 why cant I see the solutions of others after day 1??
 » 6 weeks ago, # |   0 Thanks bro.
 » 6 weeks ago, # |   0 Needed something just like this. Thanks:)
 » 6 weeks ago, # |   +1 someone help me solving [problem:P48]
•  » » 6 weeks ago, # ^ |   0
•  » » 6 weeks ago, # ^ | ← Rev. 3 →   0 SolutionFibonacci
 » 6 weeks ago, # | ← Rev. 2 →   0 hey can any one help me with ((p24 bubble sort))) i know what it is i get the ans but in the output format an any one help me and((( p26 selection sort)) also
•  » » 6 weeks ago, # ^ |   0 Spoilerloop inner and outer n-1 time and print at the end of the inner loop, once the swaps are done.
•  » » » 6 weeks ago, # ^ | ← Rev. 2 →   0 tired it i think im doing it wrong can u help me with the solution
•  » » » » 6 weeks ago, # ^ |   0 hmm, ill just send a snippet to at least help for this one and then you'll be able to solve p26 also. Spoilerfor i in range(n-1):  for j in range(n - 1):  if a[j] > a[j+1]:  a[j], a[j+1] = a[j+1], a[j]  print(*a) 
•  » » » » » 6 weeks ago, # ^ |   0 thanks man
 » 3 weeks ago, # |   0 WA5i need help here , please Quoted text.
•  » » 3 weeks ago, # ^ |   0 Corner Case : 5 1 1 1 1 1 Ranks can not be the same
 » 2 weeks ago, # |   0 Can anybody explain me virtual contest-1 last question?
•  » » 2 weeks ago, # ^ |   0 In that we just want to take the maximum frequency element greedily and add frequency*frequency to the ans(as mentioned in the question for each card), we keep on doing this till the summation of frequencies of cards!=k.My Submission here
•  » » » 2 weeks ago, # ^ |   0 So first we give the characters to toastman and then calculate coin for each character by frequency in cards given to toastman
•  » » » » 2 weeks ago, # ^ |   0 Yes, we give the maximum frequency character to toast man first then coin calculation is done, for x characters of a type x*frequency of that character is added to the answer.