제출 #151312

#제출 시각아이디문제언어결과실행 시간메모리
151312Linca_RobertSavrsen (COCI17_savrsen)C++14
컴파일 에러
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; }

컴파일 시 표준 에러 (stderr) 메시지

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