Azret's blog

By Azret, history, 4 years ago, translation, In English

How to solve A again? :D

B and C were of the same relative difficulty.

Full text and comments »

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

By Azret, history, 4 years ago, In English

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

plants supertrees tickets

Full text and comments »

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

By Azret, history, 5 years ago, In English

https://youtu.be/F4rykKLcduI

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

Full text and comments »

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

By Azret, history, 6 years ago, In English

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
...

Full text and comments »

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

By Azret, history, 6 years ago, translation, In English

Results, please?

Full text and comments »

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

By Azret, history, 6 years ago, In English

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

Full text and comments »

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

By Azret, history, 7 years ago, In English

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

Full text and comments »

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

By Azret, history, 7 years ago, translation, In English
  • Vote: I like it
  • +7
  • Vote: I do not like it

By Azret, history, 8 years ago, translation, In English

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 β

Full text and comments »

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

By Azret, history, 8 years ago, translation, In English

Propose to all to discuss solutions here.

Full text and comments »

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

By Azret, history, 8 years ago, translation, In English

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.

Full text and comments »

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

By Azret, history, 8 years ago, translation, In English

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?

Full text and comments »

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

By Azret, history, 8 years ago, translation, In English
  • Vote: I like it
  • +34
  • Vote: I do not like it

By Azret, history, 8 years ago, translation, In English
  • Vote: I like it
  • +71
  • Vote: I do not like it

By Azret, history, 8 years ago, translation, In English

Hello!

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

Full text and comments »

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

By Azret, history, 8 years ago, In English

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

UPD Problems — https://www.dropbox.com/s/ywyczn0m0n5q7ts/problems-e-000815.pdf?dl=0

Full text and comments »

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

By Azret, history, 8 years ago, In English

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?

Full text and comments »

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

By Azret, history, 8 years ago, translation, In English

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

Full text and comments »

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

By Azret, history, 9 years ago, translation, In English

Hi all!

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

Tasks:

Full text and comments »

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

By Azret, history, 9 years ago, translation, In English
  • Vote: I like it
  • +18
  • Vote: I do not like it