반응형 [PCCP] Lv2: N^2 배열자르기(87390) 해설 문제- 문제 링크: 배열자르기 해설- 자료구조: - 시간복잡도: (풀이과정)1) 2) 3) 4) 코드(C언어)solution 1)더보기solution 1#include #include #include int* solution(int n, long long left, long long right) { // return 값은 malloc 등 동적 할당을 사용해주세요. 할당 길이는 상황에 맞게 변경해주세요. int* answer = (int*)malloc(sizeof(int)*(right-left+1)); int quo = 0; int rem = 0; for (long long i = 0; i = rem) answer[i] = quo + 1; .. 2024. 12. 23. 이전 1 다음 반응형