Search
Duplicate
🌐

No.1920

std::binary_search()를 이용해도 좋고, binary_search를 직접 구현해도 좋을거 같아요
로직 수행에 있어서 시간 초과가 날 일이 없어야 하는데, 시간 초과가 난다면 입출력 스트림 버퍼를 고려해보면 좋을거 같아요. (vector 컨테이너 이용 문제인 줄 알았으나, 그렇지 않았음)
1.
scanf, printf를 이용
2.
cin.tie(NULL); cout.tie(NULL); std::ios_base::sync_with_stdio(false); 를 이용
cin, cout 속도 높이기 및 주의 사항
1.
scanf, printf와 섞어 사용하지 말 것
ios_base::sync_with_stdio(false);This disables the synchronization between the C and C++ standard streams. By default, all standard streams are synchronized, which in practice allows you to mix C- and C++-style I/O and get sensible and expected results.