Submission #151312

# Submission time Handle Problem Language Result Execution time Memory
151312 2019-09-02T12:40:02 Z Linca_Robert Savrsen (COCI17_savrsen) C++14
Compilation error
0 ms 0 KB
#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

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