10112 - Myacm Triangles

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

Moderator: Board moderators

Post Reply
Raj Ariyan
Learning poster
Posts: 70
Joined: Sat Feb 05, 2005 9:38 am
Location: Gurukul

10112 - Myacm Triangles

Post by Raj Ariyan »

Hi,
Please give me some input/output for the problem 10112 Myacm Triangle. I'm getting WA :( . Thanks in advance.
Last edited by Raj Ariyan on Sat Apr 16, 2005 3:19 pm, edited 1 time in total.
Some Love Stories Live Forever ....
mohiul alam prince
Experienced poster
Posts: 120
Joined: Sat Nov 01, 2003 6:16 am
Location: Dhaka (EWU)

Post by mohiul alam prince »

Hi
Please mention your problem number.
Thanks
MAP
Raj Ariyan
Learning poster
Posts: 70
Joined: Sat Feb 05, 2005 9:38 am
Location: Gurukul

Pro

Post by Raj Ariyan »

Hi prince,
Sorry, i've edited my previous post. If u can then plz send me some I/O. Thanks for ur look.
Some Love Stories Live Forever ....
mohiul alam prince
Experienced poster
Posts: 120
Joined: Sat Nov 01, 2003 6:16 am
Location: Dhaka (EWU)

Post by mohiul alam prince »

Hi Raj
I am also getting WA in this problem.
I have applied 478 problem's algorithm but it gives me WA

Thanks
MAP
mf
Guru
Posts: 1244
Joined: Mon Feb 28, 2005 4:51 am
Location: Zürich, Switzerland
Contact:

Post by mf »

Maybe you both get WA if you use floating-point variables?
This problem can be solved with integers - just don't divide by 2 when calculating areas.
Raj Ariyan
Learning poster
Posts: 70
Joined: Sat Feb 05, 2005 9:38 am
Location: Gurukul

Post by Raj Ariyan »

Hi mf,
I'm not doing any double calculation. In my code there are all integer calculation. But i get WA. Thanx in advance.
Some Love Stories Live Forever ....
Raj Ariyan
Learning poster
Posts: 70
Joined: Sat Feb 05, 2005 9:38 am
Location: Gurukul

Post by Raj Ariyan »

Hi mf and prince,
I've just get ACC. There was a silly mistake :oops: . Thanx for ur helps. Bye
Some Love Stories Live Forever ....
mohiul alam prince
Experienced poster
Posts: 120
Joined: Sat Nov 01, 2003 6:16 am
Location: Dhaka (EWU)

Post by mohiul alam prince »

Hi
I have got AC :)
Thanks mf and Raj.
MAP
gba356
New poster
Posts: 15
Joined: Sat Apr 28, 2007 10:12 am
Location: Taiwan

Post by gba356 »

I got AC for problem 478, I'm using the same algo but it keeps WA, here's my code, it can't even pass the sample input, but it seems correct logically, can anyone help me??
Any comment is appreciated.

Code: Select all

Code deleted after AC, thanks for Jan's help!!!
:D :D :D
Last edited by gba356 on Sat Jul 21, 2007 6:34 am, edited 1 time in total.
Jan
Guru
Posts: 1334
Joined: Wed Jun 22, 2005 10:58 pm
Location: Dhaka, Bangladesh
Contact:

Post by Jan »

Replace the following part. Check it, hope you find your error :D.

Code: Select all

	for(int k=j+1;k<n;k++) 
	{
		bool flag=true;
		for(int test=0;test<n;test++) 
		{ 
			if( test==i || test==j || test==k ) 
				continue;
			if( InTri(s[test],s[i],s[j],s[k]) ) 
			{
				flag=false;
				break; 
			}
		}
		if(flag && Area(s[i],s[j],s[k])>max_area ) 
		{ 
			max_tri[0]=s[i].name; 
			max_tri[1]=s[j].name; 
			max_tri[2]=s[k].name; 
			max_area=Area(s[i],s[j],s[k]); 
		} 
	}
And use 'max_area' as int.
Ami ekhono shopno dekhi...
HomePage
rhsumon
New poster
Posts: 48
Joined: Wed Aug 23, 2006 12:29 pm
Location: Dhaka

Post by rhsumon »

Where is the problem??? Is there any compiletion error??????
Plz check somebody i cannot find .....plz........

Code: Select all

Removed......
plz help someone
Last edited by rhsumon on Tue Sep 11, 2007 8:17 pm, edited 1 time in total.
Jan
Guru
Posts: 1334
Joined: Wed Jun 22, 2005 10:58 pm
Location: Dhaka, Bangladesh
Contact:

Post by Jan »

Dont know the new judge. Add 'stdlib.h'. May be the 'abs' is not in 'math.h'. Hope it helps.
Ami ekhono shopno dekhi...
HomePage
rhsumon
New poster
Posts: 48
Joined: Wed Aug 23, 2006 12:29 pm
Location: Dhaka

Post by rhsumon »

Thanx Jaan it workrd.
But what can we know about the new judge in the new system?
zhangfei
New poster
Posts: 5
Joined: Thu Jul 29, 2010 2:08 pm

Re: 10112 - Myacm Triangles

Post by zhangfei »

Use absolute when calculate the area!
Post Reply

Return to “Volume 101 (10100-10199)”