제출 #86368

#제출 시각아이디문제언어결과실행 시간메모리
86368dimash241Savrsen (COCI17_savrsen)C++17
컴파일 에러
0 ms0 KiB
#include <iostream>
using namespace std;

int f[1010101];
int a, b;

int main () {
	cin >> a >> b;
	for (int i = 1; i <= b; ++i) {
		int j = i + i;
		while (j <= b) {
			f[j] += i;
			j += i;
		}
	}

	ll ans = 0;
	for (int i = a; i <= b; ++i)
		ans += abs(f[i] - i);
	cout << ans;
}

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

savrsen.cpp: In function 'int main()':
savrsen.cpp:17:2: error: 'll' was not declared in this scope
  ll ans = 0;
  ^~
savrsen.cpp:19:3: error: 'ans' was not declared in this scope
   ans += abs(f[i] - i);
   ^~~
savrsen.cpp:19:3: note: suggested alternative: 'abs'
   ans += abs(f[i] - i);
   ^~~
   abs
savrsen.cpp:20:10: error: 'ans' was not declared in this scope
  cout << ans;
          ^~~
savrsen.cpp:20:10: note: suggested alternative: 'abs'
  cout << ans;
          ^~~
          abs