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 1059. Expression

How to get AC
Posted by OleGG 18 Jun 2009 22:55
Well, everybody here knows, that best scheme is 0(X*i+) . But lot of us get WA1. I've found why we fail like this. The last line of output shouldn't contain line break, so I've changed string "X\n*\ni\n+\n" to "\nX\n*\ni\n+" and got AC.
Re: How to get AC
Posted by unlucky [Vologda SPU] 2 Feb 2010 20:28
OMG. It is very strange :)
      for (int i = 1; i <=n; i++ ){
         out.printf("X%n*%n%d%n+%n",i);
      }
(Java)