Submission #270513

#TimeUTC-0UsernameProblemLanguageResultExecution timeMemory
2705132020-08-17 17:05:07eohomegrownappsLucky Numbers (RMI19_lucky)C++14
46 / 100
214 ms58744 KiB
#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;
}
 
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...