11805 - Bafana Bafana

All about problems in Volume 118. If there is a thread about your problem, please use it. If not, create one with its number in the subject.

Moderator: Board moderators

yeasin_acm_solver
New poster
Posts: 11
Joined: Wed Jun 09, 2010 2:30 pm
Location: University Of Science & Technology Chittagong (USTC) Bangladesh

11805 - Bafana Bafana

Post by yeasin_acm_solver » Sat Jul 03, 2010 6:47 pm

/*********************************************/
Muhammad Yeasin
University of Science & Technology Chittagong
(USTC)
CSE 11th Batch
E-mail: gigabyte_yeasin@yahoo.com
/*********************************************/

Accepted.

Input:

5
5 2 5
6 3 5
4 1 3
5 3 16
2 2 2

Output:

Case 1: 2
Case 2: 2
Case 3: 4
Case 4: 4
Case 5: 2
Last edited by yeasin_acm_solver on Fri Jul 09, 2010 8:15 am, edited 2 times in total.

User avatar
sohel
Guru
Posts: 856
Joined: Thu Jan 30, 2003 5:50 am
Location: New York

Re: 11805-Bafana Bafana

Post by sohel » Sat Jul 03, 2010 7:16 pm

What's your query?

naseef_07cuet
Learning poster
Posts: 62
Joined: Sat Nov 21, 2009 10:17 pm
Location: CUET,Chittagong,Bangladesh

Re: 11805-Bafana Bafana

Post by naseef_07cuet » Sat Jul 03, 2010 7:25 pm

????
If you have determination, you can do anything you want....:)

apurba
New poster
Posts: 42
Joined: Sun Oct 07, 2007 10:29 pm

Re: 11805-Bafana Bafana

Post by apurba » Tue Jul 06, 2010 2:55 am

I'm getting WA. Need some critical test cases.

Code: Select all

keep dreaming...

User avatar
sohel
Guru
Posts: 856
Joined: Thu Jan 30, 2003 5:50 am
Location: New York

Re: 11805-Bafana Bafana

Post by sohel » Tue Jul 06, 2010 8:33 am

It's very hard to get WA on this problem! Can you post your code?

apurba
New poster
Posts: 42
Joined: Sun Oct 07, 2007 10:29 pm

Re: 11805-Bafana Bafana

Post by apurba » Tue Jul 06, 2010 11:26 am

Code: Select all

Got ACCEPTED and I was so #Stupid...

Thanks to all...
Last edited by apurba on Wed Jul 07, 2010 2:51 am, edited 1 time in total.

Code: Select all

keep dreaming...

robot
New poster
Posts: 29
Joined: Sun May 24, 2009 8:39 pm

Re: 11805-Bafana Bafana

Post by robot » Tue Jul 06, 2010 12:41 pm

Hi apurba,
i think u forward wrong way
try this test case its help you
input
1
5 2 2
output: 4
plz think at right way
ASU(SUST)

naseef_07cuet
Learning poster
Posts: 62
Joined: Sat Nov 21, 2009 10:17 pm
Location: CUET,Chittagong,Bangladesh

Re: 11805-Bafana Bafana

Post by naseef_07cuet » Tue Jul 06, 2010 8:29 pm

try this:
Input:
5
3 2 1
21 19 200
23 22 199
12 14 18
5 5 9
Output will be:
Case 1: 3
Case 2: 9
Case 3: 14
Case 4: 8
Case 5: 4

Best of luck. happy coding :)
If you have determination, you can do anything you want....:)

solon_aguiar
New poster
Posts: 7
Joined: Mon Jun 08, 2009 11:16 pm

Re: 11805 - Bafana Bafana

Post by solon_aguiar » Sat Nov 27, 2010 2:49 am

I keep getting WA.
Tryed all inputs.
Can you guys help me?

Code: Select all

Removed after AC
Last edited by solon_aguiar on Mon Dec 06, 2010 8:39 pm, edited 1 time in total.

User avatar
sohel
Guru
Posts: 856
Joined: Thu Jan 30, 2003 5:50 am
Location: New York

Re: 11805 - Bafana Bafana

Post by sohel » Sat Nov 27, 2010 4:39 am

Check your code for this input

Code: Select all

1
2 2 3

naseef_07cuet
Learning poster
Posts: 62
Joined: Sat Nov 21, 2009 10:17 pm
Location: CUET,Chittagong,Bangladesh

Re: 11805 - Bafana Bafana

Post by naseef_07cuet » Wed Dec 01, 2010 1:01 pm

try to find all the output of all possible cases through your code... You will get it.
If you have determination, you can do anything you want....:)

solon_aguiar
New poster
Posts: 7
Joined: Mon Jun 08, 2009 11:16 pm

Re: 11805 - Bafana Bafana

Post by solon_aguiar » Mon Dec 06, 2010 8:39 pm

Thanks!
It was a silly mistake.
Got Accepted.

pollob
New poster
Posts: 2
Joined: Wed Sep 12, 2012 9:55 am

uva 11805

Post by pollob » Thu Sep 13, 2012 2:15 pm

Why WA??

import java.util.Scanner;


public class Main {

public static void main (String[] args){

Scanner scan =new Scanner (System.in);

int t, N, K, P, Case =0;

t =scan.nextInt();

while ((t--)>0){
N =scan.nextInt();
K =scan.nextInt();
P =scan.nextInt();

do{
K++;
if (K%N ==0) K =0;
}while ((--P)>0);

if (K==0) K =N;
System.out.println ("Case "+(++Case)+": "+K);
}

}
}

brianfry713
Guru
Posts: 5947
Joined: Thu Sep 01, 2011 9:09 am
Location: San Jose, CA, USA

Re: uva 11805

Post by brianfry713 » Thu Sep 13, 2012 8:29 pm

Input 2 2 1 AC output 1
Check input and AC output for thousands of problems on uDebug!

ahmed essam elkashef
New poster
Posts: 1
Joined: Sun Nov 18, 2012 8:45 am

Re: 11805 - Bafana Bafana

Post by ahmed essam elkashef » Sun Nov 18, 2012 9:01 am

can anybody tell me why i got wa ?? my code :
#include <iostream>
using namespace std ;
int main ()

{ int t ;
cin>>t;
for(int i=1;i<=t;i++)
{

int n, k , p ;
cin>>n>>k>>p;;
int d =k+p ;
int f=p-n ;
int l = f-n;
int result=l-n +k;
if ( n==p)
cout<<"Case " << i<<": "<< k<<endl ;
else if (n>p && d<=n)
cout<<"Case " << i<<": "<<d<<endl ;
else if (n>p && d>n)
cout<<"Case " << i<<": "<<d-n<<endl ;
else if (n<p && k+f<=n)
cout<<"Case " << i<<": "<<k+f<<endl;
else if (n<p && k+f>n&& l<n)
cout<<"Case " << i<<": "<<(k+f)-n<<endl ;
else if (l > n)
{
while( result> n)
result-=n;

cout<<"Case " << i<<": "<<result<< endl ;
}



}



return 0 ;

}

Post Reply

Return to “Volume 118 (11800-11899)”