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++

Alexander Prudaev ADMINS!!! WRONG TEST!!! [17] // Problem 1452. Pascal vs. C++ 10 Jun 2006 18:25
test #1
6
7 0 0 0 0 0

my program output "2\n1 2" but gets WA#1
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);
Alexander Prudaev i can't undestand why WA [14] // Problem 1452. Pascal vs. C++ 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
Rizvanov++ de xXx Re: i can't undestand why WA [13] // Problem 1452. Pascal vs. C++ 10 Jun 2006 22:47
ht[heap[hp].nexN&0x7FF]=hp++; //It's wrong!
Alexander Prudaev Re: i can't undestand why WA [12] // Problem 1452. Pascal vs. C++ 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++;
Rizvanov++ de xXx Re: i can't undestand why WA // Problem 1452. Pascal vs. C++ 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...
Rizvanov++ de xXx Check the your program on these tests: [10] // Problem 1452. Pascal vs. C++ 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
Alexander Prudaev Re: Check the your program on these tests: [9] // Problem 1452. Pascal vs. C++ 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]);

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

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

больше мне ничего в голову не приходит
Victor Barinov (TNU) Re: Check the your program on these tests: // Problem 1452. Pascal vs. C++ 14 Jun 2006 03:49
На всякий случай убери лишний пробел, моя АС прога не выводит его...
Dmitry 'Diman_YES' Kovalioff I will try to help you (+) [4] // Problem 1452. Pascal vs. C++ 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
Alexander Prudaev Re: I will try to help you (+) // Problem 1452. Pascal vs. C++ 17 Jun 2006 13:58
sent. I write a new program - WA12 :)
Alexander Prudaev Re: I will try to help you (+) [2] // Problem 1452. Pascal vs. C++ 24 Jun 2006 02:42
I send. You forgot about?
Dmitry 'Diman_YES' Kovalioff I did not forget. I just tried to understand why it works wrong (+) [1] // Problem 1452. Pascal vs. C++ 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.
can you give me his e-mail?
you know my, sent it.
Vladimir Yakovlev (USU) Re: Check the your program on these tests: [1] // Problem 1452. Pascal vs. C++ 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
Alexander Prudaev Re: Check the your program on these tests: // Problem 1452. Pascal vs. C++ 16 Jun 2006 19:05
I have only Visual Studio 6 & 2005
in this IDE my program writes right answer
I have same problem. On 1 test my program output:
4
6 1 5 4
but WA1. Why?