반응형
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 |
Tags
- upper_bound
- 기술면접
- 백준
- 연결요소
- softeer
- @P0
- incr
- 오퍼레터
- 6987
- 소프티어
- 이분탐색
- msSQL
- Kafka
- 처우협의
- 13908
- boj #19237 #어른 상어
- BOJ
- 경력
- 파라메트릭
- BFS
- 백트래킹
- OFFSET
- Docker
- 퇴사통보
- dfs
- compose
- 매개변수탐색
- 물채우기
- 성적평가
- 처우산정
Archives
- Today
- Total
기술 블로그
7568번 덩치 본문
728x90
반응형
https://www.acmicpc.net/problem/7568
문제에 나와있는데로만 구현하면 된다.
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 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 | #include <iostream> #include <queue> #include <stack> #include <cstdio> #include <vector> #include <cstring> #include <string> #include <math.h> #include <algorithm> #include <map> using namespace std; typedef struct wh { int weight; int height; }wh; vector<wh> v; vector<int> Rank; wh p; int main(void) { int N = 0, w = 0, h = 0; scanf("%d", &N); for (int i = 0; i < N; i++) { scanf("%d %d", &w, &h); p.weight = w; p.height = h; v.push_back(p); } for (int i = 0; i < v.size(); i++) { int r = 1; for (int j = 0; j < v.size(); j++) { if (v.at(j).weight > v.at(i).weight && v.at(j).height > v.at(i).height) { ++r; } } Rank.push_back(r); } for (auto r : Rank) printf("%d ", r); printf("\n"); return 0; } | cs |
728x90
반응형
'알고리즘 문제 > BOJ' 카테고리의 다른 글
1120번 문자열 (0) | 2018.12.29 |
---|---|
10448번 유레카 이론 (0) | 2018.12.29 |
1213번 팰린드롬 만들기 (0) | 2018.12.29 |
1038번 감소하는 수 (0) | 2018.12.28 |
1107번 리모컨 (0) | 2018.12.26 |