Peregrine_Falcon's blog

By Peregrine_Falcon, history, 5 days ago, In English

Hello, Codeforces community!
I'm glad to invite you to Criterion 2021 Round 10 which will be held on February 26, 2021 at 16:00 PM +0600 and will run for 2 hours 30 minutes.

The contest will take place at Toph.co

This contest is rated for all participants. You can register for the contest here.

Problems of this contest were prepared and tested by shefin.cse16, Hasinur_, TarifEzaz and me.

Thanks to TarifEzaz for his unconditional support and hjr265 for the best contest programming platform in Bangladesh.

We're inviting you all to participate in this contest. Hope you will enjoy the problem set.
There will be an editorial for this contest shortly after the round ends.
Feel free to share your experience with previous Criterion Rounds!

Contest Link: Criterion 2021 Round 10

Happy Coding!

Update: Editorials are out and problems are open for submissions!

Read more »

 
 
 
 
  • Vote: I like it
  • +12
  • Vote: I do not like it

By Peregrine_Falcon, history, 4 weeks ago, In English

Hello, Codeforces community!
I'm glad to invite you to Criterion 2021 Round 9 which will be held on February 5, 2021 at 16:00 PM +0600 and will run for 2 hours 30 minutes.

The contest will take place at Toph.co

This contest is rated for all participants. You can register for the contest here.

Problems of this contest were prepared and tested by ovis96, jAckAL_1586, Hasinur_, TarifEzaz, oasiscse and me.

Thanks to TarifEzaz for his unconditional support and hjr265 for the best contest programming platform in Bangladesh.

We're inviting you all to participate in this contest. Hope you will enjoy the problem set.
There will be an editorial for this contest shortly after the round ends.
Feel free to share your experience with previous Criterion Rounds!

Contest Link: Criterion 2021 Round 9

Happy Coding! UPD: Only 30 minutes to go!

Read more »

 
 
 
 
  • Vote: I like it
  • +19
  • Vote: I do not like it

By Peregrine_Falcon, history, 7 weeks ago, In English

Hello, Codeforces community!
I'm glad to invite you to Criterion 2021 Round 8 which will be held on January 15, 2021 at 15:00 PM +0600 and will run for 2 hours 30 minutes.

The contest will take place at Toph.co

This contest is rated for all participants. You can register for the contest here.

Problems of this contest were prepared and tested by upobir, jAckAL_1586, Hasinur_, ishtupeed, TarifEzaz and me.

Thanks to TarifEzaz for his unconditional support and hjr265 for the best contest programming platform in Bangladesh.

We're inviting you all to participate in this contest. Hope you will enjoy the problem set.
There will be an editorial for this contest shortly after the round ends.
Feel free to share your experience with previous Criterion Rounds!

Contest Link: Criterion 2021 Round 8

Happy Coding!

Read more »

 
 
 
 
  • Vote: I like it
  • +10
  • Vote: I do not like it

By Peregrine_Falcon, history, 6 months ago, In English

Any suggestions, please?

Read more »

 
 
 
 
  • Vote: I like it
  • -3
  • Vote: I do not like it

By Peregrine_Falcon, history, 7 months ago, In English

Hello, Codeforces community! I'm glad to invite you to — Replay of Intra UAP Programming Contest 2020, which will be held on Thursday, August 13, 2020, at 7:00 PM +0600 and will run for 3 hours.

The contest will take place at Toph.co

Since this is a replay contest, we request all contestants and everyone else who has seen the problems of preliminary to refrain from making the problem set public.

You'll be given 8 problems and 3 hours to solve them. There will be an interactive problem.

Problems of this contest were prepared and tested by rebornplusplus, Imran_Bin_Azad, ShockProof, labib, Rayhan, tufaan42, symonhasan, R_Hasan, and me.

This contest is formatted as per the official rules of ICPC Regional Programming Contests( See Details ).

You can use C++11 GCC 7.4, C++14 GCC 8.3, C++17 GCC 9.2, C11 GCC 9.2, Go 1.13, Java 1.8, Kotlin 1.1, Node.js 10.16, Perl 5.30, PHP 7.2, PyPy 7.1 (2.7), PyPy 7.1 (3.6), Python 2.7, Python 3.7, and Ruby 2.6 in this contest.

Contest Link: https://toph.co/c/intra-uap-2020-r

This contest will be beginner-friendly and Codeforces Div.2 participants may find the problem-set interesting.

Happy Coding!

Read more »

 
 
 
 
  • Vote: I like it
  • +21
  • Vote: I do not like it

By Peregrine_Falcon, history, 8 months ago, In English

I've started writing a new blog.
The First series of tutorial is about the Breadth-First Search algorithm.
There are 4 parts in this series.
I have discussed tutorial of breadth-first search and printing the shortest path between two nodes.
Bi-Coloring Problem.
Finding the shortest cycle of an unweighted graph.
2D-Grid bfs.
Multiple source bfs.
Passing flow through edges of bfs.
0-1 Breadth-First Search.
How to find the nodes lying in the all possible shortest path between two nodes.
And some other interesting applications of Breadth-First search.
Breadth-First Search. Part 1
Breadth-First Search. Part 2
Breadth-First Search. Part 3
Breadth-First Search. Part 4

I have written another blog about Prime numbers and prime checking.
Prime Numbers and Prime checking

Facebook Page of my blog.
All the article can be found in both English and Bangla.
Please let me know if there are any mistakes.
Finally sorry for my poor English.
Happy Coding.

Read more »

 
 
 
 
  • Vote: I like it
  • -16
  • Vote: I do not like it

By Peregrine_Falcon, history, 12 months ago, In English

I've been trying to solve one of my solved problem. 6151 — Beehives

I've sovled it a along time ago. It's giving me WA. Just a simple problem, finding the shortest cycle. Then I submitted my previous Accepted code. But it also giving me Wrong Answer verdict.

Here is my previous accepted code. Now I am afraid to try and solve another problem on that judge. Is there any issues?

Thank You.

Read more »

 
 
 
 
  • Vote: I like it
  • +13
  • Vote: I do not like it

By Peregrine_Falcon, history, 14 months ago, In English

 Screnshot Anyone who is unregistered, it's showing remaining time of the contest is 11 hours and 43 minutes. But after the registration it's showing 2 days remaining. Link to screenshot screenshot feature is not working for me. Don't no why.

UPD: Seems like fixed now.

Read more »

 
 
 
 
  • Vote: I like it
  • +5
  • Vote: I do not like it

By Peregrine_Falcon, 14 months ago, In English

Hello, Codeforces community! I'm glad to invite you to — Replay of Ada Lovelace National Girls' Programming Contest 2020 Preliminary, which will be held on Monday, December 23, 2019 at 7:00 PM +0600 and will run for 5 hours.

The contest will take place at Toph.co.

Since this is a replay contest, we request all contestants and everyone else who has seen the problems of preliminary to refrain from making the problem set public.

You'll be given 11 problems and 5 hours to solve them.

Problems of this contest were prepared and tested by CLown1331, Dhruba10414, 0pangktey0, fsshakkhor, Hasinur_, shadowfax, mahbubcseju, Moshiur_, rebornplusplus, Hasnaine_, I_Love_Light, BumbleBee, tanus_era, TarifEzaz, TariqueNasrullah, I_love_ProParThinkNot and me.

This contest is formatted as per the official rules of ICPC Regional Programming Contests( See Details ). You can use C++11 GCC 7.4, C++14 GCC 8.3, C++17 GCC 9.2, C11 GCC 9.2, Java 1.8, Python 2.7, and Python 3.7 in this contest.

This is the Contest Link

Happy Coding!

Read more »

 
 
 
 
  • Vote: I like it
  • +12
  • Vote: I do not like it

By Peregrine_Falcon, history, 14 months ago, In English

Hello, Codeforces community! I'm glad to invite you to Replay of VU CSE Tech Fest 2019 Programming Contest, which will be held on saturday, December 21, 2019 at 7:30 PM +0600 and will run for 5 hours.

The contest will take place at Toph.co

Since this is a replay contest, we request all contestants and everyone else who has seen the problems onsite to refrain from making the problem set public.

You'll be given 11 problems and 5 hours to solve them.

Problems of this contest were prepared and tested by TarifEzaz, fsshakkhor, fire_tornado, shadowfax, ishtupeed, De.Wilde, nahidhasan98, shahed_ahmed, Joty, BumbleBee, tahmedge, I_love_ProParThinkNot and me.

This contest is formatted as per the official rules of ICPC Regional Programming Contests( See Details ). You can use C++11 GCC 7.4, C++14 GCC 8.3, C++17 GCC 9.2, C11 GCC 9.2, Java 1.8, Python 2.7, and Python 3.7 in this contest.

This is the Contest Link

Happy Coding!

Read more »

 
 
 
 
  • Vote: I like it
  • +10
  • Vote: I do not like it

By Peregrine_Falcon, 16 months ago, In English

Orlin's algorithm has a complexity of O(n*m). It's the fastest. Why most of the programmers uses Dinic's algorithm or Edmond-Carp algorithm instead of Orlin's algorithm?

Though, I don't know anything about Orlin's algorithm.

Orlin's algorithm

Read more »

 
 
 
 
  • Vote: I like it
  • -8
  • Vote: I do not like it

By Peregrine_Falcon, history, 18 months ago, In English

I've learned Heavy light decomposition and found This Problem on Anudeep's blog. I couldn't come up any idea how to solve this problem.

Given a undirected weighted tree with N nodes ( N <= 1e5 )

All the nodes are white initially.

And Q queries ( Q <= 1e5 )

Update — Change the color of given node ( Black to White or White to Black )

Query — If there are at least one node with white color, find the maximum distance between any two nodes ( a , b ). a == b can be allowed.

Cost of edges can be negative.

Thank You.

Read more »

 
 
 
 
  • Vote: I like it
  • +2
  • Vote: I do not like it

By Peregrine_Falcon, history, 19 months ago, In English

I've a fear of bracket sequence. Whenever I face one, It scares me. So, I'm gonna solve as many as possible. I was trying to make a list of problems which contains dealing with "Bracket Sequences". Here are some. Please suggest some if you've solved any. It'll be so kind if you comment the topic with the problem.

Thank You in advance.

Happy Coding O_o.

Reading Material CP-Algorithm

Online Judge — Parentheses Balance ( Stack )

Codechef — Convert the Expression ( Infix / Postfix / Prefix conversion )

Online Judge — Equation ( Infix / Postfix / Prefix conversion )

Codeforces — Sereja and Brackets (Segment Tree)

Online Judge — Balanced String ( Constructive Algorithm )

Codeforces — Bracket Subsequence

Codeforces — Bracket Subsequence

Kattis — Pieces of Parentheses

Codechef — Matched Brackets

Codeforces — Longest Regular Bracket Sequence

Codeforces — Correct Bracket Sequence Editor

Codeforces — Serval and Parenthesis Sequence

Codeforces — Streets of Working Lanterns — 2

usaco

Jeff and Brackets

Codeforces — Replace To Make Regular Bracket Sequence

Read more »

 
 
 
 
  • Vote: I like it
  • +8
  • Vote: I do not like it

By Peregrine_Falcon, history, 19 months ago, In English

I've a graph consisting of 22 nodes and 36 edges. It's an undirected graph. From each node, I've to find the number of ways that I can reach all other nodes. Any idea please?

Read more »

 
 
 
 
  • Vote: I like it
  • +4
  • Vote: I do not like it

By Peregrine_Falcon, history, 23 months ago, In English

I just learned Ford-Fulkerson Algorithm for Maximum Flow Problem with BFS/DFS. I solved one problem from lightoj.com.

But I couldn't find any basic problem to practice the basic algorithm.

If someone can provide me some very basic problem, by practicing them I'll get used to the basic concept & coding also learn something I'll be really very grateful. I've some problems but those are not basic.

Thank You.

Read more »

 
 
 
 
  • Vote: I like it
  • +3
  • Vote: I do not like it

By Peregrine_Falcon, history, 23 months ago, In English

I was trying to solve this problem. With this code I got several WA & wasted hours of time by debugging it. But I've changed to this got AC! With no change of idea. All I changed was a line of code O_o.

it = lower_bound( v.begin() , v.end() , com [ i ].size() );

to

a = com [ i ].size();

it = lower_bound( v.begin() , v.end() , a );

Is there any problem with that?

Thank You.

Read more »

 
 
 
 
  • Vote: I like it
  • 0
  • Vote: I do not like it

By Peregrine_Falcon, history, 2 years ago, In English

In this problem I used set < pair < int , int > > st;

auto it = lower_bound( st.begin(), st.end(), make_pair( a + d + 1 , 0 ) )

But it costs me several TLE. But when I look over the tutorial solution, I saw this-

it = st.lower_bound( make_pair( a + d + 1 , 0 ) );

I used it, & got AC.

But I don't understand what's the difference? If anyone can please help. TLE Submission AC Submission Thank You O_o

Read more »

 
 
 
 
  • Vote: I like it
  • +15
  • Vote: I do not like it

By Peregrine_Falcon, history, 2 years ago, In English

In G++17 7.3.0. I've tried to use struct in the following way. But it shows me compilation Error. I've tried in Custom test . In this AC Code I just added struct, but this shows me compilation error.But here with G++14, It's running very well.

Read more »

 
 
 
 
  • Vote: I like it
  • 0
  • Vote: I do not like it

By Peregrine_Falcon, 3 years ago, In English

Problem Link

My code link

My idea:

*I made a graph providing connection to every node to all other nodes.

*Distance = sqrt( (x1 — x2 )^2 + ( y1 — y2 )^2 )

*Ran MST( Minimum Spanning Tree ) & saved the summation of costs.

*Made a graph from the MST.

*Made a Sparse Table using the MST graph & also saved the weight of maximum weighted edge for the paths.

*Then I tried to make a magical road between every possible node & searched for possible maximum ( A/B ) value, for delete a edge, I took help of the LCA for finding the maximum weighted edge between the path of currently two working nodes.

***I've been trying this problem for several days, but can't find any problem. Please help If anyone have free time.

Thanks in advance.

UPDATE: Got Accepted. { The Mistake was in Minimum Spanning Tree. Thank you. }

Read more »

 
 
 
 
  • Vote: I like it
  • 0
  • Vote: I do not like it

By Peregrine_Falcon, history, 3 years ago, In English

Convert Infix to Postfix Notation

Initially we’ve a string S which represent the expression in infix format. Now we need a character stack.

*We’ll iterate through the string S, from left to right.

  • Whenever we encounter an operand we’ll print it.

  • If we encounter an ‘(‘ we’ll push it to the stack.

  • If we encounter an ‘)’ we’ll take the following actions:

    1. We’ll continue to pop top of the stack until we find the ’(‘
    2. Before we pop top of the stack, we’ll print every character of top of the stack except ‘)’.
  • If we encounter an operator, we’ll take the following actions:

    1. We’ll continue to pop top of the stack until we find that S[ i ] is greater than the top of the Stack (by the rules of precedence) Ex: if we found an Multiplication operator on S [ i ] We’ll continue searching for addition or subtraction operator on top of the stack. We’ll stop searching until it’s empty or we’ve found one. Before that we’ll pop top of the Stack. And before pop, we’ll print every operators.
  • When the traversal will finished, we’ll continue to pop top of the stack until it's empty, and before pop we’ll print every operators.

You can see my Code

Convert Infix to Prefix Notation

To convert an infix to Prefix, first we’ve to know how to convert Infix to postfix notation.

Initially we’ve a string S which represent the expression in infix format.

  • Reverse the string S. After reversing A+B*C will become C*B+A. Note while reversing each ‘(‘ will become ‘)’ and each ‘)’ becomes ‘(‘.

  • Obtain the postfix expression of the modified string S. We’ve to handle the ‘(‘ as ‘)’ and ‘)’ as ‘(‘

  • Just reverse the postfix expression we’ve.

You can see my Code

If you want to know in details about Infix, Postfix and Prefix This Link maybe help you.

Here are some basic practice problems: WhatFix Notation Equation Convert the Expression

Thank you for reading. If there anything else, please let me know.

Read more »

 
 
 
 
  • Vote: I like it
  • +1
  • Vote: I do not like it