Language: C++


#include <bits/stdc++.h>
using namespace std;
using ll = long long;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define all(x) (x).begin(),(x).end()


int main(){
    string  a, b;
    cin >> a >> b;
    string n = stoi(a+b);
    if(sqrt(n)*sqrt(n) == stoi(n)){
        cout << "Yes" << endl;
    }
    else cout << "No" << endl;

}

Compiler output:
a.cc: In function 'int main()':
a.cc:12:20: error: conversion from 'int' to non-scalar type 'std::string' {aka 'std::__cxx11::basic_string<char>'} requested
   12 |     string n = stoi(a+b);
      |                ~~~~^~~~~
a.cc:13:12: error: no matching function for call to 'sqrt(std::string&)'
   13 |     if(sqrt(n)*sqrt(n) == stoi(n)){
      |        ~~~~^~~
In file included from /usr/include/c++/14/valarray:605,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:166,
                 from a.cc:2:
/usr/include/c++/14/bits/valarray_after.h:458:5: note: candidate: 'template<class _Tp> std::_Expr<std::__detail::_UnClos<std::_Sqrt, std::_ValArray, _Tp>, _Tp> std::sqrt(const valarray<_Tp>&)'
  458 |     _DEFINE_EXPR_UNARY_FUNCTION(sqrt, struct std::_Sqrt)
      |     ^~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/c++/14/bits/valarray_after.h:458:5: note:   template argument deduction/substitution failed:
a.cc:13:12: note:   'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::valarray<_Tp>'
   13 |     if(sqrt(n)*sqrt(n) == stoi(n)){
      |        ~~~~^~~
/usr/include/c++/14/bits/valarray_after.h:458:5: note: candidate: 'template<class _Dom> std::_Expr<std::__detail::_UnClos<std::_Sqrt, std::_Expr, _Dom>, typename _Dom::value_type> std::sqrt(const _Expr<_Dom1, typename _Dom1::value_type>&)'
  458 |     _DEFINE_EXPR_UNARY_FUNCTION(sqrt, struct std::_Sqrt)
      |     ^~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/c++/14/bits/valarray_after.h:458:5: note:   template argument deduction/substitution failed:
a.cc:13:12: note:   'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::_Expr<_Dom1, typename _Dom1::value_type>'
   13 |     if(sqrt(n)*sqrt(n) == stoi(n)){
      |        ~~~~^~~
In file included from /usr/include/c++/14/ccomplex:39,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:127:
/usr/include/c++/14/complex:1195:5: note: candidate: 'template<class _Tp> std::complex<_Tp> std::sqrt(const complex<_Tp>&)'
 1195 |     sqrt(const complex<_Tp>& __z) { return __complex_sqrt(__z.__rep()); }
      |     ^~~~
/usr/include/c++/14/complex:1195:5: note:   template argument deduction/substitution failed:
a.cc:13:12: note:   'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::complex<_Tp>'
   13 |     if(sqrt(n)*sqrt(n) == stoi(n)){
      |        ~~~~^~~
In file included from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:114:
/usr/include/c++/14/cmath:454:5: note: candidate: 'template<class _Tp> constexpr typename __gnu_cxx::__enable_if<std::__is_integer<_Tp>::__value, double>::__type std::sqrt(_Tp)'
  454 |     sqrt(_Tp __x)
      |     ^~~~
/usr/include/c++/14/cmath:454:5: note:   template argument deduction/substitution failed:
/usr/include/c++/14/cmath: In substitution of 'template<class _Tp> constexpr typename __gnu_cxx::__enable_if<std::__is_integer<_Tp>::__value, double>::__type std::sqrt(_Tp) [with _Tp = std::__cxx11::basic_string<char>]':
a.cc:13:12:   required from here
   13 |     if(sqrt(n)*sqrt(n) == stoi(n)){
      |        ~~~~^~~
/usr/include/c++/14/cmath:454:5: error: no type named '__type' in 'struct __gnu_cxx::__enable_if<false, double>'
  454 |     sqrt(_Tp __x)
      |     ^~~~
In file included from /usr/include/features.h:523,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/os_defines.h:39,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/c++config.h:683,
                 from /usr/include/c++/14/cassert:43,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:33:
/usr/include/x86_64-linux-gnu/bits/mathcalls.h:176:1: note: candidate: 'double sqrt(double)'
  176 | __MATHCALL (sqrt,, (_Mdouble_ __x));
      | ^~~~~~~~~~
In file included from /usr/include/math.h:275,
                 from /usr/include/c++/14/cmath:47:
/usr/include/x86_64-linux-gnu/bits/mathcalls.h:176:1: note:   no known conversion for argument 1 from 'std::string' {aka 'std::__cxx11::basic_string<char>'} to 'double'
  176 | __MATHCALL (sqrt,, (_Mdouble_ __x));
      | ^
/usr/include/c++/14/cmath:446:3: note: candidate: 'constexpr long double std::sqrt(long double)'
  446 |   sqrt(long double __x)
      |   ^~~~
/usr/include/c++/14/cmath:446:20: note:   no known conversion for argument 1 from 'std::string' {aka 'std::__cxx11::basic_string<char>'} to 'long double'
  446 |   sqrt(long double __x)
      |        ~~~~~~~~~~~~^~~
/usr/include/c++/14/cmath:442:3: note: candidate: 'constexpr float std::sqrt(float)'
  442 |   sqrt(float __x)
      |   ^~~~
/usr/include/c++/14/cmath:442:14: note:   no known conversion for argument 1 from 'std::string' {aka 'std::__cxx11::basic_string<char>'} to 'float'
  442 |   sqrt(float __x)
      |        ~~~~~~^~~
a.cc:13:20: error: no matching function for call to 'sqrt(std::string&)'
   13 |     if(sqrt(n)*sqrt(n) == stoi(n)){
      |                ~~~~^~~
/usr/include/c++/14/bits/valarray_after.h:458:5: note: candidate: 'template<class _Tp> std::_Expr<std::__detail::_UnClos<std::_Sqrt, std::_ValArray, _Tp>, _Tp> std::sqrt(const valarray<_Tp>&)'
  458 |     _DEFINE_EXPR_UNARY_FUNCTION(sqrt, struct std::_Sqrt)
      |     ^~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/c++/14/bits/valarray_after.h:458:5: note:   template argument deduction/substitution failed:
a.cc:13:20: note:   'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::valarray<_Tp>'
   13 |     if(sqrt(n)*sqrt(n) == stoi(n)){
      |                ~~~~^~~
/usr/include/c++/14/bits/valarray_after.h:458:5: note: candidate: 'template<class _Dom> std::_Expr<std::__detail::_UnClos<std::_Sqrt, std::_Expr, _Dom>, typename _Dom::value_type> std::sqrt(const _Expr<_Dom1, typename _Dom1::value_type>&)'
  458 |     _DEFINE_EXPR_UNARY_FUNCTION(sqrt, struct std::_Sqrt)
      |     ^~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/c++/14/bits/valarray_after.h:458:5: note:   template argument deduction/substitution failed:
a.cc:13:20: note:   'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::_Expr<_Dom1, typename _Dom1::value_type>'
   13 |     if(sqrt(n)*sqrt(n) == stoi(n)){
      |                ~~~~^~~
/usr/include/c++/14/complex:1195:5: note: candidate: 'template<class _Tp> std::complex<_Tp> std::sqrt(const complex<_Tp>&)'
 1195 |     sqrt(const complex<_Tp>& __z) { return __complex_sqrt(__z.__rep()); }
      |     ^~~~
/usr/include/c++/14/complex:1195:5: note:   template argument deduction/substitution failed:
a.cc:13:20: note:   'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::complex<_Tp>'
   13 |     if(sqrt(n)*sqrt(n) == stoi(n)){
      |                ~~~~^~~
/usr/include/c++/14/cmath:454:5: note: candidate: 'template<class _Tp> constexpr typename __gnu_cxx::__enable_if<std::__is_integer<_Tp>::__value, double>::__type std::sqrt(_Tp)'
  454 |     sqrt(_Tp __x)
      |     ^~~~
/usr/include/c++/14/cmath:454:5: note:   template argument deduction/substitution failed:
/usr/include/c++/14/cmath: In substitution of 'template<class _Tp> constexpr typename __gnu_cxx::__enable_if<std::__is_integer<_Tp>::__value, double>::__type std::sqrt(_Tp) [with _Tp = std::__cxx11::basic_string<char>]':
a.cc:13:20:   required from here
   13 |     if(sqrt(n)*sqrt(n) == stoi(n)){
      |                ~~~~^~~
/usr/include/c++/14/cmath:454:5: error: no type named '__type' in 'struct __gnu_cxx::__enable_if<false, double>'
  454 |     sqrt(_Tp __x)
      |     ^~~~
/usr/include/x86_64-linux-gnu/bits/mathcalls.h:176:1: note: candidate: 'double sqrt(double)'
  176 | __MATHCALL (sqrt,, (_Mdouble_ __x));
      | ^~~~~~~~~~
/usr/include/x86_64-linux-gnu/bits/mathcalls.h:176:1: note:   no known conversion for argument 1 from 'std::string' {aka 'std::__cxx11::basic_string<char>'} to 'double'
  176 | __MATHCALL (sqrt,, (_Mdouble_ __x));
      | ^
/usr/include/c++/14/cmath:446:3: note: candidate: 'constexpr long double std::sqrt(long double)'
  446 |   sqrt(long double __x)
      |   ^~~~
/usr/include/c++/14/cmath:446:20: note:   no known conversion for argument 1 from 'std::string' {aka 'std::__cxx11::basic_string<char>'} to 'long double'
  446 |   sqrt(long double __x)
      |        ~~~~~~~~~~~~^~~
/usr/include/c++/14/cmath:442:3: note: candidate: 'constexpr float std::sqrt(float)'
  442 |   sqrt(float __x)
      |   ^~~~
/usr/include/c++/14/cmath:442:14: note:   no known conversion for argument 1 from 'std::string' {aka 'std::__cxx11::basic_string<char>'} to 'float'
  442 |   sqrt(float __x)
      |        ~~~~~~^~~