# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
147589 | 2019-08-30T07:44:10 Z | Ruxandra985 | Savrsen (COCI17_savrsen) | C++14 | 2008 ms | 78712 KB |
#include <cstdio> #include <iostream> #define MAXI 10000010 using namespace std; long long perf[MAXI]; int main() { //freopen ("a.in" , "r" , stdin); //freopen ("a.out" , "w" , stdout); int a, b , i , j; long long sol; scanf ("%d%d",&a,&b); for (i=1;i<=MAXI/2;i++){ for (j = 2 * i ; j<=MAXI ; j+=i) perf[j]+=i; } sol = 0; for (i=a;i<=b;i++) sol = sol + max ((long long)i - perf[i] , perf[i] - (long long)i); printf ("%lld",sol); return 0; }
Compilation message
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Correct | 1880 ms | 78684 KB | Output is correct |
2 | Correct | 1905 ms | 78628 KB | Output is correct |
3 | Correct | 1870 ms | 78628 KB | Output is correct |
4 | Correct | 1872 ms | 78628 KB | Output is correct |
5 | Correct | 2008 ms | 78712 KB | Output is correct |
6 | Correct | 1952 ms | 78636 KB | Output is correct |
7 | Correct | 1884 ms | 78632 KB | Output is correct |
8 | Correct | 1884 ms | 78712 KB | Output is correct |