Page 1 of 8
10190 - Divide, But Not Quite Conquer!
Posted: Sat Mar 23, 2002 9:32 pm
by necropower
can u guys tell me a counter-example where my program fails? i am not seeing it! and the problem looks so easy, i am fealling ashamed to ask about this one...

(
#include <stdio.h>
#include <math.h>
float divider,number,temp,answer,temp2;
main()
{
int i;
number =1;
scanf("%f %f",&number,
Posted: Sat Mar 23, 2002 11:29 pm
by ram
try "25 5" and "5 5".
Posted: Sun Mar 24, 2002 6:07 am
by Stefan Pochmann
I had some problems with this one, too. Unfortunately, the judge thinks that if n<2 or m<2, then it's boring. Of course that's total crap, but the judge is always right...
<font size=-1>[ This Message was edited by: Stefan Pochmann on 2002-03-24 05:10 ]</font>
Posted: Tue Mar 26, 2002 3:37 am
by necropower
can u see any problem in that?
my input:
25 5
5 5
2 2
1 2
2 1
1 1
0 1
1 0
0 2
2 0
125 5
30 3
80 2
81 3
20000000000 2
125 125
my answer:
25 5 1
5 1
2 1
Boring!
Boring!
Boring!
Boring!
Boring!
Boring!
Boring!
125 25 5 1
Boring!
Boring!
81 27 9 3 1
Boring!
125 1
Posted: Tue Mar 26, 2002 7:30 am
by Stefan Pochmann
Looks "correct" (meaning the judge should like it).
Posted: Tue Mar 26, 2002 1:57 pm
by necropower
well, the judge didnt like it, and the code still the same...

Posted: Tue Mar 26, 2002 10:07 pm
by ram
My code works fine with all the test cases. But I am getting "Output limit exceeded" when I submit it. Can any body help me with the reason????
Posted: Wed Mar 27, 2002 1:47 am
by Stefan Pochmann
ram: That means you print to much. Either you have too much debug output (remove it) or you screw the input (fix it), so that you for example process the last testcase again and again and again. Or you have an infinite loop that prints something (fix it). Or...
Posted: Wed Mar 27, 2002 2:43 am
by ram
Thanks stefan,
It just got accepted. I used
"while(scanf("%lf %lf",&num,&div))"
instead of
"while((scanf("%lf %lf",&num,&div))==2)"
thanks for the reply.
<font size=-1>[ This Message was edited by: ram on 2002-03-27 01:43 ]</font>
Posted: Wed Aug 07, 2002 9:12 pm
by sayeed
/*@BEGIN_OF_SOURCE_CODE*/
#include<stdio.h>
#include<math.h>
int main()
{
long long n,div,x,y;
while(scanf("%lld%lld",&n,&div)==2){
if(div < 2 || n< 2) printf("Boring!\n");
else {
x = (log10(n)/log10(div));
y = pow(div,x);
if(y != n) printf("Boring!");
else
for( ;n>=1 ;n/=div)
printf("%lld ",n);
printf("\n");
}
}
return 0;
}
/*@END_OF_SOURCE_CODE*/
**********
Can anybody help me to find out the error? All input stated here works fine
who can tell me, what wrong with my code?
Posted: Thu Aug 15, 2002 8:20 pm
by stack
program v10190;
var
n, a: double;
function isPow: boolean;
var
k: double;
begin
k := ln(n)/ln(a);
if abs(k-trunc(k)) < 1e-8 then
isPow := true
else
isPow := false;
end;
procedure solve;
begin
write(n:0:0);
while true do
begin
n := trunc(n/a);
write(' ', n:0:0);
if abs(n-1) < 1e-8 then
break;
end;
writeln;
end;
begin
{ TODO -oUser -cConsole Main : Insert code here }
while not eof do
begin
readln(n, a);
if (n < 2) or (a < 2) then
begin
writeln('Boring!');
continue;
end;
if isPow then
solve
else
writeln('Boring!');
end;
end.
10190
Posted: Sat Aug 24, 2002 3:11 pm
by new comer
Whenever I submitt 10190, it says "output limit exceeded". I don't understand where is the problem. My code is like this:
#include<stdio.h>
#include<math.h>
void main()
{
long m,n,result;
for(;(scanf("%ld %ld",&m,&n))==2;)
{
if((ceil(logl(m)/logl(n))) == (floor(logl(m)/logl(n))))
{
printf("%ld ",m);
for(;;)
{
m=m/n;
printf("%ld ",m);
if(m==1)
break;
}
}
else
{
printf("Boring!");
}
printf("\n");
}
}
HELP ME![/c]
Posted: Sun Sep 08, 2002 7:38 pm
by henar2
Try with input:
0 2
your program prints 0 0 0 0 0 0....................
Good luck.
Posted: Sat Dec 21, 2002 11:15 am
by deddy one
actually I'm just using a simple calculation which is
if (n%i==0)
n = n/m;
using only calculation like that I got accepted in 0.00 sec.
hint : don't think too hard on this one, it's not that hard to solve this
Posted: Tue Dec 24, 2002 1:07 pm
by epsilon0
the judge is nuts.
1 1 should be accepted.. but it's Boring!
if (a < 2 || b < 2 || (a < b)) /* Boring! */