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
- n타일링2
- 우아한 테크 세미나
- 에러핸들링
- OS
- TCP/IP
- 10026번
- Window-Via-c/c++
- 열혈 tcp/ip 프로그래밍
- FIFO paging
- redis
- 스프링 핵심 원리
- C#
- 제프리리처
- HTTP
- 김영한
- 우아한레디스
- 윤성우 저자
- 스프링 입문
- Operating System.
- Spring
- 2475번
- 운영체제
- C++
- inflearn
- 열혈 TCP/IP 소켓 프로그래밍
- Four Squares
- 토마토
- Operating System
- 이펙티브코틀린
- BOJ
Archives
- Today
- Total
나의 브을로오그으
[c++] 7568번 : 덩치 본문
https://www.acmicpc.net/problem/7568
#include <iostream>
#include <vector>
#include <utility>
using namespace std;
int main()
{
ios::sync_with_stdio(false);
cin.tie(NULL);
vector<pair<int, int>> ranks;
int w = 0;
int h = 0;
int n = 0;
cin >> n;
ranks.reserve(n + 1);
for (int i = 0; i < n; ++i)
{
cin >> w >> h;
ranks.push_back(pair<int, int>(w, h));
}
for (int i = 0; i < n; ++i)
{
int rank = 1;
for (int j = 0; j < n; ++j)
{
int rankCount = 0;
rankCount += ranks[i].first < ranks[j].first ? 1 : 0;
rankCount += ranks[i].second < ranks[j].second ? 1 : 0;
rank += rankCount == 2 ? 1 : 0;
}
cout << rank << ' ';
}
return 0;
}
'알고리즘 > BaekJoon' 카테고리의 다른 글
[c++] 10250번 : ACM 호텔 (0) | 2022.05.04 |
---|---|
[c++] 9012번 : 괄호 (0) | 2022.05.04 |
[c++] 4949번 : 균형잡힌 세상 (0) | 2022.04.30 |
[c++] 4153번 : 직각삼각형 (0) | 2022.04.30 |
[c++] 2869번 : 달팽이는 올라가고 싶다 (0) | 2022.04.30 |