250x250
Notice
Recent Posts
Recent Comments
Link
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | 2 | 3 | 4 | 5 | ||
6 | 7 | 8 | 9 | 10 | 11 | 12 |
13 | 14 | 15 | 16 | 17 | 18 | 19 |
20 | 21 | 22 | 23 | 24 | 25 | 26 |
27 | 28 | 29 | 30 |
Tags
- 프로그래머스
- dfs
- 코테
- BFS
- 원서읽기
- PyQt
- STUDYENGLISH
- MySQL
- 원서읽자
- 원서
- swexpertacademy
- 직무면접
- 알고리즘
- D4
- 알고리즘 문제
- the midnight library
- English
- 코테 대비
- 코딩테스트
- sw expert
- sw expert academy
- SQL
- 삼성
- englishbook
- 쉬운 알고리즘 문제
- readingbook
- 완전탐색
- nightroutine
- 코테 준비
- 백준
Archives
- Today
- Total
시나브로
[백준] 7568번 덩치 본문
728x90
전체탐색으로 풀면 된다.
#include<stdio.h>
#include<vector>
#include<iostream>
#include <algorithm>
using namespace std;
int main(void) {
freopen("inp.inp", "r", stdin);
freopen("out.out", "w", stdout);
int n = 0;
scanf("%d", &n);
int list[55][2] = { 0 };
for (int i = 0; i < n; i++) {
scanf("%d %d", &list[i][0], &list[i][1]);
}
for (int i = 0; i < n; i++) {
int count = 1;
for (int j = 0; j < n; j++) {
if (i == j)
continue;
if (list[i][0] < list[j][0] && list[i][1] < list[j][1])
count++;
}
printf("%d ", count);
}
return 0;
}
https://www.acmicpc.net/problem/7568
7568번: 덩치
우리는 사람의 덩치를 키와 몸무게, 이 두 개의 값으로 표현하여 그 등수를 매겨보려고 한다. 어떤 사람의 몸무게가 x kg이고 키가 y cm라면 이 사람의 덩치는 (x,y)로 표시된다. 두 사람 A 와 B의 덩치가 각각 (x,y), (p,q)라고 할 때 x>p 그리고 y>q 이라면 우리는 A의 덩치가 B의 덩치보다 "더 크다"고 말한다. 예를 들어 어떤 A, B 두 사람의 덩치가 각각 (56,177), (45,165) 라고 한다면 A의 덩치가 B보다 큰
www.acmicpc.net
728x90
'알고리즘 > 백준' 카테고리의 다른 글
8393 합 (0) | 2020.01.09 |
---|---|
[백준] 체스판 다시 칠하기 (0) | 2019.12.31 |
[백준] 2231번 분해합 (0) | 2019.12.31 |
[백준] 2798 번 블랙잭 (0) | 2019.12.31 |
[ 백준 ] 14500번 테트로미노 _ 완전 탐색 (0) | 2019.12.30 |
Comments