11286 - Conformity

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

Moderator: Board moderators

nymo
Experienced poster
Posts: 149
Joined: Sun Jun 01, 2003 8:58 am
Location: :)

11286 - Conformity

Post by nymo » Mon Oct 01, 2007 4:52 pm

What is the best data structure in this problem to look for duplication? I don't know STL stuff, I only know basic C code... Any suggestion is welcome.

sclo
Guru
Posts: 519
Joined: Mon Jan 23, 2006 10:45 pm
Location: Vancouver, BC, Canada
Contact:

Post by sclo » Mon Oct 01, 2007 7:31 pm

study stl map and vector

ayon
Experienced poster
Posts: 161
Joined: Tue Oct 25, 2005 8:38 pm
Location: buet, dhaka, bangladesh

Post by ayon » Mon Oct 01, 2007 8:00 pm

stl is very useful for this problem, though i used Trie as the data structure
ishtiak zaman
----------------
the world is nothing but a good program, and we are all some instances of the program

sapnil
Experienced poster
Posts: 106
Joined: Thu Apr 26, 2007 2:40 pm
Location: CSE-SUST
Contact:

Post by sapnil » Tue Oct 02, 2007 12:23 pm

Use stracture with array and then sort the array in dictionary order,then
search.
This is needed for solving this problem.

Thanks
Keep posting
Sapnil

nymo
Experienced poster
Posts: 149
Joined: Sun Jun 01, 2003 8:58 am
Location: :)

Thanks...

Post by nymo » Tue Oct 02, 2007 2:23 pm

I thought of trie, too. I 'll try to implement this. to sclo, thanks for this suggestion. I will try map, vector and other STL stuff. thanks all for helping me.
regards,
nymo

nymo
Experienced poster
Posts: 149
Joined: Sun Jun 01, 2003 8:58 am
Location: :)

Post by nymo » Fri Oct 05, 2007 12:12 pm

I get WA for this problem, due to the current status of the new server, I don't know whether it is really WA or other errors shown as WA. I 've tried some test cases and got correct answer. I 've tried to implement a trie. Can you people help me? thanks.
[EDIT] I misunderstood the problem, ACC now. I 've implemented trie. thanks all.

darkos32
New poster
Posts: 27
Joined: Tue Jul 25, 2006 8:10 am
Location: Indonesia
Contact:

asd

Post by darkos32 » Mon Oct 08, 2007 11:19 am

hi,i got WA...can anyone give me the testcase please ?



thanks.

sapnil
Experienced poster
Posts: 106
Joined: Thu Apr 26, 2007 2:40 pm
Location: CSE-SUST
Contact:

Post by sapnil » Tue Oct 09, 2007 8:03 am

Try this case
Hope it will works

Code: Select all

Input:
4
100 101 102 103 104
104 103 100 101 102
200 201 202 203 204
204 203 200 201 202
5
100 101 102 103 104
100 101 102 103 104
100 101 102 103 104
100 101 102 103 104
100 101 102 103 104
5
100 101 102 103 104
100 101 102 103 104
100 101 102 103 104
100 101 102 103 104
100 101 102 103 105
Output:
2
0
4
Thanks
Keep posting
Sapnil

mmonish
Experienced poster
Posts: 109
Joined: Sun Mar 11, 2007 2:55 pm
Location: SUST

Post by mmonish » Tue Oct 09, 2007 9:35 am

>>sapnil
r u sure that these outputs r correct??
My AC code gives the following output.

Code: Select all

4
5
4

darkos32
New poster
Posts: 27
Joined: Tue Jul 25, 2006 8:10 am
Location: Indonesia
Contact:

asd

Post by darkos32 » Tue Oct 09, 2007 11:06 am

emm..which is the answer ?

now my code give me :

Code: Select all

4
5
4
but still got WA...any testcase again ?
does 0 is an input ?



thanks..

darkos32
New poster
Posts: 27
Joined: Tue Jul 25, 2006 8:10 am
Location: Indonesia
Contact:

Post by darkos32 » Tue Oct 09, 2007 11:26 am

i know now,my array size is too small...but now i got TLE...

sapnil
Experienced poster
Posts: 106
Joined: Thu Apr 26, 2007 2:40 pm
Location: CSE-SUST
Contact:

Post by sapnil » Wed Oct 17, 2007 1:29 pm

vgjgfjg
"Dream Is The Key To Success"

@@@ Jony @@@

sapnil
Experienced poster
Posts: 106
Joined: Thu Apr 26, 2007 2:40 pm
Location: CSE-SUST
Contact:

Post by sapnil » Wed Oct 17, 2007 1:33 pm

>>sapnil
r u sure that these outputs r correct??
My AC code gives the following output.

Code: Select all

4 
5 
4
To mmonish

Yes me AC code returns this output!

Thanks
Keep posting
Sapnil
"Dream Is The Key To Success"

@@@ Jony @@@

Shafaet_du
Experienced poster
Posts: 147
Joined: Mon Jun 07, 2010 11:43 am
Location: University Of Dhaka,Bangladesh
Contact:

Re: 11286 - Conformity

Post by Shafaet_du » Fri Jun 24, 2011 2:04 pm

Read the data as strings,sort them,concatanate them placing separators in middle. than use map. simple

User avatar
uDebug
A great helper
Posts: 475
Joined: Tue Jul 24, 2012 4:23 pm

Re: 11286 - Conformity

Post by uDebug » Fri Feb 07, 2014 9:31 am

Here's some input / output I found useful during testing / debugging.

Input:

Code: Select all

3
100 101 102 103 488
100 200 300 101 102
103 102 101 488 100
3
200 202 204 206 208
123 234 345 456 321
100 200 300 400 444
10
100 200 300 400 444
444 100 200 300 400 
100 300 400 444 200
100 200 400 444 300
100 444 200 300 400 
111 222 333 444 455
222 333 444 455 111
222 333 455 111 444
455 111 222 333 444 
111 222 444 455 333
16
100 200 300 400 444
444 100 200 300 400 
100 300 400 444 200
100 200 400 444 300
100 444 200 300 400 
111 222 333 444 455
222 333 444 455 111
222 333 455 111 444
455 111 222 333 444 
111 222 444 455 333
123 321 222 333 444
444 123 321 222 333 
321 123 222 333 444
222 123 321 333 444
333 123 321 222 444
123 444 321 222 333 
4
123 222 388 488 188
299 222 388 488 188
466 299 222 388 488
466 299 222 388 450
0
AC Output:

Code: Select all

2
3
10
6
4
Check input and AC output for over 7,500 problems on uDebug!

Find us on Facebook. Follow us on Twitter.

Post Reply

Return to “Volume 112 (11200-11299)”