How to solve A again? :D

B and C were of the same relative difficulty.

# | User | Rating |
---|---|---|

1 | jiangly | 3677 |

2 | Benq | 3601 |

3 | ecnerwala | 3542 |

4 | maroonrk | 3540 |

5 | cnnfls_csy | 3539 |

6 | orzdevinwang | 3493 |

7 | inaFSTream | 3478 |

8 | Um_nik | 3430 |

9 | Rebelz | 3409 |

10 | Geothermal | 3408 |

# | User | Contrib. |
---|---|---|

1 | maomao90 | 174 |

2 | adamant | 165 |

3 | awoo | 162 |

4 | TheScrasse | 161 |

5 | nor | 159 |

6 | maroonrk | 158 |

7 | SecondThread | 157 |

8 | Um_nik | 153 |

9 | Geothermal | 145 |

9 | BledDest | 145 |

How to solve A again? :D

B and C were of the same relative difficulty.

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

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

Results, please?

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

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

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*| = *A*_{x} * *B*_{y} - *A*_{y} * *B*_{x}

|*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* β

Propose to all to discuss solutions here.

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.

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 2^{k} after?

Hello.

Just want to share them with community. :)

- https://www.dropbox.com/s/gd7xwad9gad61wx/APIO2015Problemset.pdf?dl=0
- https://www.dropbox.com/s/wgjjxkpqwa0vago/APIO2015ProblemsetAnalysis.pdf?dl=0
- https://www.dropbox.com/s/no93n0ia931ypcf/apio2015_tc.zip?dl=0

P.S Thanks to fushar for sharing! :)

Hello!

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

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

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

Hello.

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

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

No ideas. How to solve it?

Hi all!

Straightly to the problem — you are given a set of *N* (1 < *N* < = 10^{5}) 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. - 10^{4} < = *x*_{i}, *y*_{i} < = 10^{4}

**UPD** Distance between points (*x*1, *y*1) and (*x*2, *y*2) is equal to |*x*1 - *x*2| + |*y*1 - *y*2|. :P

```
Input
4
0 0
1 1
1 0
0 1
Output
3 3 1 1
```

Hi all!

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

Tasks:

Hello.

**UPD** Old links don't work. New: https://www.dropbox.com/sh/b9apawmc61mzq3p/AADvGv3iF6cHwEEJ4anth5IYa?dl=0

Codeforces (c) Copyright 2010-2024 Mike Mirzayanov

The only programming contests Web 2.0 platform

Server time: Feb/27/2024 07:42:42 (k2).

Desktop version, switch to mobile version.

Supported by

User lists

Name |
---|