# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
1244839 | warrenn | Savrsen (COCI17_savrsen) | C++20 | 903 ms | 78688 KiB |
#include<bits/stdc++.h>
using namespace std;
#define int long long
const int maxn=1e7;
int tot[maxn+1];
signed main(){
for(int q=1;q<=maxn;q++){
for(int w=2*q;w<=maxn;w+=q){
tot[w]+=q;
}
}
int l,r;
cin>>l>>r;
int ans=0;
for(int q=l;q<=r;q++){
ans+=abs(tot[q]-q);
}
cout<<ans<<endl;
}
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |