답안 #153840

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
153840 2019-09-16T20:37:08 Z bogdan_buzatu Savrsen (COCI17_savrsen) C++14
30 / 120
17 ms 8440 KB
#include <iostream>
#include <algorithm>
#define pozitie second
#define numar first
using namespace std;

int n,x,sol,ciur[1000100],a,b;
int main(){
    cin>>a>>b;
    if(a==1){
        sol=1;
    }
    for(int i=2;i<=b;i++){
        for(int j=i*2;j<=b;j+=i){
            ciur[j]+=i;
        }
        x=ciur[i]+1-i;
        x=max(x,-x);
        if(i>=a){
            sol+=x;
        }



    }


    cout<<sol;


}
# 결과 실행 시간 메모리 Grader output
1 Correct 2 ms 256 KB Output is correct
2 Correct 2 ms 376 KB Output is correct
3 Incorrect 6 ms 760 KB Output isn't correct
4 Runtime error 11 ms 8312 KB Execution killed with signal 11 (could be triggered by violating memory limits)
5 Runtime error 13 ms 8316 KB Execution killed with signal 11 (could be triggered by violating memory limits)
6 Runtime error 17 ms 8440 KB Execution killed with signal 11 (could be triggered by violating memory limits)
7 Runtime error 14 ms 8440 KB Execution killed with signal 11 (could be triggered by violating memory limits)
8 Runtime error 13 ms 8412 KB Execution killed with signal 11 (could be triggered by violating memory limits)