488 - Triangle Wave

All about problems in Volume 4. If there is a thread about your problem, please use it. If not, create one with its number in the subject.

Moderator: Board moderators

Post Reply
Oronno
New poster
Posts: 21
Joined: Sun Jul 09, 2006 1:42 pm
Location: Dhaka
Contact:

PE why???

Post by Oronno »

I have done this proble, and there is no space after last output.
But i still getr the presentation error.
Why???????
check it.

Code: Select all

Code has removed
Last edited by Oronno on Sun Feb 04, 2007 11:25 am, edited 1 time in total.
I like programming but i am so lazy to do it...
helloneo
Guru
Posts: 516
Joined: Mon Jul 04, 2005 6:30 am
Location: Seoul, Korea

Post by helloneo »

You forgot '\n' at the end..
Just try to follow TripShock's output format above..
Oronno
New poster
Posts: 21
Joined: Sun Jul 09, 2006 1:42 pm
Location: Dhaka
Contact:

thanks

Post by Oronno »

Ohhh...thanks.
I get AC.
Last edited by Oronno on Fri Feb 29, 2008 12:16 pm, edited 1 time in total.
I like programming but i am so lazy to do it...
john_locke
New poster
Posts: 13
Joined: Sat Oct 07, 2006 6:42 pm
Contact:

Post by john_locke »

this problem drove me toward madness i got 20 presentation errors from judge tried all the combinations after reading previous post so plzzz help me
DELETED after -AC
thanx



Waddle
New poster
Posts: 22
Joined: Thu Jan 25, 2007 3:54 pm
Location: Taiwan
Contact:

488 Why PE

Post by Waddle »

The code has been removed.
Last edited by Waddle on Thu Mar 01, 2007 1:21 pm, edited 1 time in total.
helloneo
Guru
Posts: 516
Joined: Mon Jul 04, 2005 6:30 am
Location: Seoul, Korea

Post by helloneo »

Don't make a new thread if there is one already..

Read more carefully..
http://online-judge.uva.es/board/viewtopic.php?t=10991
Waddle
New poster
Posts: 22
Joined: Thu Jan 25, 2007 3:54 pm
Location: Taiwan
Contact:

Post by Waddle »

I'm sorry that I can only understand C.
But I thought getting a PE has no concern with thread.
Debashis Maitra
Learning poster
Posts: 62
Joined: Sun Jul 09, 2006 8:31 am
Location: University of Dhaka
Contact:

Post by Debashis Maitra »

try sample input output of that link

try to print your output in a file

this may help you

you can easly find old threads using search
Akash chhoyar swopno
Dream to touch the sky
Waddle
New poster
Posts: 22
Joined: Thu Jan 25, 2007 3:54 pm
Location: Taiwan
Contact:

Post by Waddle »

MY INPUT:
2

3
2

4
3


MY OUTPUT:
1\n
22\n
333\n
22\n
1\n
\n
1\n
22\n
333\n
22\n
1\n
\n
1\n
22\n
333\n
4444\n
333\n
22\n
1\n
\n
1\n
22\n
333\n
4444\n
333\n
22\n
1\n
\n
1\n
22\n
333\n
4444\n
333\n
22\n
1\n
\n
linux
Learning poster
Posts: 56
Joined: Sat Jul 01, 2006 12:21 pm
Location: CA-95054
Contact:

Post by linux »

There's an extra newline. Omit it as stated in problem. Hope AC. :D
Solving for fun..
Waddle
New poster
Posts: 22
Joined: Thu Jan 25, 2007 3:54 pm
Location: Taiwan
Contact:

Post by Waddle »

Like this?

\n
1\n
22\n
333\n
22\n
1\n
\n
linux
Learning poster
Posts: 56
Joined: Sat Jul 01, 2006 12:21 pm
Location: CA-95054
Contact:

488 get ac

Post by linux »

Yes. All your outputs are ok except the last.

Code: Select all

NOTE: There is a blank line after each separate waveform, excluding the last one.
Solving for fun..
Waddle
New poster
Posts: 22
Joined: Thu Jan 25, 2007 3:54 pm
Location: Taiwan
Contact:

Post by Waddle »

I still got PE
I almost gave up.
I think i have a blank line at the end of the last triangle.
Did you see my output ?

The Last:
1\n
22\n
333\n
22\n
1\n
\n --->you mean this,right?

Thank you.
linux
Learning poster
Posts: 56
Joined: Sat Jul 01, 2006 12:21 pm
Location: CA-95054
Contact:

Post by linux »

No, the output would be:

Code: Select all

1\n 
22\n 
333\n 
22\n 
1\n 
Also check this:

Code: Select all

INPUT: 
2 

3 
2 

4 
3 


OUTPUT: 
1\n 
22\n 
333\n 
22\n 
1\n 
\n 
1\n 
22\n 
333\n 
22\n 
1\n 
\n 
1\n 
22\n 
333\n 
4444\n 
333\n 
22\n 
1\n 
\n 
1\n 
22\n 
333\n 
4444\n 
333\n 
22\n 
1\n 
\n 
1\n 
22\n 
333\n 
4444\n 
333\n 
22\n 
1\n
Solving for fun..
Waddle
New poster
Posts: 22
Joined: Thu Jan 25, 2007 3:54 pm
Location: Taiwan
Contact:

Post by Waddle »

I GOT AC~~~
thanks everybody~
Post Reply

Return to “Volume 4 (400-499)”