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

Автор priyanshu_x, история, 5 лет назад, По-английски

In problem C, I wrote a solution that showed me the wrong answer on test case

For Those who don't know what is problem C
38 
6 9 6 6 6 2 8 6 6 8 5 4 6 6 9 0 0 4 4 3 6 0 0 5 4 5 0 8 4 6 4 8 0 7 5 0 0 8

My first code output 196, AC code output 210

My first code lexicographically largest array

9 8 7 6 9 8 6 8 6 5 4 3 2 0 8 6 5 4 0 8 6 5 4 0 6 5 4 0 6 4 0 6 4 0 6 0 6 0

AC code lexicographically largest array

9 8 7 6 5 4 3 2 0 9 8 6 5 4 0 8 6 5 4 0 8 6 5 4 0 8 6 4 0 6 6 6 4 0 6 0 6 0

I was amazed as I was sure with my logic, but after (successfully wasting more than 1.5 hours) I changed my approach and it got AC. After the contest was over I was thinking why my first solution was wrong and stress tested it. I got a test case

4
2 1 2 3

My first code is giving the lexicographically largest array as 3 2 2 1 whereas my AC code is giving 3 2 1 2, I am completely confused as the first output is better than the second one. Please help!

I am attaching my first code here.

Code

Sorry for my bad English.

  • Проголосовать: нравится
  • +34
  • Проголосовать: не нравится

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

The test cases were wrong. Setter solution was wrong.

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

Yeah I was also getting same output (196) on the testcase you mentioned ...

Still wondering if my logic is wrong or the testcase is wrong.

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

Yeah I was getting the same output of 196 on this testcase,was not left with much time to guess what the setter's brain was thinking.

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

This testcase wasted 2 hours of my time. And then after the contest ended I saw the mail (who checks mail during contests, the announcement could have easily come up in the contest page itself) that question B's testcases have been updated and will be rechecked. My last submission includes the hardcoded a=0, b=0 case which will be wrong after recheck. I am completely disappointed with this year's codagon. Last year it was lot of fun and problems were of good quality.

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

I faced literally the same problem