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

Автор SAKT, 12 лет назад, По-английски

Hi Codeforces.
I had just 2 problems with the last contest (Codeforces Round 260 (Div. 2)).
First, Look at this submission (7380851) for this problem (456B - Fedya and Maths). On the 11th line, there is this if:


if(s == "1") cout << 1 << endl;

It says that if the input was "1", the answer is 1. But obviously, it's wrong! If input was "1", the answer should be 0!
But this code Accepted.
Why? Really this much weak tests?!
Can anybody help that I am wrong and the code is correct or ... ?

Second, Look this submission (7382564) for this problem (456A - Laptops).
In my opinion, This code is wrong because of this line:


for (int i=0; i<n; i++) if (b[i]>b[i+1] && a[i].F!=a[i].S) {cout<<"Happy Alex"; return 0;}

It says that it never cout "Happy Alex" unless there exists an i that b[i] > b[i+1]
And if we pay attention to the way he is filling his b array:

for (int i=0; i<n; i++)
	{
		int x,y;
		cin>>x>>y;
		a[i]=make_pair(x,y);
	-->	b[i]=y;
	}

we realize that this code should output "Poor Alex" for this test because for every i, we have b[i] < b[i+1] :
3
2 1
3 2
1 3
I tried to hack him with the same test but I got an "Unsuccessful hacking attempt"
Can anybody help that I am wrong and the code is correct or ... ?

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

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

I was wrong, my bad

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

7381353 And I wonder how this got AC

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

This is my code for problem C , if we have 50,000 numbers in form ( a1 , a2 , ... ) so that ( a2 != a1 + 1 & a3 != a2 + 1 & ...) my program Set's memo for 50,000 times , and it should be TimeLimit but i got AC(i'm so lucky && weak test case )