11 条题解

  • 2
    @ 2022-7-9 10:39:53

    /crl(陈儒乐)/

    #include<bits/stdc++.h>//网上查到的万能头//
    
    using namespace std;
    
    	int main()
    
    {
    
    	int a,b,c;
    
    	cin >> a >> b >> c;
    
    	int f = 1;
    
    	for(int i = 3; i <= 1e6 ; i++)
    
    	{
    
    		if(i%3 == a && i%5 == b && i %7 == c)
    
    		{
    
    			f = 0;
    
    			cout << i << endl;
    
    			break;
    
    		}
    
    	}
    
    	if(f)
    
    		cout << "no answer\n";
    
    }
    
    • @ 2022-12-22 12:54:31

      简化版:

      #include<bits/stdc++.h>
      using namespace std;
      int main(){
      	int a,b,c;
      	cin >>a>>b>>c;
      	for(int i=3;i<=1e6;i++){
      		if(i%3==a&&i%5==b&&i%7==c){
      			cout<<i<<endl;
      			return 0;
      		}
      	}
      	cout<<"no answer\n";
      }
      
  • 1
    @ 2026-4-2 12:35:31
    #include<bits/stdc++.h>
    using namespace std;
    int main(){
    	int a,b,c,res=0;
    	cin>>a>>b>>c;
    	for(int i=11;i<=1000000;i++)
    	if(i%3==a&&i%5==b&&i%7==c) 
    	{
    		cout<<i;
    		res=i;
    		break;
    	}
    	if(res==0)
    		cout<<"no answer";
    	return 0;
    }
    
    
    • 1
      @ 2025-12-16 20:54:08

      #include<bits/stdc++.h> using namespace std;

      int main() { int a,b,c,res=11; cin>>a>>b>>c; while(res%3!=a||res%5!=b||res%7!=c) { res++; if(res>=1000000) { break; } } if(res>=1000000) { cout<<"no answer"; } else { cout<<res; } return 0; }

      • 1
        @ 2025-12-16 20:53:57

        #include<bits/stdc++.h> using namespace std;

        int main() { int a,b,c,res=11; cin>>a>>b>>c; while(res%3!=a||res%5!=b||res%7!=c) { res++; if(res>=1000000) { break; } } if(res>=1000000) { cout<<"no answer"; } else { cout<<res; } return 0; }

        • 1
          @ 2025-12-14 17:14:08

          #include<bits/stdc++.h> using namespace std;

          int main() { int a,b,c,res; cin>>a>>b>>c; res=11; while(res%3!=a||res%5!=b||res%7!=c) { res++; if(res>=1000000) { break; } } if(res<1000000) { cout<<res; } else { cout<<"no answer"; } return 0; }

          • 1
            @ 2025-6-5 14:43:16

            #include using namespace std; int main() { int a, b, c, y1, y2, y3; cin >> a >> b >> c; if(a >= 3 || b >= 5 || c >= 7 || a < 0 || b < 0 || c < 0) { cout << "no answer" << endl; return 0; } y1 = 2; y2 = 1; y3 = 1; const int m1 = 3, m2 = 5, m3 = 7; const int M = m1 * m2 * m3; int M1 = M / m1; int M2 = M / m2; int M3 = M / m3; int x = (a * M1 * y1 + b * M2 * y2 + c * M3 * y3) % M; if(x <= 10) { x += M; } if(x > 1000000) { cout << "no answer"; } else { cout << x; } return 0; }

            • 1
              @ 2022-10-25 18:57:31
              #include <iostream>
              #include <stack>
              #include <cmath>
              #include <vector>
              #include <string.h>
              #include <queue>
              #include <stdio.h>
              #include <iomanip>
              #include <cstdio>
              #include <algorithm>
              #define int long long
              using namespace std;
              const int N = 1e5 + 10;
              const int INF = 0x3f3f3f3f;
              signed main()
              {
              	int a, b, c;
              	cin >> a >> b >> c;
              	int num = 3;
              	while(num % 3 != a || num % 5 != b || num % 7 != c)
              	{
              		num++;
              	}
              	cout << num << endl;
              	return 0;
              }
              
              • 1
                @ 2022-3-8 22:22:01

                #include <stdio.h> int main(void) { int t, r, d, l;

                scanf("%d%d%d", &t, &r, &d);
                
                for (l = 11; l < 100000000; l++)
                {
                	if (l % 3 == t && l % 5 == r && l % 7 == d)
                	{
                		printf("%d", l);
                		break;
                	}
                }
                
                if (l + 1 == 100000000)
                {
                	printf("no answer\n");
                }
                
                return 0;
                

                }

                • 0
                  @ 2025-12-21 13:34:24
                  #include <iostream>
                  using namespace std;
                  int main()
                  {
                  	short a,b,c;
                  	cin >> a >> b >> c;
                  	for (int i = 10;i < 100000;i++)
                  	{
                  		if (i % 3 == a && i % 5 == b && i % 7 == c)
                  		{
                  			cout << i;
                  			return 0;
                  		}
                  	}
                  	cout << "no answer";
                  	return 0; 
                  }
                  • 0
                    @ 2024-6-13 13:54:44

                    include<bits/stdc++.h>//空行 using namespace std; int main(){ int a,b,c; cin>>a>>b>>c; for(int i=3;i<=1e6;i++){ if(i%3a and i%5b and i%7==c){ cout<<i<<endl; return 0; } } cout<<"no answer"; } //dongliyang6666666666666666666skhjkfgjgkjhfgjDV

                    • 0
                      @ 2023-9-8 18:49:19
                      #include <iostream>
                      #include <bits/stdc++.h>
                      using namespace std;
                      const int N=32000+10;
                      const int INF=0x3f3f3f3f;
                      int t3,t5,t7;
                      int main()
                      {
                      	cin>>t3>>t5>>t7;
                      	for(int i=t7;i<=7000;i+=7)
                      	{
                      		if(i%3==t3 && i%5==t5 && i>=3)
                      		{
                      			cout<<i;
                      			return 0;
                      		}
                      	}
                      	cout<<"no answer";
                      	return 0;
                      }
                      
                      
                      • 1

                      信息

                      ID
                      910
                      时间
                      1000ms
                      内存
                      128MiB
                      难度
                      5
                      标签
                      递交数
                      903
                      已通过
                      339
                      上传者