코딩테스트

코딩테스트/프로그래머스(C++)_Level.0

[프로그래머스/C++] Lv.0 조건에 맞게 수열 반환하기 1

문제 코드 #include #include #include using namespace std; vector solution(vector arr) { vector answer; for (int n : arr) { if (n & 1 && n = 50) { answer.emplace_back(n * 0.5f); continue; } answer.emplace_back(n); } return answer; }

코딩테스트/프로그래머스(C++)_Level.0

[프로그래머스/C++] Lv.0 수열과 구간 쿼리 1

문제 코드 #include #include #include using namespace std; vector solution(vector arr, vector queries) { vector answer; for (vector query : queries) { for (int i = query[0]; i

코딩테스트/프로그래머스(C++)_Level.0

[프로그래머스/C++] Lv.0 n보다 커질 때까지 더하기

문제 코드 #include #include #include using namespace std; int solution(vector numbers, int n) { int answer = 0; int i = 0; for (i = 0; i < numbers.size(); ++i) { if (answer

코딩테스트/프로그래머스(C++)_Level.0

[프로그래머스/C++] Lv.0 할 일 목록

문제 코드 #include #include #include using namespace std; vector solution(vector todo_list, vector finished) { vector answer; for (int i = 0; i < todo_list.size(); ++i) { if (!finished[i]) { answer.emplace_back(todo_list[i]); } } return answer; }

코딩테스트/프로그래머스(C++)_Level.0

[프로그래머스/C++] Lv.0 5명씩

문제 코드 #include #include #include using namespace std; vector solution(vector arr, vector queries) { vector answer; for (vector query : queries) { for (int i = query[0]; i

코딩테스트/프로그래머스(C++)_Level.0

[프로그래머스/C++] Lv.0 홀수 vs 짝수

문제 코드 using namespace std; int solution(vector num_list) { int answer = 0; int odd = 0; int even = 0; for(int i = 0; i even) ? odd : even; }

mane
'코딩테스트' 태그의 글 목록 (7 Page)