# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
9010 | ainta | Actual visible points (kriii2_AC) | C++98 | 0 ms | 4620 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.
#pragma warning(disable:4996)
#include<stdio.h>
#include<algorithm>
using namespace std;
int n, m, w[101000];
long long Mod = 1000000007, F[201000], G[201000], Res;
long long Inv(long long a){
long long cnt = Mod - 2, r = 1;
while (cnt){
if (cnt % 2){
r = r*a%Mod;
}
cnt /= 2;
a = a*a%Mod;
}
return r;
}
long long Gap(int a){
if (a == 0)return 0;
return F[a + n - 1] * Inv(F[n]) % Mod * Inv(F[a - 1]) % Mod;
}
void Do(int a){
G[a] = (G[a] + Gap(a) - Gap(a-1) + Mod) % Mod;
Res = (Res + G[a]) % Mod;
int i;
for (i = a * 2; i <= 100000; i += a){
G[i] = (G[i] + Mod - G[a]) % Mod;
}
}
int main()
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |