| 일 | 월 | 화 | 수 | 목 | 금 | 토 |
|---|---|---|---|---|---|---|
| 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
- mpnp
- Plotting
- 조지아텍
- 선형대수
- 컴퓨터과학과
- cpp
- 위니펙
- EOI
- leetcode
- 딥러닝
- LV1
- 머신러닝
- omscs
- 개발자
- 알고리즘
- Deep learning
- zeros
- 기본
- 매트랩
- 프로그래머스
- LAA
- machine learning
- 방통대
- MATLAB
- C++
- 온라인석사
- 코딩테스트
- 방송통신대학교
- 캐나다 영주권
- 주정부이민
Archives
- Today
- Total
Byte by Byte
1725. Number Of Rectangles That Can Form The Largest Square.cpp 본문
개발 로그/알고리즘
1725. Number Of Rectangles That Can Form The Largest Square.cpp
CyberSoak 2021. 10. 2. 21:35class Solution {
public:
int countGoodRectangles(vector<vector<int>>& rectangles) {
int smallest=0;
vector<int>v;
for(int i =0; i<rectangles.size(); ++i){
int tmp = min(rectangles[i][0],rectangles[i][1]);
if (tmp > smallest) smallest = tmp;
v.push_back(tmp);
}
int cnt=0;
for(int i =0; i<v.size(); ++i){
if(v[i]==smallest) cnt++;
}
return cnt;
}
};'개발 로그 > 알고리즘' 카테고리의 다른 글
| 1605. Find Valid Matrix Given Row and Column Sums.cpp (0) | 2021.10.03 |
|---|---|
| 1252. Cells with Odd Values in a Matrix.cpp (0) | 2021.10.02 |
| 894. All Possible Full Binary Trees.cpp (0) | 2021.10.02 |
| 1008. Construct Binary Search Tree from Preorder Traversal.cpp (0) | 2021.10.02 |
| 1817. Finding the Users Active Minutes.cpp (0) | 2021.09.30 |