Submission #76243816


Source Code Expand

#include <iostream>
#include <cstring>
#include <vector>
#include <random>
#include <algorithm>
#include <cmath>
#include <string>
#include <map>
#include <set>
#include <queue>
#include <stack>
#include <unordered_map>
#include <unordered_set>

using namespace std;

void solve() {
    long long x1, y1, x2, y2, r1, r2;
    cin >> x1 >> y1 >> r1 >> x2 >> y2 >> r2;
    long long d = (x1-x2)*(x1-x2)+(y1-y2)*(y1-y2);
    if (d >= (r1-r2)*(r1-r2) && d <= (r1+r2)*(r1+r2)) cout << "Yes\n";
    else cout << "No\n";
}

int main() {
    ios::sync_with_stdio(false);
    cin.tie(nullptr);

    int T;
    cin >> T;
    while (T--) {
        solve();
    }
    
    return 0;
}

Submission Info

Submission Time
Task B - Two Rings
User zhangyongran
Language C++23 (Clang 21.1.0)
Score 250
Code Size 706 Byte
Status AC
Exec Time 2 ms
Memory 3084 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 2 ms 3032 KiB
01_random_00.txt AC 1 ms 2976 KiB
01_random_01.txt AC 1 ms 3016 KiB
01_random_02.txt AC 1 ms 2976 KiB
01_random_03.txt AC 1 ms 2972 KiB
01_random_04.txt AC 1 ms 3084 KiB
01_random_05.txt AC 1 ms 3056 KiB
01_random_06.txt AC 1 ms 3032 KiB
01_random_07.txt AC 1 ms 2972 KiB
01_random_08.txt AC 1 ms 3084 KiB
01_random_09.txt AC 1 ms 3056 KiB
01_random_10.txt AC 1 ms 2864 KiB
01_random_11.txt AC 1 ms 3032 KiB