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

Strange Things
Posted by Dmitry "Logam" Kobelev [TSOGU] 24 Jul 2008 12:05
I solved this problem when I was awful newbie. Some days ago I tried to help my friend with it. I realized that my AC code is terrible and absolutely wrong))) But it's still AC.
It made us burst out laughing)))))
There are no clarifications about intersection of comments and arithmetical expressions in this problem.
Here are some test my AC code produce:

(()
YES

(1)(*
YES

(-)+
YES

If rejudge occur I'd like to see neat statement to rewrite it correctly)
Re: Strange Things
Posted by Sandro (USU) 25 Jul 2008 02:07
1) Answer is NO. Brackets have to be balanced.
2) Answer is NO. Comment is not closed.
3) Answer is YES. All correct.

These tests and some more were added. About 140 solutions lost AC, but tests are still weak in this problem. Maybe new tests will be added.
Re: Strange Things
Posted by svr 11 Nov 2008 20:56
I think that Ac prog must be terrible and absolutely wrong because with n=10000 this problem impossible to solve.
We must consider all possible unitersecting sets of segments of commentries and after apply to residues arithmetics expression rules. This collection of sets of commentry segments very big.
Standard right way- recursion: We extract one possible
commentry segment and apply same algo to residue.

AC says me that authors used additional unsaid condition:
each commentry '(*' ends on the FIRST closing '*)'.
Without this I considered "(*)*)*)" As YES But now it NO.
With additional condition the problem became very simple.

Edited by author 12.11.2008 10:59