Problem 11245

The forum to report every bug you find or tell us what you'd like to find in UVa OJ

Moderator: Board moderators

Adrian Kuegel
Guru
Posts: 724
Joined: Wed Dec 19, 2001 2:00 am
Location: Germany

Problem 11245

Post by Adrian Kuegel »

It seems there are inputs with n > 2 * 10^9
I used assert to check this; I got Accepted after I also handled n upto 2^50.
Jan
Guru
Posts: 1334
Joined: Wed Jun 22, 2005 10:58 pm
Location: Dhaka, Bangladesh
Contact:

Post by Jan »

I have another question. What if p is not a prime? It seems there are no such inputs. Was it a mistake or a trick? And if it's a trick then what can I say!!!
Ami ekhono shopno dekhi...
HomePage
emotional blind
A great helper
Posts: 383
Joined: Mon Oct 18, 2004 8:25 am
Location: Bangladesh
Contact:

Post by emotional blind »

This must not be a trick. It forces us to think about not prime also.
In onsite contest we got the sample right.. but failed to figure out the input when p=4 and waste a lot of time. and cant submit.

I don't know what about the other teams. May be lot more team faces the same problem.
MIB
New poster
Posts: 3
Joined: Tue Apr 08, 2003 10:39 am
Location: Dhaka, Bangladesh

Post by MIB »

My team also suffered with the same problem in the on-site contest...
I think the same input set is used in both contests (online & onsite).

In that case, I'm really surprised how 2 teams (even one team without any penalty :roll: ) managed to solve the problem in the onsite contest... with lacking of so much info :-?

http://daffodilvarsity.edu.bd/dipc07/wrapper2.html
MIB
ardiankp
New poster
Posts: 27
Joined: Mon Nov 01, 2004 4:04 pm

Post by ardiankp »

??? So p is prime?
emotional blind
A great helper
Posts: 383
Joined: Mon Oct 18, 2004 8:25 am
Location: Bangladesh
Contact:

Post by emotional blind »

yes..
two teams in onsite can solve this problem, i think this was common to them..
ardiankp
New poster
Posts: 27
Joined: Mon Nov 01, 2004 4:04 pm

Post by ardiankp »

LOL, yesterday I spent almost 2 hours on this problem until fell down asleep....

after knowing p is prime I can figure out the way in < 30 mins :S
Robert Gerbicz
Experienced poster
Posts: 196
Joined: Wed May 02, 2007 10:12 pm
Location: Hungary, Pest county, Halasztelek
Contact:

Re: Problem 11245

Post by Robert Gerbicz »

Adrian Kuegel wrote:It seems there are inputs with n > 2 * 10^9
I used assert to check this; I got Accepted after I also handled n upto 2^50.
Yes, using long long int for n value instead of int I've got AC. But WHY? In the problem statement: 1<=n<=2*10^9, so they've stealen one problem solution from me on the contest.

Thanks to:

Problemsetter: Abdullah al Mahmood
Special Thanks: Derek Kisman
Jan
Guru
Posts: 1334
Joined: Wed Jun 22, 2005 10:58 pm
Location: Dhaka, Bangladesh
Contact:

Post by Jan »

I can only say, the problem setter should be more careful while writing the statement. However in the onsite contest two teams solved the problem. I have two questions..

1. How did they know p is prime?
2. How did they know n cant be fit into normal int?
Last edited by Jan on Sun Jul 29, 2007 7:01 pm, edited 1 time in total.
Ami ekhono shopno dekhi...
HomePage
shahriar_manzoor
System administrator & Problemsetter
Posts: 399
Joined: Sat Jan 12, 2002 2:00 am

hmm

Post by shahriar_manzoor »

This problem unfortunately had two mistakes. One it was not mentioned that p is a prime and another one the range was not specified.

However, none of the mistakes are due to Derek Kisman or Abdullah al Mahmud. When derek wrote solutions n>2000000000 then the problem setter made it less than 2000000000. I thought I replaced the file but later I found I did not.

I placed assert() in all solution but now I find I did not do it only for problem B. I have not explanation and I have no excuse. Like my previous errors it is version conflict.

The teams who solved it onsite somehow found the error or were lucky. But they did not inform us (which is logical) about the mistake.

I am extremely sorry for the mistake. If the submissions of the onsite contest are still available I will rejudge the solutions and change the ranklist if there is any changes and if the chief judge agrees. While changing the ranklist I will follow the rules followed in 2000 World Finals (No team loses his rank for the rejudgement). But probably I will not be able to do anything about prize money :(. It would have been logical that I pay the teams from my pocket but I assume that the teams won't accept that.

Shahriar Manzoor
Judging Director of the Onsite Contest
Last edited by shahriar_manzoor on Sun Jul 29, 2007 5:42 pm, edited 1 time in total.
emotional blind
A great helper
Posts: 383
Joined: Mon Oct 18, 2004 8:25 am
Location: Bangladesh
Contact:

Post by emotional blind »

Jan wrote: 1. How did they know p is prime?
2. How did they know n cant be fit into normal int?
I have the same questions..
Do they know magic??
emotional blind
A great helper
Posts: 383
Joined: Mon Oct 18, 2004 8:25 am
Location: Bangladesh
Contact:

Re: hmm

Post by emotional blind »

shahriar_manzoor wrote:
I am extremely sorry for the mistake. If the submissions of the onsite contest are still available I will rejudge the solutions and change the ranklist if there is any changes and if the chief judge agrees. While changing the ranklist I will follow the rules followed in 2000 World Finals (No team loses his rank for the rejudgement). But probably I will not be able to do anything about prize money :(. It would have been logical that I pay the teams from my pocket but I assume that the teams won't accept that.

Shahriar Manzoor
Judging Director of the Onsite Contest
What will be rejudge strategy.. I think all submissions should get WA. isn't it?
emotional blind
A great helper
Posts: 383
Joined: Mon Oct 18, 2004 8:25 am
Location: Bangladesh
Contact:

Post by emotional blind »

All solution should get WA in that sense that some teams were trying to find out the solutions when p is not prime.. those ACCEPTED solutions surely do not work for non-prime p.

but this re-judgement will not recover our damage. Because when we see that some teams solve this problem and then we put a lot of our effort on this problem because we thought that the problem is solvable even for p is not prime. and waste our time without any success.
tanaeem
New poster
Posts: 26
Joined: Mon Mar 12, 2007 6:58 pm
Location: BUET
Contact:

I have solved this onsite

Post by tanaeem »

I have solved this problem onsite.
My answer to the question follows
1. How did they know p is prime?
I didn't even know. And why p being prime necessary is not still clear to me.
2. How did they know n cant be fit into normal int?
Whenever I see there is the result will not fit in normal integer I usually replace all int by all 64 bit int. So I got acc.
But they did not inform us (which is logical) about the mistake.
If I understood there was problem like this I would have informed the judge.
Jan
Guru
Posts: 1334
Joined: Wed Jun 22, 2005 10:58 pm
Location: Dhaka, Bangladesh
Contact:

Post by Jan »

Please check your sequence for p=4.
Ami ekhono shopno dekhi...
HomePage
Locked

Return to “Bugs and suggestions”