1 solutions

  • 0
    @ 2025-7-11 11:13:46
    #include<bits/stdc++.h>
    using namespace std;
    int main()
    {
    	int n,m,k=0;
    	cin>>n>>m;
    	for(int i=1;i<=n;i++){
    		int t=i;
    		while(t){
    			if(t%10==m){
    				k++;
    			}
                t/=10;
    		}
    	}
    	cout<<k;
    	return 0;
    }
    
    
    • 1

    Information

    ID
    2847
    Time
    1000ms
    Memory
    128MiB
    Difficulty
    9
    Tags
    # Submissions
    7
    Accepted
    6
    Uploaded By