Page 4 of 8
Posted: Tue Aug 03, 2004 9:05 am
by Bug!
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
Posted: Fri Aug 06, 2004 4:05 am
by watershed
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]
Posted: Fri Aug 06, 2004 7:23 pm
by Andrew Neitsch
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.
Posted: Sat Aug 07, 2004 5:08 am
by watershed
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
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.....

755 WA 487-3279
Posted: Thu Aug 26, 2004 2:28 pm
by tetuya
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

This is My First Replay
Posted: Fri Aug 27, 2004 8:34 am
by hiloshi
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.
Posted: Fri Aug 27, 2004 9:25 am
by tetuya
No soon had I followed your Advice and submitted,than I got Accepted !
Thank you for your Accurate Advice !
My heart was saved (^-')b
Posted: Sat Aug 28, 2004 3:53 am
by tetuya
Hello emka.
It's a bug.
Code: Select all
else if ( s[i] == 'O' || s[i] == 'N' || s[i] == 'O' || s[i] == '6' )
good luck

Posted: Sun Aug 29, 2004 9:03 pm
by tetuya
Hi 20717TZ.
string is slow in case of this problem.
you could handle it with primitive measure.

755 -> how is this possible??
Posted: Sun Oct 31, 2004 3:57 pm
by Ivo Sluganovic
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.
Posted: Sun Oct 31, 2004 9:48 pm
by Ivo Sluganovic
I found the error.
755 [487-3279] Why WA ! :-(
Posted: Tue Feb 15, 2005 6:41 pm
by Ali Arman Tamal
Why OJ gives WA

Please help me ...
Please Help !
755
Posted: Wed Mar 02, 2005 12:34 am
by kenneth
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
Posted: Fri Mar 04, 2005 12:00 pm
by Raj Ariyan
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.
Posted: Fri Mar 04, 2005 2:12 pm
by kenneth
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?