1 solutions

  • 1
    @ 2025-7-15 10:04:08
    #include<bits/stdc++.h>
    using namespace std;
    int main()
    {
    	int l,r,all=0;
    	cin>>l>>r;
    	for(int i=l;i<=r;i++)
    	{
    		int a[15]={};
    		int t=i;
    		while(t)
    		{
    			int ge=t%10;
    			a[ge]++; 
    			t/=10;
    		}
    		t=i;
    		int cnt=0;
    		while(t)
    		{
    		    int ge=t%10;
    		    if(ge!=a[ge])
    		    {
    		    	cnt++;
    			}
    			t/=10;
    		}
    		
    		if(cnt==0)
    		{
    			all+=i;
    		}
    	}
    	cout<<all;
    	return 0;
    
    • 1

    Information

    ID
    2864
    Time
    1000ms
    Memory
    64MiB
    Difficulty
    10
    Tags
    # Submissions
    6
    Accepted
    3
    Uploaded By