Please, try EDU on Codeforces! New educational section with videos, subtitles, texts, and problems. ×

### kazama460's blog

By kazama460, 7 weeks ago, ,

Hello Codeforces Community , this is CodeNCode.

I have created a course for basic algorithms and teaching binary search in there as beginning.Just as I was thinking what next problem I should take to teach how beautiful this concept is , I saw Problem B from education round 87.

so here is the list of lectures added till now.


PS : Of course I will add more problems to this list (problems like aggressive cows from spoj)

PS1 : for pointing out any mistake of mine / suggestion please let me know in the comments.

Thank you for your valuable time. CodeNCode out.

• +9

By kazama460, 2 months ago, ,

here you can find the editorial : https://youtu.be/snhHFOz0f-o

Prerequisites :

1. Longest Increasing Subsequence

2. finding divisors in O(sqrt(N))

Problem C. Orac and LCM

Code : Problem C

Note : Code for problem C discussed in video can be optimized , I am leaving that to the viewer.

Note1 : I had no idea creating a different article for adding another link would be considered spamming so I did that earlier but reading a comment there I realized it so I deleted that and updated this instead.Thanks for letting me know about that , I will keep this in mind for future posts.

• +13

By kazama460, 2 months ago, ,

Hello codeforces community

course updated : 21 May 2020

I have working on Number Theory course which is beginner/Intermediate friendly.The course emphasizes on learning by doing methodology.
After teaching an algorithm/technique and showing how it is implemented we take example practice problems from judges like Codeforces , Codechef , Spoj etc and teach how this algorithm is used in different scenario and how it can be used to solve the problem.

Here is the list of lecture from the course (I will be uploading more lectures soon)


## Number Theory Lectures

Any suggestion or criticism is welcome.
Thank you for your valuable time.

PS : Ignore any grammatical mistake as we ignore compiler warnings (My English is not very good)


• +114

By kazama460, 2 months ago, ,

Hello codeforces community

I have working on Query answering technique course which is beginner/Intermediate friendly.The course emphasizes on learning by doing methodology.
After teaching an algorithm and showing how it is implemented we take example practice problems from judges like Codeforces , Codechef , Spoj etc and teach how this algorithm is used in different scenario and how it can be used to solve the problem.

Here is the list of lecture from the course (I will be uploading more lectures)


## Mo's Algorithm Lectures

Mo's Algorithm On Trees Lectures

Any suggestion or criticism is welcome.
Thank you for your valuable time.

PS : Ignore any grammatical mistake as we ignore compiler warnings (My English is not very good)


• +45

By kazama460, 3 months ago, ,

Last Update 3 June 2020

Hello codeforces community

I have working on graph theory course which is beginner friendly.The course emphasizes on learning by doing methodology.
After teaching an algorithm and showing how it is implemented I take example practice problems from judges like Codeforces , Codechef , Spoj etc and teach how this algorithm is used in different scenario and how it can be used to solve the problem.

Here is the list of lecture from the course (I will be uploading more lectures)


## Graph Theory Course : Part 1

Any suggestion or criticism is welcome.
Thank you for your valuable time.

PS : Ignore any grammatical mistake as we ignore compiler warnings (My English is not very good)


• +87

By kazama460, history, 3 months ago, ,

Hey CF community. I am going to begin studying independent set in graph (maximal independent set) and edge covering but since my knowledge in discrete mathematics is not very good and I do not know much about these concepts I need to know the following.

1. Prerequisites to Independent set and edge covering (if any)
2. Related articles (would be a bonus)
3. Related problems to practice (would be bonus++)


Thank you for your valuable time.

• +11

By kazama460, history, 2 years ago, ,

i am stuck at simple problem , and the problem is that there is no Editorial available for this problem.

The problem is as follows:

Given M (Distinct) integers A1 , A2 , A3 , A4 , A5 ...... , Am , find all integers K , such that remainder of all elements with k is same I.E. A1%K = A2%K = A3%K = ..... = Am%K

and K>1.

Number of elements are 100 , and Ai <= 10^9

My solution is brute force: i am running a loop from 2 to second largest element (which can be upto 10^9) and finding all k , but its giving TLE.

This is the link to the problem

any hint or help would be appreciative. Thanks in advance and happy coding.

• +2

By kazama460, history, 2 years ago, ,

I am trying to solve a problem on convex hull(my first problem on convex hull) , but don't know why getting WA. I am using Grahm's scan algo to generate all points of Hull , and then simply calculating the parameter of the hull. please can anyone tell me whats wrong with my code. thank you in advance.

• 0

By kazama460, history, 3 years ago, ,
#include<bits/stdc++.h>
using namespace std;

int main()
{
float x1,x2,y1,y2,x3,y3,x4,y4,ansx,ansy;

while(cin>>x1>>y1)
{
cin>>x2>>y2>>x3>>y3>>x4>>y4;

if(x1==x3 && y1==y3)
{
ansx = x2-x1+x4;
ansy = y2-y1+y4;
}

else
if(x2==x3 && y2==y3)
{
ansx = x1-x2+x4;
ansy = y1-y2+y4;
}
else
if(x1==x4 && y1==y4)
{
ansx = x2-x1+x3;
ansy = y2-y1+y3;
}

else
{
ansx = x1-x2+x3;
ansy = y1-y2+y3;
}
printf("%.3lf %.3lf\n", ansx, ansy);
}
}


i dont know whats wrong with code , getting wrong answer. if anyone can point out some problem in the code. thank you in advance. Link to problem

• 0