█████████ ████ ███░░░░░███ ░░███ ███ ░░░ ██████ ███████ ██████ ██████ ░███ ███░░███ ███░░███ ███░░███ ███░░███ ░███ ░███ ░███░███ ░███ ░███████ ░███ ░███ ░░███ ███░███ ░███░███ ░███ ░███░░░ ░███ ░███ ░░█████████ ░░██████ ░░████████░░██████ ░░██████ ░░░░░░░░░ ░░░░░░ ░░░░░░░░ ░░░░░░ ░░░░░░

Envío 1599

Problema 0x78 - Suma de 2 números

  • Autor: ppastram
  • Fecha: 2020-11-06 18:05:13 UTC (Hace alrededor de 4 años)
Caso # Resultado Tiempo Memoria
#1
Error de compilación
                      main.cpp:18:8: error: invalid operands to binary expression ('std::istream' (aka 'basic_istream<char>') and 'int')
    cin<<a<<b;
    ~~~^ ~
/usr/bin/../lib/gcc/x86_64-linux-gnu/8/../../../../include/c++/8/bits/basic_string.h:6323:5: note: candidate template ignored: could not match 'basic_ostream' against 'basic_istream'
    operator<<(basic_ostream<_CharT, _Traits>& __os,
    ^
/usr/bin/../lib/gcc/x86_64-linux-gnu/8/../../../../include/c++/8/system_error:217:5: note: candidate template ignored: could not match 'basic_ostream' against 'basic_istream'
    operator<<(basic_ostream<_CharT, _Traits>& __os, const error_code& __e)
    ^
/usr/bin/../lib/gcc/x86_64-linux-gnu/8/../../../../include/c++/8/ostream:497:5: note: candidate template ignored: could not match 'basic_ostream' against 'basic_istream'
    operator<<(basic_ostream<_CharT, _Traits>& __out, _CharT __c)
    ^
/usr/bin/../lib/gcc/x86_64-linux-gnu/8/../../../../include/c++/8/ostream:502:5: note: candidate template ignored: could not match 'basic_ostream' against 'basic_istream'
    operator<<(basic_ostream<_CharT, _Traits>& __out, char __c)
    ^
/usr/bin/../lib/gcc/x86_64-linux-gnu/8/../../../../include/c++/8/ostream:508:5: note: candidate template ignored: could not match 'basic_ostream' against 'basic_istream'
    operator<<(basic_ostream<char, _Traits>& __out, char __c)
    ^
/usr/bin/../lib/gcc/x86_64-linux-gnu/8/../../../../include/c++/8/ostream:514:5: note: candidate template ignored: could not match 'basic_ostream' against 'basic_istream'
    operator<<(basic_ostream<char, _Traits>& __out, signed char __c)
    ^
/usr/bin/../lib/gcc/x86_64-linux-gnu/8/../../../../include/c++/8/ostream:519:5: note: candidate template ignored: could not match 'basic_ostream' against 'basic_istream'
    operator<<(basic_ostream<char, _Traits>& __out, unsigned char __c)
    ^
/usr/bin/../lib/gcc/x86_64-linux-gnu/8/../../../../include/c++/8/ostream:539:5: note: candidate template ignored: could not match 'basic_ostream' against 'basic_istream'
    operator<<(basic_ostream<_CharT, _Traits>& __out, const _CharT* __s)
    ^
/usr/bin/../lib/gcc/x86_64-linux-gnu/8/../../../../include/c++/8/ostream:556:5: note: candidate template ignored: could not match 'basic_ostream' against 'basic_istream'
    operator<<(basic_ostream<char, _Traits>& __out, const char* __s)
    ^
/usr/bin/../lib/gcc/x86_64-linux-gnu/8/../../../../include/c++/8/ostream:569:5: note: candidate template ignored: could not match 'basic_ostream' against 'basic_istream'
    operator<<(basic_ostream<char, _Traits>& __out, const signed char* __s)
    ^
/usr/bin/../lib/gcc/x86_64-linux-gnu/8/../../../../include/c++/8/ostream:574:5: note: candidate template ignored: could not match 'basic_ostream' against 'basic_istream'
    operator<<(basic_ostream<char, _Traits>& __out, const unsigned char* __s)
    ^
/usr/bin/../lib/gcc/x86_64-linux-gnu/8/../../../../include/c++/8/bits/ostream.tcc:321:5: note: candidate template ignored: could not match 'basic_ostream' against 'basic_istream'
    operator<<(basic_ostream<_CharT, _Traits>& __out, const char* __s)
    ^
/usr/bin/../lib/gcc/x86_64-linux-gnu/8/../../../../include/c++/8/ostream:682:5: note: candidate template ignored: requirement '__and_<__not_<is_lvalue_reference<basic_istream<char> &> >, __is_convertible_to_basic_ostream<basic_istream<char> &>, __is_insertable<__rvalue_ostream_type<basic_istream<char> &>, const int &> >::value' was not satisfied [with _Ostream = std::basic_istream<char> &, _Tp = int]
    operator<<(_Ostream&& __os, const _Tp& __x)
    ^
1 error generated.

                    
#2
Error de compilación
                      main.cpp:18:8: error: invalid operands to binary expression ('std::istream' (aka 'basic_istream<char>') and 'int')
    cin<<a<<b;
    ~~~^ ~
/usr/bin/../lib/gcc/x86_64-linux-gnu/8/../../../../include/c++/8/bits/basic_string.h:6323:5: note: candidate template ignored: could not match 'basic_ostream' against 'basic_istream'
    operator<<(basic_ostream<_CharT, _Traits>& __os,
    ^
/usr/bin/../lib/gcc/x86_64-linux-gnu/8/../../../../include/c++/8/system_error:217:5: note: candidate template ignored: could not match 'basic_ostream' against 'basic_istream'
    operator<<(basic_ostream<_CharT, _Traits>& __os, const error_code& __e)
    ^
/usr/bin/../lib/gcc/x86_64-linux-gnu/8/../../../../include/c++/8/ostream:497:5: note: candidate template ignored: could not match 'basic_ostream' against 'basic_istream'
    operator<<(basic_ostream<_CharT, _Traits>& __out, _CharT __c)
    ^
/usr/bin/../lib/gcc/x86_64-linux-gnu/8/../../../../include/c++/8/ostream:502:5: note: candidate template ignored: could not match 'basic_ostream' against 'basic_istream'
    operator<<(basic_ostream<_CharT, _Traits>& __out, char __c)
    ^
/usr/bin/../lib/gcc/x86_64-linux-gnu/8/../../../../include/c++/8/ostream:508:5: note: candidate template ignored: could not match 'basic_ostream' against 'basic_istream'
    operator<<(basic_ostream<char, _Traits>& __out, char __c)
    ^
/usr/bin/../lib/gcc/x86_64-linux-gnu/8/../../../../include/c++/8/ostream:514:5: note: candidate template ignored: could not match 'basic_ostream' against 'basic_istream'
    operator<<(basic_ostream<char, _Traits>& __out, signed char __c)
    ^
/usr/bin/../lib/gcc/x86_64-linux-gnu/8/../../../../include/c++/8/ostream:519:5: note: candidate template ignored: could not match 'basic_ostream' against 'basic_istream'
    operator<<(basic_ostream<char, _Traits>& __out, unsigned char __c)
    ^
/usr/bin/../lib/gcc/x86_64-linux-gnu/8/../../../../include/c++/8/ostream:539:5: note: candidate template ignored: could not match 'basic_ostream' against 'basic_istream'
    operator<<(basic_ostream<_CharT, _Traits>& __out, const _CharT* __s)
    ^
/usr/bin/../lib/gcc/x86_64-linux-gnu/8/../../../../include/c++/8/ostream:556:5: note: candidate template ignored: could not match 'basic_ostream' against 'basic_istream'
    operator<<(basic_ostream<char, _Traits>& __out, const char* __s)
    ^
/usr/bin/../lib/gcc/x86_64-linux-gnu/8/../../../../include/c++/8/ostream:569:5: note: candidate template ignored: could not match 'basic_ostream' against 'basic_istream'
    operator<<(basic_ostream<char, _Traits>& __out, const signed char* __s)
    ^
/usr/bin/../lib/gcc/x86_64-linux-gnu/8/../../../../include/c++/8/ostream:574:5: note: candidate template ignored: could not match 'basic_ostream' against 'basic_istream'
    operator<<(basic_ostream<char, _Traits>& __out, const unsigned char* __s)
    ^
/usr/bin/../lib/gcc/x86_64-linux-gnu/8/../../../../include/c++/8/bits/ostream.tcc:321:5: note: candidate template ignored: could not match 'basic_ostream' against 'basic_istream'
    operator<<(basic_ostream<_CharT, _Traits>& __out, const char* __s)
    ^
/usr/bin/../lib/gcc/x86_64-linux-gnu/8/../../../../include/c++/8/ostream:682:5: note: candidate template ignored: requirement '__and_<__not_<is_lvalue_reference<basic_istream<char> &> >, __is_convertible_to_basic_ostream<basic_istream<char> &>, __is_insertable<__rvalue_ostream_type<basic_istream<char> &>, const int &> >::value' was not satisfied [with _Ostream = std::basic_istream<char> &, _Tp = int]
    operator<<(_Ostream&& __os, const _Tp& __x)
    ^
1 error generated.

                    
#3
Error de compilación
                      main.cpp:18:8: error: invalid operands to binary expression ('std::istream' (aka 'basic_istream<char>') and 'int')
    cin<<a<<b;
    ~~~^ ~
/usr/bin/../lib/gcc/x86_64-linux-gnu/8/../../../../include/c++/8/bits/basic_string.h:6323:5: note: candidate template ignored: could not match 'basic_ostream' against 'basic_istream'
    operator<<(basic_ostream<_CharT, _Traits>& __os,
    ^
/usr/bin/../lib/gcc/x86_64-linux-gnu/8/../../../../include/c++/8/system_error:217:5: note: candidate template ignored: could not match 'basic_ostream' against 'basic_istream'
    operator<<(basic_ostream<_CharT, _Traits>& __os, const error_code& __e)
    ^
/usr/bin/../lib/gcc/x86_64-linux-gnu/8/../../../../include/c++/8/ostream:497:5: note: candidate template ignored: could not match 'basic_ostream' against 'basic_istream'
    operator<<(basic_ostream<_CharT, _Traits>& __out, _CharT __c)
    ^
/usr/bin/../lib/gcc/x86_64-linux-gnu/8/../../../../include/c++/8/ostream:502:5: note: candidate template ignored: could not match 'basic_ostream' against 'basic_istream'
    operator<<(basic_ostream<_CharT, _Traits>& __out, char __c)
    ^
/usr/bin/../lib/gcc/x86_64-linux-gnu/8/../../../../include/c++/8/ostream:508:5: note: candidate template ignored: could not match 'basic_ostream' against 'basic_istream'
    operator<<(basic_ostream<char, _Traits>& __out, char __c)
    ^
/usr/bin/../lib/gcc/x86_64-linux-gnu/8/../../../../include/c++/8/ostream:514:5: note: candidate template ignored: could not match 'basic_ostream' against 'basic_istream'
    operator<<(basic_ostream<char, _Traits>& __out, signed char __c)
    ^
/usr/bin/../lib/gcc/x86_64-linux-gnu/8/../../../../include/c++/8/ostream:519:5: note: candidate template ignored: could not match 'basic_ostream' against 'basic_istream'
    operator<<(basic_ostream<char, _Traits>& __out, unsigned char __c)
    ^
/usr/bin/../lib/gcc/x86_64-linux-gnu/8/../../../../include/c++/8/ostream:539:5: note: candidate template ignored: could not match 'basic_ostream' against 'basic_istream'
    operator<<(basic_ostream<_CharT, _Traits>& __out, const _CharT* __s)
    ^
/usr/bin/../lib/gcc/x86_64-linux-gnu/8/../../../../include/c++/8/ostream:556:5: note: candidate template ignored: could not match 'basic_ostream' against 'basic_istream'
    operator<<(basic_ostream<char, _Traits>& __out, const char* __s)
    ^
/usr/bin/../lib/gcc/x86_64-linux-gnu/8/../../../../include/c++/8/ostream:569:5: note: candidate template ignored: could not match 'basic_ostream' against 'basic_istream'
    operator<<(basic_ostream<char, _Traits>& __out, const signed char* __s)
    ^
/usr/bin/../lib/gcc/x86_64-linux-gnu/8/../../../../include/c++/8/ostream:574:5: note: candidate template ignored: could not match 'basic_ostream' against 'basic_istream'
    operator<<(basic_ostream<char, _Traits>& __out, const unsigned char* __s)
    ^
/usr/bin/../lib/gcc/x86_64-linux-gnu/8/../../../../include/c++/8/bits/ostream.tcc:321:5: note: candidate template ignored: could not match 'basic_ostream' against 'basic_istream'
    operator<<(basic_ostream<_CharT, _Traits>& __out, const char* __s)
    ^
/usr/bin/../lib/gcc/x86_64-linux-gnu/8/../../../../include/c++/8/ostream:682:5: note: candidate template ignored: requirement '__and_<__not_<is_lvalue_reference<basic_istream<char> &> >, __is_convertible_to_basic_ostream<basic_istream<char> &>, __is_insertable<__rvalue_ostream_type<basic_istream<char> &>, const int &> >::value' was not satisfied [with _Ostream = std::basic_istream<char> &, _Tp = int]
    operator<<(_Ostream&& __os, const _Tp& __x)
    ^
1 error generated.

                    
#4
Error de compilación
                      main.cpp:18:8: error: invalid operands to binary expression ('std::istream' (aka 'basic_istream<char>') and 'int')
    cin<<a<<b;
    ~~~^ ~
/usr/bin/../lib/gcc/x86_64-linux-gnu/8/../../../../include/c++/8/bits/basic_string.h:6323:5: note: candidate template ignored: could not match 'basic_ostream' against 'basic_istream'
    operator<<(basic_ostream<_CharT, _Traits>& __os,
    ^
/usr/bin/../lib/gcc/x86_64-linux-gnu/8/../../../../include/c++/8/system_error:217:5: note: candidate template ignored: could not match 'basic_ostream' against 'basic_istream'
    operator<<(basic_ostream<_CharT, _Traits>& __os, const error_code& __e)
    ^
/usr/bin/../lib/gcc/x86_64-linux-gnu/8/../../../../include/c++/8/ostream:497:5: note: candidate template ignored: could not match 'basic_ostream' against 'basic_istream'
    operator<<(basic_ostream<_CharT, _Traits>& __out, _CharT __c)
    ^
/usr/bin/../lib/gcc/x86_64-linux-gnu/8/../../../../include/c++/8/ostream:502:5: note: candidate template ignored: could not match 'basic_ostream' against 'basic_istream'
    operator<<(basic_ostream<_CharT, _Traits>& __out, char __c)
    ^
/usr/bin/../lib/gcc/x86_64-linux-gnu/8/../../../../include/c++/8/ostream:508:5: note: candidate template ignored: could not match 'basic_ostream' against 'basic_istream'
    operator<<(basic_ostream<char, _Traits>& __out, char __c)
    ^
/usr/bin/../lib/gcc/x86_64-linux-gnu/8/../../../../include/c++/8/ostream:514:5: note: candidate template ignored: could not match 'basic_ostream' against 'basic_istream'
    operator<<(basic_ostream<char, _Traits>& __out, signed char __c)
    ^
/usr/bin/../lib/gcc/x86_64-linux-gnu/8/../../../../include/c++/8/ostream:519:5: note: candidate template ignored: could not match 'basic_ostream' against 'basic_istream'
    operator<<(basic_ostream<char, _Traits>& __out, unsigned char __c)
    ^
/usr/bin/../lib/gcc/x86_64-linux-gnu/8/../../../../include/c++/8/ostream:539:5: note: candidate template ignored: could not match 'basic_ostream' against 'basic_istream'
    operator<<(basic_ostream<_CharT, _Traits>& __out, const _CharT* __s)
    ^
/usr/bin/../lib/gcc/x86_64-linux-gnu/8/../../../../include/c++/8/ostream:556:5: note: candidate template ignored: could not match 'basic_ostream' against 'basic_istream'
    operator<<(basic_ostream<char, _Traits>& __out, const char* __s)
    ^
/usr/bin/../lib/gcc/x86_64-linux-gnu/8/../../../../include/c++/8/ostream:569:5: note: candidate template ignored: could not match 'basic_ostream' against 'basic_istream'
    operator<<(basic_ostream<char, _Traits>& __out, const signed char* __s)
    ^
/usr/bin/../lib/gcc/x86_64-linux-gnu/8/../../../../include/c++/8/ostream:574:5: note: candidate template ignored: could not match 'basic_ostream' against 'basic_istream'
    operator<<(basic_ostream<char, _Traits>& __out, const unsigned char* __s)
    ^
/usr/bin/../lib/gcc/x86_64-linux-gnu/8/../../../../include/c++/8/bits/ostream.tcc:321:5: note: candidate template ignored: could not match 'basic_ostream' against 'basic_istream'
    operator<<(basic_ostream<_CharT, _Traits>& __out, const char* __s)
    ^
/usr/bin/../lib/gcc/x86_64-linux-gnu/8/../../../../include/c++/8/ostream:682:5: note: candidate template ignored: requirement '__and_<__not_<is_lvalue_reference<basic_istream<char> &> >, __is_convertible_to_basic_ostream<basic_istream<char> &>, __is_insertable<__rvalue_ostream_type<basic_istream<char> &>, const int &> >::value' was not satisfied [with _Ostream = std::basic_istream<char> &, _Tp = int]
    operator<<(_Ostream&& __os, const _Tp& __x)
    ^
1 error generated.

                    
#5
Error de compilación
                      main.cpp:18:8: error: invalid operands to binary expression ('std::istream' (aka 'basic_istream<char>') and 'int')
    cin<<a<<b;
    ~~~^ ~
/usr/bin/../lib/gcc/x86_64-linux-gnu/8/../../../../include/c++/8/bits/basic_string.h:6323:5: note: candidate template ignored: could not match 'basic_ostream' against 'basic_istream'
    operator<<(basic_ostream<_CharT, _Traits>& __os,
    ^
/usr/bin/../lib/gcc/x86_64-linux-gnu/8/../../../../include/c++/8/system_error:217:5: note: candidate template ignored: could not match 'basic_ostream' against 'basic_istream'
    operator<<(basic_ostream<_CharT, _Traits>& __os, const error_code& __e)
    ^
/usr/bin/../lib/gcc/x86_64-linux-gnu/8/../../../../include/c++/8/ostream:497:5: note: candidate template ignored: could not match 'basic_ostream' against 'basic_istream'
    operator<<(basic_ostream<_CharT, _Traits>& __out, _CharT __c)
    ^
/usr/bin/../lib/gcc/x86_64-linux-gnu/8/../../../../include/c++/8/ostream:502:5: note: candidate template ignored: could not match 'basic_ostream' against 'basic_istream'
    operator<<(basic_ostream<_CharT, _Traits>& __out, char __c)
    ^
/usr/bin/../lib/gcc/x86_64-linux-gnu/8/../../../../include/c++/8/ostream:508:5: note: candidate template ignored: could not match 'basic_ostream' against 'basic_istream'
    operator<<(basic_ostream<char, _Traits>& __out, char __c)
    ^
/usr/bin/../lib/gcc/x86_64-linux-gnu/8/../../../../include/c++/8/ostream:514:5: note: candidate template ignored: could not match 'basic_ostream' against 'basic_istream'
    operator<<(basic_ostream<char, _Traits>& __out, signed char __c)
    ^
/usr/bin/../lib/gcc/x86_64-linux-gnu/8/../../../../include/c++/8/ostream:519:5: note: candidate template ignored: could not match 'basic_ostream' against 'basic_istream'
    operator<<(basic_ostream<char, _Traits>& __out, unsigned char __c)
    ^
/usr/bin/../lib/gcc/x86_64-linux-gnu/8/../../../../include/c++/8/ostream:539:5: note: candidate template ignored: could not match 'basic_ostream' against 'basic_istream'
    operator<<(basic_ostream<_CharT, _Traits>& __out, const _CharT* __s)
    ^
/usr/bin/../lib/gcc/x86_64-linux-gnu/8/../../../../include/c++/8/ostream:556:5: note: candidate template ignored: could not match 'basic_ostream' against 'basic_istream'
    operator<<(basic_ostream<char, _Traits>& __out, const char* __s)
    ^
/usr/bin/../lib/gcc/x86_64-linux-gnu/8/../../../../include/c++/8/ostream:569:5: note: candidate template ignored: could not match 'basic_ostream' against 'basic_istream'
    operator<<(basic_ostream<char, _Traits>& __out, const signed char* __s)
    ^
/usr/bin/../lib/gcc/x86_64-linux-gnu/8/../../../../include/c++/8/ostream:574:5: note: candidate template ignored: could not match 'basic_ostream' against 'basic_istream'
    operator<<(basic_ostream<char, _Traits>& __out, const unsigned char* __s)
    ^
/usr/bin/../lib/gcc/x86_64-linux-gnu/8/../../../../include/c++/8/bits/ostream.tcc:321:5: note: candidate template ignored: could not match 'basic_ostream' against 'basic_istream'
    operator<<(basic_ostream<_CharT, _Traits>& __out, const char* __s)
    ^
/usr/bin/../lib/gcc/x86_64-linux-gnu/8/../../../../include/c++/8/ostream:682:5: note: candidate template ignored: requirement '__and_<__not_<is_lvalue_reference<basic_istream<char> &> >, __is_convertible_to_basic_ostream<basic_istream<char> &>, __is_insertable<__rvalue_ostream_type<basic_istream<char> &>, const int &> >::value' was not satisfied [with _Ostream = std::basic_istream<char> &, _Tp = int]
    operator<<(_Ostream&& __os, const _Tp& __x)
    ^
1 error generated.

                    
Puntos totales: 0 / 100

Código

#include <iostream>
#include <cstring>
#include <cstdio>
#include <cmath>
#include <queue>
#include <set>
#include <map>
#include <vector>
#include <stack>
#include <algorithm>

using namespace std;
const int N = 6e5+20;

int main()
{
    int a, b;
    cin<<a<<b;
    cout<<a+b<<endl;
}