WookjeBlog
    • 블로그
    • 소개
    • 태그
    • 수업/강의
    • 라이브러리

    Wookje blog

    알고리즘 블로그였던 것

    Featured Posts
    • [BOJ] 1793 : 타일링

      1793 : 타일링 풀이 타일링 가즈아~~~!!! 코드 #include <iostream> #include <string> #include <algorithm> using namespace std; int n; string dp[255] = { "1", "1" }; string deohagi(string a, string b) { int sum = 0; string res; while (!a.empty() || !b.empty() || sum) { if (!a.empty()) sum += a.back() - '0', a.pop_back(); if (!b.empty()) sum += b.back() - '0', b.pop_back(); res.push_back((sum % 10) + '0'); sum /= 10; } reverse(res.begin(), res.end()); return res; } int...

      boj dynamic-programming string

      wookje.kwon's profile image

      wookje.kwon

      2018-03-13 12:43

    • [BOJ] 10757 : 큰 수 A+B

      10757 : 큰 수 A+B 풀이 더하기 가즈아~! 코드 #include <iostream> #include <string> #include <algorithm> using namespace std; string deohagi(string a, string b) { int sum = 0; string res; while (!a.empty() || !b.empty() || sum) { if (!a.empty()) sum += a.back() - '0', a.pop_back(); if (!b.empty()) sum += b.back() - '0', b.pop_back(); res.push_back((sum % 10) + '0'); sum /= 10; } reverse(res.begin(), res.end()); return res; } int main() { cin.tie(0); ios_base::sync_with_stdio(0); string a, b;...

      boj string

      wookje.kwon's profile image

      wookje.kwon

      2018-03-13 12:42

    • [BOJ] 1700 : 멀티탭 스케줄링

      1700 : 멀티탭 스케줄링 풀이 가장 나중에 사용할 것 부터 뽑아주면 된당 코드 #include <stdio.h> #include <vector> using namespace std; int n, k, ans; int ord[101]; vector<int> tab; int main() { scanf("%d %d", &n, &k); for (int i = 0; i < k; i++) { scanf("%d", &ord[i]); } for (int i = 0; i < k; i++) { int flag = 0; for (int t = 0; t < tab.size(); t++) { if (tab[t] ==...

      boj greedy

      wookje.kwon's profile image

      wookje.kwon

      2018-03-07 17:39

    • [BOJ] 1476 : 날짜 계산

      1476 : 날짜 계산 풀이 역시 중국인은 똑똑해!!! 코드 #include <stdio.h> int m, s, e, x; int main() { scanf("%d %d %d", &e, &s, &m); x = (e*6916+s*4845+m*4200)%7980; return ~printf("%d", x ? x : 7980); } 아무말 백준, 백준 온라인 저지, BOJ, Baekjoon Online Judge, C, C++, 씨, 씨쁠쁠, JAVA, algorithm, 자바, 알고리즘, 자료구조, 문제, 문제 풀이, 풀이

      boj math chinese-remainder-theorem

      wookje.kwon's profile image

      wookje.kwon

      2018-02-18 18:35

    • [BOJ] 5543 : 상근날드

      5543 : 상근날드 풀이 조아조아 코드 #include <stdio.h> #include <algorithm> int a, b, c, r, i = 2; int main() { while (i--) scanf("%d %d %d", &a, &b, &c), r += std::min({ a,b,c }); return ~printf("%d", r - 50); } 아무말 백준, 백준 온라인 저지, BOJ, Baekjoon Online Judge, C, C++, 씨, 씨쁠쁠, JAVA, algorithm, 자바, 알고리즘, 자료구조, 문제, 문제 풀이, 풀이

      boj naive

      wookje.kwon's profile image

      wookje.kwon

      2018-02-18 14:34

    • [BOJ] 2698 : 인접한 비트의 개수

      2698 : 인접한 비트의 개수 풀이 그리워하면 언젠가 만나게 되는 코드 #include <stdio.h> int q, n, k, d[111][111][2]; int main() { d[1][0][0] = d[1][0][1] = 1; for (n = 2; n <= 100; n++) for (k = 0; k < n; k++) d[n][k][0] = d[n-1][k][0] + d[n-1][k][1], d[n][k][1] = d[n-1][k][0] + (k ? d[n-1][k-1][1] : 0); for (scanf("%d", &q); q--;) scanf("%d %d", &n, &k), printf("%d\n", d[n][k][0] + d[n][k][1]); return 0; } 아무말 백준, 백준 온라인...

      boj acm-icpc dynamic-programming

      wookje.kwon's profile image

      wookje.kwon

      2018-02-15 23:38

    • [BOJ] 9084 : 동전

      9084 : 동전 풀이 그리워하면 언젠가 만나게 되는 코드 #include <stdio.h> #include <string.h> int main() { int T, N, M, p, i, j, n[21], d[10001]; scanf("%d", &T); while (T--) { scanf("%d", &N); memset(n, 0, sizeof(n)); memset(d, 0, sizeof(d)); for (i = 1; i <= N; i++) scanf("%d", &n[i]); scanf("%d", &M); d[0] = 1; for (i = 1; i <= N; i++) for (j = 0; j <= M - n[i]; j++) d[j + n[i]] +=...

      boj acm-icpc dynamic-programming

      wookje.kwon's profile image

      wookje.kwon

      2018-02-15 21:44

    • [BOJ] 1783 : 병든 나이트

      1783 : 병든 나이트 풀이 깁잇투유마눈눈눈눈눈눈눈빛 쏟아지는마터터터터터터터터치 코드 #include <stdio.h> int n, m; int main() { scanf("%d %d", &n, &m); if (n == 1) puts("1"); else if (n == 2) { if (m <= 6) printf("%d", (m + 1) / 2); else puts("4"); } else { if (m <= 4) printf("%d", m); else if (m == 5 || m == 6) puts("4"); else printf("%d", m - 2); } return 0; } 아무말 백준, 백준 온라인...

      boj naive greedy

      wookje.kwon's profile image

      wookje.kwon

      2018-02-15 21:32

    • [BOJ] 1410 : 패턴의 개수

      1410 : 패턴의 개수 풀이 bitmask dp를 해보자! 근데 이거 풀이를 어떻게 써야하지 dp[len][bit] = 패턴의 길이를 len까지만 놓고 볼 때, 마스킹 된 패턴에만 일치하는 길이 len짜리 문자열의 수 코드 #include <iostream> #include <string> using namespace std; const int mod = 1000003; int n, k; int dp[50][1 << 15]; string str[15]; int main() { cin.tie(0); ios_base::sync_with_stdio(0); cin >> n >> k; for (int i = 0; i < n; i++) cin >> str[i]; int len...

      boj dynamic-programming bitmask

      wookje.kwon's profile image

      wookje.kwon

      2018-02-15 21:32

    • [BOJ] 1051 : 숫자 정사각형

      1051 : 숫자 정사각형 풀이 주위를 둘러보면 온통 네모난 것들 뿐인데~ 코드 #include <stdio.h> int n, m, k, i, j; char a[55][55]; int main() { scanf("%d %d", &n, &m); for (i = 0; i < n; i++) scanf("%s", a[i]); k = n < m ? n : m; while (k--) for (i = 0; i < n - k; i++) for (int j = 0; j < m - k; j++) if (a[i][j] == a[i][j+k]...

      boj naive brute-force

      wookje.kwon's profile image

      wookje.kwon

      2018-02-15 21:12

    • Previous Page
    • 22
    • 23
    • 24
    • 25
    • 26
    • Next Page
    • github
    • facebook
    • rss

    Copyright © Wookje Kwon. All rights reserved.