11348 - Exhibition

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

Moderator: Board moderators

amin__
New poster
Posts: 10
Joined: Thu Jul 01, 2010 10:44 am

11348 - Exibition

Post by amin__ » Thu Apr 21, 2011 6:29 pm

can anybody give me some critical cases for this problem?? Um feeling helpless by getting WA for many times :(

Mehadi
New poster
Posts: 18
Joined: Sun Jan 24, 2010 11:17 am

Re: 11348 - Exibition

Post by Mehadi » Mon Aug 15, 2011 10:00 pm

I think this is the Key line of this problem "The percent of whole income that i-th friend will get is equal to the part of his unique stamp's type."
I got several times WA but finally got the thing & get ACC.
Try this I/O:
Input:

Code: Select all

3
3
3 1 1 2
2 4 5
3 4 2 6
3
3 2 2 2
2 4 4
3 5 5 5
3
3 0 1 0
2 4 10000
3 4 2 2
Output:

Code: Select all

Case 1: 33.333333% 33.333333% 33.333333%
Case 2: 33.333333% 33.333333% 33.333333%
Case 3: 50.000000% 25.000000% 25.000000%

Mehadi
New poster
Posts: 18
Joined: Sun Jan 24, 2010 11:17 am

Re: 11348 - Exhibition

Post by Mehadi » Tue Aug 16, 2011 3:38 pm

I think this is the Key line of this problem "The percent of whole income that i-th friend will get is equal to the part of his unique stamp's type."
I got several times WA but finally got the thing & get ACC.
Try this I/O:
Input:

Code: Select all

3
3
3 1 1 2
2 4 5
3 4 2 6
3
3 2 2 2
2 4 4
3 5 5 5
3
3 0 1 0
2 4 10000
3 4 2 2
Output:

Code: Select all

Case 1: 33.333333% 33.333333% 33.333333%
Case 2: 33.333333% 33.333333% 33.333333%
Case 3: 50.000000% 25.000000% 25.000000%

amin__
New poster
Posts: 10
Joined: Thu Jul 01, 2010 10:44 am

Re: 11348 - Exibition

Post by amin__ » Tue Aug 16, 2011 3:45 pm

here this is my code..and I cant find any bug..please help me.....



removed after acc...

thank you mahedi...
Last edited by amin__ on Wed Aug 17, 2011 2:13 pm, edited 1 time in total.

Mehadi
New poster
Posts: 18
Joined: Sun Jan 24, 2010 11:17 am

Re: 11348 - Exibition

Post by Mehadi » Tue Aug 16, 2011 5:45 pm

@Amin
I think your code is almost right. Just change data type for some variable or use type casting, like use "double usum,sum[]". In your last output section within loop i think no need to use else{},becoz sum[] already hold 0.00.

asd
New poster
Posts: 1
Joined: Sun Aug 19, 2012 2:23 am

Re: 11348 - Exhibition

Post by asd » Sun Aug 19, 2012 2:31 am

is my code is wrong?
#include<cstdio>
#include<cstring>
#include<map>
#include<vector>
using namespace std;
int main()
{
/* freopen("input.txt","r",stdin);
freopen("output.txt","w",stdout);*/
int test,y=1;
scanf("%d",&test);
while(test--)
{
int n;
map<int,int>stamp;
scanf("%d",&n);
vector<int>member[n];
for(int i=0;i<n;i++)
{
int m;
scanf("%d",&m);
while(m--)
{
int s,j;
scanf("%d",&s);
for( j=0;j<member.size();j++)
{
if(s==member[j])break;
}
if(j==member.size()){
member.push_back(s);stamp[s]=stamp[s]+1;}
}//printf("\n");
}
double count[n],total=0;
for(int i=0;i<n;i++)
{
count==0.0;
for(int j=0;j<member.size();j++)
{
int s=member[j];
//printf (" %d ",stamp[s]);
if(stamp[s]==1)
{
total=total+1.0;
count=count+1.;
}
}

}
printf("Case %d: %.6lf%c",y++,(double)count[0]*100/(double)total,37);
for(int i=1;i<n;i++)
{
printf(" %.6lf%c",(double)count*100/(double)total,37);
}
printf("\n");
}
return 0;
}

brianfry713
Guru
Posts: 5947
Joined: Thu Sep 01, 2011 9:09 am
Location: San Jose, CA, USA

Re: 11348 - Exhibition

Post by brianfry713 » Mon Aug 20, 2012 10:55 pm

Yes your code is wrong, it doesn't match the sample I/O.
Check input and AC output for thousands of problems on uDebug!

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

Re: 11348 - Exhibition

Post by uDebug » Wed Jan 08, 2014 2:09 pm

Here's some input / output that helped me test / debug my program.

Input:

Code: Select all

10
3
3 1 1 2
2 4 5
3 4 2 6
3
3 2 2 2
2 4 4
3 5 5 5
3
3 0 1 0
2 4 10000
3 4 2 2
0
1
0
1
1 1
3
3 1 1 2
2 4 4
3 4 2 6
4
0
0
0
1 444
4
10 2 2 2 2 2 2 2 2 2 3
2 2 2
3 2 2 2
1 2
5
2 1 5
2 2 4
2 3 3
2 4 2
2 5 1
AC Output:

Code: Select all

Case 1: 33.333333% 33.333333% 33.333333%
Case 2: 33.333333% 33.333333% 33.333333%
Case 3: 50.000000% 25.000000% 25.000000%
Case 4: 
Case 5: 
Case 6: 100.000000%
Case 7: 50.000000% 0.000000% 50.000000%
Case 8: 0.000000% 0.000000% 0.000000% 100.000000%
Case 9: 100.000000% 0.000000% 0.000000% 0.000000%
Case 10: 0.000000% 0.000000% 100.000000% 0.000000% 0.000000%
Check input and AC output for over 7,500 problems on uDebug!

Find us on Facebook. Follow us on Twitter.

ankitsablok89
New poster
Posts: 2
Joined: Wed Jul 24, 2013 7:36 am

Uva Problem - 11348 - Exhibition

Post by ankitsablok89 » Tue Jul 15, 2014 6:51 pm

I am trying to solve this problem using maps in C++-STL, I think the logic that I am applying to solve this problem is correct, but it keeps giving me wrong answer, somewhere I feel I am committing a formatting mistake, can somebody help me point out what mistake either in logic or writing the output am I committing in my code.

Thanks a lot in advance :(
Last edited by ankitsablok89 on Tue Jul 15, 2014 7:18 pm, edited 1 time in total.

ankitsablok89
New poster
Posts: 2
Joined: Wed Jul 24, 2013 7:36 am

Re: Uva Problem - 11348 - Exhibition

Post by ankitsablok89 » Tue Jul 15, 2014 7:18 pm

forget it I got the error, was committing a silly mistake :)

Post Reply

Return to “Volume 113 (11300-11399)”