https://www.acmicpc.net/problem/1929에라토스테네스의 체를 사용하는 문제이다. #include #include #include using namespace std;int main() { cin.tie(0)->sync_with_stdio(false); int min, max; cin >> min >> max; int* arr = new int[max + 1]; arr[0] = 0, arr[1] = 0; for (int i = 2; i