submission_id
stringlengths 10
10
| problem_id
stringlengths 6
6
| language
stringclasses 3
values | code
stringlengths 1
522k
| compiler_output
stringlengths 43
10.2k
|
|---|---|---|---|---|
s235550284
|
p03970
|
C++
|
#include <iostream>
#include <string>
using namespace std;
int main(){
string s;
cin >> s;
string s0 = "CODEFESTIVAL2016";
int ans = 0;
for(int i = 0; i < s0.length; i++){
if(s[i] != s0[i]) ans++;
}
cout << ans << endl;
}
|
a.cc: In function 'int main()':
a.cc:11:25: error: invalid use of member function 'std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::size_type std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::length() const [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>; size_type = long unsigned int]' (did you forget the '()' ?)
11 | for(int i = 0; i < s0.length; i++){
| ~~~^~~~~~
| ()
|
s861966786
|
p03970
|
C
|
#include <stdio.h>
int main(void)
{
char fes[16] = 'CODEFESTIVAL2016' ;
char s[16] ;
int i,n ;
scanf("%s",&s) ;
for(i=0 ; i<16 ; i++){
if(fes[i]==s[i]) n++ ;
}
printf("%d\n",n) ;
return 0 ;
}
|
main.c: In function 'main':
main.c:5:24: warning: multi-character literal with 16 characters exceeds 'int' size of 4 bytes
5 | char fes[16] = 'CODEFESTIVAL2016' ;
| ^~~~~~~~~~~~~~~~~~
main.c:5:24: error: invalid initializer
|
s576554333
|
p03970
|
C
|
#inlcude<stdio.h>
int main(){
char ,w[20],s[]={"C0DEFESTIVAL2O16"};
int i,j=0;
scanf("%s",w);
for(i=0;s[i];i++){
if(s[i]-w[i])j++;
}
printf("%d\n",j);
return 0;
}
|
main.c:1:2: error: invalid preprocessing directive #inlcude; did you mean #include?
1 | #inlcude<stdio.h>
| ^~~~~~~
| include
main.c: In function 'main':
main.c:3:14: error: expected identifier or '(' before ',' token
3 | char ,w[20],s[]={"C0DEFESTIVAL2O16"};
| ^
main.c:5:9: error: implicit declaration of function 'scanf' [-Wimplicit-function-declaration]
5 | scanf("%s",w);
| ^~~~~
main.c:1:1: note: include '<stdio.h>' or provide a declaration of 'scanf'
+++ |+#include <stdio.h>
1 | #inlcude<stdio.h>
main.c:5:9: warning: incompatible implicit declaration of built-in function 'scanf' [-Wbuiltin-declaration-mismatch]
5 | scanf("%s",w);
| ^~~~~
main.c:5:9: note: include '<stdio.h>' or provide a declaration of 'scanf'
main.c:5:20: error: 'w' undeclared (first use in this function)
5 | scanf("%s",w);
| ^
main.c:5:20: note: each undeclared identifier is reported only once for each function it appears in
main.c:6:17: error: 's' undeclared (first use in this function)
6 | for(i=0;s[i];i++){
| ^
main.c:9:9: error: implicit declaration of function 'printf' [-Wimplicit-function-declaration]
9 | printf("%d\n",j);
| ^~~~~~
main.c:9:9: note: include '<stdio.h>' or provide a declaration of 'printf'
main.c:9:9: warning: incompatible implicit declaration of built-in function 'printf' [-Wbuiltin-declaration-mismatch]
main.c:9:9: note: include '<stdio.h>' or provide a declaration of 'printf'
|
s623263751
|
p03970
|
C++
|
#include <iostream>
using namespace std;
int main() {
string s;
string a = "CODEFESTIVAL2016";
int cnt = 0;
s << cin;
for (int i = 0; i < 16; i++) {
if (s.at(i) != a.at(i)) {
cnt++;
}
}
cout << cnt << endl;
}
|
a.cc: In function 'int main()':
a.cc:9:11: error: no match for 'operator<<' (operand types are 'std::string' {aka 'std::__cxx11::basic_string<char>'} and 'std::istream' {aka 'std::basic_istream<char>'})
9 | s << cin;
| ~ ^~ ~~~
| | |
| | std::istream {aka std::basic_istream<char>}
| std::string {aka std::__cxx11::basic_string<char>}
In file included from /usr/include/c++/14/bits/basic_string.h:47,
from /usr/include/c++/14/string:54,
from /usr/include/c++/14/bits/locale_classes.h:40,
from /usr/include/c++/14/bits/ios_base.h:41,
from /usr/include/c++/14/ios:44,
from /usr/include/c++/14/ostream:40,
from /usr/include/c++/14/iostream:41,
from a.cc:1:
/usr/include/c++/14/string_view:763:5: note: candidate: 'template<class _CharT, class _Traits> std::basic_ostream<_CharT, _Traits>& std::operator<<(basic_ostream<_CharT, _Traits>&, basic_string_view<_CharT, _Traits>)'
763 | operator<<(basic_ostream<_CharT, _Traits>& __os,
| ^~~~~~~~
/usr/include/c++/14/string_view:763:5: note: template argument deduction/substitution failed:
a.cc:9:14: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'std::basic_ostream<_CharT, _Traits>'
9 | s << cin;
| ^~~
/usr/include/c++/14/bits/basic_string.h:4077:5: note: candidate: 'template<class _CharT, class _Traits, class _Alloc> std::basic_ostream<_CharT, _Traits>& std::operator<<(basic_ostream<_CharT, _Traits>&, const __cxx11::basic_string<_CharT, _Traits, _Allocator>&)'
4077 | operator<<(basic_ostream<_CharT, _Traits>& __os,
| ^~~~~~~~
/usr/include/c++/14/bits/basic_string.h:4077:5: note: template argument deduction/substitution failed:
a.cc:9:14: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'std::basic_ostream<_CharT, _Traits>'
9 | s << cin;
| ^~~
In file included from /usr/include/c++/14/bits/memory_resource.h:38,
from /usr/include/c++/14/string:68:
/usr/include/c++/14/cstddef:125:5: note: candidate: 'template<class _IntegerType> constexpr std::__byte_op_t<_IntegerType> std::operator<<(byte, _IntegerType)'
125 | operator<<(byte __b, _IntegerType __shift) noexcept
| ^~~~~~~~
/usr/include/c++/14/cstddef:125:5: note: template argument deduction/substitution failed:
a.cc:9:9: note: cannot convert 's' (type 'std::string' {aka 'std::__cxx11::basic_string<char>'}) to type 'std::byte'
9 | s << cin;
| ^
In file included from /usr/include/c++/14/bits/ios_base.h:46:
/usr/include/c++/14/system_error:339:5: note: candidate: 'template<class _CharT, class _Traits> std::basic_ostream<_CharT, _Traits>& std::operator<<(basic_ostream<_CharT, _Traits>&, const error_code&)'
339 | operator<<(basic_ostream<_CharT, _Traits>& __os, const error_code& __e)
| ^~~~~~~~
/usr/include/c++/14/system_error:339:5: note: template argument deduction/substitution failed:
a.cc:9:14: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'std::basic_ostream<_CharT, _Traits>'
9 | s << cin;
| ^~~
/usr/include/c++/14/ostream:563:5: note: candidate: 'template<class _CharT, class _Traits> std::basic_ostream<_CharT, _Traits>& std::operator<<(basic_ostream<_CharT, _Traits>&, _CharT)'
563 | operator<<(basic_ostream<_CharT, _Traits>& __out, _CharT __c)
| ^~~~~~~~
/usr/include/c++/14/ostream:563:5: note: template argument deduction/substitution failed:
a.cc:9:14: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'std::basic_ostream<_CharT, _Traits>'
9 | s << cin;
| ^~~
/usr/include/c++/14/ostream:573:5: note: candidate: 'template<class _CharT, class _Traits> std::basic_ostream<_CharT, _Traits>& std::operator<<(basic_ostream<_CharT, _Traits>&, char)'
573 | operator<<(basic_ostream<_CharT, _Traits>& __out, char __c)
| ^~~~~~~~
/usr/include/c++/14/ostream:573:5: note: template argument deduction/substitution failed:
a.cc:9:14: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'std::basic_ostream<_CharT, _Traits>'
9 | s << cin;
| ^~~
/usr/include/c++/14/ostream:579:5: note: candidate: 'template<class _Traits> std::basic_ostream<char, _Traits>& std::operator<<(basic_ostream<char, _Traits>&, char)'
579 | operator<<(basic_ostream<char, _Traits>& __out, char __c)
| ^~~~~~~~
/usr/include/c++/14/ostream:579:5: note: template argument deduction/substitution failed:
a.cc:9:14: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'std::basic_ostream<char, _Traits>'
9 | s << cin;
| ^~~
/usr/include/c++/14/ostream:590:5: note: candidate: 'template<class _Traits> std::basic_ostream<char, _Traits>& std::operator<<(basic_ostream<char, _Traits>&, signed char)'
590 | operator<<(basic_ostream<char, _Traits>& __out, signed char __c)
| ^~~~~~~~
/usr/include/c++/14/ostream:590:5: note: template argument deduction/substitution failed:
a.cc:9:14: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'std::basic_ostream<char, _Traits>'
9 | s << cin;
| ^~~
/usr/include/c++/14/ostream:595:5: note: candidate: 'template<class _Traits> std::basic_ostream<char, _Traits>& std::operator<<(basic_ostream<char, _Traits>&, unsigned char)'
595 | operator<<(basic_ostream<char, _Traits>& __out, unsigned char __c)
| ^~~~~~~~
/usr/include/c++/14/ostream:595:5: note: template argument deduction/substitution failed:
a.cc:9:14: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'std::basic_ostream<char, _Traits>'
9 | s << cin;
| ^~~
/usr/include/c++/14/ostream:654:5: note: candidate: 'template<class _CharT, class _Traits> std::basic_ostream<_CharT, _Traits>& std::operator<<(basic_ostream<_CharT, _Traits>&, const _CharT*)'
654 | operator<<(basic_ostream<_CharT, _Traits>& __out, const _CharT* __s)
| ^~~~~~~~
/usr/include/c++/14/ostream:654:5: note: template argument deduction/substitution failed:
a.cc:9:14: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'std::basic_ostream<_CharT, _Traits>'
9 | s << cin;
| ^~~
In file included from /usr/include/c++/14/ostream:1022:
/usr/include/c++/14/bits/ostream.tcc:307:5: note: candidate: 'template<class _CharT, class _Traits> std::basic_ostream<_CharT, _Traits>& std::operator<<(basic_ostream<_CharT, _Traits>&, const char*)'
307 | operator<<(basic_ostream<_CharT, _Traits>& __out, const char* __s)
| ^~~~~~~~
/usr/include/c++/14/bits/ostream.tcc:307:5: note: template argument deduction/substitution failed:
a.cc:9:14: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'std::basic_ostream<_CharT, _Traits>'
9 | s << cin;
| ^~~
/usr/include/c++/14/ostream:671:5: note: candidate: 'template<class _Traits> std::basic_ostream<char, _Traits>& std::operator<<(basic_ostream<char, _Traits>&, const char*)'
671 | operator<<(basic_ostream<char, _Traits>& __out, const char* __s)
| ^~~~~~~~
/usr/include/c++/14/ostream:671:5: note: template argument deduction/substitution failed:
a.cc:9:14: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'std::basic_ostream<char, _Traits>'
9 | s << cin;
| ^~~
/usr/include/c++/14/ostream:684:5: note: candidate: 'template<class _Traits> std::basic_ostream<char, _Traits>& std::operator<<(basic_ostream<char, _Traits>&, const signed char*)'
684 | operator<<(basic_ostream<char, _Traits>& __out, const signed char* __s)
| ^~~~~~~~
/usr/include/c++/14/ostream:684:5: note: template argument deduction/substitution failed:
a.cc:9:14: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'std::basic_ostream<char, _Traits>'
9 | s << cin;
| ^~~
/usr/include/c++/14/ostream:689:5: note: candidate: 'template<class _Traits> std::basic_ostream<char, _Traits>& std::operator<<(basic_ostream<char, _Traits>&, const unsigned char*)'
689 | operator<<(basic_ostream<char, _Traits>& __out, const unsigned char* __s)
| ^~~~~~~~
/usr/include/c++/14/ostream:689:5: note: template argument deduction/substitution failed:
a.cc:9:14: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'std::basic_ostream<char, _Traits>'
9 | s << cin;
| ^~~
/usr/include/c++/14/ostream:810:5: note: candidate: 'template<class _Ostream, class _Tp> _Ostream&& std::operator<<(_Ostream&&, const _Tp&)'
810 | operator<<(_Ostream&& __os, const _Tp& __x)
| ^~~~~~~~
/usr/include/c++/14/ostream:810:5: note: template argument deduction/substitution failed:
/usr/include/c++/14/ostream: In substitution of 'template<class _Ostream, class _Tp> _Ostream&& std::operator<<(_Ostream&&, const _Tp&) [with _Ostream = std::__cxx11::basic_string<char>&; _Tp = std::basic_istream<char>]':
a.cc:9:7: required from here
9 | s << cin;
| ^~~
/usr/include/c++/14/ostream:810:5: error: no type named 'type' in 'struct std::enable_if<false, void>'
810 | operator<<(_Ostream&& __os, const _Tp& __x)
| ^~~~~~~~
|
s640835189
|
p03970
|
C++
|
#include <iostream> #include <string> using namespace std;
int main() { const char groundtruth[] = "CODEFESTIVAL2016"; string str; cin >> str; int count = 0; for (string::size_type i = 0; i < str.size(); ++i) { if (str[i] != groundtruth[i]) ++count; } cout << count << endl;
return 0; }
|
a.cc:1:81: warning: extra tokens at end of #include directive
1 | #include <iostream> #include <string> using namespace std;
| ^
a.cc: In function 'int main()':
a.cc:2:325: error: 'string' was not declared in this scope
2 | int main() { const char groundtruth[] = "CODEFESTIVAL2016"; string str; cin >> str; int count = 0; for (string::size_type i = 0; i < str.size(); ++i) { if (str[i] != groundtruth[i]) ++count; } cout << count << endl;
| ^~~~~~
a.cc:2:325: note: suggested alternatives:
In file included from /usr/include/c++/14/iosfwd:41,
from /usr/include/c++/14/ios:40,
from /usr/include/c++/14/ostream:40,
from /usr/include/c++/14/iostream:41,
from a.cc:1:
/usr/include/c++/14/bits/stringfwd.h:77:33: note: 'std::string'
77 | typedef basic_string<char> string;
| ^~~~~~
In file included from /usr/include/c++/14/bits/locale_classes.h:40,
from /usr/include/c++/14/bits/ios_base.h:41,
from /usr/include/c++/14/ios:44:
/usr/include/c++/14/string:76:11: note: 'std::pmr::string'
76 | using string = basic_string<char>;
| ^~~~~~
a.cc:2:405: error: 'cin' was not declared in this scope; did you mean 'std::cin'?
2 | int main() { const char groundtruth[] = "CODEFESTIVAL2016"; string str; cin >> str; int count = 0; for (string::size_type i = 0; i < str.size(); ++i) { if (str[i] != groundtruth[i]) ++count; } cout << count << endl;
| ^~~
| std::cin
/usr/include/c++/14/iostream:62:18: note: 'std::cin' declared here
62 | extern istream cin; ///< Linked to standard input
| ^~~
a.cc:2:412: error: 'str' was not declared in this scope; did you mean 'std'?
2 | int main() { const char groundtruth[] = "CODEFESTIVAL2016"; string str; cin >> str; int count = 0; for (string::size_type i = 0; i < str.size(); ++i) { if (str[i] != groundtruth[i]) ++count; } cout << count << endl;
| ^~~
| std
a.cc:2:650: error: 'string' is not a class, namespace, or enumeration
2 | int main() { const char groundtruth[] = "CODEFESTIVAL2016"; string str; cin >> str; int count = 0; for (string::size_type i = 0; i < str.size(); ++i) { if (str[i] != groundtruth[i]) ++count; } cout << count << endl;
| ^~~~~~
a.cc:2:675: error: 'i' was not declared in this scope
2 | int main() { const char groundtruth[] = "CODEFESTIVAL2016"; string str; cin >> str; int count = 0; for (string::size_type i = 0; i < str.size(); ++i) { if (str[i] != groundtruth[i]) ++count; } cout << count << endl;
| ^
a.cc:2:965: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
2 | int main() {
|
s736108183
|
p03970
|
C++
|
#include <iostream>
using namespace std;
int main() {
string s;
string a = "CODEFESTIVAL2016";
int cnt = 0;
s << cin;
for (int i = 0; i < 16; i++) {
if (s.at(i) != a.at(i)) {
cnt++
}
}
cout << cnt << endl;
}
|
a.cc: In function 'int main()':
a.cc:9:11: error: no match for 'operator<<' (operand types are 'std::string' {aka 'std::__cxx11::basic_string<char>'} and 'std::istream' {aka 'std::basic_istream<char>'})
9 | s << cin;
| ~ ^~ ~~~
| | |
| | std::istream {aka std::basic_istream<char>}
| std::string {aka std::__cxx11::basic_string<char>}
In file included from /usr/include/c++/14/bits/basic_string.h:47,
from /usr/include/c++/14/string:54,
from /usr/include/c++/14/bits/locale_classes.h:40,
from /usr/include/c++/14/bits/ios_base.h:41,
from /usr/include/c++/14/ios:44,
from /usr/include/c++/14/ostream:40,
from /usr/include/c++/14/iostream:41,
from a.cc:1:
/usr/include/c++/14/string_view:763:5: note: candidate: 'template<class _CharT, class _Traits> std::basic_ostream<_CharT, _Traits>& std::operator<<(basic_ostream<_CharT, _Traits>&, basic_string_view<_CharT, _Traits>)'
763 | operator<<(basic_ostream<_CharT, _Traits>& __os,
| ^~~~~~~~
/usr/include/c++/14/string_view:763:5: note: template argument deduction/substitution failed:
a.cc:9:14: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'std::basic_ostream<_CharT, _Traits>'
9 | s << cin;
| ^~~
/usr/include/c++/14/bits/basic_string.h:4077:5: note: candidate: 'template<class _CharT, class _Traits, class _Alloc> std::basic_ostream<_CharT, _Traits>& std::operator<<(basic_ostream<_CharT, _Traits>&, const __cxx11::basic_string<_CharT, _Traits, _Allocator>&)'
4077 | operator<<(basic_ostream<_CharT, _Traits>& __os,
| ^~~~~~~~
/usr/include/c++/14/bits/basic_string.h:4077:5: note: template argument deduction/substitution failed:
a.cc:9:14: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'std::basic_ostream<_CharT, _Traits>'
9 | s << cin;
| ^~~
In file included from /usr/include/c++/14/bits/memory_resource.h:38,
from /usr/include/c++/14/string:68:
/usr/include/c++/14/cstddef:125:5: note: candidate: 'template<class _IntegerType> constexpr std::__byte_op_t<_IntegerType> std::operator<<(byte, _IntegerType)'
125 | operator<<(byte __b, _IntegerType __shift) noexcept
| ^~~~~~~~
/usr/include/c++/14/cstddef:125:5: note: template argument deduction/substitution failed:
a.cc:9:9: note: cannot convert 's' (type 'std::string' {aka 'std::__cxx11::basic_string<char>'}) to type 'std::byte'
9 | s << cin;
| ^
In file included from /usr/include/c++/14/bits/ios_base.h:46:
/usr/include/c++/14/system_error:339:5: note: candidate: 'template<class _CharT, class _Traits> std::basic_ostream<_CharT, _Traits>& std::operator<<(basic_ostream<_CharT, _Traits>&, const error_code&)'
339 | operator<<(basic_ostream<_CharT, _Traits>& __os, const error_code& __e)
| ^~~~~~~~
/usr/include/c++/14/system_error:339:5: note: template argument deduction/substitution failed:
a.cc:9:14: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'std::basic_ostream<_CharT, _Traits>'
9 | s << cin;
| ^~~
/usr/include/c++/14/ostream:563:5: note: candidate: 'template<class _CharT, class _Traits> std::basic_ostream<_CharT, _Traits>& std::operator<<(basic_ostream<_CharT, _Traits>&, _CharT)'
563 | operator<<(basic_ostream<_CharT, _Traits>& __out, _CharT __c)
| ^~~~~~~~
/usr/include/c++/14/ostream:563:5: note: template argument deduction/substitution failed:
a.cc:9:14: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'std::basic_ostream<_CharT, _Traits>'
9 | s << cin;
| ^~~
/usr/include/c++/14/ostream:573:5: note: candidate: 'template<class _CharT, class _Traits> std::basic_ostream<_CharT, _Traits>& std::operator<<(basic_ostream<_CharT, _Traits>&, char)'
573 | operator<<(basic_ostream<_CharT, _Traits>& __out, char __c)
| ^~~~~~~~
/usr/include/c++/14/ostream:573:5: note: template argument deduction/substitution failed:
a.cc:9:14: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'std::basic_ostream<_CharT, _Traits>'
9 | s << cin;
| ^~~
/usr/include/c++/14/ostream:579:5: note: candidate: 'template<class _Traits> std::basic_ostream<char, _Traits>& std::operator<<(basic_ostream<char, _Traits>&, char)'
579 | operator<<(basic_ostream<char, _Traits>& __out, char __c)
| ^~~~~~~~
/usr/include/c++/14/ostream:579:5: note: template argument deduction/substitution failed:
a.cc:9:14: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'std::basic_ostream<char, _Traits>'
9 | s << cin;
| ^~~
/usr/include/c++/14/ostream:590:5: note: candidate: 'template<class _Traits> std::basic_ostream<char, _Traits>& std::operator<<(basic_ostream<char, _Traits>&, signed char)'
590 | operator<<(basic_ostream<char, _Traits>& __out, signed char __c)
| ^~~~~~~~
/usr/include/c++/14/ostream:590:5: note: template argument deduction/substitution failed:
a.cc:9:14: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'std::basic_ostream<char, _Traits>'
9 | s << cin;
| ^~~
/usr/include/c++/14/ostream:595:5: note: candidate: 'template<class _Traits> std::basic_ostream<char, _Traits>& std::operator<<(basic_ostream<char, _Traits>&, unsigned char)'
595 | operator<<(basic_ostream<char, _Traits>& __out, unsigned char __c)
| ^~~~~~~~
/usr/include/c++/14/ostream:595:5: note: template argument deduction/substitution failed:
a.cc:9:14: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'std::basic_ostream<char, _Traits>'
9 | s << cin;
| ^~~
/usr/include/c++/14/ostream:654:5: note: candidate: 'template<class _CharT, class _Traits> std::basic_ostream<_CharT, _Traits>& std::operator<<(basic_ostream<_CharT, _Traits>&, const _CharT*)'
654 | operator<<(basic_ostream<_CharT, _Traits>& __out, const _CharT* __s)
| ^~~~~~~~
/usr/include/c++/14/ostream:654:5: note: template argument deduction/substitution failed:
a.cc:9:14: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'std::basic_ostream<_CharT, _Traits>'
9 | s << cin;
| ^~~
In file included from /usr/include/c++/14/ostream:1022:
/usr/include/c++/14/bits/ostream.tcc:307:5: note: candidate: 'template<class _CharT, class _Traits> std::basic_ostream<_CharT, _Traits>& std::operator<<(basic_ostream<_CharT, _Traits>&, const char*)'
307 | operator<<(basic_ostream<_CharT, _Traits>& __out, const char* __s)
| ^~~~~~~~
/usr/include/c++/14/bits/ostream.tcc:307:5: note: template argument deduction/substitution failed:
a.cc:9:14: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'std::basic_ostream<_CharT, _Traits>'
9 | s << cin;
| ^~~
/usr/include/c++/14/ostream:671:5: note: candidate: 'template<class _Traits> std::basic_ostream<char, _Traits>& std::operator<<(basic_ostream<char, _Traits>&, const char*)'
671 | operator<<(basic_ostream<char, _Traits>& __out, const char* __s)
| ^~~~~~~~
/usr/include/c++/14/ostream:671:5: note: template argument deduction/substitution failed:
a.cc:9:14: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'std::basic_ostream<char, _Traits>'
9 | s << cin;
| ^~~
/usr/include/c++/14/ostream:684:5: note: candidate: 'template<class _Traits> std::basic_ostream<char, _Traits>& std::operator<<(basic_ostream<char, _Traits>&, const signed char*)'
684 | operator<<(basic_ostream<char, _Traits>& __out, const signed char* __s)
| ^~~~~~~~
/usr/include/c++/14/ostream:684:5: note: template argument deduction/substitution failed:
a.cc:9:14: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'std::basic_ostream<char, _Traits>'
9 | s << cin;
| ^~~
/usr/include/c++/14/ostream:689:5: note: candidate: 'template<class _Traits> std::basic_ostream<char, _Traits>& std::operator<<(basic_ostream<char, _Traits>&, const unsigned char*)'
689 | operator<<(basic_ostream<char, _Traits>& __out, const unsigned char* __s)
| ^~~~~~~~
/usr/include/c++/14/ostream:689:5: note: template argument deduction/substitution failed:
a.cc:9:14: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'std::basic_ostream<char, _Traits>'
9 | s << cin;
| ^~~
/usr/include/c++/14/ostream:810:5: note: candidate: 'template<class _Ostream, class _Tp> _Ostream&& std::operator<<(_Ostream&&, const _Tp&)'
810 | operator<<(_Ostream&& __os, const _Tp& __x)
| ^~~~~~~~
/usr/include/c++/14/ostream:810:5: note: template argument deduction/substitution failed:
/usr/include/c++/14/ostream: In substitution of 'template<class _Ostream, class _Tp> _Ostream&& std::operator<<(_Ostream&&, const _Tp&) [with _Ostream = std::__cxx11::basic_string<char>&; _Tp = std::basic_istream<char>]':
a.cc:9:7: required from here
9 | s << cin;
| ^~~
/usr/include/c++/14/ostream:810:5: error: no type named 'type' in 'struct std::enable_if<false, void>'
810 | operator<<(_Ostream&& __os, const _Tp& __x)
| ^~~~~~~~
a.cc:12:30: error: expected ';' before '}' token
12 | cnt++
| ^
| ;
13 | }
| ~
|
s721924399
|
p03970
|
C++
|
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<int,int> pii;
typedef vector<int> VI;
typedef vector<VI> VVI;
const double PI = 3.14159265358979323846;
const double EPS = 1e-12;
const int INF = numeric_limits<int>::max() / 2;
const int NEG_INF = numeric_limits<int>::min() / 2;
int main(){
cin.tie(0);
ios::sync_with_stdio(false);
string s;
cin >> s;
int count=0;
string ans="CODEFESTIVAL2016";
for(int i=0;i<16;i++){
if(s[i]!=ans[i]) count++
}
cout << count << endl;
}
|
a.cc: In function 'int main()':
a.cc:23:29: error: expected ';' before '}' token
23 | if(s[i]!=ans[i]) count++
| ^
| ;
24 |
25 | }
| ~
|
s003883623
|
p03970
|
C++
|
import java.io.ByteArrayInputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.util.Arrays;
public class Main {
static InputStream is;
static PrintWriter out;
static String INPUT = "";
public static void main(String[] args) throws Exception {
new Main().run();
}
void solver() {
String a="CODEFESTIVAL2016";
String s=ns();
int ans=0;
for(int i=0;i<s.length();i++){
if(a.charAt(i)!=s.charAt(i))ans++;
}
out.println(ans);
}
void run() {
is = INPUT.isEmpty() ? System.in : new ByteArrayInputStream(INPUT.getBytes());
out = new PrintWriter(System.out);
solver();
out.flush();
}
static long nl() {
try {
long num = 0;
boolean minus = false;
while ((num = is.read()) != -1 && !((num >= '0' && num <= '9') || num == '-'))
;
if (num == '-') {
num = 0;
minus = true;
} else {
num -= '0';
}
while (true) {
int b = is.read();
if (b >= '0' && b <= '9') {
num = num * 10 + (b - '0');
} else {
return minus ? -num : num;
}
}
} catch (IOException e) {
}
return -1;
}
static char nc() {
try {
int b = skip();
if (b == -1)
return 0;
return (char) b;
} catch (IOException e) {
}
return 0;
}
static double nd() {
try {
return Double.parseDouble(ns());
} catch (Exception e) {
}
return 0;
}
static String ns() {
try {
int b = skip();
StringBuilder sb = new StringBuilder();
if (b == -1)
return "";
sb.append((char) b);
while (true) {
b = is.read();
if (b == -1)
return sb.toString();
if (b <= ' ')
return sb.toString();
sb.append((char) b);
}
} catch (IOException e) {
}
return "";
}
public static char[] ns(int n) {
char[] buf = new char[n];
try {
int b = skip(), p = 0;
if (b == -1)
return null;
buf[p++] = (char) b;
while (p < n) {
b = is.read();
if (b == -1 || b <= ' ')
break;
buf[p++] = (char) b;
}
return Arrays.copyOf(buf, p);
} catch (IOException e) {
}
return null;
}
public static byte[] nse(int n) {
byte[] buf = new byte[n];
try {
int b = skip();
if (b == -1)
return null;
is.read(buf);
return buf;
} catch (IOException e) {
}
return null;
}
static int skip() throws IOException {
int b;
while ((b = is.read()) != -1 && !(b >= 33 && b <= 126))
;
return b;
}
static boolean eof() {
try {
is.mark(1000);
int b = skip();
is.reset();
return b == -1;
} catch (IOException e) {
return true;
}
}
static int ni() {
try {
int num = 0;
boolean minus = false;
while ((num = is.read()) != -1 && !((num >= '0' && num <= '9') || num == '-'))
;
if (num == '-') {
num = 0;
minus = true;
} else {
num -= '0';
}
while (true) {
int b = is.read();
if (b >= '0' && b <= '9') {
num = num * 10 + (b - '0');
} else {
return minus ? -num : num;
}
}
} catch (IOException e) {
}
return -1;
}
static void tr(Object... o) {
System.out.println(Arrays.deepToString(o));
}
}
|
a.cc:1:1: error: 'import' does not name a type
1 | import java.io.ByteArrayInputStream;
| ^~~~~~
a.cc:1:1: note: C++20 'import' only available with '-fmodules-ts'
a.cc:2:1: error: 'import' does not name a type
2 | import java.io.IOException;
| ^~~~~~
a.cc:2:1: note: C++20 'import' only available with '-fmodules-ts'
a.cc:3:1: error: 'import' does not name a type
3 | import java.io.InputStream;
| ^~~~~~
a.cc:3:1: note: C++20 'import' only available with '-fmodules-ts'
a.cc:4:1: error: 'import' does not name a type
4 | import java.io.PrintWriter;
| ^~~~~~
a.cc:4:1: note: C++20 'import' only available with '-fmodules-ts'
a.cc:5:1: error: 'import' does not name a type
5 | import java.util.Arrays;
| ^~~~~~
a.cc:5:1: note: C++20 'import' only available with '-fmodules-ts'
a.cc:7:1: error: expected unqualified-id before 'public'
7 | public class Main {
| ^~~~~~
|
s450730765
|
p03970
|
C++
|
#include <iostream>
using namespace std;
int main() {
string s;
string a = "CODEFESTIVAL2016";
int cnt = 0;
s << cin;
for (int i = 0; i < 16; i++) {
if (s.at(i) != a.at(i)) {
cnt++
}
}
cout << cnt << endl;
}
|
a.cc: In function 'int main()':
a.cc:9:11: error: no match for 'operator<<' (operand types are 'std::string' {aka 'std::__cxx11::basic_string<char>'} and 'std::istream' {aka 'std::basic_istream<char>'})
9 | s << cin;
| ~ ^~ ~~~
| | |
| | std::istream {aka std::basic_istream<char>}
| std::string {aka std::__cxx11::basic_string<char>}
In file included from /usr/include/c++/14/bits/basic_string.h:47,
from /usr/include/c++/14/string:54,
from /usr/include/c++/14/bits/locale_classes.h:40,
from /usr/include/c++/14/bits/ios_base.h:41,
from /usr/include/c++/14/ios:44,
from /usr/include/c++/14/ostream:40,
from /usr/include/c++/14/iostream:41,
from a.cc:1:
/usr/include/c++/14/string_view:763:5: note: candidate: 'template<class _CharT, class _Traits> std::basic_ostream<_CharT, _Traits>& std::operator<<(basic_ostream<_CharT, _Traits>&, basic_string_view<_CharT, _Traits>)'
763 | operator<<(basic_ostream<_CharT, _Traits>& __os,
| ^~~~~~~~
/usr/include/c++/14/string_view:763:5: note: template argument deduction/substitution failed:
a.cc:9:14: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'std::basic_ostream<_CharT, _Traits>'
9 | s << cin;
| ^~~
/usr/include/c++/14/bits/basic_string.h:4077:5: note: candidate: 'template<class _CharT, class _Traits, class _Alloc> std::basic_ostream<_CharT, _Traits>& std::operator<<(basic_ostream<_CharT, _Traits>&, const __cxx11::basic_string<_CharT, _Traits, _Allocator>&)'
4077 | operator<<(basic_ostream<_CharT, _Traits>& __os,
| ^~~~~~~~
/usr/include/c++/14/bits/basic_string.h:4077:5: note: template argument deduction/substitution failed:
a.cc:9:14: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'std::basic_ostream<_CharT, _Traits>'
9 | s << cin;
| ^~~
In file included from /usr/include/c++/14/bits/memory_resource.h:38,
from /usr/include/c++/14/string:68:
/usr/include/c++/14/cstddef:125:5: note: candidate: 'template<class _IntegerType> constexpr std::__byte_op_t<_IntegerType> std::operator<<(byte, _IntegerType)'
125 | operator<<(byte __b, _IntegerType __shift) noexcept
| ^~~~~~~~
/usr/include/c++/14/cstddef:125:5: note: template argument deduction/substitution failed:
a.cc:9:9: note: cannot convert 's' (type 'std::string' {aka 'std::__cxx11::basic_string<char>'}) to type 'std::byte'
9 | s << cin;
| ^
In file included from /usr/include/c++/14/bits/ios_base.h:46:
/usr/include/c++/14/system_error:339:5: note: candidate: 'template<class _CharT, class _Traits> std::basic_ostream<_CharT, _Traits>& std::operator<<(basic_ostream<_CharT, _Traits>&, const error_code&)'
339 | operator<<(basic_ostream<_CharT, _Traits>& __os, const error_code& __e)
| ^~~~~~~~
/usr/include/c++/14/system_error:339:5: note: template argument deduction/substitution failed:
a.cc:9:14: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'std::basic_ostream<_CharT, _Traits>'
9 | s << cin;
| ^~~
/usr/include/c++/14/ostream:563:5: note: candidate: 'template<class _CharT, class _Traits> std::basic_ostream<_CharT, _Traits>& std::operator<<(basic_ostream<_CharT, _Traits>&, _CharT)'
563 | operator<<(basic_ostream<_CharT, _Traits>& __out, _CharT __c)
| ^~~~~~~~
/usr/include/c++/14/ostream:563:5: note: template argument deduction/substitution failed:
a.cc:9:14: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'std::basic_ostream<_CharT, _Traits>'
9 | s << cin;
| ^~~
/usr/include/c++/14/ostream:573:5: note: candidate: 'template<class _CharT, class _Traits> std::basic_ostream<_CharT, _Traits>& std::operator<<(basic_ostream<_CharT, _Traits>&, char)'
573 | operator<<(basic_ostream<_CharT, _Traits>& __out, char __c)
| ^~~~~~~~
/usr/include/c++/14/ostream:573:5: note: template argument deduction/substitution failed:
a.cc:9:14: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'std::basic_ostream<_CharT, _Traits>'
9 | s << cin;
| ^~~
/usr/include/c++/14/ostream:579:5: note: candidate: 'template<class _Traits> std::basic_ostream<char, _Traits>& std::operator<<(basic_ostream<char, _Traits>&, char)'
579 | operator<<(basic_ostream<char, _Traits>& __out, char __c)
| ^~~~~~~~
/usr/include/c++/14/ostream:579:5: note: template argument deduction/substitution failed:
a.cc:9:14: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'std::basic_ostream<char, _Traits>'
9 | s << cin;
| ^~~
/usr/include/c++/14/ostream:590:5: note: candidate: 'template<class _Traits> std::basic_ostream<char, _Traits>& std::operator<<(basic_ostream<char, _Traits>&, signed char)'
590 | operator<<(basic_ostream<char, _Traits>& __out, signed char __c)
| ^~~~~~~~
/usr/include/c++/14/ostream:590:5: note: template argument deduction/substitution failed:
a.cc:9:14: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'std::basic_ostream<char, _Traits>'
9 | s << cin;
| ^~~
/usr/include/c++/14/ostream:595:5: note: candidate: 'template<class _Traits> std::basic_ostream<char, _Traits>& std::operator<<(basic_ostream<char, _Traits>&, unsigned char)'
595 | operator<<(basic_ostream<char, _Traits>& __out, unsigned char __c)
| ^~~~~~~~
/usr/include/c++/14/ostream:595:5: note: template argument deduction/substitution failed:
a.cc:9:14: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'std::basic_ostream<char, _Traits>'
9 | s << cin;
| ^~~
/usr/include/c++/14/ostream:654:5: note: candidate: 'template<class _CharT, class _Traits> std::basic_ostream<_CharT, _Traits>& std::operator<<(basic_ostream<_CharT, _Traits>&, const _CharT*)'
654 | operator<<(basic_ostream<_CharT, _Traits>& __out, const _CharT* __s)
| ^~~~~~~~
/usr/include/c++/14/ostream:654:5: note: template argument deduction/substitution failed:
a.cc:9:14: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'std::basic_ostream<_CharT, _Traits>'
9 | s << cin;
| ^~~
In file included from /usr/include/c++/14/ostream:1022:
/usr/include/c++/14/bits/ostream.tcc:307:5: note: candidate: 'template<class _CharT, class _Traits> std::basic_ostream<_CharT, _Traits>& std::operator<<(basic_ostream<_CharT, _Traits>&, const char*)'
307 | operator<<(basic_ostream<_CharT, _Traits>& __out, const char* __s)
| ^~~~~~~~
/usr/include/c++/14/bits/ostream.tcc:307:5: note: template argument deduction/substitution failed:
a.cc:9:14: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'std::basic_ostream<_CharT, _Traits>'
9 | s << cin;
| ^~~
/usr/include/c++/14/ostream:671:5: note: candidate: 'template<class _Traits> std::basic_ostream<char, _Traits>& std::operator<<(basic_ostream<char, _Traits>&, const char*)'
671 | operator<<(basic_ostream<char, _Traits>& __out, const char* __s)
| ^~~~~~~~
/usr/include/c++/14/ostream:671:5: note: template argument deduction/substitution failed:
a.cc:9:14: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'std::basic_ostream<char, _Traits>'
9 | s << cin;
| ^~~
/usr/include/c++/14/ostream:684:5: note: candidate: 'template<class _Traits> std::basic_ostream<char, _Traits>& std::operator<<(basic_ostream<char, _Traits>&, const signed char*)'
684 | operator<<(basic_ostream<char, _Traits>& __out, const signed char* __s)
| ^~~~~~~~
/usr/include/c++/14/ostream:684:5: note: template argument deduction/substitution failed:
a.cc:9:14: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'std::basic_ostream<char, _Traits>'
9 | s << cin;
| ^~~
/usr/include/c++/14/ostream:689:5: note: candidate: 'template<class _Traits> std::basic_ostream<char, _Traits>& std::operator<<(basic_ostream<char, _Traits>&, const unsigned char*)'
689 | operator<<(basic_ostream<char, _Traits>& __out, const unsigned char* __s)
| ^~~~~~~~
/usr/include/c++/14/ostream:689:5: note: template argument deduction/substitution failed:
a.cc:9:14: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'std::basic_ostream<char, _Traits>'
9 | s << cin;
| ^~~
/usr/include/c++/14/ostream:810:5: note: candidate: 'template<class _Ostream, class _Tp> _Ostream&& std::operator<<(_Ostream&&, const _Tp&)'
810 | operator<<(_Ostream&& __os, const _Tp& __x)
| ^~~~~~~~
/usr/include/c++/14/ostream:810:5: note: template argument deduction/substitution failed:
/usr/include/c++/14/ostream: In substitution of 'template<class _Ostream, class _Tp> _Ostream&& std::operator<<(_Ostream&&, const _Tp&) [with _Ostream = std::__cxx11::basic_string<char>&; _Tp = std::basic_istream<char>]':
a.cc:9:7: required from here
9 | s << cin;
| ^~~
/usr/include/c++/14/ostream:810:5: error: no type named 'type' in 'struct std::enable_if<false, void>'
810 | operator<<(_Ostream&& __os, const _Tp& __x)
| ^~~~~~~~
a.cc:12:30: error: expected ';' before '}' token
12 | cnt++
| ^
| ;
13 | }
| ~
|
s494294915
|
p03970
|
C++
|
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
int main(){
string a,b="CODEFESTIVAL2016";
cin>>a;
int c=0;
for(i=0;i<a.size();i++) if(a[i]!=b[i])c++;
cout<<c<<endl;
return 0;
}
|
a.cc: In function 'int main()':
a.cc:9:8: error: 'i' was not declared in this scope
9 | for(i=0;i<a.size();i++) if(a[i]!=b[i])c++;
| ^
|
s563994537
|
p03970
|
C++
|
Last login: Mon Oct 10 12:45:01 on console
yutakasehiroto-no-MacBook-Air:~ toyosehiroto$ cd ./Documents/Atcoder/
yutakasehiroto-no-MacBook-Air:Atcoder toyosehiroto$ cd others/
yutakasehiroto-no-MacBook-Air:others toyosehiroto$ lla
total 24
drwxr-xr-x 7 toyosehiroto staff 238 10 2 20:42 .
drwxr-xr-x 8 toyosehiroto staff 272 8 21 23:10 ..
-rw-r--r--@ 1 toyosehiroto staff 8196 9 24 17:44 .DS_Store
drwxr-xr-x 3 toyosehiroto staff 102 10 2 20:42 KUPC
drwxr-xr-x 5 toyosehiroto staff 170 9 24 17:44 code-festival
drwxr-xr-x 6 toyosehiroto staff 204 9 10 21:06 tenka1
drwxr-xr-x 11 toyosehiroto staff 374 8 7 13:36 tkppc2
yutakasehiroto-no-MacBook-Air:others toyosehiroto$ cd code-festival/
yutakasehiroto-no-MacBook-Air:code-festival toyosehiroto$ lla
total 16
drwxr-xr-x 5 toyosehiroto staff 170 9 24 17:44 .
drwxr-xr-x 7 toyosehiroto staff 238 10 2 20:42 ..
-rw-r--r--@ 1 toyosehiroto staff 6148 9 24 17:44 .DS_Store
drwxr-xr-x 11 toyosehiroto staff 374 9 24 19:44 2015qA
drwxr-xr-x 11 toyosehiroto staff 374 9 26 18:22 2016qA
yutakasehiroto-no-MacBook-Air:code-festival toyosehiroto$ mkdir 2016qB
yutakasehiroto-no-MacBook-Air:code-festival toyosehiroto$ cp -r ../../Template/ 2016qB
yutakasehiroto-no-MacBook-Air:code-festival toyosehiroto$ cd 2016qB
yutakasehiroto-no-MacBook-Air:2016qB toyosehiroto$ g++11 a.cpp
yutakasehiroto-no-MacBook-Air:2016qB toyosehiroto$ sublime
yutakasehiroto-no-MacBook-Air:2016qB toyosehiroto$ g++11 a.cpp
yutakasehiroto-no-MacBook-Air:2016qB toyosehiroto$ ./a.out
yutakasehiroto-no-MacBook-Air:2016qB toyosehiroto$ cp a.cpp e.cpp
yutakasehiroto-no-MacBook-Air:2016qB toyosehiroto$ g++11 a.cpp
yutakasehiroto-no-MacBook-Air:2016qB toyosehiroto$ ./a.out
C0DEFESTIVAL2O16
2
yutakasehiroto-no-MacBook-Air:2016qB toyosehiroto$ ./a.out
FESTIVAL2016CODE
16
yutakasehiroto-no-MacBook-Air:2016qB toyosehiroto$
|
a.cc:8:11: error: stray '@' in program
8 | -rw-r--r--@ 1 toyosehiroto staff 8196 9 24 17:44 .DS_Store
| ^
a.cc:18:11: error: stray '@' in program
18 | -rw-r--r--@ 1 toyosehiroto staff 6148 9 24 17:44 .DS_Store
| ^
a.cc:1:1: error: 'Last' does not name a type
1 | Last login: Mon Oct 10 12:45:01 on console
| ^~~~
|
s199758337
|
p03970
|
C++
|
ans = 0
s = 'CODEFESTIVAL2016'
t = raw_input().strip()
for i in xrange(16):
if s[i] != t[i]: ans +=1
print ans
|
a.cc:2:5: warning: multi-character literal with 16 characters exceeds 'int' size of 4 bytes
2 | s = 'CODEFESTIVAL2016'
| ^~~~~~~~~~~~~~~~~~
a.cc:1:1: error: 'ans' does not name a type
1 | ans = 0
| ^~~
|
s914372147
|
p03970
|
C++
|
#include <iostream>
#include <queue>
#include <stack>
#include <cstdio>
#include <algorithm>
#include <cmath>
#include <cstring>
#include <vector>
#include <list>
int main() {
const char* s = "CODEFESTIVAL2016";
std::string str;
std::cin >> str;
int cnt = 0;
for(int i = 0; i < str.size(); ++i) {
if(str[i] != s) {
++cnt;
}
}
std::cout << cnt << std::endl;
}
|
a.cc: In function 'int main()':
a.cc:20:19: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
20 | if(str[i] != s) {
|
s670609020
|
p03970
|
C++
|
s = raw_input()
t = "CODEFESTIVAL2016"
x = 0
assert len(s) == len(t)
for i in range(len(t)):
x += 1 if s[i] != t[i] else 0
print x
|
a.cc:1:1: error: 's' does not name a type
1 | s = raw_input()
| ^
|
s159068933
|
p03970
|
C++
|
#include <bits/stdc++.h>
using namespace std;
const int dx[]={1,0,-1,0,1,-1,-1,1};
const int dy[]={0,1,0,-1,1,1,-1,-1};
const int INF = 1e9;
const long long LINF = 1e18;
const double EPS = 1e-8;
#define pb emplace_back
#define mk make_pair
#define fr first
#define sc second
#define ll long long
#define reps(i,j,k) for(int i = (j); i < (k); ++i)
#define rep(i,j) reps(i,0,j)
#define all(a) (a).begin(),(a).end()
#define MOD 1000000007
typedef pair<int,int> Pii;
typedef vector<int> vi;
typedef pair<string, int> Psi;
typedef pair<ll, ll> Pll;
int main(){
string str;
cin >> str;
int cnt = 0; string hoge = "CODEFESTIVAL2015"
rep(i,str.size()){
if(str[i] != hoge[i]){
++cnt;
}
}
cout << cnt << endl;
return 0;
}
|
a.cc: In function 'int main()':
a.cc:13:21: error: expected ',' or ';' before 'for'
13 | #define reps(i,j,k) for(int i = (j); i < (k); ++i)
| ^~~
a.cc:14:18: note: in expansion of macro 'reps'
14 | #define rep(i,j) reps(i,0,j)
| ^~~~
a.cc:26:9: note: in expansion of macro 'rep'
26 | rep(i,str.size()){
| ^~~
a.cc:26:13: error: 'i' was not declared in this scope; did you mean 'vi'?
26 | rep(i,str.size()){
| ^
a.cc:13:38: note: in definition of macro 'reps'
13 | #define reps(i,j,k) for(int i = (j); i < (k); ++i)
| ^
a.cc:26:9: note: in expansion of macro 'rep'
26 | rep(i,str.size()){
| ^~~
|
s030424907
|
p03970
|
C++
|
#include <bits/stdc++.h>
#include<iostream>
#include<cstdio>
#include<vector>
#include<queue>
#include<map>
#include<cstring>
#include<string>
#include <math.h>
#include<algorithm>
// #include <boost/multiprecision/cpp_int.hpp>
#include<functional>
// #define int long long
#define inf 1000000007
#define pa pair<int,int>
#define ll long long
#define pal pair<ll,ll>
#define ppa pair<int,pa>
#define mp make_pair
#define EPS (1e-10)
#define equals(a,b) (fabs((a)-(b))<EPS)
using namespace std;
class Point{
public:
double x,y;
Point(double x=0,double y=0):x(x),y(y) {}
Point operator + (Point p) {return Point(x+p.x,y+p.y);}
Point operator - (Point p) {return Point(x-p.x,y-p.y);}
Point operator * (double a) {return Point(x*a,y*a);}
Point operator / (double a) {return Point(x/a,y/a);}
double absv() {return sqrt(norm());}
double norm() {return x*x+y*y;}
bool operator < (const Point &p) const{
return x != p.x ? x<p.x: y<p.y;
}
bool operator == (const Point &p) const{
return fabs(x-p.x)<EPS && fabs(y-p.y)<EPS;
}
};
typedef Point Vector;
struct Segment{
Point p1,p2;
};
double hen(Vector a){
if(fabs(a.x)<EPS && a.y>0) return acos(0);
else if(fabs(a.x)<EPS && a.y<0) return 3*acos(0);
else if(fabs(a.y)<EPS && a.x<0) return 2*acos(0);
else if(fabs(a.y)<EPS && a.x>0) return 0.0;
else if(a.y>0) return acos(a.x/a.absv());
else return 2*acos(0)+acos(-a.x/a.absv());
}
double dot(Vector a,Vector b){
return a.x*b.x+a.y*b.y;
}
double cross(Vector a,Vector b){
return a.x*b.y-a.y*b.x;
}
int dx[4] = {1, 0, -1, 0};
int dy[4] = {0, 1, 0, -1};
//----------------kokomade temple------------
signed main(){
string s="CODEFESTIVAL2016",t;
int n,m,k;
cin>>t;
int ans=0;
for(int i=0;i<16;i++){
if(s[i]!=t[i]) ans++
}
cout<<ans<<endl;
return 0;
}
//printf("%.10f\n",ans);
|
a.cc: In function 'int main()':
a.cc:76:37: error: expected ';' before '}' token
76 | if(s[i]!=t[i]) ans++
| ^
| ;
77 | }
| ~
|
s990853532
|
p03970
|
C++
|
#include <iostream>
#include <string>
#include <vector>
#include <cmath>
#include <algorithm>
#include <cstdlib>
#include <ctime>
#include <cstdio>
#include <functional>
#include <set>
#include <sstream>
#include <cctype>
#include <stack>
#include <queue>
#include <cstring>
#include <map>
#include <list>
#include <cassert>
using namespace std;
const long long INF=1LL<<50LL;
const double PI=3.14159265358979323846264;
const long long mod=1000000000LL+7LL;
long long gcd(long long x,long long y){
return y==0 ? x : gcd(y,x%y);
}
int main(){
string s="CODEFESTIVAL2016";
string t;
cin>>t;
int res=0;
for(int i=0;i<n;i++) res+=s[i]!=t[i];
cout<<res<<endl;
}
|
a.cc: In function 'int main()':
a.cc:38:23: error: 'n' was not declared in this scope
38 | for(int i=0;i<n;i++) res+=s[i]!=t[i];
| ^
|
s329981844
|
p03971
|
C++
|
#include <bits\stdc++.h>
using namespace std;
#define rep(i,n) for(int i=0;i<n;i++)
using ll = long long;
using ull = unsigned long long;
using P = pair<int,int>;
const ll INF = 1001001001;
int main(){
int n,a,b;
cin >> n >> a >> b;
string s;
cin >> s;
int cnt = 0;
int cntb = 0;
rep(i,n){
if(s[i]=='a'){
if(cnt<a+b){
cout << "Yes" << endl;
cnt++;
}
else cout << "No" << endl;
}
if(s[i]=='b'){
if((cnt<a+b)&&(cntb<b)){
cout << "Yes" << endl;
cnt++; cntb++;
}
else cout << "No" << endl;
}
if(s[i]=='c'){
cout << "No" << endl;
}
}
}
|
a.cc:1:10: fatal error: bits\stdc++.h: No such file or directory
1 | #include <bits\stdc++.h>
| ^~~~~~~~~~~~~~~
compilation terminated.
|
s199660382
|
p03971
|
Java
|
import java.util.*; import java.io.*; import java.math.*;
public class Main{
//Don't have to see. start------------------------------------------
static class InputIterator{
ArrayList<String> inputLine = new ArrayList<String>(1024);
int index = 0; int max; String read;
InputIterator(){
BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
try{
while((read = br.readLine()) != null){
inputLine.add(read);
}
}catch(IOException e){}
max = inputLine.size();
}
boolean hasNext(){return (index < max);}
String next(){
if(hasNext()){
return inputLine.get(index++);
}else{
throw new IndexOutOfBoundsException("There is no more input");
}
}
}
static HashMap<Integer, String> CONVSTR = new HashMap<Integer, String>();
static InputIterator ii = new InputIterator();//This class cannot be used in reactive problem.
static PrintWriter out = new PrintWriter(System.out);
static void flush(){out.flush();}
static void myout(Object t){out.println(t);}
static void myerr(Object t){System.err.print("debug:");System.err.println(t);}
static String next(){return ii.next();}
static boolean hasNext(){return ii.hasNext();}
static int nextInt(){return Integer.parseInt(next());}
static long nextLong(){return Long.parseLong(next());}
static double nextDouble(){return Double.parseDouble(next());}
static ArrayList<String> nextStrArray(){return myconv(next(), 8);}
static ArrayList<String> nextCharArray(){return myconv(next(), 0);}
static ArrayList<Integer> nextIntArray(){
ArrayList<String> input = nextStrArray(); ArrayList<Integer> ret = new ArrayList<Integer>(input.size());
for(int i = 0; i < input.size(); i++){
ret.add(Integer.parseInt(input.get(i)));
}
return ret;
}
static ArrayList<Long> nextLongArray(){
ArrayList<String> input = nextStrArray(); ArrayList<Long> ret = new ArrayList<Long>(input.size());
for(int i = 0; i < input.size(); i++){
ret.add(Long.parseLong(input.get(i)));
}
return ret;
}
static String myconv(Object list, int no){//only join
String joinString = CONVSTR.get(no);
if(list instanceof String[]){
return String.join(joinString, (String[])list);
}else if(list instanceof ArrayList){
return String.join(joinString, (ArrayList)list);
}else{
throw new ClassCastException("Don't join");
}
}
static ArrayList<String> myconv(String str, int no){//only split
String splitString = CONVSTR.get(no);
return new ArrayList<String>(Arrays.asList(str.split(splitString)));
}
public static void main(String[] args){
CONVSTR.put(8, " "); CONVSTR.put(9, "\n"); CONVSTR.put(0, "");
solve();flush();
}
//Don't have to see. end------------------------------------------
static void solve(){//Here is the main function
ArrayList<Integer> one = nextIntArray();
int N = one.get(0);
int A = one.get(1);
int B = one.get(2);
ArrayList<String> s = nextCharArray();
int count = 0;
int tmpB = 0;
for(int i = 0; i < N; i++){
String tmp = list.get(i);
if(tmp.equals("a")){
if(count < A + B){
count++;
myout("Yes");
}else{
myout("No");
}
}else if(tmp.equals("b")){
if(count < A + B && tmpB < B){
count++;
tmpB++;
myout("Yes");
}else{
myout("No");
}
}else{
myout("No");
}
}
}
//Method addition frame start
//Method addition frame end
}
|
Main.java:80: error: cannot find symbol
String tmp = list.get(i);
^
symbol: variable list
location: class Main
Note: Main.java uses unchecked or unsafe operations.
Note: Recompile with -Xlint:unchecked for details.
1 error
|
s562318964
|
p03971
|
C++
|
#include <bits/stdc++.h>
using namespace std;
int main()
{
int n, a, b;
cin >> n >> a >> b;
int cnt=0, cnt_i=0;
string s;
cin >> s;
for(int i=0; i<n; i++)
{
if(s.at[i]=='a')
{
if(cnt<a+b){
cout << "Yes" << endl;
cnt++;
}
else
{
cout << "No" << endl;
}
}
else if(s.at[i]=='b')
{
if(cnt<a+b && cnt_i<b)
{
cout << "Yes" << endl;
cnt++, cnt_i++;
}
else
{
cout << "No" << endl;
}
}
else
{
cout << "No" << endl;
}
}
}
|
a.cc: In function 'int main()':
a.cc:16:12: error: invalid types '<unresolved overloaded function type>[int]' for array subscript
16 | if(s.at[i]=='a')
| ^
a.cc:27:17: error: invalid types '<unresolved overloaded function type>[int]' for array subscript
27 | else if(s.at[i]=='b')
| ^
|
s166050677
|
p03971
|
C++
|
#include <bits/stdc++.h>
using namespace std;
int main()
{
int n, a, b;
cin >> n >> a >> b;
int cnt=0, cnt_i=0;
string s;
cin >> s;
for(int i=0; i<s.size(); i++)
{
if(s.at[i]=='a')
{
if(cnt<a+b){
cout << "Yes" << endl;
cnt++;
}
else
{
cout << "No" << endl;
}
}
else if(s.at[i]=='b')
{
if(cnt<a+b && cnt_i<b)
{
cout << "Yes" << endl;
cnt++, cnt_i++;
}
else
{
cout << "No" << endl;
}
}
else
{
cout << "No" << endl;
}
}
}
|
a.cc: In function 'int main()':
a.cc:16:12: error: invalid types '<unresolved overloaded function type>[int]' for array subscript
16 | if(s.at[i]=='a')
| ^
a.cc:27:17: error: invalid types '<unresolved overloaded function type>[int]' for array subscript
27 | else if(s.at[i]=='b')
| ^
|
s114927139
|
p03971
|
C
|
#include<stdio.h>
int main(){
int N,B,A;
scanf("%d%d%d",&N,&B,&A);
char S[10000000];
scanf("%s",S);
int counta=0,countb=0;
for(int i=0;i<N;i++){
if(S[i]=='a'){
if(A+B>counta){
counta++;
printf("Yes\n");
}
else if(S[i]=='b'){
if(A+B>counta && countb<=B){
countb++;
counta++;
printf("Yes\n");
}
else {
printf("No\n");
}
}
return 0;
}
|
main.c: In function 'main':
main.c:29:1: error: expected declaration or statement at end of input
29 | }
| ^
main.c:29:1: error: expected declaration or statement at end of input
|
s169293566
|
p03971
|
C
|
#include<stdio.h>
int main(){
int N,B,A;
scanf("%d%d%d",&N,&B,&A);
char S[10000000];
scanf("%s",S);
int counta=0,countb=0;
for(int i=0;i<N;i++){
if(S[i]=='a'){
if(A+B>counta){
counta++;
printf("Yes\n");
}
else if(S[i]=='b'){
if(A+B>counta && countb<=B){
countb++;
counta++;
printf("Yes\n");
}
else {
printf("No\n");
}
}
return 0;
}
|
main.c: In function 'main':
main.c:29:1: error: expected declaration or statement at end of input
29 | }
| ^
main.c:29:1: error: expected declaration or statement at end of input
|
s129529785
|
p03971
|
C++
|
#include <iostream>
#include<algorithm>
#include <bits/stdc++.h>
using namespace std;
int main() {
int n, a, b;
cin >> n >> a >> b;
string s;
cin >> s;
int count = 0;
int countf = 0;
for (int i = 0; i < n; i++) {
if (s[i] == 'a') {
if (count < a + b) {
cout << "Yes" << endl;
count++;
}
else {
cout << "No" << endl;
}
}
else if (s[i] == 'b') {
if (count < a + b && countf < b) {
cout << "Yes" << endl;
countf++;
count++;
}
else {
cout << "No" << endl;
}
}
else {
cout << "No" << endl;
}
}
|
a.cc: In function 'int main()':
a.cc:36:10: error: expected '}' at end of input
36 | }
| ^
a.cc:6:12: note: to match this '{'
6 | int main() {
| ^
|
s534161665
|
p03971
|
C++
|
#include <iostream>
#include<algorithm>
#include <bits/stdc++.h>
using namespace std;
int main() {
int n, a, b;
cin >> n >> a >> b;
string s;
cin >> s;
int count = 0;
int countf = 0;
for (int i = 0; i < n; i++) {
if (s[i] == 'a') {
if (count < a + b) {
cout << "Yes" << endl;
count++;
}
else {
cout << "No" << endl;
}
}
else if (s[i] == 'b') {
if (count < a + b && countf < b) {
cout << "Yes" << endl;
countf++;
count++;
}
else {
cout << "No" << end;
}
}
else {
cout << "No" << endl;
}
}
|
a.cc: In function 'int main()':
a.cc:30:46: error: no match for 'operator<<' (operand types are 'std::basic_ostream<char>' and '<unresolved overloaded function type>')
30 | cout << "No" << end;
| ~~~~~~~~~~~~~^~~~~~
In file included from /usr/include/c++/14/iostream:41,
from a.cc:1:
/usr/include/c++/14/ostream:116:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(__ostream_type& (*)(__ostream_type&)) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>]'
116 | operator<<(__ostream_type& (*__pf)(__ostream_type&))
| ^~~~~~~~
/usr/include/c++/14/ostream:116:36: note: no known conversion for argument 1 from '<unresolved overloaded function type>' to 'std::basic_ostream<char>::__ostream_type& (*)(std::basic_ostream<char>::__ostream_type&)' {aka 'std::basic_ostream<char>& (*)(std::basic_ostream<char>&)'}
116 | operator<<(__ostream_type& (*__pf)(__ostream_type&))
| ~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~
/usr/include/c++/14/ostream:125:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(__ios_type& (*)(__ios_type&)) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>; __ios_type = std::basic_ios<char>]'
125 | operator<<(__ios_type& (*__pf)(__ios_type&))
| ^~~~~~~~
/usr/include/c++/14/ostream:125:32: note: no known conversion for argument 1 from '<unresolved overloaded function type>' to 'std::basic_ostream<char>::__ios_type& (*)(std::basic_ostream<char>::__ios_type&)' {aka 'std::basic_ios<char>& (*)(std::basic_ios<char>&)'}
125 | operator<<(__ios_type& (*__pf)(__ios_type&))
| ~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~
/usr/include/c++/14/ostream:135:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(std::ios_base& (*)(std::ios_base&)) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>]'
135 | operator<<(ios_base& (*__pf) (ios_base&))
| ^~~~~~~~
/usr/include/c++/14/ostream:135:30: note: no known conversion for argument 1 from '<unresolved overloaded function type>' to 'std::ios_base& (*)(std::ios_base&)'
135 | operator<<(ios_base& (*__pf) (ios_base&))
| ~~~~~~~~~~~~^~~~~~~~~~~~~~~~~
/usr/include/c++/14/ostream:174:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(long int) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>]'
174 | operator<<(long __n)
| ^~~~~~~~
/usr/include/c++/14/ostream:174:23: note: no known conversion for argument 1 from '<unresolved overloaded function type>' to 'long int'
174 | operator<<(long __n)
| ~~~~~^~~
/usr/include/c++/14/ostream:178:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(long unsigned int) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>]'
178 | operator<<(unsigned long __n)
| ^~~~~~~~
/usr/include/c++/14/ostream:178:32: note: no known conversion for argument 1 from '<unresolved overloaded function type>' to 'long unsigned int'
178 | operator<<(unsigned long __n)
| ~~~~~~~~~~~~~~^~~
/usr/include/c++/14/ostream:182:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(bool) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>]'
182 | operator<<(bool __n)
| ^~~~~~~~
/usr/include/c++/14/ostream:182:23: note: no known conversion for argument 1 from '<unresolved overloaded function type>' to 'bool'
182 | operator<<(bool __n)
| ~~~~~^~~
In file included from /usr/include/c++/14/ostream:1022:
/usr/include/c++/14/bits/ostream.tcc:96:5: note: candidate: 'std::basic_ostream<_CharT, _Traits>& std::basic_ostream<_CharT, _Traits>::operator<<(short int) [with _CharT = char; _Traits = std::char_traits<char>]'
96 | basic_ostream<_CharT, _Traits>::
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/c++/14/bits/ostream.tcc:97:22: note: no known conversion for argument 1 from '<unresolved overloaded function type>' to 'short int'
97 | operator<<(short __n)
| ~~~~~~^~~
/usr/include/c++/14/ostream:189:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(short unsigned int) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>]'
189 | operator<<(unsigned short __n)
| ^~~~~~~~
/usr/include/c++/14/ostream:189:33: note: no known conversion for argument 1 from '<unresolved overloaded function type>' to 'short unsigned int'
189 | operator<<(unsigned short __n)
| ~~~~~~~~~~~~~~~^~~
/usr/include/c++/14/bits/ostream.tcc:110:5: note: candidate: 'std::basic_ostream<_CharT, _Traits>& std::basic_ostream<_CharT, _Traits>::operator<<(int) [with _CharT = char; _Traits = std::char_traits<char>]'
110 | basic_ostream<_CharT, _Traits>::
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/c++/14/bits/ostream.tcc:111:20: note: no known conversion for argument 1 from '<unresolved overloaded function type>' to 'int'
111 | operator<<(int __n)
| ~~~~^~~
/usr/include/c++/14/ostream:200:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(unsigned int) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>]'
200 | operator<<(unsigned int __n)
| ^~~~~~~~
/usr/include/c++/14/ostream:200:31: note: no known conversion for argument 1 from '<unresolved overloaded function type>' to 'unsigned int'
200 | operator<<(unsigned int __n)
| ~~~~~~~~~~~~~^~~
/usr/include/c++/14/ostream:211:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(long long int) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>]'
211 | operator<<(long long __n)
| ^~~~~~~~
/usr/include/c++/14/ostream:211:28: note: no known conversion for argument 1 from '<unresolved overloaded function type>' to 'long long int'
211 | operator<<(long long __n)
| ~~~~~~~~~~^~~
/usr/include/c++/14/ostream:215:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(long long unsigned int) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>]'
215 | operator<<(unsigned long long __n)
| ^~~~~~~~
/usr/include/c++/14/ostream:215:37: note: no known conversion for argument 1 from '<unresolved overloaded function type>' to 'long long unsigned int'
215 | operator<<(unsigned long long __n)
| ~~~~~~~~~~~~~~~~~~~^~~
/usr/include/c++/14/ostream:231:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(double) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>]'
231 | operator<<(double __f)
| ^~~~~~~~
/usr/include/c++/14/ostream:231:25: note: no known conversion for argument 1 from '<unresolved overloaded function type>' to 'double'
231 | operator<<(double __f)
| ~~~~~~~^~~
/usr/include/c++/14/ostream:235:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(float) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>]'
235 | operator<<(float __f)
| ^~~~~~~~
/usr/include/c++/14/ostream:235:24: note: no known conversion for argument 1 from '<unresolved overloaded function type>' to 'float'
235 | operator<<(float __f)
| ~~~~~~^~~
/usr/include/c++/14/ostream:243:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(long double) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>]'
243 | operator<<(long double __f)
| ^~~~~~~~
/usr/include/c++/14/ostream:243:30: note: no known conversion for argument 1 from '<unresolved overloaded function type>' to 'long double'
243 | operator<<(long double __f)
| ~~~~~~~~~~~~^~~
/usr/include/c++/14/ostream:301:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(const void*) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>]'
301 | operator<<(const void* __p)
| ^~~~~~~~
/usr/include/c++/14/ostream:301:30: note: no known conversion for argument 1 from '<unresolved overloaded function type>' to 'const void*'
301 | operator<<(const void* __p)
| ~~~~~~~~~~~~^~~
/usr/include/c++/14/ostream:306:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(std::nullptr_t) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>; std::nullptr_t = std::nullptr_t]'
306 | operator<<(nullptr_t)
| ^~~~~~~~
/usr/include/c++/14/ostream:306:18: note: no known conversion for argument 1 from '<unresolved overloaded function type>' to 'std::nu
|
s230456918
|
p03971
|
C++
|
#include <bits/stdc++.h>
using namespace std;
int main(){
int N, A, B, S;
cin >> N >>A >>B;
vector<string> vec(N);
for (int i = 0; i < N; i++) {
cin >> vec.at(i);
}
for (int j = 0; j < N; j++) {
if(vec.at(j)=="a" && sum<A+B ){
cout << "Yes" <<endl;
S++;
}
else if(vec.at(j)=="b" && j<B){
cout << "Yes" <<endl;
S++;
}
else{
cout << "No" <<endl;
}
}
}
|
a.cc: In function 'int main()':
a.cc:14:30: error: 'sum' was not declared in this scope
14 | if(vec.at(j)=="a" && sum<A+B ){
| ^~~
|
s198925695
|
p03971
|
C++
|
#include <bits/stdc++.h>
using namespace std;
int main() {
int n , a, b;
cin >> n >> a >> b;
string s ;
int dom = 0;
int fore = 0;
for ( int i=0 ; i<n ; i++){
if (s.at(i) == 'c'){
cout << "No"<< endl;
continue ;
}else if ( s.at(i) == 'a'){
if (dom+fore<=n){
cout << "Yes" << endl;
dom++ ;
continue ;
}else {
cout << "No" << endl;
continue ;
}
}else if ( s.at(i) == 'b'){
if (dom + fore <= n && fore<=b){
cout << "Yes" << endl;
fore ++ ;
continue ;
}else {
cout << "No" << endl;
continue ;
}
}
}
|
a.cc: In function 'int main()':
a.cc:33:2: error: expected '}' at end of input
33 | }
| ^
a.cc:4:12: note: to match this '{'
4 | int main() {
| ^
|
s952864761
|
p03971
|
C++
|
#include <bits/stdc++.h>
#include <algorithm>
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <deque>
#include <functional>
#include <iostream>
#include <map>
#include <queue>
#include <set>
#include <stack>
#include <string>
#include <tuple>
#include <utility>
#include <vector>
#define pi 3.14159265358979323846264338327950L
using namespace std;
int main() {
int N, A, B, Pa=0, Pb=0,;
cin >> N >> A >> B;
string S;
cin >> S;
for (int i=0; i<N; i++) {
if (S[i]=='a') {
if (Pa<A+B) {
cout << "Yes" << endl;
Pa=Pa+1;
}
else {
cout << "No" << endl;
}
}
else if (S[i]=='b') {
if (Pa<A+B && Pb<B) {
cout << "Yes" << endl;
Pa=Pa+1;
Pb=Pb+1;
}
else {
cout << "No" << endl;
}
}
else {
cout << "No" << endl;
}
}
}
|
a.cc: In function 'int main()':
a.cc:21:27: error: expected unqualified-id before ';' token
21 | int N, A, B, Pa=0, Pb=0,;
| ^
|
s921492601
|
p03971
|
C++
|
#include<bits/stdc++.h>
using namespace std;
int main(){
int N=0,A=0,B=0;
cin>>N>>A>>B;
string S;
cin>>S;
int count=0;
int countb=0;
for(int i=0;i<N;i++){
string S.at(i);
if(S.at(i)=="a"&&count<(A+B)){
count+=1;
cout<<"Yes"<<endl;
}
else if(S.at(i)=="b"&&count<(A+B)&&countb<B){
count+=1;
countb+=1;
cout<<"Yes"<<endl;
}
else{
cout<<"No"<<endl;
}
}
}
|
a.cc: In function 'int main()':
a.cc:11:13: error: expected initializer before '.' token
11 | string S.at(i);
| ^
a.cc:12:15: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
12 | if(S.at(i)=="a"&&count<(A+B)){
| ~~~~~~~^~~~~
a.cc:16:20: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
16 | else if(S.at(i)=="b"&&count<(A+B)&&countb<B){
| ~~~~~~~^~~~~
|
s299090977
|
p03971
|
C++
|
#include<bits/stdc++.h>
using namespace std;
int main(){
int N=0,A=0,B=0;
cin>>N>>A>>B;
string S;
cin>>S;
int count=0;
int countb=0;
for(int i=0;i<N;i++){
char S.at(i);
if(S.at(i)=="a"&&count<(A+B)){
count+=1;
cout<<"Yes"<<endl;
}
else if(S.at(i)=="b"&&count<(A+B)&&countb<B){
count+=1;
countb+=1;
cout<<"Yes"<<endl;
}
else{
cout<<"No"<<endl;
}
}
}
|
a.cc: In function 'int main()':
a.cc:11:11: error: expected initializer before '.' token
11 | char S.at(i);
| ^
a.cc:12:15: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
12 | if(S.at(i)=="a"&&count<(A+B)){
| ~~~~~~~^~~~~
a.cc:16:20: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
16 | else if(S.at(i)=="b"&&count<(A+B)&&countb<B){
| ~~~~~~~^~~~~
|
s598708180
|
p03971
|
C++
|
#include <bits/stdc++.h>
using namespace std;
int main(){
int N,A,B,a=0,b=1;
string S;
cin>>N>>A>>B>>S;
for(int i=0; i<N; i++){
if(S[i] == 'c'){
cout << "No" << endl;
}
else if(S[i] == 'a'){
if(a<A+B){
cou t<< "Yes" << endl;
a++;
}
else{
cout<<"No"<<endl;
}
}
else{
if(a<A+B && b<=B){
cout << "Yes" << endl;
a++;
}
else{
cout<<"No"<<endl;
b++;
}
}
}
|
a.cc: In function 'int main()':
a.cc:14:9: error: 'cou' was not declared in this scope; did you mean 'cos'?
14 | cou t<< "Yes" << endl;
| ^~~
| cos
a.cc:31:2: error: expected '}' at end of input
31 | }
| ^
a.cc:4:11: note: to match this '{'
4 | int main(){
| ^
|
s528779857
|
p03971
|
Java
|
n,a,b = map(int,input().split())
a_cnt,b_cnt,cnt = 0,0,0
s = input()
cnt = a+b
for i in range(n):
if s[i] == "a":
if a_cnt + b_cnt <= cnt:
#print(a_cnt + b_cnt)
print("Yes")
else:
print("No")
a_cnt +=1
elif s[i] == "b":
if a_cnt + b_cnt < cnt and b_cnt < b:
print("Yes")
else:
print("No")
b_cnt +=1
elif s[i] == "c":
print("No")
|
Main.java:1: error: class, interface, enum, or record expected
n,a,b = map(int,input().split())
^
Main.java:9: error: illegal character: '#'
#print(a_cnt + b_cnt)
^
2 errors
|
s139452275
|
p03971
|
C++
|
#include <bits/stdc++.h>
#define rep(i,n) for (int i = 0; i < (n); i++)
using namespace std;
typedef long long ll;
const int inf = 1001001001;
int main(){
int n,a,b;
cin >> n >> a >> b;
string s;
int cnt_tot = 0;
int cnt_foreign = 0;
int m = s.size();
rep(i,n) {
if(s[i] == 'a'){
if(cnt_tot < a+b) cout << Yes << endl;
else cout << "No" << endl;
cnt_tot++;
}
else if(s[i] == 'b'){
if(cnt_tot < a + b && cnt_foreign+1 <= b) cout << "Yes" << endl;
else cout << "No" << endl;
cnt_tot++;
cnt_foreign++;
}
else {
cout << "No" << endl;
cnt_tot++;
}
}
}
|
a.cc: In function 'int main()':
a.cc:19:33: error: 'Yes' was not declared in this scope
19 | if(cnt_tot < a+b) cout << Yes << endl;
| ^~~
|
s913773094
|
p03971
|
C++
|
n, a, b = list(map(int, input().split()))
s = input()
cnt = 0
oversea = 0
for each in s:
if each == 'a' and cnt < a + b:
print('Yes')
cnt += 1
continue
if each == 'b' and cnt < a + b and oversea < b:
print('Yes')
cnt += 1
oversea += 1
continue
else:
print('No')
|
a.cc:9:15: warning: multi-character character constant [-Wmultichar]
9 | print('Yes')
| ^~~~~
a.cc:13:15: warning: multi-character character constant [-Wmultichar]
13 | print('Yes')
| ^~~~~
a.cc:18:15: warning: multi-character character constant [-Wmultichar]
18 | print('No')
| ^~~~
a.cc:1:1: error: 'n' does not name a type
1 | n, a, b = list(map(int, input().split()))
| ^
|
s555056125
|
p03971
|
C++
|
#include<iostream>
using namespace std;
int main(){
int x=0,y=0;
int n; cin >> n;
int a,b; cin >> a >> b;
string s; cin >> s;
int n = (int)s.size();
for(int i = 0; i < n; ++i){
if(s[i] == 'a'){
if(x+y<a+b){
cout << "yes" << endl;
x++;
}
else cout << "No" << endl;
} else if(s[i] == 'b'){
if(x+y<a+b&&y<b){
cout << "Yes" << endl;
y++;
} else cout << "No" << endl;
} else {
cout << "No" << endl;
}
}
}
|
a.cc: In function 'int main()':
a.cc:8:7: error: redeclaration of 'int n'
8 | int n = (int)s.size();
| ^
a.cc:5:7: note: 'int n' previously declared here
5 | int n; cin >> n;
| ^
|
s961104001
|
p03971
|
C++
|
#include<iosteam>
using namespace std;
int main(){
int x=0,y=0;
int n; cin >> n;
int a,b; cin >> a >> b;
string s; cin >> s;
int n = (int)s.size();
for(int i = 0; i < n; ++i){
if(s[i] == 'a'){
if(x+y<a+b){
cout << "yes" << endl;
x++;
}
else cout << "No" << endl;
} else if(s[i] == 'b'){
if(x+y<a+b&&y<b){
cout << "Yes" << endl;
y++;
} else cout << "No" << endl;
} else {
cout << "No" << endl;
}
}
}
|
a.cc:1:9: fatal error: iosteam: No such file or directory
1 | #include<iosteam>
| ^~~~~~~~~
compilation terminated.
|
s095004518
|
p03971
|
C++
|
#include <bits/stdc++.h>
using namespace std;
int main() {
int n,a,b;
string s;
cin >> n >> a >> b >> s;
int s=0;
for ( int i=0; i<n; i++ ) {
if ( s[i]=='a' ) {
if ( s<a+b ) {
cout << "Yes" << '\n';
s++;
} else {
cout << "No" << '\n';
}
}
else if ( s[i]=='b' ) {
if ( i<b&&s<a+b ) {
cout << "Yes" << '\n';
s++;
} else {
cout << "No" << '\n';
}
}
else {
cout << "No" << '\n';
}
}
return 0;
}
|
a.cc: In function 'int main()':
a.cc:8:7: error: conflicting declaration 'int s'
8 | int s=0;
| ^
a.cc:6:10: note: previous declaration as 'std::string s'
6 | string s;
| ^
a.cc:11:13: error: no match for 'operator<' (operand types are 'std::string' {aka 'std::__cxx11::basic_string<char>'} and 'int')
11 | if ( s<a+b ) {
| ~^~~~
| | |
| | int
| std::string {aka std::__cxx11::basic_string<char>}
In file included from /usr/include/c++/14/regex:68,
from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:181,
from a.cc:1:
/usr/include/c++/14/bits/regex.h:1143:5: note: candidate: 'template<class _BiIter> bool std::__cxx11::operator<(const sub_match<_BiIter>&, const sub_match<_BiIter>&)'
1143 | operator<(const sub_match<_BiIter>& __lhs, const sub_match<_BiIter>& __rhs)
| ^~~~~~~~
/usr/include/c++/14/bits/regex.h:1143:5: note: template argument deduction/substitution failed:
a.cc:11:16: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::__cxx11::sub_match<_BiIter>'
11 | if ( s<a+b ) {
| ^
/usr/include/c++/14/bits/regex.h:1224:5: note: candidate: 'template<class _Bi_iter, class _Ch_traits, class _Ch_alloc> bool std::__cxx11::operator<(__sub_match_string<_Bi_iter, _Ch_traits, _Ch_alloc>&, const sub_match<_BiIter>&)'
1224 | operator<(const __sub_match_string<_Bi_iter, _Ch_traits, _Ch_alloc>& __lhs,
| ^~~~~~~~
/usr/include/c++/14/bits/regex.h:1224:5: note: template argument deduction/substitution failed:
a.cc:11:16: note: mismatched types 'const std::__cxx11::sub_match<_BiIter>' and 'int'
11 | if ( s<a+b ) {
| ^
/usr/include/c++/14/bits/regex.h:1317:5: note: candidate: 'template<class _Bi_iter, class _Ch_traits, class _Ch_alloc> bool std::__cxx11::operator<(const sub_match<_BiIter>&, __sub_match_string<_Bi_iter, _Ch_traits, _Ch_alloc>&)'
1317 | operator<(const sub_match<_Bi_iter>& __lhs,
| ^~~~~~~~
/usr/include/c++/14/bits/regex.h:1317:5: note: template argument deduction/substitution failed:
a.cc:11:16: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::__cxx11::sub_match<_BiIter>'
11 | if ( s<a+b ) {
| ^
/usr/include/c++/14/bits/regex.h:1391:5: note: candidate: 'template<class _Bi_iter> bool std::__cxx11::operator<(const typename std::iterator_traits<_Iter>::value_type*, const sub_match<_BiIter>&)'
1391 | operator<(typename iterator_traits<_Bi_iter>::value_type const* __lhs,
| ^~~~~~~~
/usr/include/c++/14/bits/regex.h:1391:5: note: template argument deduction/substitution failed:
a.cc:11:16: note: mismatched types 'const std::__cxx11::sub_match<_BiIter>' and 'int'
11 | if ( s<a+b ) {
| ^
/usr/include/c++/14/bits/regex.h:1485:5: note: candidate: 'template<class _Bi_iter> bool std::__cxx11::operator<(const sub_match<_BiIter>&, const typename std::iterator_traits<_Iter>::value_type*)'
1485 | operator<(const sub_match<_Bi_iter>& __lhs,
| ^~~~~~~~
/usr/include/c++/14/bits/regex.h:1485:5: note: template argument deduction/substitution failed:
a.cc:11:16: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::__cxx11::sub_match<_BiIter>'
11 | if ( s<a+b ) {
| ^
/usr/include/c++/14/bits/regex.h:1560:5: note: candidate: 'template<class _Bi_iter> bool std::__cxx11::operator<(const typename std::iterator_traits<_Iter>::value_type&, const sub_match<_BiIter>&)'
1560 | operator<(typename iterator_traits<_Bi_iter>::value_type const& __lhs,
| ^~~~~~~~
/usr/include/c++/14/bits/regex.h:1560:5: note: template argument deduction/substitution failed:
a.cc:11:16: note: mismatched types 'const std::__cxx11::sub_match<_BiIter>' and 'int'
11 | if ( s<a+b ) {
| ^
/usr/include/c++/14/bits/regex.h:1660:5: note: candidate: 'template<class _Bi_iter> bool std::__cxx11::operator<(const sub_match<_BiIter>&, const typename std::iterator_traits<_Iter>::value_type&)'
1660 | operator<(const sub_match<_Bi_iter>& __lhs,
| ^~~~~~~~
/usr/include/c++/14/bits/regex.h:1660:5: note: template argument deduction/substitution failed:
a.cc:11:16: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::__cxx11::sub_match<_BiIter>'
11 | if ( s<a+b ) {
| ^
In file included from /usr/include/c++/14/bits/stl_algobase.h:64,
from /usr/include/c++/14/algorithm:60,
from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:51:
/usr/include/c++/14/bits/stl_pair.h:1045:5: note: candidate: 'template<class _T1, class _T2> constexpr bool std::operator<(const pair<_T1, _T2>&, const pair<_T1, _T2>&)'
1045 | operator<(const pair<_T1, _T2>& __x, const pair<_T1, _T2>& __y)
| ^~~~~~~~
/usr/include/c++/14/bits/stl_pair.h:1045:5: note: template argument deduction/substitution failed:
a.cc:11:16: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::pair<_T1, _T2>'
11 | if ( s<a+b ) {
| ^
In file included from /usr/include/c++/14/bits/stl_algobase.h:67:
/usr/include/c++/14/bits/stl_iterator.h:448:5: note: candidate: 'template<class _Iterator> constexpr bool std::operator<(const reverse_iterator<_Iterator>&, const reverse_iterator<_Iterator>&)'
448 | operator<(const reverse_iterator<_Iterator>& __x,
| ^~~~~~~~
/usr/include/c++/14/bits/stl_iterator.h:448:5: note: template argument deduction/substitution failed:
a.cc:11:16: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::reverse_iterator<_Iterator>'
11 | if ( s<a+b ) {
| ^
/usr/include/c++/14/bits/stl_iterator.h:493:5: note: candidate: 'template<class _IteratorL, class _IteratorR> constexpr bool std::operator<(const reverse_iterator<_Iterator>&, const reverse_iterator<_IteratorR>&)'
493 | operator<(const reverse_iterator<_IteratorL>& __x,
| ^~~~~~~~
/usr/include/c++/14/bits/stl_iterator.h:493:5: note: template argument deduction/substitution failed:
a.cc:11:16: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::reverse_iterator<_Iterator>'
11 | if ( s<a+b ) {
| ^
/usr/include/c++/14/bits/stl_iterator.h:1694:5: note: candidate: 'template<class _IteratorL, class _IteratorR> constexpr bool std::operator<(const move_iterator<_IteratorL>&, const move_iterator<_IteratorR>&)'
1694 | operator<(const move_iterator<_IteratorL>& __x,
| ^~~~~~~~
/usr/include/c++/14/bits/stl_iterator.h:1694:5: note: template argument deduction/substitution failed:
a.cc:11:16: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::move_iterator<_IteratorL>'
11 | if ( s<a+b ) {
| ^
/usr/include/c++/14/bits/stl_iterator.h:1760:5: note: candidate: 'template<class _Iterator> constexpr bool std::operator<(const move_iterator<_IteratorL>&, const move_iterator<_IteratorL>&)'
1760 | operator<(const move_iterator<_Iterator>& __x,
| ^~~~~~~~
/usr/include/c++/14/bits/stl_iterator.h:1760:5: note: template argument deduction/substitution failed:
a.cc:11:16: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::move_iterator<_IteratorL>'
11 | if ( s<a+b ) {
| ^
In file included from /usr/include/c++/14/bits/basic_string.h:47,
from /usr/include/c++/14/string:54,
from /usr/include/c++/14/bitset:52,
from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:52:
/usr/include/c++/14/string_view:673:5: note: candidate: 'template<class _CharT, class _Traits> constexpr bool std::operator<(basic_string_view<_CharT, _Traits>, basic_string_view<_CharT, _Traits>)'
673 | operator< (basic_string_view<_CharT, _Traits> __x,
| ^~~~~~~~
/usr/include/c++/14/string_view:673:5: note: template argument deduction/substitution failed:
a.cc:11:16: note: 'std::__cxx11::basic_string<char>' is not derived from 'std::basic_string_view<_CharT, _Traits>'
11 | if ( s<a+b ) {
| ^
/usr/include/c++/14/string_view:680:5: note: candidate: 'template<class _CharT, class _Traits> constexpr bool std::operator<(basic_string_view<_CharT, _Traits>, __type_identity_t<basic_string_view<_CharT, _Traits> >)'
680 | operator< (basic_string_view<_CharT, _Traits> __x,
| ^~~~~~~~
/usr/include/c++/14/string_view:680:5: note: template argument deduction/substitution failed:
a.cc:11:16: note: 'std::__cxx11::basic_string<char>' is not derived from 'std::basic_string_view<_CharT, _Traits>'
11 | if ( s<a+b ) {
| ^
/usr/include/c++/14/string_view:688:5: note: candidate: 'template<class _CharT, class _Traits> constexpr bool std::operator<(__type_identity_t<basic_string_view<_CharT, _Traits> >, basic_string_view<_CharT, _Traits>)'
688 | operator< (__type_identity_t<basic_string_view<_CharT, _Traits>> __x,
| ^~~~~~~~
/usr/include/c++/14/string_view:688:5: note: template argument deduction/substitution failed:
a.cc:11:16: note: mismatched types 'std::basic_string_view<_CharT, _Traits>' and 'int'
11 | if ( s<a+b ) {
| ^
/usr/include/c++/14/bits/basic_string.h:3874:5: note: candidate: 'template<class _CharT, class _Traits, class _Alloc> bool std::operator<(const __cxx11::basic_string<_CharT, _Traits, _Allocator>&, const __cxx11::basic_string<_CharT, _Traits, _Allocator>&)'
3874 | operator<(const basic_string<_CharT, _Traits, _Alloc>& __lhs,
| ^~~~~~~~
/usr/include/c++/14/bits/basic_string.h:3874:5: note: template argument deduction/substitution failed:
a.cc:11:16: note: mismatched types 'const std::__cxx11::basic_string<_CharT, _Traits, _Allocator>' and 'int'
|
s414872982
|
p03971
|
C++
|
#include <bits/stdc++.h>
using namespace std;
int main() {
int N, A, B, hito, kokugai;
string S;
cin >> N >> A >> B >> S;
hito =0; kokugai =0;
for(int i= 0; i<N; i++){
if(S.at(i)=="a" && hito < A+B){
cout << "Yes" << endl;
hito ++;
}
else if(S.at(i)=="b" && hito < A+B && kokugai <B){
cout << "Yes" << endl;
hito ++;
kokugai ++;
}
else cout << "No" << endl;
}
}
|
a.cc: In function 'int main()':
a.cc:11:15: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
11 | if(S.at(i)=="a" && hito < A+B){
| ~~~~~~~^~~~~
a.cc:15:20: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
15 | else if(S.at(i)=="b" && hito < A+B && kokugai <B){
| ~~~~~~~^~~~~
|
s437386954
|
p03971
|
C++
|
#include <bits/stdc++.h>
using namespace std;
int main() {
int N, A, B, hito, kokugai;
string S;
cin >> N >> A >> B >> S;
hito =0; kokugai =0;
for(int i= 0; i<N; i++){
if(S.at(i)=="a" && hito < A+B){
cout << "Yes" << endl;
hito ++;
}
else if(S.at(i)=="b" && hito < A+B && kokugai <B){
cout << "Yes" << endl;
hito ++;
kokugai ++;
}
else cout << "No" << endl;
}
|
a.cc: In function 'int main()':
a.cc:11:15: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
11 | if(S.at(i)=="a" && hito < A+B){
| ~~~~~~~^~~~~
a.cc:15:20: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
15 | else if(S.at(i)=="b" && hito < A+B && kokugai <B){
| ~~~~~~~^~~~~
a.cc:22:2: error: expected '}' at end of input
22 | }
| ^
a.cc:4:12: note: to match this '{'
4 | int main() {
| ^
|
s216675513
|
p03971
|
C++
|
#include <bits/stdc++.h>
using namespace std;
int main() {
int N, A, B, hito, kokugai;
string S;
cin >> N >> A >> B >> S;
kokunai =0; kokugai =0;
for(int i= 0; i<N; i++){
if(S.at(i)=="a" && hito < A+B){
cout << "Yes" << endl;
hito ++;
}
else if(S.at(i)=="b" && hito < A+B && kokugai <B){
cout << "Yes" << endl;
hito ++;
kokugai ++;
}
else cout << "No" << endl;
}
|
a.cc: In function 'int main()':
a.cc:9:3: error: 'kokunai' was not declared in this scope; did you mean 'kokugai'?
9 | kokunai =0; kokugai =0;
| ^~~~~~~
| kokugai
a.cc:12:15: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
12 | if(S.at(i)=="a" && hito < A+B){
| ~~~~~~~^~~~~
a.cc:16:20: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
16 | else if(S.at(i)=="b" && hito < A+B && kokugai <B){
| ~~~~~~~^~~~~
a.cc:23:2: error: expected '}' at end of input
23 | }
| ^
a.cc:5:12: note: to match this '{'
5 | int main() {
| ^
|
s662653381
|
p03971
|
C++
|
#include<bits/stdc++.h>
using namespace std;
using ll = long long;
using Graph = vector<vector<int>>;
const ll mod=1000000007;
const int MAX_N = 1000; // n の最大値
// nCk を取得
double nCk(int n, int k) {
double res=1.0;
for(int i=0; i<n; i++){
res*=0.5;}
for(int i=0; i<k; i++){
res*=(double)(n-i);
res/=(double)(k-i);
}
return res;}
int main() {
ll n,a,b;
cin>>n>>a>>b;
string s;
cin>>s;
ll k=0;
ll g=0;
for(ll i=0; i<s.size(); i++){
if(s.at(i)=='a'&&k+g<a+b){
cout << "Yes" << endl;
k++;}
else if(s.at(i)=='b'&&(k+g<a+b)&&g<b){
cout << "Yes" << endl;
g++;}
else{
cout << "No" << endl;}}
|
a.cc: In function 'int main()':
a.cc:34:24: error: expected '}' at end of input
34 | cout << "No" << endl;}}
| ^
a.cc:19:12: note: to match this '{'
19 | int main() {
| ^
|
s354651230
|
p03971
|
C++
|
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
int main() {
ll n,A,B;
string s;
cin>>n>>A>>B>>s;
ll iketaa=0, iketab=0;
rep(i,n){
if(iketaa+iketab>=A+B){
cout<<"No"<<endl;
}
else if(s[i]=='c'){
cout<<"No"<<endl;
}
else if(s[i]=='a'){
cout<<"Yes"<<endl;
iketaa++;
}
else if(s[i]==b&&iketab<=B){
cout<<"Yes"<<endl;
}
}
}
|
a.cc: In function 'int main()':
a.cc:22:21: error: 'b' was not declared in this scope
22 | else if(s[i]==b&&iketab<=B){
| ^
|
s955473972
|
p03971
|
C++
|
#include <bits/stdc++.h>
using namespace std;
int main() {
string data;
int N,A,B;
int ok = 0;
int B_cnt = 1;
cin >> N >> A >> B;
cin >> data;
for (int i=0; i<N; i++) {
if (data[i] == 'c') {
cout << "No" << endl;
}
if (data[i] == 'a') {
if (ok < A+B) {
cout << "Yes" << endl;
ok++;
}
else {
cout << "No" << endl;
}
}
if (data[i] == 'b') {
if ((ok < A+B) && (B_cnt <= B)) {
cout << "Yes" << endl;
B_cnt++;
ok++;
}
else {
cout << "No" << endl;
}
}
}
}
|
a.cc:27:21: error: extended character is not valid in an identifier
27 | if ((ok < A+B) && (B_cnt <= B)) {
| ^
a.cc:27:25: error: extended character is not valid in an identifier
27 | if ((ok < A+B) && (B_cnt <= B)) {
| ^
a.cc: In function 'int main()':
a.cc:27:21: error: expected ')' before '\U00003000'
27 | if ((ok < A+B) && (B_cnt <= B)) {
| ~ ^~
| )
|
s133884727
|
p03971
|
C++
|
#include <bits/stdc++.h>
using namespace std;
int main() {
string data;
int N,A,B;
int ok = 0;
int B_cnt = 1;
cin >> N >> A >> B;
cin >> data;
for (int i=0; i<N; i++) {
if (data[i] == 'c') {
cout << "No" << endl;
}
if (data[i] == 'a') {
if (ok < A+B) {
cout << "Yes" << endl;
ok++;
}
else {
cout << "No" << endl;
}
}
if (data[i] == 'b') {
if (ok<A+B && B_cnt<=B) {
cout << "Yes" << endl;
B_cnt++;
ok++;
}
else {
cout << "No" << endl;
}
}
}
}
|
a.cc:27:16: error: extended character is not valid in an identifier
27 | if (ok<A+B && B_cnt<=B) {
| ^
a.cc:27:21: error: extended character is not valid in an identifier
27 | if (ok<A+B && B_cnt<=B) {
| ^
a.cc: In function 'int main()':
a.cc:27:16: error: 'B\U00003000' was not declared in this scope
27 | if (ok<A+B && B_cnt<=B) {
| ^~~
a.cc:27:21: error: '\U00003000B_cnt' was not declared in this scope; did you mean 'B_cnt'?
27 | if (ok<A+B && B_cnt<=B) {
| ^~~~~~~
| B_cnt
|
s430923415
|
p03971
|
C++
|
#include <bits/stdc++.h>
using namespace std;
int main() {
string data;
int N,A,B;
int B_cnt = 0;
cin >> N >> A >> B;
cin >> data;
for (int i=0; i<N; i++) {
if (data[i] == 'c') {
cout << "No" <<endl;
}
if (data[i] == 'a') {
if (i <= A+B) {
cout << "Yes" <<endl;
}
else {
cout << "No" <<endl;
}
}
if (data[i] == 'b') {
B_cnt += 1;
if ((i <= A+B)&&(B_cnk <= B)) {
cout << "Yes" <<endl;
}
else {
cout << "No" <<endl;
}
}
}
}
|
a.cc: In function 'int main()':
a.cc:27:24: error: 'B_cnk' was not declared in this scope; did you mean 'B_cnt'?
27 | if ((i <= A+B)&&(B_cnk <= B)) {
| ^~~~~
| B_cnt
|
s180924694
|
p03971
|
C++
|
#include <bits/stdc++.h>
using namespace std;
int main() {
string data;
int N,A,B;
int B_cnt = 0;
cin >> N >> A >> B;
cin >> data;
for (int i=0; i<N; i++) {
if (data[i] == 'c') {
cout << "No" <<endl;
}
if (data[i] == 'a') {
if (i <= A+B) {
cout << "Yes" <<endl;
}
else {
cout << "No" <<endl;
}
}
if (data[i] == 'b') {
B_cnk += 1;
if ((i <= A+B)&&(B_cnk <= B)) {
cout << "Yes" <<endl;
}
else {
cout << "No" <<endl;
}
}
}
}
|
a.cc: In function 'int main()':
a.cc:26:7: error: 'B_cnk' was not declared in this scope; did you mean 'B_cnt'?
26 | B_cnk += 1;
| ^~~~~
| B_cnt
|
s148346312
|
p03971
|
C++
|
#include <bits/stdc++.h>
using namespace std;
int main() {
string data;
int N,A,B;
int B_cnt = 0;
cin >> N >> A >> B;
cin >> data;
for (int i=0; i<N; i++) {
if (data[i] == 'c') {
cout << "No" <<endl;
}
if (data[i] == 'a') {
if (i <= A+B) {
cout << "Yes" <<endl;
}
else {
cout << "No" <<endl;
}
if (data[i] == 'b') {
B_cnk += 1;
if ((i <= A+B)&&(B_cnk <= B)) {
cout << "Yes" <<endl;
}
else {
cout << "No" <<endl;
}
}
}
}
|
a.cc: In function 'int main()':
a.cc:25:7: error: 'B_cnk' was not declared in this scope; did you mean 'B_cnt'?
25 | B_cnk += 1;
| ^~~~~
| B_cnt
a.cc:34:2: error: expected '}' at end of input
34 | }
| ^
a.cc:4:12: note: to match this '{'
4 | int main() {
| ^
|
s830914306
|
p03971
|
C++
|
#include <bits/stdc++.h>
using namespace std;
int main() {
string data;
int N,A,B;
int B_cnt = 0;
cin >> N >> A >> B;
cin >> data;
for (int i=0; i<N; i++) {
if (data[i] == 'c') {
cout << 'No' <<endl;
}
if (data[i] == 'a') {
if (i <= A+B) {
cout << 'Yes' <<endl;
}
else {
cout << 'No' <<endl;
}
if (data[i] == 'b') {
B_cnk += 1;
if ((i <= A+B)&&(B_cnk <= B)) {
cout << 'Yes' <<endl;
}
else {
cout << 'No' <<endl;
}
}
}
}
|
a.cc:13:15: warning: multi-character character constant [-Wmultichar]
13 | cout << 'No' <<endl;
| ^~~~
a.cc:18:17: warning: multi-character character constant [-Wmultichar]
18 | cout << 'Yes' <<endl;
| ^~~~~
a.cc:21:17: warning: multi-character character constant [-Wmultichar]
21 | cout << 'No' <<endl;
| ^~~~
a.cc:27:17: warning: multi-character character constant [-Wmultichar]
27 | cout << 'Yes' <<endl;
| ^~~~~
a.cc:30:17: warning: multi-character character constant [-Wmultichar]
30 | cout << 'No' <<endl;
| ^~~~
a.cc: In function 'int main()':
a.cc:25:7: error: 'B_cnk' was not declared in this scope; did you mean 'B_cnt'?
25 | B_cnk += 1;
| ^~~~~
| B_cnt
a.cc:34:2: error: expected '}' at end of input
34 | }
| ^
a.cc:4:12: note: to match this '{'
4 | int main() {
| ^
|
s914260013
|
p03971
|
C++
|
#include <bits/stdc++.h>
using namespace std;
int main() {
string data;
int N,A,B;
int B_cnt = 0
cin >> N >> A >> B;
cin >> data;
for (int i=0, i<N, i++) {
if (data[i] == 'c') {
cout << 'No' <<endl;
}
if (data[i] == 'a') {
if (i <= A+B) {
cout << 'Yes' <<endl;
}
else {
cout << 'No' <<endl;
}
if (data[i] == 'b') {
B_cnk += 1;
if ((i <= A+B)&&(B_cnk <= B)) {
cout << 'Yes' <<endl;
}
else {
cout << 'No' <<endl;
}
}
}
}
|
a.cc:13:15: warning: multi-character character constant [-Wmultichar]
13 | cout << 'No' <<endl;
| ^~~~
a.cc:18:17: warning: multi-character character constant [-Wmultichar]
18 | cout << 'Yes' <<endl;
| ^~~~~
a.cc:21:17: warning: multi-character character constant [-Wmultichar]
21 | cout << 'No' <<endl;
| ^~~~
a.cc:27:17: warning: multi-character character constant [-Wmultichar]
27 | cout << 'Yes' <<endl;
| ^~~~~
a.cc:30:17: warning: multi-character character constant [-Wmultichar]
30 | cout << 'No' <<endl;
| ^~~~
a.cc: In function 'int main()':
a.cc:8:3: error: expected ',' or ';' before 'cin'
8 | cin >> N >> A >> B;
| ^~~
a.cc:11:18: error: expected ';' before '<' token
11 | for (int i=0, i<N, i++) {
| ^
| ;
a.cc:11:18: error: expected primary-expression before '<' token
a.cc:11:25: error: expected ';' before ')' token
11 | for (int i=0, i<N, i++) {
| ^
| ;
a.cc:25:7: error: 'B_cnk' was not declared in this scope; did you mean 'B_cnt'?
25 | B_cnk += 1;
| ^~~~~
| B_cnt
a.cc:34:2: error: expected '}' at end of input
34 | }
| ^
a.cc:4:12: note: to match this '{'
4 | int main() {
| ^
|
s999082173
|
p03971
|
C
|
#include<stdio.h>
int main(){
char m[100005];
int n,s,t,d[100005];
int sum,count1=0,count2=0;
scanf("%d %d %d",&n,&s,&t);
scanf("%c",m);
sum=s+t;
for(int i=0;i<n;i++){
if(s[i]=='c')d[i]=0;
else if(s[i]=='a' && count1<sum+1){
d[i]=1;
count1+=1;
}
else if(s[i]=='b' && count1<sum+1 && count2<t+1){
d[i]=1;
count2+=1;
}
else d[i]=0;
}
for(int j=0;j<n;j++){
if(d[j]==1)printf("Yes\n");
else printf("No\n");
}
return 0;
}
|
main.c: In function 'main':
main.c:10:9: error: subscripted value is neither array nor pointer nor vector
10 | if(s[i]=='c')d[i]=0;
| ^
main.c:11:14: error: subscripted value is neither array nor pointer nor vector
11 | else if(s[i]=='a' && count1<sum+1){
| ^
main.c:15:14: error: subscripted value is neither array nor pointer nor vector
15 | else if(s[i]=='b' && count1<sum+1 && count2<t+1){
| ^
|
s674816560
|
p03971
|
C++
|
#include<bits/stdc++.h>
using namespace std;
#define rep(i, c) for(ll i = 0; i < (ll)c; i++)
#define ll long long
#define upd_max(maxer, updater) if (maxer < updater) maxer = updater;
#define upd_min(miner, updater) if (miner > updater) miner = updater;
const int inf = 1000000000; // 10^9
int main(){
string s[110000];
ll n, a, b, kaigai = 0, kokunai = 0;
cin >> n >> a >> b >> s;
rep(i, n){
if(s[i] == 'a'){
if(kokunai + kaigai < a + b){
cout << "Yes" << endl;
kokunai++;
}
else cout << "No" << endl;
}
else if(s[i] == 'b'){
if(kokunai + kaigai < a + b && kaigai < b){
cout << "Yes" << endl;
kaigai++;
}
else cout << "No" << endl;
}
else{
cout << "No" << endl;
}
}
return 0;
}
|
a.cc: In function 'int main()':
a.cc:13:24: error: no match for 'operator>>' (operand types are 'std::basic_istream<char>::__istream_type' {aka 'std::basic_istream<char>'} and 'std::string [110000]' {aka 'std::__cxx11::basic_string<char> [110000]'})
13 | cin >> n >> a >> b >> s;
| ~~~~~~~~~~~~~~~~~~ ^~ ~
| | |
| | std::string [110000] {aka std::__cxx11::basic_string<char> [110000]}
| std::basic_istream<char>::__istream_type {aka std::basic_istream<char>}
In file included from /usr/include/c++/14/sstream:40,
from /usr/include/c++/14/complex:45,
from /usr/include/c++/14/ccomplex:39,
from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:127,
from a.cc:1:
/usr/include/c++/14/istream:170:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(bool&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' (near match)
170 | operator>>(bool& __n)
| ^~~~~~~~
/usr/include/c++/14/istream:170:7: note: conversion of argument 1 would be ill-formed:
a.cc:13:27: error: cannot bind non-const lvalue reference of type 'bool&' to a value of type 'std::string*' {aka 'std::__cxx11::basic_string<char>*'}
13 | cin >> n >> a >> b >> s;
| ^
/usr/include/c++/14/istream:174:7: note: candidate: 'std::basic_istream<_CharT, _Traits>& std::basic_istream<_CharT, _Traits>::operator>>(short int&) [with _CharT = char; _Traits = std::char_traits<char>]' (near match)
174 | operator>>(short& __n);
| ^~~~~~~~
/usr/include/c++/14/istream:174:7: note: conversion of argument 1 would be ill-formed:
a.cc:13:27: error: invalid conversion from 'std::string*' {aka 'std::__cxx11::basic_string<char>*'} to 'short int' [-fpermissive]
13 | cin >> n >> a >> b >> s;
| ^
| |
| std::string* {aka std::__cxx11::basic_string<char>*}
a.cc:13:27: error: cannot bind rvalue '(short int)((std::string*)(& s))' to 'short int&'
/usr/include/c++/14/istream:177:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(short unsigned int&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' (near match)
177 | operator>>(unsigned short& __n)
| ^~~~~~~~
/usr/include/c++/14/istream:177:7: note: conversion of argument 1 would be ill-formed:
a.cc:13:27: error: invalid conversion from 'std::string*' {aka 'std::__cxx11::basic_string<char>*'} to 'short unsigned int' [-fpermissive]
13 | cin >> n >> a >> b >> s;
| ^
| |
| std::string* {aka std::__cxx11::basic_string<char>*}
a.cc:13:27: error: cannot bind rvalue '(short unsigned int)((std::string*)(& s))' to 'short unsigned int&'
/usr/include/c++/14/istream:181:7: note: candidate: 'std::basic_istream<_CharT, _Traits>& std::basic_istream<_CharT, _Traits>::operator>>(int&) [with _CharT = char; _Traits = std::char_traits<char>]' (near match)
181 | operator>>(int& __n);
| ^~~~~~~~
/usr/include/c++/14/istream:181:7: note: conversion of argument 1 would be ill-formed:
a.cc:13:27: error: invalid conversion from 'std::string*' {aka 'std::__cxx11::basic_string<char>*'} to 'int' [-fpermissive]
13 | cin >> n >> a >> b >> s;
| ^
| |
| std::string* {aka std::__cxx11::basic_string<char>*}
a.cc:13:27: error: cannot bind rvalue '(int)((std::string*)(& s))' to 'int&'
/usr/include/c++/14/istream:184:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(unsigned int&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' (near match)
184 | operator>>(unsigned int& __n)
| ^~~~~~~~
/usr/include/c++/14/istream:184:7: note: conversion of argument 1 would be ill-formed:
a.cc:13:27: error: invalid conversion from 'std::string*' {aka 'std::__cxx11::basic_string<char>*'} to 'unsigned int' [-fpermissive]
13 | cin >> n >> a >> b >> s;
| ^
| |
| std::string* {aka std::__cxx11::basic_string<char>*}
a.cc:13:27: error: cannot bind rvalue '(unsigned int)((std::string*)(& s))' to 'unsigned int&'
/usr/include/c++/14/istream:188:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(long int&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' (near match)
188 | operator>>(long& __n)
| ^~~~~~~~
/usr/include/c++/14/istream:188:7: note: conversion of argument 1 would be ill-formed:
a.cc:13:27: error: invalid conversion from 'std::string*' {aka 'std::__cxx11::basic_string<char>*'} to 'long int' [-fpermissive]
13 | cin >> n >> a >> b >> s;
| ^
| |
| std::string* {aka std::__cxx11::basic_string<char>*}
a.cc:13:27: error: cannot bind rvalue '(long int)((std::string*)(& s))' to 'long int&'
/usr/include/c++/14/istream:192:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(long unsigned int&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' (near match)
192 | operator>>(unsigned long& __n)
| ^~~~~~~~
/usr/include/c++/14/istream:192:7: note: conversion of argument 1 would be ill-formed:
a.cc:13:27: error: invalid conversion from 'std::string*' {aka 'std::__cxx11::basic_string<char>*'} to 'long unsigned int' [-fpermissive]
13 | cin >> n >> a >> b >> s;
| ^
| |
| std::string* {aka std::__cxx11::basic_string<char>*}
a.cc:13:27: error: cannot bind rvalue '(long unsigned int)((std::string*)(& s))' to 'long unsigned int&'
/usr/include/c++/14/istream:199: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)
199 | operator>>(long long& __n)
| ^~~~~~~~
/usr/include/c++/14/istream:199:7: note: conversion of argument 1 would be ill-formed:
a.cc:13:27: error: invalid conversion from 'std::string*' {aka 'std::__cxx11::basic_string<char>*'} to 'long long int' [-fpermissive]
13 | cin >> n >> a >> b >> s;
| ^
| |
| std::string* {aka std::__cxx11::basic_string<char>*}
a.cc:13:27: error: cannot bind rvalue '(long long int)((std::string*)(& s))' to 'long long int&'
/usr/include/c++/14/istream:203: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)
203 | operator>>(unsigned long long& __n)
| ^~~~~~~~
/usr/include/c++/14/istream:203:7: note: conversion of argument 1 would be ill-formed:
a.cc:13:27: error: invalid conversion from 'std::string*' {aka 'std::__cxx11::basic_string<char>*'} to 'long long unsigned int' [-fpermissive]
13 | cin >> n >> a >> b >> s;
| ^
| |
| std::string* {aka std::__cxx11::basic_string<char>*}
a.cc:13:27: error: cannot bind rvalue '(long long unsigned int)((std::string*)(& s))' to 'long long unsigned int&'
/usr/include/c++/14/istream:328: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)
328 | operator>>(void*& __p)
| ^~~~~~~~
/usr/include/c++/14/istream:328:7: note: conversion of argument 1 would be ill-formed:
a.cc:13:27: error: cannot bind non-const lvalue reference of type 'void*&' to an rvalue of type 'void*'
13 | cin >> n >> a >> b >> s;
| ^
/usr/include/c++/14/istream:219:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(float&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]'
219 | operator>>(float& __f)
| ^~~~~~~~
/usr/include/c++/14/istream:219:25: note: no known conversion for argument 1 from 'std::string [110000]' {aka 'std::__cxx11::basic_string<char> [110000]'} to 'float&'
219 | operator>>(float& __f)
| ~~~~~~~^~~
/usr/include/c++/14/istream:223:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(double&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]'
223 | operator>>(double& __f)
| ^~~~~~~~
/usr/include/c++/14/istream:223:26: note: no known conversion for argument 1 from 'std::string [110000]' {aka 'std::__cxx11::basic_string<char> [110000]'} to 'double&'
223 | operator>>(double& __f)
| ~~~~~~~~^~~
/usr/include/c++/14/istream:227:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(long double&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istrea
|
s764539130
|
p03971
|
C++
|
#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i=0; i<(int)(n); i++)
#define all(x) x.begin(), x.end()
#define mod 1000000007
typedef long long ll;
int main(){
int N, A, B;
cin >> N >> A >> B;
string str;
cin >> str;
int ac = 0;
int foreignRanking = 0;
rep(i, str.length()){
if(str[i] == 'a'){
if(ac < A+B){
cout << "Yes" << endl;
ac++;
}else{
cout << "No" << endl;
}
}else if(str[i] == 'b'){
if(ac < A+B && foreignRanking < B){
cout << "Yes" << endl;
ac++;
foreignRanking++;
}else{
cout << "No" << endl;
}else{
cout << "No" << endl;
}
}
return 0;
}
|
a.cc: In function 'int main()':
a.cc:30:6: error: expected '}' before 'else'
30 | }else{
| ^~~~
a.cc:23:28: note: to match this '{'
23 | }else if(str[i] == 'b'){
| ^
|
s782442452
|
p03971
|
C++
|
#include <bits/stdc++.h>
using namespace std;
int main() {
vector<string> gokaku;
int A,B,N;
string number;
int Bcount=1;
cin>>N>>A>>B;
cin>>number;
for(int i=0;i<N;i++){
if(number.at(i)=="a"){
if(i<=(A+B)){
gokaku.push_back("Yes");
}
if(i>(A+B)){
gokaku.push_back("No");
}
}
if(number.at(i)=="b"){
if(i<=(A+B)){
if(i<=Bcount){
gokaku.push_back("Yes");
Bcount++;
}
}
else{
gokaku.push_back("No");
}
}
if(number.at(i)=="c"){
gokaku.push_back("No");
}
}
for(int i=0;i<N;i++){
cout<<gokaku.at(i)<<endl;
}
}
|
a.cc: In function 'int main()':
a.cc:14:20: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
14 | if(number.at(i)=="a"){
| ~~~~~~~~~~~~^~~~~
a.cc:23:20: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
23 | if(number.at(i)=="b"){
| ~~~~~~~~~~~~^~~~~
a.cc:36:20: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
36 | if(number.at(i)=="c"){
| ~~~~~~~~~~~~^~~~~
|
s488807738
|
p03971
|
C++
|
#include <bits/stdc++.h>
using namespace std;
int main() {
vector<string> gokaku;
int A,B,N;
string numner;
int Bcount=1;
cin>>N>>A>>B;
cin>>number;
for(int i=0;i<N;i++){
if(number.at(i)=="a"){
if(i<=(A+B)){
gokaku.push_back("Yes");
}
if(i>(A+B)){
gokaku.push_back("No");
}
}
if(number.at(i)=="b"){
if(i<=(A+B)){
if(i<=Bcount){
gokaku.push_back("Yes");
Bcount++;
}
}
else{
gokaku.push_back("No");
}
}
if(number.at(i)=="c"){
gokaku.push_back("No");
}
}
for(int i=0;i<N;i++){
cout<<gokaku.at(i)<<endl;
}
}
|
a.cc: In function 'int main()':
a.cc:11:8: error: 'number' was not declared in this scope; did you mean 'numner'?
11 | cin>>number;
| ^~~~~~
| numner
|
s921591195
|
p03971
|
C++
|
#include <bits/stdc++.h>
using namespace std;
int main() {
vector<string> gokaku;
int A,B,N;
int Bcount=1;
cin>>N>>A>>B;
vector<char> number(N);
cin>>number;
for(int i=0;i<N;i++){
if(number.at(i)=="a"){
if(i<=(A+B)){
gokaku.push_back("Yes");
}
if(i>(A+B)){
gokaku.push_back("No");
}
}
if(number.at(i)=="b"){
if(i<=(A+B)){
if(i<=Bcount){
gokaku.push_back("Yes");
Bcount++;
}
}
else{
gokaku.push_back("No");
}
}
if(number.at(i)=="c"){
gokaku.push_back("No");
}
}
for(int i=0;i<N;i++){
cout<<gokaku.at(i)<<endl;
}
}
|
a.cc: In function 'int main()':
a.cc:12:6: error: no match for 'operator>>' (operand types are 'std::istream' {aka 'std::basic_istream<char>'} and 'std::vector<char>')
12 | cin>>number;
| ~~~^~~~~~~~
| | |
| | std::vector<char>
| std::istream {aka std::basic_istream<char>}
In file included from /usr/include/c++/14/sstream:40,
from /usr/include/c++/14/complex:45,
from /usr/include/c++/14/ccomplex:39,
from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:127,
from a.cc:1:
/usr/include/c++/14/istream:170:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(bool&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]'
170 | operator>>(bool& __n)
| ^~~~~~~~
/usr/include/c++/14/istream:170:24: note: no known conversion for argument 1 from 'std::vector<char>' to 'bool&'
170 | operator>>(bool& __n)
| ~~~~~~^~~
/usr/include/c++/14/istream:174:7: note: candidate: 'std::basic_istream<_CharT, _Traits>& std::basic_istream<_CharT, _Traits>::operator>>(short int&) [with _CharT = char; _Traits = std::char_traits<char>]'
174 | operator>>(short& __n);
| ^~~~~~~~
/usr/include/c++/14/istream:174:25: note: no known conversion for argument 1 from 'std::vector<char>' to 'short int&'
174 | operator>>(short& __n);
| ~~~~~~~^~~
/usr/include/c++/14/istream:177:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(short unsigned int&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]'
177 | operator>>(unsigned short& __n)
| ^~~~~~~~
/usr/include/c++/14/istream:177:34: note: no known conversion for argument 1 from 'std::vector<char>' to 'short unsigned int&'
177 | operator>>(unsigned short& __n)
| ~~~~~~~~~~~~~~~~^~~
/usr/include/c++/14/istream:181:7: note: candidate: 'std::basic_istream<_CharT, _Traits>& std::basic_istream<_CharT, _Traits>::operator>>(int&) [with _CharT = char; _Traits = std::char_traits<char>]'
181 | operator>>(int& __n);
| ^~~~~~~~
/usr/include/c++/14/istream:181:23: note: no known conversion for argument 1 from 'std::vector<char>' to 'int&'
181 | operator>>(int& __n);
| ~~~~~^~~
/usr/include/c++/14/istream:184:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(unsigned int&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]'
184 | operator>>(unsigned int& __n)
| ^~~~~~~~
/usr/include/c++/14/istream:184:32: note: no known conversion for argument 1 from 'std::vector<char>' to 'unsigned int&'
184 | operator>>(unsigned int& __n)
| ~~~~~~~~~~~~~~^~~
/usr/include/c++/14/istream:188:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(long int&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]'
188 | operator>>(long& __n)
| ^~~~~~~~
/usr/include/c++/14/istream:188:24: note: no known conversion for argument 1 from 'std::vector<char>' to 'long int&'
188 | operator>>(long& __n)
| ~~~~~~^~~
/usr/include/c++/14/istream:192:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(long unsigned int&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]'
192 | operator>>(unsigned long& __n)
| ^~~~~~~~
/usr/include/c++/14/istream:192:33: note: no known conversion for argument 1 from 'std::vector<char>' to 'long unsigned int&'
192 | operator>>(unsigned long& __n)
| ~~~~~~~~~~~~~~~^~~
/usr/include/c++/14/istream:199: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>]'
199 | operator>>(long long& __n)
| ^~~~~~~~
/usr/include/c++/14/istream:199:29: note: no known conversion for argument 1 from 'std::vector<char>' to 'long long int&'
199 | operator>>(long long& __n)
| ~~~~~~~~~~~^~~
/usr/include/c++/14/istream:203: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>]'
203 | operator>>(unsigned long long& __n)
| ^~~~~~~~
/usr/include/c++/14/istream:203:38: note: no known conversion for argument 1 from 'std::vector<char>' to 'long long unsigned int&'
203 | operator>>(unsigned long long& __n)
| ~~~~~~~~~~~~~~~~~~~~^~~
/usr/include/c++/14/istream:219:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(float&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]'
219 | operator>>(float& __f)
| ^~~~~~~~
/usr/include/c++/14/istream:219:25: note: no known conversion for argument 1 from 'std::vector<char>' to 'float&'
219 | operator>>(float& __f)
| ~~~~~~~^~~
/usr/include/c++/14/istream:223:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(double&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]'
223 | operator>>(double& __f)
| ^~~~~~~~
/usr/include/c++/14/istream:223:26: note: no known conversion for argument 1 from 'std::vector<char>' to 'double&'
223 | operator>>(double& __f)
| ~~~~~~~~^~~
/usr/include/c++/14/istream:227:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(long double&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]'
227 | operator>>(long double& __f)
| ^~~~~~~~
/usr/include/c++/14/istream:227:31: note: no known conversion for argument 1 from 'std::vector<char>' to 'long double&'
227 | operator>>(long double& __f)
| ~~~~~~~~~~~~~^~~
/usr/include/c++/14/istream:328: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>]'
328 | operator>>(void*& __p)
| ^~~~~~~~
/usr/include/c++/14/istream:328:25: note: no known conversion for argument 1 from 'std::vector<char>' to 'void*&'
328 | operator>>(void*& __p)
| ~~~~~~~^~~
/usr/include/c++/14/istream:122:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(__istream_type& (*)(__istream_type&)) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]'
122 | operator>>(__istream_type& (*__pf)(__istream_type&))
| ^~~~~~~~
/usr/include/c++/14/istream:122:36: note: no known conversion for argument 1 from 'std::vector<char>' to 'std::basic_istream<char>::__istream_type& (*)(std::basic_istream<char>::__istream_type&)' {aka 'std::basic_istream<char>& (*)(std::basic_istream<char>&)'}
122 | operator>>(__istream_type& (*__pf)(__istream_type&))
| ~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~
/usr/include/c++/14/istream:126:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(__ios_type& (*)(__ios_type&)) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>; __ios_type = std::basic_ios<char>]'
126 | operator>>(__ios_type& (*__pf)(__ios_type&))
| ^~~~~~~~
/usr/include/c++/14/istream:126:32: note: no known conversion for argument 1 from 'std::vector<char>' to 'std::basic_istream<char>::__ios_type& (*)(std::basic_istream<char>::__ios_type&)' {aka 'std::basic_ios<char>& (*)(std::basic_ios<char>&)'}
126 | operator>>(__ios_type& (*__pf)(__ios_type&))
| ~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~
/usr/include/c++/14/istream:133:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(std::ios_base& (*)(std::ios_base&)) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]'
133 | operator>>(ios_base& (*__pf)(ios_base&))
| ^~~~~~~~
/usr/include/c++/14/istream:133:30: note: no known conversion for argument 1 from 'std::vector<char>' to 'std::ios_base& (*)(std::ios_base&)'
133 | operator>>(ios_base& (*__pf)(ios_base&))
| ~~~~~~~~~~~~^~~~~~~~~~~~~~~~
/usr/include/c++/14/istream:352:7: note: candidate: 'std::basic_istream<_CharT, _Traits>& std::basic_istream<_CharT, _Traits>::operator>>(__streambuf_type*) [with _CharT = char; _Traits = std::char_traits<char>; __streambuf_type = std::basic_streambuf<char>]'
352 | operator>>(__streambuf_type* __sb);
| ^~~~~~~~
/usr/include/c++/14/istream:352:36: note: no known conversion for argument 1 from 'std::vector<char>' to 'std::basic_istream<char>::__streambuf_type*' {aka 'std::basic_streambuf<char>*'}
352 | operator>>(__streambuf_type* __sb);
| ~~~~~~~~~~~~~~~~~~^~~~
In file included from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:41:
/usr/includ
|
s109335241
|
p03971
|
C++
|
#include <bits/stdc++.h>
using namespace std;
int main() {
vector<string> gokaku;
int A,B,N;
int Bcount=1;
cin>>N>>A>>B;
vector<string> number(N);
cin>>number;
for(int i=0;i<N;i++){
if(number.at(i)=="a"){
if(i<=(A+B)){
gokaku.push_back("Yes");
}
if(i>(A+B)){
gokaku.push_back("No");
}
}
if(number.at(i)=="b"){
if(i<=(A+B)){
if(i<=Bcount){
gokaku.push_back("Yes");
Bcount++;
}
}
else{
gokaku.push_back("No");
}
}
if(number.at(i)=="c"){
gokaku.push_back("No");
}
}
for(int i=0;i<N;i++){
cout<<gokaku.at(i)<<endl;
}
}
|
a.cc: In function 'int main()':
a.cc:12:6: error: no match for 'operator>>' (operand types are 'std::istream' {aka 'std::basic_istream<char>'} and 'std::vector<std::__cxx11::basic_string<char> >')
12 | cin>>number;
| ~~~^~~~~~~~
| | |
| | std::vector<std::__cxx11::basic_string<char> >
| std::istream {aka std::basic_istream<char>}
In file included from /usr/include/c++/14/sstream:40,
from /usr/include/c++/14/complex:45,
from /usr/include/c++/14/ccomplex:39,
from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:127,
from a.cc:1:
/usr/include/c++/14/istream:170:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(bool&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]'
170 | operator>>(bool& __n)
| ^~~~~~~~
/usr/include/c++/14/istream:170:24: note: no known conversion for argument 1 from 'std::vector<std::__cxx11::basic_string<char> >' to 'bool&'
170 | operator>>(bool& __n)
| ~~~~~~^~~
/usr/include/c++/14/istream:174:7: note: candidate: 'std::basic_istream<_CharT, _Traits>& std::basic_istream<_CharT, _Traits>::operator>>(short int&) [with _CharT = char; _Traits = std::char_traits<char>]'
174 | operator>>(short& __n);
| ^~~~~~~~
/usr/include/c++/14/istream:174:25: note: no known conversion for argument 1 from 'std::vector<std::__cxx11::basic_string<char> >' to 'short int&'
174 | operator>>(short& __n);
| ~~~~~~~^~~
/usr/include/c++/14/istream:177:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(short unsigned int&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]'
177 | operator>>(unsigned short& __n)
| ^~~~~~~~
/usr/include/c++/14/istream:177:34: note: no known conversion for argument 1 from 'std::vector<std::__cxx11::basic_string<char> >' to 'short unsigned int&'
177 | operator>>(unsigned short& __n)
| ~~~~~~~~~~~~~~~~^~~
/usr/include/c++/14/istream:181:7: note: candidate: 'std::basic_istream<_CharT, _Traits>& std::basic_istream<_CharT, _Traits>::operator>>(int&) [with _CharT = char; _Traits = std::char_traits<char>]'
181 | operator>>(int& __n);
| ^~~~~~~~
/usr/include/c++/14/istream:181:23: note: no known conversion for argument 1 from 'std::vector<std::__cxx11::basic_string<char> >' to 'int&'
181 | operator>>(int& __n);
| ~~~~~^~~
/usr/include/c++/14/istream:184:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(unsigned int&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]'
184 | operator>>(unsigned int& __n)
| ^~~~~~~~
/usr/include/c++/14/istream:184:32: note: no known conversion for argument 1 from 'std::vector<std::__cxx11::basic_string<char> >' to 'unsigned int&'
184 | operator>>(unsigned int& __n)
| ~~~~~~~~~~~~~~^~~
/usr/include/c++/14/istream:188:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(long int&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]'
188 | operator>>(long& __n)
| ^~~~~~~~
/usr/include/c++/14/istream:188:24: note: no known conversion for argument 1 from 'std::vector<std::__cxx11::basic_string<char> >' to 'long int&'
188 | operator>>(long& __n)
| ~~~~~~^~~
/usr/include/c++/14/istream:192:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(long unsigned int&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]'
192 | operator>>(unsigned long& __n)
| ^~~~~~~~
/usr/include/c++/14/istream:192:33: note: no known conversion for argument 1 from 'std::vector<std::__cxx11::basic_string<char> >' to 'long unsigned int&'
192 | operator>>(unsigned long& __n)
| ~~~~~~~~~~~~~~~^~~
/usr/include/c++/14/istream:199: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>]'
199 | operator>>(long long& __n)
| ^~~~~~~~
/usr/include/c++/14/istream:199:29: note: no known conversion for argument 1 from 'std::vector<std::__cxx11::basic_string<char> >' to 'long long int&'
199 | operator>>(long long& __n)
| ~~~~~~~~~~~^~~
/usr/include/c++/14/istream:203: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>]'
203 | operator>>(unsigned long long& __n)
| ^~~~~~~~
/usr/include/c++/14/istream:203:38: note: no known conversion for argument 1 from 'std::vector<std::__cxx11::basic_string<char> >' to 'long long unsigned int&'
203 | operator>>(unsigned long long& __n)
| ~~~~~~~~~~~~~~~~~~~~^~~
/usr/include/c++/14/istream:219:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(float&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]'
219 | operator>>(float& __f)
| ^~~~~~~~
/usr/include/c++/14/istream:219:25: note: no known conversion for argument 1 from 'std::vector<std::__cxx11::basic_string<char> >' to 'float&'
219 | operator>>(float& __f)
| ~~~~~~~^~~
/usr/include/c++/14/istream:223:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(double&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]'
223 | operator>>(double& __f)
| ^~~~~~~~
/usr/include/c++/14/istream:223:26: note: no known conversion for argument 1 from 'std::vector<std::__cxx11::basic_string<char> >' to 'double&'
223 | operator>>(double& __f)
| ~~~~~~~~^~~
/usr/include/c++/14/istream:227:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(long double&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]'
227 | operator>>(long double& __f)
| ^~~~~~~~
/usr/include/c++/14/istream:227:31: note: no known conversion for argument 1 from 'std::vector<std::__cxx11::basic_string<char> >' to 'long double&'
227 | operator>>(long double& __f)
| ~~~~~~~~~~~~~^~~
/usr/include/c++/14/istream:328: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>]'
328 | operator>>(void*& __p)
| ^~~~~~~~
/usr/include/c++/14/istream:328:25: note: no known conversion for argument 1 from 'std::vector<std::__cxx11::basic_string<char> >' to 'void*&'
328 | operator>>(void*& __p)
| ~~~~~~~^~~
/usr/include/c++/14/istream:122:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(__istream_type& (*)(__istream_type&)) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]'
122 | operator>>(__istream_type& (*__pf)(__istream_type&))
| ^~~~~~~~
/usr/include/c++/14/istream:122:36: note: no known conversion for argument 1 from 'std::vector<std::__cxx11::basic_string<char> >' to 'std::basic_istream<char>::__istream_type& (*)(std::basic_istream<char>::__istream_type&)' {aka 'std::basic_istream<char>& (*)(std::basic_istream<char>&)'}
122 | operator>>(__istream_type& (*__pf)(__istream_type&))
| ~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~
/usr/include/c++/14/istream:126:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(__ios_type& (*)(__ios_type&)) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>; __ios_type = std::basic_ios<char>]'
126 | operator>>(__ios_type& (*__pf)(__ios_type&))
| ^~~~~~~~
/usr/include/c++/14/istream:126:32: note: no known conversion for argument 1 from 'std::vector<std::__cxx11::basic_string<char> >' to 'std::basic_istream<char>::__ios_type& (*)(std::basic_istream<char>::__ios_type&)' {aka 'std::basic_ios<char>& (*)(std::basic_ios<char>&)'}
126 | operator>>(__ios_type& (*__pf)(__ios_type&))
| ~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~
/usr/include/c++/14/istream:133:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(std::ios_base& (*)(std::ios_base&)) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]'
133 | operator>>(ios_base& (*__pf)(ios_base&))
| ^~~~~~~~
/usr/include/c++/14/istream:133:30: note: no known conversion for argument 1 from 'std::vector<std::__cxx11::basic_string<char> >' to 'std::ios_base& (*)(std::ios_base&)'
133 | operator>>(ios_base& (*__pf)(ios_base&))
| ~~~~~~~~~~~~^~~~~~~~~~~~~~~~
/usr/include/c++/14/istream:352:7: note: candidate: 'std::basic_istream<_CharT, _Traits>& std::basic_istream<_CharT, _Traits>::operator>>(__streambuf_type*) [with _CharT = char; _Traits
|
s028842830
|
p03971
|
C++
|
#include <bits/stdc++.h>
using namespace std;
int main() {
vector<string> number(N);
vector<string> gokaku;
int A,B,N;
int Bcount=1;
cin>>N>>A>>B;
cin>>number;
for(int i=0;i<N;i++){
if(number.at(i)=="a"){
if(i<=(A+B)){
gokaku.push_back("Yes");
}
if(i>(A+B)){
gokaku.push_back("No");
}
}
if(number.at(i)=="b"){
if(i<=(A+B)){
if(i<=Bcount){
gokaku.push_back("Yes");
Bcount++;
}
}
else{
gokaku.push_back("No");
}
}
if(number.at(i)=="c"){
gokaku.push_back("No");
}
}
for(int i=0;i<N;i++){
cout<<gokaku.at(i)<<endl;
}
}
|
a.cc: In function 'int main()':
a.cc:5:25: error: 'N' was not declared in this scope
5 | vector<string> number(N);
| ^
a.cc:10:6: error: no match for 'operator>>' (operand types are 'std::istream' {aka 'std::basic_istream<char>'} and 'std::vector<std::__cxx11::basic_string<char> >')
10 | cin>>number;
| ~~~^~~~~~~~
| | |
| | std::vector<std::__cxx11::basic_string<char> >
| std::istream {aka std::basic_istream<char>}
In file included from /usr/include/c++/14/sstream:40,
from /usr/include/c++/14/complex:45,
from /usr/include/c++/14/ccomplex:39,
from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:127,
from a.cc:1:
/usr/include/c++/14/istream:170:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(bool&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]'
170 | operator>>(bool& __n)
| ^~~~~~~~
/usr/include/c++/14/istream:170:24: note: no known conversion for argument 1 from 'std::vector<std::__cxx11::basic_string<char> >' to 'bool&'
170 | operator>>(bool& __n)
| ~~~~~~^~~
/usr/include/c++/14/istream:174:7: note: candidate: 'std::basic_istream<_CharT, _Traits>& std::basic_istream<_CharT, _Traits>::operator>>(short int&) [with _CharT = char; _Traits = std::char_traits<char>]'
174 | operator>>(short& __n);
| ^~~~~~~~
/usr/include/c++/14/istream:174:25: note: no known conversion for argument 1 from 'std::vector<std::__cxx11::basic_string<char> >' to 'short int&'
174 | operator>>(short& __n);
| ~~~~~~~^~~
/usr/include/c++/14/istream:177:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(short unsigned int&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]'
177 | operator>>(unsigned short& __n)
| ^~~~~~~~
/usr/include/c++/14/istream:177:34: note: no known conversion for argument 1 from 'std::vector<std::__cxx11::basic_string<char> >' to 'short unsigned int&'
177 | operator>>(unsigned short& __n)
| ~~~~~~~~~~~~~~~~^~~
/usr/include/c++/14/istream:181:7: note: candidate: 'std::basic_istream<_CharT, _Traits>& std::basic_istream<_CharT, _Traits>::operator>>(int&) [with _CharT = char; _Traits = std::char_traits<char>]'
181 | operator>>(int& __n);
| ^~~~~~~~
/usr/include/c++/14/istream:181:23: note: no known conversion for argument 1 from 'std::vector<std::__cxx11::basic_string<char> >' to 'int&'
181 | operator>>(int& __n);
| ~~~~~^~~
/usr/include/c++/14/istream:184:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(unsigned int&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]'
184 | operator>>(unsigned int& __n)
| ^~~~~~~~
/usr/include/c++/14/istream:184:32: note: no known conversion for argument 1 from 'std::vector<std::__cxx11::basic_string<char> >' to 'unsigned int&'
184 | operator>>(unsigned int& __n)
| ~~~~~~~~~~~~~~^~~
/usr/include/c++/14/istream:188:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(long int&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]'
188 | operator>>(long& __n)
| ^~~~~~~~
/usr/include/c++/14/istream:188:24: note: no known conversion for argument 1 from 'std::vector<std::__cxx11::basic_string<char> >' to 'long int&'
188 | operator>>(long& __n)
| ~~~~~~^~~
/usr/include/c++/14/istream:192:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(long unsigned int&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]'
192 | operator>>(unsigned long& __n)
| ^~~~~~~~
/usr/include/c++/14/istream:192:33: note: no known conversion for argument 1 from 'std::vector<std::__cxx11::basic_string<char> >' to 'long unsigned int&'
192 | operator>>(unsigned long& __n)
| ~~~~~~~~~~~~~~~^~~
/usr/include/c++/14/istream:199: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>]'
199 | operator>>(long long& __n)
| ^~~~~~~~
/usr/include/c++/14/istream:199:29: note: no known conversion for argument 1 from 'std::vector<std::__cxx11::basic_string<char> >' to 'long long int&'
199 | operator>>(long long& __n)
| ~~~~~~~~~~~^~~
/usr/include/c++/14/istream:203: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>]'
203 | operator>>(unsigned long long& __n)
| ^~~~~~~~
/usr/include/c++/14/istream:203:38: note: no known conversion for argument 1 from 'std::vector<std::__cxx11::basic_string<char> >' to 'long long unsigned int&'
203 | operator>>(unsigned long long& __n)
| ~~~~~~~~~~~~~~~~~~~~^~~
/usr/include/c++/14/istream:219:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(float&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]'
219 | operator>>(float& __f)
| ^~~~~~~~
/usr/include/c++/14/istream:219:25: note: no known conversion for argument 1 from 'std::vector<std::__cxx11::basic_string<char> >' to 'float&'
219 | operator>>(float& __f)
| ~~~~~~~^~~
/usr/include/c++/14/istream:223:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(double&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]'
223 | operator>>(double& __f)
| ^~~~~~~~
/usr/include/c++/14/istream:223:26: note: no known conversion for argument 1 from 'std::vector<std::__cxx11::basic_string<char> >' to 'double&'
223 | operator>>(double& __f)
| ~~~~~~~~^~~
/usr/include/c++/14/istream:227:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(long double&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]'
227 | operator>>(long double& __f)
| ^~~~~~~~
/usr/include/c++/14/istream:227:31: note: no known conversion for argument 1 from 'std::vector<std::__cxx11::basic_string<char> >' to 'long double&'
227 | operator>>(long double& __f)
| ~~~~~~~~~~~~~^~~
/usr/include/c++/14/istream:328: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>]'
328 | operator>>(void*& __p)
| ^~~~~~~~
/usr/include/c++/14/istream:328:25: note: no known conversion for argument 1 from 'std::vector<std::__cxx11::basic_string<char> >' to 'void*&'
328 | operator>>(void*& __p)
| ~~~~~~~^~~
/usr/include/c++/14/istream:122:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(__istream_type& (*)(__istream_type&)) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]'
122 | operator>>(__istream_type& (*__pf)(__istream_type&))
| ^~~~~~~~
/usr/include/c++/14/istream:122:36: note: no known conversion for argument 1 from 'std::vector<std::__cxx11::basic_string<char> >' to 'std::basic_istream<char>::__istream_type& (*)(std::basic_istream<char>::__istream_type&)' {aka 'std::basic_istream<char>& (*)(std::basic_istream<char>&)'}
122 | operator>>(__istream_type& (*__pf)(__istream_type&))
| ~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~
/usr/include/c++/14/istream:126:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(__ios_type& (*)(__ios_type&)) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>; __ios_type = std::basic_ios<char>]'
126 | operator>>(__ios_type& (*__pf)(__ios_type&))
| ^~~~~~~~
/usr/include/c++/14/istream:126:32: note: no known conversion for argument 1 from 'std::vector<std::__cxx11::basic_string<char> >' to 'std::basic_istream<char>::__ios_type& (*)(std::basic_istream<char>::__ios_type&)' {aka 'std::basic_ios<char>& (*)(std::basic_ios<char>&)'}
126 | operator>>(__ios_type& (*__pf)(__ios_type&))
| ~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~
/usr/include/c++/14/istream:133:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(std::ios_base& (*)(std::ios_base&)) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]'
133 | operator>>(ios_base& (*__pf)(ios_base&))
| ^~~~~~~~
/usr/include/c++/14/istream:133:30: note: no known conversion for argument 1 from 'std::vector<std::__cxx11::basic_string<char> >' to 'std::ios_base& (*)(std::ios_base&)'
133 | operator>>(ios_base& (*__pf)(ios_base&))
| ~~~~~~~~~~~~^~~~~~~~~~~~~~~~
/usr/include/c++/14/istream:352:7: note: candidate: 'std::basic
|
s750476294
|
p03971
|
C++
|
#include <bits/stdc++.h>
using namespace std;
int main() {
vector<string> number;
vector<string> gokaku;
int A,B,N;
int Bcount=1;
cin>>N>>A>>B;
cin>>number;
for(int i=0;i<N;i++){
if(number.at(i)=="a"){
if(i<=(A+B)){
gokaku.push_back("Yes");
}
if(i>(A+B)){
gokaku.push_back("No");
}
}
if(number.at(i)=="b"){
if(i<=(A+B)){
if(i<=Bcount){
gokaku.push_back("Yes");
Bcount++;
}
}
else{
gokaku.push_back("No");
}
}
if(number.at(i)=="c"){
gokaku.push_back("No");
}
}
for(int i=0;i<N;i++){
cout<<gokaku.at(i)<<endl;
}
}
|
a.cc: In function 'int main()':
a.cc:10:6: error: no match for 'operator>>' (operand types are 'std::istream' {aka 'std::basic_istream<char>'} and 'std::vector<std::__cxx11::basic_string<char> >')
10 | cin>>number;
| ~~~^~~~~~~~
| | |
| | std::vector<std::__cxx11::basic_string<char> >
| std::istream {aka std::basic_istream<char>}
In file included from /usr/include/c++/14/sstream:40,
from /usr/include/c++/14/complex:45,
from /usr/include/c++/14/ccomplex:39,
from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:127,
from a.cc:1:
/usr/include/c++/14/istream:170:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(bool&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]'
170 | operator>>(bool& __n)
| ^~~~~~~~
/usr/include/c++/14/istream:170:24: note: no known conversion for argument 1 from 'std::vector<std::__cxx11::basic_string<char> >' to 'bool&'
170 | operator>>(bool& __n)
| ~~~~~~^~~
/usr/include/c++/14/istream:174:7: note: candidate: 'std::basic_istream<_CharT, _Traits>& std::basic_istream<_CharT, _Traits>::operator>>(short int&) [with _CharT = char; _Traits = std::char_traits<char>]'
174 | operator>>(short& __n);
| ^~~~~~~~
/usr/include/c++/14/istream:174:25: note: no known conversion for argument 1 from 'std::vector<std::__cxx11::basic_string<char> >' to 'short int&'
174 | operator>>(short& __n);
| ~~~~~~~^~~
/usr/include/c++/14/istream:177:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(short unsigned int&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]'
177 | operator>>(unsigned short& __n)
| ^~~~~~~~
/usr/include/c++/14/istream:177:34: note: no known conversion for argument 1 from 'std::vector<std::__cxx11::basic_string<char> >' to 'short unsigned int&'
177 | operator>>(unsigned short& __n)
| ~~~~~~~~~~~~~~~~^~~
/usr/include/c++/14/istream:181:7: note: candidate: 'std::basic_istream<_CharT, _Traits>& std::basic_istream<_CharT, _Traits>::operator>>(int&) [with _CharT = char; _Traits = std::char_traits<char>]'
181 | operator>>(int& __n);
| ^~~~~~~~
/usr/include/c++/14/istream:181:23: note: no known conversion for argument 1 from 'std::vector<std::__cxx11::basic_string<char> >' to 'int&'
181 | operator>>(int& __n);
| ~~~~~^~~
/usr/include/c++/14/istream:184:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(unsigned int&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]'
184 | operator>>(unsigned int& __n)
| ^~~~~~~~
/usr/include/c++/14/istream:184:32: note: no known conversion for argument 1 from 'std::vector<std::__cxx11::basic_string<char> >' to 'unsigned int&'
184 | operator>>(unsigned int& __n)
| ~~~~~~~~~~~~~~^~~
/usr/include/c++/14/istream:188:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(long int&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]'
188 | operator>>(long& __n)
| ^~~~~~~~
/usr/include/c++/14/istream:188:24: note: no known conversion for argument 1 from 'std::vector<std::__cxx11::basic_string<char> >' to 'long int&'
188 | operator>>(long& __n)
| ~~~~~~^~~
/usr/include/c++/14/istream:192:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(long unsigned int&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]'
192 | operator>>(unsigned long& __n)
| ^~~~~~~~
/usr/include/c++/14/istream:192:33: note: no known conversion for argument 1 from 'std::vector<std::__cxx11::basic_string<char> >' to 'long unsigned int&'
192 | operator>>(unsigned long& __n)
| ~~~~~~~~~~~~~~~^~~
/usr/include/c++/14/istream:199: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>]'
199 | operator>>(long long& __n)
| ^~~~~~~~
/usr/include/c++/14/istream:199:29: note: no known conversion for argument 1 from 'std::vector<std::__cxx11::basic_string<char> >' to 'long long int&'
199 | operator>>(long long& __n)
| ~~~~~~~~~~~^~~
/usr/include/c++/14/istream:203: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>]'
203 | operator>>(unsigned long long& __n)
| ^~~~~~~~
/usr/include/c++/14/istream:203:38: note: no known conversion for argument 1 from 'std::vector<std::__cxx11::basic_string<char> >' to 'long long unsigned int&'
203 | operator>>(unsigned long long& __n)
| ~~~~~~~~~~~~~~~~~~~~^~~
/usr/include/c++/14/istream:219:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(float&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]'
219 | operator>>(float& __f)
| ^~~~~~~~
/usr/include/c++/14/istream:219:25: note: no known conversion for argument 1 from 'std::vector<std::__cxx11::basic_string<char> >' to 'float&'
219 | operator>>(float& __f)
| ~~~~~~~^~~
/usr/include/c++/14/istream:223:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(double&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]'
223 | operator>>(double& __f)
| ^~~~~~~~
/usr/include/c++/14/istream:223:26: note: no known conversion for argument 1 from 'std::vector<std::__cxx11::basic_string<char> >' to 'double&'
223 | operator>>(double& __f)
| ~~~~~~~~^~~
/usr/include/c++/14/istream:227:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(long double&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]'
227 | operator>>(long double& __f)
| ^~~~~~~~
/usr/include/c++/14/istream:227:31: note: no known conversion for argument 1 from 'std::vector<std::__cxx11::basic_string<char> >' to 'long double&'
227 | operator>>(long double& __f)
| ~~~~~~~~~~~~~^~~
/usr/include/c++/14/istream:328: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>]'
328 | operator>>(void*& __p)
| ^~~~~~~~
/usr/include/c++/14/istream:328:25: note: no known conversion for argument 1 from 'std::vector<std::__cxx11::basic_string<char> >' to 'void*&'
328 | operator>>(void*& __p)
| ~~~~~~~^~~
/usr/include/c++/14/istream:122:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(__istream_type& (*)(__istream_type&)) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]'
122 | operator>>(__istream_type& (*__pf)(__istream_type&))
| ^~~~~~~~
/usr/include/c++/14/istream:122:36: note: no known conversion for argument 1 from 'std::vector<std::__cxx11::basic_string<char> >' to 'std::basic_istream<char>::__istream_type& (*)(std::basic_istream<char>::__istream_type&)' {aka 'std::basic_istream<char>& (*)(std::basic_istream<char>&)'}
122 | operator>>(__istream_type& (*__pf)(__istream_type&))
| ~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~
/usr/include/c++/14/istream:126:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(__ios_type& (*)(__ios_type&)) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>; __ios_type = std::basic_ios<char>]'
126 | operator>>(__ios_type& (*__pf)(__ios_type&))
| ^~~~~~~~
/usr/include/c++/14/istream:126:32: note: no known conversion for argument 1 from 'std::vector<std::__cxx11::basic_string<char> >' to 'std::basic_istream<char>::__ios_type& (*)(std::basic_istream<char>::__ios_type&)' {aka 'std::basic_ios<char>& (*)(std::basic_ios<char>&)'}
126 | operator>>(__ios_type& (*__pf)(__ios_type&))
| ~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~
/usr/include/c++/14/istream:133:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(std::ios_base& (*)(std::ios_base&)) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]'
133 | operator>>(ios_base& (*__pf)(ios_base&))
| ^~~~~~~~
/usr/include/c++/14/istream:133:30: note: no known conversion for argument 1 from 'std::vector<std::__cxx11::basic_string<char> >' to 'std::ios_base& (*)(std::ios_base&)'
133 | operator>>(ios_base& (*__pf)(ios_base&))
| ~~~~~~~~~~~~^~~~~~~~~~~~~~~~
/usr/include/c++/14/istream:352:7: note: candidate: 'std::basic_istream<_CharT, _Traits>& std::basic_istream<_CharT, _Traits>::operator>>(__streambuf_type*) [with _CharT = char; _Traits
|
s352801899
|
p03971
|
C++
|
#include <bits/stdc++.h>
using namespace std;
int main() {
vector<string> number;
vector<string> gokaku;
int A,B,N;
int Bcount=1;
cin>>N>>A>>B;
cin>>number;
number.push_back(X);
for(int i=0;i<N;i++){
if(number.at(i)=="a"){
if(i<=(A+B)){
gokaku.push_back("Yes");
}
if(i>(A+B)){
gokaku.push_back("No");
}
}
if(number.at(i)=="b"){
if(i<=(A+B)){
if(i<=Bcount){
gokaku.push_back("Yes");
Bcount++;
}
}
else{
gokaku.push_back("No");
}
}
if(number.at(i)=="c"){
gokaku.push_back("No");
}
}
for(int i=0;i<N;i++){
cout<<gokaku.at(i)<<endl;
}
}
|
a.cc: In function 'int main()':
a.cc:10:6: error: no match for 'operator>>' (operand types are 'std::istream' {aka 'std::basic_istream<char>'} and 'std::vector<std::__cxx11::basic_string<char> >')
10 | cin>>number;
| ~~~^~~~~~~~
| | |
| | std::vector<std::__cxx11::basic_string<char> >
| std::istream {aka std::basic_istream<char>}
In file included from /usr/include/c++/14/sstream:40,
from /usr/include/c++/14/complex:45,
from /usr/include/c++/14/ccomplex:39,
from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:127,
from a.cc:1:
/usr/include/c++/14/istream:170:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(bool&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]'
170 | operator>>(bool& __n)
| ^~~~~~~~
/usr/include/c++/14/istream:170:24: note: no known conversion for argument 1 from 'std::vector<std::__cxx11::basic_string<char> >' to 'bool&'
170 | operator>>(bool& __n)
| ~~~~~~^~~
/usr/include/c++/14/istream:174:7: note: candidate: 'std::basic_istream<_CharT, _Traits>& std::basic_istream<_CharT, _Traits>::operator>>(short int&) [with _CharT = char; _Traits = std::char_traits<char>]'
174 | operator>>(short& __n);
| ^~~~~~~~
/usr/include/c++/14/istream:174:25: note: no known conversion for argument 1 from 'std::vector<std::__cxx11::basic_string<char> >' to 'short int&'
174 | operator>>(short& __n);
| ~~~~~~~^~~
/usr/include/c++/14/istream:177:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(short unsigned int&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]'
177 | operator>>(unsigned short& __n)
| ^~~~~~~~
/usr/include/c++/14/istream:177:34: note: no known conversion for argument 1 from 'std::vector<std::__cxx11::basic_string<char> >' to 'short unsigned int&'
177 | operator>>(unsigned short& __n)
| ~~~~~~~~~~~~~~~~^~~
/usr/include/c++/14/istream:181:7: note: candidate: 'std::basic_istream<_CharT, _Traits>& std::basic_istream<_CharT, _Traits>::operator>>(int&) [with _CharT = char; _Traits = std::char_traits<char>]'
181 | operator>>(int& __n);
| ^~~~~~~~
/usr/include/c++/14/istream:181:23: note: no known conversion for argument 1 from 'std::vector<std::__cxx11::basic_string<char> >' to 'int&'
181 | operator>>(int& __n);
| ~~~~~^~~
/usr/include/c++/14/istream:184:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(unsigned int&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]'
184 | operator>>(unsigned int& __n)
| ^~~~~~~~
/usr/include/c++/14/istream:184:32: note: no known conversion for argument 1 from 'std::vector<std::__cxx11::basic_string<char> >' to 'unsigned int&'
184 | operator>>(unsigned int& __n)
| ~~~~~~~~~~~~~~^~~
/usr/include/c++/14/istream:188:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(long int&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]'
188 | operator>>(long& __n)
| ^~~~~~~~
/usr/include/c++/14/istream:188:24: note: no known conversion for argument 1 from 'std::vector<std::__cxx11::basic_string<char> >' to 'long int&'
188 | operator>>(long& __n)
| ~~~~~~^~~
/usr/include/c++/14/istream:192:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(long unsigned int&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]'
192 | operator>>(unsigned long& __n)
| ^~~~~~~~
/usr/include/c++/14/istream:192:33: note: no known conversion for argument 1 from 'std::vector<std::__cxx11::basic_string<char> >' to 'long unsigned int&'
192 | operator>>(unsigned long& __n)
| ~~~~~~~~~~~~~~~^~~
/usr/include/c++/14/istream:199: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>]'
199 | operator>>(long long& __n)
| ^~~~~~~~
/usr/include/c++/14/istream:199:29: note: no known conversion for argument 1 from 'std::vector<std::__cxx11::basic_string<char> >' to 'long long int&'
199 | operator>>(long long& __n)
| ~~~~~~~~~~~^~~
/usr/include/c++/14/istream:203: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>]'
203 | operator>>(unsigned long long& __n)
| ^~~~~~~~
/usr/include/c++/14/istream:203:38: note: no known conversion for argument 1 from 'std::vector<std::__cxx11::basic_string<char> >' to 'long long unsigned int&'
203 | operator>>(unsigned long long& __n)
| ~~~~~~~~~~~~~~~~~~~~^~~
/usr/include/c++/14/istream:219:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(float&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]'
219 | operator>>(float& __f)
| ^~~~~~~~
/usr/include/c++/14/istream:219:25: note: no known conversion for argument 1 from 'std::vector<std::__cxx11::basic_string<char> >' to 'float&'
219 | operator>>(float& __f)
| ~~~~~~~^~~
/usr/include/c++/14/istream:223:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(double&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]'
223 | operator>>(double& __f)
| ^~~~~~~~
/usr/include/c++/14/istream:223:26: note: no known conversion for argument 1 from 'std::vector<std::__cxx11::basic_string<char> >' to 'double&'
223 | operator>>(double& __f)
| ~~~~~~~~^~~
/usr/include/c++/14/istream:227:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(long double&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]'
227 | operator>>(long double& __f)
| ^~~~~~~~
/usr/include/c++/14/istream:227:31: note: no known conversion for argument 1 from 'std::vector<std::__cxx11::basic_string<char> >' to 'long double&'
227 | operator>>(long double& __f)
| ~~~~~~~~~~~~~^~~
/usr/include/c++/14/istream:328: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>]'
328 | operator>>(void*& __p)
| ^~~~~~~~
/usr/include/c++/14/istream:328:25: note: no known conversion for argument 1 from 'std::vector<std::__cxx11::basic_string<char> >' to 'void*&'
328 | operator>>(void*& __p)
| ~~~~~~~^~~
/usr/include/c++/14/istream:122:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(__istream_type& (*)(__istream_type&)) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]'
122 | operator>>(__istream_type& (*__pf)(__istream_type&))
| ^~~~~~~~
/usr/include/c++/14/istream:122:36: note: no known conversion for argument 1 from 'std::vector<std::__cxx11::basic_string<char> >' to 'std::basic_istream<char>::__istream_type& (*)(std::basic_istream<char>::__istream_type&)' {aka 'std::basic_istream<char>& (*)(std::basic_istream<char>&)'}
122 | operator>>(__istream_type& (*__pf)(__istream_type&))
| ~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~
/usr/include/c++/14/istream:126:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(__ios_type& (*)(__ios_type&)) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>; __ios_type = std::basic_ios<char>]'
126 | operator>>(__ios_type& (*__pf)(__ios_type&))
| ^~~~~~~~
/usr/include/c++/14/istream:126:32: note: no known conversion for argument 1 from 'std::vector<std::__cxx11::basic_string<char> >' to 'std::basic_istream<char>::__ios_type& (*)(std::basic_istream<char>::__ios_type&)' {aka 'std::basic_ios<char>& (*)(std::basic_ios<char>&)'}
126 | operator>>(__ios_type& (*__pf)(__ios_type&))
| ~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~
/usr/include/c++/14/istream:133:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(std::ios_base& (*)(std::ios_base&)) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]'
133 | operator>>(ios_base& (*__pf)(ios_base&))
| ^~~~~~~~
/usr/include/c++/14/istream:133:30: note: no known conversion for argument 1 from 'std::vector<std::__cxx11::basic_string<char> >' to 'std::ios_base& (*)(std::ios_base&)'
133 | operator>>(ios_base& (*__pf)(ios_base&))
| ~~~~~~~~~~~~^~~~~~~~~~~~~~~~
/usr/include/c++/14/istream:352:7: note: candidate: 'std::basic_istream<_CharT, _Traits>& std::basic_istream<_CharT, _Traits>::operator>>(__streambuf_type*) [with _CharT = char; _Traits
|
s654611418
|
p03971
|
C++
|
#include <bits/stdc++.h>
using namespace std;
int main() {
vector<string> number;
vector<string> gokaku;
int A,B,N;
int Bcount=1;
cin>>N>>A>>B;
for(int i=0;i<N;i++){
string X;
cin>>X;
number.push_back(X);
}
for(int i=0;i<N;i++){
if(number.at(i)=='a'){
if(i<=(A+B)){
gokaku.push_back('Yes');
}
if(i>(A+B)){
gokaku.push_back('No');
}
}
if(number.at(i)=='b'){
if(i<=(A+B)){
if(i<=Bcount){
gokaku.push_back('Yes');
Bcount++;
}
}
else{
gokaku.push_back('No');
}
}
if(number.at(i)=='c'){
gokaku.push_back('No');
}
}
for(int i=0;i<N;i++){
cout<<gokaku.at(i)<<endl;
}
}
|
a.cc:18:26: warning: multi-character character constant [-Wmultichar]
18 | gokaku.push_back('Yes');
| ^~~~~
a.cc:21:26: warning: multi-character character constant [-Wmultichar]
21 | gokaku.push_back('No');
| ^~~~
a.cc:28:28: warning: multi-character character constant [-Wmultichar]
28 | gokaku.push_back('Yes');
| ^~~~~
a.cc:34:26: warning: multi-character character constant [-Wmultichar]
34 | gokaku.push_back('No');
| ^~~~
a.cc:39:24: warning: multi-character character constant [-Wmultichar]
39 | gokaku.push_back('No');
| ^~~~
a.cc: In function 'int main()':
a.cc:16:20: error: no match for 'operator==' (operand types are '__gnu_cxx::__alloc_traits<std::allocator<std::__cxx11::basic_string<char> >, std::__cxx11::basic_string<char> >::value_type' {aka 'std::__cxx11::basic_string<char>'} and 'char')
16 | if(number.at(i)=='a'){
| ~~~~~~~~~~~~^~~~~
| | |
| | char
| __gnu_cxx::__alloc_traits<std::allocator<std::__cxx11::basic_string<char> >, std::__cxx11::basic_string<char> >::value_type {aka std::__cxx11::basic_string<char>}
In file included from /usr/include/c++/14/regex:68,
from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:181,
from a.cc:1:
/usr/include/c++/14/bits/regex.h:1103:5: note: candidate: 'template<class _BiIter> bool std::__cxx11::operator==(const sub_match<_BiIter>&, const sub_match<_BiIter>&)'
1103 | operator==(const sub_match<_BiIter>& __lhs, const sub_match<_BiIter>& __rhs)
| ^~~~~~~~
/usr/include/c++/14/bits/regex.h:1103:5: note: template argument deduction/substitution failed:
a.cc:16:22: note: '__gnu_cxx::__alloc_traits<std::allocator<std::__cxx11::basic_string<char> >, std::__cxx11::basic_string<char> >::value_type' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::__cxx11::sub_match<_BiIter>'
16 | if(number.at(i)=='a'){
| ^~~
/usr/include/c++/14/bits/regex.h:1199:5: note: candidate: 'template<class _Bi_iter, class _Ch_traits, class _Ch_alloc> bool std::__cxx11::operator==(__sub_match_string<_Bi_iter, _Ch_traits, _Ch_alloc>&, const sub_match<_BiIter>&)'
1199 | operator==(const __sub_match_string<_Bi_iter, _Ch_traits, _Ch_alloc>& __lhs,
| ^~~~~~~~
/usr/include/c++/14/bits/regex.h:1199:5: note: template argument deduction/substitution failed:
a.cc:16:22: note: mismatched types 'const std::__cxx11::sub_match<_BiIter>' and 'char'
16 | if(number.at(i)=='a'){
| ^~~
/usr/include/c++/14/bits/regex.h:1274:5: note: candidate: 'template<class _Bi_iter, class _Ch_traits, class _Ch_alloc> bool std::__cxx11::operator==(const sub_match<_BiIter>&, __sub_match_string<_Bi_iter, _Ch_traits, _Ch_alloc>&)'
1274 | operator==(const sub_match<_Bi_iter>& __lhs,
| ^~~~~~~~
/usr/include/c++/14/bits/regex.h:1274:5: note: template argument deduction/substitution failed:
a.cc:16:22: note: '__gnu_cxx::__alloc_traits<std::allocator<std::__cxx11::basic_string<char> >, std::__cxx11::basic_string<char> >::value_type' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::__cxx11::sub_match<_BiIter>'
16 | if(number.at(i)=='a'){
| ^~~
/usr/include/c++/14/bits/regex.h:1366:5: note: candidate: 'template<class _Bi_iter> bool std::__cxx11::operator==(const typename std::iterator_traits<_Iter>::value_type*, const sub_match<_BiIter>&)'
1366 | operator==(typename iterator_traits<_Bi_iter>::value_type const* __lhs,
| ^~~~~~~~
/usr/include/c++/14/bits/regex.h:1366:5: note: template argument deduction/substitution failed:
a.cc:16:22: note: mismatched types 'const std::__cxx11::sub_match<_BiIter>' and 'char'
16 | if(number.at(i)=='a'){
| ^~~
/usr/include/c++/14/bits/regex.h:1441:5: note: candidate: 'template<class _Bi_iter> bool std::__cxx11::operator==(const sub_match<_BiIter>&, const typename std::iterator_traits<_Iter>::value_type*)'
1441 | operator==(const sub_match<_Bi_iter>& __lhs,
| ^~~~~~~~
/usr/include/c++/14/bits/regex.h:1441:5: note: template argument deduction/substitution failed:
a.cc:16:22: note: '__gnu_cxx::__alloc_traits<std::allocator<std::__cxx11::basic_string<char> >, std::__cxx11::basic_string<char> >::value_type' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::__cxx11::sub_match<_BiIter>'
16 | if(number.at(i)=='a'){
| ^~~
/usr/include/c++/14/bits/regex.h:1534:5: note: candidate: 'template<class _Bi_iter> bool std::__cxx11::operator==(const typename std::iterator_traits<_Iter>::value_type&, const sub_match<_BiIter>&)'
1534 | operator==(typename iterator_traits<_Bi_iter>::value_type const& __lhs,
| ^~~~~~~~
/usr/include/c++/14/bits/regex.h:1534:5: note: template argument deduction/substitution failed:
a.cc:16:22: note: mismatched types 'const std::__cxx11::sub_match<_BiIter>' and 'char'
16 | if(number.at(i)=='a'){
| ^~~
/usr/include/c++/14/bits/regex.h:1613:5: note: candidate: 'template<class _Bi_iter> bool std::__cxx11::operator==(const sub_match<_BiIter>&, const typename std::iterator_traits<_Iter>::value_type&)'
1613 | operator==(const sub_match<_Bi_iter>& __lhs,
| ^~~~~~~~
/usr/include/c++/14/bits/regex.h:1613:5: note: template argument deduction/substitution failed:
a.cc:16:22: note: '__gnu_cxx::__alloc_traits<std::allocator<std::__cxx11::basic_string<char> >, std::__cxx11::basic_string<char> >::value_type' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::__cxx11::sub_match<_BiIter>'
16 | if(number.at(i)=='a'){
| ^~~
/usr/include/c++/14/bits/regex.h:2186:5: note: candidate: 'template<class _Bi_iter, class _Alloc> bool std::__cxx11::operator==(const match_results<_BiIter, _Alloc>&, const match_results<_BiIter, _Alloc>&)'
2186 | operator==(const match_results<_Bi_iter, _Alloc>& __m1,
| ^~~~~~~~
/usr/include/c++/14/bits/regex.h:2186:5: note: template argument deduction/substitution failed:
a.cc:16:22: note: '__gnu_cxx::__alloc_traits<std::allocator<std::__cxx11::basic_string<char> >, std::__cxx11::basic_string<char> >::value_type' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::__cxx11::match_results<_BiIter, _Alloc>'
16 | if(number.at(i)=='a'){
| ^~~
In file included from /usr/include/c++/14/bits/stl_algobase.h:64,
from /usr/include/c++/14/algorithm:60,
from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:51:
/usr/include/c++/14/bits/stl_pair.h:1033:5: note: candidate: 'template<class _T1, class _T2> constexpr bool std::operator==(const pair<_T1, _T2>&, const pair<_T1, _T2>&)'
1033 | operator==(const pair<_T1, _T2>& __x, const pair<_T1, _T2>& __y)
| ^~~~~~~~
/usr/include/c++/14/bits/stl_pair.h:1033:5: note: template argument deduction/substitution failed:
a.cc:16:22: note: '__gnu_cxx::__alloc_traits<std::allocator<std::__cxx11::basic_string<char> >, std::__cxx11::basic_string<char> >::value_type' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::pair<_T1, _T2>'
16 | if(number.at(i)=='a'){
| ^~~
In file included from /usr/include/c++/14/bits/stl_algobase.h:67:
/usr/include/c++/14/bits/stl_iterator.h:441:5: note: candidate: 'template<class _Iterator> constexpr bool std::operator==(const reverse_iterator<_Iterator>&, const reverse_iterator<_Iterator>&)'
441 | operator==(const reverse_iterator<_Iterator>& __x,
| ^~~~~~~~
/usr/include/c++/14/bits/stl_iterator.h:441:5: note: template argument deduction/substitution failed:
a.cc:16:22: note: '__gnu_cxx::__alloc_traits<std::allocator<std::__cxx11::basic_string<char> >, std::__cxx11::basic_string<char> >::value_type' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::reverse_iterator<_Iterator>'
16 | if(number.at(i)=='a'){
| ^~~
/usr/include/c++/14/bits/stl_iterator.h:486:5: note: candidate: 'template<class _IteratorL, class _IteratorR> constexpr bool std::operator==(const reverse_iterator<_Iterator>&, const reverse_iterator<_IteratorR>&)'
486 | operator==(const reverse_iterator<_IteratorL>& __x,
| ^~~~~~~~
/usr/include/c++/14/bits/stl_iterator.h:486:5: note: template argument deduction/substitution failed:
a.cc:16:22: note: '__gnu_cxx::__alloc_traits<std::allocator<std::__cxx11::basic_string<char> >, std::__cxx11::basic_string<char> >::value_type' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::reverse_iterator<_Iterator>'
16 | if(number.at(i)=='a'){
| ^~~
/usr/include/c++/14/bits/stl_iterator.h:1667:5: note: candidate: 'template<class _IteratorL, class _IteratorR> constexpr bool std::operator==(const move_iterator<_IteratorL>&, const move_iterator<_IteratorR>&)'
1667 | operator==(const move_iterator<_IteratorL>& __x,
| ^~~~~~~~
/usr/include/c++/14/bits/stl_iterator.h:1667:5: note: template argument deduction/substitution failed:
a.cc:16:22: note: '__gnu_cxx::__alloc_traits<std::allocator<std::__cxx11::basic_string<char> >, std::__cxx11::basic_string<char> >::value_type' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::move_iterator<_IteratorL>'
16 | if(number.at(i)=='a'){
| ^~~
/usr/include/c++/14/bits/stl_iterator.h:1737:5: note: candidate: 'template<class _Iterator> constexpr bool std::operator==(const move_iterator<_IteratorL>&, const move_iterator<_IteratorL>&)'
1737 | operator==(const move_iterator<_Iterator>& __x,
| ^~~~~~~~
/usr/include/c++/14/bits/stl_iterator.h:1737:5: note: template argument deduction/substitution failed:
a.cc:16:22: note: '__gnu_cxx::__alloc_traits<std::allocator<
|
s348745233
|
p03971
|
C++
|
#include <bits/stdc++.h>
using namespace std;
int main() {
vector<string> number;
vector<string> gokaku;
int A,B,N;
int Bcount=1;
cin>>A>>B>>N;
for(int i=0;i<N;i++){
string X;
cin>>X;
number.push_back(X);
}
for(int i=0;i<N;i++){
if(number.at(i)=="a"){
if(i<=(A+B)){
gokaku.push_back("Yes");
}
if(i>(A+B)){
gokaku.push_back("No");
}
}
if(number.at(i)=="b"){
if(i<=(A+B)){
if(i<=Bcount){
gokaku.push_back("Yes");
Bcount++;
}
}
else{
gokaku.push_back("No");
}
}
if(number.at(i)=="c"){
gokaku.push_back("No");
}
}
for(int i==0;i<N;i++){
cout<<gokaku.at(i)<<endl;
}
}
|
a.cc: In function 'int main()':
a.cc:43:12: error: expected ';' before '==' token
43 | for(int i==0;i<N;i++){
| ^~
| ;
a.cc:43:12: error: expected primary-expression before '==' token
43 | for(int i==0;i<N;i++){
| ^~
a.cc:43:19: error: expected ')' before ';' token
43 | for(int i==0;i<N;i++){
| ~ ^
| )
a.cc:43:20: error: 'i' was not declared in this scope
43 | for(int i==0;i<N;i++){
| ^
|
s540923603
|
p03971
|
C++
|
#include <bits/stdc++.h>
using namespace std;
int main() {
vector<string> number;
vector<string> gokaku;
int A,B,N;
int Bcount=1;
cin>>A>B>>N;
for(int i=0;i<N;i++){
string X;
cin>>X;
number.push_back(X);
}
for(int i=0;i<N;i++){
if(number.at(i)=="a"){
if(i<=(A+B)){
gokaku.push_back("Yes");
}
if(i>(A+B)){
gokaku.push_back("No");
}
}
if(number.at(i)=="b"){
if(i<=(A+B)){
if(i<=Bcount){
gokaku.push_back("Yes");
Bcount++;
}
}
else{
gokaku.push_back("No");
}
}
if(number.at(i)=="c"){
gokaku.push_back("No");
}
}
for(int i==0;i<N;i++){
cout<<gokaku.at(i)<<endl;
}
}
|
a.cc: In function 'int main()':
a.cc:9:9: error: no match for 'operator>' (operand types are 'std::basic_istream<char>::__istream_type' {aka 'std::basic_istream<char>'} and 'int')
9 | cin>>A>B>>N;
| ~~~~~~^~~~~
| | |
| | int
| std::basic_istream<char>::__istream_type {aka std::basic_istream<char>}
a.cc:9:9: note: candidate: 'operator>(int, int)' (built-in)
9 | cin>>A>B>>N;
| ~~~~~~^~~~~
a.cc:9:9: note: no known conversion for argument 1 from 'std::basic_istream<char>::__istream_type' {aka 'std::basic_istream<char>'} to 'int'
In file included from /usr/include/c++/14/regex:68,
from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:181,
from a.cc:1:
/usr/include/c++/14/bits/regex.h:1176:5: note: candidate: 'template<class _BiIter> bool std::__cxx11::operator>(const sub_match<_BiIter>&, const sub_match<_BiIter>&)'
1176 | operator>(const sub_match<_BiIter>& __lhs, const sub_match<_BiIter>& __rhs)
| ^~~~~~~~
/usr/include/c++/14/bits/regex.h:1176:5: note: template argument deduction/substitution failed:
a.cc:9:13: note: 'std::basic_istream<char>::__istream_type' {aka 'std::basic_istream<char>'} is not derived from 'const std::__cxx11::sub_match<_BiIter>'
9 | cin>>A>B>>N;
| ^
/usr/include/c++/14/bits/regex.h:1236:5: note: candidate: 'template<class _Bi_iter, class _Ch_traits, class _Ch_alloc> bool std::__cxx11::operator>(__sub_match_string<_Bi_iter, _Ch_traits, _Ch_alloc>&, const sub_match<_BiIter>&)'
1236 | operator>(const __sub_match_string<_Bi_iter, _Ch_traits, _Ch_alloc>& __lhs,
| ^~~~~~~~
/usr/include/c++/14/bits/regex.h:1236:5: note: template argument deduction/substitution failed:
a.cc:9:13: note: 'std::basic_istream<char>::__istream_type' {aka 'std::basic_istream<char>'} is not derived from 'std::__cxx11::__sub_match_string<_Bi_iter, _Ch_traits, _Ch_alloc>'
9 | cin>>A>B>>N;
| ^
/usr/include/c++/14/bits/regex.h:1329:5: note: candidate: 'template<class _Bi_iter, class _Ch_traits, class _Ch_alloc> bool std::__cxx11::operator>(const sub_match<_BiIter>&, __sub_match_string<_Bi_iter, _Ch_traits, _Ch_alloc>&)'
1329 | operator>(const sub_match<_Bi_iter>& __lhs,
| ^~~~~~~~
/usr/include/c++/14/bits/regex.h:1329:5: note: template argument deduction/substitution failed:
a.cc:9:13: note: 'std::basic_istream<char>::__istream_type' {aka 'std::basic_istream<char>'} is not derived from 'const std::__cxx11::sub_match<_BiIter>'
9 | cin>>A>B>>N;
| ^
/usr/include/c++/14/bits/regex.h:1403:5: note: candidate: 'template<class _Bi_iter> bool std::__cxx11::operator>(const typename std::iterator_traits<_Iter>::value_type*, const sub_match<_BiIter>&)'
1403 | operator>(typename iterator_traits<_Bi_iter>::value_type const* __lhs,
| ^~~~~~~~
/usr/include/c++/14/bits/regex.h:1403:5: note: template argument deduction/substitution failed:
a.cc:9:13: note: mismatched types 'const std::__cxx11::sub_match<_BiIter>' and 'int'
9 | cin>>A>B>>N;
| ^
/usr/include/c++/14/bits/regex.h:1497:5: note: candidate: 'template<class _Bi_iter> bool std::__cxx11::operator>(const sub_match<_BiIter>&, const typename std::iterator_traits<_Iter>::value_type*)'
1497 | operator>(const sub_match<_Bi_iter>& __lhs,
| ^~~~~~~~
/usr/include/c++/14/bits/regex.h:1497:5: note: template argument deduction/substitution failed:
a.cc:9:13: note: 'std::basic_istream<char>::__istream_type' {aka 'std::basic_istream<char>'} is not derived from 'const std::__cxx11::sub_match<_BiIter>'
9 | cin>>A>B>>N;
| ^
/usr/include/c++/14/bits/regex.h:1573:5: note: candidate: 'template<class _Bi_iter> bool std::__cxx11::operator>(const typename std::iterator_traits<_Iter>::value_type&, const sub_match<_BiIter>&)'
1573 | operator>(typename iterator_traits<_Bi_iter>::value_type const& __lhs,
| ^~~~~~~~
/usr/include/c++/14/bits/regex.h:1573:5: note: template argument deduction/substitution failed:
a.cc:9:13: note: mismatched types 'const std::__cxx11::sub_match<_BiIter>' and 'int'
9 | cin>>A>B>>N;
| ^
/usr/include/c++/14/bits/regex.h:1673:5: note: candidate: 'template<class _Bi_iter> bool std::__cxx11::operator>(const sub_match<_BiIter>&, const typename std::iterator_traits<_Iter>::value_type&)'
1673 | operator>(const sub_match<_Bi_iter>& __lhs,
| ^~~~~~~~
/usr/include/c++/14/bits/regex.h:1673:5: note: template argument deduction/substitution failed:
a.cc:9:13: note: 'std::basic_istream<char>::__istream_type' {aka 'std::basic_istream<char>'} is not derived from 'const std::__cxx11::sub_match<_BiIter>'
9 | cin>>A>B>>N;
| ^
In file included from /usr/include/c++/14/bits/stl_algobase.h:64,
from /usr/include/c++/14/algorithm:60,
from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:51:
/usr/include/c++/14/bits/stl_pair.h:1058:5: note: candidate: 'template<class _T1, class _T2> constexpr bool std::operator>(const pair<_T1, _T2>&, const pair<_T1, _T2>&)'
1058 | operator>(const pair<_T1, _T2>& __x, const pair<_T1, _T2>& __y)
| ^~~~~~~~
/usr/include/c++/14/bits/stl_pair.h:1058:5: note: template argument deduction/substitution failed:
a.cc:9:13: note: 'std::basic_istream<char>::__istream_type' {aka 'std::basic_istream<char>'} is not derived from 'const std::pair<_T1, _T2>'
9 | cin>>A>B>>N;
| ^
In file included from /usr/include/c++/14/bits/stl_algobase.h:67:
/usr/include/c++/14/bits/stl_iterator.h:462:5: note: candidate: 'template<class _Iterator> constexpr bool std::operator>(const reverse_iterator<_Iterator>&, const reverse_iterator<_Iterator>&)'
462 | operator>(const reverse_iterator<_Iterator>& __x,
| ^~~~~~~~
/usr/include/c++/14/bits/stl_iterator.h:462:5: note: template argument deduction/substitution failed:
a.cc:9:13: note: 'std::basic_istream<char>::__istream_type' {aka 'std::basic_istream<char>'} is not derived from 'const std::reverse_iterator<_Iterator>'
9 | cin>>A>B>>N;
| ^
/usr/include/c++/14/bits/stl_iterator.h:507:5: note: candidate: 'template<class _IteratorL, class _IteratorR> constexpr bool std::operator>(const reverse_iterator<_Iterator>&, const reverse_iterator<_IteratorR>&)'
507 | operator>(const reverse_iterator<_IteratorL>& __x,
| ^~~~~~~~
/usr/include/c++/14/bits/stl_iterator.h:507:5: note: template argument deduction/substitution failed:
a.cc:9:13: note: 'std::basic_istream<char>::__istream_type' {aka 'std::basic_istream<char>'} is not derived from 'const std::reverse_iterator<_Iterator>'
9 | cin>>A>B>>N;
| ^
/usr/include/c++/14/bits/stl_iterator.h:1714:5: note: candidate: 'template<class _IteratorL, class _IteratorR> constexpr bool std::operator>(const move_iterator<_IteratorL>&, const move_iterator<_IteratorR>&)'
1714 | operator>(const move_iterator<_IteratorL>& __x,
| ^~~~~~~~
/usr/include/c++/14/bits/stl_iterator.h:1714:5: note: template argument deduction/substitution failed:
a.cc:9:13: note: 'std::basic_istream<char>::__istream_type' {aka 'std::basic_istream<char>'} is not derived from 'const std::move_iterator<_IteratorL>'
9 | cin>>A>B>>N;
| ^
/usr/include/c++/14/bits/stl_iterator.h:1774:5: note: candidate: 'template<class _Iterator> constexpr bool std::operator>(const move_iterator<_IteratorL>&, const move_iterator<_IteratorL>&)'
1774 | operator>(const move_iterator<_Iterator>& __x,
| ^~~~~~~~
/usr/include/c++/14/bits/stl_iterator.h:1774:5: note: template argument deduction/substitution failed:
a.cc:9:13: note: 'std::basic_istream<char>::__istream_type' {aka 'std::basic_istream<char>'} is not derived from 'const std::move_iterator<_IteratorL>'
9 | cin>>A>B>>N;
| ^
In file included from /usr/include/c++/14/bits/basic_string.h:47,
from /usr/include/c++/14/string:54,
from /usr/include/c++/14/bitset:52,
from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:52:
/usr/include/c++/14/string_view:695:5: note: candidate: 'template<class _CharT, class _Traits> constexpr bool std::operator>(basic_string_view<_CharT, _Traits>, basic_string_view<_CharT, _Traits>)'
695 | operator> (basic_string_view<_CharT, _Traits> __x,
| ^~~~~~~~
/usr/include/c++/14/string_view:695:5: note: template argument deduction/substitution failed:
a.cc:9:13: note: 'std::basic_istream<char>' is not derived from 'std::basic_string_view<_CharT, _Traits>'
9 | cin>>A>B>>N;
| ^
/usr/include/c++/14/string_view:702:5: note: candidate: 'template<class _CharT, class _Traits> constexpr bool std::operator>(basic_string_view<_CharT, _Traits>, __type_identity_t<basic_string_view<_CharT, _Traits> >)'
702 | operator> (basic_string_view<_CharT, _Traits> __x,
| ^~~~~~~~
/usr/include/c++/14/string_view:702:5: note: template argument deduction/substitution failed:
a.cc:9:13: note: 'std::basic_istream<char>' is not derived from 'std::basic_string_view<_CharT, _Traits>'
9 | cin>>A>B>>N;
| ^
/usr/include/c++/14/string_view:710:5: note: candidate: 'template<class _CharT, class _Traits> constexpr bool std::operator>(__type_identity_t<basic_string_view<_CharT, _Traits> >, basic_string_view<_CharT, _Traits>)'
710 | operator> (__type_identity_t<basic_string_view<_CharT, _Traits>> __x,
| ^~~~~~~~
/usr/include/c++/14/string_view:710:5: note: template argument deduction/substitution failed:
a.cc:9:13: note: mismatched types 'std::basic_string_view<_CharT, _Traits>' and 'int'
9 | cin>>A>B>>N;
| ^
/usr/include/c++/14/bits/basic_string.h:3915:5: note: candidate: 'template<class _CharT, class _Traits, class _Alloc> bool std::operator>(const __cxx11::basic_string<_CharT, _Traits, _Allocator>&, const __cxx11::basic_string<_CharT, _Traits, _Allocator>&)'
3915 | operator>(const basic_string<_CharT, _Traits, _Alloc>& __lhs,
| ^~~~~~~~
/usr/include/c
|
s924076951
|
p03971
|
C++
|
#include <stdio.h>
#include <iostream>
using namespace std;
using ll = long long;
int main(void) {
int N, A, B;
scanf("%d%d%d", &N, &A, &B);
string S;
cin >> S;
int passed = 0;
for (int i = 0; i < N; i++) {
char c = S.at(i);
if (c == 'a' && passed < A + B) {
passed++;
printf("Yes\n");
} else if (c == 'b' && passed < B) {
passed++;
printf("Yes\n");
} else {
printf("No\n", );
}
}
return 0;
}
|
a.cc: In function 'int main()':
a.cc:21:40: error: expected primary-expression before ')' token
21 | printf("No\n", );
| ^
|
s165786642
|
p03971
|
C++
|
#include<bits/stdc++.h>
using namespace std;
int main(){
int n,a,b,cnt=0,bnt=1;
string s,ans = "No";
cin n >> a >> b >>s;
vector<int>k;
for(int i = 0;i < n;i++){
asn = "false";
if(s[i] == 'a'){
if((a + b) > cnt){
cnt++;
ans = "Yes";
}
}
if(s[i] == 'b'){
if((a + b) > cnt && bnt >= i+1){
bnt++;
cnt++;
ans = "Yes";
}
}
cout << ans << endl;
}
}
|
a.cc: In function 'int main()':
a.cc:7:6: error: expected ';' before 'n'
7 | cin n >> a >> b >>s;
| ^~
| ;
a.cc:10:5: error: 'asn' was not declared in this scope; did you mean 'ans'?
10 | asn = "false";
| ^~~
| ans
|
s391100952
|
p03971
|
C++
|
#include <bits/stdc++.h>
using namespace std;
int main(){
long long n,a,b,pas=0; string s;
cin>>n>>a>>b;
cin>>s;
int foreign = 0;
for(long long i=0;i<s.length();i++)
{
if(s[i] == 'a'){
if(pas < a+b){
cout<<"Yes"<<endl;
pas++; }
else cout<<"No"<<endl;
}
else if(s[i] == 'b'){
if(pas < a+b && foreign<=b){
cout<<"Yes"<<endl;
pas++; }
else cout<<"No"<<endl;
|
a.cc: In function 'int main()':
a.cc:28:27: error: expected '}' at end of input
28 | else cout<<"No"<<endl;
| ^
a.cc:23:23: note: to match this '{'
23 | else if(s[i] == 'b'){
| ^
a.cc:28:27: error: expected '}' at end of input
28 | else cout<<"No"<<endl;
| ^
a.cc:15:2: note: to match this '{'
15 | {
| ^
a.cc:28:27: error: expected '}' at end of input
28 | else cout<<"No"<<endl;
| ^
a.cc:5:11: note: to match this '{'
5 | int main(){
| ^
|
s995051134
|
p03971
|
C++
|
#include <bits/stdc++.h>
using namespace std;
int main(){
long long n,a,b,pas=0; string s;
cin>>n>>a>>b;
cin>>s;
int foreign = 0;
for(long long i=0;i<s.length();i++)
{
if(s[i] == 'a'){
if(cnt < a+b){
cout<<"Yes"<<endl;
pas++; }
else cout<<"No"<<endl;
}
else if(s[i] == 'b'){
if(cnt < a+b && foreign<=b){
cout<<"Yes"<<endl;
pas++; }
else cout<<"No"<<endl;
foreign++;
}
else
cout<<"No"<<endl;
}
return 0;
}
|
a.cc: In function 'int main()':
a.cc:18:10: error: 'cnt' was not declared in this scope; did you mean 'int'?
18 | if(cnt < a+b){
| ^~~
| int
a.cc:25:8: error: 'cnt' was not declared in this scope; did you mean 'int'?
25 | if(cnt < a+b && foreign<=b){
| ^~~
| int
|
s413456011
|
p03971
|
C++
|
#include <iostream>
#include <string>
using namespace std;
int main() {
int N, A, B;
string S;
cin >> N >> A >> B;
cin >> S;
int pass = 0;
int passb = 0;
for(int i = 0; i < S.length; i++) {
if(S[i] == 'c') cout << "No" << endl;
else {
if(S[i] == 'a' && pass < (A + B)) {
pass++;
cout << "Yes" << endl;
} else if(S[i] == 'b' && pass < (A + B) && passb < B) {
pass++;
passb++;
cout << "Yes" << endl;
} else {
cout << "No" << endl;
}
}
}
return 0;
}
|
a.cc: In function 'int main()':
a.cc:12:24: error: invalid use of member function 'std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::size_type std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::length() const [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>; size_type = long unsigned int]' (did you forget the '()' ?)
12 | for(int i = 0; i < S.length; i++) {
| ~~^~~~~~
| ()
|
s716240707
|
p03971
|
C
|
#include <stdio.h>
int main(){
int honsen,honsenf,A,B,N;
scanf("%d %d %d",&N,&A,&B);
honsen = A + B;
honsenf = B;
char c;
for(int o=0;i<N;i++){
getchar(c);
if(c=='a'){
if(honsen > 0){
printf("Yes\n");
honsen--;
}else{
printf("No\n");
}
}else if(c == 'b'){
if(honsen > 0){
if(honsenf > 0){
printf("Yes\n");
honsenf--;
}else{
printf("No\n");
}
}else{
printf("No\n");
}
}else if(c == 'c'){
printf("No\n");
}
}
}
|
main.c: In function 'main':
main.c:9:21: error: 'i' undeclared (first use in this function)
9 | for(int o=0;i<N;i++){
| ^
main.c:9:21: note: each undeclared identifier is reported only once for each function it appears in
main.c:10:17: error: too many arguments to function 'getchar'
10 | getchar(c);
| ^~~~~~~
In file included from main.c:1:
/usr/include/stdio.h:582:12: note: declared here
582 | extern int getchar (void);
| ^~~~~~~
|
s525369632
|
p03971
|
C++
|
#include <bits/stdc++.h>
#define rng(i, a, b) for (int i = int(a); i < int(b); i++)
#define rep(i, b) rng(i, 0, b)
#define gnr(i, a, b) for (int i = int(b) - 1; i >= int(a); i--)
#define per(i, b) gnr(i, 0, b)
using namespace std;
using ll = long long;
using P = pair<int, int>;
int main() {
int n, a, b;
string s;
cin >> n >> a >> b;
cin >> s;
int aa = 0;
int bb = 0;
rep(i, n) {
bool ok = false;
char c = s.at(i);
if (c == 'a') {
if (aa + bb < a + b) {
ok = true;
aa++;
}
} else if (c == 'b') {
if (aa + bb < a + b && bb < b) {
ok = true;
bb++;
}
} else {
// false のまま
}
cout << (ok ? "Yes" : "No") << endl;
}
return 0;
}
#include <bits/stdc++.h>
#define rng(i, a, b) for (int i = int(a); i < int(b); i++)
#define rep(i, b) rng(i, 0, b)
#define gnr(i, a, b) for (int i = int(b) - 1; i >= int(a); i--)
#define per(i, b) gnr(i, 0, b)
using namespace std;
using ll = long long;
using P = pair<int, int>;
int main() {
int n, a, b;
string s;
cin >> n >> a >> b;
cin >> s;
int aa = 0;
int bb = 0;
rep(i, n) {
bool ok = false;
char c = s.at(i);
if (c == 'a') {
if (aa + bb < a + b) {
ok = true;
aa++;
}
} else if (c == 'b') {
if (aa + bb < a + b && bb < b) {
ok = true;
bb++;
}
} else {
// false のまま
}
cout << (ok ? "Yes" : "No") << endl;
}
return 0;
}
|
a.cc:52:5: error: redefinition of 'int main()'
52 | int main() {
| ^~~~
a.cc:13:5: note: 'int main()' previously defined here
13 | int main() {
| ^~~~
|
s132689789
|
p03971
|
C++
|
#include<bits/stdc++.h>
using namespace std;
#define cinsc ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(0);
#define all(cont) cont.begin(), cont.end()
#define rall(cont) cont.end(), cont.begin()
#define FOR(i,k,n) for(int64 i=k;i<n;i++)
#define FOREACH(it, l) for (auto it = l.begin(); it != l.end(); it++)
#define IN(A, B, C) assert( B <= A && A <= C)
#define MP make_pair
#define PB push_back
#define INF (int)1e9
#define EPS 1e-9
#define PI 3.1415926535897932384626433832795
#define MOD 1000000007
#define read(type) readInt<type>()
#define SQ(x) ((x)*(x))
const double pi=acos(-1.0);
typedef pair<int, int> PII;
typedef vector<int> VI;
typedef vector<string> VS;
typedef vector<PII> VII;
typedef vector<VI> VVI;
typedef map<int,int> MPII;
typedef set<int> SETI;
typedef multiset<int> MSETI;
typedef long int int32;
typedef unsigned long int uint32;
typedef long long int int64;
typedef unsigned long long int uint64;
int64 powr(int64 x,int64 y,int64 p)
{
int res = 1;
x = x % p;
if (x == 0) return 0;
while (y > 0){
if (y & 1)
res = (res*x) % p;
y = y>>1;
x = (x*x) % p;
}
return res;
}
int main(){
int n,a,b;
string s;
cin>>n>>a>>b
cin>>s;
int c1=0,c2=0;
FOR(i,0,n){
if(s[i]=='a' && c1<a+b){
c1++;cout<<"YES"<<endl;continue;
}else if(s[i]=='b' && c1<a+b && c2<b){
c1++,c2++;cout<<"YES"<<endl;continue;
}
cout<<"NO"<<endl;
}
return 0;
}
|
a.cc: In function 'int main()':
a.cc:50:21: error: expected ';' before 'cin'
50 | cin>>n>>a>>b
| ^
| ;
51 | cin>>s;
| ~~~
|
s268104714
|
p03971
|
C++
|
#include<stdio.h>
using namespace std;
int main()
{
int n,A,B;
cin >> n >> A >> B;
char a[n];
cin>>a;
int c1=0,c2=0;
for(int i=0;i<n;i++)
{
if(a[i]=='c')
{
cout<<"No"<<endl;
continue;
}
if(a[i]=='a')
{
if(c1< A+B)
{
c1++;
cout<<"Yes"<<endl;
continue;
}}
if(a[i]=='b')
{
c2++;
if(c1< A+B && c2<B)
{
c1++;
cout<<"Yes"<<endl;
continue;
}
}
}
return 0;
}
|
a.cc: In function 'int main()':
a.cc:6:3: error: 'cin' was not declared in this scope
6 | cin >> n >> A >> B;
| ^~~
a.cc:2:1: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
1 | #include<stdio.h>
+++ |+#include <iostream>
2 | using namespace std;
a.cc:14:7: error: 'cout' was not declared in this scope
14 | cout<<"No"<<endl;
| ^~~~
a.cc:14:7: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
a.cc:14:19: error: 'endl' was not declared in this scope
14 | cout<<"No"<<endl;
| ^~~~
a.cc:2:1: note: 'std::endl' is defined in header '<ostream>'; this is probably fixable by adding '#include <ostream>'
1 | #include<stdio.h>
+++ |+#include <ostream>
2 | using namespace std;
a.cc:22:9: error: 'cout' was not declared in this scope
22 | cout<<"Yes"<<endl;
| ^~~~
a.cc:22:9: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
a.cc:22:22: error: 'endl' was not declared in this scope
22 | cout<<"Yes"<<endl;
| ^~~~
a.cc:22:22: note: 'std::endl' is defined in header '<ostream>'; this is probably fixable by adding '#include <ostream>'
a.cc:31:9: error: 'cout' was not declared in this scope
31 | cout<<"Yes"<<endl;
| ^~~~
a.cc:31:9: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
a.cc:31:22: error: 'endl' was not declared in this scope
31 | cout<<"Yes"<<endl;
| ^~~~
a.cc:31:22: note: 'std::endl' is defined in header '<ostream>'; this is probably fixable by adding '#include <ostream>'
|
s955694091
|
p03971
|
C++
|
#include <bits/stdc++.h>
using namespace std;
int main() {
int N; int A; int B;
cin>>N>>A>>B;
string S;
cin>>S;
int X=0; int C=0; //XはBのかず CはA+Bのかず
for(int i=0; i<N; i++;){
if(S.at(i)=='c')
cout<<"No"<<endl;
else if(S.at(i)=='a'){
C++;
if(C<=A+B)
cout<<"Yes"<<endl;
else cout<<"No"<<endl;
}
else{
X++;
C++;
if(C<=A+B&&X<=B)
cout<<"Yes"<<endl;
else cout<<"No"<<endl;
}
}
}
|
a.cc: In function 'int main()':
a.cc:10:24: error: expected ')' before ';' token
10 | for(int i=0; i<N; i++;){
| ~ ^
| )
a.cc:10:25: error: expected primary-expression before ')' token
10 | for(int i=0; i<N; i++;){
| ^
|
s743738471
|
p03971
|
C++
|
#include <bits/stdc++.h>
using namespace std;
int main() {
int N; int A; int B;
cin>>N>>A>>B;
string S;
cin>>S;
int X=0;
for(int i=0; i<N; i++;){
if(S.at(i)=='c')
cout<<"No"<<endl;
else if(S.at(i)=='a'){
if(i<=A+B)
cout<<"Yes"<<endl;
else cout<<"No"<<endl;
}
else{
X++;
if(i<=A+B&&X<=B)
cout<<"Yes"<<endl;
else cout<<"No"<<endl;
}
}
}
|
a.cc: In function 'int main()':
a.cc:10:24: error: expected ')' before ';' token
10 | for(int i=0; i<N; i++;){
| ~ ^
| )
a.cc:10:25: error: expected primary-expression before ')' token
10 | for(int i=0; i<N; i++;){
| ^
|
s595655525
|
p03971
|
C++
|
#include <bits/stdc++.h>
using namespace std;
int main() {
int N; int A; int B;
cin>>N>>A>>B;
string S(N);
cin>>S;
int X=0;
for(int i=0; i<N; i++;){
if(S.at(i)=='c')
cout<<"No"<<endl;
else if(S.at(i)=='a'){
if(i<=A+B)
cout<<"Yes"<<endl;
else cout<<"No"<<endl;
}
else{
X++;
if(i<=A+B&&X<=B)
cout<<"Yes"<<endl;
else cout<<"No"<<endl;
}
}
}
|
a.cc: In function 'int main()':
a.cc:7:13: error: no matching function for call to 'std::__cxx11::basic_string<char>::basic_string(int&)'
7 | string S(N);
| ^
In file included from /usr/include/c++/14/string:54,
from /usr/include/c++/14/bitset:52,
from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:52,
from a.cc:1:
/usr/include/c++/14/bits/basic_string.h:800:9: note: candidate: 'template<class _Tp, class> std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::basic_string(const _Tp&, const _Alloc&) [with <template-parameter-2-2> = _Tp; _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>]'
800 | basic_string(const _Tp& __t, const _Alloc& __a = _Alloc())
| ^~~~~~~~~~~~
/usr/include/c++/14/bits/basic_string.h:800:9: note: template argument deduction/substitution failed:
In file included from /usr/include/c++/14/bits/stl_pair.h:60,
from /usr/include/c++/14/bits/stl_algobase.h:64,
from /usr/include/c++/14/algorithm:60,
from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:51:
/usr/include/c++/14/type_traits: In substitution of 'template<bool _Cond, class _Tp> using std::enable_if_t = typename std::enable_if::type [with bool _Cond = false; _Tp = void]':
/usr/include/c++/14/bits/basic_string.h:149:8: required by substitution of 'template<class _CharT, class _Traits, class _Alloc> template<class _Tp, class _Res> using std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::_If_sv = std::enable_if_t<((bool)std::__and_<std::is_convertible<const _Tp&, std::basic_string_view<_CharT, _Traits> >, std::__not_<std::is_convertible<const _Tp*, const std::__cxx11::basic_string<_CharT, _Traits, _Alloc>*> >, std::__not_<std::is_convertible<const _Tp&, const _CharT*> > >::value), _Res> [with _Tp = int; _Res = void; _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>]'
149 | using _If_sv = enable_if_t<
| ^~~~~~
/usr/include/c++/14/bits/basic_string.h:797:30: required from here
797 | template<typename _Tp, typename = _If_sv<_Tp, void>>
| ^~~~~~~~
/usr/include/c++/14/type_traits:2711:11: error: no type named 'type' in 'struct std::enable_if<false, void>'
2711 | using enable_if_t = typename enable_if<_Cond, _Tp>::type;
| ^~~~~~~~~~~
/usr/include/c++/14/bits/basic_string.h:788:9: note: candidate: 'template<class _Tp, class> std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::basic_string(const _Tp&, size_type, size_type, const _Alloc&) [with <template-parameter-2-2> = _Tp; _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>]'
788 | basic_string(const _Tp& __t, size_type __pos, size_type __n,
| ^~~~~~~~~~~~
/usr/include/c++/14/bits/basic_string.h:788:9: note: candidate expects 3 arguments, 1 provided
/usr/include/c++/14/bits/basic_string.h:765:9: note: candidate: 'template<class _InputIterator, class> std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::basic_string(_InputIterator, _InputIterator, const _Alloc&) [with <template-parameter-2-2> = _InputIterator; _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>]'
765 | basic_string(_InputIterator __beg, _InputIterator __end,
| ^~~~~~~~~~~~
/usr/include/c++/14/bits/basic_string.h:765:9: note: candidate expects 2 arguments, 1 provided
/usr/include/c++/14/bits/basic_string.h:669:7: note: candidate: 'template<class> std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::basic_string(size_type, _CharT, const _Alloc&) [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>]'
669 | basic_string(size_type __n, _CharT __c, const _Alloc& __a = _Alloc())
| ^~~~~~~~~~~~
/usr/include/c++/14/bits/basic_string.h:669:7: note: candidate expects 2 arguments, 1 provided
/usr/include/c++/14/bits/basic_string.h:646:7: note: candidate: 'template<class> std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::basic_string(const _CharT*, const _Alloc&) [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>]'
646 | basic_string(const _CharT* __s, const _Alloc& __a = _Alloc())
| ^~~~~~~~~~~~
/usr/include/c++/14/bits/basic_string.h:646:7: note: template argument deduction/substitution failed:
a.cc:7:12: note: cannot convert 'N' (type 'int') to type 'const char*'
7 | string S(N);
| ^
/usr/include/c++/14/bits/basic_string.h:721:7: note: candidate: 'std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::basic_string(std::__cxx11::basic_string<_CharT, _Traits, _Alloc>&&, const _Alloc&) [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>]'
721 | basic_string(basic_string&& __str, const _Alloc& __a)
| ^~~~~~~~~~~~
/usr/include/c++/14/bits/basic_string.h:721:7: note: candidate expects 2 arguments, 1 provided
/usr/include/c++/14/bits/basic_string.h:716:7: note: candidate: 'std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::basic_string(const std::__cxx11::basic_string<_CharT, _Traits, _Alloc>&, const _Alloc&) [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>]'
716 | basic_string(const basic_string& __str, const _Alloc& __a)
| ^~~~~~~~~~~~
/usr/include/c++/14/bits/basic_string.h:716:7: note: candidate expects 2 arguments, 1 provided
/usr/include/c++/14/bits/basic_string.h:711:7: note: candidate: 'std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::basic_string(std::initializer_list<_Tp>, const _Alloc&) [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>]'
711 | basic_string(initializer_list<_CharT> __l, const _Alloc& __a = _Alloc())
| ^~~~~~~~~~~~
/usr/include/c++/14/bits/basic_string.h:711:45: note: no known conversion for argument 1 from 'int' to 'std::initializer_list<char>'
711 | basic_string(initializer_list<_CharT> __l, const _Alloc& __a = _Alloc())
| ~~~~~~~~~~~~~~~~~~~~~~~~~^~~
/usr/include/c++/14/bits/basic_string.h:682:7: note: candidate: 'std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::basic_string(std::__cxx11::basic_string<_CharT, _Traits, _Alloc>&&) [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>]'
682 | basic_string(basic_string&& __str) noexcept
| ^~~~~~~~~~~~
/usr/include/c++/14/bits/basic_string.h:682:35: note: no known conversion for argument 1 from 'int' to 'std::__cxx11::basic_string<char>&&'
682 | basic_string(basic_string&& __str) noexcept
| ~~~~~~~~~~~~~~~^~~~~
/usr/include/c++/14/bits/basic_string.h:624:7: note: candidate: 'std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::basic_string(const _CharT*, size_type, const _Alloc&) [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>; size_type = long unsigned int]'
624 | basic_string(const _CharT* __s, size_type __n,
| ^~~~~~~~~~~~
/usr/include/c++/14/bits/basic_string.h:624:7: note: candidate expects 3 arguments, 1 provided
/usr/include/c++/14/bits/basic_string.h:604:7: note: candidate: 'std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::basic_string(const std::__cxx11::basic_string<_CharT, _Traits, _Alloc>&, size_type, size_type, const _Alloc&) [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>; size_type = long unsigned int]'
604 | basic_string(const basic_string& __str, size_type __pos,
| ^~~~~~~~~~~~
/usr/include/c++/14/bits/basic_string.h:604:7: note: candidate expects 4 arguments, 1 provided
/usr/include/c++/14/bits/basic_string.h:586:7: note: candidate: 'std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::basic_string(const std::__cxx11::basic_string<_CharT, _Traits, _Alloc>&, size_type, size_type) [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>; size_type = long unsigned int]'
586 | basic_string(const basic_string& __str, size_type __pos,
| ^~~~~~~~~~~~
/usr/include/c++/14/bits/basic_string.h:586:7: note: candidate expects 3 arguments, 1 provided
/usr/include/c++/14/bits/basic_string.h:569:7: note: candidate: 'std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::basic_string(const std::__cxx11::basic_string<_CharT, _Traits, _Alloc>&, size_type, const _Alloc&) [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>; size_type = long unsigned int]'
569 | basic_string(const basic_string& __str, size_type __pos,
| ^~~~~~~~~~~~
/usr/include/c++/14/bits/basic_string.h:569:7: note: candidate expects 3 arguments, 1 provided
/usr/include/c++/14/bits/basic_string.h:552:7: note: candidate: 'std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::basic_string(const std::__cxx11::basic_string<_CharT, _Traits, _Alloc>&) [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>]'
552 | basic_string(const basic_string& __str)
| ^~~~~~~~~~~~
/usr/include/c++/14/bits/basic_string.h:552:40: note: no known conversion for argument 1 from 'int' to 'const std::__cxx11::basic_string<char>&'
552 | basic_string(const basic_string& __str)
| ~~~~~~~~~~~~~~~~~~~~^~~~~
/usr/include/c++/14/bits/basic_string.h:540:7: note: candidate: 'std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::basic_string(const _Alloc&) [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>]'
540 | basic_string(const _Alloc& __a) _GLIBCXX_NOEXCEPT
| ^~~~~~~~~~~~
/usr/include/c++/14/bits/basic_string.h:540:34: note: no known conversion for argument 1 from 'int' to 'const std::allocator<char>&'
540 | basic_string(const _Alloc& __a) _GLIBCXX_NOEXCEPT
| ~~~~~~~~~~~~~~^~~
/usr/include/c++/14/bits/basic_string.h:527:7: note: candidate: 'std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::basic_string() [with _CharT = char; _Traits = std::ch
|
s675230116
|
p03971
|
C++
|
#include <bits/stdc++.h>
#define ll long long
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
using namespace std;
int main() {
int n, a, b;
string s;
cin >> n >> a >> b;
cin >> s;
int total = a + b;
int count = 0;
int foreign_count = 0;
rep (i, n) {
string state = s[i];
if (state == 'a') {
if (count < total) {
cout << 'Yes' << endl;
} else {
cout << 'No' << endl;
}
count++;
} else if (state == 'b') {
if (count < total && foreign_count <= b) {
cout << 'Yes' << endl;
} else {
cout << 'No' << endl;
}
count++;
foreign_count++;
} else {
cout << 'No' << endl;
count++;
}
}
return 0;
}
|
a.cc:21:25: warning: multi-character character constant [-Wmultichar]
21 | cout << 'Yes' << endl;
| ^~~~~
a.cc:23:25: warning: multi-character character constant [-Wmultichar]
23 | cout << 'No' << endl;
| ^~~~
a.cc:28:25: warning: multi-character character constant [-Wmultichar]
28 | cout << 'Yes' << endl;
| ^~~~~
a.cc:30:25: warning: multi-character character constant [-Wmultichar]
30 | cout << 'No' << endl;
| ^~~~
a.cc:35:21: warning: multi-character character constant [-Wmultichar]
35 | cout << 'No' << endl;
| ^~~~
a.cc: In function 'int main()':
a.cc:18:27: error: conversion from '__gnu_cxx::__alloc_traits<std::allocator<char>, char>::value_type' {aka 'char'} to non-scalar type 'std::string' {aka 'std::__cxx11::basic_string<char>'} requested
18 | string state = s[i];
| ^
a.cc:19:19: error: no match for 'operator==' (operand types are 'std::string' {aka 'std::__cxx11::basic_string<char>'} and 'char')
19 | if (state == 'a') {
| ~~~~~ ^~ ~~~
| | |
| | char
| std::string {aka std::__cxx11::basic_string<char>}
In file included from /usr/include/c++/14/regex:68,
from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:181,
from a.cc:1:
/usr/include/c++/14/bits/regex.h:1103:5: note: candidate: 'template<class _BiIter> bool std::__cxx11::operator==(const sub_match<_BiIter>&, const sub_match<_BiIter>&)'
1103 | operator==(const sub_match<_BiIter>& __lhs, const sub_match<_BiIter>& __rhs)
| ^~~~~~~~
/usr/include/c++/14/bits/regex.h:1103:5: note: template argument deduction/substitution failed:
a.cc:19:22: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::__cxx11::sub_match<_BiIter>'
19 | if (state == 'a') {
| ^~~
/usr/include/c++/14/bits/regex.h:1199:5: note: candidate: 'template<class _Bi_iter, class _Ch_traits, class _Ch_alloc> bool std::__cxx11::operator==(__sub_match_string<_Bi_iter, _Ch_traits, _Ch_alloc>&, const sub_match<_BiIter>&)'
1199 | operator==(const __sub_match_string<_Bi_iter, _Ch_traits, _Ch_alloc>& __lhs,
| ^~~~~~~~
/usr/include/c++/14/bits/regex.h:1199:5: note: template argument deduction/substitution failed:
a.cc:19:22: note: mismatched types 'const std::__cxx11::sub_match<_BiIter>' and 'char'
19 | if (state == 'a') {
| ^~~
/usr/include/c++/14/bits/regex.h:1274:5: note: candidate: 'template<class _Bi_iter, class _Ch_traits, class _Ch_alloc> bool std::__cxx11::operator==(const sub_match<_BiIter>&, __sub_match_string<_Bi_iter, _Ch_traits, _Ch_alloc>&)'
1274 | operator==(const sub_match<_Bi_iter>& __lhs,
| ^~~~~~~~
/usr/include/c++/14/bits/regex.h:1274:5: note: template argument deduction/substitution failed:
a.cc:19:22: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::__cxx11::sub_match<_BiIter>'
19 | if (state == 'a') {
| ^~~
/usr/include/c++/14/bits/regex.h:1366:5: note: candidate: 'template<class _Bi_iter> bool std::__cxx11::operator==(const typename std::iterator_traits<_Iter>::value_type*, const sub_match<_BiIter>&)'
1366 | operator==(typename iterator_traits<_Bi_iter>::value_type const* __lhs,
| ^~~~~~~~
/usr/include/c++/14/bits/regex.h:1366:5: note: template argument deduction/substitution failed:
a.cc:19:22: note: mismatched types 'const std::__cxx11::sub_match<_BiIter>' and 'char'
19 | if (state == 'a') {
| ^~~
/usr/include/c++/14/bits/regex.h:1441:5: note: candidate: 'template<class _Bi_iter> bool std::__cxx11::operator==(const sub_match<_BiIter>&, const typename std::iterator_traits<_Iter>::value_type*)'
1441 | operator==(const sub_match<_Bi_iter>& __lhs,
| ^~~~~~~~
/usr/include/c++/14/bits/regex.h:1441:5: note: template argument deduction/substitution failed:
a.cc:19:22: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::__cxx11::sub_match<_BiIter>'
19 | if (state == 'a') {
| ^~~
/usr/include/c++/14/bits/regex.h:1534:5: note: candidate: 'template<class _Bi_iter> bool std::__cxx11::operator==(const typename std::iterator_traits<_Iter>::value_type&, const sub_match<_BiIter>&)'
1534 | operator==(typename iterator_traits<_Bi_iter>::value_type const& __lhs,
| ^~~~~~~~
/usr/include/c++/14/bits/regex.h:1534:5: note: template argument deduction/substitution failed:
a.cc:19:22: note: mismatched types 'const std::__cxx11::sub_match<_BiIter>' and 'char'
19 | if (state == 'a') {
| ^~~
/usr/include/c++/14/bits/regex.h:1613:5: note: candidate: 'template<class _Bi_iter> bool std::__cxx11::operator==(const sub_match<_BiIter>&, const typename std::iterator_traits<_Iter>::value_type&)'
1613 | operator==(const sub_match<_Bi_iter>& __lhs,
| ^~~~~~~~
/usr/include/c++/14/bits/regex.h:1613:5: note: template argument deduction/substitution failed:
a.cc:19:22: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::__cxx11::sub_match<_BiIter>'
19 | if (state == 'a') {
| ^~~
/usr/include/c++/14/bits/regex.h:2186:5: note: candidate: 'template<class _Bi_iter, class _Alloc> bool std::__cxx11::operator==(const match_results<_BiIter, _Alloc>&, const match_results<_BiIter, _Alloc>&)'
2186 | operator==(const match_results<_Bi_iter, _Alloc>& __m1,
| ^~~~~~~~
/usr/include/c++/14/bits/regex.h:2186:5: note: template argument deduction/substitution failed:
a.cc:19:22: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::__cxx11::match_results<_BiIter, _Alloc>'
19 | if (state == 'a') {
| ^~~
In file included from /usr/include/c++/14/bits/stl_algobase.h:64,
from /usr/include/c++/14/algorithm:60,
from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:51:
/usr/include/c++/14/bits/stl_pair.h:1033:5: note: candidate: 'template<class _T1, class _T2> constexpr bool std::operator==(const pair<_T1, _T2>&, const pair<_T1, _T2>&)'
1033 | operator==(const pair<_T1, _T2>& __x, const pair<_T1, _T2>& __y)
| ^~~~~~~~
/usr/include/c++/14/bits/stl_pair.h:1033:5: note: template argument deduction/substitution failed:
a.cc:19:22: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::pair<_T1, _T2>'
19 | if (state == 'a') {
| ^~~
In file included from /usr/include/c++/14/bits/stl_algobase.h:67:
/usr/include/c++/14/bits/stl_iterator.h:441:5: note: candidate: 'template<class _Iterator> constexpr bool std::operator==(const reverse_iterator<_Iterator>&, const reverse_iterator<_Iterator>&)'
441 | operator==(const reverse_iterator<_Iterator>& __x,
| ^~~~~~~~
/usr/include/c++/14/bits/stl_iterator.h:441:5: note: template argument deduction/substitution failed:
a.cc:19:22: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::reverse_iterator<_Iterator>'
19 | if (state == 'a') {
| ^~~
/usr/include/c++/14/bits/stl_iterator.h:486:5: note: candidate: 'template<class _IteratorL, class _IteratorR> constexpr bool std::operator==(const reverse_iterator<_Iterator>&, const reverse_iterator<_IteratorR>&)'
486 | operator==(const reverse_iterator<_IteratorL>& __x,
| ^~~~~~~~
/usr/include/c++/14/bits/stl_iterator.h:486:5: note: template argument deduction/substitution failed:
a.cc:19:22: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::reverse_iterator<_Iterator>'
19 | if (state == 'a') {
| ^~~
/usr/include/c++/14/bits/stl_iterator.h:1667:5: note: candidate: 'template<class _IteratorL, class _IteratorR> constexpr bool std::operator==(const move_iterator<_IteratorL>&, const move_iterator<_IteratorR>&)'
1667 | operator==(const move_iterator<_IteratorL>& __x,
| ^~~~~~~~
/usr/include/c++/14/bits/stl_iterator.h:1667:5: note: template argument deduction/substitution failed:
a.cc:19:22: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::move_iterator<_IteratorL>'
19 | if (state == 'a') {
| ^~~
/usr/include/c++/14/bits/stl_iterator.h:1737:5: note: candidate: 'template<class _Iterator> constexpr bool std::operator==(const move_iterator<_IteratorL>&, const move_iterator<_IteratorL>&)'
1737 | operator==(const move_iterator<_Iterator>& __x,
| ^~~~~~~~
/usr/include/c++/14/bits/stl_iterator.h:1737:5: note: template argument deduction/substitution failed:
a.cc:19:22: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::move_iterator<_IteratorL>'
19 | if (state == 'a') {
| ^~~
In file included from /usr/include/c++/14/bits/char_traits.h:42,
from /usr/include/c++/14/string:42,
from /usr/include/c++/14/bitset:52,
from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:52:
/usr/include/c++/14/bits/postypes.h:192:5: note: candidate: 'template<class _StateT> bool std::operator==(const fpos<_StateT>&, const fpos<_StateT>&)'
192 | operator==(const fpos<_StateT>& __lhs, const fpos<_StateT>& __rhs)
| ^~~~~~~~
/usr/include/c++/14/bits/postypes.h:192:5: note: template argument deduction/substitution failed:
a.cc:19:22: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::fpos<_StateT>'
19 | if (state == 'a') {
| ^~~
In
|
s715284543
|
p03971
|
C
|
#include <bits/stdc++.h>
using namespace std;
int main() {
int n, A, B;
cin >> n >> A >> B;
string x;
cin >> x;
int suma=0, sumb=0, sumab=0;
for(int i=0; i<n; i++){
if(x.at(i)=='c') {
cout << "No" << endl;
}
if(x.at(i)=='a'){
if(sumab<A+B){
suma++;
cout << "Yes" << endl;
sumab++;
}
else cout << "No" << endl;
}
if (x.at(i)=='b'){
if(sumab<A+B && sumb<B){
sumb++;
cout << "Yes" << endl;
sumab++;
}
else cout << "No" << endl;
}
}
//cout << suma << sumb << sumab << endl;
return 0;
}
|
main.c:1:10: fatal error: bits/stdc++.h: No such file or directory
1 | #include <bits/stdc++.h>
| ^~~~~~~~~~~~~~~
compilation terminated.
|
s737375062
|
p03971
|
C++
|
#include<iostream>
#include<string>
using namespaces std;
int main()
{
int n, a, b;
string s;
cin >> n >> a >> b >> s;
int cnta = 0, cntb = 0;
for(int i = 0; i < n; i ++){
if(s[i] == 'a' && cnta < a + b){
cout << "Yes\n";
cnta ++;
}
else if(s[i] == 'b' && cntb < b){
cout << "Yes\n";
cntb ++;
}
else{
cout << "No\n";
}
}
}
|
a.cc:4:7: error: expected nested-name-specifier before 'namespaces'
4 | using namespaces std;
| ^~~~~~~~~~
a.cc: In function 'int main()':
a.cc:9:9: error: 'string' was not declared in this scope
9 | string s;
| ^~~~~~
a.cc:9:9: note: suggested alternatives:
In file included from /usr/include/c++/14/iosfwd:41,
from /usr/include/c++/14/ios:40,
from /usr/include/c++/14/ostream:40,
from /usr/include/c++/14/iostream:41,
from a.cc:1:
/usr/include/c++/14/bits/stringfwd.h:77:33: note: 'std::string'
77 | typedef basic_string<char> string;
| ^~~~~~
In file included from /usr/include/c++/14/bits/locale_classes.h:40,
from /usr/include/c++/14/bits/ios_base.h:41,
from /usr/include/c++/14/ios:44:
/usr/include/c++/14/string:76:11: note: 'std::pmr::string'
76 | using string = basic_string<char>;
| ^~~~~~
a.cc:10:9: error: 'cin' was not declared in this scope; did you mean 'std::cin'?
10 | cin >> n >> a >> b >> s;
| ^~~
| std::cin
/usr/include/c++/14/iostream:62:18: note: 'std::cin' declared here
62 | extern istream cin; ///< Linked to standard input
| ^~~
a.cc:10:31: error: 's' was not declared in this scope
10 | cin >> n >> a >> b >> s;
| ^
a.cc:14:15: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
14 | cout << "Yes\n";
| ^~~~
| std::cout
/usr/include/c++/14/iostream:63:18: note: 'std::cout' declared here
63 | extern ostream cout; ///< Linked to standard output
| ^~~~
a.cc:18:15: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
18 | cout << "Yes\n";
| ^~~~
| std::cout
/usr/include/c++/14/iostream:63:18: note: 'std::cout' declared here
63 | extern ostream cout; ///< Linked to standard output
| ^~~~
a.cc:22:15: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
22 | cout << "No\n";
| ^~~~
| std::cout
/usr/include/c++/14/iostream:63:18: note: 'std::cout' declared here
63 | extern ostream cout; ///< Linked to standard output
| ^~~~
|
s768851412
|
p03971
|
C++
|
#include <iostream>
#include <string>
#include <limits.h>
#include <numeric>
#include <math.h>
#include <bits/stdc++.h>
#define rep(i,c) for (int i=0;i<c;i++)
using namespace std;
int main(){
cout <"a" <endl;
}
|
a.cc: In function 'int main()':
a.cc:10:6: error: no match for 'operator<' (operand types are 'std::ostream' {aka 'std::basic_ostream<char>'} and 'const char [2]')
10 | cout <"a" <endl;
| ~~~~ ^~~~
| | |
| | const char [2]
| std::ostream {aka std::basic_ostream<char>}
In file included from /usr/include/c++/14/regex:68,
from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:181,
from a.cc:6:
/usr/include/c++/14/bits/regex.h:1143:5: note: candidate: 'template<class _BiIter> bool std::__cxx11::operator<(const sub_match<_BiIter>&, const sub_match<_BiIter>&)'
1143 | operator<(const sub_match<_BiIter>& __lhs, const sub_match<_BiIter>& __rhs)
| ^~~~~~~~
/usr/include/c++/14/bits/regex.h:1143:5: note: template argument deduction/substitution failed:
a.cc:10:7: note: 'std::ostream' {aka 'std::basic_ostream<char>'} is not derived from 'const std::__cxx11::sub_match<_BiIter>'
10 | cout <"a" <endl;
| ^~~
/usr/include/c++/14/bits/regex.h:1224:5: note: candidate: 'template<class _Bi_iter, class _Ch_traits, class _Ch_alloc> bool std::__cxx11::operator<(__sub_match_string<_Bi_iter, _Ch_traits, _Ch_alloc>&, const sub_match<_BiIter>&)'
1224 | operator<(const __sub_match_string<_Bi_iter, _Ch_traits, _Ch_alloc>& __lhs,
| ^~~~~~~~
/usr/include/c++/14/bits/regex.h:1224:5: note: template argument deduction/substitution failed:
a.cc:10:7: note: 'std::ostream' {aka 'std::basic_ostream<char>'} is not derived from 'std::__cxx11::__sub_match_string<_Bi_iter, _Ch_traits, _Ch_alloc>'
10 | cout <"a" <endl;
| ^~~
/usr/include/c++/14/bits/regex.h:1317:5: note: candidate: 'template<class _Bi_iter, class _Ch_traits, class _Ch_alloc> bool std::__cxx11::operator<(const sub_match<_BiIter>&, __sub_match_string<_Bi_iter, _Ch_traits, _Ch_alloc>&)'
1317 | operator<(const sub_match<_Bi_iter>& __lhs,
| ^~~~~~~~
/usr/include/c++/14/bits/regex.h:1317:5: note: template argument deduction/substitution failed:
a.cc:10:7: note: 'std::ostream' {aka 'std::basic_ostream<char>'} is not derived from 'const std::__cxx11::sub_match<_BiIter>'
10 | cout <"a" <endl;
| ^~~
/usr/include/c++/14/bits/regex.h:1391:5: note: candidate: 'template<class _Bi_iter> bool std::__cxx11::operator<(const typename std::iterator_traits<_Iter>::value_type*, const sub_match<_BiIter>&)'
1391 | operator<(typename iterator_traits<_Bi_iter>::value_type const* __lhs,
| ^~~~~~~~
/usr/include/c++/14/bits/regex.h:1391:5: note: template argument deduction/substitution failed:
a.cc:10:7: note: mismatched types 'const std::__cxx11::sub_match<_BiIter>' and 'const char [2]'
10 | cout <"a" <endl;
| ^~~
/usr/include/c++/14/bits/regex.h:1485:5: note: candidate: 'template<class _Bi_iter> bool std::__cxx11::operator<(const sub_match<_BiIter>&, const typename std::iterator_traits<_Iter>::value_type*)'
1485 | operator<(const sub_match<_Bi_iter>& __lhs,
| ^~~~~~~~
/usr/include/c++/14/bits/regex.h:1485:5: note: template argument deduction/substitution failed:
a.cc:10:7: note: 'std::ostream' {aka 'std::basic_ostream<char>'} is not derived from 'const std::__cxx11::sub_match<_BiIter>'
10 | cout <"a" <endl;
| ^~~
/usr/include/c++/14/bits/regex.h:1560:5: note: candidate: 'template<class _Bi_iter> bool std::__cxx11::operator<(const typename std::iterator_traits<_Iter>::value_type&, const sub_match<_BiIter>&)'
1560 | operator<(typename iterator_traits<_Bi_iter>::value_type const& __lhs,
| ^~~~~~~~
/usr/include/c++/14/bits/regex.h:1560:5: note: template argument deduction/substitution failed:
a.cc:10:7: note: mismatched types 'const std::__cxx11::sub_match<_BiIter>' and 'const char [2]'
10 | cout <"a" <endl;
| ^~~
/usr/include/c++/14/bits/regex.h:1660:5: note: candidate: 'template<class _Bi_iter> bool std::__cxx11::operator<(const sub_match<_BiIter>&, const typename std::iterator_traits<_Iter>::value_type&)'
1660 | operator<(const sub_match<_Bi_iter>& __lhs,
| ^~~~~~~~
/usr/include/c++/14/bits/regex.h:1660:5: note: template argument deduction/substitution failed:
a.cc:10:7: note: 'std::ostream' {aka 'std::basic_ostream<char>'} is not derived from 'const std::__cxx11::sub_match<_BiIter>'
10 | cout <"a" <endl;
| ^~~
In file included from /usr/include/c++/14/string:48,
from /usr/include/c++/14/bits/locale_classes.h:40,
from /usr/include/c++/14/bits/ios_base.h:41,
from /usr/include/c++/14/ios:44,
from /usr/include/c++/14/ostream:40,
from /usr/include/c++/14/iostream:41,
from a.cc:1:
/usr/include/c++/14/bits/stl_iterator.h:448:5: note: candidate: 'template<class _Iterator> constexpr bool std::operator<(const reverse_iterator<_Iterator>&, const reverse_iterator<_Iterator>&)'
448 | operator<(const reverse_iterator<_Iterator>& __x,
| ^~~~~~~~
/usr/include/c++/14/bits/stl_iterator.h:448:5: note: template argument deduction/substitution failed:
a.cc:10:7: note: 'std::ostream' {aka 'std::basic_ostream<char>'} is not derived from 'const std::reverse_iterator<_Iterator>'
10 | cout <"a" <endl;
| ^~~
/usr/include/c++/14/bits/stl_iterator.h:493:5: note: candidate: 'template<class _IteratorL, class _IteratorR> constexpr bool std::operator<(const reverse_iterator<_Iterator>&, const reverse_iterator<_IteratorR>&)'
493 | operator<(const reverse_iterator<_IteratorL>& __x,
| ^~~~~~~~
/usr/include/c++/14/bits/stl_iterator.h:493:5: note: template argument deduction/substitution failed:
a.cc:10:7: note: 'std::ostream' {aka 'std::basic_ostream<char>'} is not derived from 'const std::reverse_iterator<_Iterator>'
10 | cout <"a" <endl;
| ^~~
/usr/include/c++/14/bits/stl_iterator.h:1694:5: note: candidate: 'template<class _IteratorL, class _IteratorR> constexpr bool std::operator<(const move_iterator<_IteratorL>&, const move_iterator<_IteratorR>&)'
1694 | operator<(const move_iterator<_IteratorL>& __x,
| ^~~~~~~~
/usr/include/c++/14/bits/stl_iterator.h:1694:5: note: template argument deduction/substitution failed:
a.cc:10:7: note: 'std::ostream' {aka 'std::basic_ostream<char>'} is not derived from 'const std::move_iterator<_IteratorL>'
10 | cout <"a" <endl;
| ^~~
/usr/include/c++/14/bits/stl_iterator.h:1760:5: note: candidate: 'template<class _Iterator> constexpr bool std::operator<(const move_iterator<_IteratorL>&, const move_iterator<_IteratorL>&)'
1760 | operator<(const move_iterator<_Iterator>& __x,
| ^~~~~~~~
/usr/include/c++/14/bits/stl_iterator.h:1760:5: note: template argument deduction/substitution failed:
a.cc:10:7: note: 'std::ostream' {aka 'std::basic_ostream<char>'} is not derived from 'const std::move_iterator<_IteratorL>'
10 | cout <"a" <endl;
| ^~~
In file included from /usr/include/c++/14/bits/stl_algobase.h:64,
from /usr/include/c++/14/string:51:
/usr/include/c++/14/bits/stl_pair.h:1045:5: note: candidate: 'template<class _T1, class _T2> constexpr bool std::operator<(const pair<_T1, _T2>&, const pair<_T1, _T2>&)'
1045 | operator<(const pair<_T1, _T2>& __x, const pair<_T1, _T2>& __y)
| ^~~~~~~~
/usr/include/c++/14/bits/stl_pair.h:1045:5: note: template argument deduction/substitution failed:
a.cc:10:7: note: 'std::ostream' {aka 'std::basic_ostream<char>'} is not derived from 'const std::pair<_T1, _T2>'
10 | cout <"a" <endl;
| ^~~
In file included from /usr/include/c++/14/bits/basic_string.h:47,
from /usr/include/c++/14/string:54:
/usr/include/c++/14/string_view:673:5: note: candidate: 'template<class _CharT, class _Traits> constexpr bool std::operator<(basic_string_view<_CharT, _Traits>, basic_string_view<_CharT, _Traits>)'
673 | operator< (basic_string_view<_CharT, _Traits> __x,
| ^~~~~~~~
/usr/include/c++/14/string_view:673:5: note: template argument deduction/substitution failed:
a.cc:10:7: note: 'std::basic_ostream<char>' is not derived from 'std::basic_string_view<_CharT, _Traits>'
10 | cout <"a" <endl;
| ^~~
/usr/include/c++/14/string_view:680:5: note: candidate: 'template<class _CharT, class _Traits> constexpr bool std::operator<(basic_string_view<_CharT, _Traits>, __type_identity_t<basic_string_view<_CharT, _Traits> >)'
680 | operator< (basic_string_view<_CharT, _Traits> __x,
| ^~~~~~~~
/usr/include/c++/14/string_view:680:5: note: template argument deduction/substitution failed:
a.cc:10:7: note: 'std::basic_ostream<char>' is not derived from 'std::basic_string_view<_CharT, _Traits>'
10 | cout <"a" <endl;
| ^~~
/usr/include/c++/14/string_view:688:5: note: candidate: 'template<class _CharT, class _Traits> constexpr bool std::operator<(__type_identity_t<basic_string_view<_CharT, _Traits> >, basic_string_view<_CharT, _Traits>)'
688 | operator< (__type_identity_t<basic_string_view<_CharT, _Traits>> __x,
| ^~~~~~~~
/usr/include/c++/14/string_view:688:5: note: template argument deduction/substitution failed:
a.cc:10:7: note: mismatched types 'std::basic_string_view<_CharT, _Traits>' and 'const char*'
10 | cout <"a" <endl;
| ^~~
/usr/include/c++/14/bits/basic_string.h:3874:5: note: candidate: 'template<class _CharT, class _Traits, class _Alloc> bool std::operator<(const __cxx11::basic_string<_CharT, _Traits, _Allocator>&, const __cxx11::basic_string<_CharT, _Traits, _Allocator>&)'
3874 | operator<(const basic_string<_CharT, _Traits, _Alloc>& __lhs,
| ^~~~~~~~
/usr/include/c++/14/bits/basic_string.h:3874:5: note: template argument deduction/substitution failed:
a.cc:10:7: note: 'std::ostream' {aka 'std::basic_ostream<char>'} is not derived from 'const std::__cxx11::basic_string<_CharT, _Traits, _Allocator>'
10 | cout <"a" <endl;
| ^~~
/usr/include/c++/14/bits/basic_string.h:3888:5: note: candidate: 'template<class _CharT, class _Traits, class _Alloc> bool std::operator<(const __cxx11::basic_string<_CharT, _Traits, _Allocator>&
|
s417588718
|
p03971
|
C++
|
#include <iostream>
#include <string>
#include <limits.h>
#include <numeric>
#include <math.h>
#include <bits/stdc++.h>
#define rep(i,c) for (int i=0;i<c;i++)
using namespace std;
cout <<"a" <<endl;
|
a.cc:9:1: error: 'cout' does not name a type
9 | cout <<"a" <<endl;
| ^~~~
|
s524450151
|
p03971
|
C++
|
#include <iostream>
#include <string>
#include <limits.h>
#include <numeric>
#include <math.h>
#include <bits/stdc++.h>
#define rep(i,c) for (int i=0;i<c;i++)
using namespace std;
cout <"a" <endl;
|
a.cc:9:1: error: 'cout' does not name a type
9 | cout <"a" <endl;
| ^~~~
|
s416347722
|
p03971
|
Java
|
public class Main {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
int n = Integer.parseInt(sc.next());
int a = Integer.parseInt(sc.next());
int b = Integer.parseInt(sc.next());
int overseaStudent = 1;
String s = sc.next();
int passed = 0;
for (int i = 0; i < n; i++) {
String x = s.substring(i,i+1);
switch (x){
case "a":
if (passed < a + b) {
passed += 1;
System.out.println("Yes");
} else {
System.out.println("No");
}
break;
case "b":
if (passed < a + b && overseaStudent <= b) {
passed += 1;
overseaStudent += 1;
System.out.println("Yes");
} else {
System.out.println("No");
}
break;
case "c":
System.out.println("No");
break;
}
}
}
}
|
Main.java:5: error: cannot find symbol
Scanner sc = new Scanner(System.in);
^
symbol: class Scanner
location: class Main
Main.java:5: error: cannot find symbol
Scanner sc = new Scanner(System.in);
^
symbol: class Scanner
location: class Main
2 errors
|
s217252151
|
p03971
|
C++
|
#include <bits/stdc++.h>
using namespace std;
int main(){
int N,A,B;
cin >> N >> A >> B;
string S;
cin >> S;
vector<int> vec(N);
int total = 0;
int abroad = 0;
for(int i=0;i<N;i++){
char s = S[i];
if(s=='a'){
if(total<A+B){vec[i] = 1; total+=1;}
else{vec[i]=0;}
}else if (s == 'b'){
if(total<A+B && abroad<B){vec[i] = 1; total+=1; abroad+=1;}
else{vec[i] = 0;}
}else{vec[i] = 0;}
}
for(bool b:vec){
if(b) cout << "Yes" << endl;
else cout << "No" << endl;
}d
}
|
a.cc: In function 'int main()':
a.cc:25:6: error: 'd' was not declared in this scope
25 | }d
| ^
|
s866779684
|
p03971
|
C
|
#include <bits/stdc++.h>
#define rep(i,n) for(int i = 0;i < (n);i++)
using namespace std;
using ll = long long;
using pii = pair<int,int>;
int main(){
int n,a,b;
cin >> n >> a >> b;
string s;
cin >> s;
int j = 0,r = 0;
rep(i,n){
if(s[i] == 'a'){
if(a+b > r){
cout << "Yes" << endl;
r++;
continue;
}
}
if(s[i] == 'b'){
if(a+b > r && b > j){
cout << "Yes" << endl;
r++; j++;
continue;
}
}
cout << "No" << endl;
}
return 0;
}
|
main.c:1:10: fatal error: bits/stdc++.h: No such file or directory
1 | #include <bits/stdc++.h>
| ^~~~~~~~~~~~~~~
compilation terminated.
|
s462252499
|
p03971
|
C++
|
int main(){
int N,A,B;
string S;
cin>>N>>A>>B;
cin>>S;
int n=(A+B);
int b=1;
int p=0;
for(int i=1; i<=N;i++){
if(S.at(i-1)=='a'){
if(p<n){cout<<"Yes"<<endl; p++;}
else{cout<<"No"<<endl;}
}
if(S.at(i-1)=='b'){
if(p<n && b<=B){cout<<"Yes"<<endl; b++; p++;}
else{cout<<"No"<<endl;b++;}
}
if(S.at(i-1)=='c'){cout<<"No"<<endl;}
}
}
|
a.cc: In function 'int main()':
a.cc:4:3: error: 'string' was not declared in this scope
4 | string S;
| ^~~~~~
a.cc:5:3: error: 'cin' was not declared in this scope
5 | cin>>N>>A>>B;
| ^~~
a.cc:6:8: error: 'S' was not declared in this scope
6 | cin>>S;
| ^
a.cc:12:15: error: 'cout' was not declared in this scope
12 | if(p<n){cout<<"Yes"<<endl; p++;}
| ^~~~
a.cc:12:28: error: 'endl' was not declared in this scope
12 | if(p<n){cout<<"Yes"<<endl; p++;}
| ^~~~
a.cc:13:12: error: 'cout' was not declared in this scope
13 | else{cout<<"No"<<endl;}
| ^~~~
a.cc:13:24: error: 'endl' was not declared in this scope
13 | else{cout<<"No"<<endl;}
| ^~~~
a.cc:16:23: error: 'cout' was not declared in this scope
16 | if(p<n && b<=B){cout<<"Yes"<<endl; b++; p++;}
| ^~~~
a.cc:16:36: error: 'endl' was not declared in this scope
16 | if(p<n && b<=B){cout<<"Yes"<<endl; b++; p++;}
| ^~~~
a.cc:17:12: error: 'cout' was not declared in this scope
17 | else{cout<<"No"<<endl;b++;}
| ^~~~
a.cc:17:24: error: 'endl' was not declared in this scope
17 | else{cout<<"No"<<endl;b++;}
| ^~~~
a.cc:19:24: error: 'cout' was not declared in this scope
19 | if(S.at(i-1)=='c'){cout<<"No"<<endl;}
| ^~~~
a.cc:19:36: error: 'endl' was not declared in this scope
19 | if(S.at(i-1)=='c'){cout<<"No"<<endl;}
| ^~~~
|
s944614821
|
p03971
|
C++
|
#include<bits/stdc++.h>
using namespace std;
int main(){
cin.tie(0);
ios_base::sync_with_stdio(false);
int n,a,b;
cin>>n>>a>>b;
string s;
cin>>s;
int c=0;
int d=0;
int e=0;
for(int i=0;i<n;i++){
if(s[i]=='a' && e<a+b;){
cout<<"Yes"<<"\n";
e++;
}else if(s[i]=='b' && d+1<=b && e<a+b){
cout<<"Yes"<<"\n";
d++;
e++;
}else if(s[i]=='c'){
cout<<"No"<<"\n";
c++;
}else{
cout<<"No"<<"\n";
}
}
}
|
a.cc: In function 'int main()':
a.cc:16:27: error: expected primary-expression before ')' token
16 | if(s[i]=='a' && e<a+b;){
| ^
|
s986328374
|
p03971
|
C++
|
#include<iostream>
#include<vector>
using namespace std;
int main(){
int n,a,b,con=0,count=0;
cin>>n>>a>>b;
vector<char> mozi[n];
scanf("%s",mozi);
int i,j;
for(i=0;i<n;i++){
if(mozi[i]=='a'&&a+b>count){
cout<<"Yes"<<endl;
count++;
}
else if(a[i]=='b'&&con<b&&count<a+b){
cout<<"Yes"<<endl;
count++;
con++;
}
else{
cout<<"No"<<endl;
}
}
return 0;
}
|
a.cc: In function 'int main()':
a.cc:11:15: error: no match for 'operator==' (operand types are 'std::vector<char>' and 'char')
11 | if(mozi[i]=='a'&&a+b>count){
| ~~~~~~~^~~~~
| | |
| | char
| std::vector<char>
In file included from /usr/include/c++/14/iosfwd:42,
from /usr/include/c++/14/ios:40,
from /usr/include/c++/14/ostream:40,
from /usr/include/c++/14/iostream:41,
from a.cc:1:
/usr/include/c++/14/bits/postypes.h:192:5: note: candidate: 'template<class _StateT> bool std::operator==(const fpos<_StateT>&, const fpos<_StateT>&)'
192 | operator==(const fpos<_StateT>& __lhs, const fpos<_StateT>& __rhs)
| ^~~~~~~~
/usr/include/c++/14/bits/postypes.h:192:5: note: template argument deduction/substitution failed:
a.cc:11:17: note: 'std::vector<char>' is not derived from 'const std::fpos<_StateT>'
11 | if(mozi[i]=='a'&&a+b>count){
| ^~~
In file included from /usr/include/c++/14/string:43,
from /usr/include/c++/14/bits/locale_classes.h:40,
from /usr/include/c++/14/bits/ios_base.h:41,
from /usr/include/c++/14/ios:44:
/usr/include/c++/14/bits/allocator.h:235:5: note: candidate: 'template<class _T1, class _T2> bool std::operator==(const allocator<_CharT>&, const allocator<_T2>&)'
235 | operator==(const allocator<_T1>&, const allocator<_T2>&)
| ^~~~~~~~
/usr/include/c++/14/bits/allocator.h:235:5: note: template argument deduction/substitution failed:
a.cc:11:17: note: 'std::vector<char>' is not derived from 'const std::allocator<_CharT>'
11 | if(mozi[i]=='a'&&a+b>count){
| ^~~
In file included from /usr/include/c++/14/string:48:
/usr/include/c++/14/bits/stl_iterator.h:441:5: note: candidate: 'template<class _Iterator> constexpr bool std::operator==(const reverse_iterator<_Iterator>&, const reverse_iterator<_Iterator>&)'
441 | operator==(const reverse_iterator<_Iterator>& __x,
| ^~~~~~~~
/usr/include/c++/14/bits/stl_iterator.h:441:5: note: template argument deduction/substitution failed:
a.cc:11:17: note: 'std::vector<char>' is not derived from 'const std::reverse_iterator<_Iterator>'
11 | if(mozi[i]=='a'&&a+b>count){
| ^~~
/usr/include/c++/14/bits/stl_iterator.h:486:5: note: candidate: 'template<class _IteratorL, class _IteratorR> constexpr bool std::operator==(const reverse_iterator<_Iterator>&, const reverse_iterator<_IteratorR>&)'
486 | operator==(const reverse_iterator<_IteratorL>& __x,
| ^~~~~~~~
/usr/include/c++/14/bits/stl_iterator.h:486:5: note: template argument deduction/substitution failed:
a.cc:11:17: note: 'std::vector<char>' is not derived from 'const std::reverse_iterator<_Iterator>'
11 | if(mozi[i]=='a'&&a+b>count){
| ^~~
/usr/include/c++/14/bits/stl_iterator.h:1667:5: note: candidate: 'template<class _IteratorL, class _IteratorR> constexpr bool std::operator==(const move_iterator<_IteratorL>&, const move_iterator<_IteratorR>&)'
1667 | operator==(const move_iterator<_IteratorL>& __x,
| ^~~~~~~~
/usr/include/c++/14/bits/stl_iterator.h:1667:5: note: template argument deduction/substitution failed:
a.cc:11:17: note: 'std::vector<char>' is not derived from 'const std::move_iterator<_IteratorL>'
11 | if(mozi[i]=='a'&&a+b>count){
| ^~~
/usr/include/c++/14/bits/stl_iterator.h:1737:5: note: candidate: 'template<class _Iterator> constexpr bool std::operator==(const move_iterator<_IteratorL>&, const move_iterator<_IteratorL>&)'
1737 | operator==(const move_iterator<_Iterator>& __x,
| ^~~~~~~~
/usr/include/c++/14/bits/stl_iterator.h:1737:5: note: template argument deduction/substitution failed:
a.cc:11:17: note: 'std::vector<char>' is not derived from 'const std::move_iterator<_IteratorL>'
11 | if(mozi[i]=='a'&&a+b>count){
| ^~~
In file included from /usr/include/c++/14/bits/stl_algobase.h:64,
from /usr/include/c++/14/string:51:
/usr/include/c++/14/bits/stl_pair.h:1033:5: note: candidate: 'template<class _T1, class _T2> constexpr bool std::operator==(const pair<_T1, _T2>&, const pair<_T1, _T2>&)'
1033 | operator==(const pair<_T1, _T2>& __x, const pair<_T1, _T2>& __y)
| ^~~~~~~~
/usr/include/c++/14/bits/stl_pair.h:1033:5: note: template argument deduction/substitution failed:
a.cc:11:17: note: 'std::vector<char>' is not derived from 'const std::pair<_T1, _T2>'
11 | if(mozi[i]=='a'&&a+b>count){
| ^~~
In file included from /usr/include/c++/14/bits/basic_string.h:47,
from /usr/include/c++/14/string:54:
/usr/include/c++/14/string_view:629:5: note: candidate: 'template<class _CharT, class _Traits> constexpr bool std::operator==(basic_string_view<_CharT, _Traits>, __type_identity_t<basic_string_view<_CharT, _Traits> >)'
629 | operator==(basic_string_view<_CharT, _Traits> __x,
| ^~~~~~~~
/usr/include/c++/14/string_view:629:5: note: template argument deduction/substitution failed:
a.cc:11:17: note: 'std::vector<char>' is not derived from 'std::basic_string_view<_CharT, _Traits>'
11 | if(mozi[i]=='a'&&a+b>count){
| ^~~
/usr/include/c++/14/string_view:637:5: note: candidate: 'template<class _CharT, class _Traits> constexpr bool std::operator==(basic_string_view<_CharT, _Traits>, basic_string_view<_CharT, _Traits>)'
637 | operator==(basic_string_view<_CharT, _Traits> __x,
| ^~~~~~~~
/usr/include/c++/14/string_view:637:5: note: template argument deduction/substitution failed:
a.cc:11:17: note: 'std::vector<char>' is not derived from 'std::basic_string_view<_CharT, _Traits>'
11 | if(mozi[i]=='a'&&a+b>count){
| ^~~
/usr/include/c++/14/string_view:644:5: note: candidate: 'template<class _CharT, class _Traits> constexpr bool std::operator==(__type_identity_t<basic_string_view<_CharT, _Traits> >, basic_string_view<_CharT, _Traits>)'
644 | operator==(__type_identity_t<basic_string_view<_CharT, _Traits>> __x,
| ^~~~~~~~
/usr/include/c++/14/string_view:644:5: note: template argument deduction/substitution failed:
a.cc:11:17: note: mismatched types 'std::basic_string_view<_CharT, _Traits>' and 'char'
11 | if(mozi[i]=='a'&&a+b>count){
| ^~~
/usr/include/c++/14/bits/basic_string.h:3755:5: note: candidate: 'template<class _CharT, class _Traits, class _Alloc> bool std::operator==(const __cxx11::basic_string<_CharT, _Traits, _Allocator>&, const __cxx11::basic_string<_CharT, _Traits, _Allocator>&)'
3755 | operator==(const basic_string<_CharT, _Traits, _Alloc>& __lhs,
| ^~~~~~~~
/usr/include/c++/14/bits/basic_string.h:3755:5: note: template argument deduction/substitution failed:
a.cc:11:17: note: 'std::vector<char>' is not derived from 'const std::__cxx11::basic_string<_CharT, _Traits, _Allocator>'
11 | if(mozi[i]=='a'&&a+b>count){
| ^~~
/usr/include/c++/14/bits/basic_string.h:3772:5: note: candidate: 'template<class _CharT, class _Traits, class _Alloc> bool std::operator==(const __cxx11::basic_string<_CharT, _Traits, _Allocator>&, const _CharT*)'
3772 | operator==(const basic_string<_CharT, _Traits, _Alloc>& __lhs,
| ^~~~~~~~
/usr/include/c++/14/bits/basic_string.h:3772:5: note: template argument deduction/substitution failed:
a.cc:11:17: note: 'std::vector<char>' is not derived from 'const std::__cxx11::basic_string<_CharT, _Traits, _Allocator>'
11 | if(mozi[i]=='a'&&a+b>count){
| ^~~
/usr/include/c++/14/bits/basic_string.h:3819:5: note: candidate: 'template<class _CharT, class _Traits, class _Alloc> bool std::operator==(const _CharT*, const __cxx11::basic_string<_CharT, _Traits, _Allocator>&)'
3819 | operator==(const _CharT* __lhs,
| ^~~~~~~~
/usr/include/c++/14/bits/basic_string.h:3819:5: note: template argument deduction/substitution failed:
a.cc:11:17: note: mismatched types 'const _CharT*' and 'std::vector<char>'
11 | if(mozi[i]=='a'&&a+b>count){
| ^~~
In file included from /usr/include/c++/14/bits/memory_resource.h:47,
from /usr/include/c++/14/string:68:
/usr/include/c++/14/tuple:2558:5: note: candidate: 'template<class ... _TElements, class ... _UElements> constexpr bool std::operator==(const tuple<_UTypes ...>&, const tuple<_Elements ...>&)'
2558 | operator==(const tuple<_TElements...>& __t,
| ^~~~~~~~
/usr/include/c++/14/tuple:2558:5: note: template argument deduction/substitution failed:
a.cc:11:17: note: 'std::vector<char>' is not derived from 'const std::tuple<_UTypes ...>'
11 | if(mozi[i]=='a'&&a+b>count){
| ^~~
In file included from /usr/include/c++/14/bits/locale_facets.h:48,
from /usr/include/c++/14/bits/basic_ios.h:37,
from /usr/include/c++/14/ios:46:
/usr/include/c++/14/bits/streambuf_iterator.h:234:5: note: candidate: 'template<class _CharT, class _Traits> bool std::operator==(const istreambuf_iterator<_CharT, _Traits>&, const istreambuf_iterator<_CharT, _Traits>&)'
234 | operator==(const istreambuf_iterator<_CharT, _Traits>& __a,
| ^~~~~~~~
/usr/include/c++/14/bits/streambuf_iterator.h:234:5: note: template argument deduction/substitution failed:
a.cc:11:17: note: 'std::vector<char>' is not derived from 'const std::istreambuf_iterator<_CharT, _Traits>'
11 | if(mozi[i]=='a'&&a+b>count){
| ^~~
In file included from /usr/include/c++/14/vector:66,
from a.cc:2:
/usr/include/c++/14/bits/stl_vector.h:2050:5: note: candidate: 'template<class _Tp, class _Alloc> bool std::operator==(const vector<_Tp, _Alloc>&, const vector<_Tp, _Alloc>&)'
2050 | operator==(const vector<_Tp, _Alloc>& __x, const vector<_Tp, _Alloc>& __y)
| ^~~~~~~~
/usr/include/c++/14/bits/stl_vector.h:2050:5: note: template argument deduction/substitution failed:
a.cc:11:17:
|
s607310348
|
p03971
|
C++
|
#include<iostream>
#include<vector>
using namespace std;
int main(){
int n,a,b,con=0,count=0;
cin>>n>>a>>b;
vector<char> mozi[n];
cin>>mozi;
int i,j;
for(i=0;i<n;i++){
if(mozi[i]=='a'&&a+b>count){
cout<<"Yes"<<endl;
count++;
}
else if(a[i]=='b'&&con<b&&count<a+b){
cout<<"Yes"<<endl;
count++;
con++;
}
else{
cout<<"No"<<endl;
}
}
return 0;
}
|
a.cc: In function 'int main()':
a.cc:8:6: error: no match for 'operator>>' (operand types are 'std::istream' {aka 'std::basic_istream<char>'} and 'std::vector<char> [n]')
8 | cin>>mozi;
| ~~~^~~~~~
| | |
| | std::vector<char> [n]
| std::istream {aka std::basic_istream<char>}
In file included from /usr/include/c++/14/iostream:42,
from a.cc:1:
/usr/include/c++/14/istream:170:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(bool&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' (near match)
170 | operator>>(bool& __n)
| ^~~~~~~~
/usr/include/c++/14/istream:170:7: note: conversion of argument 1 would be ill-formed:
a.cc:8:8: error: cannot bind non-const lvalue reference of type 'bool&' to a value of type 'std::vector<char>*'
8 | cin>>mozi;
| ^~~~
/usr/include/c++/14/istream:174:7: note: candidate: 'std::basic_istream<_CharT, _Traits>& std::basic_istream<_CharT, _Traits>::operator>>(short int&) [with _CharT = char; _Traits = std::char_traits<char>]' (near match)
174 | operator>>(short& __n);
| ^~~~~~~~
/usr/include/c++/14/istream:174:7: note: conversion of argument 1 would be ill-formed:
a.cc:8:8: error: invalid conversion from 'std::vector<char>*' to 'short int' [-fpermissive]
8 | cin>>mozi;
| ^~~~
| |
| std::vector<char>*
a.cc:8:8: error: cannot bind rvalue '(short int)((std::vector<char>*)(& mozi))' to 'short int&'
/usr/include/c++/14/istream:177:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(short unsigned int&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' (near match)
177 | operator>>(unsigned short& __n)
| ^~~~~~~~
/usr/include/c++/14/istream:177:7: note: conversion of argument 1 would be ill-formed:
a.cc:8:8: error: invalid conversion from 'std::vector<char>*' to 'short unsigned int' [-fpermissive]
8 | cin>>mozi;
| ^~~~
| |
| std::vector<char>*
a.cc:8:8: error: cannot bind rvalue '(short unsigned int)((std::vector<char>*)(& mozi))' to 'short unsigned int&'
/usr/include/c++/14/istream:181:7: note: candidate: 'std::basic_istream<_CharT, _Traits>& std::basic_istream<_CharT, _Traits>::operator>>(int&) [with _CharT = char; _Traits = std::char_traits<char>]' (near match)
181 | operator>>(int& __n);
| ^~~~~~~~
/usr/include/c++/14/istream:181:7: note: conversion of argument 1 would be ill-formed:
a.cc:8:8: error: invalid conversion from 'std::vector<char>*' to 'int' [-fpermissive]
8 | cin>>mozi;
| ^~~~
| |
| std::vector<char>*
a.cc:8:8: error: cannot bind rvalue '(int)((std::vector<char>*)(& mozi))' to 'int&'
/usr/include/c++/14/istream:184:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(unsigned int&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' (near match)
184 | operator>>(unsigned int& __n)
| ^~~~~~~~
/usr/include/c++/14/istream:184:7: note: conversion of argument 1 would be ill-formed:
a.cc:8:8: error: invalid conversion from 'std::vector<char>*' to 'unsigned int' [-fpermissive]
8 | cin>>mozi;
| ^~~~
| |
| std::vector<char>*
a.cc:8:8: error: cannot bind rvalue '(unsigned int)((std::vector<char>*)(& mozi))' to 'unsigned int&'
/usr/include/c++/14/istream:188:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(long int&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' (near match)
188 | operator>>(long& __n)
| ^~~~~~~~
/usr/include/c++/14/istream:188:7: note: conversion of argument 1 would be ill-formed:
a.cc:8:8: error: invalid conversion from 'std::vector<char>*' to 'long int' [-fpermissive]
8 | cin>>mozi;
| ^~~~
| |
| std::vector<char>*
a.cc:8:8: error: cannot bind rvalue '(long int)((std::vector<char>*)(& mozi))' to 'long int&'
/usr/include/c++/14/istream:192:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(long unsigned int&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' (near match)
192 | operator>>(unsigned long& __n)
| ^~~~~~~~
/usr/include/c++/14/istream:192:7: note: conversion of argument 1 would be ill-formed:
a.cc:8:8: error: invalid conversion from 'std::vector<char>*' to 'long unsigned int' [-fpermissive]
8 | cin>>mozi;
| ^~~~
| |
| std::vector<char>*
a.cc:8:8: error: cannot bind rvalue '(long unsigned int)((std::vector<char>*)(& mozi))' to 'long unsigned int&'
/usr/include/c++/14/istream:199: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)
199 | operator>>(long long& __n)
| ^~~~~~~~
/usr/include/c++/14/istream:199:7: note: conversion of argument 1 would be ill-formed:
a.cc:8:8: error: invalid conversion from 'std::vector<char>*' to 'long long int' [-fpermissive]
8 | cin>>mozi;
| ^~~~
| |
| std::vector<char>*
a.cc:8:8: error: cannot bind rvalue '(long long int)((std::vector<char>*)(& mozi))' to 'long long int&'
/usr/include/c++/14/istream:203: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)
203 | operator>>(unsigned long long& __n)
| ^~~~~~~~
/usr/include/c++/14/istream:203:7: note: conversion of argument 1 would be ill-formed:
a.cc:8:8: error: invalid conversion from 'std::vector<char>*' to 'long long unsigned int' [-fpermissive]
8 | cin>>mozi;
| ^~~~
| |
| std::vector<char>*
a.cc:8:8: error: cannot bind rvalue '(long long unsigned int)((std::vector<char>*)(& mozi))' to 'long long unsigned int&'
/usr/include/c++/14/istream:328: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)
328 | operator>>(void*& __p)
| ^~~~~~~~
/usr/include/c++/14/istream:328:7: note: conversion of argument 1 would be ill-formed:
a.cc:8:8: error: cannot bind non-const lvalue reference of type 'void*&' to an rvalue of type 'void*'
8 | cin>>mozi;
| ^~~~
/usr/include/c++/14/istream:219:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(float&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]'
219 | operator>>(float& __f)
| ^~~~~~~~
/usr/include/c++/14/istream:219:25: note: no known conversion for argument 1 from 'std::vector<char> [n]' to 'float&'
219 | operator>>(float& __f)
| ~~~~~~~^~~
/usr/include/c++/14/istream:223:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(double&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]'
223 | operator>>(double& __f)
| ^~~~~~~~
/usr/include/c++/14/istream:223:26: note: no known conversion for argument 1 from 'std::vector<char> [n]' to 'double&'
223 | operator>>(double& __f)
| ~~~~~~~~^~~
/usr/include/c++/14/istream:227:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(long double&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]'
227 | operator>>(long double& __f)
| ^~~~~~~~
/usr/include/c++/14/istream:227:31: note: no known conversion for argument 1 from 'std::vector<char> [n]' to 'long double&'
227 | operator>>(long double& __f)
| ~~~~~~~~~~~~~^~~
/usr/include/c++/14/istream:122:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(__istream_type& (*)(__istream_type&)) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]'
122 | operator>>(__istream_type& (*__pf)(__istream_type&))
| ^~~~~~~~
/usr/include/c++/14/istream:122:36: note: no known conversion for argument 1 from 'std::vector<char> [n]' to 'std::basic_istream<char>::__istream_type& (*)(std::basic_istream<char>::__istream_type&)' {aka 'std::basic_istream<char>& (*)(std::basic_istream<char>&)'}
122 | operator>>(__istream_type& (*__pf)(__istream_type&))
| ~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~
/usr/include/c++/14/istream:126:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(__ios_type& (*)(__ios_type&)) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>; __ios_type = std::basic_ios<char>]'
126 | operator>>(__ios_type& (*__pf)(__ios_type&))
| ^~~~~~~~
/usr/include/c++/14/istream:126:32: note: no known conversion for argument 1 from 'std::vector<char> [n]' to 'std::basic_istream<char>::__ios_type& (*)(std::basic_istream<char>::__ios_type&)' {aka 'std::basic_ios<char>& (*)(std::basic_ios
|
s206532686
|
p03971
|
C++
|
#include<iostream>
using std::cout;
using std::cin;
using std::endl;
int main()
{
int n, a, b;
cin >> n >> a >> b;
int domestic = 0;
int foreigner = 0;
int max = a + b;
string s;
cin >> s;
for (int i = 0; i < n; i ++)
{
if (s.at(i) == 'a')
{
if (domestic + foreigner < max)
{
cout << "Yes" << endl;
domestic ++;
}
else cout << "No" << endl;
}
else if (s.at(i) == 'b')
{
if (domestic + foreigner < max && foreigner < b)
{
cout << "Yes" << endl;
foreigner ++;
}
else cout << "No" << endl;
}
else
cout << "No" << endl;
}
return 0;
}
|
a.cc: In function 'int main()':
a.cc:15:3: error: 'string' was not declared in this scope
15 | string s;
| ^~~~~~
a.cc:15:3: note: suggested alternatives:
In file included from /usr/include/c++/14/iosfwd:41,
from /usr/include/c++/14/ios:40,
from /usr/include/c++/14/ostream:40,
from /usr/include/c++/14/iostream:41,
from a.cc:1:
/usr/include/c++/14/bits/stringfwd.h:77:33: note: 'std::string'
77 | typedef basic_string<char> string;
| ^~~~~~
In file included from /usr/include/c++/14/bits/locale_classes.h:40,
from /usr/include/c++/14/bits/ios_base.h:41,
from /usr/include/c++/14/ios:44:
/usr/include/c++/14/string:76:11: note: 'std::pmr::string'
76 | using string = basic_string<char>;
| ^~~~~~
a.cc:16:10: error: 's' was not declared in this scope
16 | cin >> s;
| ^
|
s241684066
|
p03971
|
C++
|
#include <bits/stdc++.h>
using namespace std;
using ll = long long; // ll は long long と同じとする。(int64_t)
int main(){
int N , A , B;
cin >> N >> A >> B;
int sum = A + B;{
char C;
cin >> C;
cout << (c == 'a' && AB-- > 0 || c == 'b' && b-- > 0 && ab-- > 0 ? "Yes" : "No") << endl;
}
}
|
a.cc: In function 'int main()':
a.cc:10:18: error: 'c' was not declared in this scope
10 | cout << (c == 'a' && AB-- > 0 || c == 'b' && b-- > 0 && ab-- > 0 ? "Yes" : "No") << endl;
| ^
a.cc:10:30: error: 'AB' was not declared in this scope; did you mean 'B'?
10 | cout << (c == 'a' && AB-- > 0 || c == 'b' && b-- > 0 && ab-- > 0 ? "Yes" : "No") << endl;
| ^~
| B
a.cc:10:54: error: 'b' was not declared in this scope
10 | cout << (c == 'a' && AB-- > 0 || c == 'b' && b-- > 0 && ab-- > 0 ? "Yes" : "No") << endl;
| ^
a.cc:10:65: error: 'ab' was not declared in this scope; did you mean 'abs'?
10 | cout << (c == 'a' && AB-- > 0 || c == 'b' && b-- > 0 && ab-- > 0 ? "Yes" : "No") << endl;
| ^~
| abs
|
s631699573
|
p03971
|
C++
|
int main() {
int N, A, B;
string S;
cin >> N >> A >> B >> S;
int cnt = 0;
int acnt = 0;
for (char c : S) {
if (c == 'a') {
if (cnt < A + B) {
cout << "Yes" << endl;
cnt ++;
}
else {
cout << "No" << endl;
}
}
if (c == 'b') {
acnt++;
if (cnt < A + B) {
if (acnt <= B) {
cout << "Yes" << endl;
cnt++;
}
else {
cout << "NO" << endl;
}
}
else {
cout << "No" << endl;
}
}
if (c == 'c') {
cout << "No" << endl;
}
}
}
|
a.cc: In function 'int main()':
a.cc:3:3: error: 'string' was not declared in this scope
3 | string S;
| ^~~~~~
a.cc:4:3: error: 'cin' was not declared in this scope
4 | cin >> N >> A >> B >> S;
| ^~~
a.cc:4:25: error: 'S' was not declared in this scope
4 | cin >> N >> A >> B >> S;
| ^
a.cc:10:9: error: 'cout' was not declared in this scope
10 | cout << "Yes" << endl;
| ^~~~
a.cc:10:26: error: 'endl' was not declared in this scope
10 | cout << "Yes" << endl;
| ^~~~
a.cc:14:9: error: 'cout' was not declared in this scope
14 | cout << "No" << endl;
| ^~~~
a.cc:14:25: error: 'endl' was not declared in this scope
14 | cout << "No" << endl;
| ^~~~
a.cc:21:11: error: 'cout' was not declared in this scope
21 | cout << "Yes" << endl;
| ^~~~
a.cc:21:28: error: 'endl' was not declared in this scope
21 | cout << "Yes" << endl;
| ^~~~
a.cc:25:11: error: 'cout' was not declared in this scope
25 | cout << "NO" << endl;
| ^~~~
a.cc:25:27: error: 'endl' was not declared in this scope
25 | cout << "NO" << endl;
| ^~~~
a.cc:29:9: error: 'cout' was not declared in this scope
29 | cout << "No" << endl;
| ^~~~
a.cc:29:25: error: 'endl' was not declared in this scope
29 | cout << "No" << endl;
| ^~~~
a.cc:33:7: error: 'cout' was not declared in this scope
33 | cout << "No" << endl;
| ^~~~
a.cc:33:23: error: 'endl' was not declared in this scope
33 | cout << "No" << endl;
| ^~~~
|
s107991744
|
p03971
|
C++
|
#include<bits/stdc++.h>
using namespace std;
int main(){
int N,A,B;
int sum=0;
int pon=0;
cin>>N>>A>>B;
string k;
vector<int> vec;
for(int i=0;i<N;i++){
if(k.at(i)==a&&sum<A+B)
{cout<<"Yes"<<endl;
sum++;
}
if(k.at(i)==b&&sum<A+B&&pon<=B){
cout<<"Yes"<<endl;
sum++;
pon++;
}
else{cout<<"No"<<endl;}
}
}
|
a.cc: In function 'int main()':
a.cc:11:15: error: 'a' was not declared in this scope
11 | if(k.at(i)==a&&sum<A+B)
| ^
a.cc:15:17: error: 'b' was not declared in this scope
15 | if(k.at(i)==b&&sum<A+B&&pon<=B){
| ^
|
s289654869
|
p03971
|
C++
|
import collections
import sys
import numpy as np
sys.setrecursionlimit(1000000000)
from heapq import heapify,heappop,heappush,heappushpop
MOD = 10**9+7
import itertools
import math
n,a,b = map(int,input().split())
s = input()
cnt = 0
cnt_b = 0
for i in range(len(s)):
if s[i] == "c":
print("No")
elif s[i] == "a":
if cnt < a + b:
print("Yes")
cnt += 1
else:
print("No")
else:
if cnt < a + b and cnt_b<b:
print("Yes")
cnt += 1
cnt_b += 1
else:
print("No")
|
a.cc:1:1: error: 'import' does not name a type
1 | import collections
| ^~~~~~
a.cc:1:1: note: C++20 'import' only available with '-fmodules-ts'
|
s907924352
|
p03971
|
C++
|
#include <bits/stdc++.h>
using namespace std;
int main() {
// freopen("input.txt", "r", stdin);
// freopen("output.txt", "w", stdout);
int n, a, b;
cin>>n>>a>>b;
string s;
cin>>s;
int passed = 0;
int passed_oversea = 0;
for (int i=0; i<n; i++){
if (s[i]=='a' and passed < a+b){
puts("Yes");
passed++;
}
else if (s[i]=='b' and passed < a+b and passed_oversea<b){
puts("Yes");
passed++;
passed_oversea++;
}
else {
puts("No");
}
}
}
#include <bits/stdc++.h>
using namespace std;
int main() {
// freopen("input.txt", "r", stdin);
// freopen("output.txt", "w", stdout);
int n, a, b;
cin>>n>>a>>b;
string s;
cin>>s;
int passed = 0;
int passed_oversea = 0;
for (int i=0; i<n; i++){
if (s[i]=='a' and passed < a+b){
puts("Yes");
passed++;
}
else if (s[i]=='b' and passed < a+b and passed_oversea<b){
puts("Yes");
passed++;
passed_oversea++;
}
else {
puts("No");
}
}
}
|
a.cc:32:5: error: redefinition of 'int main()'
32 | int main() {
| ^~~~
a.cc:4:5: note: 'int main()' previously defined here
4 | int main() {
| ^~~~
|
s846448053
|
p03971
|
C
|
#include <stdio.h>
int main()
{
int n,a,b;
scanf("%d%d%d",&n,&a,&b);
char s[n + 1];
scanf("%s",&s);
int i = 0;
int countera = 0;
int counterb = 0;
while (s[i])
{
if ((s[i] == 'a' && countera <= a+b))
{
printf("Yes\n");
countera++;
}
else if (s[i] == 'b' && counter <= a+b && counter <= b)
{
counterb++;
}
else
{
printf("No\n");
}
i++;
}
}
|
main.c: In function 'main':
main.c:18:29: error: 'counter' undeclared (first use in this function); did you mean 'counterb'?
18 | else if (s[i] == 'b' && counter <= a+b && counter <= b)
| ^~~~~~~
| counterb
main.c:18:29: note: each undeclared identifier is reported only once for each function it appears in
|
s205331265
|
p03971
|
C++
|
#include<bits/stdc++.h>
using namespace std;
#define int long long
#define double long double
#define fo(a,b) for(int a=0;a<b;a++)
#define Sort(a) sort(a.begin(),a.end())
#define rev(a) reverse(a.begin(),a.end())
#define fi first
#define se second
#define sz size()
#define bgn begin()
#define en end()
#define pb push_back
#define pp() pop_back()
#define V vector
#define P pair
#define yuko(a) setprecision(a)
#define uni(a) a.erase(unique(a.begin(),a.end()),a.end())
#define Q queue
#define pri priority_queue
#define Pri priority_queue<int,vector<int>,greater<int>>
#define PriP priority_queue<P<int,int>,vector<P<int,int>>,greater<P<int,int>>>
#define ff first.first
#define fs first.second
#define sf second.first
#define ss second.second
#define all(a) (a).begin(),(a).end()
#define elif else if
int low(V<int> &a,int b){
auto c=lower_bound(a.begin(),a.end(),b);
int d=c-a.bgn;
return d;
}
int upp(V<int> &a,int b){
auto c=upper_bound(a.begin(),a.end(),b);
int d=c-a.bgn;
return d;
}
template<class T>
void cou(vector<vector<T>> a){
int b=a.size();
int c=a[0].size();
fo(i,b){
fo(j,c){
cout<<a[i][j];
if(j==c-1)
cout<<endl;
else
cout<<' ';
}
}
}
int wari(int a,int b) {
if(a%b==0)
return a/b;
else
return a/b+1;
}
int keta(int a){
double b=a;
b=log10(b);
int c=b;
return c+1;
}
int souwa(int a){
return a*(a+1)/2;
}
int gcm(int a,int b){
if(a%b==0)
return b;
return gcm(b,a%b);
}
bool prime(int a){
if(a<2)
return false;
else if(a==2)
return true;
else if(a%2==0)
return false;
for(int i=3;i<=sqrt(a)+1;i+=2){
if (a%i==0)
return false;
}
return true;
}
struct Union{
vector<int> par;
Union(int a){
par=vector<int>(a,-1);
}
int find(int a){
if(par[a]<0)
return a;
else
return par[a]=find(par[a]);
}
bool same(int a,int b){
return find(a)==find(b);
}
int Size(int a){
return -par[find(a)];
}
void unite(int a,int b){
a=find(a);
b=find(b);
if(a==b)
return;
if(Size(b)>Size(a))
swap<int>(a,b);
par[a]+=par[b];
par[b]=a;
}
};
int ketas(int a){
string b=to_string(a);
int c=0;
fo(i,keta(a)){
c+=b[i]-'0';
}
return c;
}
bool fe(int a,int b){
a%=10;
b%=10;
if(a==0)
a=10;
if(b==0)
b=10;
if(a>b)
return true;
else
return false;
}
int INF=1000000007;
struct edge{int s,t,d; };
V<int> mojisyu(string a){
V<int> b(26,0);
fo(i,a.sz){
b[a[i]-'a']++;
}
return b;
}
int wa2(int a){
if(a%2==1)
return a/2;
return a/2-1;
}
/*signed main(){
int a,b,c;
cin>>a>>b>>c;
V<V<edge>> d(a);
fo(i,b){
edge e;
cin>>e.s>>e.t>>e.d;
d[e.s].pb(e);
}
V<int> e(a,INF);
e[c]=0;
priority_queue<P<int,int>,V<P<int,int>>,greater<P<int,int>>> f;
f.push({0,c});
int h=INF;
while(!f.empty()){
P<int,int> g;
g=f.top();
f.pop();
int v = g.second, i = g.first;
for(edge l : d[v]){
if(e[l.t] > i + l.d){
e[l.t] = i + l.d;
f.push({i+l.d , l.t});
}
}
}
fo(i,a){
if(e[i]==INF)
cout<<"INF"<<endl;
else
cout<<e[i]<<endl;
}
}
?*/
int nCr(int n,int r){
int a=1;
r=min(r,n-r);
for(int i=n;i>n-r;i--){
a*=i;
a/=n-i+1;
}
return a;
}
/*void sea(int x,int y){
if(x<0||a<=x||y<0||b<=y||c[x][y]=='#')
return;
if(d[x][y])
return;
d[x][y]++;
sea(x+1,y);
sea(x-1,y);
sea(x,y+1);
sea(x,y-1);
}*/
int kaijou(int a){
int b=1;
fo(i,a)
b*=i+1;
return b;
}
int nPr(int a,int b){
if(a<b)
return 0;
if(b==0)
return 1;
int c=1;
for(int i=a;i>a-b;i--){
c*=i;
c%=INF;
}
return c;
}
long long modpow(long long a, long long n, long long mod) {
long long res = 1;
while (n > 0) {
if (n & 1) res = res * a % mod;
a = a * a % mod;
n >>= 1;
}
return res;
}
// a^{-1} mod を計算する
long long modinv(long long a, long long mod) {
return modpow(a, mod - 2, mod);
}
int lcm(int a,int b){
int c=modinv(gcm(a,b),INF);
return ((a*c)%INF)*(b%INF)%INF;
}
int MOD=INF;
int fac[1000010], finv[1000010], inv[1000010];
// テーブルを作る前処理
//先にCOMinit()で前処理をする
//ABC145D
void COMinit() {
fac[0]=fac[1]=1;
finv[0]=finv[1]=1;
inv[1]=1;
for(int i=2;i<1000010;i++){
fac[i]=fac[i-1]*i%MOD;
inv[i]=MOD-inv[MOD%i]*(MOD/i)%MOD;
finv[i]=finv[i-1]*inv[i]%MOD;
}
}
// 二項係数計算
int COM(int n,int k){
if(n<k)
return 0;
if(n<0||k<0)
return 0;
return fac[n]*(finv[k]*finv[n-k]%MOD)%MOD;
}
bool naka(int a,int b,V<V<char>> c){
return (a>=0&&b>=0&&a<c.sz&&b<c[0].sz);
}
V<P<int,int>> mawari8={{0,-1},{0,1},{1,0},{-1,0},{-1,-1},{1,1},{1,-1},{-1,-1}};
int inf=1000000000000000007;
/*
signed main(){
int a,b,c;
cin>>a>>b>>c;
V<V<edge>> d(a);
fo(i,b){
edge e;
cin>>e.s>>e.t>>e.d;
d[e.s].pb(e);
}
V<int> e(a,INF);
e[c]=0;
priority_queue<P<int,int>,V<P<int,int>>,greater<P<int,int>>> f;
f.push({0,c});
int h=INF;
while(!f.empty()){
P<int,int> g;
g=f.top();
f.pop();
int v = g.second, i = g.first;
for(edge l : d[v]){
if(e[l.t] > i + l.d){
e[l.t] = i + l.d;
f.push({i+l.d , l.t});
}
}
}
fo(i,a){
if(e[i]==INF)
cout<<"INF"<<endl;
else
cout<<e[i]<<endl;
}
}*/
V<P<int,int>> mawari4={{0,-1},{0,1},{1,0},{-1,0}};
//最短経路の表 a(全部INFで初期化)
//縦横 x,y
//迷路 f
//スタートsx,sy
//ゴールgx,gy
//文字はgから使おうね
/*int bfs_haba(){
Q<P<int,int>> b;
a[sx][sy]=0;
b.push({sx,sy});
while(!b.empty()){
P<int,int> c=b.front();
b.pop();
if(c.fi==gx&&c.se==gy){
break;
}
fo(i,4){
int d=c.fi+mawari4[i].fi;
int e=c.se+mawari4[i].se;
if(0<=d&&0<=e&&d<x&&e<y&&f[d][e]!='#'&&a[d][e]==INF){
b.push({d,e});
a[d][e]=1+a[c.fi][c.se];
}
}
}
return a[gx][gy];
}*/
V<int> onajibubun(string a){
V<int> b(a.sz);
for(int i=1,j=0;i<a.sz;i++){
if(i+b[i-j]<j+b[j])
b[i]=b[i-j];
else{
int c=max<int>(0,j+b[j]-i);
while(i+c<a.sz&&a[c]==a[i+c])
c++;
b[i]=c;
j=i;
}
}
b[0]=a.sz;
return b;
}
//各頂点ごとにどこに辺が出てるかの表がc
//各頂点ごとの色を表すV<int>(頂点数max)のcolorを用意する
//aはどこ塗るか、bは何で塗るかなので、(0,1,c)でよぶとおけ
V<int> color(205);
bool nibu_hantei(int a,int b,V<V<int>> c){
color[a]=b;
fo(i,c[a].sz){
if(b==color[c[a][i]])
return false;
if(color[c[a][i]]==0&&!nibu_hantei(c[a][i],-b,c))
return false;
}
return true;
}
//aは頂点数
//nibu_hanteiの上にcolorを用意する
//各頂点ごとにどこに辺が出てるかの表がc
bool renketujanai_nibu_hantei(int a,V<V<int>> c){
fo(i,a){
if(color[i]==0){
if(!nibu_hantei(i,1,c))
return false;
}
}
return true;
}
struct segmin{
vector<int> seg;
int b;
segmin(V<int> a){
b=1;
while(b<a.sz)
b*=2;
seg=vector<int>(2*b-1,inf);
fo(i,a.sz){
seg[i+b-1]=a[i];
}
for(int i=b-2;i>=0;i--){
seg[i]=min(seg[2*i+1],seg[2*i+2]);
}
}
void update(int i,int a){
i+=b-1;
seg[i]=a;
while(i){
i=(i-1)/2;
seg[i]=min(seg[2*i+1],seg[2*i+2]);
}
}
//最初呼び出すときは要求区間x,y+1(yは添え字+1)とa=0,l=0,r=INFで
//l,rは探すところ
int getmin(int x,int y,int a,int l,int r){
if(r==INF)
r=b;
if(r<=x||y<=l)
return INF;
if(x<=l&&r<=y)
return seg[a];
int a1=getmin(x,y,2*a+1,l,(l+r)/2);
int a2=getmin(x,y,2*a+2,(l+r)/2,r);
return min(a1,a2);
}
};
struct segadd{
vector<int> seg;
int b;
segadd(V<int> a){
b=1;
while(b<a.sz)
b*=2;
seg=vector<int>(2*b-1,0);
fo(i,a.sz){
seg[i+b-1]=a[i];
}
for(int i=b-2;i>=0;i--){
seg[i]=seg[2*i+1]+seg[2*i+2];
}
}
void update(int i,int a){
i+=b-1;
seg[i]=a;
while(i){
i=(i-1)/2;
seg[i]=seg[2*i+1]+seg[2*i+2];
}
}
//最初呼び出すときは要求区間x,y+1(yは添え字+1)とa=0,l=0,r=INFで
//l,rは探すところ
int getadd(int x,int y,int a,int l,int r){
if(r==INF)
r=b;
if(r<=x||y<=l)
return 0;
if(x<=l&&r<=y)
return seg[a];
int a1=getadd(x,y,2*a+1,l,(l+r)/2);
int a2=getadd(x,y,2*a+2,(l+r)/2,r);
return a1+a2;
}
};
V<P<int,int>> factorize(int n){
V<P<int,int>> res;
for(int i=2; i*i<=n; i++){
if(n%i)
continue;
res.emplace_back(i,0);
while(n%i==0){
n/=i;
res.back().second++;
}
}
if(n!=1)
res.emplace_back(n,1);
return res;
}
int pow_kai(int a, int b){
int c=1;
while(b>0){//bit全部捨てるまで
if(b%2){//一番右のbitが1
c=c*a;
}
a=a*a;
b>>=1;//全体右に1つシフト
}
return c;
}
const int dx[4] = {1, 0, -1, 0};
const int dy[4] = {0, 1, 0, -1};
signed main(){
int n,a,b;
cin>>n>>a>>b;
string s;
cin>>s;
int c=0;
int d=0;
fo(i,n){
if(s[i]=='a'&&c<a+b){
cout<<"Yes"<<endl;
c++;
}
else if(s[i]=='b'&&c<a+b&&d<b){
cout<<"Yes"<<endl;
c++;
d++;
}
else
cout<<"No"<endl;
}
}
|
a.cc: In function 'int main()':
a.cc:495:17: error: no match for 'operator<' (operand types are 'std::basic_ostream<char>' and '<unresolved overloaded function type>')
495 | cout<<"No"<endl;
| ~~~~~~~~~~^~~~~
In file included from /usr/include/c++/14/regex:68,
from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:181,
from a.cc:1:
/usr/include/c++/14/bits/regex.h:1143:5: note: candidate: 'template<class _BiIter> bool std::__cxx11::operator<(const sub_match<_BiIter>&, const sub_match<_BiIter>&)'
1143 | operator<(const sub_match<_BiIter>& __lhs, const sub_match<_BiIter>& __rhs)
| ^~~~~~~~
/usr/include/c++/14/bits/regex.h:1143:5: note: template argument deduction/substitution failed:
a.cc:495:18: note: 'std::basic_ostream<char>' is not derived from 'const std::__cxx11::sub_match<_BiIter>'
495 | cout<<"No"<endl;
| ^~~~
/usr/include/c++/14/bits/regex.h:1224:5: note: candidate: 'template<class _Bi_iter, class _Ch_traits, class _Ch_alloc> bool std::__cxx11::operator<(__sub_match_string<_Bi_iter, _Ch_traits, _Ch_alloc>&, const sub_match<_BiIter>&)'
1224 | operator<(const __sub_match_string<_Bi_iter, _Ch_traits, _Ch_alloc>& __lhs,
| ^~~~~~~~
/usr/include/c++/14/bits/regex.h:1224:5: note: template argument deduction/substitution failed:
a.cc:495:18: note: 'std::basic_ostream<char>' is not derived from 'std::__cxx11::__sub_match_string<_Bi_iter, _Ch_traits, _Ch_alloc>'
495 | cout<<"No"<endl;
| ^~~~
/usr/include/c++/14/bits/regex.h:1317:5: note: candidate: 'template<class _Bi_iter, class _Ch_traits, class _Ch_alloc> bool std::__cxx11::operator<(const sub_match<_BiIter>&, __sub_match_string<_Bi_iter, _Ch_traits, _Ch_alloc>&)'
1317 | operator<(const sub_match<_Bi_iter>& __lhs,
| ^~~~~~~~
/usr/include/c++/14/bits/regex.h:1317:5: note: template argument deduction/substitution failed:
a.cc:495:18: note: 'std::basic_ostream<char>' is not derived from 'const std::__cxx11::sub_match<_BiIter>'
495 | cout<<"No"<endl;
| ^~~~
/usr/include/c++/14/bits/regex.h:1391:5: note: candidate: 'template<class _Bi_iter> bool std::__cxx11::operator<(const typename std::iterator_traits<_Iter>::value_type*, const sub_match<_BiIter>&)'
1391 | operator<(typename iterator_traits<_Bi_iter>::value_type const* __lhs,
| ^~~~~~~~
/usr/include/c++/14/bits/regex.h:1391:5: note: template argument deduction/substitution failed:
a.cc:495:18: note: couldn't deduce template parameter '_Bi_iter'
495 | cout<<"No"<endl;
| ^~~~
/usr/include/c++/14/bits/regex.h:1485:5: note: candidate: 'template<class _Bi_iter> bool std::__cxx11::operator<(const sub_match<_BiIter>&, const typename std::iterator_traits<_Iter>::value_type*)'
1485 | operator<(const sub_match<_Bi_iter>& __lhs,
| ^~~~~~~~
/usr/include/c++/14/bits/regex.h:1485:5: note: template argument deduction/substitution failed:
a.cc:495:18: note: 'std::basic_ostream<char>' is not derived from 'const std::__cxx11::sub_match<_BiIter>'
495 | cout<<"No"<endl;
| ^~~~
/usr/include/c++/14/bits/regex.h:1560:5: note: candidate: 'template<class _Bi_iter> bool std::__cxx11::operator<(const typename std::iterator_traits<_Iter>::value_type&, const sub_match<_BiIter>&)'
1560 | operator<(typename iterator_traits<_Bi_iter>::value_type const& __lhs,
| ^~~~~~~~
/usr/include/c++/14/bits/regex.h:1560:5: note: template argument deduction/substitution failed:
a.cc:495:18: note: couldn't deduce template parameter '_Bi_iter'
495 | cout<<"No"<endl;
| ^~~~
/usr/include/c++/14/bits/regex.h:1660:5: note: candidate: 'template<class _Bi_iter> bool std::__cxx11::operator<(const sub_match<_BiIter>&, const typename std::iterator_traits<_Iter>::value_type&)'
1660 | operator<(const sub_match<_Bi_iter>& __lhs,
| ^~~~~~~~
/usr/include/c++/14/bits/regex.h:1660:5: note: template argument deduction/substitution failed:
a.cc:495:18: note: 'std::basic_ostream<char>' is not derived from 'const std::__cxx11::sub_match<_BiIter>'
495 | cout<<"No"<endl;
| ^~~~
In file included from /usr/include/c++/14/bits/stl_algobase.h:64,
from /usr/include/c++/14/algorithm:60,
from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:51:
/usr/include/c++/14/bits/stl_pair.h:1045:5: note: candidate: 'template<class _T1, class _T2> constexpr bool std::operator<(const pair<_T1, _T2>&, const pair<_T1, _T2>&)'
1045 | operator<(const pair<_T1, _T2>& __x, const pair<_T1, _T2>& __y)
| ^~~~~~~~
/usr/include/c++/14/bits/stl_pair.h:1045:5: note: template argument deduction/substitution failed:
a.cc:495:18: note: 'std::basic_ostream<char>' is not derived from 'const std::pair<_T1, _T2>'
495 | cout<<"No"<endl;
| ^~~~
In file included from /usr/include/c++/14/bits/stl_algobase.h:67:
/usr/include/c++/14/bits/stl_iterator.h:448:5: note: candidate: 'template<class _Iterator> constexpr bool std::operator<(const reverse_iterator<_Iterator>&, const reverse_iterator<_Iterator>&)'
448 | operator<(const reverse_iterator<_Iterator>& __x,
| ^~~~~~~~
/usr/include/c++/14/bits/stl_iterator.h:448:5: note: template argument deduction/substitution failed:
a.cc:495:18: note: 'std::basic_ostream<char>' is not derived from 'const std::reverse_iterator<_Iterator>'
495 | cout<<"No"<endl;
| ^~~~
/usr/include/c++/14/bits/stl_iterator.h:493:5: note: candidate: 'template<class _IteratorL, class _IteratorR> constexpr bool std::operator<(const reverse_iterator<_Iterator>&, const reverse_iterator<_IteratorR>&)'
493 | operator<(const reverse_iterator<_IteratorL>& __x,
| ^~~~~~~~
/usr/include/c++/14/bits/stl_iterator.h:493:5: note: template argument deduction/substitution failed:
a.cc:495:18: note: 'std::basic_ostream<char>' is not derived from 'const std::reverse_iterator<_Iterator>'
495 | cout<<"No"<endl;
| ^~~~
/usr/include/c++/14/bits/stl_iterator.h:1694:5: note: candidate: 'template<class _IteratorL, class _IteratorR> constexpr bool std::operator<(const move_iterator<_IteratorL>&, const move_iterator<_IteratorR>&)'
1694 | operator<(const move_iterator<_IteratorL>& __x,
| ^~~~~~~~
/usr/include/c++/14/bits/stl_iterator.h:1694:5: note: template argument deduction/substitution failed:
a.cc:495:18: note: 'std::basic_ostream<char>' is not derived from 'const std::move_iterator<_IteratorL>'
495 | cout<<"No"<endl;
| ^~~~
/usr/include/c++/14/bits/stl_iterator.h:1760:5: note: candidate: 'template<class _Iterator> constexpr bool std::operator<(const move_iterator<_IteratorL>&, const move_iterator<_IteratorL>&)'
1760 | operator<(const move_iterator<_Iterator>& __x,
| ^~~~~~~~
/usr/include/c++/14/bits/stl_iterator.h:1760:5: note: template argument deduction/substitution failed:
a.cc:495:18: note: 'std::basic_ostream<char>' is not derived from 'const std::move_iterator<_IteratorL>'
495 | cout<<"No"<endl;
| ^~~~
In file included from /usr/include/c++/14/bits/basic_string.h:47,
from /usr/include/c++/14/string:54,
from /usr/include/c++/14/bitset:52,
from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:52:
/usr/include/c++/14/string_view:673:5: note: candidate: 'template<class _CharT, class _Traits> constexpr bool std::operator<(basic_string_view<_CharT, _Traits>, basic_string_view<_CharT, _Traits>)'
673 | operator< (basic_string_view<_CharT, _Traits> __x,
| ^~~~~~~~
/usr/include/c++/14/string_view:673:5: note: template argument deduction/substitution failed:
a.cc:495:18: note: 'std::basic_ostream<char>' is not derived from 'std::basic_string_view<_CharT, _Traits>'
495 | cout<<"No"<endl;
| ^~~~
/usr/include/c++/14/string_view:680:5: note: candidate: 'template<class _CharT, class _Traits> constexpr bool std::operator<(basic_string_view<_CharT, _Traits>, __type_identity_t<basic_string_view<_CharT, _Traits> >)'
680 | operator< (basic_string_view<_CharT, _Traits> __x,
| ^~~~~~~~
/usr/include/c++/14/string_view:680:5: note: template argument deduction/substitution failed:
a.cc:495:18: note: 'std::basic_ostream<char>' is not derived from 'std::basic_string_view<_CharT, _Traits>'
495 | cout<<"No"<endl;
| ^~~~
/usr/include/c++/14/string_view:688:5: note: candidate: 'template<class _CharT, class _Traits> constexpr bool std::operator<(__type_identity_t<basic_string_view<_CharT, _Traits> >, basic_string_view<_CharT, _Traits>)'
688 | operator< (__type_identity_t<basic_string_view<_CharT, _Traits>> __x,
| ^~~~~~~~
/usr/include/c++/14/string_view:688:5: note: template argument deduction/substitution failed:
a.cc:495:18: note: couldn't deduce template parameter '_CharT'
495 | cout<<"No"<endl;
| ^~~~
/usr/include/c++/14/bits/basic_string.h:3874:5: note: candidate: 'template<class _CharT, class _Traits, class _Alloc> bool std::operator<(const __cxx11::basic_string<_CharT, _Traits, _Allocator>&, const __cxx11::basic_string<_CharT, _Traits, _Allocator>&)'
3874 | operator<(const basic_string<_CharT, _Traits, _Alloc>& __lhs,
| ^~~~~~~~
/usr/include/c++/14/bits/basic_string.h:3874:5: note: template argument deduction/substitution failed:
a.cc:495:18: note: 'std::basic_ostream<char>' is not derived from 'const std::__cxx11::basic_string<_CharT, _Traits, _Allocator>'
495 | cout<<"No"<endl;
| ^~~~
/usr/include/c++/14/bits/basic_string.h:3888:5: note: candidate: 'template<class _CharT, class _Traits, class _Alloc> bool std::operator<(const __cxx11::basic_string<_CharT, _Traits, _Allocator>&, const _CharT*)'
3888 | operator<(const basic_string<_CharT, _Traits, _Alloc>& __lhs,
| ^~~~~~~~
/usr/include/c++/14/bits/basic_string.h:3888:5: note: template arg
|
s203794847
|
p03971
|
C++
|
#include <bits/stdc++.h>
using namespace std;
int main() {
int N,A,B;
string str = "S";
cin >> N >> A >> B >> S;
int P = 0;
int O = 0;
for(int H = 0;H < N;H++){
if(str.at(H) == 'a' && A + B > P){
cout << "Yes" << endl;
P++;
}
else{
cout << "No" << endl;
}
if(str.at(H) == 'b' && A + B > P && B > O){
cout << "Yes" << endl;
P++;
O++;
}
else{
cout << "No" << endl;
}
if(str.at(H) == 'c'){
cout << "No" << endl;
}
}
}
|
a.cc: In function 'int main()':
a.cc:7:27: error: 'S' was not declared in this scope
7 | cin >> N >> A >> B >> S;
| ^
|
s352744307
|
p03971
|
C++
|
#include <bits/stdc++.h>
using namespace std;
int main() {
int N,A,B;
string str = S;
cin >> N >> A >> B >> S;
int P = 0;
int O = 0;
for(int H = 0;H < N;H++){
if(str.at(H) == 'a' && A + B > P){
cout << "Yes" << endl;
P++;
}
else{
cout << "No" << endl;
}
if(str.at(H) == 'b' && A + B > P && B > O){
cout << "Yes" << endl;
P++;
O++;
}
else{
cout << "No" << endl;
}
if(str.at(H) == 'c'){
cout << "No" << endl;
}
}
}
|
a.cc: In function 'int main()':
a.cc:6:16: error: 'S' was not declared in this scope
6 | string str = S;
| ^
|
s703476761
|
p03971
|
C++
|
def solve():
n,a,b = map(int,input().split())
s = input()
cnt_a=0
cnt_b=0
for i in s:
if i=='a':
if cnt_a<a+b:
print('Yes')
cnt_a+=1
else:
print('No')
elif i=='b':
if cnt_a<a+b and cnt_b<b:
print('Yes')
cnt_b+=1
cnt_a+=1
else:
print('No')
else:
print('No')
if __name__ == "__main__":
solve()
|
a.cc:9:23: warning: multi-character character constant [-Wmultichar]
9 | print('Yes')
| ^~~~~
a.cc:12:23: warning: multi-character character constant [-Wmultichar]
12 | print('No')
| ^~~~
a.cc:15:23: warning: multi-character character constant [-Wmultichar]
15 | print('Yes')
| ^~~~~
a.cc:19:23: warning: multi-character character constant [-Wmultichar]
19 | print('No')
| ^~~~
a.cc:21:19: warning: multi-character character constant [-Wmultichar]
21 | print('No')
| ^~~~
a.cc:1:1: error: 'def' does not name a type
1 | def solve():
| ^~~
|
s035838456
|
p03971
|
C++
|
N, A , B = map(int,input().split())
S = input()
count_b = 0
count_total = 0
ans = ["No"] * N
for i in range(N):
if count_total >= A+B:
break
if S[i] == "c":
continue
if S[i] == "a":
count_total += 1
ans[i] = "Yes"
if S[i] == "b":
count_b += 1
if count_b <= B:
count_total += 1
ans[i] = "Yes"
for i in range(N):
print(ans[i])
|
a.cc:1:1: error: 'N' does not name a type
1 | N, A , B = map(int,input().split())
| ^
|
s233112598
|
p03971
|
C++
|
#include <bits/stdc++.h>
#define rep(i,n) for (int i = 0; i < (n); ++i)
using namespace std;
typedef long long ll;
int main(){
int N;
int A,B;
cin>>N>>A>>B;
string S;
cin>>S;
int sum = A+B;
int cnt =0;
int cntf =0;
for (size_t i = 0; i < N; i++)//A
{
if (S[i]=="a" && cnt<sum)
{
cout<<"Yes"<<endl;
cnt++;
}else if (S[i]=="b"&&cntf<B&&cnt<sum)//B
{
cout<<"Yes"<<endl;
cnt++;cntf++;
}else{
cout<<"No"<<endl;
cnt++;
}
}
}
|
a.cc: In function 'int main()':
a.cc:17:16: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
17 | if (S[i]=="a" && cnt<sum)
a.cc:21:22: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
21 | }else if (S[i]=="b"&&cntf<B&&cnt<sum)//B
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.