Page 1 of 4
10880 - Colin and Ryan
Posted: Sun Jul 31, 2005 6:59 am
by Cho
I used some part of my code of 10858 to solve this problem.
1. Find all factors of C-R
2. Output those factors which are > R
Got WAs during the contest.
Many people solved this one in the contest. Is there anything I missed? Just hope it's not a hidden bug from the re-used code.
Posted: Sun Jul 31, 2005 9:26 am
by Krzysztof Duleba
There are cases with C=R, in spite what the problem statement says.
Posted: Sun Jul 31, 2005 10:11 am
by Cho
My code output nothing for that case.
Is that correct?
Posted: Sun Jul 31, 2005 10:19 am
by mf
There was a clarification (
http://online-judge.uva.es/board/viewtopic.php?t=8581):
In the case R == C, the answer should be "0".
Posted: Sun Jul 31, 2005 7:00 pm
by abishek
this was stupid!
I think that the problem must have been rejudged, and the solution must have been changed, rather than changing the question.
its not right to expect ppl to refresh the clarifications page.
Posted: Sun Jul 31, 2005 8:00 pm
by Krzysztof Duleba
abishek wrote:its not right to expect ppl to refresh the clarifications page.
Huh? That's perfectly right. This is what that page is for.
Posted: Sun Jul 31, 2005 10:43 pm
by misof
Krzysztof Duleba wrote:abishek wrote:its not right to expect ppl to refresh the clarifications page.
Huh? That's perfectly right. This is what that page is for.
+1
Clarifications == announcements during the contest. You
are expected to read the clarifications,
especially if you believe that your solution is correct and the judge says otherwise. The other option is to submit a clarification request. Did you do that?
I did

A bit of insight: During the contest Abednego found out that the problems with a special judge aren't judged correctly (most probably UVa had a buggy description how should the special judge behave). He was too busy fixing this issue, especially the task B many people submitted already. The best he could do was to post a clarification about the problem C.
I posted a clarification request, he admitted that the output in the case C==R is wrong, but there was nothing better he could do
at that time.
My opinion is that rejudging the submissions
after the contest would be a good idea...
But -- due to the clarification both solutions for the R==C case should be accepted.
Posted: Mon Aug 01, 2005 8:59 am
by Abednego
Yes, sorry about that mistake.
I learned an important lesson there. When I ask two people to write an alternate solution to my problem, and both of their solutions give an answer that is different from mine, then there might be something wrong with the problem. :-) I'm too arrogant.
The problem statement, when it is posted to the archive, will have a correction. A better way would be to fix the judge's solution, but it's a minor issue, and I think that it would cause more trouble than simply adding a sentence to the problem description.
Posted: Sat Aug 06, 2005 9:03 pm
by ibrahim
What should be the output of " 100 0 "
Posted: Sat Aug 06, 2005 9:09 pm
by Cho
Posted: Tue Aug 09, 2005 2:15 pm
by pipo
hi.. i got WA.. i don'k know why I got WA...
Do you show some data for input and output ??
Posted: Tue Aug 09, 2005 3:22 pm
by CodeMaker
hi pipo, check it out:
input:
Code: Select all
15
2000000000 40
10000000 0
909090 909090
0 0
100 0
84946644 544
146 4
4843 45
818481 215
7181994 51851
61 7
441 0
441 10
99999999 3333
818181 16
output:
Code: Select all
Case #1: 46 56 70 92 115 140 161 184 230 280 322 460 644 805 920 1288 1610 3220 6440 310559 621118 1242236 1552795 2173913 2484472 3105590 4347826 6211180 7142857 8695652 10869565 12422360 14285714 17391304 21739130 28571428 35714285 43478260 49999999 57142856 71428570 86956520 99999998 142857140 199999996 249999995 285714280 399999992 499999990 999999980 1999999960
Case #2: 1 2 4 5 8 10 16 20 25 32 40 50 64 80 100 125 128 160 200 250 320 400 500 625 640 800 1000 1250 1600 2000 2500 3125 3200 4000 5000 6250 8000 10000 12500 15625 16000 20000 25000 31250 40000 50000 62500 78125 80000 100000 125000 156250 200000 250000 312500 400000 500000 625000 1000000 1250000 2000000 2500000 5000000 10000000
Case #3: 0
Case #4: 0
Case #5: 1 2 4 5 10 20 25 50 100
Case #6: 849461 1698922 3397844 4247305 8494610 16989220 21236525 42473050 84946100
Case #7: 71 142
Case #8: 2399 4798
Case #9: 4597 9194 409133 818266
Case #10: 134531 245867 7130143
Case #11: 9 18 27 54
Case #12: 1 3 7 9 21 49 63 147 441
Case #13: 431
Case #14: 4242 4286 6429 6666 7777 12858 15001 15554 23331 23573 30002 45003 46662 47146 70719 90006 141438 165011 216443 330022 432886 495033 649329 990066 1298658 1515101 2380873 3030202 4545303 4761746 7142619 9090606 14285238 16666111 33332222 49998333 99996666
Case #15: 163633 818165
Posted: Tue Aug 09, 2005 4:49 pm
by pipo
thank you.. CodeMaker...
well... My output is right exactly on your output...
Is any critical input ??
my solution is simple...
my code is below... help me please...
Posted: Wed Aug 10, 2005 11:53 am
by Sedefcho
Pipo,
I took your code and I slightly changed it and now it gets ACC.
What are the changes I made?
I don't change all the time the value of the variable max as you
do in your loop. I just fix it in the very beginning like this :
max = (int)(sqrt(temp) + 1);
and I never change it inside the loop.
This is maybe the most important change I did. I also do not use a
stack, just two arrays but I don't think this is so significant.
Still, who knows...
I also changed the value of MAX. Your constant MAX=1024 is
too small, I think. Makes no harm if we make it 1024*1024 let's say.
I also changed this condition:
if (temp==0)
to
if (temp<=0)
but I don't know if this changes something.
So one of these changes has obviously fixed some bug which you
had before. Anyway, if you want, you can give me and email address
so that I can send you the changed code which gets ACC.
Regards!
Posted: Mon Aug 22, 2005 3:52 pm
by rube
I don't understand Why I am getting WA.
Please help me, Here is my code:
Code: Select all
#include <stdio.h>
#include <math.h>
#include <algorithm>
using namespace std;
#define max_f 2000000
int fac[max_f+1],k;
void factor(int n){
int i,sr;
k=0;
sr=sqrt(n);
for(i=1;i<=sr;i++){
if(n%i==0){
fac[k++]=i;
if(i!=sr)
fac[k++]=n/i;
}
}
}
int main(){
int n,T,cas=1,i,r;
//freopen("in.txt","r",stdin);
scanf("%d",&T);
while(T--){
scanf("%d %d",&n,&r);
printf("Case #%d:",cas++);
if(n==r){printf(" 0\n");continue;}
n-=r;
factor(n);
sort(fac,fac+k);
for(i=0;i<k;i++)
if(fac[i]>r){
printf(" %d",fac[i]);
}
printf("\n");
}
return 0;
}