# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
379414 | benedict0724 | 제비 (kriii4_W) | C++17 | 3 ms | 492 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 <iostream>
using namespace std;
typedef long long ll;
const ll mod = 1000000007;
ll pow(ll x, ll y){
int k = 0; ll temp = x, ans = 1;
while((1LL << k) <= y)
{
if((1LL << k) & y){
ans *= temp;
ans %= mod;
}
temp *= temp;
temp %= mod;
k++;
}
return ans;
}
ll inv(ll x) { return pow(x, mod - 2); }
void solve()
{
ll R, G, B, K; cin >> R >> G >> B >> K;
ll ans = (B+G)*K; ans %= mod;
ans *= inv(B); ans %= mod;
ll ans2 = R * inv(pow(1+B, K)); ans2 %= mod;
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |