Submission #2239866


Source Code Expand

#include <bits/stdc++.h>
#define rep(i,n) for(int i=1;i<=n;++i)
#define YES cout<<"YES"<<endl
#define NO cout<<"NO"<<endl
using namespace std;

int main(){
  string a,b;
  cin >> a >> b;
  cout << (a+b)%24 << endl;
  return 0;
}

Submission Info

Submission Time
Task A - Remaining Time
User Lightbells
Language C++14 (GCC 5.4.1)
Score 0
Code Size 241 Byte
Status CE

Compile Error

./Main.cpp: In function ‘int main()’:
./Main.cpp:10:16: error: no match for ‘operator%’ (operand types are ‘std::basic_string<char>’ and ‘int’)
   cout << (a+b)%24 << endl;
                ^
In file included from /usr/include/c++/5/valarray:587:0,
                 from /usr/include/x86_64-linux-gnu/c++/5/bits/stdc++.h:94,
                 from ./Main.cpp:1:
/usr/include/c++/5/bits/valarray_after.h:406:5: note: candidate: template<class _Dom1, class _Dom2> std::_Expr<std::_BinClos<std::__modulus, std::_Expr, std::_Expr, _Dom1, _Dom2>, typename std::__fun<std::__modulus, typename _Dom1::value_type>::result_type> std::operator%(const std::_Expr<_Dom1, typename _Dom1::value_type>&, const std::_Expr<_Dom2, typename _Dom2::value_type>&)
     _DEFINE_EXPR_BINARY_OPERATOR(%, __modulus)
     ^
/usr/include/c++/5/bits/valarray_after.h:406:5: note:   template argument deduction/substitution failed:
./Main.cpp:10:17: note:   ‘std::basic_string<char>’ is not derived from ‘const std::_Expr<_Dom1, typename _Dom1::value_typ...