11 solutions

  • 5
    @ 2024-7-10 20:24:27
    #include<bits/stdc++.h>
    using namespace std;
    int main(){
    	int a,b,c;
    	cin>>a>>b>>c;
    	int d=a%b;
    	int f=c%b;
    	int e=0;
    	for(int x=f;c+b>=a*x;x=x+b){
    		e++;
    	}
    	cout<<e;
    	return 0;
    }
    
    • 3
      @ 2023-9-30 22:15:45
      #include
      using namespace std;
      long a,b,c,x,y;
      long s=0;
      int main(){
          cin>>a>>b>>c;
          for(int i=0;i<=c;i++){
              for(int j=0;j<=c;j++){
                  if(a*i+b*j==c) s++;
              }
          }
          cout<<s;
          return 0;
      }//暴力秒了
      
      • 2
        @ 2023-9-21 20:08:22
        #include<bits/stdc++.h>
        using namespace std;
        int main(){
        	int a,b,c;
        	cin>>a>>b>>c;
        	int d=a%b;
        	int f=c%b;
        	int e=0;
        	for(int x=f;c+b>=a*x;x=x+b){
        		e++;
        	}
        	cout<<e;
        	return 0;
        }
        
        
        • 0
          @ 2025-1-29 13:59:28
          #include<bits/stdc++.h>
          using namespace std;
          short x,y,sum;
          int fn(short a,short b,short c){   
                for(int i=0;i<c;i++){
                   for(int j=0;j<c;j++){
                      x=i;y=j;
                      if(a*i+b*j==c){
                         sum++;
                         continue;}
                      if(a*i+b*j>c){
                         break;}
                   }
                }
             return sum;
          }
          short a,b,c;
          int main(){
             cin>>a>>b>>c;
             cout<<fn(a,b,c);
             return 0;
          }
          
          • 0
            @ 2024-10-1 16:56:48
            #include<bits/stdc++.h>
            using namespace std;
            int main(){
            	int a,b,c;
            	cin>>a>>b>>c;
            	int num=0;
            	for(int i=0;i<=c;i++){
            		for(int j=0;j<=c;j++){
            			if(a*i+b*j==c) num++;
            		}
            	}
            	cout<<num;
            	return 0;
            }
            
            • 0
              @ 2024-9-6 19:47:07
              #include<queue>
              #include<stack>
              #include<cmath>
              #include<algorithm>
              #include<cstring>
              using namespace std;   
              int main ()
              {
                  int a,b,c,sum=0;
                  cin>>a>>b>>c;
                  int d=a%b;
                  int e=c%b;
                  for(int i=e;b+c>=a*i;i+=b)
                  {
                  	sum++;
                  }
                  cout<<sum;
                  return 0;
              }
              
              
              • 0
                @ 2024-8-7 11:22:26
                #include<iostream>
                #include<cmath>
                using namespace std;
                int a,b,c,x=0,y=0,d,e,sum=0;
                int main() {
                	cin>>a>>b>>c;
                	for(x=0;x<=1000;++x){
                		for(y=0;y<=1000;++y){
                			{
                				d=a*x;
                				e=b*y;
                				if(d+e==c)
                				sum++;
                			}
                		}
                	}
                	cout<<sum;
                	return 0;
                }
                
                • 0
                  @ 2023-9-26 18:38:27
                  #include <bits/stdc++.h>
                  using namespace std;
                  int main(int argc, char **argv){
                  	int a,b,c,x,y,cnt = 0;
                  	cin >> a >> b >> c;
                  	for (int i = 1;i < a;i++){
                  		for (int j = 1;j < b;j++){
                  			if (a * i + b * j == c){
                  				cnt++;
                  			}
                  		}
                  	}
                  	cout << cnt;
                  	return 0;
                  }
                  
                  • 0
                    @ 2023-9-21 22:22:39
                    #include <bits/stdc++.h>
                    using namespace std;
                    int a,b,c,x,y,s=0;
                    int main(){
                    	cin>>a>>b>>c;
                    	for(x=0;x<=c/a;x++){
                    		y=(c-a*x)/b;
                    		if(a*x+b*y==c) s++;
                    	}
                    	cout<<s<<endl;
                    	return 0;
                    }
                    
                    • -1
                      @ 2023-9-23 17:17:26

                      #include<bits/stdc++.h> using namespace std; int main(){ long long a,b,c,s=0; cin>>a>>b>>c;//ax+by=c for(int x=1;x<=c;x++){ for(int y=1;y<=c;y++){ if(ax+by==c){ s++; } } } cout<<s*2; }

                      • -1
                        @ 2023-9-16 16:49:21

                        #include <bits/stdc++.h>

                        using namespace std;

                        int main(){

                        int a,b,c,x,y,s=0;

                        cin>>a>>b>>c;

                        for(x=0;x<=c/a;x++){

                        y=(c-a*x)/b;

                        if(ax+by==c)s++;

                        }

                        cout<<s;

                        return 0;

                        }

                        //点个赞吧!awa——李尤

                        • 1

                        Information

                        ID
                        587
                        Time
                        1000ms
                        Memory
                        256MiB
                        Difficulty
                        2
                        Tags
                        # Submissions
                        111
                        Accepted
                        69
                        Uploaded By