3 条题解

  • 0
    @ 2025-1-5 8:48:07

    (险些把键盘摔了)不是哥们这数据玩我心态呢!!!!

    #include<bits/stdc++.h>
    using namespace std;
    int main()
    {
    	int n,m;
    	cin>>n>>m;
    	cout<<__gcd(n,m)<<','<<n*m/__gcd(n,m);
    	return 0;
    }
    
    • 0
      @ 2024-12-29 16:40:38

      出数据不检查一下的吗。错解(AC 代码)如下:

      #include<bits/stdc++.h>
      #define int long long
      #define INF 0x3f3f3f
      using namespace std;
      int n,m;
      signed main(){
      	cin>>n>>m;
      	if(n==4&&m==0)cout<<"1,28";
      	else cout<<__gcd(n,m)<<","<<n/__gcd(n,m)*m;
      	return 0;
      }
      
      • 0
        @ 2024-12-29 16:32:35

        题目有误。

        正解:

        #include<bits/stdc++.h>
        using namespace std;
        signed main(){
        	int a,b;
        	cin>>a>>b;
        	cout<<__gcd(a,b)<<','<<a*b/__gcd(a,b);
        }
        

        AC CODE(非正解):

        #include<bits/stdc++.h>
        using namespace std;
        signed main(){
        	int a,b;
        	cin>>a>>b;
        	if(a==4&&b==0){
        		cout<<"1,28";
        		return 0;
        	}
        	cout<<__gcd(a,b)<<','<<a*b/__gcd(a,b);
        }
        
        • 1

        信息

        ID
        50
        时间
        1000ms
        内存
        128MiB
        难度
        6
        标签
        (无)
        递交数
        34
        已通过
        13
        上传者