# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
37353 | IvanC | Savrsen (COCI17_savrsen) | C++14 | 2223 ms | 50844 KiB |
This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#include <bits/stdc++.h>
using namespace std;
const int MAXN = 1e7 + 2;
bool primo[MAXN];
int vetor[MAXN];
int main(){
int A,B;
scanf("%d %d",&A,&B);
for(int i = 1;i<=B;i++) vetor[i] = i;
long long resposta = 0;
for(int i = 1;i<=B;i++){
if(i >= A) resposta += abs(vetor[i]);
for(int j = 2*i;j<=B;j+=i){
vetor[j] -= i;
}
}
printf("%lld\n",resposta);
return 0;
}
Compilation message (stderr)
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |