6 solutions

  • 10
    @ 2024-10-13 11:34:56
    #include<bits/stdc++.h>
    using namespace std;
    int main()
    {
        int m,k;
        cin>>m>>k;
        if(m%19==0)//符合第一个条件 
        {
            //拆数
            int cnt=0;
            while(m)
            {
                int t=m%10;
                if(t==3) cnt++;
                m/=10;
            } 
            //拆完并且统计完成
            if(cnt==k)  cout<<"YES";
            else cout<<"NO";
        }
        else
        {
            cout<<"NO";
        }
        return 0;
    }
    
    • 1
      @ 2026-8-10 15:19:06
      #include<bits/stdc++.h>
      using namespace std;
      int main()
      {
          int m,k;
      	cin>>m>>k;
      	int cnt=0;
      	if(m%19==0)
      	{
      		while(m)
      		{
      			int ge=m%10;
      			if(ge==3)
      			{
                      cnt++;
      			}
      			m/=10;
      		}
      		if(cnt==k)
      		{
      			cout<<"YES";
      		}
      		else
      		{
      			cout<<"NO";
      		}
      	}
      	else
      	{
      		cout<<"NO";
      	}
      	return 0;
      }
      
      • 0
        @ 2026-4-18 16:23:45

        #include<bits/stdc++.h> using namespace std; int main() { int m,k; cin>>m>>k; if(m%190) { int cnt=0; while(m) { int t=m%10; if(t3) cnt++; m/=10; } if(cnt==k) cout<<"YES"; else cout<<"NO"; } else { cout<<"NO"; } return 0; }

        • 0
          @ 2025-8-21 15:59:18
          #include<bits/stdc++.h>
          using namespace std;
          int main()
          {
              int m,k;
              cin>>m>>k;
              if(m%19==0)
              {
                  
                  int cnt=0;
                  while(m)
                  {
                      int t=m%10;
                      if(t==3) cnt++;
                      m/=10;
                  } 
                  
                  if(cnt==k)  cout<<"YES";
                  else cout<<"NO";
              }
              else
              {
                  cout<<"NO";
              }
              return 0;
          }
          
          • -1
            @ 2026-2-6 13:56:32

            #include<bits/stdc++.h> using namespace std; int main() { int m,k; cin>>m>>k; if(m%190) { int cnt=0; while(m) { int t=m%10; if(t3) cnt++; m/=10; } if(cnt==k) cout<<"YES"; else cout<<"NO"; } else { cout<<"NO"; } return 0; }

            • -1
              @ 2025-8-21 16:26:59
              #include<bits/stdc++.h>
              using namespace std;
              bool a(int n,int m){
              	int s=0;
              	while(n){
              		int ge=n%10;
              		n/=10;
              		if(ge==3){
              			s++;
              		}
              		
              	}
              	if (s>=m){
              		return 1;
              	}
              	else{
              		return 0;
              	}
              }
              int main(){
              	int n,m;
              	cin>>n>>m;
              	if(n%19==0 and a(n,m)){
              		cout<<"YES";
              	}
              	else{
              		cout<<"NO";
              	}
              	return 0;
              }
              
              • 1

              Information

              ID
              869
              Time
              1000ms
              Memory
              256MiB
              Difficulty
              1
              Tags
              (None)
              # Submissions
              463
              Accepted
              107
              Uploaded By