Skip to content

Instantly share code, notes, and snippets.

@rolroralra
Last active August 26, 2021 01:53
Show Gist options
  • Save rolroralra/efc888c3b8e250c776cfbb1dffb2230e to your computer and use it in GitHub Desktop.
Save rolroralra/efc888c3b8e250c776cfbb1dffb2230e to your computer and use it in GitHub Desktop.
Cpp

Make (Build Tool)

https://www.tuwlab.com/index.php?mid=ece&page=2&document_srl=27193


CMake (Build Tool)

https://www.tuwlab.com/index.php?mid=ece&page=2&document_srl=27234 https://www.tuwlab.com/index.php?mid=ece&page=2&document_srl=27260 https://www.tuwlab.com/ece/27270


Lambda in cpp

https://modoocode.com/196


Tuple in cpp

[https://psychoria.tistory.com/180](https://psychoria.tistory.com/180


TODO

Additional

scanf 사용(C 동일) cin 사용 시 sync_with_stdio(false);
문구 추가 이후 코드에 절대 scanf 및 printf 사용금지

#include <bits/stdc++.h>

using namespace std;

int T, N, K;

int main() {
    std::ios::sync_with_stdio(false); // 최초 1회 
    cin.tie(NULL);
    cout.tie(NULL);
    
    #ifdef TEST
    std::ifstream inputFileStream;
    inputFileStream.open("../src/sample_input.txt", std::ios_base::in);
    if (inputFileStream.is_open())
    {
        std::cin.rdbuf(inputFileStream.rdbuf()); // swap
    }
    #endif
    
    cin >> T; 

    for (int test_case = 1; test_case <= T; test_case++) {
        cin >> N >> K;
        
        int result = 0;

        cout << "#" << test_case << " " << result << endl;
    }

    return 0;
}    


Visual Studio 2019 -- scanf 사용금지 설정 해제

https://shek.tistory.com/49 https://royal-jelly.tistory.com/62

// Way1
#define _CRT_SECURE_NO_WARNINGS

// Way2
#pragma warnings(disable: 4996)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment