MikeMirzayanov's blog

By MikeMirzayanov, 12 days ago, translation, In English,

Hi Codeforces.

Recently there have been several improvements on the website. A little later, I will write a short note about them. Here I want to tell about a noticeable new functionality that has recently been implemented by kuviman.

Sometimes after the end of a round there are requests in comments to add a particular test. And problem writers or coordinators add it manually. Now this process is automated.

Meet the uphacking phase!

Now, after the end of almost any contest, participants from Div.1 have the opportunity to hack any solution in this contest during the week. Yes, including official solutions from rounds. In case of successful hacking:

  • Your test will be automatically added to the problem and will be used in the future when testing new solutions for this problem;
  • If a hacked solution is a practice (i.e. upsolving), then its verdict will change to “hacked” otherwise its verdict will remain unchanged;
  • The participant whose solution has been hacked will be notified via system private message;
  • Each solution can be successfully hacked only once.

In order to add only adequate and reasonable tests, it is forbidden to hack solutions that intentionally contain a mistake. Please strictly follow this rule. It is because of the possibility of inadequate behavior that we cannot open uphacking for everyone.

I hope that this innovation will be useful and tests for problems will become even better!

  • MikeMirzayanov

UPD: Probably, later we will extend uphacking phase and reduce the rating bound.

Read more »

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

By MikeMirzayanov, history, 3 weeks ago, In English,

Hello,

Do you remember my post New: Diagnostics of Solutions in C++? If not, please read it.

Recently, I've implemented better UI to show you diagnostics. Now in on the status pages sometimes you can notice something like this:

Click to the  and you'll see the code with the highlighted problematic line and description with the possible reason of the mistake.

Do you like it?

Read more »

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

By MikeMirzayanov, 7 weeks ago, In English,

In 2019, with the support of XTX Markets, 6 rounds of the new Codeforces Global Rounds will be held. These will be common rounds for both divisions of 7–9 problems each. The duration of the rounds will be 2-3 hours, depending on the number and complexity of the problems. All such rounds will be rated for all participants. At each such round, 50 brand T-shirts will be handed out, and we will be happy to give T-shirts to all authors and problem testers.

The prizes for the 6-round series in 2019:

  • In each round top-100 participants get points according to the table.
  • The final result for each participant is equal to the sum of points he gets in the four rounds he placed the highest.
  • The best 20 participants over all series get sweatshirts and place certificates.

Current standings after two rounds:

Place Contestant = Round 1 Round 2
1 tourist 1706 1000 706
2 Um_nik 1281 706 575
3 ecnerwala 1000 1000
4 mnbvmar 900 497 403
5 sunset 814 443 371
6 TLE 599 575 24
7 ksun48 569 371 198
8 fateice 518 307 211
9 Endagorion 510 13 497
10 Petr 443 443
11 lych_cys 436 218 218
12 wxhtxdy 403 403
13 yokozuna57 399 74 325
14 neal 382 211 171
15 cki86201 346 346
15 CauchySheep 346 346
17 snuke 325 325
18 jonathanirvings 323 97 226
19 realDonaldTrunp 307 307
20 V--o_o--V 291 291
20 krijgertje 291 291
22 LHiC 277 277
22 yhx-12243 277 277
24 kmjp 272 226 46
24 ania 272 198 74
26 lumibons 265 265
26 visitWorld 265 265
28 sigma425 254 254
28 leaf1415 254 254
30 stO 246 60 186
31 zemen 245 204 41
32 uwi 244 244
32 Arterm 244 244
34 whzzt 241 171 70
35 dotorya 235 235
35 Isaf27_loves_me 235 235
37 MofK 206 8 198
38 vammadur 204 204
39 mareksom 201 99 102
40 AFO_OFA 194 78 116
41 AlexDmitriev 192 192
42 yutaka1999 186 186
43 Kostroma 185 4 181
44 jiangshibiao_father 181 181
45 voover 176 176
45 hos.lyric 176 176
47 Alex_2oo8 166 166
47 yosupo 166 166
49 tlwpdus 161 161
49 supy 161 161
51 kdh_9949 157 157
51 I_love_Tanya_Romanova 157 157
53 SpyCheese 153 153
53 E869120 153 153
55 Subconscious 149 149
55 maroonrk 149 149
57 mmaxio 145 145
57 egor.lifar 145 145
59 AghaTizi 142 142
59 NeKrasnyj 142 142
61 abacabadabacaba 138 138
61 riantkb 138 138
63 VArtem 135 135
63 yuxiaogang 135 135
63 ainta 135 135
66 fyy2603 131 131
66 edisonhello 131 131
68 izban 128 128
69 voidmax 125 125
69 _rqy 125 125
69 KMAASZRAA 125 125
72 irkstepanov 122 122
73 Rzepa 119 119
73 jah_melon 119 119
75 aid 118 107 11
76 Egor 116 116
76 JOHNKRAM 116 116
78 G.Z.V.O.D.E.N 113 113
79 zhouzhidao 112 52 60
80 allllekssssa 110 110
80 kazuma 110 110
82 Maksim1744 107 107
83 Real_A_Madrid 105 105
83 UtahaSenpai 105 105
85 pobiren 102 102
86 Itst 99 99
87 TangentDay 97 97
87 chenjb 97 97
89 Merkurev 94 94
90 scanhex 92 92
90 sugim48 92 92
92 geniucos 90 90
92 dreamoon_love_AA 90 90
94 tfg 87 87
94 TimonKnigge 87 87
94 ToTLeS 87 87
97 Elegia.Inferno 85 85
98 kczno1 83 83
98 Heltion 83 83
100 _Happy_New_Year_ 80 80
100 131131yhx 80 80
102 Hazyknight 78 78
102 DEGwer 78 78
104 Roundgod 76 76
105 Radewoosh 74 74
106 Xellos 72 72
107 QAQAutoMaton 70 70
107 flying_fish 70 70
109 Vergara 68 68
109 Bugman 68 68
111 djq_fpc 66 66
112 hermano95 63 63
112 imp 63 63
114 laofudasuanbaofushehui 62 62
114 fuppy 62 62
116 ilyakor 60 60
116 Constantius 60 60
118 Farhod_Farmon 58 58
119 isaf27 56 56
120 senek_k 54 54
120 superguymj 54 54
122 zerokugi 52 52
122 cuizhuyefei 52 52
124 kf11 50 50
124 gs18115 50 50
126 imalyd 48 48
127 Reyna 46 5 41
127 Tommyr7 46 46
129 zeliboba 45 45
129 FlyToTheSky 45 45
129 kobae964 45 45
132 natsugiri 43 43
133 wzp666 41 41
133 Lily 41 41
135 camypaper 39 39
136 yfzcsc 37 37
137 orbitingflea 36 36
137 SidneyEarth 36 36
137 logicmachine 36 36
140 zhou888 34 34
141 fedoseev.timofey 32 32
141 hloya_ygrt 32 32
143 chemthan 31 31
143 Hezhu 31 31
145 satashun 29 29
145 tourist4.0 29 29
147 HanwhaEagles 27 27
147 zhangqingqi 27 27
147 PinkieRabbit 27 27
150 capra 26 26
151 LzyRapx 24 24
152 DAyamaCTF 22 22
152 athin 22 22
154 cerberus97 21 21
154 Sonechko 21 21
156 HuaJun 19 19
156 WA_TLE 19 19
158 GyojunYoun 17 17
158 he_____he 17 17
160 FizzyDavid 16 16
160 jijiang 16 16
162 cz_yixuanxu 14 14
162 gyz_gyz 14 14
162 majk 14 14
165 adadadd 11 11
165 PhoenixEclipse 11 11
167 nicklu0 10 10
168 rahulDugar 8 8
169 teapotd 7 7
169 BigBag 7 7
169 Golovanov399 7 7
172 zhouzhendongYa 4 4
173 ko_osaga 2 2
173 Sooke 2 2
175 gamegame 1 1
175 rais.fathin38 1 1

Read more »

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

By MikeMirzayanov, 7 weeks ago, In English,

During the past few days, we have done some internal optimizations (thanks, kuviman). Before the start of Codeforces Global Round 3, I want to be absolutely sure that everything works correctly. I ask you to help us to test the system. Please, take part in Testing Round #15 (Unrated). It is unrated, contains 1-2 easy well-known problems. The pretests will be extremely weak to increase the number of hacks. Thanks!

UPD: It seems everything works great. Thanks!

Read more »

Announcement of Testing Round #15 (Unrated)
 
 
 
 
  • Vote: I like it
  • +36
  • Vote: I do not like it

By MikeMirzayanov, 2 months ago, translation, In English,

Hello, Codeforces!

Today I’ve released an important update of the Polygon — partial support for advanced properties of resources. The main task that is being solved by this update is to support the development of problems with graders.

In most competitions, participants need to submit a complete solution code, including reading an input reading and an output writing. For example, in Codeforces rounds you solve such kind of problems. However, in some competitions another approach is using: a participant needs to implement the required function or interface.

For example, in a problem statement can be written that in a C ++ solution you need to implement a function that has prototype int sum (int a, int b) and submit the implementation. In this case, a participant has to submit a source code that contains the implementation of this function. Then, in the process of judging this solution for such a problem, an online judge should compile and link into a single executable file the file sent by the participant and a special jury-prepared file that contains the rest of the necessary code (in particular, there will be the function main).

In the case of problem ``A + B’’, such file, which is called a grader, might look like (grader.cpp):

#include <iostream>
int sum(int a, int b);
int main() {
	int a, b;
	std::cin >> a >> b;
	std::cout << sum(a, b) << std::endl;
}

A solution might look like:

int sum(int a, int b) {
    return a + b;
}

Therefore, a grader cannot be independently compiled into an executable file: it also needs a solution to the problem.

And now basic support for such problems in Polygon has been implemented (thanks to PavelKunyavskiy and cannor147 for the help!). I've started with C++ support only.

In order to add grader files, you must upload them as resources, specifying additional advanced properties: that resources are applicable to cpp.* language group, that they are compile-time resources and that solutions need to be compiled with them.

After adding such resources, while compiling solutions, they will be in the same folder with the solution, and those resources that are C++ files will be appended to the compiler command line.

Please note that all additional information for resources is available in the problem descriptor file problem.xml. Also, API is updated (see the documentation for the methods problem.files and problem.saveFile).

Later, the support of some other languages will be added. Also, I’ll add a feature to attach resources in a similar way not to solutions only, but also to validators/integrators/checkers. Of course, you can expect support for such kind of problems on Codeforces. I note that such problems can be used not only in olympiads/contests but also in the educational process. For example, I can easily imagine an exercise on Java, where you need to implement a given interface, and all other routines (unit tests and other things) are hidden in resources files.

P.S. The support of graders appeared for a special reason: today in Russia begins the IOI training camp. The best high school students will compete for the right to represent Russia on International Olympiad in Informatics. I hope, this feature will help the scientific committee to write new problems. And I wish participants every success and luck!

Read more »

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

By MikeMirzayanov, 2 months ago, In English,

Many thanks to problem authors — Tech Scouts instructors. Please, review the author's solutions. They are beautiful and short. Our community has many to learn from mathematicians!

Tutorial is loading...
Tutorial is loading...
Tutorial is loading...
Tutorial is loading...
Tutorial is loading...
Tutorial is loading...
Tutorial is loading...
Tutorial is loading...
Tutorial is loading...
Tutorial is loading...
Tutorial is loading...
Tutorial is loading...
Tutorial is loading...
Tutorial is loading...
Tutorial is loading...
Tutorial is loading...
Tutorial is loading...
Tutorial is loading...
Tutorial is loading...
Tutorial is loading...
Tutorial is loading...

Read more »

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

By MikeMirzayanov, 2 months ago, In English,

What do you know about real Mathforces? This is a world full of numbers, theorems and formulas. Are you ready for the adventure full of challenges and dangers in a new world?

Our friends from Harbour.Space University, the International Tournament of Young Mathematicians (ITYM) and St. Paul's International School Barcelona for the second time organize Tech Scouts — two week International summer camp for high school students. I really think it is a valuable and useful initiative.

For some participants the organizers cover participation fee, the decision is based on the results in special online math test and phone interview.

I invite you to take part in Mathforces: Tech Scouts Online Test 2018 (just fun and practice, unofficial, unrated). It was offered to candidates a year ago, in 2018. This year participants can use it as a practice. I think for many of you it will be interesting to compare your math skills. It starts on May/05/2019 11:05 (Moscow time).

The duration of the test will be 2 hours. You will be offered about 20 math questions. Each of them are expected to be solved using math skills. Please refrain from writing code and try to solve problems without any programming.

You can skip questions or re-submit answers during the test. All the answers will be judged after the test ends. Each question costs 1-3 points in case of the correct answer. Please, do not share your answers before the end of the test.

For sure, the test will be unrated.

Please refrain from participation if you have already participated in this test last year.

UPD 1: The problems will be in English.

UPD 2: The tutorials are published.

Read more »

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

By MikeMirzayanov, 3 months ago, In English,

Hello,

Three days ago I was forced to come back to ITMO (at midnight!) to turn on the server. I was just happy that the night security at the university understood everything and I got into the server room without any issues. It seems the server was overheated and and shut down. Today, I and _kun_ are planning to update a thermal grease in it. We have not done this before (but I watched the video on YouTube). Wish us good luck!

Read more »

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

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

Hi!

I didn't find any blog post about the round. So, let's discuss it. I'm a little bit upset, because I didn't solve C. Actually, on last minutes I wrote the solution which should pass if replace linear searches with binary.

Am I right that now Google doesn't publish tests?

P.S. And abacabadabacaba is right. The standings are completely unusable (

Read more »

Tags gcj, 2019, 1b
 
 
 
 
  • Vote: I like it
  • +226
  • Vote: I do not like it

By MikeMirzayanov, 3 months ago, In English,

ICPC World Finals 2019 will begin on April 4, 2019 at 11:00 (UTC). This event is the main event of the year in the world of sports programming!

In the past 20 years alone, ICPC participation has increased by more than 2000%. The contest evolved into its present form as a multi-tier competition in 1977, with the first finals held in conjunction with the ACM Computer Science Conference. Last year, ICPC Regional participation included 52,709 of the finest students and faculty in computing disciplines from 3,233 universities in 110 countries. We remind you that in the current world champion is the team of Moscow State University.

Codeforces wishes the teams to show a vivid and interesting contest. We wish to find beautiful solutions, write without bugs and enjoy many accepted problems!

Links:

ICPC World Finals 2019 English Broadcast:
Legends Live Stream (Endagorion + Petr + tourist):

Read more »

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

By MikeMirzayanov, 4 months ago, translation, In English,

Hi Codeforces!

Here are some recent improvements here and in Polygon.

Weak and Leaked Passwords

We often hear about password leaks from various services. Considering that having common passwords is a common (but insecure) practice, we've improved Codeforces and Polygon to identify weak or leaked passwords. If on the top of the website you see a message that your password is not secure, then just change it immediately.

Type of the round when creating a contest proposal

This item improves our work with the writers. When creating a contest proposal, please indicate the type of a round. Leave the field empty only if you don't know the type of the round (it is strange).

Calendar

We've fixed errors when synchronizing official Codeforces rounds with the calendar. Now everything should be correct.

I trust this user

Currently, Codeforces provides a mature infrastructure for organizing contests, olympiads and trainings. With the help of domain groups and mashups, competitions of various levels were hosted on Codeforces. The organizers are sometimes not regular users of Codeforces rounds and do not have rights to some of the actions. Now, any red user can confirm his trust in another account, and he will get the right to: write comments/posts, create private groups, create mashups. I hope this will save me from a certain routine of processing such requests.

Confirmation via email when entering Polygon

When you sign in Polygon, your IP-address and browser will be verified. If you didn't use them in the recent past, then you may be asked to sign in with a confirmation email. In this case, just follow the secret link that comes to your email.

Read more »

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

By MikeMirzayanov, 4 months ago, In English,

Thanks for taking part in the round. I hope you enjoyed the round. It happens that the statements were really easy to understand (thanks to testers). We've got only 38 questions during a round!

Tutorial is loading...
Code
Tutorial is loading...
Code
Tutorial is loading...
Code
Tutorial is loading...
Code
Tutorial is loading...
Code
Tutorial is loading...
Tutorial is loading...
Code
Tutorial is loading...
Code

Read more »

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

By MikeMirzayanov, 4 months ago, translation, In English,

Hello, Codeforces!

I am pleased to invite you to Codeforces Round #547 (Div. 3), which will start on Mar/19/2019 17:35 (Moscow time). Everyone whose current rating is strictly less than 1600 is invited to participate officially. All others can take part out of the competition.

It so happened that the schedule of this month is not replete with rounds (coordinators, we hope for you!). Therefore I decided to partially correct the situation. All the problems of this round were invented and prepared by me on the last day of Hello Muscat Programming Bootcamp 2019 and on flights from Muscat to St. Petersburg. I even specially noted the time for preparation: for the current moment (the problems are ready for testing) I spent about 6 hours on their preparation, including inventing some of the problems. I really like working on problems, this is something at the intersection of creativity and programming. I really hope you enjoy the result of my work.



I am in Oman while writing the problems for the round.

The round will be hosted by rules of educational rounds (extended ICPC). Thus, during the round, solutions will be judged on preliminary tests, and after the round it will be a 12-hour phase of open hacks. I tried to make strong tests — just like you will be upset if many solutions fail after the contest is over. You will be given 6-8 problems for 2 hours to solve them.

Note that the penalty for incorrect submissions in this round is 10 minutes.

Remember that only the trusted participants of the third division will be included in the official standings table. As it is written by link, this is a compulsory measure for combating unsporting behavior. To qualify as a trusted participants of the third division, you must:

  • take part in at least two rated rounds (and solve at least one problem in each of them),
  • do not have a point of 1900 or higher in the rating.

Regardless of whether you are a trusted participant of the third division or not, if your rating is less than 1600, then the round will be rated for you.

I hope a little later a list of thanks to testers will appear instead of this paragraph. So far I only plan to give the round to testing. Many thanks to the testers ivan100sic, KrK, Benq, I_love_Tanya_Romanova, nhho! UPD: And extra thanks to more testers Pavs, PikMike, Narts, anon20016, Stresshoover, Ivan19981305.

Good luck on the round
MikeMirzayanov

Read more »

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

By MikeMirzayanov, 4 months ago, translation, In English,

Hello!

We supported the rendering of LaTeX-formulas with MathJax in new posts and comments. Now the formulas will be as beautiful as in problem statements. Drawback: they are displayed not immediately, but redrawn after the page is displayed. Old posts and comments are displayed in the old way (already a lot of old content, backward compatibility is very important). Note that if you edit old post, it will still be displayed in the old style.

Here are some example: $$$1 \le n \le 10^{12}$$$,  $$$c = \sqrt{a^2+b^2}$$$,  $$$i\hbar\frac{\partial}{\partial t}\left|\Psi(t)\right>=H\left|\Psi(t)\right>$$$.

Read more »

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

By MikeMirzayanov, 5 months ago, In English,

Hey.

Last week I started the experiment.

I believe in semi-automated learning of programming through problem solving. There are clear advantages of this approach: independence of practice from the teacher, good testing of solutions, clear milestones for students, ability of the approach to scale.

The fundamentals of programming in this sense are quite good: it is easy to prepare problems, there is a clear learning plan, and student progress is well understood.

Surely some structured courses for learning the language from scratch already exist. But why not do it exactly the way I like it? IMHO, a set of problems is crucial here. The devil in the details: increase in the level of problems complexity, diversity, lack of requirements in mathematical preparation, and so on. I have teaching experience (OMG, almost 20 years!), some teaching materials from my work with students of Saratov University and the desire to try!

So, experiment. Since February 20, a wonderful girl le.mur has been learning the basics of C ++ from scratch under my supervision and guidance. We agreed that she captures her impressions in a special Instagram account (subscribe, it motivates!) Lena did not study mathematics in any special way, no initial skills in programming and informatics. Every day she practices 2-4 hours. I expect, one homework should be done in 1-4 days. My plan is to minimize individual explanations, as long as it turns out.



I brazenly stole a photo from Instagram

A training plan for the near future (that is, the very beginning) looks like this:

  • The concept of a variable, the simplest functions (min, max, abs), problems without conditional operators and loops.
  • Conditional operator, both forms (if, if-else). Understanding of scopes of variables, nested if-s. Problems on conditional operators.
  • Loop statements: while and for. Problems for the use of loops without additional constructions (that is, they are solved in one loop without nested conditionals/loops).
  • Problems to use loops and conditional operators together.
  • Problems to use nested loops.

Each item corresponds to one homework and it will contain 10-20 problems on this topic. Further according to the plan, arrays and strings are expected, but they have yet to be reached.

One of the first conclusions that I managed to do for myself: at the initial stage, you should not immerse yourself in unnecessary details, a simplified or incomplete understanding helps to understand the basics. For example, while Lena operates only with integer variables (type int), she always puts curly brackets after control operators, uses only logical && and ||, only approximately understands the meaning of the “using namespace std” magical spell. It seems to me that after obtaining the initial skills, it will be easier to expand understanding with types, additional operators and other details.

I hope that Lena will succeed and she will not lose her motivation to study.

And how did you learn the very basics of programming? What worked well for you?

Read more »

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

By MikeMirzayanov, 5 months ago, In English,

Hello, Codeforces!

Yesterday slappy advised me to stop writing problems. I will not listen to his advice and will not stop coming up with new problems. Moreover, the idea of problem 1118C - Palindromic Matrix is mine, and I do not consider it bad or unsuccessful.

IMHO, this is a good example of a problem, where an sloppy (almost slappy) implementation leads to a casework, duplication of code and a lot of formulas. On the other hand, a well-turned implementation is devoid of all these drawbacks and easy to write. It seems to me that such feedback about the problem is something of a Dunning-Kruger effect.

In general, this is an important skill of the developer to write such code, which solves the problem reliably, concisely and is not dirty. And if your code smells bad, then instead of the shaming the authors, I urge you to think "can I write a solution to this problem better?". Good way is to read solutions of other participants. You can choose short implementations from experienced participants. If you focus on learning, rather than just participating for fun, this should be the rule: read solutions of other participants (better experienced, choosing short codes or extremely efficient) and learn. The fact that you got “Accepted” does not mean that you have nothing to learn with this problem.

Here is the explanation of my solution which was written in ~10 minutes. Please, read the problem 1118C - Palindromic Matrix if you don’t know the statement. This problem is just a generalization of string palindrome constructing problem on 2D.

In general case there are 3 types of elements of a matrix (I didn’t spend to much time on drawing, the image is not perfect):

Each element in the blue area has 4 equal copies (itself and 3 additional symmetric cells). Each element in the yellow area has 2 equal copies (itself and 1 additional symmetric cell). And the single central cell (the green area) has only the single copy (itself). The yellow and green areas are absent in case of even n.

It means that you can fill the matrix with a greedy approach. At first process the blue area: for each cell take any value with number of occurrences at least 4 and fill the cell and its copies. After it process the yellow area (if any): for each cell take any value with number of occurrences at least 2 and fill the cell and its copy. Finally, process the green area (if any): take any value with number of occurrences at least 1 and fill the cell and its copy.

Easy to see that each time you can take a value with the greatest number of occurrences, so I used priority_queue<pair<int,int>> to maintain values ordered by number of occurrences. The first item in a pair is a number of occurrences, the second item in a pair is value itself. To construct such priority_queue q just use simple code like this:

map<int,int> cnts;
forn(i, n * n) {
    int val;
    cin >> val;
    cnts[val]++;
}
for (auto [key, value]: cnts)
    q.push({value, key});

To implement the rest of code, use simple function to reflect a position to the symmetric (in 1D):

int rev(int i) {
    return n - i - 1;
}

Now the main part of the code is: iterate over blue, yellow, green areas and put values in the matrix (consider all symmetric copies in together):

int m = n / 2;
forn(i, m) // blue area
    forn(j, m)
        put({{i, j}, {i, rev(j)}, {rev(i), j}, {rev(i), rev(j)}});
if (n % 2 != 0) {
    forn(i, m) { // yellow area
        put({{i, m}, {rev(i), m}});
        put({{m, i}, {m, rev(i)}});
    }
    put({{m, m}}); // green area
}

The function put takes a sequence of symmetric positions and put same values on them:

void put(vector<pair<int,int>> pos) {
    auto t(q.top());
    q.pop();
    if (t.first < pos.size()) // can’t do it?
        no(); 
    for (auto [i, j]: pos)
        a[i][j] = t.second;
    t.first -= pos.size();
    q.push(t);
}

So the complete code is very simple and contains only two if statements (almost no casework!).

Complete Code

MikeMirzayanov

Read more »

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

By MikeMirzayanov, 5 months ago, translation, In English,

Hi Codeforces!

February 2019 is already on the calendar, which means that I was late with the report for 2018. Better late than never! Let's remember last year.

In 2018, _kun_, 300iq and arsijo joined the team of coordinators. The work of the coordinators is headed (and is the coordinator of the coordinators) KAN. I really hope that a more measured schedule of preparing rounds by a large team of coordinators will give a better insight into the contests. The main innovations in the platform are implemented by me and the developers kuviman, fcspartakm, MaximShipko. Great work on the organization of events and prizes mailing was done by gKseni.

Special thanks to the writers of the problems and testers. It is your content that charges the community with life and unites all of us. Thank you for the problems!

And now let's summarize the 2018th year.

Partner Events

We are pleased to hold programming competitions with companies or for companies. I'm sure this is a great way to support the community of young programmers and hire talented candidates. Here is a list of our main partners this year:

  • Telegram and personally Pavel Durov is supporting Codeforces activities for many years, every regular round is held with their help, thank you!
  • VK, VK Cup — team competition for young Russian-speaking programmers with a series of elimination rounds and finals in St. Petersburg
  • Mail.Ru, Mail.Ru Cup — open individual programming competition, consists of several stages, Technocup — open competition for schoolchildren
  • Harbour.Space University — a series of educational rounds, the selection of summer school Tech Scouts
  • Lyft — a two-level competition with the Final at Lyft headquarters (California) and the mirror contest for worldwide participants
  • Avito, Avito Code Challenge and Avito Cool Challenge — open partnership rounds targeting a wide international audience
  • Microsoft, Microsoft Q # Coding Contest — unusual quantum computing competition
  • AIM Tech — open partnership round targeting a wide international audience
  • Huawei — research competition (marathon) with elements of machine learning
  • IQ Option — private round as a corporate training

Read more »

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

By MikeMirzayanov, 5 months ago, In English,

Hello!

It is always satisfying and important for me when former contest participants offer their help to the community and support the development of programming competitions. And now I am in a hurry to share the news that thanks to the support of XTX Markets and the personal participation of Yuri Bedny and Alexander Gerko, we are launching a new line of Codeforces Global Rounds. Hooray!

Like many of you, I had never heard of XTX Markets before but it is one of the largest quantitative-driven electronic liquidity providers in the world. I understand little about the financial sector, but with their 34,148 cores and 42 petabytes of usable storage in their research cluster, XTX’s rapid growth and strong market share globally speak for themselves.

So, in 2019, with the support of XTX Markets, 6 rounds of the new Codeforces Global Rounds will be held. These will be common rounds for both divisions of 7–9 problems each. The duration of the rounds will be 2-3 hours, depending on the number and complexity of the problems. All such rounds will be rated for all participants. At each such round, 50 brand T-shirts will be handed out, and we will be happy to give T-shirts to all authors and problem testers.

I will be very happy for Codeforces to work with the best authors of the problems. I hope that the XTX Markets initiative will allow for interesting and testing rounds that will delight community members! We have the opportunity to pay $800, double fee, for the preparation of a full set of problems (for some rounds we may collect problems from different authors).

The first Global Round will take place very soon — starting Feb/07/2019 16:35 (Moscow time). I hope you will enjoy the round!

MikeMirzayanov

Read more »

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

By MikeMirzayanov, 6 months ago, In Russian,

Привет, Codeforces!

Закончился первый тур олимпиады. Надеюсь, что скоро участники поделятся своими впечатлениями от задач и результами. В этом году впервые Codeforces участвовал в проведении этой олимпиады — 12 регионов принимали участие на нашей платформе. Есть кто из участвующих? Как впечатления? Кажется, всё работало без сбоев. Очередей не было.

Дорешивать задачи можно в Тренировках по ссылке 2018-2019 Всероссийская олимпиада школьников по информатике, региональный этап, 1 тур.

UPD: Закончен второй тур. По ссылке Тренировках можно дорешивать и задачи 2-го тура: 2018-2019 Всероссийская олимпиада школьников по информатике, региональный этап, 2 тур.

Read more »

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

By MikeMirzayanov, 6 months ago, translation, In English,

Hello!

The shortest news on Codeforces. I added support for Microsoft Visual Studio C ++ 2017. The solutions are compiled with the command line cl /std:c++17 /W4 /F268435456 /EHsc /O2 /DONLINE_JUDGE %1.

Read more »

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

By MikeMirzayanov, 6 months ago, In Russian,

Привет!

Совсем скоро состоится региональный этап РОИ. В этом году Codeforces присоединяется к проведению, и некоторые регионы будут писать олимпиаду на базе Codeforces.

Для проведения олимпиады мной были пописаны некоторые элементы функциональности Codeforces и Polygon. Теперь, в Полигоне можно не только устанавливать политики начисления баллов для групп тестов и их зависимости, но и рекомендуемую для тестирующей системы политику отображения информации о тестировании. Как и на Всеросиийских олимпиадах, поддержаны следующие политики:

  • NONE — не показывать в отчете информацию о тестировании группы,
  • POINTS — показывать только баллы за группу тестов,
  • ICPC — показывать вердикт до первого упавшего теста (включительно),
  • COMPLETE — показывать все вердикты (в этом случае группа тестируется полностью, даже если оценивается только её полное прохождение).

В тестировании на Codeforces было поддержано прерывание групп тестов и пропуск их тестирования, если это можно сделать в соответствии с политиками групп.

Кроме того, для организаторов регионов был разработан отдельный интерфейс, который сделает проведение олимпиады простым и комфортным.

Приглашаю всех интересующихся присоединиться к открытому пробному туру региональной олимпиады по адресу https://roi19p.contest.codeforces.com. Просто используйте свой аккаунт Codeforces, чтобы зайти на этот подсайт и примите участие в пробном туре. Обратите внимание, что каждое условие содержит описание политик начисления баллов и отображения отчетов. По задачам можно задавать вопросы (тестируем всё!), но я не могу обещать, что смогу ответить на них.

Если что-то работает неправильно, непредсказуемо или неудобно, то пишите комментарий под этот пост.

Спасибо!

Read more »

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

By MikeMirzayanov, 7 months ago, In English,

Congratulations to all the new 2019 year! At this very moment you can make an important wish. Done? I wish it to be fulfilled!

I wish you to become better in the new year, to think better and to meet less often with bugs and mistakes. Let all your solutions be fast, effective and correct!

Later, I will compile statistics for 2018 and publish in the form of an annual report

Now I'd like to remind you most voted posts of 2018. Here is the list of the top 15:

Happy New Year!

Read more »

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

By MikeMirzayanov, 7 months ago, In English,

Do you already have a New Year's mood?

And we have traditional gifts!

Change Handle Feature

Hurry! Only until the 10th of January, you can change your handle (but only once)! Note that it will be possible to roll back the changes or change the handle again only after a year. Be careful what you wish for.

You can change your handle to the new one which wasn't used before by anybody or which was used by you before. The links to a profile page with old handle would automatically redirect to the actual profile.

This year we have an improvement. If you took part in at least 10 rounds you can request handle of an inactive participant. It means that the participant should have a period of activity on Codeforces of at most 90 days, this period should be in 2015 or earlier. The inactive participant can’t have posted comments, messages and so on. It can't take part in more than 2 contests. It will be automatically renamed and informed by email. If you can’t change handle to others, it means that some requirement doesn't meet. Please do not ask me to do something with it. I'm not Santa Claus.

Talking about handles I always reminisce the following story. Once a user wrote me the message: "Please change my handle from I_love_Valya to I_love_Sveta, as I no longer love Valya ..."

New Year's Masquerade of Colors and Ranks

Traditional magical tab has appeared in the profile setting. Happy New Year!

Read more »

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

By MikeMirzayanov, 8 months ago, In English,

Hello,

We have some technical issues for operating with recent problems. If you created a gym/mashup (today or yesterday), it is possible that its submissions are not visible. I'm working on it. Probably, today night it will be a planned maintenance shutdown to fix it.

I think it will not affect Educational Codeforces Round 55 (Rated for Div. 2).

Mike.

Read more »

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

By MikeMirzayanov, 8 months ago, In English,

Here are merged results of Mail.Ru Cup 2018 Round 1, Mail.Ru Cup 2018 Round 2 and Mail.Ru Cup 2018 Round 3 according to the GP100 scores (see the announcement for the details https://codeforces.com/blog/entry/62355). Best two contests give the summary score of a participant. This table is unofficial yet. But anyway... congratulations to the winnerzzzz!

Place Contestant = Round 1 Round 2 Round 3
1 mnbvmar 1497 1000 497 29
2 V--o_o--V 1281 575 575 706
3 Radewoosh 1265 265 1000
4 aid 1204 204 1000 142
5 LHiC 1203 497 706 226
6 Um_nik 997 706 291 235
7 ksun48 788 291 497
8 SpyCheese 742 371 371 265
9 RAVEman 619 19 176 443
10 scott_wu 614 307 307 307
11 ch_egor 575 575
12 JustasK 538 192 346
13 BudAlNik 531 277 254 122
14 lewin 515 443 72
15 al13n 477 186 62 291
16 tourist 443 443
17 isaf27 426 277 149
18 I_love_Tanya_Romanova 422 204 218
19 natsugiri 419 48 371
20 Reyna 405 244 54 161
20 Golovanov399 405 403 2
22 ecnerwala 403 403
22 Endagorion 403 403
24 DeadMedveD 389 145 68 244
25 j_______________________ 384 198 186
25 Kostroma 384 218 46 166
27 Errichto 382 36 346
28 zemen 371 226 32 145
29 kostka 370 45 325
30 uwi 364 153 211 131
31 BigBag 355 198 157
31 dreamoon 355 265 90
33 kmjp 353 70 218 135
34 dotorya 346 346
35 Zhukov_Dmitry 337 235 102
36 OO0OOO00O0OOO0O00OOO0OO 325 325
36 Petr 325 325
38 krijgertje 319 181 138
39 SYury 313 78 235
40 Marcin_smu 309 138 171
41 mjhun 308 110 198
42 KrK 294 102 192
43 socketnaut 286 181 105
44 Benq 277 277
45 mmaxio 270 16 254
46 Nikitosh 261 142 119
47 irkstepanov 258 254 4
48 AndreySergunin 251 166 85
49 qwerty787788 244 244
50 Fedosik 242 135 107
51 sevenkplus 236 226 10
52 gamegame 229 192 37
53 voover 227 56 171
54 Xellos 225 72 153
55 FCB1234 224 43 181
56 MakeRussiaGreatAgain 218 138 80
57 neal 211 211
57 ainta 211 211
59 MrDindows 204 204
60 znirzej 190 122 68
61 progmatic 186 186
62 AeonHQ 182 161 21
63 maroonrk 176 176
63 snuke 176 149 27
63 rudy102 176 176
66 cki86201 171 171
67 Shef 166 166
68 mHuman 163 21 142
69 zeliboba 162 34 128
70 imeimi 161 161
71 KMAASZRAA 160 97 63
72 Alex_2oo8 157 157
72 wxy_z 157 157
74 JiK 154 128 26
75 ilyakor 153 153
76 yashChandnani 152 92 60 45
76 amethyst0 152 135 13 17
78 DmitryGrigorev 151 52 11 99
79 kaldiuo 150 90 60
80 function348 149 149
81 fgcos 148 107 41
82 andrey_efremov 145 145
83 subconscious 143 63 80
84 Merkurev 131 131
84 N1k1_tos1_NA 131 131
86 grumpy_gordon 129 116 13
87 Nurboom 128 128
88 zscoder 127 116 11
89 prof.PVH 126 34 50 76
90 Shayan 125 125
90 majk 125 125
90 rimuruu 125 125
93 Miyukine 122 122
93 WA_TLE 122 122
95 palayutm 121 87 34
96 queria_ser_abella 119 119
97 savkinsd2089 117 107 10
98 sharyava 116 116
99 bbatti93 114 22 92
100 Swistakk 113 113
100 boook 113 113
100 Fdg 113 113
103 rui-de 111 87 24
104 Definitely_Not_Ngkan146 110 110
104 liujunhao 110 110
106 pparys 105 105
106 ShadowLight 105 105
108 Quang 104 14 90
109 ivanovmp 102 102
110 rtilikay 99 99
110 Motarack 99 41 58
110 sy_chen 99 99
113 hank55663 97 97
113 MicGor 97 97
115 tlwpdus 94 94
115 mrscherry 94 94
115 Batrr 94 94
118 shadowatyy 92 92
119 PoDuReM 87 4 83
119 ll931110 87 87
121 e-pluszak 86 72 14
122 dario2994 85 85
122 cephian 85 85
124 lezdzh 83 83
124 SmsS4 83 83
126 fsouza 82 56 26
127 kimden 80 80
128 ei133333 78 78
128 adedalic 78 78
130 papa3 76 76
130 Coder 76 76
132 tfg 74 74
132 ablikexe 74 74
132 hloya_ygrt 74 74
135 ushakov.fedor 72 72
136 Mateuszrze 70 70
136 maximumSHOT 70 70
138 waynetuinfor 68 68
139 iitbhu_0 66 66
139 kefaa 66 27 39
139 NurlashKO 66 66
142 nanachi 63 63
143 Ali.Sh 62 62
143 ismagilov.code 62 62
145 AlexDmitriev 60 60
146 nhho 58 58
146 Noam527 58 58
148 131131yhx 56 56
149 qoo2p5 54 54
149 alex9801 54 54
151 Sert 52 52
151 mariand 52 52
151 YaDon4ick 52 52
154 radoslav11 51 29 22
155 cuber2460 50 50
156 Damon 48 48
156 archie_fake 48 48
156 mango_lassi 48 48
159 shananton 46 46
160 Wild_Hamster 45 45
160 Holidin 45 2 43
162 nikabb 43 43
163 Farhod_Farmon 41 41
164 walnutwaldo20 39 39
164 Alexandr_TS 39 39
166 qlmupi 37 37
166 wa1tz719 37 37
168 Egor 36 36
168 stilltoosimple 36 36
170 f.bialas 32 32
170 LoneFox 32 32
172 sina_pakseresht 31 31
172 Kaban-5 31 31
172 nigus 31 31
175 kyleliu 29 29
176 mateusz 27 27
177 joomas 26 26
177 NBAH 26 26
179 icecuber 24 24
180 chemthan 22 22
181 kalinov 21 21
182 kr_abhinav 19 19
182 Arterm 19 19
184 Sagiri_Izumi 17 17
184 Lollipop 17 17
186 sava-cska 16 16
186 jinzhihan 16 16
188 Weeeee 14 14
189 sqrtdecompton 13 13
190 test616.cpp 11 11
191 shoemakerjo 10 10
192 tamionv 8 8
192 bazsi700 8 8
192 guille 8 8
195 spiderg 7 7
195 ErdemKirez 7 7
195 albertg 7 7
198 muratt 5 5
198 AlexLuchianov 5 5
198 glebushka98 5 5
198 teleport 5 5
202 mitterr1999 2 2
203 k__mas 1 1
203 erop.sergeev 1 1
203 _LeMur_ 1 1

Read more »

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