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

Traditionally, SnarkNews runs two New Year Contests.

The New Year Blitz Contest (Multiple Language Round) will start at 16:00 31.12.2015 and ends at 08:00 01.01.2016 Moscow Time. Contest will consist of 9-13 problems. Some of those problems are based on problems, used at official or training contests in 2015. Contest rules are based on the ACM system with two important modifications.

  1. Penalty time is calculated as distance between time of first successful submit for the contestant on this problem and 0:00:00 01.01.2016, i.e. successful submissions at 23:50:00 31.12.2015 and at 0:10:00 01.01.2016 will both have penalty time 10 minutes (600 seconds).

  2. Multiple Language Round rule: If for the first successful submit for the contestant on the some problem was used the programming language, which was never used by this contestant in his previous first successful submits on other problems, contestant receives language bonus: his summary penalty time is decreased by 100 minutes (6000 seconds). Note that different implementations of the same language are counting as same language, i.e. Java 6 and Java 7 are both counted as Java, C++ 32 bit and C++11 64 bit both as C++. Additionally, C and C++ are counted as same programming language.

Contest will be running on Yandex.Contest system. Link for registration and participation.

12'th Prime New Year Contest will start at 0:00 30.12.2015 and finish at 23:50 10.01.2016 Moscow time. Traditionally, Prime New Year Contest consists of problems, which were presented at team programming contests in 2015 and never solved on the contest. For the Prime New Year contest plain ACM rules are used.

Idea of Prime Contest was first implemented by Andrey Lopatin and Nick Dourov at Summer Petrozavodsk training camp at 2003; in Russian word "Prostoj" used in meanings "prime" and "easy", so, contest was called "Prostoj contest" but was composed of extremelly hard problems, numbered with prime numbers (2,3,5 etc). Since then such a numeration is traditionally used for contests, consisting of very hard problems only.

Contest will be running on Yandex.Contest system. Link for registration and participation.

Both contests have English statements.

Full text and comments »

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

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

Hello, Codeforces!

I'd like to invite you to Codeforces Round #337 (Div. 2). It'll be held on Sunday, December 27 at 14:05 MSK (Moscow time) and as usual Div. 1 participants can join out of competition. Note that round starts in the unusual time!!!

Me and Edvard Davtyan (Edvard) prepared the tasks for this Round.

Great thanks to Gleb Evstropov (GlebsHP) for helping us preparing the contest, to Maria Belova (Delinur) for translating the statements into English and to Mike Mirzayanov (MikeMirzayanov) for the great Polygon platform.

The scoring distribution will be announced later. Good luck everyone!

UPD The start time of the Round is moved on 10 minutes. Score distribution 500-1000-1500-2500-2500

UPD2 Competition completed! Thank you all! Editorial

Full text and comments »

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

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

Hello everyone!

Up to this day Codeforces showed local server time everywhere, and programmers all around the world knew exactly what 19:35 Moscow time corresponds to in their time zone. Now it will be much harder for you to make a mistake and skip another round, since you are going to see time in your time zone.

This is what a usual London programmer sees waiting for Codeforces Round #337 (Div. 2):

The problem was not that easy to implement, since many parts of the site are heavily cached, and we had to manipulate time directly in browser using JavaScript.

Thanks for your attention, good luck to all at the next round!

Full text and comments »

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

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

Hi, Codeforces!

Educational Codeforces Round 4 will take place on 25 December 2015 at 18:00 MSK for the first and second divisions. You can read about educational rounds here and here. This time a little time has passed since the previous round. Although we planned this round at Monday, we forgot to include it to schedule, so it was appeared only now. So it is the fourth and the last educational round this year.

<Maybe this paragraph will not be changed ever>

The round will be unrated for all users and it will be held with extented ACM ICPC rules. You will have two hours to solve six problems. After that you will have one day to hack any solution you want. You will have access to copy any solution and test it locally.

</Maybe this paragraph will not be changed ever>

This time the round was prepared only by me, Edvard Davtyan. Thanks a lot to MikeMirzayanov for helping to invent the problems. Also thanks in advance to Maria Belova Delinur who will check English statements, when they will be ready :-)

I think this time the problems is simpler than usually, because at first we have too hard problemset and removed the hardest problem and added very simple problem. I hope you will enjoy the problems and solve all of them!

Also I want to wish you Happy New Year!!!

Good luck and have fun!

UPD 1: The first phase is ended, hack the solutions of your opponents!

UPD 2: The editorial is ready.

Full text and comments »

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

By Balajiganapathi, history, 8 years ago, In English

Background

One of the regionals in India was scheduled to be held at Hindustan University at Chennai on December 17 — 18, 2015. Unfortunately Chennai was stuck by a natural disaster. The entire south India received heavy rainfall and hence there was a lot of flooding at many places including Chennai around that time. Atleast 347 people died in the state of Tamil Nadu (where Chennai is located). The damage due to the floods overall in south India is estimated to be atleast USD 3 Billion. It is the costliest flood in 2015.

Ofcourse, due to this the Chennai regionals was postponed. I think everyone here will agree that this was an unexpected, unprecedent situation and hence it was entirely understandable that the regionals was postponed.

The Blog post

Dr. C J Hwang is the ICPC Asia director. In response to the above postponement he posted a blog article on his blog. You can read it here. Please read it as this post deals with that announcement.

Quote from the blog: "In the 20 years of ACM-ICPC Asia history, we never had the case of contest postponement."

Comment: That is just luck. It is great luck that there never was any problem during any of the Asia regionals during the past 20 years.

Quote from the blog: "Several years ago, Vietnam contest had a flood and I was there. I walked over the deep water.I was wet with pants and shoes. Vietnam committee did not request any postponement."

Comment: Wet pants and shoes, seriously? This seems like a minor water logging not a major, destructive flood.

Quote from the blog: "To avoid any future abuse of asking postponement to cover the un-readiness and the irresponsibility of hosting the contest ..."

Comment: Abuse? What exactly does Dr. Hwang want the organizers to do? How can you conduct a coding contest when there is water 2 storey high? How is this un readiness or irresponsibility? The flights/train/bus service were all stopped so how would the contestants reach the venue? What if something happened to them? There were no proper supply of food/water/electricity during the floods. As someone who has experienced a real flood, I am extremely offended by this statement.

Quote from the blog: "..., I am proposing to insert a few new lines into 2015 Asia rules. These new lines are same as I had approved for Asia Chennai. We have no time for negotiation/discussion and the complexity of calculating Asia site scores prevent us from any other solutions."

Comment: Why no time for negotiation or discussion? Calculating the slots is indeed complicated, but it does not take that much time either. This reason is here just so he can rush the decision before any discussion takes place. This should not be how decisions are taken at ICPC.

You can read the actual rule in the blog itself. Rules are generally passed by a vote. Here is the result of the voting for this rule:

Quote from the blog: "Voting Result: Casting Yes vote – 11 (Including 3 from WC sub-region)

Casting No vote – 1 (Including 1 from WC sub-region)

Implicit Yes vote – 40"

Comment: See that last line? The Implicit Yes vote? It means those who did not vote were automatically considered as "Yes". Yeah, that is how decisions are taken for such an important rule.

Concluding Remark

I have nothing against the rule. But everything against the manner in which it was decided. Also, the remarks about the flood situation reeks of arrogance and a total lack of empathy for the disastrous situation at Chennai. It is really sad that decisions are taken like this at such a prestigious contest like ICPC.

Full text and comments »

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

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

Hello.

Now you do not have to go into Google if you need to search blog posts. You can do it directly on Codeforces. The implemented search is based on Apache Lucene . The index contains all open public posts, which are already more than 15,000 documents.

Temporarily search for tags are now available (tags will be added to the index soon), but instead you have the opportunity to find posts and even sort using different criteria. By the way, you can use complete syntax of Lucene queries to search. Here is a short description of main features.

You can use several words in query to find by all of them at the same time. In addition, if you are lucky search understands word forms and some synonyms. It supports search by title and author.

Some examples:

  • 305 — search for 305, most probably it will find blogs about the Round 305
  • andrew stankevich contests — search for words "andrew", "stankevich" and "contests" at the same time
  • user:mikemirzayanov title:testlib — search containing "testlib" in title by MikeMirzayanov
  • "vk cup" — use quotes to find phrase as is
  • title:educational search in title

Regarding indexing comments, solutions and problem statements I have a feeling that it may be useless. Too difficult to find something relevant (or maybe not). What do you think: should we implement it?

Full text and comments »

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

By ed1d1a8d, history, 8 years ago, In English

Greetings! CodeForces Round #336 welcomes both divisions this Wednesday, December 23, 2015 at 16:35:00 UTC. The round is authored by me, Amor727, Chilli, and GlebsHP. We hope you'll like the problems. Scoring and score distribution: Not Dynamic; Div1: 500 — 1250 — 1500 — 2000 — 3000; Div2: 500 — 1000 — 1500 — 2250 — 2500

Much thanks to Amor727 and Chilli for writing and editing problems, GlebsHP for organizing the competition and for his very helpful attitude, Delinur for translations, winger for testing, Marina Kruglikova for statement fixes, and MikeMirzayanov for his amazing CF and Polygon platforms.

During this contest you will be assisting Genos from the series One Punch Man. His master Saitama will also make some appearances. We wish everyone good luck and high rating in assisting the two. From the contest crew and the two fellows below, happy holidays!

Congratulations to the winners:

Division 1:

  1. matthew99

  2. tourist

  3. ACRush

  4. jqdai0815

Division 2:

  1. Hansuzu

  2. ajjack999888

  3. platypus179

  4. Petru

  5. Mihaell

Editorial of round: /blog/entry/22256

Full text and comments »

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

By Hikari9, history, 8 years ago, In English

It's always a hassle to define our 2D Geometry library during a contest. Is there a way to make our computational geometry lives easier in any way? Fortunately for us, there is, at least in C++, using complex numbers.

Complex numbers are of the form a + bi, where a is the real part and b imaginary. Thus, we can let a be the x-coordinate and b be the y-coordinate. Whelp, complex numbers can be represented as 2D vectors! Therefore, we can use complex numbers to define a point instead of defining the class ourselves. You can look at std::complex reference here.


Defining our point class

We can define our point class by typing typedef complex<double> point; at the start of our program. To access our x- and y-coordinates, we can macro the real() and imag() functions by using #define. Of course, don't forget to #include <complex> before anything.

#include <iostream>
#include <complex>
using namespace std;

// define x, y as real(), imag()
typedef complex<double> point;
#define x real()
#define y imag()

// sample program
int main() {
	point a = 2;
	point b(3, 7);
	cout << a << ' ' << b << endl; // (2, 0) (3, 7)
	cout << a + b << endl;         // (5, 7)
}

Oh goodie! We can use std:cout for debugging! We can also add points as vectors without having to define operator+. Nifty. And apparently, we can overall add points, subtract points, do scalar multiplication without defining any operator. Very nifty indeed.


Example

point a(3, 2), b(2, -7);

// vector addition and subtraction
cout << a + b << endl;   // (5,-5)
cout << a - b << endl;   // (1,9)

// scalar multiplication
cout << 3.0 * a << endl; // (9,6)
cout << a / 5.0 << endl; // (0.6,0.4)


Functions using std::complex

What else can we do with complex numbers? Well, there's a lot that is really easy to code.

  1. Vector addition: a + b

  2. Scalar multiplication: r * a

  3. Dot product: (conj(a) * b).x

  4. Cross product: (conj(a) * b).y

    notice: conj(a) * b = (ax*bx + ay*by) + i (ax*by — ay*bx)

  5. Squared distance: norm(a - b)

  6. Euclidean distance: abs(a - b)

  7. Angle of elevation: arg(b - a)

  8. Slope of line (a, b): tan(arg(b - a))

  9. Polar to cartesian: polar(r, theta)

  10. Cartesian to polar: point(abs(p), arg(p))

  11. Rotation about the origin: a * polar(1.0, theta)

  12. Rotation about pivot p: (a-p) * polar(1.0, theta) + p

    UPD: added more useful functions

  13. Angle ABC: abs(remainder(arg(a-b) - arg(c-b), 2.0 * M_PI))

    remainder normalizes the angle to be between [-PI, PI]. Thus, we can get the positive non-reflex angle by taking its abs value.

  14. Project p onto vector v: v * dot(p, v) / norm(v);

  15. Project p onto line (a, b): a + (b - a) * dot(p - a, b - a) / norm(b - a)

  16. Reflect p across line (a, b): a + conj((p - a) / (b - a)) * (b - a)

  17. Intersection of line (a, b) and (p, q):

point intersection(point a, point b, point p, point q) {
  double c1 = cross(p - a, b - a), c2 = cross(q - a, b - a);
  return (c1 * q - c2 * p) / (c1 - c2); // undefined if parallel
}

Drawbacks

Using std::complex is very advantageous, but it has one disadvantage: you can't use std::cin or scanf. Also, if we macro x and y, we can't use them as variables. But that's rather minor, don't you think?

EDIT: Credits to Zlobober for pointing out that std::complex has issues with integral data types. The library will work for simple arithmetic like vector addition and such, but not for polar or abs. It will compile but there will be some errors in correctness! The tip then is to rely on the library only if you're using floating point data all throughout.

Full text and comments »

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

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

Hi, Codeforces!

Educational Codeforces Round 3 will take place on 19 December 2015 at 18:00 MSK for the first and second divisions. You can read about educational rounds here and here. A lot of time have passed since the previous round. I hope that the next rounds will be more regular.

<This paragraph wasn't changed>

The round will be unrated for all users and it will be held with extented ACM ICPC rules. You will have two hours to solve six problems. After that you will have one day to hack any solution you want. You will have access to copy any solution and test it locally.

</This paragraph wasn't changed>

This time the round was prepared not only by me, Edvard Davtyan. Firstly, thanks a lot to Alexey Dergunov dalex who shared one of his problems with well-known idea. Also thanks a lot to Alexandr Frolov fcspartakm, Vitaliy Kudasov kuviman and Arthur Svechnikov ikar for their help in preparing problems. MikeMirzayanov helped us to invent the problems. Also thanks a lot to Maria Belova Delinur for translating the problems from my RussianEnglish to English :-)

I hope you will enjoy the problems.

Good luck and have fun!

UPD1: The first part of competition is over. I hope that you enjoyed the problems. Now you let's hack other solutions :-)

UPD2: The editorial is ready.

UPD3: The round is over. All solutions are rejudged on full testset. The results are final.

UPD4: 6725 rows affected :-)

Full text and comments »

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