| 일 | 월 | 화 | 수 | 목 | 금 | 토 |
|---|---|---|---|---|---|---|
| 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
- 방통대
- 조지아텍
- Deep learning
- 코딩테스트
- 위니펙
- 선형대수
- 알고리즘
- zeros
- 온라인석사
- LV1
- mpnp
- 방송통신대학교
- machine learning
- 캐나다 영주권
- 프로그래머스
- 컴퓨터과학과
- 기본
- 딥러닝
- 매트랩
- leetcode
- C++
- omscs
- MATLAB
- LAA
- EOI
- cpp
- Plotting
- 주정부이민
- 개발자
- 머신러닝
Archives
- Today
- Total
Byte by Byte
1827. Minimum Operations to Make the Array Increasing.cpp 본문
요구조건 정확히 안봐서 헤맴..
class Solution {
public:
int minOperations(vector<int>& nums) {
int res =0;
int len = nums.size();
for(int i =0; i<len-1;i++){
if(nums[i]>=nums[i+1]){
res += (nums[i] - nums[i+1] +1);
nums[i+1] += (nums[i] - nums[i+1] +1);
}a
}
return res;
}
};'개발 로그 > 알고리즘' 카테고리의 다른 글
| 1630. Arithmetic Subarrays.cpp (0) | 2021.10.06 |
|---|---|
| 1309. Decrypt String from Alphabet to Integer Mapping.cpp (0) | 2021.10.05 |
| 1863. Sum of All Subset XOR Totals.cpp (0) | 2021.10.04 |
| 1382. Balance a Binary Search Tree.cpp (0) | 2021.10.04 |
| 763. Partition Labels.cpp (0) | 2021.10.03 |