Submission #19123852


Source Code Expand

#include <bits/stdc++.h>
#define INF 1e9
#define eps 1e-6
typedef long long ll;
using namespace std;

int n, x[1010], y[1010], ans;

int main(){

	cin >> n;
	for(int i = 1; i <= n; i++)
		cin >> x[i] >> y[i];
	for(int i = 1; i <= n; i++)
		for(int j = i + 1; j <= n; j++){
			if(y[j] - y[i] >= min(x[j] - x[i], x[i] - x[j]) && y[j] - y[i] <= max(x[j] - x[i], x[i] - x[j]))
				ans++;
		}
	cout << ans << endl;

	return 0;
}

Submission Info

Submission Time
Task B - Gentle Pairs
User HoshizoraZ
Language C++ (GCC 9.2.1)
Score 200
Code Size 446 Byte
Status AC
Exec Time 13 ms
Memory 3632 KiB

Judge Result

Set Name Sample All
Score / Max Score 0 / 0 200 / 200
Status
AC × 3
AC × 21
Set Name Test Cases
Sample sample_01.txt, sample_02.txt, sample_03.txt
All random_01.txt, random_02.txt, random_03.txt, random_04.txt, random_05.txt, random_06.txt, random_07.txt, random_08.txt, random_09.txt, random_10.txt, random_11.txt, random_12.txt, random_13.txt, random_14.txt, random_15.txt, random_16.txt, random_17.txt, random_18.txt, sample_01.txt, sample_02.txt, sample_03.txt
Case Name Status Exec Time Memory
random_01.txt AC 6 ms 3456 KiB
random_02.txt AC 2 ms 3576 KiB
random_03.txt AC 2 ms 3600 KiB
random_04.txt AC 8 ms 3604 KiB
random_05.txt AC 2 ms 3444 KiB
random_06.txt AC 2 ms 3444 KiB
random_07.txt AC 3 ms 3600 KiB
random_08.txt AC 2 ms 3416 KiB
random_09.txt AC 2 ms 3444 KiB
random_10.txt AC 2 ms 3572 KiB
random_11.txt AC 7 ms 3452 KiB
random_12.txt AC 9 ms 3560 KiB
random_13.txt AC 8 ms 3448 KiB
random_14.txt AC 13 ms 3596 KiB
random_15.txt AC 5 ms 3532 KiB
random_16.txt AC 7 ms 3528 KiB
random_17.txt AC 6 ms 3572 KiB
random_18.txt AC 6 ms 3620 KiB
sample_01.txt AC 2 ms 3412 KiB
sample_02.txt AC 2 ms 3632 KiB
sample_03.txt AC 2 ms 3596 KiB