### Azret's blog

By Azret, history, 4 years ago, translation,

How to solve A again? :D

B and C were of the same relative difficulty.

• +21

By Azret, history, 4 years ago,

If it is permitted to discuss problems now, how to solve A? I think B and C are more or less straightforward.

• +75

By Azret, history, 5 years ago,

https://youtu.be/F4rykKLcduI

Checkout the latest video on Joma Tech channel — I think that should be interesting!

• +95

By Azret, history, 7 years ago,

Dear CF Staff,

Can you, please, consider providing an interface to add a foreign language?

For example, I need that to do problem statements for our Regional & National Olympiads, but, at first, I could not find a way to replace default English "Input file name", "Output file name", etc. names to Kyrgyz ones, so I had to hardcode them into olymp.sty and statements.ftl.

It would be great also if one could make a several-languages statement like this

1. Page 1, Kyrgyz
2. Page 1, Russian
3. Page 2, Kyrgyz
...


or like this

1. Page 1, Kyrgyz
2. Page 2, Kyrgyz
...
N + 1. Page 1, Russian
...

• +16

By Azret, history, 7 years ago, translation,

• +6

By Azret, history, 7 years ago,

Hi, Chinese part of the Codeforces!

Can you, please, list the main (or the best) Chinese Online Judges and describe for what kind of problems they are known for and other interesting features of them?

Thanks, Azret

• -9

By Azret, history, 7 years ago,

Hello CF,

Does anybody know any contests like OpenCup competitions (Grand-Prix of *)? I feel there must at least one of such great regular online competitions with insightful problems like these.

-- Azret, Azret

• +38

By Azret, history, 8 years ago, translation,
• +7

By Azret, history, 8 years ago, translation,

Hello.

I am trying to prove that sin (α - β) = sin α * cos β - cos α * sin β but getting something wrong.

OPα = (cos α, sin α)
OPβ = (cos β, sin β)
|OPα × OPβ| = |OPα| * |OPβ| * sin (γ)
|OPα| = |OPβ| = 1
γ = α - β
Hence, |OPα × OPβ| = sin (α - β)
Since, |A × B| = Ax * By - Ay * Bx
|OPα × OPβ| = cos α * sin β - sin α * cos β
Hence, sin (α - β) = cos α * sin β - sin α * cos β

But all formulas in internet say that sin (α - β) = sin α * cos β - cos α * sin β , i.e reverse of what I wrote above. Can someone find my mistake?

P.S Below is the correct proof written in white. You can find my mistake yourself first. ;)
As I understood I made mistake in computing angle. Since angles are + in counter-clockwise direction then
|OPα × OPβ| = ... * sin(360 - γ)
|OPα × OPβ| = |OPα| * |OPβ| * ( - sin (γ))
Hence, |OPα × OPβ| =  - sin (α - β)
And  - sin (α - β) = cos α * sin β - sin α * cos β
Leads to sin (α - β) = sin α * cos β - cos α * sin β

• +8

By Azret, history, 8 years ago, translation,

Propose to all to discuss solutions here.

• -10

By Azret, history, 8 years ago, translation,

Hello.

Tomorrow at 23:00 UTC will be held GCJ 2016 Qualification Round.
Round will last for 27 hours. Don't forget to register!

Let's discuss problems here after the contest.

• +41

By Azret, history, 8 years ago, translation,

Hello.

Reading the article from e-maxx (ALERT! RUSSIAN!). A piece of code ("radix sort of equivalence classes" part):

	for (int i=0; i<n; ++i) {
pn[i] = p[i] - (1<<h);
if (pn[i] < 0)  pn[i] += n;
}
memset (cnt, 0, classes * sizeof(int));
for (int i=0; i<n; ++i)
++cnt[c[pn[i]]];
for (int i=1; i<classes; ++i)
cnt[i] += cnt[i-1];
for (int i=n-1; i>=0; --i)
p[--cnt[c[pn[i]]]] = pn[i];


Why p[] contains correct order of cyclic shifts of length 2k after?

• +4

By Azret, history, 8 years ago, translation,
• +34

By Azret, history, 8 years ago, translation,

Hello.

Just want to share them with community. :)

P.S Thanks to fushar for sharing! :)

• +71

By Azret, history, 8 years ago, translation,

Hello!

Does anybody know who will host APIO this year? Or when it will be held?

• +27

By Azret, history, 8 years ago,

Qualification round just ended. How to solve A, C, D?

• +31

By Azret, history, 9 years ago,

Hello.

Given directed unweighted graph. It consist of N ≤ 105 vertices. There is at most one edge from each vertex. You need to answer for two types of queries (Q ≤ 105):

1. Delete an edge from vertex V. Unexisting edge won't be deleted.
2. Find shortest path from U to V.

No ideas. How to solve it?

• +5

By Azret, history, 9 years ago, translation,

Hi all!

Straightly to the problem — you are given a set of N (1 < N <  = 105) distinct points with integer coordinates on coordinate plane. For each point you need to find number of closest point to it (from set, expect itself). If there are more than one output point with minimum number.  - 104 <  = xi, yi <  = 104

UPD Distance between points (x1, y1) and (x2, y2) is equal to |x1 - x2| + |y1 - y2|. :P

Input
4
0 0
1 1
1 0
0 1

Output
3 3 1 1

• +9

By Azret, history, 9 years ago, translation,

Hi all!

How can we add/assign arithmetic/geometric sequence in simple/persistent segment tree?