Cod sursa(job #3343885)
| Utilizator | Data | 28 februarie 2026 18:01:01 | |
|---|---|---|---|
| Problema | Ciurul lui Eratosthenes | Scor | 10 |
| Compilator | cpp-64 | Status | done |
| Runda | Arhiva educationala | Marime | 0.28 kb |
#include<bits/stdc++.h>
using namespace std;
ifstream fin ("ciur.in");
ofstream fout ("ciur.out");
long long int N,a[2000001],k;
int main(){
fin>>N;
for(int i=2; i*i<=N; ++i)
for(int j=i; j*i<=N; ++j){
a[i*j]=1;
k++;
}
fout<<N-(k+1);
}