Блог пользователя harsh__h

Автор harsh__h, 2 года назад, По-английски

Hello, Codeforces!

I invite you to participate in Codeforces Round 931 (Div. 2), which will be held on Mar/01/2024 17:35 (Moscow time).

The round will be rated for participants with rating lower than 2100. Participants with higher rating can participate in round unofficially.

You will have 2 hours to solve 5 problems, with one of the problems having 2 versions. One or more interactive problems may occur in the round, so please read guide for interactive problems before the contest.

All problems are authored by me.

I would like to thank:

Good luck to all participants!

UPD: Score distribution: 500 — 1000 — 1500 — (1500 — 1250) — 3250

UPD2: Editorial

UPD3: Congratulations to the winners!

Div1 + Div2

Place Participant
1 Um_nik
2 BurnedChicken
3 arvindf232
4 turmax
5 hitonanode

Div2

Place Participant
1 mlmlml
2 2018LZY
3 q1w2e3r4_1
4 shade34
5 damjandavkov
  • Проголосовать: нравится
  • +206
  • Проголосовать: не нравится

»
2 года назад, скрыть # |
 
Проголосовать: нравится +35 Проголосовать: не нравится

As a tester, problems are very interesting :)

»
2 года назад, скрыть # |
 
Проголосовать: нравится +27 Проголосовать: не нравится

As a tester, I can assure that you will enjoy the problems.

»
2 года назад, скрыть # |
 
Проголосовать: нравится +49 Проголосовать: не нравится

As a tester, I enjoyed testing this round a lot! :)

»
2 года назад, скрыть # |
 
Проголосовать: нравится +18 Проголосовать: не нравится

As a tester, I can ensure you that the problems are quite engaging. You will love solving them. Lots of learning on the way!!

»
2 года назад, скрыть # |
 
Проголосовать: нравится +6 Проголосовать: не нравится

Hoping for the best Div.2 round!

»
2 года назад, скрыть # |
 
Проголосовать: нравится +6 Проголосовать: не нравится

First contest on the spring!

I hope the tasks will be as short and clear as the announcement of this contest!

Good Luck for EVERYone!

»
2 года назад, скрыть # |
 
Проголосовать: нравится +3 Проголосовать: не нравится

OMG purple round

»
2 года назад, скрыть # |
 
Проголосовать: нравится -18 Проголосовать: не нравится

Interactive problems? I don't even know how to solve them, does anyone has resource which I can refer

»
2 года назад, скрыть # |
 
Проголосовать: нравится 0 Проголосовать: не нравится

Thanks a lot for authour and tester for very good and high quality of problemset(at least A,B and C)

»
2 года назад, скрыть # |
 
Проголосовать: нравится +7 Проголосовать: не нравится

score distribution???

»
2 года назад, скрыть # |
 
Проголосовать: нравится 0 Проголосовать: не нравится

sounds like a tough contest tho

»
2 года назад, скрыть # |
 
Проголосовать: нравится 0 Проголосовать: не нравится

Codforces Round 931 (Div. 2) i think there is mistake

»
2 года назад, скрыть # |
 
Проголосовать: нравится +5 Проголосовать: не нравится

IIT Guwahati orz <3

»
2 года назад, скрыть # |
 
Проголосовать: нравится +3 Проголосовать: не нравится

interforces

»
2 года назад, скрыть # |
 
Проголосовать: нравится +9 Проголосовать: не нравится

aryanc403 testing back to back contests

»
2 года назад, скрыть # |
 
Проголосовать: нравится 0 Проголосовать: не нравится

Back to back cf contests. I like it !

»
2 года назад, скрыть # |
 
Проголосовать: нравится +47 Проголосовать: не нравится

As a second time tester, this is definetely one of the top 2 rounds I ever tested.

»
2 года назад, скрыть # |
 
Проголосовать: нравится +14 Проголосовать: не нравится

jdurie tester orz

»
2 года назад, скрыть # |
 
Проголосовать: нравится +18 Проголосовать: не нравится

jdurie :heart_eyes:

»
2 года назад, скрыть # |
 
Проголосовать: нравится +5 Проголосовать: не нравится

Jdurie

»
2 года назад, скрыть # |
 
Проголосовать: нравится +6 Проголосовать: не нравится

Hope C is not interactive :D

»
2 года назад, скрыть # |
 
Проголосовать: нравится +2 Проголосовать: не нравится

Give us the score distribution,precious! (Read in Gollum's voice.)

»
2 года назад, скрыть # |
 
Проголосовать: нравится +3 Проголосовать: не нравится

I want to become blue wish me luck

»
2 года назад, скрыть # |
 
Проголосовать: нравится +22 Проголосовать: не нравится

What happened to the chain of pictures of authors?

»
2 года назад, скрыть # |
 
Проголосовать: нравится +6 Проголосовать: не нравится

hope no bitmasks(

»
2 года назад, скрыть # |
 
Проголосовать: нравится 0 Проголосовать: не нравится

Bring it on, It's time for My Redemption.

»
2 года назад, скрыть # |
Rev. 2  
Проголосовать: нравится -6 Проголосовать: не нравится

One and only author harsh__h :)

»
2 года назад, скрыть # |
 
Проголосовать: нравится 0 Проголосовать: не нравится

Wow. Two contest in a row and two positive delta.

»
2 года назад, скрыть # |
 
Проголосовать: нравится +3 Проголосовать: не нравится

Can I be a newbie tester for some future contest. I want try what it's like to be a tester.

»
2 года назад, скрыть # |
 
Проголосовать: нравится 0 Проголосовать: не нравится

How can we hack others in interactive problems?

»
2 года назад, скрыть # |
 
Проголосовать: нравится +8 Проголосовать: не нравится

with one of the problems having 2 versions One or more interactive problems XD XD

»
2 года назад, скрыть # |
 
Проголосовать: нравится +23 Проголосовать: не нравится

indian setter = mathforces

»
2 года назад, скрыть # |
Rev. 2  
Проголосовать: нравится +5 Проголосовать: не нравится

it was very enjoyable contest

»
2 года назад, скрыть # |
 
Проголосовать: нравится +19 Проголосовать: не нравится

Waiting for problem setters pics

»
2 года назад, скрыть # |
 
Проголосовать: нравится +1 Проголосовать: не нравится

There is just one author and people are asking him to post his selfie onto the announcement which will be shown on the home page lol. (no offense)

»
2 года назад, скрыть # |
 
Проголосовать: нравится 0 Проголосовать: не нравится

Amazing maths problem (propply)

»
2 года назад, скрыть # |
 
Проголосовать: нравится 0 Проголосовать: не нравится

Looks like recent Div 2 demotions in the current contest are considered “out of contest” even if their rating is 2100 by the start of the contest. Any reason why?

https://mirror.codeforces.com/contestRegistrants/1934/page/2?order=BY_RATING_DESC

»
2 года назад, скрыть # |
 
Проголосовать: нравится -42 Проголосовать: не нравится

whats wrong with last 2 rounds?

»
2 года назад, скрыть # |
 
Проголосовать: нравится +2 Проголосовать: не нравится

awful contest

»
2 года назад, скрыть # |
Rev. 2  
Проголосовать: нравится -33 Проголосовать: не нравится

Wtf, why C is interactive again? Is it so hard to make up NOT interactive problem for Div2?

»
2 года назад, скрыть # |
 
Проголосовать: нравится +69 Проголосовать: не нравится

No early screencast from Um_nik? :-(

»
2 года назад, скрыть # |
 
Проголосовать: нравится -32 Проголосовать: не нравится

can we stop with the interactive C please, welcome back pupil

»
2 года назад, скрыть # |
 
Проголосовать: нравится +1 Проголосовать: не нравится

russian translation for D1 is a bit strange. In english text it says: "This is the solo version of the problem". But word 'solo' is also used in russian text "Это сольная версия задачи". At first I thought it was somehow 'salty' version of problem D (salty is used to describe contention, bitterness, anger, or an otherwise-foul attitude). I got confused for a second, I even changed the language of the text to doublecheck.

I think the better way to say it both in english and in russian was "This is non-interactive version of the problem" / "Это неинтерактивная версия задачи"

»
2 года назад, скрыть # |
 
Проголосовать: нравится +15 Проголосовать: не нравится

Such a beatiful contest , I decided to give up just like my crush.

»
2 года назад, скрыть # |
 
Проголосовать: нравится +2 Проголосовать: не нравится

not able to solve problem B I should quit CP

»
2 года назад, скрыть # |
 
Проголосовать: нравится 0 Проголосовать: не нравится

Author probably thought he was proposing these problems for a math Olympiad

»
2 года назад, скрыть # |
 
Проголосовать: нравится +2 Проголосовать: не нравится

see y'all in green :|

»
2 года назад, скрыть # |
Rev. 2  
Проголосовать: нравится +6 Проголосовать: не нравится

Why is the limit on operations 63 in problem D when there is a solution with 2 operations?

»
2 года назад, скрыть # |
 
Проголосовать: нравится +30 Проголосовать: не нравится

Problem C seems to essentially be a duplicate of a problem which I wrote in a previous DMOJ round, but with one fewer step.

»
2 года назад, скрыть # |
Rev. 2  
Проголосовать: нравится -57 Проголосовать: не нравится

deleted

»
2 года назад, скрыть # |
 
Проголосовать: нравится 0 Проголосовать: не нравится

why c is interactive

»
2 года назад, скрыть # |
 
Проголосовать: нравится 0 Проголосовать: не нравится

can someone please explain me problem B

»
2 года назад, скрыть # |
 
Проголосовать: нравится 0 Проголосовать: не нравится

There is no hack phase this time?

»
2 года назад, скрыть # |
 
Проголосовать: нравится 0 Проголосовать: не нравится

Amazing interactive problems; I don`t know how to start.

»
2 года назад, скрыть # |
 
Проголосовать: нравится 0 Проголосовать: не нравится

Did anyone else get this annoying error for Problem C wrong output format Unexpected end of file — int32 expected (test case 2)?

Also, I technically never submitted a problem and passed test case 1, so is my participation unrated?

»
2 года назад, скрыть # |
 
Проголосовать: нравится +4 Проголосовать: не нравится

spent whole contest time for problem C

»
2 года назад, скрыть # |
 
Проголосовать: нравится +11 Проголосовать: не нравится

D was easier than B.

»
2 года назад, скрыть # |
 
Проголосовать: нравится 0 Проголосовать: не нравится

249172627 can anyone please tell me why Div2.C giving such error?

»
2 года назад, скрыть # |
 
Проголосовать: нравится +66 Проголосовать: не нравится

I know this is a skill issue on my part, but still — CF should really give a interactor / tester like GCJ used to. I presume me and many others just YOLO submit interactive problems without testing at this point since it is a pain to validate compared to normal problems.

»
2 года назад, скрыть # |
 
Проголосовать: нравится +4 Проголосовать: не нравится

So bad...

»
2 года назад, скрыть # |
Rev. 2  
Проголосовать: нравится 0 Проголосовать: не нравится

Can someone please say, why I'm getting rt here? 249171286

»
2 года назад, скрыть # |
 
Проголосовать: нравится -18 Проголосовать: не нравится

I had a terrible experience in this round as well as the previous, both C and D1 are true mind benders.

Signing up AB -- 15mins, wrong idea for C -- 15mins, trying D1 and getting 3 WAs -- 45mins, correct idea for C -- 25mins, work on D1 again -- 15mins

»
2 года назад, скрыть # |
 
Проголосовать: нравится +18 Проголосовать: не нравится

C is a good problem but very painful to implement. Took so much of time for me.
Good round overall, thanks harsh__h and all testers!

»
2 года назад, скрыть # |
 
Проголосовать: нравится 0 Проголосовать: не нравится

What DO you Do in Interactive Problems???? Can someone pls explain
I followed the instructions but still getting Idleness Limit Exceeded
My Code

Thanks!

»
2 года назад, скрыть # |
 
Проголосовать: нравится +5 Проголосовать: не нравится

MathForces

»
2 года назад, скрыть # |
Rev. 2  
Проголосовать: нравится +12 Проголосовать: не нравится

-100 lets go

also what happened with my C

edit: lines intersect outside of boundary. Accepted now

  • »
    »
    2 года назад, скрыть # ^ |
     
    Проголосовать: нравится 0 Проголосовать: не нравится

    You only need to ask any three out of c1,c2,c3,c4 queries. (c1,c4) and (c2,c3) are complementary equations, so each mine satisfies exactly one of these equations. On solving the three equations, you get two solutions, exactly one of which is a mine. For the final query, you can ask the distance from either of these solutions. If the distance is zero, then it is a mine. Otherwise, the other solution is a mine.

  • »
    »
    2 года назад, скрыть # ^ |
     
    Проголосовать: нравится 0 Проголосовать: не нравится
    1. First find possible points from query(1,1) , query(1,n) , query(1,m). Atmost two points are possible from this.
    2. now find distance from one of the possible points . if you get response as zero then this pair is answer or other pair will be answer.
»
2 года назад, скрыть # |
 
Проголосовать: нравится +30 Проголосовать: не нравится

 Worst day ever

»
2 года назад, скрыть # |
 
Проголосовать: нравится +19 Проголосовать: не нравится

A: Sort a[i] and the answer is a[n]+a[n-1]-a[1]-a[2].

B: We can believe that for some n0, we have dp[n]=dp[n-15]+1 for all n>=n0, and we can solve the problem by brute force for n<n0. (n0=300 can pass)

C: First query for (1, 1), let answer be d0, then there will be a mine on the line L0: x+y=2+d0. Then we query for the 2 endpoints of the intersection of L0 and the grid, let these points be A1,A2 and answer be d1,d2, then the circle (A1, d1) and (A2, d2) will have exactly 1 intersection with L0 in the grid, one of them will be the answer.

D1: If n is power of 2 we cannot do any operation. Otherwise, let r=floor(log2(n)). If 2**r<=m, then (m^n)<n, we can solve the problem in 1 operation. Otherwise, let t1=floor(log2(n-2**r)), t2=floor(log2(m)). If t2<t1, we can solve in 2 operation: n --> 2**r+m --> m. If t2==t1, we also have (m^n)<n and solve in 1 operation. If t2>t1, there's no solution.

D2: Let ppc(n) be the count of '1' in the binary representation of n. Then if ppc(n) is even, we always can do some operation to turn it into n1, n2 such that ppc(n1), ppc(n2) are odd. If ppc(n) is odd, for any n1, n2 such that (n1^n2)==n, one of ppc(n1) and ppc(n2) will be even. So If the initial ppc(n) is even we play first, otherwise we play second, and we can always let ppc(n) to be even on our turn. To win in 63 turns, we can let n1=2**r, n2=n-2**r, if the opponent choose n1 they will lose immediately, if they choose n2 the value of n will be halved.

»
2 года назад, скрыть # |
 
Проголосовать: нравится +40 Проголосовать: не нравится

I hate myself. Due to a series of stupid oversights I spent 35 minutes not seeing a single missing +1 in E, thinking that I verified all possible tests locally

»
2 года назад, скрыть # |
 
Проголосовать: нравится +4 Проголосовать: не нравится

Yes, it's interesting

»
2 года назад, скрыть # |
 
Проголосовать: нравится +9 Проголосовать: не нравится

I enjoyed thinking about problems D2 and E.

Thanks for the contest!

»
2 года назад, скрыть # |
 
Проголосовать: нравится +5 Проголосовать: не нравится

Amazing contest and Again amazing problem C. I think every contest need an interactive Problem.

»
2 года назад, скрыть # |
Rev. 2  
Проголосовать: нравится -51 Проголосовать: не нравится

What is the error in this code?

#include <bits/stdc++.h>
using namespace std;
#define int long long int
#define double long double
#define endl '\n'
#define PI 3.1415926535897932384626433832795l
const int MAX_N = 1e5 + 5;
const int MOD = 1e9 + 7;
const int INF = 1e9;
const double EPS = 1e-9;
void solve()
{
    int n, m;
    cin >> n >> m;
    cout << "? 1 1" << endl;
    cout.flush();
    int d1;
    cin >> d1;
    if (d1 == 0)
    {
        cout << "! 1 1" << endl;
        cout.flush();
        return;
    }
    cout << "? 1 " << m << endl;
    cout.flush();
    int d2;
    cin >> d2;
    if (d2 == 0)
    {
        cout << "! 1 " << m << endl;
        cout.flush();
        return;
    }
    cout << "? " << n << " " << 1 << endl;
    cout.flush();
    int d3;
    cin >> d3;
    if (d3 == 0)
    {
        cout << "! " << n << " 1" << endl;
        cout.flush();
        return;
    }

    int x1 = ((d1 + d2 - n) + 1) / 2;
    int y1 = d1 - x1;
    int x2 = ((d1 + d3 - m) + 1) / 2;
    int y2 = d1 - x2;
    if (x1 + 1 > 0 && y1 + 1 > 0)
    {
        cout << "? " << y1 + 1 << " " << x1 + 1 << endl;
        cout.flush();
        int d4;
        cin >> d4;
        if (d4 == 0)
        {
            cout << "! " << y1 + 1 << " " << x1 + 1 << endl;
        }
        else
        {
            cout << "! " << y2 + 1 << " " << x2 + 1 << endl;
        }
        cout.flush();
    }
    else
    {
        cout << "? " << y2 + 1 << " " << x2 + 1 << endl;
        cout.flush();
        int d4;
        cin >> d4;
        if (d4 == 0)
        {
            cout << "! " << y2 + 1 << " " << x2 + 1 << endl;
        }
        else
        {
            cout << "! " << y1 + 1 << " " << x1 + 1 << endl;
        }
        cout.flush();
    }
}
int32_t main()
{
    ios_base::sync_with_stdio(0);
    cin.tie(0);
    cout.tie(0);
    cin.tie(NULL);
    int t;
    cin >> t;
    while (t--)
        solve();
    return 0;
}

The code seems correct for C question, please help me find bug

»
2 года назад, скрыть # |
 
Проголосовать: нравится -9 Проголосовать: не нравится

B and C were very appropriate difficulty-wise. Good job.

»
2 года назад, скрыть # |
 
Проголосовать: нравится +1 Проголосовать: не нравится

Amazing problems and huge thanks to the author! Problems involving binary representations have always been one of my most feared type, and D1 and D2 really teached me a lot!

»
2 года назад, скрыть # |
 
Проголосовать: нравится 0 Проголосовать: не нравится

interactive forces ftw

»
2 года назад, скрыть # |
 
Проголосовать: нравится 0 Проголосовать: не нравится

Why am I getting Idleness Limit Exceeded in this Code?

»
2 года назад, скрыть # |
 
Проголосовать: нравится 0 Проголосовать: не нравится

fvck interactive

»
2 года назад, скрыть # |
 
Проголосовать: нравится +5 Проголосовать: не нравится

In problem D1 I tried to derive what those operations mean.

Let number $$$n$$$ has at least $$$2$$$ digits $$$1$$$. Then we can take prefix of these digits $$$1$$$, and either change them all to $$$0$$$ and the last to $$$1$$$, or change them all to $$$1$$$ and the last to $$$0$$$. All digits after the chosen prefix can be changed to any other without restrictions.

1000100010101010101
|   |   |
0   0   1
 000 000 [anything]

But it turned out, that the intended solution is "we can see that..."

»
2 года назад, скрыть # |
 
Проголосовать: нравится +9 Проголосовать: не нравится

Fast system testing..

»
2 года назад, скрыть # |
 
Проголосовать: нравится 0 Проголосовать: не нравится

In problem B some people have pre-computed a string of length 30. How they are approaching that problem?

»
2 года назад, скрыть # |
 
Проголосовать: нравится -9 Проголосовать: не нравится

Thank you, interactive problems made my purple handle gone.

»
2 года назад, скрыть # |
 
Проголосовать: нравится +4 Проголосовать: не нравится

After the contest, I realize that I only used 3 operations on problem C, and got choke till now.

»
2 года назад, скрыть # |
 
Проголосовать: нравится 0 Проголосовать: не нравится

B number problem is literally same as the famous coin change dp problem solution of which is also available throughout youtube and other sites. Then how come this problem is unique?People can just use the available code changing the coin denominations!

  • »
    »
    2 года назад, скрыть # ^ |
     
    Проголосовать: нравится +11 Проголосовать: не нравится

    Nope, the simple DP won't work, because the limit of $$$n$$$ is too large -- you can't create a table with $$$10^9$$$ elements. You need to find a way to calculate the answer for a large $$$n$$$, which is the core of this problem.

»
2 года назад, скрыть # |
 
Проголосовать: нравится +13 Проголосовать: не нравится

D1: 249146196 WA3

1<<j --> 1ll<<j

249177813 AC

Pain.

»
2 года назад, скрыть # |
 
Проголосовать: нравится 0 Проголосовать: не нравится

What is wrong with this code for C?? 249143051

»
2 года назад, скрыть # |
 
Проголосовать: нравится +3 Проголосовать: не нравится

Why making a invalid query in c gave WA

»
2 года назад, скрыть # |
 
Проголосовать: нравится +1 Проголосовать: не нравится

rating updates ?

»
2 года назад, скрыть # |
 
Проголосовать: нравится 0 Проголосовать: не нравится

Troll

»
2 года назад, скрыть # |
 
Проголосовать: нравится 0 Проголосовать: не нравится

why am I getting idleness limit exceeded? I have flush after every write, can this be due to my wrong approach? 249177547

»
2 года назад, скрыть # |
 
Проголосовать: нравится 0 Проголосовать: не нравится

Even though my rating is below 2100, I am somehow not included in the official standings

»
2 года назад, скрыть # |
Rev. 2  
Проголосовать: нравится 0 Проголосовать: не нравится

I have a doubt during upsolving of problem B: Can anyone let me know, what is the difference in my 2 codes and why I get WA on 3 in 1st one and Accepted on 2nd, that feels so weird why dp fails in 1st one

249181823 : My Incorrect Submission

249181977 : My Correct Submission

Lookin forward for a positive response. Thanks <3

»
2 года назад, скрыть # |
Rev. 2  
Проголосовать: нравится +2 Проголосовать: не нравится

Amazing C !! LOVE MATH. Thanks for this problem setter

  • »
    »
    2 года назад, скрыть # ^ |
     
    Проголосовать: нравится 0 Проголосовать: не нравится

    What is your solution for c?

    • »
      »
      »
      2 года назад, скрыть # ^ |
      Rev. 2  
      Проголосовать: нравится +3 Проголосовать: не нравится

      If we set the the point (1,1) as fixed and ask(1,1) then we will get the nearest point to (1,1) now one of the following (1,m) or (n,1) must have the same near point no we have

      • d1 = ask(1,1)

      • d2 = ask(1,m)

      • d3 = ask(n,1)

      let (x,y) is the our point that can be obtained from d1,d2 now ask(x,y) if the result is zero then this is the point else we have to take (x,y) with respect to ask(1,1) , ask(n,1)

      How to obtain a possible (x,y) from two queries you can solve equation of two variables form any two of the following :

      • d1 = (x-1) + (y-1)

      • d2 = (x-1) + (m-y)

      • d3 = (n-x) + (y-1)

      You can have a look on my submission that also have some comments that may help you 249181821

      upvote if that helps you <3

»
2 года назад, скрыть # |
 
Проголосовать: нравится -7 Проголосовать: не нравится

i solved B with this code , does this count as brute force ?? ps : if i am not allowed to post solution here plz inform me and i will delete it

def solve():
    n = inp()
 
    coins = [1, 3, 6, 10, 15]
    ans = float('inf')
 
    def dfs(num, index, curr):
        nonlocal ans
        if num == 0:
            ans = min(ans, curr)
            return
        if index == 0:
            ans = min(ans, curr + num)
            return
 
        c = coins[index]
        for i in range(index):
            k = num // c
            dfs(num - (c * k), i, curr + k)
            if k > 1:
                dfs(num - (c * (k - 1)), i, curr + (k - 1))
 
    for j in range(len(coins)):
        dfs(n, j, 0)
    return ans
»
2 года назад, скрыть # |
 
Проголосовать: нравится 0 Проголосовать: не нравится

For addressing Problem B, let's denote the solution as f(n). Through empirical observation, it appears that for nearly all n greater than 30, f(n) follows the recurrence relation f(n) = f(n-30) + 2. However, there are two notable exceptions: f(35) = 3, which doesn't align with f(5) + 2, and f(38) = 4, contradicting f(8) + 2.

To tackle this, I adopted the following strategy: I constructed a DP table to compute f(n) for n up to 60. For values exceeding 60, I employed the aforementioned recurrence relation. While I haven't formally proven this approach, extensive experimentation suggests its efficacy.

»
2 года назад, скрыть # |
Rev. 2  
Проголосовать: нравится 0 Проголосовать: не нравится

I have a complain. I have solve Question B & C of today's contest was succesfully run in pretests, but after the contest it's showing runtime error. & submitting the same code after this problem it is succesfully accepted. Please Check, or tell me how it's happened.

C: During Contest & after contest

B: During Contest & after contest

  • »
    »
    2 года назад, скрыть # ^ |
     
    Проголосовать: нравится +4 Проголосовать: не нравится

    Welcome to the land of undefined behavior

    In problem B when i = 30, you are accessing sieve[30] but your vector size is exactly 30 (should be > 30)

    In problem C you didn't delete the code from problem B and the same thing happens

    • »
      »
      »
      2 года назад, скрыть # ^ |
       
      Проголосовать: нравится 0 Проголосовать: не нравится

      shittt. I got it,but why there is no runtime error in test 1, it should come at the earliest testcase only. & Please tell why the same code is successfully submitted after the contest.

      • »
        »
        »
        »
        2 года назад, скрыть # ^ |
        Rev. 2  
        Проголосовать: нравится +1 Проголосовать: не нравится

        The thing about undefined behavior is your code will become completely unpredictable

        You can try submitting that same code for some more times and see that it might get different verdicts for different submissions of the same code

      • »
        »
        »
        »
        2 года назад, скрыть # ^ |
        Rev. 4  
        Проголосовать: нравится +1 Проголосовать: не нравится

        You can read more about undefined behavior here: https://en.cppreference.com/w/cpp/language/ub

        (I know that it's kinda weird that C++ doesn't immediately throw a rte on invalid array accessing, but I guess it's just a quirk of C++ that you have to deal with...)

        Also as a side note, vector has a .at() method and it is guaranteed to perform bound checking (It will throw an exception in case of invalid accesing), so you might want to use it instead of the normal [] operator

»
2 года назад, скрыть # |
Rev. 2  
Проголосовать: нравится -12 Проголосовать: не нравится

how to report cheating ? have a look.. exact same code.

249197369

[249112538](https://mirror.codeforces.com/contest/1934/submission/249112538 edit : bro I'm new. Why so many down votes :(

»
2 года назад, скрыть # |
 
Проголосовать: нравится +9 Проголосовать: не нравится

when will the rating change happen?

»
2 года назад, скрыть # |
Rev. 4  
Проголосовать: нравится +16 Проголосовать: не нравится

I was unrated even though I was purple when joining… Could someone please look into this issue? It would’ve been my best perf by far :(

»
2 года назад, скрыть # |
 
Проголосовать: нравится +1 Проголосовать: не нравится

To much interactive questions, that's not great

»
2 года назад, скрыть # |
 
Проголосовать: нравится 0 Проголосовать: не нравится

Was the name for problem A chosen as a reference to the solution? Taking the two min and two max?

»
2 года назад, скрыть # |
 
Проголосовать: нравится +1 Проголосовать: не нравится

LoL, this round was a rated for me, even though my rating was >= 2100

2024-03-02-091013

»
2 года назад, скрыть # |
 
Проголосовать: нравится +8 Проголосовать: не нравится

Feedback on the problems:

  • A: A typical easy problem, but I don't think it's interesting — just boring casework. There must be an origin if need to choose 3 elements.

  • B: I don't know why the authors set $$$1,3,6,10,15$$$, still boring.

  • C: Good problem. Maybe it's not a good choice to place an interactive problem on D2C. Many participants are familiar with it.

  • D1: Normal problem imo. It's easy to get a $$$2$$$-step solution by doing some case work, do the authors set $$$k\le 63$$$ in order to mislead?

  • D2: Nice problem. The parity is traditional in games, and combine it with popcount is cool. Also the example is strong enough to check some mistakes. (I got 10 WAs on pretest 1 because of not using long long)

  • E: Not read.

»
2 года назад, скрыть # |
 
Проголосовать: нравится 0 Проголосовать: не нравится
void solve()
{
	int n, m;
	cin >> n >> m;

	cout << "? " << 1 << " " << 1 << endl;
	int d1;
	cin >> d1;

	int bx = min(n, d1 + 1), by = max(1LL, d1 - n + 2);
	int ty = min(m, d1 + 1), tx = max(1LL, d1 - m + 2);

	cout << "? " << bx << " " << by << endl;
	int d2; cin >> d2;

	cout << "? " << tx << " " << ty << endl;
	int d3; cin >> d3;

	pair<int, int> ans1, ans2;
	ans1 = {bx - d2, by + d2};
	ans2 = {tx + d3, ty - d3};

	cout << "? " << ans1.ff << " " << ans1.ss << endl;
	int d4; cin >> d4;

	if (d4 == 0)
	{
		cout << "! " << ans1.ff << " " << ans1.ss << endl;
	}
	else
	{
		cout << "! " << ans2.ff << " " << ans2.ss << endl;
	}
}

Can someone help me to find out why it is WA?

Step 1 - Query (1, 1), we got a diagonal of cells where one mine can be present.
Step 2 - Query endpoints of the diagonal.
Step 3 - Form 2 new set of points and one of them must be an answer.
»
2 года назад, скрыть # |
 
Проголосовать: нравится +3 Проголосовать: не нравится

Why C skip? I am afraid of hack, so I make my code long. Submission

»
2 года назад, скрыть # |
 
Проголосовать: нравится 0 Проголосовать: не нравится

My first solve interactive questions in Codeforces!!!

»
2 года назад, скрыть # |
 
Проголосовать: нравится 0 Проголосовать: не нравится

@harsh__h why my code get skipped? mine whole code is written by me why plag then?

»
2 года назад, скрыть # |
 
Проголосовать: нравится 0 Проголосовать: не нравится

It's very interesting contest).