755 - 487--3279

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

Moderator: Board moderators

Bug!
New poster
Posts: 24
Joined: Thu Oct 30, 2003 10:19 am

Post by Bug! » Tue Aug 03, 2004 9:05 am

Hi... I try to changed my algorithm n it can passed TLE.. But Now i've got WA for this prob.. Can u give me any critical i/o ??
Thx a lot..
Andre

watershed
New poster
Posts: 13
Joined: Thu Aug 05, 2004 9:14 am

Post by watershed » Fri Aug 06, 2004 4:05 am

I use C++ map , but I still got TLE
who can fix my program
I know my code isn't very good
thanks for your help.....

[cpp] CUT ^^"... [/cpp]
Last edited by watershed on Sat Aug 07, 2004 5:10 am, edited 1 time in total.

Andrew Neitsch
New poster
Posts: 43
Joined: Fri Jun 25, 2004 9:37 pm

Post by Andrew Neitsch » Fri Aug 06, 2004 7:23 pm

Why on earth are you using a map<char,char> to get the value of each letter? That's insane. Use a switch statement.

Do

map<int,int> phonenumbercount;

When you have the phone number as an INT (which you don't use any C++, ever, to figure out), do phonenumbercount[number]++.

The print your phone number with printf("%03d-%04d",n/10000,n%10000);

The only thing you need from C++ is a single map, indicating how many of each phone number there are, and an iterator to step through them afterwards.

watershed
New poster
Posts: 13
Joined: Thu Aug 05, 2004 9:14 am

Post by watershed » Sat Aug 07, 2004 5:08 am

Andrew Neitsch wrote:Why on earth are you using a map<char,char> to get the value of each letter? That's insane. Use a switch statement.
I think fast for the way , but actually I wrong :cry:
Do
map<int,int> phonenumbercount;
When you have the phone number as an INT (which you don't use any C++, ever, to figure out), do phonenumbercount[number]++.
The print your phone number with printf("%03d-%04d",n/10000,n%10000);
The only thing you need from C++ is a single map, indicating how many of each phone number there are, and an iterator to step through them afterwards.
thanks your correction and help , I got AC..... :D

User avatar
tetuya
New poster
Posts: 14
Joined: Thu May 27, 2004 2:31 pm

755 WA 487-3279

Post by tetuya » Thu Aug 26, 2004 2:28 pm

I've gotten WA for long time. :(
I tried test input on this board and mine.
please tell me my mistake or some advice.
[cpp]

Accepted nasty my code is cleared.

And Thank you Hiloshi!

[/cpp]

thank you :D
Last edited by tetuya on Fri Aug 27, 2004 9:29 am, edited 5 times in total.

hiloshi
New poster
Posts: 20
Joined: Fri Aug 27, 2004 8:15 am
Location: Kanagawa, Japan

This is My First Replay

Post by hiloshi » Fri Aug 27, 2004 8:34 am

hi tetuya!
I think you had take mistake in func method.

[cpp]
if(counter>0)
printf("%03d-%04d %d\n",tmp/10000,tmp%10000,++counter);

}
skip:;
if(duple) cout << "No duplicates." << endl;
}
[/cpp]

Label skip and follow code is executed any case.
You should type "return" before label skip:

Check this input

1

2
1111111
1111111
--------------
correct output is
111-1111 2

but your program will output
111-1111 2
No duplicates.

User avatar
tetuya
New poster
Posts: 14
Joined: Thu May 27, 2004 2:31 pm

Post by tetuya » Fri Aug 27, 2004 9:25 am

No soon had I followed your Advice and submitted,than I got Accepted ! :D

Thank you for your Accurate Advice ! :wink:

My heart was saved (^-')b
sorry for my poor English.

User avatar
tetuya
New poster
Posts: 14
Joined: Thu May 27, 2004 2:31 pm

Post by tetuya » Sat Aug 28, 2004 3:53 am

Hello emka.
It's a bug. :wink:

Code: Select all

else if ( s[i] == 'O' || s[i] == 'N' || s[i] == 'O' || s[i] == '6' )
good luck :D
sorry for my poor English.

User avatar
tetuya
New poster
Posts: 14
Joined: Thu May 27, 2004 2:31 pm

Post by tetuya » Sun Aug 29, 2004 9:03 pm

Hi 20717TZ.

string is slow in case of this problem.
you could handle it with primitive measure. :)
sorry for my poor English.

Ivo Sluganovic
New poster
Posts: 12
Joined: Tue Sep 21, 2004 10:08 pm

755 -> how is this possible??

Post by Ivo Sluganovic » Sun Oct 31, 2004 3:57 pm

How is it possible that for the following code,
OJ says it uses only 64 KB when it should use at least 0.3 MB?

It also says WA in 0.00 seconds.

[c]
[/c]

I don't understand this.

Ivo Sluganovic
New poster
Posts: 12
Joined: Tue Sep 21, 2004 10:08 pm

Post by Ivo Sluganovic » Sun Oct 31, 2004 9:48 pm

I found the error.

User avatar
Ali Arman Tamal
Learning poster
Posts: 76
Joined: Sat Jan 15, 2005 5:04 pm
Location: Dhaka
Contact:

755 [487-3279] Why WA ! :-(

Post by Ali Arman Tamal » Tue Feb 15, 2005 6:41 pm

Why OJ gives WA :-? Please help me ...

Code: Select all

CUT AFTER AC
Please Help !
Last edited by Ali Arman Tamal on Fri Mar 18, 2005 5:18 pm, edited 1 time in total.

kenneth
New poster
Posts: 24
Joined: Wed Mar 02, 2005 12:29 am

755

Post by kenneth » Wed Mar 02, 2005 12:34 am

Would anyone be able to provide some input and output with lots of data in there as i think my program is correct, but keep getting WA =p

Thanks alot

Raj Ariyan
Learning poster
Posts: 70
Joined: Sat Feb 05, 2005 9:38 am
Location: Gurukul

Post by Raj Ariyan » Fri Mar 04, 2005 12:00 pm

Hi,
You can check this input. Hope it helps. Good luck

Input :-
4

5
-0-0-0-0-1-0-1
IYSDS-1-1-
MMDPS-22
0000A--AA
-----AMSAM--AA

6
3-10-10-1A
6464642
ASACCS5
-1111115
F101010
888-1200

5
-5-5-9-7-4-9-2
2947955
GO-HOME-1
HOME-123
12344-AA

9
-123-5657
12----12121
ABBCSS1
12112-A--B
ABBC-123
-1-2----3AABC
KKSDS-AA
ALNKNDS
----KKJ1234
Output:-
No duplicates.
No duplicates.
No duplicates.
No duplicates.
Last edited by Raj Ariyan on Tue Mar 08, 2005 2:52 pm, edited 1 time in total.
Some Love Stories Live Forever ....

kenneth
New poster
Posts: 24
Joined: Wed Mar 02, 2005 12:29 am

Post by kenneth » Fri Mar 04, 2005 2:12 pm

I think the 3rd test case is wrong since the number of phone numbers is wrong.

Furthermore, for the last input, how come the output is as such?

Post Reply

Return to “Volume 7 (700-799)”