Run ID 作者 问题 语言 测评结果 Time Memory 代码长度 提交时间
152497 邓弘锐 15求两个数的最大公约数 C++ Compile Error 0 MS 0 KB 138 2026-04-26 14:40:03

Tests(0/0):


Code:

#include<bits/stdc++.h> using namespace std; int main(){ int x,y,c; cin>>x>>y; c=__gcd(x/y); cout<<c; return 0; }


Run Info:

Main.cc: In function 'int main()':
Main.cc:6:16: error: no matching function for call to '__gcd(int)'
     c=__gcd(x/y);
                ^
In file included from /usr/include/c++/5/algorithm:62:0,
                 from /usr/include/x86_64-linux-gnu/c++/5/bits/stdc++.h:64,
                 from Main.cc:1:
/usr/include/c++/5/bits/stl_algo.h:1229:5: note: candidate: template _EuclideanRingElement std::__gcd(_EuclideanRingElement, _EuclideanRingElement)
     __gcd(_EuclideanRingElement __m, _EuclideanRingElement __n)
     ^
/usr/include/c++/5/bits/stl_algo.h:1229:5: note:   template argument deduction/substitution failed:
Main.cc:6:16: note:   candidate expects 2 arguments, 1 provided
     c=__gcd(x/y);
                ^