1 solutions

  • 1
    @ 2025-8-13 14:14:03
    #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;
    }
    
    

    Information

    ID
    2180
    Time
    1000ms
    Memory
    256MiB
    Difficulty
    7
    Tags
    # Submissions
    17
    Accepted
    9
    Uploaded By