백준 7568 c

magicdrill·2024년 3월 20일

백준 문제풀이

목록 보기
179/673

백준 7568 c

#include <stdio.h>
#pragma warning(disable:4996)

int profile[50][2];
int rank[50];

int main(void)
{
	int N;
	int x, y;
	int i, j, count = 1;

	scanf("%d", &N);
	for (i = 0; i < N; i++)
	{
		scanf("%d %d", &x, &y);
		profile[i][0] = x;
		profile[i][1] = y;
	}

	for (i = 0; i < N; i++)
	{
		count = 1;
		for (j = 0; j < N; j++)
		{
			if (profile[i][0] < profile[j][0] && profile[i][1] < profile[j][1])//i보다 큰 j가 있으면 
			{
				count++;
			}
			else
			{
				;
			}
		}
		rank[i] = count;
	}

	for (i = 0; i < N; i++)
	{
		printf("%d\n", rank[i]);
	}

	return 0;
}

0개의 댓글