GithubHelp home page GithubHelp logo

bojalgorithm's People

Contributors

heydoy avatar

Watchers

 avatar

bojalgorithm's Issues

c++ 입출력 시간 단축

  1. c++과 c의 표준 스트림 동기화 끄기
ios_base::sync_with_stdio(false); // 0또는 false
cin.tie(0); // 0 또는 NULL
cout.tie(0);

c와 c++를 섞어 쓸 경우 입출력 순서가 보장되지 않는다. 순서가 섞이거나 c++ 스크림들의 스레드 안전성이 보장되지 않음.

그러나 c++ 과 c의 표준 스트림 동기화를 끄게 되면 입출력 연산속도를 크게 향상시킬 수 있기 때문에 위 코드를 넣어주는 편이 좋음.

  1. endl 대신에 '\n' 쓰기
    endl은 개행 뿐 아니라 내부 버퍼도 비우기 때문에 속도가 느림.

읽기 좋은 참고내용

10진수 > 2진수, 2진수 > 10진수로 변환하기

참고

10진수 > 2진수

var value = 100
var result = String(value,radix: 2)

2진수 > 10진수

var value = "1100100"
var result = Int(value,radix: 2) //  Optional

2진수 > 16진수

2진수를 한 번 10진수로 바꾸고 나서 16진수로 변환해야한다.

var value = "11001001"
var intValue : Int = Int(value,radix: 2)!
var result : String = String(result, radix : 16)

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.