530 - Binomial Showdown
Moderator: Board moderators
-
- New poster
- Posts: 1
- Joined: Thu Aug 12, 2010 7:25 am
- Location: iran
Re: 530 Why WA
variable is short.
-
- New poster
- Posts: 1
- Joined: Mon Jun 27, 2011 6:29 am
Mexican Quesadillas Recipes
Bean Quesadillas
Bean Quesadillas Ingredients:
? 4 6-inch whole wheat or flavored flour tortillas
? 1/4 cup regular salsa or taco sauce
? 1 1/2 cups shredded cheddar blend, lightly packed
? 1/2 cup canned black or kidney beans, rinsed and drained
Bean Quesadillas Recipe Directions:
1. Preheat the oven to 250°F then place a baking pan.
2. Place the tortilla to the countertop of a waxed paper or paper towel.
3. Lightly pack a 1/3-cup dry measuring cup with cheese.
4. Pour half of the cheese over the bottom half of the tortilla, spread evenly to within 1/4 inch of the edge.
5. Take 1 tablespoon of salsa (or taco sauce) evenly over the cheese, then put 2 tablespoons of the beans evenly over the salsa.
6. Pour the remaining half of the 1/3 cup of cheese over the beans. Fold the top half of the tortilla over the bottom half and press down slightly. Set aside.
7. Repeat steps 2 to 6 for the remaining tortillas.
8. Preheat a frying pan over medium heat, about 2 minutes.
9. Carefully put 2 folded Quesadillas into the frying pan. Press down on the quesadillas with a spatula
10. Cook until the bottoms of the Quesadillas are lightly browned and crisp, about 2 to 3 minutes.
11. Carefully turn each quesadilla and cook on the second side until lightly browned and crisp, and the cheese inside is melted, about 2 to 3 minutes.
12. Place the quesadillasonto the baking pan in the oven to keep warm.
13. Repeat steps 9 to 12 for the remaining tortillas.
14. Take the baking pan from the oven then place the
Quesadillas on a cutting board. Cut each quesadilla in half using a chef's knife then cut again each piece in half to make four pieces.
?
Bean Quesadillas are delicious served with sour cream and salsa.
? This Bean Quesadillas recipe makes 16 pieces.
Chicken Quesadillas Recipe
Chicken Quesadillas Ingredients:
? 2 tablespoons olive oil
? 1/4 small cup chopped red onion
? 1 garlic cloves, minced
? 1/4 small cup chopped red and green pepper, combined
? 1/2 teaspoon chopped fresh coriander
? 1 chili peppers (to taste),minced
? 1 1/2 plum tomatoes, chopped
? 3/4 cup chopped cooked chicken
? 4 flour tortillas
? 1 cup grated Monterey Jack and cheddar cheese, combined
Chicken Quesadillas Recipes Directions:
1. In a large skillet, heat 2 tablespoons of the oil on medium heat. Add the red onion, garlic, peppers and coriander to the skillet and sauté until softened, about 5 minutes.
2. Add the chili peppers and tomatoes to the skillet and simmer for 3 minutes. Add the chicken to the skillet and stir well to combine.
3. In a medium-sized skillet, heat a thin layer of part of the remaining oil over medium-low heat.
4. Place a tortilla in the skillet and sprinkle with 1/4 cup of the cheese. Add the chicken mixture and then top with another 1/4 cup of the cheese. Cover with another tortilla.
5. Cook the Quesadillas on each side for 2 to 3 minutes, until the cheese has melted and the tortillas are lightly browned.
6. Transfer to a baking sheet and keep warm in a 250°F oven while you cook the remaining Quesadillas. Cut each quesadilla and serve.
? This Chicken Quesadillas recipe makes 2 servings.
? Quesadillas are delicious served with salsa, sour cream and guacamole.
Bean Quesadillas Ingredients:
? 4 6-inch whole wheat or flavored flour tortillas
? 1/4 cup regular salsa or taco sauce
? 1 1/2 cups shredded cheddar blend, lightly packed
? 1/2 cup canned black or kidney beans, rinsed and drained
Bean Quesadillas Recipe Directions:
1. Preheat the oven to 250°F then place a baking pan.
2. Place the tortilla to the countertop of a waxed paper or paper towel.
3. Lightly pack a 1/3-cup dry measuring cup with cheese.
4. Pour half of the cheese over the bottom half of the tortilla, spread evenly to within 1/4 inch of the edge.
5. Take 1 tablespoon of salsa (or taco sauce) evenly over the cheese, then put 2 tablespoons of the beans evenly over the salsa.
6. Pour the remaining half of the 1/3 cup of cheese over the beans. Fold the top half of the tortilla over the bottom half and press down slightly. Set aside.
7. Repeat steps 2 to 6 for the remaining tortillas.
8. Preheat a frying pan over medium heat, about 2 minutes.
9. Carefully put 2 folded Quesadillas into the frying pan. Press down on the quesadillas with a spatula
10. Cook until the bottoms of the Quesadillas are lightly browned and crisp, about 2 to 3 minutes.
11. Carefully turn each quesadilla and cook on the second side until lightly browned and crisp, and the cheese inside is melted, about 2 to 3 minutes.
12. Place the quesadillasonto the baking pan in the oven to keep warm.
13. Repeat steps 9 to 12 for the remaining tortillas.
14. Take the baking pan from the oven then place the
Quesadillas on a cutting board. Cut each quesadilla in half using a chef's knife then cut again each piece in half to make four pieces.
?
Bean Quesadillas are delicious served with sour cream and salsa.
? This Bean Quesadillas recipe makes 16 pieces.
Chicken Quesadillas Recipe
Chicken Quesadillas Ingredients:
? 2 tablespoons olive oil
? 1/4 small cup chopped red onion
? 1 garlic cloves, minced
? 1/4 small cup chopped red and green pepper, combined
? 1/2 teaspoon chopped fresh coriander
? 1 chili peppers (to taste),minced
? 1 1/2 plum tomatoes, chopped
? 3/4 cup chopped cooked chicken
? 4 flour tortillas
? 1 cup grated Monterey Jack and cheddar cheese, combined
Chicken Quesadillas Recipes Directions:
1. In a large skillet, heat 2 tablespoons of the oil on medium heat. Add the red onion, garlic, peppers and coriander to the skillet and sauté until softened, about 5 minutes.
2. Add the chili peppers and tomatoes to the skillet and simmer for 3 minutes. Add the chicken to the skillet and stir well to combine.
3. In a medium-sized skillet, heat a thin layer of part of the remaining oil over medium-low heat.
4. Place a tortilla in the skillet and sprinkle with 1/4 cup of the cheese. Add the chicken mixture and then top with another 1/4 cup of the cheese. Cover with another tortilla.
5. Cook the Quesadillas on each side for 2 to 3 minutes, until the cheese has melted and the tortillas are lightly browned.
6. Transfer to a baking sheet and keep warm in a 250°F oven while you cook the remaining Quesadillas. Cut each quesadilla and serve.
? This Chicken Quesadillas recipe makes 2 servings.
? Quesadillas are delicious served with salsa, sour cream and guacamole.
-
- Learning poster
- Posts: 96
- Joined: Tue Jul 19, 2011 12:19 pm
- Location: Dhaka, Bangladesh
- Contact:
530 Binomial Showdown Time limit exceeded
Please, Help me
Why TLE?
Why TLE?
Code: Select all
#include <math.h>
int main()
{
long long n,k;
while(scanf("%lld %lld",&n,&k)==2)
{
long long num=1,d=1,i,a;
if(n==0 && k==0) break;
long long min = n - k;
for(i=n; i > min; i--)
num = num * i;
for(i=k; i > 1; i--)
d = d * i;
a = num/d;
printf("%lld\n",a);
}
return 0;
}
Re: 530 woes
for those who are getting WA try the following:::::
[/c]
input::::
45 0
15 9
0 0
output::::
1
5005
hope i helped u
[/c]
input::::
45 0
15 9
0 0
output::::
1
5005
hope i helped u
Re: 530 woes
yes you did. thanx a lot.avatar wrote:for those who are getting WA try the following:::::
[/c]
input::::
45 0
15 9
0 0
output::::
1
5005
hope i helped u
-
- Guru
- Posts: 5947
- Joined: Thu Sep 01, 2011 9:09 am
- Location: San Jose, CA, USA
Re: 530 Binomial Showdown Time limit exceeded
Try the input 20000 20000, the answer should be 1.
Check input and AC output for thousands of problems on uDebug!
-
- Learning poster
- Posts: 96
- Joined: Tue Jul 19, 2011 12:19 pm
- Location: Dhaka, Bangladesh
- Contact:
Re: 530 Binomial Showdown Time limit exceeded
Hi brianfry713,
thanks for helping.
But it's now WA. Here is my modified code please check it, please.
thanks for helping.
But it's now WA. Here is my modified code please check it, please.
Code: Select all
#include <cstdio>
#include <cctype>
#include <cmath>
#include <iostream>
using namespace std;
int main()
{
long double n, m;
while(scanf("%Lf %Lf",&n,&m)==2)
{
long double t=0.0, t_fact=1.0, m_fact=1.0, n_fact=1.0, c, i, j;
if(n==0 && m==0) break;
if(m==1)
cout<<n<<endl;
else if(m==0) cout<<"1"<<endl;
else
{
t=n-m;
if(t>m)
{
for(i=n ; i>t ; i--)
{
n_fact=n_fact*i;
if(m>0)
{
n_fact/=m;
m--;
}
}
c=n_fact;
//m=m+1.0;
if(m>1)
{
for(j=m ; j>=1 ; j--)
m_fact*=j;
c=n_fact/m_fact;
}
}
else
{
for(i=n ; i>m ; i--)
{
n_fact*=i;
if(t>0)
{
n_fact/=t;
t--;
}
}
c=n_fact;
//t=t+1.0;
if(t>1)
{
for(j=t ; j>0 ; j--)
t_fact*=j;
c=n_fact/t_fact;
}
}
printf("%.0Lf\n",c);
}
}
return 0;
}
-
- Guru
- Posts: 5947
- Joined: Thu Sep 01, 2011 9:09 am
- Location: San Jose, CA, USA
Re: 530 Binomial Showdown Time limit exceeded
Don't use long double, use unsigned long long.
Check input and AC output for thousands of problems on uDebug!
-
- Learning poster
- Posts: 96
- Joined: Tue Jul 19, 2011 12:19 pm
- Location: Dhaka, Bangladesh
- Contact:
Re: 530 Binomial Showdown Time limit exceeded
Hi boss,
Still WA...
Still WA...
Code: Select all
#include <cstdio>
#include <cctype>
#include <cmath>
#include <iostream>
using namespace std;
int main()
{
unsigned long long n, m;
while(scanf("%llu %llu",&n,&m)==2)
{
unsigned long long t=0, t_fact=1, m_fact=1, n_fact=1, c, i, j;
if(n==0 && m==0) break;
if(m==1)
cout<<n<<endl;
else if(m==0) cout<<"1"<<endl;
else
{
t=n-m;
if(t>m)
{
for(i=n ; i>t ; i--)
{
n_fact=n_fact*i;
if(m>0)
{
n_fact/=m;
m--;
}
}
c=n_fact;
//m=m+1.0;
if(m>1)
{
for(j=m ; j>=1 ; j--)
m_fact*=j;
c=n_fact/m_fact;
}
}
else
{
for(i=n ; i>m ; i--)
{
n_fact*=i;
if(t>0)
{
n_fact/=t;
t--;
}
}
c=n_fact;
//t=t+1.0;
if(t>1)
{
for(j=t ; j>0 ; j--)
t_fact*=j;
c=n_fact/t_fact;
}
}
printf("%llu\n",c);
}
}
return 0;
}
-
- Guru
- Posts: 5947
- Joined: Thu Sep 01, 2011 9:09 am
- Location: San Jose, CA, USA
Re: 530 Binomial Showdown Time limit exceeded
Try the sample I/O.
Check input and AC output for thousands of problems on uDebug!
-
- Learning poster
- Posts: 96
- Joined: Tue Jul 19, 2011 12:19 pm
- Location: Dhaka, Bangladesh
- Contact:
Re: 530 Binomial Showdown Time limit exceeded
Hi
Boss
Now, I use Pascale-Triangle formula to solve this problem. But, I am getting Runtime error. Please, help me.
Here is my code:
Boss
Now, I use Pascale-Triangle formula to solve this problem. But, I am getting Runtime error. Please, help me.
Here is my code:
Code: Select all
Finally, I got it AC /* Removed */
Re: 530 woes
Input:
Output:
Code: Select all
33 33
33 32
33 31
33 30
33 29
33 28
33 27
33 26
33 25
33 24
33 23
33 22
33 21
33 20
33 19
33 18
33 17
0 0
Code: Select all
1
33
528
5456
40920
237336
1107568
4272048
13884156
38567100
92561040
193536720
354817320
573166440
818809200
1037158320
1166803110
Life shouldn't be null.
-
- New poster
- Posts: 48
- Joined: Sat Apr 06, 2013 6:02 pm
Re: 530 woes
why getting runtime error???? please help...
Code: Select all
removed after AC
Last edited by triplemzim on Fri Aug 02, 2013 11:37 pm, edited 1 time in total.
-
- Guru
- Posts: 5947
- Joined: Thu Sep 01, 2011 9:09 am
- Location: San Jose, CA, USA
-
- New poster
- Posts: 48
- Joined: Sat Apr 06, 2013 6:02 pm
Re: 530 woes
i don't know but believe it or not i got RE after submitting that code... 
