일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
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 |
- 2단계로킹
- 의미와 무의미의 경계에서
- UActor
- C++
- 언리얼 커스텀 플러그인
- 1967번
- oracle
- hackerank
- 셰그먼트트리
- 데이터베이스 배움터
- 민겸수
- 트랜잭션 관리
- Unreal
- 백준
- OS
- 비재귀셰그먼트
- Linux
- objtofbx
- FBX
- UnrealMP
- SQL
- 오손데이터읽기
- 언리얼 플러그인
- 5639
- 실습
- 1759번
- Security
- 1253번
- command not found
- 백준 1253번
- Today
- Total
목록코딩 인터뷰/C++ (36)
fatalite
#include using namespace std;int solution(int n){ int ans = 0; while(n != 0) { if(n % 2 == 0) { n /= 2; continue; } else { n -= 1; ans++; } } return ans;}
순열 구현 방법 순간 헷갈려서 애먹은그래도 천천히 생각하니깐 됐다#include #include #include #include #include using namespace std;vector> dupPermutations;pair Simulate( vector> users, vector emoticons, vector discountPercents){ int emoticonPlus = 0; int emoticonMoney = 0; for(vector user : users) { int userSum = 0; for(int j = 0; j = user[1]) { emoticonPlus +=..
vector.size()의 리턴 값은 unsigned다.....segmentation fault나서 헤매었다#include #include #include using namespace std;vector GetIce(int first){ int k = first; vector IceArr; while(k != 1) { IceArr.push_back(k); if(k % 2 == 0) { k = k / 2; } else { k = k * 3 + 1; } } IceArr.push_back(1); return IceArr;}vector solutio..
다익스트라#include #include #include #include #include using namespace std;int MAX_NUM = 100000000;vector> GraphEdges;vector Dijkstra(int start){ vector Dist; for(int i = 0 ; i q; q.push(start); while(!q.empty()) { int cur = q.front(); q.pop(); for(int i = 0 ; i words) { // Make Edges words.push_back(begin); GraphEdges = vector>(words.size()); for..
관련 개념n진법, 구현 이거 이렇게 풀어도 되는건가;; #include #include #include #include #include using namespace std;vector Get10ToN(int n, int number){ vector answer; if(number == 0) { answer.push_back(0); } while(number > 0) { answer.push_back(number % n); number /= n; } std::reverse(answer.begin(), answer.end()); return answer;}string solution(int n, int t, int m, i..
주어진 내용을 그대로 구현하면 된다.내가 구현하려고 했으면 시간이 오래 걸렸을 듯 하다. 관련된 내용은- 스택(그러나, 나는 올바른 괄호 구하는데 스택을 사용하지 않았다.)- 재귀(스택과 재귀!)- string을 잘 다룰 수 있는가?#include #include #include #include using namespace std;bool isRight(string s){ int cnt = 0; for(char c : s) { if(c == '(') { cnt++; } else { if(cnt == 0) { return false; ..
#include #include #include using namespace std;vector solution(int n) { int now = 1; vector> snale = vector>(); // 2차원 배열 for(int i = 1 ; i line = vector(); for(int j = 1; j answer; for(vector line : snale) { for(int a : line) { answer.push_back(a); } } return answer;}
문제 문제 난이도 : 골드 1 문제 분류: 셰그먼트 트리 문제 리뷰 코드 자체는 알고리즘 코딩 테스트 DO IT 편을 참조하였다. 재귀 셰그먼트 참고 해서 구현 했다가, 안되어서 비재귀 셰그먼트 트리로 구현하였는데 이게 더 나은 것 같다는 생각이.. 재귀 셰그먼트 안되었던게 로직이 이상한게 아니었고, "\n"을 안해줘서 틀렸다고 뜬 거였다.. 문제 소스 코드 #include #include #include #include #include #include #include #include using namespace std; int N,M,K; static vector Tree; void Init() { ios_base::sync_with_stdio(false); cin.tie(NULL); std::cout..
문제 문제 난이도 : 실버 1 문제 분류 : 두 포인터 문제 풀이 및 코드 복잡... #include #include #include #include #include #include #include using namespace std; void Init() { ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL); } int main() { //Initialize Init(); //Input int n, k = 0; cin >> n >> k; vector List; vector Count(100001,0); for (int i = 0; i > Tmp; List.push_back(Tmp); } //M..
문제 문제 난이도: 실버 2 문제 분류: BFS 혹은 DFS 문제 풀이 및 코드 #include #include #include #include #include #include using namespace std; vector Visited; vector Map; int LandNum() { queue q; for (int h = 0; h < Map.size(); ++h) { for (int w = 0; w < Map[h].size(); ++w) { if (Map[h][w] == true) { q.push({ h, w }); } } } int Count = 0; while (!q.empty()) { pair p = q.front(); q.pop(); if (Visited[p.first][p.second]..