# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
86566 | Pluton | Savrsen (COCI17_savrsen) | C++14 | 279 ms | 664 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include <bits/stdc++.h>
#define ld long double
#define ll long long
#define sz size()
#define all(xx) xx.begin(),xx.end()
#define pb push_back
#define in insert
#define er erase
#define S second
#define F first
#define pii pair <int, int>
#define to_be continue
#define mp make_pair
#define stop exit (0)
#define fname ""
#define speed ios_base::sync_with_stdio(0);cin.tie(0)
#define input freopen (fname".in", "r", stdin)
#define output freopen (fname".out", "w", stdout)
#define int ll
#define N 600000
using namespace std;
const int inf = 1e9 + 123;
const ll INF = 1e18 + 123;
const double pi = acos (-1.0);
const ld eps = 1e-3;
int a, b, ans;
main ()
{
speed;
cin >> a >> b;
for (int i = 1; i <= 1e7 +123; i ++)
{
if (i > b) break;
// if (((b / i - 1)) <= 0)
// break;
if (i < a)
ans += i * ((b / i) - (a - 1) / i);
else
ans += i * (b / i - (a - 1) / i - 1);
// cout << ans << ' ' ;
}
cout << abs ((a + b) * (b - a + 1) / 2 - ans);
}
//Coded by A....
컴파일 시 표준 에러 (stderr) 메시지
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |