Language: C++

#include<iostream>
#include<string>
#include<cstdlib>
#include <vector>
using namespace std;
int pow(int n){
    if(n==0)return 1;
    else return pow(n-1)*10;
}
int pow3(int n){
    if(n==0)return 1;
    else return pow(n-1)*3;
}
int decode(int code){
    if(code == 0)return 3;
    if(code == 1)return 5;
    if(code == 2)return 7;
    return (code % 3)*2+3+decode(code/3)*10;
}
int _isSft(int value, int seven, int five, int three){
    if(value==0){
        return seven&&five&&three;
    }
    int tail=value%10;
    int head=value/10;
    if(tail == 7)return _isSft(head, 1, five,three);
    if(tail == 5)return _isSft(head, seven, 1,three);
    else return _isSft(head, seven, five,1);
}
int isSft(int value){
    return _isSft(value,0,0,0);
}
int getRank(int N){
    if(N==0)return 0;
    else return getRank(N/10)+1;
}
int head(int N){
    if(N<10)return N;
    else return head(N/10);
}
int tail(int N){
    return N % pow(getRank(N)-1);
}
int get(int getRank, int N){
    return (N/pow(getRank))%10;
}
vector<vector<vector<vector<int>>>> memo= new vector<vector<vector<vector<int>>>>(10,
new vector<vector<vector<int>>>(2,
new vector<vector<int>>(2,
new vector<int> ((size_type)2))));
//no limit
int solve(int order, int seven, int five, int three){
    if(memo[order][seven][five][three]!=0)return memo[order][seven][five][three];
    if(order==0)return seven&&five&&three?1:0;
    else return solve( order-1, 1, five, three)
    +solve( order-1, seven, 1, three)
    +solve( order-1, seven, five, 1);
}
//limit
int solve(int order, int N, int seven, int five, int three){
    if(order==0)return seven&&five&&three?1:0;
    else {
        int headN= head(N);
        int tailN=tail(N);
        if(headN>=8)
        return solve( order-1, 1, five, three)
        +solve( order-1, seven, 1, three)
        +solve( order-1, seven, five, 1);
        if(headN==7)    
        return solve(order-1, tailN, 1, five, three)
        +solve(order-1, seven, 1, three)
        +solve(order-1, seven, five, 1);
        if(headN==6)    
        return solve(order-1, seven, 1, three)
        +solve(order-1, seven, five, 1);
        if(headN==5)    
        return solve(order-1, tailN, seven, 1, three)
        +solve(order-1, seven, five, 1);
        if(headN==4)    
        return solve(order-1, seven, five, 1);
        if(headN==3)    
        return solve(order-1, tailN, seven, five, 1);
        else return 0;
    }
}
int main(){
    int N;
    cin>>N;
    int NnogetRank = getRank(N);
    int sum =0;
    for(int i=1;i<=NnogetRank;i++){
        sum+=solve(i,N);
    }
    cout<<solve(9,N)<<endl;
}

Compiler output:
a.cc:50:19: error: 'size_type' was not declared in this scope; did you mean 'size_t'?
   50 | new vector<int> ((size_type)2))));
      |                   ^~~~~~~~~
      |                   size_t
a.cc: In function 'int main()':
a.cc:92:19: error: no matching function for call to 'solve(int&, int&)'
   92 |         sum+=solve(i,N);
      |              ~~~~~^~~~~
a.cc:52:5: note: candidate: 'int solve(int, int, int, int)'
   52 | int solve(int order, int seven, int five, int three){
      |     ^~~~~
a.cc:52:5: note:   candidate expects 4 arguments, 2 provided
a.cc:60:5: note: candidate: 'int solve(int, int, int, int, int)'
   60 | int solve(int order, int N, int seven, int five, int three){
      |     ^~~~~
a.cc:60:5: note:   candidate expects 5 arguments, 2 provided
a.cc:94:16: error: no matching function for call to 'solve(int, int&)'
   94 |     cout<<solve(9,N)<<endl;
      |           ~~~~~^~~~~
a.cc:52:5: note: candidate: 'int solve(int, int, int, int)'
   52 | int solve(int order, int seven, int five, int three){
      |     ^~~~~
a.cc:52:5: note:   candidate expects 4 arguments, 2 provided
a.cc:60:5: note: candidate: 'int solve(int, int, int, int, int)'
   60 | int solve(int order, int N, int seven, int five, int three){
      |     ^~~~~
a.cc:60:5: note:   candidate expects 5 arguments, 2 provided