QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#592454 | #552. 字符串匹配问题 | 3un_larryfunc | Compile Error | / | / | C++20 | 495b | 2024-09-26 22:39:18 | 2024-09-26 22:39:19 |
Due to the privacy settings of the submitter, you are not allowed to view this code.
Details
answer.code:3:92: warning: ISO C++ forbids declaration of ‘main’ with no type [-Wreturn-type] 3 | using namespace std;constexpr int N = 3e5 + 5;bitset<N> p[26], ok;char s[N], t[N];int n, m;main() {cin >> (s + 1) >> (t + 1), n = strlen(s + 1), m = strlen(t + 1);for (int i = 1; i <= m; i++) {if (t[i] != '*') p[t[i] - 'a'].set(i);else for (int j = 0; j < 26; j++) p[j].set(i);}ok.set();for (int i = 1; i <= n; i++) {if (s[i] != '*') {ok &= p[s[i] - 'a'] >> (i - 1);}}for (int i = 1; i <= m - n + 1; i++) {if (ok[i]) {cout << i << " ";}}return 0;} | ^~~~ answer.code: In function ‘int main()’: answer.code:3:104: error: no match for ‘operator>>’ (operand types are ‘std::istream’ {aka ‘std::basic_istream<char>’} and ‘char*’) 3 | using namespace std;constexpr int N = 3e5 + 5;bitset<N> p[26], ok;char s[N], t[N];int n, m;main() {cin >> (s + 1) >> (t + 1), n = strlen(s + 1), m = strlen(t + 1);for (int i = 1; i <= m; i++) {if (t[i] != '*') p[t[i] - 'a'].set(i);else for (int j = 0; j < 26; j++) p[j].set(i);}ok.set();for (int i = 1; i <= n; i++) {if (s[i] != '*') {ok &= p[s[i] - 'a'] >> (i - 1);}}for (int i = 1; i <= m - n + 1; i++) {if (ok[i]) {cout << i << " ";}}return 0;} | ~~~ ^~ ~~~~~~~ | | | | | char* | std::istream {aka std::basic_istream<char>} In file included from /usr/include/c++/13/sstream:40, from /usr/include/c++/13/complex:45, from /usr/include/c++/13/ccomplex:39, from /usr/include/x86_64-linux-gnu/c++/13/bits/stdc++.h:127, from answer.code:1: /usr/include/c++/13/istream:325:7: note: candidate: ‘std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(void*&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]’ (near match) 325 | operator>>(void*& __p) | ^~~~~~~~ /usr/include/c++/13/istream:325:7: note: conversion of argument 1 would be ill-formed: answer.code:3:110: error: cannot bind non-const lvalue reference of type ‘void*&’ to an rvalue of type ‘void*’ 3 | using namespace std;constexpr int N = 3e5 + 5;bitset<N> p[26], ok;char s[N], t[N];int n, m;main() {cin >> (s + 1) >> (t + 1), n = strlen(s + 1), m = strlen(t + 1);for (int i = 1; i <= m; i++) {if (t[i] != '*') p[t[i] - 'a'].set(i);else for (int j = 0; j < 26; j++) p[j].set(i);}ok.set();for (int i = 1; i <= n; i++) {if (s[i] != '*') {ok &= p[s[i] - 'a'] >> (i - 1);}}for (int i = 1; i <= m - n + 1; i++) {if (ok[i]) {cout << i << " ";}}return 0;} | ~~~^~~~ /usr/include/c++/13/istream:201:7: note: candidate: ‘std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(long long unsigned int&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]’ (near match) 201 | operator>>(unsigned long long& __n) | ^~~~~~~~ /usr/include/c++/13/istream:201:7: note: conversion of argument 1 would be ill-formed: answer.code:3:110: error: invalid conversion from ‘char*’ to ‘long long unsigned int’ [-fpermissive] 3 | using namespace std;constexpr int N = 3e5 + 5;bitset<N> p[26], ok;char s[N], t[N];int n, m;main() {cin >> (s + 1) >> (t + 1), n = strlen(s + 1), m = strlen(t + 1);for (int i = 1; i <= m; i++) {if (t[i] != '*') p[t[i] - 'a'].set(i);else for (int j = 0; j < 26; j++) p[j].set(i);}ok.set();for (int i = 1; i <= n; i++) {if (s[i] != '*') {ok &= p[s[i] - 'a'] >> (i - 1);}}for (int i = 1; i <= m - n + 1; i++) {if (ok[i]) {cout << i << " ";}}return 0;} | ~~~^~~~ | | | char* answer.code:3:110: error: cannot bind rvalue ‘(long long unsigned int)(((char*)(& s)) + 1)’ to ‘long long unsigned int&’ /usr/include/c++/13/istream:197:7: note: candidate: ‘std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(long long int&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]’ (near match) 197 | operator>>(long long& _...