Submission #70747126


Source Code Expand

#include <bits/stdc++.h>
//#include <atcoder/all>
using namespace std;
//using namespace atcoder;
//using mint = modint1000000007;
//const int mod = 1000000007;
//using mint = modint998244353;
//const int mod = 998244353;
//const int INF = 1e9;
//const long long LINF = 1e18;
#define rep(i, n) for (int i = 0; i < (n); ++i)
#define rep2(i,l,r)for(int i=(l);i<(r);++i)
#define rrep(i, n) for (int i = (n) - 1; i >= 0; --i)
#define rrep2(i,l,r)for(int i=(r) - 1;i>=(l);--i)
#define all(x) (x).begin(),(x).end()
#define allR(x) (x).rbegin(),(x).rend()
#define P pair<int,int>
template<typename A, typename B> inline bool chmax(A & a, const B & b) { if (a < b) { a = b; return true; } return false; }
template<typename A, typename B> inline bool chmin(A & a, const B & b) { if (a > b) { a = b; return true; } return false; }

int main() {
	std::ios::sync_with_stdio(false);
	std::cin.tie(nullptr);
	int t; cin >> t;
	while (t--) {
		vector<long long>a(4);
		rep(i, 4)cin >> a[i];
		bool chk = false;
		rep(i, 4) {
			long long x = a[0] + a[1];
			long long y = a[2] + a[3];
			long long z = abs(a[2] - a[3]);
			// z<x < y
			//double mina = sqrt(a[0] * a[0] + a[1] * a[1]);//
			//double maxa = a[0] + a[1];

			//double minb = abs(a[2] - a[3]);//ok
			//double maxb = a[2] + a[3];//ng

			if (z < x && x < y)chk = true;
			rotate(a.rbegin(), a.rbegin() + 1, a.rend());

		}

		cout << (chk ? "Yes" : "No") << endl;
	}
	return 0;
}

Submission Info

Submission Time
Task D - Boomerang
User kwm_t
Language C++ 23 (gcc 12.2)
Score 100
Code Size 1477 Byte
Status AC
Exec Time 122 ms
Memory 3532 KiB

Judge Result

Set Name Sample All
Score / Max Score 0 / 0 100 / 100
Status
AC × 1
AC × 29
Set Name Test Cases
Sample sample-01.txt
All hand-00.txt, hand-01.txt, hand-02.txt, large-00.txt, large-01.txt, large-02.txt, large-03.txt, large-04.txt, large-05.txt, large-06.txt, large-07.txt, large-08.txt, large-09.txt, large-10.txt, large-11.txt, large-12.txt, large-13.txt, large-14.txt, sample-01.txt, small-00.txt, small-01.txt, small-02.txt, small-03.txt, small-04.txt, small-05.txt, small-06.txt, small-07.txt, small-08.txt, small-09.txt
Case Name Status Exec Time Memory
hand-00.txt AC 93 ms 3472 KiB
hand-01.txt AC 101 ms 3464 KiB
hand-02.txt AC 98 ms 3416 KiB
large-00.txt AC 121 ms 3388 KiB
large-01.txt AC 122 ms 3492 KiB
large-02.txt AC 122 ms 3520 KiB
large-03.txt AC 122 ms 3324 KiB
large-04.txt AC 122 ms 3488 KiB
large-05.txt AC 121 ms 3472 KiB
large-06.txt AC 121 ms 3532 KiB
large-07.txt AC 121 ms 3476 KiB
large-08.txt AC 121 ms 3392 KiB
large-09.txt AC 121 ms 3464 KiB
large-10.txt AC 121 ms 3388 KiB
large-11.txt AC 121 ms 3468 KiB
large-12.txt AC 121 ms 3484 KiB
large-13.txt AC 122 ms 3432 KiB
large-14.txt AC 122 ms 3328 KiB
sample-01.txt AC 1 ms 3416 KiB
small-00.txt AC 111 ms 3468 KiB
small-01.txt AC 111 ms 3412 KiB
small-02.txt AC 111 ms 3332 KiB
small-03.txt AC 111 ms 3468 KiB
small-04.txt AC 111 ms 3476 KiB
small-05.txt AC 111 ms 3328 KiB
small-06.txt AC 111 ms 3532 KiB
small-07.txt AC 110 ms 3492 KiB
small-08.txt AC 111 ms 3480 KiB
small-09.txt AC 111 ms 3524 KiB