488 - PRESENTATION ERROR!

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

Moderator: Board moderators

Re: Stupid problem........

Postby helloneo » Tue Feb 26, 2008 8:59 am

Obaida wrote:Thank you......488.... it give me at least 20 or more wA.... some one please help me..........please.........


You are printing an extra '\n' at the first line of the output.. :-)


PS. Remove you code after AC.. :-)
helloneo
Guru
 
Posts: 516
Joined: Mon Jul 04, 2005 6:30 am
Location: Seoul, Korea

stupid......problem.

Postby Obaida » Tue Feb 26, 2008 11:49 am

Now look at my output.... I thik thats good.... but still WA
Code: Select all
2\n
\n
3\n
2\n
1\n
22\n
333\n
22\n
1\n
\n
1\n
22\n
333\n
22\n
1\n
\n
3\n
2\n
1\n
22\n
333\n
22\n
1\n
\n
1\n
22\n
333\n
22\n
1\n

try_try_try_try_&&&_try@try.com
This may be the address of success.
Obaida
A great helper
 
Posts: 380
Joined: Wed Jan 16, 2008 6:51 am
Location: (BUBT) Dhaka,Bagladesh.

Re: stupid......problem.

Postby helloneo » Tue Feb 26, 2008 12:09 pm

Obaida wrote:Now look at my output.... I thik thats good.... but still WA


Actually your code prints output this way.. :-)

\n
2\n
\n
3\n
2\n
1\n
22\n
333\n
22\n
1\n
\n
1\n
22\n
333\n
22\n
1\n
\n
3\n
2\n
1\n
22\n
333\n
22\n
1\n
\n
1\n
22\n
333\n
22\n
1\n
helloneo
Guru
 
Posts: 516
Joined: Mon Jul 04, 2005 6:30 am
Location: Seoul, Korea

Strange....

Postby Obaida » Tue Feb 26, 2008 12:36 pm

I think I can't read you.... still WA....
look at my code...... what should be edited...
Code: Select all
Removed
Last edited by Obaida on Sat Mar 01, 2008 10:58 am, edited 1 time in total.
try_try_try_try_&&&_try@try.com
This may be the address of success.
Obaida
A great helper
 
Posts: 380
Joined: Wed Jan 16, 2008 6:51 am
Location: (BUBT) Dhaka,Bagladesh.

Postby AcmNightivy » Thu Feb 28, 2008 4:18 pm

I change in using stdio..but still WA..Help!!Thanks!!
Code: Select all
#include <stdio.h>

int main ()
{
   int i, j, k;
   int caseNum;
   int a, f;
   char num[10][10] = {"", "1", "22", "333", "4444", "55555", "666666", "7777777", "88888888", "999999999"};

   scanf ("%d", &caseNum);

   for (i = 0; i < caseNum; i++)
   {
      scanf ("%d%d", &a, &f);

      for (j = 0; j < f; j++)
      {
         for (k = 1; k <= a; k++)
         {
            printf ("%s\n", num[k]);
         }
         k = k - 2;
         for (; k >= 1; k--)
         {
            printf ("%s\n", num[k]);
         }

         //if (i != caseNum - 1)
         printf ("\n");
      }   
   }
   return 0;
}
AcmNightivy
New poster
 
Posts: 36
Joined: Tue Dec 04, 2007 10:20 am

Still WA....

Postby Obaida » Sat Mar 01, 2008 6:07 am

Some one please could tell me from my above code... that where is the extra \n in my program.... I couldn't find it.... But still I had to belive because I am getting WA in this problem...... :cry:
try_try_try_try_&&&_try@try.com
This may be the address of success.
Obaida
A great helper
 
Posts: 380
Joined: Wed Jan 16, 2008 6:51 am
Location: (BUBT) Dhaka,Bagladesh.

Postby CSEDU_1323 » Sat Mar 01, 2008 9:52 am

hi,
Obaida, helloneo trace out ur error u print a extra new line in d front

use if(l>= 1 &&l<n)
instead if(l>= 0 &&l<n)
will do ur work

&&

u don't need 2 take test case more than once

HOPE THIS HELPS
--- B HAPPY & KEEP SMILING ------
CSEDU_1323
New poster
 
Posts: 10
Joined: Mon Feb 25, 2008 8:22 pm
Location: Dhaka, Bangladesh.

Yes...

Postby Obaida » Sat Mar 01, 2008 12:12 pm

Thank You very much.....! I got Accepted..... But in the instruction of the program it is mentoned that we had to print a blank line after test case....
But afterall thank you.... very much....
try_try_try_try_&&&_try@try.com
This may be the address of success.
Obaida
A great helper
 
Posts: 380
Joined: Wed Jan 16, 2008 6:51 am
Location: (BUBT) Dhaka,Bagladesh.

Re: 488 - PRESENTATION ERROR!

Postby pwilt » Thu Apr 17, 2008 3:03 am

I seem to be getting the answer correct (tried to follow the formatting in the other posts to the letter) but I'm still getting WA from the judge. Can anybody point out something that I've missed?

Code: Select all
#include <iostream>
#include <string>

using namespace std;

int main(){
    int tc;
    cin >> tc;
    string nums[9] = {"1","22","333","4444","55555","666666","7777777","88888888","999999999"};
   
    short amp, freq, j;
   
    for (int i = 1; i <= tc; i++){
        cin >> amp;
        cin >> freq;
       
        for (short k = 1; k <= freq; k++){
            for (j = 0; j < amp; j++){
                cout << nums[j] << endl;
            }
            for (j -= 2; j >= 0; j--){
                cout << nums[j] << endl;
            }
            if (k < freq){
                cout << endl;
            }
        }
        if (i < tc){
            cout << endl;
        }
    }
}
pwilt
New poster
 
Posts: 2
Joined: Wed Apr 09, 2008 6:59 pm

Re: 488 - PRESENTATION ERROR!

Postby pwilt » Sat Apr 19, 2008 3:54 am

Bump?
pwilt
New poster
 
Posts: 2
Joined: Wed Apr 09, 2008 6:59 pm

Re: 488 - PRESENTATION ERROR!

Postby Obaida » Tue Apr 22, 2008 9:45 am

But this is Actually WA...!
Not PE... :o
In "int main()" type you should use "return 0;"
But you didn't do it.
try_try_try_try_&&&_try@try.com
This may be the address of success.
Obaida
A great helper
 
Posts: 380
Joined: Wed Jan 16, 2008 6:51 am
Location: (BUBT) Dhaka,Bagladesh.

Re: 488 - PRESENTATION ERROR!

Postby davidbuzatto » Wed Dec 28, 2011 4:50 pm

Hello everybody,

I getting a WA, but I really don't understand why.

My input:
Code: Select all
6

3
2

1
0

1
1

2
2

1
0

3
3


My output:
Code: Select all
1
22
333
22
1

1
22
333
22
1

1

1
22
1

1
22
1

1
22
333
22
1

1
22
333
22
1

1
22
333
22
1 (no \n)


Thank you very much!
davidbuzatto
New poster
 
Posts: 1
Joined: Wed Dec 28, 2011 4:47 pm

Re: 488 - PRESENTATION ERROR!

Postby omarking06 » Fri Mar 15, 2013 5:50 pm

Whats wrong with this code please !!! .. i checked the I/O !! and nothing !!
I got WA!
Code: Select all
#include <iostream>
using namespace std;

int main()
{
   int t,a,f;
   cin>>t;
   for (int i=0;i<t;i++)
   {
      cin>>a>>f;
      for (int i=0;i<f;i++)
      {
         for (int j=1;j<=a;j++)
         {
            cout<<j;
            for (int k=1;k<j;k++)
            {
               cout<<j;
            }
            cout<<endl;
         }

         for (int x=a-1;x>0;x--)
         {
            cout<<x;
            for (int y=x;y>1;y--)
            {
               cout<<x;
            }
            cout<<endl;
         }
         if (i==f-1) continue;
         cout<<endl;
      }   
   }
}
omarking06
New poster
 
Posts: 6
Joined: Fri Mar 15, 2013 1:07 am

Re: 488 - PRESENTATION ERROR!

Postby brianfry713 » Fri Mar 15, 2013 9:11 pm

Input:
Code: Select all
2

3
2

4
3
Correct output:
Code: Select all
1
22
333
22
1

1
22
333
22
1

1
22
333
4444
333
22
1

1
22
333
4444
333
22
1

1
22
333
4444
333
22
1
brianfry713
Guru
 
Posts: 1861
Joined: Thu Sep 01, 2011 9:09 am
Location: San Jose, CA, USA

Re: 488 - PRESENTATION ERROR!

Postby omarking06 » Sat Mar 16, 2013 2:01 am

here is my I/O :
Code: Select all
2
3
2
1
22
333
22
1

1
22
333
22
1
4
3
1
22
333
4444
333
22
1

1
22
333
4444
333
22
1

1
22
333
4444
333
22
1

i dont see anything wrong !!
omarking06
New poster
 
Posts: 6
Joined: Fri Mar 15, 2013 1:07 am

PreviousNext

Return to Volume IV

Who is online

Users browsing this forum: No registered users and 1 guest