11723 - Numbering Roads
Moderator: Board moderators
11723 - Numbering Roads
Can someone give some hint for this problem?
Can't understand how the result is 1 for input 8 5
Can't understand how the result is 1 for input 8 5
Re: 11723 - Numbering Roads
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
you can named 8 streets: 1 2 3 4 5 1A 2A 3A !lnr wrote:Can someone give some hint for this problem?
Can't understand how the result is 1 for input 8 5
So, you only need one suffix!

Re: 11723 - Numbering Roads
I did the same thing.But still wrong answer.yan yan wrote:you can named 8 streets: 1 2 3 4 5 1A 2A 3A !lnr wrote:Can someone give some hint for this problem?
Can't understand how the result is 1 for input 8 5
So, you only need one suffix!
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
try this:
i think output should be
Code: Select all
5 8
Code: Select all
Case 1: 0
Re: 11723 - Numbering Roads
I also did this still wrong answer.yan yan wrote:try this:i think output should beCode: Select all
5 8
Code: Select all
Case 1: 0
Can someone post some input output?
-
- Learning poster
- Posts: 62
- Joined: Sat Nov 21, 2009 10:17 pm
- Location: CUET,Chittagong,Bangladesh
Re: 11723 - Numbering Roads
Check this:
output will be
Code: Select all
53 2
11 6
7 7
Code: Select all
Case 1: 26
Case 2: 1
Case 3: 0
If you have determination, you can do anything you want....

-
- Learning poster
- Posts: 62
- Joined: Sat Nov 21, 2009 10:17 pm
- Location: CUET,Chittagong,Bangladesh
Re: 11723 - Numbering Roads
I don't understood these lines from your code:
why 2 printf function......
Code: Select all
if(g==0){
printf("%d\n",t);
testCase++;
continue;
}
printf("%d\n",t+1);

If you have determination, you can do anything you want....

-
- New poster
- Posts: 50
- Joined: Tue May 25, 2010 9:10 am
- Contact:
11723 Numbering the rods (Uva toolkit is not responding)
For the problem Uva toolkit is not responding....
I'll keep holding on...Until the walls come tumbling down...And freedom is all around ..... 

-
- Experienced poster
- Posts: 110
- Joined: Tue May 06, 2008 2:18 pm
- Location: CSE-DU, Bangladesh
- Contact:
Re: 11723 Numbering the rods (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.shaon_cse_cu08 wrote:For the problem Uva toolkit is not responding....
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.
You should not always say what you know, but you should always know what you say.
-
- New poster
- Posts: 50
- Joined: Tue May 25, 2010 9:10 am
- Contact:
Re: 11723 Numbering the rods (Uva toolkit is not responding)
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.....
I'll keep holding on...Until the walls come tumbling down...And freedom is all around ..... 

11723-Numbering Roads!
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...
Advance thanx for help!!!!!!!!!!!
But i got WA.
Is that my process is correct ?????
here is my code:
//Removed after accepted...
Advance thanx for help!!!!!!!!!!!
Last edited by durjay on Thu Sep 16, 2010 6:20 pm, edited 1 time in total.
-
- Learning poster
- Posts: 62
- Joined: Sat Nov 21, 2009 10:17 pm
- Location: CUET,Chittagong,Bangladesh
Re: 11723-Numbering Roads!
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
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
If you have determination, you can do anything you want....

Re: 11723-Numbering Roads!
Thanks naseef.....
Now i got accepted.....
Now i got accepted.....

Re: 11723-Numbering Roads!
I have tried 4 times. But still get WA.
Is there any special case?
Is there any special case?