제출 #482193

#제출 시각아이디문제언어결과실행 시간메모리
482193MilosMilutinovicSavrsen (COCI17_savrsen)C++14
120 / 120
1042 ms39444 KiB
#include <bits/stdc++.h> #define ff(i,a,b) for(int (i) = (a); (i) <= (b); ++(i)) #define fb(i,a,b) for(int (i) = (a); (i) >= (b); --(i)) #define pb push_back using namespace std; int sum[10000005]; int main() { ios_base::sync_with_stdio(false); cin.tie(0); ff(i,1,1e7){ for(int j = i + i; j <= 1e7; j += i)sum[j] += i; } int a, b; cin >> a >> b; long long ans = 0; ff(i,a,b)ans += abs(i-sum[i]); cout << ans; return 0; }

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

savrsen.cpp: In function 'int main()':
savrsen.cpp:2:27: warning: unnecessary parentheses in declaration of 'i' [-Wparentheses]
    2 | #define ff(i,a,b) for(int (i) = (a); (i) <= (b); ++(i))
      |                           ^
savrsen.cpp:15:2: note: in expansion of macro 'ff'
   15 |  ff(i,1,1e7){
      |  ^~
savrsen.cpp:2:27: warning: unnecessary parentheses in declaration of 'i' [-Wparentheses]
    2 | #define ff(i,a,b) for(int (i) = (a); (i) <= (b); ++(i))
      |                           ^
savrsen.cpp:21:2: note: in expansion of macro 'ff'
   21 |  ff(i,a,b)ans += abs(i-sum[i]);
      |  ^~
#Verdict Execution timeMemoryGrader output
Fetching results...