Untitled

 avatar
unknown
plain_text
5 months ago
356 B
3
Indexable
#include <bits/stdc++.h>
using namespace std;
int main() {
int n;
cin>>n;
vector<int>pds(n);
for(int i = 2; i <= n; ++i){
    if(pds[i] == 0){
        for (int j = 0; j <= n; ++j){
            pds[j]++;
        }
    }
}
int almost = 0;
for(int i = 2; i <= n; ++i){
    if(pds[i] == 2){
        almost++;
    }
}
cout<<almost<<endl;
}
Editor is loading...
Leave a Comment