Page 1 of 3

Posted: Tue Jun 15, 2010 7:07 pm
Can someone give some hint for this problem?
Can't understand how the result is 1 for input 8 5

### Re: 11723 - Numbering Roads

Posted: Wed Jun 16, 2010 7:14 am
Code:

Code: Select all

``````    testCase=1;
while(scanf("%d %d",&a,&b)==2){
if(a+b==0){
break;
}
printf("Case %d: ",testCase);
save=a-b;
t=save/b;
g=save%b;
if(t>26){
printf("impossible\n");
testCase++;
continue;
}
if(g==0){
printf("%d\n",t);
testCase++;
continue;
}
printf("%d\n",t+1);
testCase++;
}
``````

### Re: 11723 - Numbering Roads

Posted: Wed Jun 16, 2010 11:27 am
lnr wrote:Can someone give some hint for this problem?
Can't understand how the result is 1 for input 8 5
you can named 8 streets: 1 2 3 4 5 1A 2A 3A !
So, you only need one suffix!

### Re: 11723 - Numbering Roads

Posted: Wed Jun 16, 2010 1:52 pm
yan yan wrote:
lnr wrote:Can someone give some hint for this problem?
Can't understand how the result is 1 for input 8 5
you can named 8 streets: 1 2 3 4 5 1A 2A 3A !
So, you only need one suffix!
I did the same thing.But still wrong answer.
Code:

Code: Select all

``````#include<iostream>
#include<cstdio>
#include<vector>
#include<string>
#include<cstring>
#include<cmath>
#include<cstdlib>
#include<algorithm>
#include<map>
#include<set>
#include<cctype>
#include<stack>
#include<queue>
#include<iterator>
#include<sstream>
using namespace std;

#define PI 2.0*acos(0.0)
typedef long long ll;

int testCase,i,j,k,l,m,n,x,y,z,a,b,c,d,e,f,g,t,save;

void process(){
testCase=1;
while(scanf("%d %d",&a,&b)==2){
if(a+b==0){
break;
}
printf("Case %d: ",testCase);
save=a-b;
t=save/b;
g=save%b;
if(t>26){
printf("impossible\n");
testCase++;
continue;
}
if(g==0){
printf("%d\n",t);
testCase++;
continue;
}
printf("%d\n",t+1);
testCase++;
}
}

int main() {
//	freopen("in.txt","r",stdin);
process();
return 0;
}
``````

### Re: 11723 - Numbering Roads

Posted: Thu Jun 17, 2010 3:35 am
try this:

Code: Select all

``5 8``
i think output should be

Code: Select all

``Case 1: 0``

### Re: 11723 - Numbering Roads

Posted: Thu Jun 17, 2010 6:51 pm
yan yan wrote:try this:

Code: Select all

``5 8``
i think output should be

Code: Select all

``Case 1: 0``
I also did this still wrong answer.
Can someone post some input output?

### Re: 11723 - Numbering Roads

Posted: Sun Jun 27, 2010 11:26 pm
Check this:

Code: Select all

``````53 2
11 6
7 7
``````
output will be

Code: Select all

``````Case 1: 26
Case 2: 1
Case 3: 0
``````

### Re: 11723 - Numbering Roads

Posted: Sun Jun 27, 2010 11:30 pm
I don't understood these lines from your code:

Code: Select all

``````if(g==0){
printf("%d\n",t);
testCase++;
continue;
}
printf("%d\n",t+1);
``````
why 2 printf function......

### 11723 Numbering the rods (Uva toolkit is not responding)

Posted: Tue Aug 10, 2010 12:26 pm
For the problem Uva toolkit is not responding... .

### Re: 11723 Numbering the rods (Uva toolkit is not responding)

Posted: Tue Aug 10, 2010 7:19 pm
shaon_cse_cu08 wrote:
For the problem Uva toolkit is not responding... .
Why do you need something like that to solve a problem? And, what you might not know is, for many problems, uva toolkit gives wrong outputs.

And you don't need to add "quote" tags around all your posts, these tags are used to quote other's statements, not your own....

Happy coding.

### Re: 11723 Numbering the rods (Uva toolkit is not responding)

Posted: Tue Aug 10, 2010 7:28 pm
But for many problems UVa toolkit is must....Coz in those problems da sample input/output is not so much clear.... And isn't it all about Bugs and suggestion?? Its not like i m killing any 1 by suggesting about this problem..... And sry for the Quote part and I will try 2 use da toolkit as less as possible.....

Posted: Thu Sep 09, 2010 6:16 pm
I thought this problem easily. I just do the addition with no of integer from 1 to 26.if this addition greater then no of roads then i use break condition.
But i got WA.
Is that my process is correct ?????

here is my code:

//Removed after accepted...

Posted: Thu Sep 16, 2010 12:11 pm
Dear Durjay,
Check this case:
1 1
Output should be: Case 1: 0
but your program gives :Case 1: 1

fix it.read and understand problem statement more carefully.

Happy Coding

Naseef
CUET DURBER