Somnath Rakshit

 Mathematics

Associated with Math.SE; for both general discussion & math qu...
Sep 10, 2016 20:37
Hi, could you plz help me out with my question here?

https://math.stackexchange.com/questions/1921884/area-common-to-a-circle-and-a-rectangle
Oct 24, 2015 17:32
I was wondering if you could help me with this question at math.stackexchange.com/questions/1495597/number-of-good-words
Oct 15, 2015 19:08
i don't have any counter example with me but this answer was rejected
Oct 15, 2015 19:07
the soln. posted doesn't work always
 
Oct 16, 2015 02:00
the answer doesn't match with the computer
Oct 16, 2015 02:00
 
Oct 15, 2015 20:15
private testcases are present. there is no way im going to know the testcases for which my code fails
Oct 15, 2015 20:13
black box testing is done on my code
Oct 15, 2015 20:12
why?
Oct 15, 2015 20:09
automatic truncation
Oct 15, 2015 20:09
integer division
Oct 15, 2015 20:07
it wont
Oct 15, 2015 20:06
t is the no. of testcases
Oct 15, 2015 20:06
int t;
long long min=9999999999,i,m[4],c[3];
scanf("%d",&t);
while(t--)
{
scanf("%lld\n%lld\n%lld",&c[0],&c[1],&c[2]);
qsort(c,3,sizeof(c[0]),compare);
m[0]=(c[0]+c[1]+c[2])/3;
m[1]=(c[0]+c[1]);
m[2]=(c[2]+c[1]);
m[3]=(c[0]+c[2]);
for(i=0;i<4;i++)
if(m[i]<min)
min=m[i];
printf("%lld\n",min);
}
Oct 15, 2015 20:04
wrong still. i did it in c
Oct 15, 2015 19:59
yes
Oct 15, 2015 19:58
wrong
Oct 15, 2015 19:53
trying
Oct 15, 2015 19:52
neither can i
Oct 15, 2015 19:47
What was your fault that you found out?
Oct 15, 2015 19:46
Yes. I set up the formula and submitted.
Oct 15, 2015 19:46
No idea.But this answer was rejected.
Oct 15, 2015 19:46
min(trunc((a+b+c)/3) , a+b) is not the answer. It doesn't work always.
Oct 15, 2015 19:46
We cannot assume a<=b<=c
Oct 15, 2015 19:46
The problem says that for the given testcase, the one possible way to form the words is RRG, RGB, GRB, BGR where R,G,B denote the letters of the words. We cannot form more than 4 words with the given number of letters. The question says What maximum number of words can be formed if we have the given number of letters?
Oct 15, 2015 19:46
The problem has just been updated. The placement of letters do not matter. All 3 letter words which does not have all the letters same are allowed.
Oct 15, 2015 19:46
But then, how is the answer 4 for when a,b,c are equal to 5,4,3?
Oct 15, 2015 19:46
The given sample answer says that if we have 5 R, 4 G and 3 B, then the answer will be 4. RRG, RGB, GRB, BGR.
Oct 15, 2015 19:46
I need 3 letter words only.
 

 combi

combinatorical problem
Oct 15, 2015 18:41
min(trunc((a+b+c)/3) , a+b) doesn't work always
Oct 15, 2015 18:31
yes
Oct 15, 2015 18:28
yes
Oct 15, 2015 18:27
7?
Oct 15, 2015 18:25
thnx a lot!
Oct 15, 2015 18:24
yes, ur right!!!!!
Oct 15, 2015 18:21
but the actual answer's 9
Oct 15, 2015 18:20
the actual answer's 9. but we get 10 using this
Oct 15, 2015 18:19
doesn't occur for 3-14-15
Oct 15, 2015 18:15
ok
Oct 15, 2015 18:14
next?
Oct 15, 2015 18:11
but BBB isn't allowed
Oct 15, 2015 18:11
BBR and BBG are fine
Oct 15, 2015 18:11
BBx BBx BBx?
Oct 15, 2015 18:08
for 3-14-15?
Oct 15, 2015 18:06
understood so far
Oct 15, 2015 18:03
how?
Oct 15, 2015 18:02
those are the constraints. nothing else is written about them
Oct 15, 2015 18:02
1<=a<=3*10^9
1<=b<=3*10^9
1<=c<=3*10^9