By RAD, 9 years ago, translation, , We want to congratulate you with a happy new school year with this contest. We wish you excellent marks, easy exams and many Accepted in the contests. Let this year bring you many new and interesting knowledge!

Artem Rakhov and Codeforces team

P. S. Note that the round will be held on the Codeforces Format Rules. Read the rules before the competition. Good luck!

UPD: Announcement of Codeforces Beta Round #27 (Codeforces format, Div. 2) Announcement of Codeforces Beta Round #27 (Codeforces format, Div. 2)  Comments (104)
 Can you please translate this post to English?
 I want to know the 22nd test of problem E!!!!!
•  118
•  What about the answer to 118?
•  864691128455135232
 D is just a 2-sat problem???
•  who can help me!!! THANKS!!!
 What's 11th test of problem C?
•  +1Also need this test!
•  Copy AC solution and generate some test(for example 50), and check it. Or read right idea more carefully. P.S. sorry for my poor english =(
•  found my bug.test:62 2 3 3 2 2
•  Some big test. N = 10^5, but there are only 2 different numbers. The answer is:3 1 3 4May be your program does not work properly with equal numbers?
•  thanks for a hint about equal numbers! it helped me!
•  Now I need 18th test of problem C
•  This test helped me:5-1 -2 -6 -3 -4
•  Looks like you and I are facing same problem.Btw, how are you getting the tests?
 What is the 6th test case for C??Or any hints about C?
•  6th pretest is:42 3 3 1
•  The answer is not41 2 3 4??
•  I think it's 31 2 4But I'm not too sure, I didn't get this problem right either
•  Yes, that is one of the solutions. If there is a solution, then the shortest is always of length 3.
•  Yeah, that's what I thought =)
•  the shortest length is always 3, if the test have unordered subsequence.
•  nope!answers are:(1)31 2 4(2)31 3 4
•  Yes, yes, sorry, I only gave what my program would output, but you're right
•  U r right too! There are 2 solutions, so there are two answers to choose to output!
 We can't see others solutions?
•  try test:30001 2 3 4 5 6...... 3000;)
•  My program outputs junk memory, god dammit. Should it output 3001 ?
•  yep!the answer is 3001
•  Hmm, i fixed that and upload it again, but now it fails on 4th test case.
•  Try this:Input:12Output:1
•  Without executing the code, i would guess the answer of my code, probably 3, obviously i misunderstood the problem, i thought the number should be bigger then the minimal number.
•  Actually, it started from 1.
 RAD, could you tell me the input and output for the 4th test case in problem E? Thank you.
•  N = 9, answer is 36
•  Thanks, I found my bug.
•  I Have Right Answer when I tested this test case on my computer  , why i still get WA on 4th Test caseMy Submission ID is 111986
 What is the 7th test case for E?
•  N = 20, answer is 240
•  Thank you.
•  and test case 3td for problem E?
•  I need this one too!
•  N = 8, answer is 24
•  Thanks!
 What about the second problem. Is it possible to solve it using DFS ?
•  yep)I solved it using Topological Sorting
•  Dude, why topological sorting?
•  First idea that came to me :D
•  Easiest way to solve is to use transitive property of comparison.i.e. if for x and y participants exist such another participant(z), that p_x>p_z & p_z>p_y (won x and lost to y) => p_x>p_y (y better x)p_x p_x
•  yes. because everyone has a "pj", we can think the input as a directional Graph. if a and b appear less than N-1 times, then dfs(a,b)-bool. if a can reach b, we can see a win b.Just as SKYDOS 's TopSort.
 In problem B how it's supossed to write the numbers??I did it like cout<
•  pls, show your code.
•  here is my code:#include #include using namespace std;int games;int winsto;bool getsToWinTo(int i, int j){     for(int ii=1; ii<=60; ii++)     {         if(winsto[i][ii] && winsto[ii][j])         return true;              }     return false;}int main(){    int n;    cin>>n;    int a,b;    memset(games,0,sizeof(games));    int t=n*(n-1);    t/=2;    t--;    //cout<>a>>b;            games[a][b]=1;             games[b][a]=1;            winsto[a][b]=1;    }    bool done=false;    for(int i=1; i<=n; i++)    {            for(int j=1; j<=n; j++)            {                    if(i==j) continue;                    if(!games[i][j] && getsToWinTo(i,j))                    {                          cout<>a;        return 0;    }
•  lol, same idea as mine :)
•  same idea as right ;)
•  but i got P.E. T_T
•  after i changed content of your inner cycle to:if(i==j) continue;if(!games[i][j]){ if(getsToWinTo(i,j)) cout<
•  forgot about reason of PE:seems, that ' ' is not valid char constant, but " " is
•  you are right, I didn't see that case, thank you very much
•  Original solution outputs nothing on test 31 21 3That's the reason of PE, not the ' '.
•  You're right, I thought, that PE appear at PreTest#1, not MainTest #1.PS. I never tried to use ' ' (and haven't any lections at C) so post above is just theory.
•  And I tested it because that seemd strange to me.
 RAD: Can I please have test case 18 for C, and 10 for D...? Thanks
•  Test 18 for C is big random test, test 10 for D:6 4 6 3 1 3 6 4 5 3
•  Now can I have test case 23 for D please. :)It'll be really great if the test cases were available in practice mode, just like in TC.
•  Big random test, N = M = 100
 how to see others code???
•  You cant see others solutions.
•  thank you
•  Sorry dude, my bad, it is not obvious but actually you can see others code. Go to problem status and click on the left link, you should get solution pop up.
 can i know what is the test case 3 for Problem B???
•  5 3 5 2 5 1 5 1 4 4 3 1 3 2 3 4 5 4 2
•  what is the output?? lets talk about sample input and output, output is 4 3, if it comes 3 4 then it should be WA, so how to differ that???how to be sure about the format??
•  can you do me a favor? may i know test case 6?
•  try that:31 21 3
•  output is 3 2. what should be the output?
•  that's right
•  it could be 2 3 too.. isnt that??coz 1 to 21 to 3so if i said 3 to 2 is not making circle and also 2 to 3 is not making circle.
 Can someone post an idea for Problem E ?Thanx ! :)
•  There is editorial about today's round. You can read it here.
 my solution about A B C.hope can do something to you.i want to know how to do C and E.
 What is the test case #3 for problem E?
•  N = 8, answer is 24
 Hey, How can I view others solutions? The popup box which appears doesn't have the  other  code.
•  Done
 I generated a huge data to hack a TLE solution, but the judge says 'submit already challenged'. What does this mean??? I wasted a lot of time to try to hack it, But this solution hadn't been hacked until faild on system tests.
•  Hmm, probably someone hacked the same defender's solution before you.
•  oops, This solution hadn't been hacked until failed on system tests.
 Can someone please have a look at my solutions to problem C and D and help me identify the flaws in it...
 I want to know the test 15th of problem B
•  It is big random test where N=50
 Nice problem set (Y).Other solution for problem E could be:* Factorize N (assume that M will be the number of prime factors) -- O(sqrt(N))* Calculate all the possible arrays b[1..M'] (M' <= M) multiplying i prime factors of N (with i: 0 <= i <= m) -- O(M * 2 ^ M))* Sort the resulting array b[1..M'] in non-increasing order -- O(M' log M')* Calculate a number X (X = 2 ^ (b - 1) * 3 ^ (b - 1]) * 5 ^ (b - 1) ...) -- O(M' log N)* Take the minimum X among all the possible arrays -- O(sqrt(N) + M * 2 ^ M * (M' log M' + M' log N)). This algorithm will run in time.For example,N = 16* b = [2, 2, 2, 2] -> 210* b = [4, 2, 2] -> 120* b = [4, 4] -> 216* b = [8, 2] -> 384* b =  -> 32678(Some arrays may appear several times)I wanted to share this information with you, but, IMO DP is a more elegant (and shorter) solution for this problem =).
•  I am little confused, can you tell me why this code fails on the first test case?#include #define MAXN 3001int main() {    int n, i;    bool m[MAXN];    scanf ("%d", &n);    while (n--) {        scanf ("%d", &i);        m[i] = true;    }    for (int j=1; j < MAXN; j++) {        if (!m[j]) {            printf ("%d\n", j);            return 0;        }    }}
•  First test != Sample testSo try this test:30001 2 3 4 5 6 7 ...... 3000
•  wow!
 Can I see D's test 11?
•  6 5 5 3 4 1 2 6 5 1 5 2
•  I have this solution for this problem. This is the exact same solution I submitted during the contest (I corrected only couple of identations). I have tested it against your test and got ioioi, which seems to be correct answer. Still I get wa 11 when submitting. Any ideas of flaws in my algorithm?
 can I see E's test10?Thank you!
 What is C's test case 19 ?I`m getting WA :((
 whats the 10th test case of problem c i  get tle in this case
 My code is giving presentation error on Test case 4.may i please see the case 4?? please?