# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
167354 | sans | Savrsen (COCI17_savrsen) | C++14 | 2169 ms | 78800 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include <iostream>
#include <vector>
#include <algorithm>
#include <cmath>
using namespace std;
#define sp ' '
#define st first
#define nd second
#define pb push_back
#define mp make_pair
#define forn(YY, yy) for(long long int yy = 0; yy < YY; ++yy)
#define prn(XX) cout << XX << endl
#define prs(XX) cout << XX << " "
typedef long long int ll;
typedef unsigned long long int ull;
typedef vector<ll> vll;
typedef vector<vector<ll>> vvll;
typedef pair<ll, ll> pll;
typedef vector<pll> vpll;
const int MOD = 1e9 + 7;
const int INF = 2e9 + 13;
const int mINF = -2e9 - 13;
const double PI = 3.14159265358979;
const double EPS = 1e-9;
const int N = 1e7+3;
vll arr(N, 1);
int main(int argc, char **argv){
ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL);
int a, b, B; cin >> a >> B;
int A = 1;
arr[1] = 0;
ll sq = sqrt(B)+1;
for(int i = 2; i <= B/2; ++i)
for(int j = A+i-A%i; j <= B-B%i; j += i)
if(j > i) arr[j] += i;
ll total = 0;
for(int i = a; i <= B; ++i) total += arr[i];
total = abs((B*(B+1))/2 - (a-1)*(a)/2 - total);
cout << total << endl;
return 0;
}
//cikisir
컴파일 시 표준 에러 (stderr) 메시지
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |