Codeforces celebrates 10 years! We are pleased to announce the crowdfunding-campaign. Congratulate us by the link https://codeforces.com/10years. ×

_LNHTD_'s blog

By _LNHTD_, history, 3 months ago, In English,

Recently, I have come across a problem that need to find a path from $$$S$$$ to $$$T$$$ like these :

I have tried to do a dfs with order like: up (-1, 0) , right (0, 1), down (1, 0), left(0, -1) (Suppose $$$S$$$ is (1, 1) and $$$T$$$ is (n, m) ). However it fails cases like this

I tried to google it too (but don't know how to use which words to describe this so fail finding anything.). I wonder if there is any algorithm for this.

Thanks anyway <3

Read more »

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

By _LNHTD_, history, 3 months ago, In English,

The problem is : We are given perimeter (P) of a triangle. We need to find the number of triplet edges (a, b, c) of a triangle, so that three edges are all integer, the area and the length of the radius of the incircle and circumcircle is also an integer.

In the solution, they have an observation that : In order to exist at least a triplet satisfy the problem, 4 must be a divisor of P (perimeter) and a, b, c (three edges) must be all even.

I have proofed all a, b, c are even. But I can't figure out how 4 is a divisor of P.

Could someone help me to proof this ? Thanks in advance!!

Read more »

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