GithubHelp home page GithubHelp logo

class-intermediate's Introduction

main

NPC 중급반

NPC 중급반에 오신 걸 환영합니다! 🤗

중급반은 학부 수준의 자료구조 및 알고리즘을 중심으로 진행합니다.
스터디는 C++로 이뤄지기에, C++ 기초 문법과 STL을 익힌 후에 참여하는 것을 권장합니다.

Curriculum 📋

  1. 문제 해결 전략
  2. 완전 탐색 & 분할 정복
  3. 그리디 알고리즘
  4. 다이내믹 프로그래밍
  5. 이진 탐색
  6. DFS & BFS
  7. 최단 경로 탐색
  8. 비트마스킹
  9. 최소 스패닝 트리

[보충 자료]
A. 큐, 스택, 데크
B. 트리와 그래프
C. 우선순위 큐와 힙

Guideline 🔨

📦class-intermediate
┣ 📂1. Intro
┃ ┣ 📜example1.cpp
┃ ┣ 📜example2.cpp
┃ ┗ 📜README.md
┣ 📂2. Brute Force & Divide and Conquer
┃ ┣ 📜example1.cpp
┃ ┣ 📜example2.cpp
┃ ┗ 📜README.md
┃ ...
┗ 📜README.md

이 repository의 구조는 위와 같습니다. 각 폴더별로 README에 해당 part의 내용이 있고, 예제 및 연습 문제 등의 소스 코드가 .cpp 확장자로 있습니다. 따라서 원하는 part의 폴더를 누르면 바로 아래 README로 내용이 표시되고, 소스 코드를 참고하고 싶다면 그 part에서 원하는 cpp 파일을 확인하면 됩니다.

Source 🔍

일부 내용을 종만북(구종만, "알고리즘 문제 해결 전략", 인사이트(2012))에서 차용했습니다.

Contributors 😎

최재민 @dotoleeoak - 교안 및 repo 전반 제작
김주영 @illuminoplanet - 문제 선별
이승재 @leesj10147 - 문제 선별

class-intermediate's People

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

class-intermediate's Issues

1541번 - 파싱 이용

#include <bits/stdc++.h>
#define endl '\n'
using namespace std;

typedef long long ll;
typedef pair<int, int> pii;

int main(void)
{
    ios_base::sync_with_stdio(false);
    cin.tie(nullptr);

    string s; cin >> s;
    int n = s.size();

    vector<int> number;
    int minus = 0;
    for (int i = 0; i < n; i++)
    {
        if (isdigit(s[i]))
        {
            int j = i;
            while (j+1 < n && isdigit(s[j+1])) j++;
            int parsed = stoi(s.substr(i, j-i+1));
            number.push_back(parsed);
            i = j;
        }
        if (!minus && s[i] == '-') minus = number.size();
    }

    if (!minus) minus = number.size();

    int result = accumulate(number.begin(), number.begin()+minus, 0)-accumulate(number.begin()+minus, number.end(), 0);
    cout << result << endl;
    return 0;
}

9461번 - 탑다운 DP

#include <bits/stdc++.h>
#define endl '\n'
using namespace std;

typedef long long ll;
typedef pair<int, int> pii;

ll cache[101];

//D[N] = D[N-1] + D[N-5]
ll padovan(int n)
{
    ll& c = cache[n];
    if (c != -1) return c;
    if (n <= 3) return 1;
    if (n == 4 || n == 5) return 2;
    ///////////////////////////////////////////////
    return c = padovan(n-1)+padovan(n-5);
}

int main(void)
{
    ios_base::sync_with_stdio(false);
    cin.tie(nullptr);

    memset(cache, -1, sizeof(cache));

    int T; cin >> T;
    while (T--)
    {
        int n; cin >> n;
        cout << padovan(n) << endl;
    }

    return 0;
}

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.