제출 #1039369

#제출 시각아이디문제언어결과실행 시간메모리
10393697againSavrsen (COCI17_savrsen)C++17
30 / 120
459 ms39516 KiB
#include <bits/stdc++.h>
#define FAST ios::sync_with_stdio(0);cout.tie(0);cin.tie(0)

using namespace std ;

void slv()
{
    int l , r ;
    cin >> l >> r ;

    vector <int> sum(1e7+1 , 0) ;
    for(int i = 2 ; i <= 1e7 ; i++)
    {
        for(int j = 2*i ; j <= 1e7 ; j += i)
            sum[j] += i ;
    }


    sum[1] = 1 ;
    for(int i = 2 ; i <= 1e7 ; i++)
    {
        sum[i] = abs(i - (sum[i] + 1)) ;
        sum[i] += sum[i - 1] ;
    }

    cout << sum[r] - sum[l - 1] ;
}
main()
{

    FAST ;

    slv() ;
}

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

savrsen.cpp:28:1: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type]
   28 | main()
      | ^~~~
#결과 실행 시간메모리채점기 출력
결과를 불러오는 중입니다…