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

    Wookje blog

    알고리즘 블로그였던 것

    Featured Posts
    • [BOJ] 1302 : 베스트셀러

      1302 : 베스트셀러 풀이 다정했던 사람이여 나를 잊었나 벌써 나를 잊어버렸나 코드 #include <iostream> #include <string> #include <map> using namespace std; int n, rn; string s, rs; map<string, int> m; int main() { ios_base::sync_with_stdio(0); cin.tie(0); cin >> n; while (n--) cin >> s, m[s]++; for (auto it : m) if (rn < it.second) rn = it.second, rs = it.first; cout << rs; return 0; } 아무말 백준, 백준 온라인 저지, BOJ, Baekjoon Online Judge, C,...

      boj string map

      wookje.kwon's profile image

      wookje.kwon

      2018-03-27 16:51

    • [BOJ] 1297 : TV 크기

      1297 : TV 크기 풀이 수학 조아!!! 가로 세로 n:m의 비율이 주어지면 이 때의 대각선 비율을 d라고 하자. 이제 이걸 주어진 대각선 길이에 맞춰 나누고 곱하고 으쌰으쌰 해보자. 코드 #include <cstdio> #include <cmath> int main() { int k, a, b; scanf("%d %d %d", &k, &a, &b); double d = k/sqrt(a*a+b*b); printf("%d %d", (int)(a*d), (int)(b*d)); return 0; } 아무말 백준, 백준 온라인 저지, BOJ, Baekjoon Online Judge, C, C++, 씨, 씨쁠쁠, JAVA, algorithm, 자바, 알고리즘, 자료구조,...

      boj math

      wookje.kwon's profile image

      wookje.kwon

      2018-03-27 14:38

    • [BOJ] 2293 : 동전 1

      2293 : 동전 1 풀이 dp[i] = 동전 i원을 만들 수 있는 방법의 수 dp[i] = dp[i - coins[]] 코드 main() { int N, K, x, i, j; int dp[10001] = { 1, }; scanf("%d %d", &N, &K); for (i = 1; i <= N; i++) { scanf("%d", &x); for (j = 0; j <= K - x; j++) dp[j + x] += dp[j]; } printf("%d", dp[K]); } 아무말 백준, 백준 온라인 저지, BOJ, Baekjoon...

      boj dynamic-programming

      wookje.kwon's profile image

      wookje.kwon

      2018-03-27 14:23

    • [BOJ] 1225 : 이상한 곱셈

      1225 : 이상한 곱셈 풀이 눈누난 코드 #include <cstdio> long long i, s, r; char a[10001], b[10001]; int main() { scanf("%s %s", a, b); for (i = 0; a[i]; i++) s += a[i] - '0'; for (i = 0; b[i]; i++) r += s * (b[i] - '0'); printf("%lld", r); return 0; } 아무말 백준, 백준 온라인 저지, BOJ, Baekjoon Online Judge, C, C++, 씨, 씨쁠쁠, JAVA, algorithm, 자바, 알고리즘, 자료구조, 문제, 문제 풀이, 풀이...

      boj math

      wookje.kwon's profile image

      wookje.kwon

      2018-03-26 09:13

    • [BOJ] 1011 : Fly me to the Alpha Centauri

      1011 : Fly me to the Alpha Centauri 풀이 1 2 3 ... i-1 i i-1 ... 3 2 1 이렇게 삼각형으로 증가/감소하는 수열 s를 생각해보자. s의 원소들의 합은 i^2이다. dist = end - start일 때, dist가 음수가 되지 않는 가장 큰 i를 골라서 dist - i^2를 해주자. 남은 거리는 1와 i 사이에 숫자를 잘 골라서 채워넣을 수 있다. 코드 #include <stdio.h> #include <math.h> int main() { int tc; for (scanf("%d", &tc); tc; tc--) {...

      boj math

      wookje.kwon's profile image

      wookje.kwon

      2018-03-25 19:20

    • [BOJ] 10870 : 피보나치 수 5

      10870 : 피보나치 수 5 풀이 엠티 가즈아~ 코드 #include <stdio.h> int n, a, b = 1; int main() { scanf("%d", &n); while (n--) { b += a; a = b - a; } printf("%d", a); return 0; } 아무말 백준, 백준 온라인 저지, BOJ, Baekjoon Online Judge, C, C++, 씨, 씨쁠쁠, JAVA, algorithm, 자바, 알고리즘, 자료구조, 문제, 문제 풀이, 풀이

      boj dynamic-programming

      wookje.kwon's profile image

      wookje.kwon

      2018-03-23 11:42

    • [BOJ] 11727 : 2xn 타일링 2

      11727 : 2xn 타일링 2 풀이 끄으 코드 main() { int n, a = 0, b = 1, i; scanf("%d", &n); for (i = 0; i < n; ++i) { b += a * 2; a = b - a * 2; b %= 10007; } printf("%d", b); } 아무말 백준, 백준 온라인 저지, BOJ, Baekjoon Online Judge, C, C++, 씨, 씨쁠쁠, JAVA, algorithm, 자바, 알고리즘, 자료구조, 문제, 문제 풀이, 풀이

      boj dynamic-programming

      wookje.kwon's profile image

      wookje.kwon

      2018-03-22 18:45

    • [BOJ] 11726 : 2xn 타일링

      11726 : 2xn 타일링 풀이 쓰기 귀찮다 다른 블로그에 그림이 포함된 친절한 풀이가 많으니 다른 블로그를 참고 해주시면 감사하겠습니다. 코드 #include <stdio.h> int n, dp[1010]; int main() { dp[0] = dp[1] = 1; scanf("%d", &n); for (int i = 2; i <= n; i++) dp[i] = (dp[i - 1] + dp[i - 2]) % 10007; printf("%d", dp[n] % 10007); return 0; } main(n,a,b) { scanf("%d",&n); a=b=1; while(n--) { b+=a; a=b-a; b%=10007; } printf("%d",a); } 아무말...

      boj dynamic-programming

      wookje.kwon's profile image

      wookje.kwon

      2018-03-22 18:42

    • [BOJ] 1188 : 음식 평론가

      1188 : 음식 평론가 풀이 n과 m의 최대공약수를 이용해 문제에 접근해보자. n과 m이 서로소인 경우, 서로소가 아닌 경우로 나눌 수 있다. g = gcd(n, m)이라고 하자. f(n, m)을 n과 m에 대한 답을 구하는 함수라고 하자. f(n, m) = f(n/g, m/g) * g임은 자명하게 알 수 있다. 그러므로 g != 1인 경우의 답은 g = 1인 경우의 답을 알면 구할 수 있고 우린 모든 경우에 대해 답을 구할 수 있게 된다. 어떤 a, b에 대해서 gcd(a,...

      boj math

      wookje.kwon's profile image

      wookje.kwon

      2018-03-22 16:39

    • [BOJ] 1145 : 적어도 대부분의 배수

      1145 : 적어도 대부분의 배수 풀이 조아~ 코드 #include <stdio.h> int i,j,c,a[5]; int main() { for (i=0;i<5;i++)scanf("%d",&a[i]); for (i=1;;i++){ for(j=0,c=0;j<5;j++)if(i%a[j]==0)c++; if(c>=3)return ~printf("%d",i); } return 0; } 아무말 백준, 백준 온라인 저지, BOJ, Baekjoon Online Judge, C, C++, 씨, 씨쁠쁠, JAVA, algorithm, 자바, 알고리즘, 자료구조, 문제, 문제 풀이, 풀이

      boj math

      wookje.kwon's profile image

      wookje.kwon

      2018-03-22 10:18

    • Previous Page
    • 20
    • 21
    • 22
    • 23
    • 24
    • Next Page
    • github
    • facebook
    • rss

    Copyright © Wookje Kwon. All rights reserved.