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 1027. D++ Again

Show all messages Hide all messages

Help please! I want to solve this problem, my program pass all the tests I've found in this forum successful! Why I've got WA on test 1! TELL ME PLEASE about this test! I can't understand what is wrong in my program!

P.S. My program pass these tests correctly:

(*)     - NO
(*(*)   - YES
(**)    - YES
(*8*)*) - NO
(       - NO
())(D   - NO

(123
321)    - YES

(1+2+3
)       - YES

qe()eq  - YES
q(())q  - YES

45(798+-
)(**)()  - YES


And task example text pass successful too.


Explain me please what is test 1. I can't solve this problem without this information.
First test must be example test, so check your input/output first.

P.S. This program passed test #1

#include <stdio.h>

int main()
{
printf("YES\n");
return 0;
}


Edited by author 06.01.2008 12:52
It's very strange. My program outputs 'YES' or 'NO', it's correct. But maybe I should read input data from text file? My current program reads input data in a cycle ('while') and reads it for symbols one by one.
Here is fragment of my code which reads input data. Answer me please, is it correct?

while( not eof ) do
 begin
  read( c );

 //...
 end;
I've verified, such reading method is correct. So, I can't understand where I've done a mistake. My program outputs YES while passing the example test. But I always get WA on test 1. Give me please the first test, I must solve this problem.