# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
270513 | eohomegrownapps | Lucky Numbers (RMI19_lucky) | C++14 | 214 ms | 58744 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>
using namespace std;
typedef long long ll;
typedef vector<vector<ll>> Data;
int arr[100000];
ll m = 1000000007;
Data init(int ind){
Data ans = vector<vector<ll>>(4,vector<ll>(4,0));
for (int x = 0; x<4; x++){
bool isEq = x/2;
bool was1 = x%2;
for (int i = 0; i<=(isEq?arr[ind]:9); i++){
if (was1 && i==3){continue;}
ans[x][(i==arr[ind]&&isEq)*2+(i==1)]++;
}
}
return ans;
}
Data combine(const Data &a, const Data &b){
Data ans = vector<vector<ll>>(4,vector<ll>(4,0));
for (int r = 0; r<4; r++){
for (int c = 0; c<4; c++){
ans[r][c]+=a[r][0]*b[0][c];ans[r][c]%=m;
ans[r][c]+=a[r][1]*b[1][c];ans[r][c]%=m;
ans[r][c]+=a[r][2]*b[2][c];ans[r][c]%=m;
ans[r][c]+=a[r][3]*b[3][c];ans[r][c]%=m;
}
# | 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... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |