답안 #839591

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
839591 2023-08-30T10:04:40 Z kyaruru Pipes (CEOI15_pipes) C++17
컴파일 오류
0 ms 0 KB
#include <bits/stdc++.h>

using namespace std;
typedef long long ll;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;

vector<int> adj[100001];
vector<int> tin(100001,-1),low(100001,-1);
vector<pii> ans;
bool vi[100001];
int t=0;


void dfs(int x,int p=-1){
    vi[x]=true;
    tin[x]=low[x]=t++;
    for(int u:adj[x]){
        if(u==p) continue;
        if(vi[u]){
            low[x]=min(low[x],tin[u]);
        }else{
            dfs(u,x);
            low[x]=min(low[x],low[u]);
            if(low[u]>tin[x]) cout>>u>>" ">>x>>"₩n";
        }
    }
}

int main() {
    ios::sync_with_stdio(0);
    cin.tie(0);

    int a,b;
    cin>>a>>b;

    for(int i=0; i<b; i++){
        int x,y;
        cin>>x>>y;
        adj[x].push_back(y);
        adj[y].push_back(x);
    }

    for(int i=1; i<=a; i++){
        if(!vi[i]) dfs(i);
    }
}

Compilation message

pipes.cpp: In function 'void dfs(int, int)':
pipes.cpp:25:35: error: no match for 'operator>>' (operand types are 'std::ostream' {aka 'std::basic_ostream<char>'} and 'int')
   25 |             if(low[u]>tin[x]) cout>>u>>" ">>x>>"₩n";
      |                               ~~~~^~~
      |                               |     |
      |                               |     int
      |                               std::ostream {aka std::basic_ostream<char>}
pipes.cpp:25:35: note: candidate: 'operator>>(int, int)' (built-in)
   25 |             if(low[u]>tin[x]) cout>>u>>" ">>x>>"₩n";
      |                               ~~~~^~~
pipes.cpp:25:35: note:   no known conversion for argument 1 from 'std::ostream' {aka 'std::basic_ostream<char>'} to 'int'
In file included from /usr/include/x86_64-linux-gnu/c++/10/bits/stdc++.h:45,
                 from pipes.cpp:1:
/usr/include/c++/10/cstddef:130:5: note: candidate: 'template<class _IntegerType> constexpr std::__byte_op_t<_IntegerType> std::operator>>(std::byte, _IntegerType)'
  130 |     operator>>(byte __b, _IntegerType __shift) noexcept
      |     ^~~~~~~~
/usr/include/c++/10/cstddef:130:5: note:   template argument deduction/substitution failed:
pipes.cpp:25:31: note:   cannot convert 'std::cout' (type 'std::ostream' {aka 'std::basic_ostream<char>'}) to type 'std::byte'
   25 |             if(low[u]>tin[x]) cout>>u>>" ">>x>>"₩n";
      |                               ^~~~
In file included from /usr/include/c++/10/string:56,
                 from /usr/include/c++/10/bits/locale_classes.h:40,
                 from /usr/include/c++/10/bits/ios_base.h:41,
                 from /usr/include/c++/10/ios:42,
                 from /usr/include/c++/10/istream:38,
                 from /usr/include/c++/10/sstream:38,
                 from /usr/include/c++/10/complex:45,
                 from /usr/include/c++/10/ccomplex:39,
                 from /usr/include/x86_64-linux-gnu/c++/10/bits/stdc++.h:54,
                 from pipes.cpp:1:
/usr/include/c++/10/bits/basic_string.tcc:1476:5: note: candidate: 'template<class _CharT, class _Traits, class _Alloc> std::basic_istream<_CharT, _Traits>& std::operator>>(std::basic_istream<_CharT, _Traits>&, std::__cxx11::basic_string<_CharT, _Traits, _Allocator>&)'
 1476 |     operator>>(basic_istream<_CharT, _Traits>& __in,
      |     ^~~~~~~~
/usr/include/c++/10/bits/basic_string.tcc:1476:5: note:   template argument deduction/substitution failed:
pipes.cpp:25:37: note:   'std::ostream' {aka 'std::basic_ostream<char>'} is not derived from 'std::basic_istream<_CharT, _Traits>'
   25 |             if(low[u]>tin[x]) cout>>u>>" ">>x>>"₩n";
      |                                     ^
In file included from /usr/include/c++/10/istream:991,
                 from /usr/include/c++/10/sstream:38,
                 from /usr/include/c++/10/complex:45,
                 from /usr/include/c++/10/ccomplex:39,
                 from /usr/include/x86_64-linux-gnu/c++/10/bits/stdc++.h:54,
                 from pipes.cpp:1:
/usr/include/c++/10/bits/istream.tcc:931:5: note: candidate: 'template<class _CharT, class _Traits> std::basic_istream<_CharT, _Traits>& std::operator>>(std::basic_istream<_CharT, _Traits>&, _CharT&)'
  931 |     operator>>(basic_istream<_CharT, _Traits>& __in, _CharT& __c)
      |     ^~~~~~~~
/usr/include/c++/10/bits/istream.tcc:931:5: note:   template argument deduction/substitution failed:
pipes.cpp:25:37: note:   'std::ostream' {aka 'std::basic_ostream<char>'} is not derived from 'std::basic_istream<_CharT, _Traits>'
   25 |             if(low[u]>tin[x]) cout>>u>>" ">>x>>"₩n";
      |                                     ^
In file included from /usr/include/c++/10/sstream:38,
                 from /usr/include/c++/10/complex:45,
                 from /usr/include/c++/10/ccomplex:39,
                 from /usr/include/x86_64-linux-gnu/c++/10/bits/stdc++.h:54,
                 from pipes.cpp:1:
/usr/include/c++/10/istream:756:5: note: candidate: 'template<class _Traits> std::basic_istream<char, _Traits>& std::operator>>(std::basic_istream<char, _Traits>&, unsigned char&)'
  756 |     operator>>(basic_istream<char, _Traits>& __in, unsigned char& __c)
      |     ^~~~~~~~
/usr/include/c++/10/istream:756:5: note:   template argument deduction/substitution failed:
pipes.cpp:25:37: note:   'std::ostream' {aka 'std::basic_ostream<char>'} is not derived from 'std::basic_istream<char, _Traits>'
   25 |             if(low[u]>tin[x]) cout>>u>>" ">>x>>"₩n";
      |                                     ^
In file included from /usr/include/c++/10/sstream:38,
                 from /usr/include/c++/10/complex:45,
                 from /usr/include/c++/10/ccomplex:39,
                 from /usr/include/x86_64-linux-gnu/c++/10/bits/stdc++.h:54,
                 from pipes.cpp:1:
/usr/include/c++/10/istream:761:5: note: candidate: 'template<class _Traits> std::basic_istream<char, _Traits>& std::operator>>(std::basic_istream<char, _Traits>&, signed char&)'
  761 |     operator>>(basic_istream<char, _Traits>& __in, signed char& __c)
      |     ^~~~~~~~
/usr/include/c++/10/istream:761:5: note:   template argument deduction/substitution failed:
pipes.cpp:25:37: note:   'std::ostream' {aka 'std::basic_ostream<char>'} is not derived from 'std::basic_istream<char, _Traits>'
   25 |             if(low[u]>tin[x]) cout>>u>>" ">>x>>"₩n";
      |                                     ^
In file included from /usr/include/c++/10/istream:991,
                 from /usr/include/c++/10/sstream:38,
                 from /usr/include/c++/10/complex:45,
                 from /usr/include/c++/10/ccomplex:39,
                 from /usr/include/x86_64-linux-gnu/c++/10/bits/stdc++.h:54,
                 from pipes.cpp:1:
/usr/include/c++/10/bits/istream.tcc:963:5: note: candidate: 'template<class _CharT2, class _Traits2> std::basic_istream<_CharT, _Traits>& std::operator>>(std::basic_istream<_CharT, _Traits>&, _CharT2*)'
  963 |     operator>>(basic_istream<_CharT, _Traits>& __in, _CharT* __s)
      |     ^~~~~~~~
/usr/include/c++/10/bits/istream.tcc:963:5: note:   template argument deduction/substitution failed:
pipes.cpp:25:37: note:   'std::ostream' {aka 'std::basic_ostream<char>'} is not derived from 'std::basic_istream<_CharT, _Traits>'
   25 |             if(low[u]>tin[x]) cout>>u>>" ">>x>>"₩n";
      |                                     ^
In file included from /usr/include/c++/10/sstream:38,
                 from /usr/include/c++/10/complex:45,
                 from /usr/include/c++/10/ccomplex:39,
                 from /usr/include/x86_64-linux-gnu/c++/10/bits/stdc++.h:54,
                 from pipes.cpp:1:
/usr/include/c++/10/istream:803:5: note: candidate: 'template<class _Traits> std::basic_istream<char, _Traits>& std::operator>>(std::basic_istream<char, _Traits>&, unsigned char*)'
  803 |     operator>>(basic_istream<char, _Traits>& __in, unsigned char* __s)
      |     ^~~~~~~~
/usr/include/c++/10/istream:803:5: note:   template argument deduction/substitution failed:
pipes.cpp:25:37: note:   'std::ostream' {aka 'std::basic_ostream<char>'} is not derived from 'std::basic_istream<char, _Traits>'
   25 |             if(low[u]>tin[x]) cout>>u>>" ">>x>>"₩n";
      |                                     ^
In file included from /usr/include/c++/10/sstream:38,
                 from /usr/include/c++/10/complex:45,
                 from /usr/include/c++/10/ccomplex:39,
                 from /usr/include/x86_64-linux-gnu/c++/10/bits/stdc++.h:54,
                 from pipes.cpp:1:
/usr/include/c++/10/istream:808:5: note: candidate: 'template<class _Traits> std::basic_istream<char, _Traits>& std::operator>>(std::basic_istream<char, _Traits>&, signed char*)'
  808 |     operator>>(basic_istream<char, _Traits>& __in, signed char* __s)
      |     ^~~~~~~~
/usr/include/c++/10/istream:808:5: note:   template argument deduction/substitution failed:
pipes.cpp:25:37: note:   'std::ostream' {aka 'std::basic_ostream<char>'} is not derived from 'std::basic_istream<char, _Traits>'
   25 |             if(low[u]>tin[x]) cout>>u>>" ">>x>>"₩n";
      |                                     ^
In file included from /usr/include/c++/10/sstream:38,
                 from /usr/include/c++/10/complex:45,
                 from /usr/include/c++/10/ccomplex:39,
                 from /usr/include/x86_64-linux-gnu/c++/10/bits/stdc++.h:54,
                 from pipes.cpp:1:
/usr/include/c++/10/istream:980:5: note: candidate: 'template<class _Istream, class _Tp> typename std::enable_if<std::__and_<std::__not_<std::is_lvalue_reference<_Tp> >, std::__is_convertible_to_basic_istream<_Istream>, std::__is_extractable<typename std::__is_convertible_to_basic_istream<_Tp>::__istream_type, _Tp&&, void> >::value, typename std::__is_convertible_to_basic_istream<_Tp>::__istream_type>::type std::operator>>(_Istream&&, _Tp&&)'
  980 |     operator>>(_Istream&& __is, _Tp&& __x)
      |     ^~~~~~~~
/usr/include/c++/10/istream:980:5: note:   template argument deduction/substitution failed:
/usr/include/c++/10/istream: In substitution of 'template<class _Istream, class _Tp> typename std::enable_if<std::__and_<std::__not_<std::is_lvalue_reference<_Tp> >, std::__is_convertible_to_basic_istream<_Istream>, std::__is_extractable<typename std::__is_convertible_to_basic_istream<_Tp>::__istream_type, _Tp&&, void> >::value, typename std::__is_convertible_to_basic_istream<_Tp>::__istream_type>::type std::operator>>(_Istream&&, _Tp&&) [with _Istream = std::basic_ostream<char>&; _Tp = int&]':
pipes.cpp:25:37:   required from here
/usr/include/c++/10/istream:980:5: error: no type named 'type' in 'struct std::enable_if<false, void>'
In file included from /usr/include/c++/10/ccomplex:39,
                 from /usr/include/x86_64-linux-gnu/c++/10/bits/stdc++.h:54,
                 from pipes.cpp:1:
/usr/include/c++/10/complex:500:5: note: candidate: 'template<class _Tp, class _CharT, class _Traits> std::basic_istream<_CharT, _Traits>& std::operator>>(std::basic_istream<_CharT, _Traits>&, std::complex<_Tp>&)'
  500 |     operator>>(basic_istream<_CharT, _Traits>& __is, complex<_Tp>& __x)
      |     ^~~~~~~~
/usr/include/c++/10/complex:500:5: note:   template argument deduction/substitution failed:
pipes.cpp:25:37: note:   'std::ostream' {aka 'std::basic_ostream<char>'} is not derived from 'std::basic_istream<_CharT, _Traits>'
   25 |             if(low[u]>tin[x]) cout>>u>>" ">>x>>"₩n";
      |                                     ^
In file included from /usr/include/x86_64-linux-gnu/c++/10/bits/stdc++.h:66,
                 from pipes.cpp:1:
/usr/include/c++/10/bitset:1472:5: note: candidate: 'template<class _CharT, class _Traits, long unsigned int _Nb> std::basic_istream<_CharT, _Traits>& std::operator>>(std::basic_istream<_CharT, _Traits>&, std::bitset<_Nb>&)'
 1472 |     operator>>(std::basic_istream<_CharT, _Traits>& __is, bitset<_Nb>& __x)
      |     ^~~~~~~~
/usr/include/c++/10/bitset:1472:5: note:   template argument deduction/substitution failed:
pipes.cpp:25:37: note:   'std::ostream' {aka 'std::basic_ostream<char>'} is not derived from 'std::basic_istream<_CharT, _Traits>'
   25 |             if(low[u]>tin[x]) cout>>u>>" ">>x>>"₩n";
      |                                     ^
In file included from /usr/include/x86_64-linux-gnu/c++/10/bits/stdc++.h:72,
                 from pipes.cpp:1:
/usr/include/c++/10/iomanip:71:5: note: candidate: 'template<class _CharT, class _Traits> std::basic_istream<_CharT, _Traits>& std::operator>>(std::basic_istream<_CharT, _Traits>&, std::_Resetiosflags)'
   71 |     operator>>(basic_istream<_CharT, _Traits>& __is, _Resetiosflags __f)
      |     ^~~~~~~~
/usr/include/c++/10/iomanip:71:5: note:   template argument deduction/substitution failed:
pipes.cpp:25:37: note:   'std::ostream' {aka 'std::basic_ostream<char>'} is not derived from 'std::basic_istream<_CharT, _Traits>'
   25 |             if(low[u]>tin[x]) cout>>u>>" ">>x>>"₩n";
      |                                     ^
In file included from /usr/include/x86_64-linux-gnu/c++/10/bits/stdc++.h:72,
                 from pipes.cpp:1:
/usr/include/c++/10/iomanip:101:5: note: candidate: 'template<class _CharT, class _Traits> std::basic_istream<_CharT, _Traits>& std::operator>>(std::basic_istream<_CharT, _Traits>&, std::_Setiosflags)'
  101 |     operator>>(basic_istream<_CharT, _Traits>& __is, _Setiosflags __f)
      |     ^~~~~~~~
/usr/include/c++/10/iomanip:101:5: note:   template argument deduction/substitution failed:
pipes.cpp:25:37: note:   'std::ostream' {aka 'std::basic_ostream<char>'} is not derived from 'std::basic_istream<_CharT, _Traits>'
   25 |             if(low[u]>tin[x]) cout>>u>>" ">>x>>"₩n";
      |                                     ^
In file included from /usr/include/x86_64-linux-gnu/c++/10/bits/stdc++.h:72,
                 from pipes.cpp:1:
/usr/include/c++/10/iomanip:132:5: note: candidate: 'template<class _CharT, class _Traits> std::basic_istream<_CharT, _Traits>& std::operator>>(std::basic_istream<_CharT, _Traits>&, std::_Setbase)'
  132 |     operator>>(basic_istream<_CharT, _Traits>& __is, _Setbase __f)
      |     ^~~~~~~~
/usr/include/c++/10/iomanip:132:5: note:   template argument deduction/substitution failed:
pipes.cpp:25:37: note:   'std::ostream' {aka 'std::basic_ostream<char>'} is not derived from 'std::basic_istream<_CharT, _Traits>'
   25 |             if(low[u]>tin[x]) cout>>u>>" ">>x>>"₩n";
      |                                     ^
In file included from /usr/include/x86_64-linux-gnu/c++/10/bits/stdc++.h:72,
                 from pipes.cpp:1:
/usr/include/c++/10/iomanip:170:5: note: candidate: 'template<class _CharT, class _Traits> std::basic_istream<_CharT, _Traits>& std::operator>>(std::basic_istream<_CharT, _Traits>&, std::_Setfill<_CharT>)'
  170 |     operator>>(basic_istream<_CharT, _Traits>& __is, _Setfill<_CharT> __f)
      |     ^~~~~~~~
/usr/include/c++/10/iomanip:170:5: note:   template argument deduction/substitution failed:
pipes.cpp:25:37: note:   'std::ostream' {aka 'std::basic_ostream<char>'} is not derived from 'std::basic_istream<_CharT, _Traits>'
   25 |             if(low[u]>tin[x]) cout>>u>>" ">>x>>"₩n";
      |                                     ^
In file included from /usr/include/x86_64-linux-gnu/c++/10/bits/stdc++.h:72,
                 from pipes.cpp:1:
/usr/include/c++/10/iomanip:200:5: note: candidate: 'template<class _CharT, class _Traits> std::basic_istream<_CharT, _Traits>& std::operator>>(std::basic_istream<_CharT, _Traits>&, std::_Setprecision)'
  200 |     operator>>(basic_istream<_CharT, _Traits>& __is, _Setprecision __f)
      |     ^~~~~~~~
/usr/include/c++/10/iomanip:200:5: note:   template argument deduction/substitution failed:
pipes.cpp:25:37: note:   'std::ostream' {aka 'std::basic_ostream<char>'} is not derived from 'std::basic_istream<_CharT, _Traits>'
   25 |             if(low[u]>tin[x]) cout>>u>>" ">>x>>"₩n";
      |                                     ^
In file included from /usr/include/x86_64-linux-gnu/c++/10/bits/stdc++.h:72,
                 from pipes.cpp:1:
/usr/include/c++/10/iomanip:230:5: note: candidate: 'template<class _CharT, class _Traits> std::basic_istream<_CharT, _Traits>& std::operator>>(std::basic_istream<_CharT, _Traits>&, std::_Setw)'
  230 |     operator>>(basic_istream<_CharT, _Traits>& __is, _Setw __f)
      |     ^~~~~~~~
/usr/include/c++/10/iomanip:230:5: note:   template argument deduction/substitution failed:
pipes.cpp:25:37: note:   'std::ostream' {aka 'std::basic_ostream<char>'} is not derived from 'std::basic_istream<_CharT, _Traits>'
   25 |             if(low[u]>tin[x]) cout>>u>>" ">>x>>"₩n";
      |                                     ^
In file included from /usr/include/x86_64-linux-gnu/c++/10/bits/stdc++.h:72,
                 from pipes.cpp:1:
/usr/include/c++/10/iomanip:264:5: note: candidate: 'template<class _CharT, class _Traits, class _MoneyT> std::basic_istream<_CharT, _Traits>& std::operator>>(std::basic_istream<_CharT, _Traits>&, std::_Get_money<_MoneyT>)'
  264 |     operator>>(basic_istream<_CharT, _Traits>& __is, _Get_money<_MoneyT> __f)
      |     ^~~~~~~~
/usr/include/c++/10/iomanip:264:5: note:   template argument deduction/substitution failed:
pipes.cpp:25:37: note:   'std::ostream' {aka 'std::basic_ostream<char>'} is not derived from 'std::basic_istream<_CharT, _Traits>'
   25 |             if(low[u]>tin[x]) cout>>u>>" ">>x>>"₩n";
      |                                     ^
In file included from /usr/include/x86_64-linux-gnu/c++/10/bits/stdc++.h:72,
                 from pipes.cpp:1:
/usr/include/c++/10/iomanip:418:5: note: candidate: 'template<class _CharT, class _Traits> std::basic_istream<_CharT, _Traits>& std::operator>>(std::basic_istream<_CharT, _Traits>&, std::_Get_time<_CharT>)'
  418 |     operator>>(basic_istream<_CharT, _Traits>& __is, _Get_time<_CharT> __f)
      |     ^~~~~~~~
/usr/include/c++/10/iomanip:418:5: note:   template argument deduction/substitution failed:
pipes.cpp:25:37: note:   'std::ostream' {aka 'std::basic_ostream<char>'} is not derived from 'std::basic_istream<_CharT, _Traits>'
   25 |             if(low[u]>tin[x]) cout>>u>>" ">>x>>"₩n";
      |                                     ^
In file included from /usr/include/c++/10/valarray:603,
                 from /usr/include/x86_64-linux-gnu/c++/10/bits/stdc++.h:95,
                 from pipes.cpp:1:
/usr/include/c++/10/bits/valarray_after.h:414:5: note: candidate: 'template<class _Dom1, class _Dom2> std::_Expr<std::__detail::_BinClos<std::__shift_right, std::_Expr, std::_Expr, _Dom1, _Dom2>, typename std::__fun<std::__shift_right, typename _Dom1::value_type>::result_type> std::operator>>(const std::_Expr<_Dom1, typename _Dom1::value_type>&, const std::_Expr<_Dom2, typename _Dom2::value_type>&)'
  414 |     _DEFINE_EXPR_BINARY_OPERATOR(>>, __shift_right)
      |     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/c++/10/bits/valarray_after.h:414:5: note:   template argument deduction/substitution failed:
pipes.cpp:25:37: note:   'std::ostream' {aka 'std::basic_ostream<char>'} is not derived from 'const std::_Expr<_Dom1, typename _Dom1::value_type>'
   25 |             if(low[u]>tin[x]) cout>>u>>" ">>x>>"₩n";
      |                                     ^
In file included from /usr/include/c++/10/valarray:603,
                 from /usr/include/x86_64-linux-gnu/c++/10/bits/stdc++.h:95,
                 from pipes.cpp:1:
/usr/include/c++/10/bits/valarray_after.h:414:5: note: candidate: 'template<class _Dom> std::_Expr<std::__detail::_BinClos<std::__shift_right, std::_Expr,