Submission #151312

#TimeUsernameProblemLanguageResultExecution timeMemory
151312Linca_RobertSavrsen (COCI17_savrsen)C++14
Compilation error
0 ms0 KiB
#include<bits/stdc++.h>
using namespace std;

int A, B, f[1e7 + 5];
long long ans = 0;
int main(){
    cin >> A >> B;
    for( int i = 1; i <= B; i++ ){
        f[i] -= i;
        for( int j = i + i; j <= B; j += i )
            f[j] += i;
    }
    for( int i = A; i <= B; i++ )
        ans += max( f[i], -f[i] );
    cout << ans << endl;
    return 0;
}

Compilation message (stderr)

savrsen.cpp:4:20: error: size of array 'f' has non-integral type 'double'
 int A, B, f[1e7 + 5];
                    ^