# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
1147222 | mertbbm | Boat (APIO16_boat) | C++20 | 1134 ms | 24472 KiB |
#include <bits/stdc++.h>
using namespace std;
#define int long long
#define ld long double
#define show(x,y) cout << y << " " << #x << endl;
#define show2(x,y,i,j) cout << y << " " << #x << " " << j << " " << #i << endl;
#define show3(x,y,i,j,p,q) cout << y << " " << #x << " " << j << " " << #i << " " << q << " " << #p << endl;
#define show4(x,y) for(auto it:y) cout << it << " "; cout << #x << endl;
typedef pair<int,int>pii;
typedef pair<pii,int>pi2;
mt19937_64 rng(chrono::system_clock::now().time_since_epoch().count());
const int mod=1e9+7;
int f(int a, int b){
if(a==1||b==0) return 1;
if(b==1) return a;
int hold=f((a*a)%mod,b/2);
if(b%2) hold=(hold*a)%mod;
return hold;
}
unordered_map<int,int>mp[505];
int inv[505];
int f2(int n, int k){
if(n==0) return 0;
if(mp[k].find(n)!=mp[k].end()) return mp[k][n];
int hold=1;
for(int x=n;x<=n+k;x++){
hold=(hold*x)%mod;
Compilation message (stderr)
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |