일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
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 |
- BFS
- 삼성 SDS 대학생 알고리즘 특강
- 스택
- 백트래킹
- koitp
- Algorithm
- dynamic programming
- PS
- 백준
- 동적 계획법
- C++
- sw expert academy
- SWEA
- dfs
- 잠실
- 맛집
- 시뮬레이션
- 브루트포스
- 해커랭크
- 삼성 기출
- 에라토스테네스의 체
- 완전탐색
- 구현
- BOJ
- 그리디
- 알고리즘
- hackerrank
- DP
- 소수
- 다이나믹 프로그래밍
- Today
- Total
목록해커랭크 (7)
펭로그
문제링크 : https://www.hackerrank.com/challenges/torque-and-development 1234567891011121314151617181920212223242526#include using namespace std;vector p;int f(int a) { return p[a] == a ? a : p[a] = f(p[a]); }void u(int a, int b) { p[f(a)] = f(b); }int main() { int T; cin >> T; while (T--) { int N, M, a, b; long long c, d; cin >> N >> M >> c >> d; p.clear(); p.resize(N); iota(p.begin(), p.end(), 0); ..
문제링크 : https://www.hackerrank.com/challenges/counter-game 1234567891011121314151617181920212223242526272829#include using namespace std; string counterGame(unsigned long long int n) { // Complete this function int cnt = 0; while(n) { n &= (n-1); cnt++; } if(cnt&1) return "Louise"; else return "Richard"; //return cnt%2?"Louise":"Richard";} int main() { int t; cin >> t; for(int a0 = 0; a0 > n; cout
문제링크 : https://www.hackerrank.com/challenges/tower-breakers-1 1234567891011121314151617181920212223242526#include using namespace std; int towerBreakers(int n, int m) { if(m == 1) return 2; if(n % 2) return 1; else return 2;} int main() { int t; cin >> t; for(int i = 0; i > n >> m; int result = towerBreakers(n, m); cout
문제링크 : https://www.hackerrank.com/challenges/sansa-and-xor 1234567891011121314151617181920212223242526272829303132#include using namespace std; int sansaXor(vector arr) { // Complete this function int res = 0; if(!(arr.size() % 2)) return 0; else{ for(int i = 0; i > t; for(int a0 = 0; a0 > n; vector arr(n); for(int arr_i = 0; arr_i > arr[arr_i]; } int result = sansaXor(arr); cout
문제링크 : https://www.hackerrank.com/challenges/flipping-the-matrix 12345678910111213141516171819202122232425262728293031#include using namespace std; int main() { int queries; // 1
문제링크 : https://www.hackerrank.com/challenges/connected-cell-in-a-grid 123456789101112131415161718192021222324252627282930313233343536373839404142#include using namespace std; int mat[10][10];int visited[10][10] = {0,};int max_size = 0; int find(int row, int col){ if(!mat[row][col] || visited[row][col]) return 0; visited[row][col] = 1; int size = 1; int x = row; int y = col; for(int i = -1; i n; ..
문제링크 : https://www.hackerrank.com/challenges/magic-square-forming 전형적인 마방진 알고리즘 문제다.특별할 것은 없고 주어진 조건에 따라서 마방진을 만들 수 있는 모든 경우의 수를 구한 다음 일일이 대조시키는 방식으로 풀었다. 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859#include using namespace std; int main() { /* Enter your code here. Read input from STDIN. Print output to STDOUT */ // input numbers ..