10925 - Krakovia

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

Moderator: Board moderators

SRX
Learning poster
Posts: 63
Joined: Sat May 14, 2005 8:13 am
Location: Taiwan

10925 - Krakovia

Post by SRX »

Can you give me some testdata , I don't know where wrong in my code

thanks
wook
Learning poster
Posts: 76
Joined: Fri Oct 01, 2004 11:34 am
Location: Korea, Republic Of

tricky case

Post by wook »

stupid mistake.

ignore it. :oops:
Last edited by wook on Sun Oct 02, 2005 5:00 am, edited 1 time in total.
Sorry For My Poor English.. :)
wook
Learning poster
Posts: 76
Joined: Fri Oct 01, 2004 11:34 am
Location: Korea, Republic Of

sorry

Post by wook »

i got very stupid mistake.. :oops:

sorry again.



V < 10^20,
thus we can't use only 64bit integers.

and, the test cases I used to debug my program

input:
1 1
1

1 20
1

3 9
1
4
3

3 8
1
4
3

1 1
31415926535897932384

5 11
99999999999999999999
99999999999999999999
99999999999999999999
99999999999999999999
99999999999999999999

2 20
31415926535897932384
31415926535897932384

2 9
20000000000
1000

3 1
100000000000000000000
200000000000000000000
400000000000000000000

11 2
100000000000000000000
100000000000000000000
100000000000000000000
100000000000000000000
100000000000000000000
100000000000000000000
100000000000000000000
100000000000000000000
100000000000000000000
100000000000000000000
100000000000000000000

5 20
100000000000000000000
99999999999999999999
99999999999999999998
99999999999999999997
99999999999999999996

4 17
3515135187212
503540533457899
2132105
102

21 7
1
10
100
1000
10000
100000
1000000
10000000
100000000
1000000000
10000000000
100000000000
1000000000000
10000000000000
100000000000000
1000000000000000
10000000000000000
100000000000000000
1000000000000000000
10000000000000000000
100000000000000000000
0 0
output:
Bill #1 costs 1: each friend should pay 1

Bill #2 costs 1: each friend should pay 0

Bill #3 costs 8: each friend should pay 0

Bill #4 costs 8: each friend should pay 1

Bill #5 costs 31415926535897932384: each friend should pay 31415926535897932384

Bill #6 costs 499999999999999999995: each friend should pay 45454545454545454545

Bill #7 costs 62831853071795864768: each friend should pay 3141592653589793238

Bill #8 costs 20000001000: each friend should pay 2222222333

Bill #9 costs 700000000000000000000: each friend should pay 700000000000000000000

Bill #10 costs 1100000000000000000000: each friend should pay 550000000000000000000

Bill #11 costs 499999999999999999990: each friend should pay 24999999999999999999

Bill #12 costs 507055670777318: each friend should pay 29826804163371

Bill #13 costs 111111111111111111111: each friend should pay 15873015873015873015
Sorry For My Poor English.. :)
SRX
Learning poster
Posts: 63
Joined: Sat May 14, 2005 8:13 am
Location: Taiwan

Re: sorry

Post by SRX »

Code: Select all

have AC 
Last edited by SRX on Sun Oct 02, 2005 12:17 pm, edited 1 time in total.
sohel
Guru
Posts: 856
Joined: Thu Jan 30, 2003 5:50 am
Location: New York

try these..

Post by sohel »

try this case

Input

Code: Select all

2 3
9999
1
1 20
3
4 5
9999
999
99
9
0 0
Output

Code: Select all

Bill #1 costs 10000: each friend should pay 3333

Bill #2 costs 3: each friend should pay 0

Bill #3 costs 11106: each friend should pay 2221

SRX
Learning poster
Posts: 63
Joined: Sat May 14, 2005 8:13 am
Location: Taiwan

Re: try these..

Post by SRX »

sohel wrote:try this case

Input

Code: Select all

2 3
9999
1
1 20
3
4 5
9999
999
99
9
0 0
Output

Code: Select all

Bill #1 costs 10000: each friend should pay 3333

Bill #2 costs 3: each friend should pay 0

Bill #3 costs 11106: each friend should pay 2221

thanks very much

The reason is my "lazy bigint addition"
I don't code right addition , so got wa
I remember that I code lazy ( short code ) addition for speed :oops:

thanks sohel and wook again ! :D
Eva Tsai
New poster
Posts: 4
Joined: Sun Jul 10, 2005 11:01 am

Post by Eva Tsai »

Code: Select all


Last edited by Eva Tsai on Sat Jul 07, 2007 8:53 am, edited 2 times in total.
Timo
Learning poster
Posts: 70
Joined: Tue Oct 11, 2005 2:44 am
Location: Indonesia

Post by Timo »

You can try this case :

1 1
56270
1 8
59532
11 4
46174
39274
57939
53253
62523
46232
49934
64389
60970
42991
46583
16 17
39008
59470
53737
39200
42326
40011
43117
53067
48817
47243
48956
50353
45630
62386
54306
62179
14 10
51959
49936
56012
41518
58226
60565
53840
46328
61011
50654
47690
48301
65452
43772
6 10
54850
55119
49470
48852
57800
60821
17 6
56305
54239
58889
54091
64035
51876
38340
65492
54206
63609
63493
58506
38590
55719
54342
60086
60088
5 5
44576
40948
40505
45189
52782
11 1
61926
52873
52155
49032
58536
62368
46146
47586
41034
41329
64354
12 11
48372
44217
58523
59537
59012
56261
49882
61864
48555
64678
39308
59656
0 0
Timo
Learning poster
Posts: 70
Joined: Tue Oct 11, 2005 2:44 am
Location: Indonesia

Post by Timo »

Here is the output from my accepted program.

Bill #1 costs 56270: each friend should pay 56270

Bill #2 costs 59532: each friend should pay 7441

Bill #3 costs 570262: each friend should pay 142565

Bill #4 costs 789806: each friend should pay 46459

Bill #5 costs 735264: each friend should pay 73526

Bill #6 costs 326912: each friend should pay 32691

Bill #7 costs 951906: each friend should pay 158651

Bill #8 costs 224000: each friend should pay 44800

Bill #9 costs 577339: each friend should pay 577339

Bill #10 costs 649865: each friend should pay 59078


I hope you will get AC
Eva Tsai
New poster
Posts: 4
Joined: Sun Jul 10, 2005 11:01 am

Post by Eva Tsai »

I've tried the cases posted by Timo,
and my WA program can print the same output, too.
Please give me more testdeta, thanks a lot.
Eva Tsai
New poster
Posts: 4
Joined: Sun Jul 10, 2005 11:01 am

Post by Eva Tsai »

I've got AC.
What a stupid mistake I made!
Thanks for the response of Guest.
Jemerson
Learning poster
Posts: 59
Joined: Mon Feb 02, 2004 11:19 pm
Contact:

Post by Jemerson »

Hum.. i had accepted all sugestted inputs but I was still getting WA, so i found two inputs that showed me some extra cases. After correct this I got Accepted. Here they are:

Input:

Code: Select all

1 16
17432479801732498109834891047810
1 15
17432479801732498109834891047810
Output:

Code: Select all

Bill #1 costs 17432479801732498109834891047810: each friend should pay 1089529987608281131864680690488

Bill #2 costs 17432479801732498109834891047810: each friend should pay 1162165320115499873988992736520

Good Luck for everyone
UFCG Brazil - Computer Science graduate student
http://acm.uva.es/problemset/usersnew.php?user=54806 ... and going up!
Roby
Experienced poster
Posts: 101
Joined: Wed May 04, 2005 4:33 pm
Location: Tangerang, Banten, Indonesia
Contact:

10925 - Krakovia

Post by Roby »

Somebody please help me, how to solve this problem? It's look like easy to solve but I failed with the second test case in sample input. Here's my code:

Code: Select all

AC already
Any help would be appreciated...
Last edited by Roby on Sun Apr 16, 2006 10:47 am, edited 1 time in total.
Roby
Experienced poster
Posts: 101
Joined: Wed May 04, 2005 4:33 pm
Location: Tangerang, Banten, Indonesia
Contact:

Post by Roby »

Anyone, help me please ... :cry:
Krzysztof Duleba
Guru
Posts: 584
Joined: Thu Jun 19, 2003 3:48 am
Location: Sanok, Poland
Contact:

Post by Krzysztof Duleba »

Isn't this problem about regular BigInt arithmetic operations? Just make sure they all work fine and you'll get AC.
Post Reply

Return to “Volume 109 (10900-10999)”