Submission #76240932


Source Code Expand

#include <bits/stdc++.h>
#define int long long
#define ll long long
#define ull unsigned long long
#define inf 1e18
#define eps 1e-9
#define endl "\n"
#define il inline
#define ls 2*k
#define rs 2*k+1
using namespace std;
const int N=2e5+5,M=2e6+5;
const int mod=998244353;
inline int read(){
    int x=0,f=1;
    char ch=getchar();
    while(ch<'0'||ch>'9'){
        if(ch=='-') f=-1;
        ch=getchar();
    }
    while(ch>='0' && ch<='9') x=x*10+ch-'0',ch=getchar();
    return x*f;
}
long double a,b,c,d,r1,r2;
signed main(){
	ios::sync_with_stdio(0);
	cin.tie(0); cout.tie(0);
	int tc;cin>>tc; 
	while(tc--){
		cin>>a>>b>>r1>>c>>d>>r2;
		long double dis=sqrt((a-c)*(a-c)+(b-d)*(b-d));
//		cout<<(a-c)*(a-c)<<' '<<(b-d)*(b-d)<<' '<<(a-c)*(a-c)+(b-d)*(b-d)<<'\n'; 
		if(dis>r1 && dis>r2){
			if((r1+r2)>=dis) cout<<"Yes\n";
			else cout<<"No\n";
		}
		else{
			if(r1<r2) swap(r1,r2);
			if((dis+r2)>=r1) cout<<"Yes\n";
			else cout<<"No\n";
		}
//		cout<<dis<<' '<<r1<<'\n'; 
	}
	return 0;
}
/*

*/

Submission Info

Submission Time
Task B - Two Rings
User Limingxuan
Language C++23 (GCC 15.2.0)
Score 250
Code Size 1050 Byte
Status AC
Exec Time 1 ms
Memory 3984 KiB

Judge Result

Set Name Sample All
Score / Max Score 0 / 0 250 / 250
Status
AC × 1
AC × 13
Set Name Test Cases
Sample 00_sample_00.txt
All 00_sample_00.txt, 01_random_00.txt, 01_random_01.txt, 01_random_02.txt, 01_random_03.txt, 01_random_04.txt, 01_random_05.txt, 01_random_06.txt, 01_random_07.txt, 01_random_08.txt, 01_random_09.txt, 01_random_10.txt, 01_random_11.txt
Case Name Status Exec Time Memory
00_sample_00.txt AC 1 ms 3740 KiB
01_random_00.txt AC 1 ms 3716 KiB
01_random_01.txt AC 1 ms 3608 KiB
01_random_02.txt AC 1 ms 3692 KiB
01_random_03.txt AC 1 ms 3692 KiB
01_random_04.txt AC 1 ms 3708 KiB
01_random_05.txt AC 1 ms 3608 KiB
01_random_06.txt AC 1 ms 3984 KiB
01_random_07.txt AC 1 ms 3840 KiB
01_random_08.txt AC 1 ms 3776 KiB
01_random_09.txt AC 1 ms 3716 KiB
01_random_10.txt AC 1 ms 3608 KiB
01_random_11.txt AC 1 ms 3680 KiB