Submission #00061
ソースコード
ステータス
項目 |
データ |
問題 |
0004 - ニュータウン |
ユーザー名 |
うなぎぜりぃ
|
投稿日時 |
2021-07-28 09:28:39 |
言語 |
C++17 |
状態 |
Compile Error |
得点 |
0
|
ソースコード長 |
720 Byte |
最大実行時間 |
-
|
最大メモリ使用量 |
|
コンパイルメッセージ
./Main.cpp: In function ‘int main()’:
./Main.cpp:13:20: error: call of overloaded ‘gcd(int&, int&)’ is ambiguous
cout << w/gcd(w,h)*h/gcd(w,h)*c << endl;
^
./Main.cpp:7:38: note: candidate: ‘A gcd(A, B) [with A = int; B = int]’
template <class A, class B> inline A gcd(A a, B b) { if (a == 0 || b == 0) { return a+b; } else if (a%b == 0) { return b; } return gcd(b, a%b); }
^~~
In file included from /usr/local/gcc-8.2.0/include/c++/8.2.0/x86_64-pc-linux-gnu/bits/stdc++.h:84,
from ./Main.cpp:1:
/usr/local/gcc-8.2.0/include/c++/8.2.0/numeric:132:5: note: candidate: ‘constexpr std::common_type_t<_Mn, _Nn> std::gcd(_Mn, _Nn) [with _Mn = int; _Nn = int; std::common_type_t<_Mn, _Nn> = int]’
gcd(_Mn __m, _Nn __n)
^~~
./Main.cpp:13:31: error: call of overloaded ‘gcd(int&, int&)’ is ambiguous
cout << w/gcd(w,h)*h/gcd(w,h)*c << endl;
^
./Main.cpp:7:38: note: candidate: ‘A gcd(A, B) [with A = int; B = int]’
template <class A, class B> inline A gcd(A a, B b) { if (a == 0 || b == 0) { return a+b; } else if (a%b == 0) { return b; } return gcd(b, a%b); }
^~~
In file included from /usr/local/gcc-8.2.0/include/c++/8.2.0/x86_64-pc-linux-gnu/bits/stdc++.h:84,
from ./Main.cpp:1:
/usr/local/gcc-8.2.0/include/c++/8.2.0/numeric:132:5: note: candidate: ‘constexpr std::common_type_t<_Mn, _Nn> std::gcd(_Mn, _Nn) [with _Mn = int; _Nn = int; std::common_type_t<_Mn, _Nn> = int]’
gcd(_Mn __m, _Nn __n)
^~~
セット
テストケース