제출 #1339482

#제출 시각아이디문제언어결과실행 시간메모리
1339482vjudge1Parametriziran (COCI19_parametriziran)C++17
컴파일 에러
0 ms0 KiB
#include <bits/stdc++.h>
#define int long long
using namespace std;

const int MAXN = 1e5;
const int MOD = 666013;

bitset<MAXN + 1> has[6][27];
string s1[MAXN + 1];

signed main() {
    int n, m, i, j;
    long long ans = 0;
    string s;

    cin >> n >> m;

    for (i = 1; i <= n; i++) {
        cin >> s1[i];
        for (j = 0; j < m; j++) {
            if (s1[i][j] != '?')
                s1[i][j] -= 'a';
            else
                s1[i][j] = 26;

            has[j][(int)s1[i][j]][i] = 1;
        }
    }

    bitset<MAXN + 1> aux, correct;
    aux.set();

    for (i = 1; i <= n; i++) {
        bool ok = 1;
        correct = aux;
        s = s1[i];

        for (j = 0; j < m; j++) {
            if (s[j] != 26) {
                correct &= has[j][( int )s[j] | ( int )has[j]][26];
                ok = 0;
            }
        }

        if (ok == 1)
            ans += n;
        else
            ans += correct.count();
    }

    cout << ans << '\n';
    return 0;
}

컴파일 시 표준 에러 (stderr) 메시지

Main.cpp: In function 'int main()':
Main.cpp:40:25: error: no match for 'operator&=' (operand types are 'std::bitset<100001>' and 'std::bitset<100001>::reference')
   40 |                 correct &= has[j][( int )s[j] | ( int )has[j]][26];
In file included from /usr/include/x86_64-linux-gnu/c++/13/bits/stdc++.h:52,
                 from Main.cpp:1:
/usr/include/c++/13/bitset:1041:7: note: candidate: 'std::bitset<_Nb>& std::bitset<_Nb>::operator&=(const std::bitset<_Nb>&) [with long unsigned int _Nb = 100001]'
 1041 |       operator&=(const bitset<_Nb>& __rhs) _GLIBCXX_NOEXCEPT
      |       ^~~~~~~~
/usr/include/c++/13/bitset:1041:37: note:   no known conversion for argument 1 from 'std::bitset<100001>::reference' to 'const std::bitset<100001>&'
 1041 |       operator&=(const bitset<_Nb>& __rhs) _GLIBCXX_NOEXCEPT
      |                  ~~~~~~~~~~~~~~~~~~~^~~~~
In file included from /usr/include/x86_64-linux-gnu/c++/13/bits/stdc++.h:198:
/usr/include/c++/13/charconv:661:3: note: candidate: 'constexpr std::chars_format& std::operator&=(chars_format&, chars_format)'
  661 |   operator&=(chars_format& __lhs, chars_format __rhs) noexcept
      |   ^~~~~~~~
/usr/include/c++/13/charconv:661:28: note:   no known conversion for argument 1 from 'std::bitset<100001>' to 'std::chars_format&'
  661 |   operator&=(chars_format& __lhs, chars_format __rhs) noexcept
      |              ~~~~~~~~~~~~~~^~~~~
In file included from /usr/include/x86_64-linux-gnu/c++/13/bits/stdc++.h:176:
/usr/include/c++/13/future:176:18: note: candidate: 'std::launch& std::operator&=(launch&, launch)'
  176 |   inline launch& operator&=(launch& __x, launch __y) noexcept
      |                  ^~~~~~~~
/usr/include/c++/13/future:176:37: note:   no known conversion for argument 1 from 'std::bitset<100001>' to 'std::launch&'
  176 |   inline launch& operator&=(launch& __x, launch __y) noexcept
      |                             ~~~~~~~~^~~
In file included from /usr/include/c++/13/streambuf:43,
                 from /usr/include/c++/13/bits/streambuf_iterator.h:35,
                 from /usr/include/c++/13/iterator:66,
                 from /usr/include/x86_64-linux-gnu/c++/13/bits/stdc++.h:54:
/usr/include/c++/13/bits/ios_base.h:186:3: note: candidate: 'const std::_Ios_Iostate& std::operator&=(_Ios_Iostate&, _Ios_Iostate)'
  186 |   operator&=(_Ios_Iostate& __a, _Ios_Iostate __b)
      |   ^~~~~~~~
/usr/include/c++/13/bits/ios_base.h:186:28: note:   no known conversion for argument 1 from 'std::bitset<100001>' to 'std::_Ios_Iostate&'
  186 |   operator&=(_Ios_Iostate& __a, _Ios_Iostate __b)
      |              ~~~~~~~~~~~~~~^~~
/usr/include/c++/13/bits/ios_base.h:146:3: note: candidate: 'const std::_Ios_Openmode& std::operator&=(_Ios_Openmode&, _Ios_Openmode)'
  146 |   operator&=(_Ios_Openmode& __a, _Ios_Openmode __b)
      |   ^~~~~~~~
/usr/include/c++/13/bits/ios_base.h:146:29: note:   no known conversion for argument 1 from 'std::bitset<100001>' to 'std::_Ios_Openmode&'
  146 |   operator&=(_Ios_Openmode& __a, _Ios_Openmode __b)
      |              ~~~~~~~~~~~~~~~^~~
/usr/include/c++/13/bits/ios_base.h:103:3: note: candidate: 'const std::_Ios_Fmtflags& std::operator&=(_Ios_Fmtflags&, _Ios_Fmtflags)'
  103 |   operator&=(_Ios_Fmtflags& __a, _Ios_Fmtflags __b)
      |   ^~~~~~~~
/usr/include/c++/13/bits/ios_base.h:103:29: note:   no known conversion for argument 1 from 'std::bitset<100001>' to 'std::_Ios_Fmtflags&'
  103 |   operator&=(_Ios_Fmtflags& __a, _Ios_Fmtflags __b)
      |              ~~~~~~~~~~~~~~~^~~
In file included from /usr/include/x86_64-linux-gnu/c++/13/bits/stdc++.h:41:
/usr/include/c++/13/cstddef:172:3: note: candidate: 'constexpr std::byte& std::operator&=(byte&, byte)'
  172 |   operator&=(byte& __l, byte __r) noexcept
      |   ^~~~~~~~
/usr/include/c++/13/cstddef:172:20: note:   no known conversion for argument 1 from 'std::bitset<100001>' to 'std::byte&'
  172 |   operator&=(byte& __l, byte __r) noexcept
      |              ~~~~~~^~~