백준 16396 [c++]


백준 16396 [c++]

#include <iostream> using namespace std; int arr[10001]; int main(void) { fill_n(arr, 10001, 0); int point1min = 99999, point2max = -1, ct = 0; bool smooth = true; int num; cin >> num; for (int i = 0; i < num; i++) { int point1, point2; cin >> point1 >> point2; if (point1 < point1min) point1min = point1; if (point2 > point2max) point2max = point2; for (int j = point1; j < point2; j++) { if (arr[j] == true) continue; arr[j] = true; } } for (int k = point1min; k < point2max; k++) { if (arr[k] == t...



원문링크 : 백준 16396 [c++]