# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
1175126 | nuutsnoynton | Savrsen (COCI17_savrsen) | C++20 | 1071 ms | 78688 KiB |
#include<bits/stdc++.h>
using namespace std;
using ll = long long;
const ll N = 1e7 + 2;
ll val[N] = {0};
int main() {
ll n, m, r, x, y, i, j, ans, t, lo, hi;
for (i = 0; i <= 1e7; i ++) {
val[i]= i;
}
for (i = 1; i <= 1e7; i ++) {
for ( j = 2 * i; j <= 1e7;j += i) {
val[j] -= i;
}
}
cin >> lo >> hi;
ans = 0;
for (i = lo; i <= hi; i ++) {
ans += abs(val[i]);
}
cout<< ans << endl;
}
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |