제출 #40985

#제출 시각아이디문제언어결과실행 시간메모리
40985HassoonySavrsen (COCI17_savrsen)C++14
120 / 120
1511 ms39716 KiB
#include<bits/stdc++.h>
#include<unordered_map>
using namespace std;
typedef long long ll;
typedef double D;
const ll inf=(1ll<<61);
const int mod=1e9+7;
const int MX=1e7+9;
const int SQ=350;
int A,B,F[MX];
int main(){
    scanf("%d%d",&A,&B);
    for(int i=1;i<=B;i++){
        for(int j=i+i;j<=B;j+=i)
            F[j]+=i;
    }
    ll ans=0;
    for(int i=A;i<=B;i++){
        ans+=(abs(i-F[i]));
    }
    cout<<ans<<endl;
}

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

savrsen.cpp: In function 'int main()':
savrsen.cpp:12:24: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
     scanf("%d%d",&A,&B);
                        ^
#Verdict Execution timeMemoryGrader output
Fetching results...