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

    Wookje blog

    알고리즘 블로그였던 것

    Featured Posts
    • [BOJ] 15973 : 두 박스

      15973 : 두 박스 풀이 노가다를 해보자~ 사실 노가다 안 해도 됨 코드 #include <iostream> #include <string> using namespace std; int x[5], y[5]; string gogo() { if (x[0] == x[3] && y[0] == y[3] || x[1] == x[2] && y[0] == y[3] || x[0] == x[3] && y[1] == y[2] || x[1] == x[2] && y[1] == y[2]) return "POINT"; if (x[0] == x[3] && y[2] <= y[0] && y[0] <= y[3] || x[0] ==...

      boj koi naive

      wookje.kwon's profile image

      wookje.kwon

      2018-08-27 20:19

    • 제2회 천하제일 코딩대회 예선 문제 풀이

      대회 정보: https://www.acmicpc.net/contest/view/303 문제 목록: https://www.acmicpc.net/category/detail/1889 출제 및 검수 : bryan, chogahui05, exqt, jh05013, jwvg0425, pinch3773, wookje 문제 A B C D E 출제자 jwvg0425 wookje wookje wookje wookje 예선 출제에 수고해주신, 그리고 본선도 수고해주실 출제진 여러분들께 감사의 말씀 올립니다. A. 고장난 시계 풀이 15885 : 고장난 시계 흘러간 시간이 t시간일 때, 정상 시계는 t % 12를 가리키고 상대속도 x가 곱해진 시계는 t * x % 12를 가르킨다. 이를 이용해 수식을 유도하여 답을 구할 수...

      chat sunrin

      wookje.kwon's profile image

      wookje.kwon

      2018-07-13 22:07

    • [BOJ] 14971 : A Garden With Ponds

      14971 : A Garden With Ponds 풀이 코드 개더러워… 코드 #include <cstdio> #include <algorithm> #define REP(k,l,r) for(int k=(l);k<(r);k++) using namespace std; int n, m, a[12][12]; int main() { while (1) { scanf("%d %d", &n ,&m); if (!n && !m) return 0; REP(i,1,n+1) REP(j,1,m+1) scanf("%d", &a[i][j]); int res = 0; REP(i,1,n+1) REP(j,1,m+1) { REP(x,i+2,n+1) REP(y,j+2,m+1) { int mo = 1e9; REP(k,i,x+1) mo = min(mo, min(a[k][j], a[k][y])); REP(k,j,y+1) mo = min(mo, min(a[i][k], a[x][k])); int mi = -1,...

      boj acm-icpc naive

      wookje.kwon's profile image

      wookje.kwon

      2018-06-30 17:34

    • [BOJ] 14969 : Taro`s Shopping

      14969 : Taro’s Shopping 풀이 별빛이 내린다 코드 #include <cstdio> int n, m, a[1001]; int main() { while (1) { scanf("%d %d", &n, &m); if (!n && !m) { return 0; } for (int i = 0; i < n; i++) { scanf("%d", a + i); } int res = -1; for (int i = 0; i < n; i++) { for (int j = 0; j < n; j++) { if (i == j)...

      boj acm-icpc naive

      wookje.kwon's profile image

      wookje.kwon

      2018-06-30 17:33

    • [BOJ] 10531 : Golf Bot

      10531 : Golf Bot 풀이 골프 봇이 칠 수 있는 거리를 체킹 배열 a와 b에 체크했다고 생각하자. 두 배열을 bool 곱셈한 배열을 c배열이라고 하자. 만약 a[i] != 0 && b[j] != 0라면 c[i+j] != 0도 성립한다. 코드 #define _USE_MATH_DEFINES #include <cstdio> #include <cmath> #include <complex> #include <vector> #include <algorithm> using namespace std; #define sz(v) ((int)(v).size()) #define all(v) (v).begin(),(v).end() typedef complex<double> base; void fft(vector<base> &a, bool invert) { int n = sz(a); for (int i=1,j=0;i<n;i++){ int...

      boj acm-icpc fast-fourier-transform math

      wookje.kwon's profile image

      wookje.kwon

      2018-06-30 15:59

    • [BOJ] 1067 : 이동

      1067 : 이동 풀이 . 코드 #define _USE_MATH_DEFINES #include <cstdio> #include <cmath> #include <complex> #include <vector> #include <algorithm> using namespace std; #define sz(v) ((int)(v).size()) #define all(v) (v).begin(),(v).end() typedef complex<double> base; void fft(vector<base> &a, bool invert) { int n = sz(a); for (int i=1,j=0;i<n;i++){ int bit = n >> 1; for (;j>=bit;bit>>=1) j -= bit; j += bit; if (i < j) swap(a[i],a[j]); } for (int len=2;len<=n;len<<=1){ double ang = 2*M_PI/len*(invert?-1:1); base wlen(cos(ang),sin(ang)); for (int i=0;i<n;i+=len){...

      boj fast-fourier-transform

      wookje.kwon's profile image

      wookje.kwon

      2018-06-30 09:21

    • [BOJ] 1074 : Z

      1074 : Z 풀이 약간의 커팅이 필요하다. 코드 #include <cstdio> #include <cstdlib> int n, r, c; void f(int x, int y, int s, int cnt) { if (s == 0 && x == r && y == c) { printf("%d\n", cnt); exit(0); } if (r < x || c < y || x + s*2 <= r || y + s*2 <= c) return; int nx = x + s, ny = y + s,...

      boj divide-and-conquer

      wookje.kwon's profile image

      wookje.kwon

      2018-06-24 22:17

    • [BOJ] 10451 : 순열 사이클

      10451 : 순열 사이클 풀이 . 코드 #include <iostream> #include <vector> #include <algorithm> #include <cstring> using namespace std; int t, n; vector<int> a[1001]; int ans, chk[1001]; void dfs(int now) { chk[now] = 1; for (int i = 0; i < a[now].size(); i++) if (chk[a[now][i]] != 1) dfs(a[now][i]); } int main() { cin >> t; while (t--) { cin >> n; for (int i = 1; i <= n; i++) { int v; cin >> v;...

      boj graph dfs

      wookje.kwon's profile image

      wookje.kwon

      2018-06-24 22:15

    • [BOJ] 14226 : 이모티콘

      14226 : 이모티콘 풀이 . 코드 #include <cstdio> #include <cstring> int n, dp[12345][23]; int min(int a, int b) { return a < b ? a : b; } int go(int now, int cnt) { if (now == 0 || cnt > 20) return 1e9; if (now == n) return 0; if (dp[now][cnt] != -1) return dp[now][cnt]; int ret = go(now - 1, cnt + 1) + 1; for (int i = 2; i * now...

      boj dynamic-programming

      wookje.kwon's profile image

      wookje.kwon

      2018-06-24 22:11

    • [BOJ] 1415 : 사탕

      1415 : 사탕 풀이 . 코드 #include <cstdio> #include <vector> using namespace std; int n, ccnt[10001]; long long d[500005]; vector<int> cvec; bool p[500005]; void getprimes() { for (int i = 2; i <= 500000; i++) p[i] = 1; for (int i = 2; i*i <= 500000; i++) if (p[i]) for (int j = i*i; j <= 500000; j += i) p[j] = 0; } int main() { getprimes(); scanf("%d", &n); int zcnt = 1; d[0]...

      boj dynamic-programming

      wookje.kwon's profile image

      wookje.kwon

      2018-06-24 22:09

    • Previous Page
    • 13
    • 14
    • 15
    • 16
    • 17
    • Next Page
    • github
    • facebook
    • rss

    Copyright © Wookje Kwon. All rights reserved.