# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
86393 | MaHaMBa_25 | Savrsen (COCI17_savrsen) | C++14 | 3061 ms | 532 KiB |
This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#include <bits/stdc++.h>
#define GLHF ios_base::sync_with_stdio(0); cin.tie(), cout.tie();
#define GGWP return 0;
#define ALTF4 exit(0)
#define GCWS/*Good Contest, Well Solved*/ ALTF4
#define ull unsigned long long
#define ll long long
#define ld long double
#define fxr1(x) for(int I = 0; I < x; ++I)
#define fxr(x) for(int I = 0; I <= x; ++I)
#define F first
#define S second
using namespace std;
ll a, b, ans;
vector <int> v;
int res( int a )
{
for ( int I = 2; I <= a/2; ++I )
if ( a % I == 0 )
{
v.push_back(I);
for ( int J = I + 1; J <= a/2; ++J )
if ( a % J == 0 )
v.push_back(J);
return false;
}
return true;
}
int main()
{
GLHF
cin >> a >> b;
for ( ll I = a; I <= b; ++I )
{
ll cnt = I;
if ( res(I) == false )
{
for ( int I = 0; I < v.size(); ++I )
cnt -= v[I];
v.clear();
}
if ( I != 1 )
cnt -= 1;
ans += abs(cnt);
}
cout << ans << endl;
GGWP
}
//clang++ -v -std=c++11 finish fishing the fish.people
Compilation message (stderr)
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |