ENG  RUSTimus Online Judge
Online Judge
Problems
Authors
Online contests
About Online Judge
Frequently asked questions
Site news
Webboard
Links
Problem set
Submit solution
Judge status
Guide
Register
Update your info
Authors ranklist
Current contest
Scheduled contests
Past contests
Rules
back to board

Discussion of Problem 1452. Pascal vs. C++

ADMINS!!! WRONG TEST!!!
Posted by Alexander Prudaev 10 Jun 2006 18:25
test #1
6
7 0 0 0 0 0

my program output "2\n1 2" but gets WA#1
You are wrong. The first test is the sample for all Timus Top Coders' problems (-)
Posted by Dmitry 'Diman_YES' Kovalioff 10 Jun 2006 21:08
Re: You are wrong. The first test is the sample for all Timus Top Coders' problems (-)
Posted by WA? 10 Jun 2006 21:36
yes, you are right
my cheat program:

var N;
begin
  readln(N);
  readln(N);
  readln(N);
  if (N=0) then 10 div 0 else InfinityRecursion
end.

of course, read(N);
i can't undestand why WA
Posted by Alexander Prudaev 10 Jun 2006 21:55
i am in despair. it work! test it!
at least once for sample input it write sample output.
i don't use any random, but it gets WA1

//code deleted


Edited by author 13.06.2006 23:27
Re: i can't undestand why WA
Posted by Rizvanov++ de xXx 10 Jun 2006 22:47
ht[heap[hp].nexN&0x7FF]=hp++; //It's wrong!
Re: i can't undestand why WA
Posted by Alexander Prudaev 10 Jun 2006 23:29
ht[heap[hp].nexN&0x7FF]=hp++; //It's wrong!

why it's wrong?
it's equivalent line:

ht[heap[hp].nexN&0x7FF]=hp; hp++;
Re: i can't undestand why WA
Posted by Rizvanov++ de xXx 10 Jun 2006 23:47
ht[heap[hp].nexN&0x7FF]=hp; hp++; //It's right!
and after finding of all mistakes, you get the TLE#6...
Check the your program on these tests:
Posted by Rizvanov++ de xXx 10 Jun 2006 23:54
6
1 2 3 4 5 6

3
1 1 2

3
1 2049 4097

Edited by author 11.06.2006 05:08
Re: Check the your program on these tests:
Posted by Alexander Prudaev 12 Jun 2006 16:44
я извиняюсь, мне просто не сказать этого по английски :)
я запостил не ту версию программы, в этой есть баги.
да не в этом дело

я написал программу которая даёт правильный ответ на sample#1
причём даже в той же последовательности выводит номера.

моя программа даёт ответ:
4
4 5 1 6

но проверяющая система выносит вердикт: WA#1

я закомментировал вывод ответа
и написал в конце printf("4\n4 5 1 6");
такая программа получает WA2

вопрос: как такое может быть, что одна программа
получает WA2, а вторая WA1

я не однократно проверил что программы на
этот sample выдают один и тот же ответ

может быть причина в том, что я вывожу числа так:
for (i=0;i<chetotam;i++) printf("%d ",int_ar[i]);

мешает лишний пробел? это глупо, и маловероятно.

перед выводом нет перевода строки.

больше мне ничего в голову не приходит
Re: Check the your program on these tests:
Posted by Victor Barinov (TNU) 14 Jun 2006 03:49
На всякий случай убери лишний пробел, моя АС прога не выводит его...
I will try to help you (+)
Posted by Dmitry 'Diman_YES' Kovalioff 14 Jun 2006 10:14
Your solution is verified by a checker written by Ilya Grebnov, and no one still claimed it works wrong. I want you to send me both you WA(1) and WA(2) solutions for investigation. If some bug in the checker is found I will fix it. My e-mail for Russian-speaking programmers is dimanyes@mail.ru
Re: Check the your program on these tests:
Posted by Vladimir Yakovlev (USU) 15 Jun 2006 15:05
Your program works wrong on sample input. Test it with other compiler. For example, with Intel C++ Compiler 7.0
Re: Check the your program on these tests:
Posted by Alexander Prudaev 16 Jun 2006 19:05
I have only Visual Studio 6 & 2005
in this IDE my program writes right answer
Re: I will try to help you (+)
Posted by Alexander Prudaev 17 Jun 2006 13:58
sent. I write a new program - WA12 :)
Re: I will try to help you (+)
Posted by Alexander Prudaev 24 Jun 2006 02:42
I send. You forgot about?
I did not forget. I just tried to understand why it works wrong (+)
Posted by Dmitry 'Diman_YES' Kovalioff 24 Jun 2006 08:32
I have nothing to say. Everything is ok on my Borland C++ Builder compiler. You must contact with Vladimir Yakovlev to investigate this problem because he is C++ programmer. I have forwarded your mail to him.
Re: I did not forget. I just tried to understand why it works wrong (+)
Posted by Alexander Prudaev 26 Jun 2006 23:19
can you give me his e-mail?
you know my, sent it.
Re: Check the your program on these tests:
Posted by Wasdek 13 Nov 2013 20:04
I have same problem. On 1 test my program output:
4
6 1 5 4
but WA1. Why?