submission_id
stringlengths
10
10
problem_id
stringlengths
6
6
language
stringclasses
3 values
code
stringlengths
1
522k
compiler_output
stringlengths
43
10.2k
s048576520
p00445
C
#include <stdio.h> int main() { char str[10001]; int i = 0, j = 0, a; while (scan("%s", str) == 1) { for (a = 0;str[a] != '\0';a++) { if (str[a] == 'J'&&str[a + 1] == 'O'&&str[a + 2] == 'I') i++; } for (a = 0;str[a] != '\0';a++) { if (str[a] == 'I'&&str[a + 1] == 'O'&&str[a + 2] == 'I') j++; } printf("%d\n %d\n", i, j); } return 0; }
main.c: In function 'main': main.c:7:24: error: implicit declaration of function 'scan'; did you mean 'scanf'? [-Wimplicit-function-declaration] 7 | while (scan("%s", str) == 1) { | ^~~~ | scanf
s881191401
p00445
C
#include <stdio.h> #include <string.h> int main(){ int i,k,kai; char a[1000],x[1000]; while(1){ scanf("%s",a); if(a=="EOF")break; for(i=0;i<strlen(a)-2;i++){ strcopy(x,a,3); if(x=="IOI"||x=="JOI")kai++; } printf("%d\n",kai); } return 0; }
main.c: In function 'main': main.c:14:5: error: implicit declaration of function 'strcopy'; did you mean 'strcpy'? [-Wimplicit-function-declaration] 14 | strcopy(x,a,3); | ^~~~~~~ | strcpy
s106338726
p00445
C
#include<stdio.h> int main(void) { char n[10001],j={'J'},o={'O'},i={'I'},h={'I'}; int a=0,b=0,i=0,c; scanf("%s",n); while(n[i]!='\0'){ i+=1; } for(c=0;c<i;c++){ if(n[c]==j){ if(n[c+1]==o){ if(n[c+2==i]){ a+=1; } } } else if(n[c]==h){ if(n[c+1]==o){ if(n[c+2]==h){ b+=1; } } } } printf("%d\n%d\n",a,b); return 0; }
main.c: In function 'main': main.c:5:21: error: conflicting types for 'i'; have 'int' 5 | int a=0,b=0,i=0,c; | ^ main.c:4:39: note: previous definition of 'i' with type 'char' 4 | char n[10001],j={'J'},o={'O'},i={'I'},h={'I'}; | ^
s136376227
p00445
C
#include<stdio.h> int main(void) { while(1){ char n[10001],j={'J'},o={'O'},i={'I'},h={'I'}; int a=0,b=0,i=0,c; if(scanf("%s",n)==EOF){ break; } while(n[i]!='\0'){ i+=1; } for(c=0;c<i;c++){ if(n[c]==j){ if(n[c+1]==o){ if(n[c+2==i]){ a+=1; } } } else if(n[c]==h){ if(n[c+1]==o){ if(n[c+2]==h){ b+=1; } } } } printf("%d\n%d\n",a,b); } return 0; }
main.c: In function 'main': main.c:6:21: error: conflicting types for 'i'; have 'int' 6 | int a=0,b=0,i=0,c; | ^ main.c:5:39: note: previous definition of 'i' with type 'char' 5 | char n[10001],j={'J'},o={'O'},i={'I'},h={'I'}; | ^
s340410544
p00445
C
#include<iostream> #include<stdio.h> int main(){ char c; int a=0,b=0,d=0,f=0; while(scanf("%c",&c)!=EOF){ if(c=='\n'){ printf("%d\n%d\n",a,b); a=0; b=0; } else{ if(c=='J'){ if(0==d){ d++; } f=0; } else if(c=='O'){ if(d==1){ d++; } else d=0; if(f==1){ f++; } else f=0; } else if(c=='I'){ if(d==2){ a++; d=0; } else d=0; if(f==0){ f++; } else if(f==2){ b++; f=1; } else f=0; } else{ d=0; f=0; } } } }
main.c:1:9: fatal error: iostream: No such file or directory 1 | #include<iostream> | ^~~~~~~~~~ compilation terminated.
s142077769
p00445
C
#include <stdio.h> #include <string.h> int main(){ char str[1000], *p; while ( scanf( "%s", str) == 1 ){ int i = 0; for ( p = strstr( str, "JOI" ); p != '\0'; p = strstr( p+1, "JOI" ) ){ i++; } printf("%d\n", i); for ( p = strstr( str, "IOI" ); p != '\0'; p = strstr( p+1, "IOI" ) ){ i++; } printf("%d\n", j, i); } return 0; }
main.c: In function 'main': main.c:10:51: warning: comparison between pointer and zero character constant [-Wpointer-compare] 10 | for ( p = strstr( str, "JOI" ); p != '\0'; p = strstr( p+1, "JOI" ) ){ | ^~ main.c:10:49: note: did you mean to dereference the pointer? 10 | for ( p = strstr( str, "JOI" ); p != '\0'; p = strstr( p+1, "JOI" ) ){ | ^ main.c:14:51: warning: comparison between pointer and zero character constant [-Wpointer-compare] 14 | for ( p = strstr( str, "IOI" ); p != '\0'; p = strstr( p+1, "IOI" ) ){ | ^~ main.c:14:49: note: did you mean to dereference the pointer? 14 | for ( p = strstr( str, "IOI" ); p != '\0'; p = strstr( p+1, "IOI" ) ){ | ^ main.c:17:32: error: 'j' undeclared (first use in this function) 17 | printf("%d\n", j, i); | ^ main.c:17:32: note: each undeclared identifier is reported only once for each function it appears in
s788152244
p00445
C
#include <stdio.h> int main(){ int j=0;ai=0; int i; char moji[10001]={'\0'}; while(1){ scanf("%s",moji); if(moji==EOF)break; j=0; ai=0; for(i=0;moji[i+2]!='\0';i++){ if(moji[i]==J && moji[i+1]==O && moji[i+2]==I){ j++; } else if(moji[i]==I && moji[i+1]==O && moji[i+2]==I){ ai++; } } printf("%d\n",j); printf("%d\n",ai); } return 0; }
main.c: In function 'main': main.c:4:9: error: 'ai' undeclared (first use in this function) 4 | int j=0;ai=0; | ^~ main.c:4:9: note: each undeclared identifier is reported only once for each function it appears in main.c:10:8: warning: comparison between pointer and integer 10 | if(moji==EOF)break; | ^~ main.c:14:13: error: 'J' undeclared (first use in this function) 14 | if(moji[i]==J && moji[i+1]==O && moji[i+2]==I){ | ^ main.c:14:29: error: 'O' undeclared (first use in this function) 14 | if(moji[i]==J && moji[i+1]==O && moji[i+2]==I){ | ^ main.c:14:45: error: 'I' undeclared (first use in this function) 14 | if(moji[i]==J && moji[i+1]==O && moji[i+2]==I){ | ^
s501790223
p00445
C++
#include<utility> #include<vector> #include<map> #include<algorithm> #include<queue> #include<stack> using namespace std; //AOJ IOI int main(){ while(true){ string S; cin >> S; if(S == "EOF") break; int JOI = 0, IOI = 0; for(int i=0; i<S.size(); i++){ if(S[i] == 'J'){ if(S[i+1] == 'O'){ if(S[i+2] == 'I'){ JOI++; } } } if(S[i] == 'I'){ if(S[i+1] == 'O'){ if(S[i+2] == 'I'){ IOI++; } } } } cout << JOI << endl << IOI << endl; } return 0; }
a.cc: In function 'int main()': a.cc:14:17: error: 'string' was not declared in this scope 14 | string S; | ^~~~~~ a.cc:7:1: note: 'std::string' is defined in header '<string>'; this is probably fixable by adding '#include <string>' 6 | #include<stack> +++ |+#include <string> 7 | a.cc:15:17: error: 'cin' was not declared in this scope 15 | cin >> S; | ^~~ a.cc:7:1: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>' 6 | #include<stack> +++ |+#include <iostream> 7 | a.cc:15:24: error: 'S' was not declared in this scope 15 | cin >> S; | ^ a.cc:36:17: error: 'cout' was not declared in this scope 36 | cout << JOI << endl << IOI << endl; | ^~~~ a.cc:36:17: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>' a.cc:36:32: error: 'endl' was not declared in this scope 36 | cout << JOI << endl << IOI << endl; | ^~~~ a.cc:7:1: note: 'std::endl' is defined in header '<ostream>'; this is probably fixable by adding '#include <ostream>' 6 | #include<stack> +++ |+#include <ostream> 7 |
s204266709
p00445
C++
#include<algorithm> #include<queue> #include<stack> using namespace std; //AOJ IOI int main(){ while(true){ string S; cin >> S; if(S == "EOF") break; int JOI = 0, IOI = 0; for(int i=0; i<S.size(); i++){ if(S[i] == 'J'){ if(S[i+1] == 'O'){ if(S[i+2] == 'I'){ JOI++; } } } if(S[i] == 'I'){ if(S[i+1] == 'O'){ if(S[i+2] == 'I'){ IOI++; } } } } cout << JOI << endl << IOI << endl; } return 0; }
a.cc: In function 'int main()': a.cc:11:17: error: 'string' was not declared in this scope 11 | string S; | ^~~~~~ a.cc:4:1: note: 'std::string' is defined in header '<string>'; this is probably fixable by adding '#include <string>' 3 | #include<stack> +++ |+#include <string> 4 | a.cc:12:17: error: 'cin' was not declared in this scope 12 | cin >> S; | ^~~ a.cc:4:1: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>' 3 | #include<stack> +++ |+#include <iostream> 4 | a.cc:12:24: error: 'S' was not declared in this scope 12 | cin >> S; | ^ a.cc:33:17: error: 'cout' was not declared in this scope 33 | cout << JOI << endl << IOI << endl; | ^~~~ a.cc:33:17: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>' a.cc:33:32: error: 'endl' was not declared in this scope 33 | cout << JOI << endl << IOI << endl; | ^~~~ a.cc:4:1: note: 'std::endl' is defined in header '<ostream>'; this is probably fixable by adding '#include <ostream>' 3 | #include<stack> +++ |+#include <ostream> 4 |
s770293844
p00445
C++
#include<bits/stdc++.h> using namespace std; int main(void){ char a[10001]; while(cin>>a;){ int x=strlen(a); int cnt=0; int cnt1=0; for(int i=0;i<x;i++){ if(a[i]=='J'&&a[i+1]=='O'&&a[i+2]=='I'){ cnt++; } if(a[i]=='I'&&a[i+1]=='O'&&a[i+2]=='I'){ cnt1++; } } cout<<cnt<<endl; cout<<cnt1<<endl; } return 0; }
a.cc: In function 'int main()': a.cc:5:21: error: expected ')' before ';' token 5 | while(cin>>a;){ | ~ ^ | ) a.cc:5:22: error: expected primary-expression before ')' token 5 | while(cin>>a;){ | ^
s327230565
p00445
C++
#include<iostream> #include<string> int main() { string ss; cin >> ss; int j=0,k=0; for(int i=1;i<ss.length()-1;i++){ if(ss[i]=='O'){ if(ss[i+1]=='I'){ if(ss[i-1]=='J')j++; if(ss[i-1]=='I')k++; } } } cout << j << "\n" << k << "\n"; return 0; }
a.cc: In function 'int main()': a.cc:5:1: error: 'string' was not declared in this scope 5 | string ss; | ^~~~~~ a.cc:5:1: 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:6:1: error: 'cin' was not declared in this scope; did you mean 'std::cin'? 6 | cin >> ss; | ^~~ | std::cin /usr/include/c++/14/iostream:62:18: note: 'std::cin' declared here 62 | extern istream cin; ///< Linked to standard input | ^~~ a.cc:6:8: error: 'ss' was not declared in this scope 6 | cin >> ss; | ^~ a.cc:16:1: error: 'cout' was not declared in this scope; did you mean 'std::cout'? 16 | cout << j << "\n" << k << "\n"; | ^~~~ | std::cout /usr/include/c++/14/iostream:63:18: note: 'std::cout' declared here 63 | extern ostream cout; ///< Linked to standard output | ^~~~
s280516072
p00445
C++
#include <iostream> #include <string> using namespace std; int main () { string s; int i; while(cin >> s, s!=EOF) { for(i=0;i<s.size();i++) { if(s[i]=='J') if(s[i+1]=='O') if(s[i+2]=='I') { count++; i += 1; } if(s[i]=='I') if(s[i+1]=='O') if(s[i+2]=='I') { count++; i += 1; } } } cout << count << endl; }
a.cc: In function 'int main()': a.cc:8:18: error: no match for 'operator!=' (operand types are 'std::string' {aka 'std::__cxx11::basic_string<char>'} and 'int') 8 | while(cin >> s, s!=EOF) { | ~^~ | | | std::string {aka std::__cxx11::basic_string<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:197:5: note: candidate: 'template<class _StateT> bool std::operator!=(const fpos<_StateT>&, const fpos<_StateT>&)' 197 | operator!=(const fpos<_StateT>& __lhs, const fpos<_StateT>& __rhs) | ^~~~~~~~ /usr/include/c++/14/bits/postypes.h:197:5: note: template argument deduction/substitution failed: In file included from /usr/include/c++/14/cstdio:42, from /usr/include/c++/14/ext/string_conversions.h:45, from /usr/include/c++/14/bits/basic_string.h:4154, 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: a.cc:8:20: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::fpos<_StateT>' 8 | while(cin >> s, s!=EOF) { | ^~~ In file included from /usr/include/c++/14/string:43: /usr/include/c++/14/bits/allocator.h:243:5: note: candidate: 'template<class _T1, class _T2> bool std::operator!=(const allocator<_CharT>&, const allocator<_T2>&)' 243 | operator!=(const allocator<_T1>&, const allocator<_T2>&) | ^~~~~~~~ /usr/include/c++/14/bits/allocator.h:243:5: note: template argument deduction/substitution failed: a.cc:8:20: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::allocator<_CharT>' 8 | while(cin >> s, s!=EOF) { | ^~~ In file included from /usr/include/c++/14/string:48: /usr/include/c++/14/bits/stl_iterator.h:455:5: note: candidate: 'template<class _Iterator> constexpr bool std::operator!=(const reverse_iterator<_Iterator>&, const reverse_iterator<_Iterator>&)' 455 | operator!=(const reverse_iterator<_Iterator>& __x, | ^~~~~~~~ /usr/include/c++/14/bits/stl_iterator.h:455:5: note: template argument deduction/substitution failed: a.cc:8:20: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::reverse_iterator<_Iterator>' 8 | while(cin >> s, s!=EOF) { | ^~~ /usr/include/c++/14/bits/stl_iterator.h:500:5: note: candidate: 'template<class _IteratorL, class _IteratorR> constexpr bool std::operator!=(const reverse_iterator<_Iterator>&, const reverse_iterator<_IteratorR>&)' 500 | operator!=(const reverse_iterator<_IteratorL>& __x, | ^~~~~~~~ /usr/include/c++/14/bits/stl_iterator.h:500:5: note: template argument deduction/substitution failed: a.cc:8:20: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::reverse_iterator<_Iterator>' 8 | while(cin >> s, s!=EOF) { | ^~~ /usr/include/c++/14/bits/stl_iterator.h:1686:5: note: candidate: 'template<class _IteratorL, class _IteratorR> constexpr bool std::operator!=(const move_iterator<_IteratorL>&, const move_iterator<_IteratorR>&)' 1686 | operator!=(const move_iterator<_IteratorL>& __x, | ^~~~~~~~ /usr/include/c++/14/bits/stl_iterator.h:1686:5: note: template argument deduction/substitution failed: a.cc:8:20: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::move_iterator<_IteratorL>' 8 | while(cin >> s, s!=EOF) { | ^~~ /usr/include/c++/14/bits/stl_iterator.h:1753:5: note: candidate: 'template<class _Iterator> constexpr bool std::operator!=(const move_iterator<_IteratorL>&, const move_iterator<_IteratorL>&)' 1753 | operator!=(const move_iterator<_Iterator>& __x, | ^~~~~~~~ /usr/include/c++/14/bits/stl_iterator.h:1753:5: note: template argument deduction/substitution failed: a.cc:8:20: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::move_iterator<_IteratorL>' 8 | while(cin >> s, s!=EOF) { | ^~~ 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:1052:5: note: candidate: 'template<class _T1, class _T2> constexpr bool std::operator!=(const pair<_T1, _T2>&, const pair<_T1, _T2>&)' 1052 | operator!=(const pair<_T1, _T2>& __x, const pair<_T1, _T2>& __y) | ^~~~~~~~ /usr/include/c++/14/bits/stl_pair.h:1052:5: note: template argument deduction/substitution failed: a.cc:8:20: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::pair<_T1, _T2>' 8 | while(cin >> s, s!=EOF) { | ^~~ In file included from /usr/include/c++/14/bits/basic_string.h:47: /usr/include/c++/14/string_view:651:5: note: candidate: 'template<class _CharT, class _Traits> constexpr bool std::operator!=(basic_string_view<_CharT, _Traits>, basic_string_view<_CharT, _Traits>)' 651 | operator!=(basic_string_view<_CharT, _Traits> __x, | ^~~~~~~~ /usr/include/c++/14/string_view:651:5: note: template argument deduction/substitution failed: a.cc:8:20: note: 'std::__cxx11::basic_string<char>' is not derived from 'std::basic_string_view<_CharT, _Traits>' 8 | while(cin >> s, s!=EOF) { | ^~~ /usr/include/c++/14/string_view:658: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> >)' 658 | operator!=(basic_string_view<_CharT, _Traits> __x, | ^~~~~~~~ /usr/include/c++/14/string_view:658:5: note: template argument deduction/substitution failed: a.cc:8:20: note: 'std::__cxx11::basic_string<char>' is not derived from 'std::basic_string_view<_CharT, _Traits>' 8 | while(cin >> s, s!=EOF) { | ^~~ /usr/include/c++/14/string_view:666: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>)' 666 | operator!=(__type_identity_t<basic_string_view<_CharT, _Traits>> __x, | ^~~~~~~~ /usr/include/c++/14/string_view:666:5: note: template argument deduction/substitution failed: a.cc:8:20: note: mismatched types 'std::basic_string_view<_CharT, _Traits>' and 'int' 8 | while(cin >> s, s!=EOF) { | ^~~ /usr/include/c++/14/bits/basic_string.h:3833: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>&)' 3833 | operator!=(const basic_string<_CharT, _Traits, _Alloc>& __lhs, | ^~~~~~~~ /usr/include/c++/14/bits/basic_string.h:3833:5: note: template argument deduction/substitution failed: a.cc:8:20: note: mismatched types 'const std::__cxx11::basic_string<_CharT, _Traits, _Allocator>' and 'int' 8 | while(cin >> s, s!=EOF) { | ^~~ /usr/include/c++/14/bits/basic_string.h:3847:5: note: candidate: 'template<class _CharT, class _Traits, class _Alloc> bool std::operator!=(const _CharT*, const __cxx11::basic_string<_CharT, _Traits, _Allocator>&)' 3847 | operator!=(const _CharT* __lhs, | ^~~~~~~~ /usr/include/c++/14/bits/basic_string.h:3847:5: note: template argument deduction/substitution failed: a.cc:8:20: note: mismatched types 'const _CharT*' and 'std::__cxx11::basic_string<char>' 8 | while(cin >> s, s!=EOF) { | ^~~ /usr/include/c++/14/bits/basic_string.h:3860:5: note: candidate: 'template<class _CharT, class _Traits, class _Alloc> bool std::operator!=(const __cxx11::basic_string<_CharT, _Traits, _Allocator>&, const _CharT*)' 3860 | operator!=(const basic_string<_CharT, _Traits, _Alloc>& __lhs, | ^~~~~~~~ /usr/include/c++/14/bits/basic_string.h:3860:5: note: template argument deduction/substitution failed: a.cc:8:20: note: mismatched types 'const _CharT*' and 'int' 8 | while(cin >> s, s!=EOF) { | ^~~ 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:2613:5: note: candidate: 'template<class ... _TElements, class ... _UElements> constexpr bool std::operator!=(const tuple<_UTypes ...>&, const tuple<_Elements ...>&)' 2613 | operator!=(const tuple<_TElements...>& __t, | ^~~~~~~~ /usr/include/c++/14/tuple:2613:5: note: template argument deduction/substitution failed: a.cc:8:20: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::tuple<_UTypes ...>' 8 | while(cin >> s, s!=EOF) { | ^~~ 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:242:5: note: candidate: 'template<class _CharT, class _Traits> bool std::operator!=(const istreambuf_iterator<_CharT, _Traits>&, const istreambuf_iterator<_CharT, _Traits>&)' 242 | operator!=(const istreambuf_iterator<_CharT, _Traits>& __a, | ^~~~~~~~ /usr/include/c++/14/bits/streambuf_iterator.h:242:5: note: template argument deduction/substitution failed: a.cc:8:20: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::istreambuf_iterator<_CharT, _Traits>' 8 | while(cin >> s, s!=EOF) { | ^~~ In file included from /usr/include/x86_64-linux
s038110566
p00445
C++
#include <iostream> #include <string> using namespace std; int main () { string s; int i, count; while(cin >> s, s) { for(i=0;i<s.size();i++) { if(s[i]=='J') if(s[i+1]=='O') if(s[i+2]=='I') { count++; i += 1; } if(s[i]=='I') if(s[i+1]=='O') if(s[i+2]=='I') { count++; i += 1; } } } cout << count << endl; }
a.cc: In function 'int main()': a.cc:8:15: error: could not convert '(((void)std::operator>><char, char_traits<char>, allocator<char> >(std::cin, s)), s)' from 'std::string' {aka 'std::__cxx11::basic_string<char>'} to 'bool' 8 | while(cin >> s, s) { | ~~~~~~~~^~~ | | | std::string {aka std::__cxx11::basic_string<char>}
s673158089
p00445
C++
#include <iostream> #include <string> using namespace std; int main () { string s; int i, count; while(cin >> s, s!=false) { for(i=0;i<s.size();i++) { if(s[i]=='J') if(s[i+1]=='O') if(s[i+2]=='I') { count++; i += 1; } if(s[i]=='I') if(s[i+1]=='O') if(s[i+2]=='I') { count++; i += 1; } } } cout << count << endl; }
a.cc: In function 'int main()': a.cc:8:18: error: no match for 'operator!=' (operand types are 'std::string' {aka 'std::__cxx11::basic_string<char>'} and 'bool') 8 | while(cin >> s, s!=false) { | ~^~~~~~~ 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:197:5: note: candidate: 'template<class _StateT> bool std::operator!=(const fpos<_StateT>&, const fpos<_StateT>&)' 197 | operator!=(const fpos<_StateT>& __lhs, const fpos<_StateT>& __rhs) | ^~~~~~~~ /usr/include/c++/14/bits/postypes.h:197:5: note: template argument deduction/substitution failed: a.cc:8:20: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::fpos<_StateT>' 8 | while(cin >> s, s!=false) { | ^~~~~ 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:243:5: note: candidate: 'template<class _T1, class _T2> bool std::operator!=(const allocator<_CharT>&, const allocator<_T2>&)' 243 | operator!=(const allocator<_T1>&, const allocator<_T2>&) | ^~~~~~~~ /usr/include/c++/14/bits/allocator.h:243:5: note: template argument deduction/substitution failed: a.cc:8:20: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::allocator<_CharT>' 8 | while(cin >> s, s!=false) { | ^~~~~ In file included from /usr/include/c++/14/string:48: /usr/include/c++/14/bits/stl_iterator.h:455:5: note: candidate: 'template<class _Iterator> constexpr bool std::operator!=(const reverse_iterator<_Iterator>&, const reverse_iterator<_Iterator>&)' 455 | operator!=(const reverse_iterator<_Iterator>& __x, | ^~~~~~~~ /usr/include/c++/14/bits/stl_iterator.h:455:5: note: template argument deduction/substitution failed: a.cc:8:20: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::reverse_iterator<_Iterator>' 8 | while(cin >> s, s!=false) { | ^~~~~ /usr/include/c++/14/bits/stl_iterator.h:500:5: note: candidate: 'template<class _IteratorL, class _IteratorR> constexpr bool std::operator!=(const reverse_iterator<_Iterator>&, const reverse_iterator<_IteratorR>&)' 500 | operator!=(const reverse_iterator<_IteratorL>& __x, | ^~~~~~~~ /usr/include/c++/14/bits/stl_iterator.h:500:5: note: template argument deduction/substitution failed: a.cc:8:20: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::reverse_iterator<_Iterator>' 8 | while(cin >> s, s!=false) { | ^~~~~ /usr/include/c++/14/bits/stl_iterator.h:1686:5: note: candidate: 'template<class _IteratorL, class _IteratorR> constexpr bool std::operator!=(const move_iterator<_IteratorL>&, const move_iterator<_IteratorR>&)' 1686 | operator!=(const move_iterator<_IteratorL>& __x, | ^~~~~~~~ /usr/include/c++/14/bits/stl_iterator.h:1686:5: note: template argument deduction/substitution failed: a.cc:8:20: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::move_iterator<_IteratorL>' 8 | while(cin >> s, s!=false) { | ^~~~~ /usr/include/c++/14/bits/stl_iterator.h:1753:5: note: candidate: 'template<class _Iterator> constexpr bool std::operator!=(const move_iterator<_IteratorL>&, const move_iterator<_IteratorL>&)' 1753 | operator!=(const move_iterator<_Iterator>& __x, | ^~~~~~~~ /usr/include/c++/14/bits/stl_iterator.h:1753:5: note: template argument deduction/substitution failed: a.cc:8:20: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::move_iterator<_IteratorL>' 8 | while(cin >> s, s!=false) { | ^~~~~ 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:1052:5: note: candidate: 'template<class _T1, class _T2> constexpr bool std::operator!=(const pair<_T1, _T2>&, const pair<_T1, _T2>&)' 1052 | operator!=(const pair<_T1, _T2>& __x, const pair<_T1, _T2>& __y) | ^~~~~~~~ /usr/include/c++/14/bits/stl_pair.h:1052:5: note: template argument deduction/substitution failed: a.cc:8:20: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::pair<_T1, _T2>' 8 | while(cin >> s, s!=false) { | ^~~~~ 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:651:5: note: candidate: 'template<class _CharT, class _Traits> constexpr bool std::operator!=(basic_string_view<_CharT, _Traits>, basic_string_view<_CharT, _Traits>)' 651 | operator!=(basic_string_view<_CharT, _Traits> __x, | ^~~~~~~~ /usr/include/c++/14/string_view:651:5: note: template argument deduction/substitution failed: a.cc:8:20: note: 'std::__cxx11::basic_string<char>' is not derived from 'std::basic_string_view<_CharT, _Traits>' 8 | while(cin >> s, s!=false) { | ^~~~~ /usr/include/c++/14/string_view:658: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> >)' 658 | operator!=(basic_string_view<_CharT, _Traits> __x, | ^~~~~~~~ /usr/include/c++/14/string_view:658:5: note: template argument deduction/substitution failed: a.cc:8:20: note: 'std::__cxx11::basic_string<char>' is not derived from 'std::basic_string_view<_CharT, _Traits>' 8 | while(cin >> s, s!=false) { | ^~~~~ /usr/include/c++/14/string_view:666: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>)' 666 | operator!=(__type_identity_t<basic_string_view<_CharT, _Traits>> __x, | ^~~~~~~~ /usr/include/c++/14/string_view:666:5: note: template argument deduction/substitution failed: a.cc:8:20: note: mismatched types 'std::basic_string_view<_CharT, _Traits>' and 'bool' 8 | while(cin >> s, s!=false) { | ^~~~~ /usr/include/c++/14/bits/basic_string.h:3833: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>&)' 3833 | operator!=(const basic_string<_CharT, _Traits, _Alloc>& __lhs, | ^~~~~~~~ /usr/include/c++/14/bits/basic_string.h:3833:5: note: template argument deduction/substitution failed: a.cc:8:20: note: mismatched types 'const std::__cxx11::basic_string<_CharT, _Traits, _Allocator>' and 'bool' 8 | while(cin >> s, s!=false) { | ^~~~~ /usr/include/c++/14/bits/basic_string.h:3847:5: note: candidate: 'template<class _CharT, class _Traits, class _Alloc> bool std::operator!=(const _CharT*, const __cxx11::basic_string<_CharT, _Traits, _Allocator>&)' 3847 | operator!=(const _CharT* __lhs, | ^~~~~~~~ /usr/include/c++/14/bits/basic_string.h:3847:5: note: template argument deduction/substitution failed: a.cc:8:20: note: mismatched types 'const _CharT*' and 'std::__cxx11::basic_string<char>' 8 | while(cin >> s, s!=false) { | ^~~~~ /usr/include/c++/14/bits/basic_string.h:3860:5: note: candidate: 'template<class _CharT, class _Traits, class _Alloc> bool std::operator!=(const __cxx11::basic_string<_CharT, _Traits, _Allocator>&, const _CharT*)' 3860 | operator!=(const basic_string<_CharT, _Traits, _Alloc>& __lhs, | ^~~~~~~~ /usr/include/c++/14/bits/basic_string.h:3860:5: note: template argument deduction/substitution failed: a.cc:8:20: note: mismatched types 'const _CharT*' and 'bool' 8 | while(cin >> s, s!=false) { | ^~~~~ 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:2613:5: note: candidate: 'template<class ... _TElements, class ... _UElements> constexpr bool std::operator!=(const tuple<_UTypes ...>&, const tuple<_Elements ...>&)' 2613 | operator!=(const tuple<_TElements...>& __t, | ^~~~~~~~ /usr/include/c++/14/tuple:2613:5: note: template argument deduction/substitution failed: a.cc:8:20: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::tuple<_UTypes ...>' 8 | while(cin >> s, s!=false) { | ^~~~~ 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:242:5: note: candidate: 'template<class _CharT, class _Traits> bool std::operator!=(const istreambuf_iterator<_CharT, _Traits>&, const istreambuf_iterator<_CharT, _Traits>&)' 242 | operator!=(const istreambuf_iterator<_CharT, _Traits>& __a, | ^~~~~~~~ /usr/include/c++/14/bits/streambuf_iterator.h:242:5: note: template argument deduction/substitution failed: a.cc:8:20: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::istreambuf_iterator<_CharT, _Traits>' 8 | while(cin >> s, s!=false) { | ^~~~~ In file included from /usr/include/x86_64-linux-gnu/c++/14/bits/c++allocator.h:33, from /usr/include/c++/14/bits/allocator.h:46: /usr/include/c++/14/bits/new_allocator.h:222:9: note: candidate: 'template<class _Up> bool std::operator!=(const __new_allo
s464987854
p00445
C++
#include <iostream> #include <string> using namespace std; int main () { string s; int i, count; while(cin >> s, s!=-1) { for(i=0;i<s.size();i++) { if(s[i]=='J') if(s[i+1]=='O') if(s[i+2]=='I') { count++; i += 1; } if(s[i]=='I') if(s[i+1]=='O') if(s[i+2]=='I') { count++; i += 1; } } } cout << count << endl; }
a.cc: In function 'int main()': a.cc:8:18: error: no match for 'operator!=' (operand types are 'std::string' {aka 'std::__cxx11::basic_string<char>'} and 'int') 8 | while(cin >> s, s!=-1) { | ~^~~~ | | | | | int | std::string {aka std::__cxx11::basic_string<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:197:5: note: candidate: 'template<class _StateT> bool std::operator!=(const fpos<_StateT>&, const fpos<_StateT>&)' 197 | operator!=(const fpos<_StateT>& __lhs, const fpos<_StateT>& __rhs) | ^~~~~~~~ /usr/include/c++/14/bits/postypes.h:197:5: note: template argument deduction/substitution failed: a.cc:8:21: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::fpos<_StateT>' 8 | while(cin >> s, s!=-1) { | ^ 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:243:5: note: candidate: 'template<class _T1, class _T2> bool std::operator!=(const allocator<_CharT>&, const allocator<_T2>&)' 243 | operator!=(const allocator<_T1>&, const allocator<_T2>&) | ^~~~~~~~ /usr/include/c++/14/bits/allocator.h:243:5: note: template argument deduction/substitution failed: a.cc:8:21: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::allocator<_CharT>' 8 | while(cin >> s, s!=-1) { | ^ In file included from /usr/include/c++/14/string:48: /usr/include/c++/14/bits/stl_iterator.h:455:5: note: candidate: 'template<class _Iterator> constexpr bool std::operator!=(const reverse_iterator<_Iterator>&, const reverse_iterator<_Iterator>&)' 455 | operator!=(const reverse_iterator<_Iterator>& __x, | ^~~~~~~~ /usr/include/c++/14/bits/stl_iterator.h:455:5: note: template argument deduction/substitution failed: a.cc:8:21: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::reverse_iterator<_Iterator>' 8 | while(cin >> s, s!=-1) { | ^ /usr/include/c++/14/bits/stl_iterator.h:500:5: note: candidate: 'template<class _IteratorL, class _IteratorR> constexpr bool std::operator!=(const reverse_iterator<_Iterator>&, const reverse_iterator<_IteratorR>&)' 500 | operator!=(const reverse_iterator<_IteratorL>& __x, | ^~~~~~~~ /usr/include/c++/14/bits/stl_iterator.h:500:5: note: template argument deduction/substitution failed: a.cc:8:21: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::reverse_iterator<_Iterator>' 8 | while(cin >> s, s!=-1) { | ^ /usr/include/c++/14/bits/stl_iterator.h:1686:5: note: candidate: 'template<class _IteratorL, class _IteratorR> constexpr bool std::operator!=(const move_iterator<_IteratorL>&, const move_iterator<_IteratorR>&)' 1686 | operator!=(const move_iterator<_IteratorL>& __x, | ^~~~~~~~ /usr/include/c++/14/bits/stl_iterator.h:1686:5: note: template argument deduction/substitution failed: a.cc:8:21: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::move_iterator<_IteratorL>' 8 | while(cin >> s, s!=-1) { | ^ /usr/include/c++/14/bits/stl_iterator.h:1753:5: note: candidate: 'template<class _Iterator> constexpr bool std::operator!=(const move_iterator<_IteratorL>&, const move_iterator<_IteratorL>&)' 1753 | operator!=(const move_iterator<_Iterator>& __x, | ^~~~~~~~ /usr/include/c++/14/bits/stl_iterator.h:1753:5: note: template argument deduction/substitution failed: a.cc:8:21: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::move_iterator<_IteratorL>' 8 | while(cin >> s, s!=-1) { | ^ 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:1052:5: note: candidate: 'template<class _T1, class _T2> constexpr bool std::operator!=(const pair<_T1, _T2>&, const pair<_T1, _T2>&)' 1052 | operator!=(const pair<_T1, _T2>& __x, const pair<_T1, _T2>& __y) | ^~~~~~~~ /usr/include/c++/14/bits/stl_pair.h:1052:5: note: template argument deduction/substitution failed: a.cc:8:21: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::pair<_T1, _T2>' 8 | while(cin >> s, s!=-1) { | ^ 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:651:5: note: candidate: 'template<class _CharT, class _Traits> constexpr bool std::operator!=(basic_string_view<_CharT, _Traits>, basic_string_view<_CharT, _Traits>)' 651 | operator!=(basic_string_view<_CharT, _Traits> __x, | ^~~~~~~~ /usr/include/c++/14/string_view:651:5: note: template argument deduction/substitution failed: a.cc:8:21: note: 'std::__cxx11::basic_string<char>' is not derived from 'std::basic_string_view<_CharT, _Traits>' 8 | while(cin >> s, s!=-1) { | ^ /usr/include/c++/14/string_view:658: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> >)' 658 | operator!=(basic_string_view<_CharT, _Traits> __x, | ^~~~~~~~ /usr/include/c++/14/string_view:658:5: note: template argument deduction/substitution failed: a.cc:8:21: note: 'std::__cxx11::basic_string<char>' is not derived from 'std::basic_string_view<_CharT, _Traits>' 8 | while(cin >> s, s!=-1) { | ^ /usr/include/c++/14/string_view:666: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>)' 666 | operator!=(__type_identity_t<basic_string_view<_CharT, _Traits>> __x, | ^~~~~~~~ /usr/include/c++/14/string_view:666:5: note: template argument deduction/substitution failed: a.cc:8:21: note: mismatched types 'std::basic_string_view<_CharT, _Traits>' and 'int' 8 | while(cin >> s, s!=-1) { | ^ /usr/include/c++/14/bits/basic_string.h:3833: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>&)' 3833 | operator!=(const basic_string<_CharT, _Traits, _Alloc>& __lhs, | ^~~~~~~~ /usr/include/c++/14/bits/basic_string.h:3833:5: note: template argument deduction/substitution failed: a.cc:8:21: note: mismatched types 'const std::__cxx11::basic_string<_CharT, _Traits, _Allocator>' and 'int' 8 | while(cin >> s, s!=-1) { | ^ /usr/include/c++/14/bits/basic_string.h:3847:5: note: candidate: 'template<class _CharT, class _Traits, class _Alloc> bool std::operator!=(const _CharT*, const __cxx11::basic_string<_CharT, _Traits, _Allocator>&)' 3847 | operator!=(const _CharT* __lhs, | ^~~~~~~~ /usr/include/c++/14/bits/basic_string.h:3847:5: note: template argument deduction/substitution failed: a.cc:8:21: note: mismatched types 'const _CharT*' and 'std::__cxx11::basic_string<char>' 8 | while(cin >> s, s!=-1) { | ^ /usr/include/c++/14/bits/basic_string.h:3860:5: note: candidate: 'template<class _CharT, class _Traits, class _Alloc> bool std::operator!=(const __cxx11::basic_string<_CharT, _Traits, _Allocator>&, const _CharT*)' 3860 | operator!=(const basic_string<_CharT, _Traits, _Alloc>& __lhs, | ^~~~~~~~ /usr/include/c++/14/bits/basic_string.h:3860:5: note: template argument deduction/substitution failed: a.cc:8:21: note: mismatched types 'const _CharT*' and 'int' 8 | while(cin >> s, s!=-1) { | ^ 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:2613:5: note: candidate: 'template<class ... _TElements, class ... _UElements> constexpr bool std::operator!=(const tuple<_UTypes ...>&, const tuple<_Elements ...>&)' 2613 | operator!=(const tuple<_TElements...>& __t, | ^~~~~~~~ /usr/include/c++/14/tuple:2613:5: note: template argument deduction/substitution failed: a.cc:8:21: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::tuple<_UTypes ...>' 8 | while(cin >> s, s!=-1) { | ^ 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:242:5: note: candidate: 'template<class _CharT, class _Traits> bool std::operator!=(const istreambuf_iterator<_CharT, _Traits>&, const istreambuf_iterator<_CharT, _Traits>&)' 242 | operator!=(const istreambuf_iterator<_CharT, _Traits>& __a, | ^~~~~~~~ /usr/include/c++/14/bits/streambuf_iterator.h:242:5: note: template argument deduction/substitution failed: a.cc:8:21: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::istreambuf_iterator<_CharT, _Traits>' 8 | while(cin >> s, s!=-1) { | ^ In file included from /usr/include/x86_64-linux-gnu/c++/14/bits/c++allocator.h:33, from /usr/include/c++/14/bits/allocator.h:46: /usr/include/c++/14/bits/new_allocator.h:222:9: note: candidate: 'template<class _Up> bo
s877850114
p00445
C++
#include <iostream> #include <string> using namespace std; int main () { string s; int i, joi, ioi; while(cin >> s, !cin.eof()) { count = 0; for(i=0;i<s.size();i++) { if(s[i]=='J') { if(s[i+1]=='O') { if(s[i+2]=='I') { joi++; i += 1; } } } if(s[i]=='I') { if(s[i+1]=='O') { if(s[i+2]=='I') { ioi++; i += 1; } } } } } cout << count << endl; }
a.cc: In function 'int main()': a.cc:9:5: error: 'count' was not declared in this scope 9 | count = 0; | ^~~~~ a.cc:29:9: error: 'count' was not declared in this scope 29 | cout << count << endl; | ^~~~~
s961395019
p00445
C++
#include <iostream> #include <string> using namespace std; int main () { string s; int i, joi, ioi; while(cin >> s, !cin.eof()) { count = 0; for(i=0;i<s.size();i++) { if(s[i]=='J') { if(s[i+1]=='O') { if(s[i+2]=='I') { joi++; i += 1; } } } if(s[i]=='I') { if(s[i+1]=='O') { if(s[i+2]=='I') { ioi++; i += 1; } } } } } cout << joi << endl << ioi << endl; }
a.cc: In function 'int main()': a.cc:9:5: error: 'count' was not declared in this scope 9 | count = 0; | ^~~~~
s242434649
p00445
C++
#include <stdio.h> #include <stdlib.h> #include <string.h> #include <math.h> #include <time.h> #include <limits.h> //#include <windows.h> #include <iostream> #include <algorithm> #include <set> #include <queue> #include <functional> using namespace std; typedef unsigned int uint; typedef long long int llint; typedef pair<llint,llint> pii; #define mpq(T) priority_queue<T,vector<T>,greater<T> > #define FOR(i,a,b) for(int i = (a),i < (b); i++) #define REP(i,a) for(int i = 0; i < (a); i++) class BIT { private: int s; llint* d; public: BIT(int size) { s = size; d = (llint*)malloc(sizeof(llint) * s); for(int i = 0; i < s; i++) { d[i] = 0; } } void add(int b,int x) { for(int i = b + 1; i <= s; i += (i & -i)) { d[i - 1] += x; } } llint sum(int b) { llint all = 0; for(int i = b + 1; i > 0; i -= (i & -i)) { all += d[i - 1]; } return all; } ~BIT() { free(d); } }; class unionfind { private: int s; int* o; int* r; public: unionfind(int dsize) { s = dsize; o = (int*)malloc(sizeof(int) * s); r = (int*)malloc(sizeof(int) * s); for(int i = 0; i < s; i++) { o[i] = i; r[i] = 0; } } int mfind(int b) { if(o[b] != b) { o[b] = mfind(o[b]); } return o[b]; } void munion(int a,int b) { int aw = mfind(a); int bw = mfind(b); if(aw == bw) { return; } if(r[aw] > r[bw]) { o[bw] = a; } else if(r[aw] < r[bw]) { o[aw] = bw; } else { o[bw] = aw; r[aw]++; } s--; } int size() { return s; } ~unionfind() { free(o); free(r); } }; template<class T> int lbound(T* d,T key,int s,int e) { s--; while(e - s > 1) { int m = (s + e) / 2; if(d[m] < key) { s = m; } else { e = m; } } return e; } template<class T> int ubound(T* d,T key,int s,int e) { s--; while(e - s > 1) { int m = (s + e) / 2; if(key < d[m]) { e = m; } else { s = m; } } return e; } class zpress { private: int ms; pii* md; int n; int s; llint* d; int* t; public: zpress(int dsize = 1000000) { int ms = dsize; md = (pii*)malloc(sizeof(pii) * ms); d = (llint*)malloc(sizeof(llint) * ms); t = (int*)malloc(sizeof(int) * ms); n = 0; } void in(llint x) { in2(x,n); n++; } void in2(llint x,int b) { md[b] = make_pair(x,b); } void syori() { syori2(n); } void syori2(int k) { sort(md,md + k); llint mae = LLONG_MIN; s = 0; REP(i,k) { if(md[i].first != mae) { d[s] = md[i].first; s++; mae = md[i].first; } t[md[i].second] = s - 1; } } llint iti(int b) { return t[b]; } int size() { return s; } int first(llint x) { return lbound(d,x,0,s); } int end(llint x) { return ubound(d,x,0,s);; } ~zpress() { free(md); free(d); free(t); } }; class xorshift { private: unsigned int a,b,c,d; public: xorshift(unsigned int aw = 123456789,unsigned int bw = 362436069,unsigned int cw = 521288629,unsigned int dw = 88675123,unsigned int e = 97) { a = aw; b = bw; c = cw; d = dw; for(unsigned int i = 0; i < e; i++) { operator()(); } } unsigned int operator()() { unsigned int w = a ^ (a << 11); a = b; b = c; c = d; d = (d ^ (d >> 19)) ^ (w ^ (w >> 8)); return d; } }; llint gcd(llint a,llint b) { while(1) { llint w = a % b; if(w == 0) { return b; } a = b; b = w; } } llint sei(llint d,llint p) { if(d < 0) { d -= ((d + 1) / p - 1) * p; } else { d %= p; } return d; } llint inv(llint a,llint p) { llint r0 = sei(a,p); llint r1 = p; llint a0 = 1; llint b0 = 0; llint a1 = 0; llint b1 = 1; while(1) { llint q = r0 / r1; llint w = r0 - q * r1; if(w == 0) { break; } r0 = r1; r1 = w; w = a0 - q * a1; a0 = a1; a1 = w; } return sei(a1,p); } template <llint P> class mod { private: llint d; public: mod(llint a = 0) { d = a; d = sei(d,P); } mod operator-() const { return mod(P - d); } mod operator+=(const mod& a) { d = d + a.d; d = sei(d,P); return *this; } mod operator-=(const mod& a) { return operator+=(-a); } mod operator*=(const mod& a) { d = d * a.d; d = sei(d,P); return *this; } mod operator/=(const mod& a) { return a * mod(inv(d,P)); } mod operator+(const mod& a) const { mod w = *this; return (w += a); } mod operator-(const mod& a) const { mod w = *this; return (w -= a); } mod operator*(const mod& a) const { mod w = *this; return (w *= a); } mod operator/(const mod& a) const { mod w = *this; return (w /= a); } bool operator==(const mod& a) const { return (d == a.d); } bool operator!=(const mod& a) const { return (d != a.d); } operator llint() const { return d; } }; ///////////////////////////////////////////////////// FILE* fi; FILE* fo; void err(char* a) { printf("%s\n",a); getchar(); } llint in() { llint w; fscanf(fi,"%lld",&w); return w; } void ins(char* a) { fscanf(fi,"%s",a); } void out(llint a) { fprintf(fo,"%lld\n",a); } void outs(char* a) { fprintf(fo,"%s\n",a); } void func(); int main() { fi = stdin; fo = stdout; func(); return 0; } char s[11111]; void func() { ins(s); int l = strlen(s); int jw = 0; int iw = 0; FOR(i,2,l) { if(s[i - 2] == 'J' && s[i - 1] == 'O' && s[i] == 'I') { jw++; } if(s[i - 2] == 'I' && s[i - 1] == 'O' && s[i] == 'I') { iw++; } } out(jw); out(iw); }
a.cc: In function 'void func()': a.cc:21:38: error: expected ';' before '<' token 21 | #define FOR(i,a,b) for(int i = (a),i < (b); i++) | ^ a.cc:455:9: note: in expansion of macro 'FOR' 455 | FOR(i,2,l) | ^~~ a.cc:21:38: error: expected primary-expression before '<' token 21 | #define FOR(i,a,b) for(int i = (a),i < (b); i++) | ^ a.cc:455:9: note: in expansion of macro 'FOR' 455 | FOR(i,2,l) | ^~~
s239768855
p00445
C++
#include <stdio.h> #include <string.h> int main(void) { char buf[10000], comp[2][3] = {"JOI", "IOI"}; int cou[2], i,c, t[2]; while(scanf("%s", buf) != EOF){ cou[0] = 0; cou[1] = 0; for(i = 0; strlen(buf)-2 > i; i++){ t[0] = 0; t[1] = 0; for(c = 0; 3 > c; c++){ if(comp[0][c] != buf[i + c]) t[0] = 1; if(comp[1][c] != buf[i + c]) t[1] = 1; } if(t[0] == 0)cou[0]++; if(t[1] == 0)cou[1]++; } printf("%d\n%d\n", cou[0],cou[1]); } return 0; }
a.cc: In function 'int main()': a.cc:5:40: error: initializer-string for 'char [3]' is too long [-fpermissive] 5 | char buf[10000], comp[2][3] = {"JOI", "IOI"}; | ^~~~~ a.cc:5:47: error: initializer-string for 'char [3]' is too long [-fpermissive] 5 | char buf[10000], comp[2][3] = {"JOI", "IOI"}; | ^~~~~
s026338385
p00445
C++
#include <stdio.h> #include <string.h> int main(void) { char buf[10001], comp[2][3] = {"JOI", "IOI"}; int cou[2], i,c, t[2]; while(scanf("%s", buf) != EOF){ cou[0] = 0; cou[1] = 0; for(i = 0; strlen(buf)-2 > i; i++){ t[0] = 0; t[1] = 0; for(c = 0; 3 > c; c++){ if(comp[0][c] != buf[i + c]) t[0] = 1; if(comp[1][c] != buf[i + c]) t[1] = 1; } if(t[0] == 0)cou[0]++; if(t[1] == 0)cou[1]++; } printf("%d\n%d\n", cou[0],cou[1]); } return 0; }
a.cc: In function 'int main()': a.cc:5:40: error: initializer-string for 'char [3]' is too long [-fpermissive] 5 | char buf[10001], comp[2][3] = {"JOI", "IOI"}; | ^~~~~ a.cc:5:47: error: initializer-string for 'char [3]' is too long [-fpermissive] 5 | char buf[10001], comp[2][3] = {"JOI", "IOI"}; | ^~~~~
s073240468
p00445
C++
#include <iostream> #include <vector> using namespace std; int countKeyword(vector<int>* x, vector<int>* oi) { int count = 0; for (int i = 0; i < x->size(); i++) { std::vector<int>::iterator iter = std::find(oi->begin() , oi->end(), x->at(i) + 1); if (iter != oi->end()) count++; } return count; } int main() { char str[10000]; vector<int> posI; vector<int> posJ; vector<int> posOI; cin >> str; for (int i = 0; str[i] != '\0'; i++) { if (str[i] == 'J') { posJ.push_back(i); } else if (str[i] == 'O' && str[i+1] == 'I') { posOI.push_back(i); } else if (str[i] == 'I') { posI.push_back(i); } } cout << countKeyword(&posJ, &posOI) << endl; cout << countKeyword(&posI, &posOI) << endl; return 0; }
a.cc: In function 'int countKeyword(std::vector<int>*, std::vector<int>*)': a.cc:9:60: error: no matching function for call to 'find(std::vector<int>::iterator, std::vector<int>::iterator, __gnu_cxx::__alloc_traits<std::allocator<int>, int>::value_type)' 9 | std::vector<int>::iterator iter = std::find(oi->begin() , oi->end(), x->at(i) + 1); | ~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 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, from /usr/include/c++/14/ostream:40, from /usr/include/c++/14/iostream:41, from a.cc:1: /usr/include/c++/14/bits/streambuf_iterator.h:435:5: note: candidate: 'template<class _CharT2> typename __gnu_cxx::__enable_if<std::__is_char<_CharT2>::__value, std::istreambuf_iterator<_CharT> >::__type std::find(istreambuf_iterator<_CharT>, istreambuf_iterator<_CharT>, const _CharT2&)' 435 | find(istreambuf_iterator<_CharT> __first, | ^~~~ /usr/include/c++/14/bits/streambuf_iterator.h:435:5: note: template argument deduction/substitution failed: a.cc:9:60: note: '__gnu_cxx::__normal_iterator<int*, std::vector<int> >' is not derived from 'std::istreambuf_iterator<_CharT>' 9 | std::vector<int>::iterator iter = std::find(oi->begin() , oi->end(), x->at(i) + 1); | ~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
s590317389
p00445
C++
#include <iostream> #include <string> using namespace std; int main() { while (cin){ string n1; cin >> n1; int m1 = 0, m2 = 0; if(cin,eof()) for (int i = 0; i < n1.size(); i++){ if (n1[i] == 'J'){ if (n1[i + 1] == 'O'){ if (n1[i + 2] == 'I'){ m1 += 1; } } } else if (n1[i] == 'I'){ if (n1[i + 1] == 'O'){ if (n1[i + 2] == 'I'){ m2 += 1; } } } } cout << m1 << endl; cout << m2 << endl; } return 0; }
a.cc: In function 'int main()': a.cc:10:24: error: 'eof' was not declared in this scope; did you mean 'feof'? 10 | if(cin,eof()) | ^~~ | feof
s576765036
p00445
C++
#include <iostream> #include <string> using namespace std; int main() { while (cin){ string n1; cin >> n1; int m1 = 0, m2 = 0; if(cin,eof()) break; for (int i = 0; i < n1.size(); i++){ if (n1[i] == 'J'){ if (n1[i + 1] == 'O'){ if (n1[i + 2] == 'I'){ m1 += 1; } } } else if (n1[i] == 'I'){ if (n1[i + 1] == 'O'){ if (n1[i + 2] == 'I'){ m2 += 1; } } } } cout << m1 << endl; cout << m2 << endl; } return 0; }
a.cc: In function 'int main()': a.cc:10:24: error: 'eof' was not declared in this scope; did you mean 'feof'? 10 | if(cin,eof()) break; | ^~~ | feof
s227078393
p00445
C++
#include <iostream> #include <string> using namespace std; int main(){ string str,JOI="JOI",IOI="IOI"; cin>>str int J=0,I=0,c1=0,c2=0,a=-1,b=-1; for(int i=0;i<str.size();i++){ J=str.find(JOI,i); I=str.find(IOI,i); if(J>=0&&J!=a){ c1++; a=J; } if(I>=0&&I!=b){ c2++; b=I; } } cout<<c1<<endl<<c2<<endl; return 0; }
a.cc: In function 'int main()': a.cc:7:17: error: expected ';' before 'int' 7 | cin>>str | ^ | ; 8 | int J=0,I=0,c1=0,c2=0,a=-1,b=-1; | ~~~ a.cc:10:17: error: 'J' was not declared in this scope 10 | J=str.find(JOI,i); | ^ a.cc:11:17: error: 'I' was not declared in this scope 11 | I=str.find(IOI,i); | ^ a.cc:12:29: error: 'a' was not declared in this scope 12 | if(J>=0&&J!=a){ | ^ a.cc:13:25: error: 'c1' was not declared in this scope 13 | c1++; | ^~ a.cc:16:29: error: 'b' was not declared in this scope 16 | if(I>=0&&I!=b){ | ^ a.cc:17:25: error: 'c2' was not declared in this scope 17 | c2++; | ^~ a.cc:21:15: error: 'c1' was not declared in this scope 21 | cout<<c1<<endl<<c2<<endl; | ^~ a.cc:21:25: error: 'c2' was not declared in this scope 21 | cout<<c1<<endl<<c2<<endl; | ^~
s731456205
p00445
C++
#include <iostream> #include <string> using namespace std; int main(){ string str,JOI="JOI",IOI="IOI"; while(true){ cin>>str; if(str==EOF)return 0; int J=0,I=0,c1=0,c2=0,a=-1,b=-1; for(int i=0;i<str.size();i++){ J=str.find(JOI,i); I=str.find(IOI,i); if(J>=0&&J!=a){ c1++; a=J; } if(I>=0&&I!=b){ c2++; b=I; } } cout<<c1<<endl<<c2<<endl; } return 0; }
a.cc: In function 'int main()': a.cc:9:15: error: no match for 'operator==' (operand types are 'std::string' {aka 'std::__cxx11::basic_string<char>'} and 'int') 9 | if(str==EOF)return 0; | ~~~^~ | | | std::string {aka std::__cxx11::basic_string<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: In file included from /usr/include/c++/14/cstdio:42, from /usr/include/c++/14/ext/string_conversions.h:45, from /usr/include/c++/14/bits/basic_string.h:4154, 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: a.cc:9:17: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::fpos<_StateT>' 9 | if(str==EOF)return 0; | ^~~ In file included from /usr/include/c++/14/string:43: /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:9:17: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::allocator<_CharT>' 9 | if(str==EOF)return 0; | ^~~ 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:9:17: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::reverse_iterator<_Iterator>' 9 | if(str==EOF)return 0; | ^~~ /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:9:17: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::reverse_iterator<_Iterator>' 9 | if(str==EOF)return 0; | ^~~ /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:9:17: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::move_iterator<_IteratorL>' 9 | if(str==EOF)return 0; | ^~~ /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:9:17: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::move_iterator<_IteratorL>' 9 | if(str==EOF)return 0; | ^~~ 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:9:17: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::pair<_T1, _T2>' 9 | if(str==EOF)return 0; | ^~~ In file included from /usr/include/c++/14/bits/basic_string.h:47: /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:9:17: note: 'std::__cxx11::basic_string<char>' is not derived from 'std::basic_string_view<_CharT, _Traits>' 9 | if(str==EOF)return 0; | ^~~ /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:9:17: note: 'std::__cxx11::basic_string<char>' is not derived from 'std::basic_string_view<_CharT, _Traits>' 9 | if(str==EOF)return 0; | ^~~ /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:9:17: note: mismatched types 'std::basic_string_view<_CharT, _Traits>' and 'int' 9 | if(str==EOF)return 0; | ^~~ /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:9:17: note: mismatched types 'const std::__cxx11::basic_string<_CharT, _Traits, _Allocator>' and 'int' 9 | if(str==EOF)return 0; | ^~~ /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:9:17: note: mismatched types 'const _CharT*' and 'int' 9 | if(str==EOF)return 0; | ^~~ /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:9:17: note: mismatched types 'const _CharT*' and 'std::__cxx11::basic_string<char>' 9 | if(str==EOF)return 0; | ^~~ 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:9:17: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::tuple<_UTypes ...>' 9 | if(str==EOF)return 0; | ^~~ 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:9:17: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::istreambuf_iterator<_CharT, _Traits>' 9 | if(str==EOF)return 0; | ^~~ In file included from /usr/include/x86_64
s463564188
p00445
C++
#include <iostream> #include <string> using namespace std; int main(){ string str,JOI="JOI",IOI="IOI"; while(true){ cin>>str; if(str==-1)return 0; int J=0,I=0,c1=0,c2=0,a=-1,b=-1; for(int i=0;i<str.size();i++){ J=str.find(JOI,i); I=str.find(IOI,i); if(J>=0&&J!=a){ c1++; a=J; } if(I>=0&&I!=b){ c2++; b=I; } } cout<<c1<<endl<<c2<<endl; } return 0; }
a.cc: In function 'int main()': a.cc:9:15: error: no match for 'operator==' (operand types are 'std::string' {aka 'std::__cxx11::basic_string<char>'} and 'int') 9 | if(str==-1)return 0; | ~~~^~~~ | | | | | int | std::string {aka std::__cxx11::basic_string<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:9:18: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::fpos<_StateT>' 9 | if(str==-1)return 0; | ^ 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:9:18: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::allocator<_CharT>' 9 | if(str==-1)return 0; | ^ 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:9:18: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::reverse_iterator<_Iterator>' 9 | if(str==-1)return 0; | ^ /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:9:18: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::reverse_iterator<_Iterator>' 9 | if(str==-1)return 0; | ^ /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:9:18: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::move_iterator<_IteratorL>' 9 | if(str==-1)return 0; | ^ /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:9:18: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::move_iterator<_IteratorL>' 9 | if(str==-1)return 0; | ^ 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:9:18: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::pair<_T1, _T2>' 9 | if(str==-1)return 0; | ^ 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:9:18: note: 'std::__cxx11::basic_string<char>' is not derived from 'std::basic_string_view<_CharT, _Traits>' 9 | if(str==-1)return 0; | ^ /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:9:18: note: 'std::__cxx11::basic_string<char>' is not derived from 'std::basic_string_view<_CharT, _Traits>' 9 | if(str==-1)return 0; | ^ /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:9:18: note: mismatched types 'std::basic_string_view<_CharT, _Traits>' and 'int' 9 | if(str==-1)return 0; | ^ /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:9:18: note: mismatched types 'const std::__cxx11::basic_string<_CharT, _Traits, _Allocator>' and 'int' 9 | if(str==-1)return 0; | ^ /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:9:18: note: mismatched types 'const _CharT*' and 'int' 9 | if(str==-1)return 0; | ^ /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:9:18: note: mismatched types 'const _CharT*' and 'std::__cxx11::basic_string<char>' 9 | if(str==-1)return 0; | ^ 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:9:18: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::tuple<_UTypes ...>' 9 | if(str==-1)return 0; | ^ 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:9:18: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::istreambuf_iterator<_CharT, _Traits>' 9 | if(str==-1)return 0; | ^ In file included from /usr/include/x86_64-linux-gnu/c++/14/bits/c++allocator.h:33, from /usr/include/c++/14/bits/allocator.h:46: /usr/include/c++/14/bits/new_allocator.h:215:9: note: candidate: 'template<class _U
s259059352
p00445
C++
#include <iostream> #include <string> #include<cstdio> using namespace std; int main(){ string str,JOI="JOI",IOI="IOI"; while(true){ cin>>str; if(str==EOF)return 0; int J=0,I=0,c1=0,c2=0,a=-1,b=-1; for(int i=0;i<str.size();i++){ J=str.find(JOI,i); I=str.find(IOI,i); if(J>=0&&J!=a){ c1++; a=J; } if(I>=0&&I!=b){ c2++; b=I; } } cout<<c1<<endl<<c2<<endl; } return 0; }
a.cc: In function 'int main()': a.cc:10:15: error: no match for 'operator==' (operand types are 'std::string' {aka 'std::__cxx11::basic_string<char>'} and 'int') 10 | if(str==EOF)return 0; | ~~~^~ | | | std::string {aka std::__cxx11::basic_string<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: In file included from /usr/include/c++/14/cstdio:42, from /usr/include/c++/14/ext/string_conversions.h:45, from /usr/include/c++/14/bits/basic_string.h:4154, 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: a.cc:10:17: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::fpos<_StateT>' 10 | if(str==EOF)return 0; | ^~~ In file included from /usr/include/c++/14/string:43: /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:10:17: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::allocator<_CharT>' 10 | if(str==EOF)return 0; | ^~~ 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:10:17: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::reverse_iterator<_Iterator>' 10 | if(str==EOF)return 0; | ^~~ /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:10:17: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::reverse_iterator<_Iterator>' 10 | if(str==EOF)return 0; | ^~~ /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:10:17: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::move_iterator<_IteratorL>' 10 | if(str==EOF)return 0; | ^~~ /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:10:17: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::move_iterator<_IteratorL>' 10 | if(str==EOF)return 0; | ^~~ 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:10:17: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::pair<_T1, _T2>' 10 | if(str==EOF)return 0; | ^~~ In file included from /usr/include/c++/14/bits/basic_string.h:47: /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:10:17: note: 'std::__cxx11::basic_string<char>' is not derived from 'std::basic_string_view<_CharT, _Traits>' 10 | if(str==EOF)return 0; | ^~~ /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:10:17: note: 'std::__cxx11::basic_string<char>' is not derived from 'std::basic_string_view<_CharT, _Traits>' 10 | if(str==EOF)return 0; | ^~~ /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:10:17: note: mismatched types 'std::basic_string_view<_CharT, _Traits>' and 'int' 10 | if(str==EOF)return 0; | ^~~ /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:10:17: note: mismatched types 'const std::__cxx11::basic_string<_CharT, _Traits, _Allocator>' and 'int' 10 | if(str==EOF)return 0; | ^~~ /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:10:17: note: mismatched types 'const _CharT*' and 'int' 10 | if(str==EOF)return 0; | ^~~ /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:10:17: note: mismatched types 'const _CharT*' and 'std::__cxx11::basic_string<char>' 10 | if(str==EOF)return 0; | ^~~ 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:10:17: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::tuple<_UTypes ...>' 10 | if(str==EOF)return 0; | ^~~ 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:10:17: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::istreambuf_iterator<_CharT, _Traits>' 10 | if(str==EOF)return 0; | ^~~ In file included from /us
s422998937
p00445
C++
include <iostream> #include <string> using namespace std; int main(){ string s; while( cin >> s){ string joi = "JOI",ioi = "IOI"; int num_joi=0,num_ioi=0; for(int i=0;i < s.size()-2 ;i++) { string sub= s.substr(i,3) ; if(sub == joi) num_joi++; if(sub == ioi) num_ioi++; } cout << num_joi <<"\n" << num_ioi << "\n"; } }
a.cc:1:1: error: 'include' does not name a type 1 | include <iostream> | ^~~~~~~ In file included from /usr/include/c++/14/bits/char_traits.h:42, from /usr/include/c++/14/string:42, from a.cc:2: /usr/include/c++/14/bits/postypes.h:68:11: error: 'ptrdiff_t' does not name a type 68 | typedef ptrdiff_t streamsize; // Signed integral type | ^~~~~~~~~ /usr/include/c++/14/bits/postypes.h:41:1: note: 'ptrdiff_t' is defined in header '<cstddef>'; this is probably fixable by adding '#include <cstddef>' 40 | #include <cwchar> // For mbstate_t +++ |+#include <cstddef> 41 | In file included from /usr/include/c++/14/bits/char_traits.h:50: /usr/include/c++/14/type_traits:666:33: error: 'nullptr_t' is not a member of 'std' 666 | struct is_null_pointer<std::nullptr_t> | ^~~~~~~~~ /usr/include/c++/14/type_traits:666:42: error: template argument 1 is invalid 666 | struct is_null_pointer<std::nullptr_t> | ^ /usr/include/c++/14/type_traits:670:48: error: template argument 1 is invalid 670 | struct is_null_pointer<const std::nullptr_t> | ^ /usr/include/c++/14/type_traits:674:51: error: template argument 1 is invalid 674 | struct is_null_pointer<volatile std::nullptr_t> | ^ /usr/include/c++/14/type_traits:678:57: error: template argument 1 is invalid 678 | struct is_null_pointer<const volatile std::nullptr_t> | ^ /usr/include/c++/14/type_traits:1429:37: error: 'size_t' is not a member of 'std'; did you mean 'size_t'? 1429 | : public integral_constant<std::size_t, alignof(_Tp)> | ^~~~~~ In file included from /usr/include/wchar.h:35, from /usr/include/c++/14/cwchar:44, from /usr/include/c++/14/bits/postypes.h:40: /usr/lib/gcc/x86_64-linux-gnu/14/include/stddef.h:214:23: note: 'size_t' declared here 214 | typedef __SIZE_TYPE__ size_t; | ^~~~~~ /usr/include/c++/14/type_traits:1429:57: error: template argument 1 is invalid 1429 | : public integral_constant<std::size_t, alignof(_Tp)> | ^ /usr/include/c++/14/type_traits:1429:57: note: invalid template non-type parameter /usr/include/c++/14/type_traits:1438:37: error: 'size_t' is not a member of 'std'; did you mean 'size_t'? 1438 | : public integral_constant<std::size_t, 0> { }; | ^~~~~~ /usr/lib/gcc/x86_64-linux-gnu/14/include/stddef.h:214:23: note: 'size_t' declared here 214 | typedef __SIZE_TYPE__ size_t; | ^~~~~~ /usr/include/c++/14/type_traits:1438:46: error: template argument 1 is invalid 1438 | : public integral_constant<std::size_t, 0> { }; | ^ /usr/include/c++/14/type_traits:1438:46: note: invalid template non-type parameter /usr/include/c++/14/type_traits:1440:26: error: 'std::size_t' has not been declared 1440 | template<typename _Tp, std::size_t _Size> | ^~~ /usr/include/c++/14/type_traits:1441:21: error: '_Size' was not declared in this scope 1441 | struct rank<_Tp[_Size]> | ^~~~~ /usr/include/c++/14/type_traits:1441:27: error: template argument 1 is invalid 1441 | struct rank<_Tp[_Size]> | ^ /usr/include/c++/14/type_traits:1442:37: error: 'size_t' is not a member of 'std'; did you mean 'size_t'? 1442 | : public integral_constant<std::size_t, 1 + rank<_Tp>::value> { }; | ^~~~~~ /usr/lib/gcc/x86_64-linux-gnu/14/include/stddef.h:214:23: note: 'size_t' declared here 214 | typedef __SIZE_TYPE__ size_t; | ^~~~~~ /usr/include/c++/14/type_traits:1442:65: error: template argument 1 is invalid 1442 | : public integral_constant<std::size_t, 1 + rank<_Tp>::value> { }; | ^ /usr/include/c++/14/type_traits:1442:65: note: invalid template non-type parameter /usr/include/c++/14/type_traits:1446:37: error: 'size_t' is not a member of 'std'; did you mean 'size_t'? 1446 | : public integral_constant<std::size_t, 1 + rank<_Tp>::value> { }; | ^~~~~~ /usr/lib/gcc/x86_64-linux-gnu/14/include/stddef.h:214:23: note: 'size_t' declared here 214 | typedef __SIZE_TYPE__ size_t; | ^~~~~~ /usr/include/c++/14/type_traits:1446:65: error: template argument 1 is invalid 1446 | : public integral_constant<std::size_t, 1 + rank<_Tp>::value> { }; | ^ /usr/include/c++/14/type_traits:1446:65: note: invalid template non-type parameter /usr/include/c++/14/type_traits:2086:26: error: 'std::size_t' has not been declared 2086 | template<typename _Tp, std::size_t _Size> | ^~~ /usr/include/c++/14/type_traits:2087:30: error: '_Size' was not declared in this scope 2087 | struct remove_extent<_Tp[_Size]> | ^~~~~ /usr/include/c++/14/type_traits:2087:36: error: template argument 1 is invalid 2087 | struct remove_extent<_Tp[_Size]> | ^ /usr/include/c++/14/type_traits:2099:26: error: 'std::size_t' has not been declared 2099 | template<typename _Tp, std::size_t _Size> | ^~~ /usr/include/c++/14/type_traits:2100:35: error: '_Size' was not declared in this scope 2100 | struct remove_all_extents<_Tp[_Size]> | ^~~~~ /usr/include/c++/14/type_traits:2100:41: error: template argument 1 is invalid 2100 | struct remove_all_extents<_Tp[_Size]> | ^ /usr/include/c++/14/type_traits:2171:12: error: 'std::size_t' has not been declared 2171 | template<std::size_t _Len> | ^~~ /usr/include/c++/14/type_traits:2176:30: error: '_Len' was not declared in this scope 2176 | unsigned char __data[_Len]; | ^~~~ /usr/include/c++/14/type_traits:2194:12: error: 'std::size_t' has not been declared 2194 | template<std::size_t _Len, std::size_t _Align = | ^~~ /usr/include/c++/14/type_traits:2194:30: error: 'std::size_t' has not been declared 2194 | template<std::size_t _Len, std::size_t _Align = | ^~~ /usr/include/c++/14/type_traits:2195:55: error: '_Len' was not declared in this scope 2195 | __alignof__(typename __aligned_storage_msa<_Len>::__type)> | ^~~~ /usr/include/c++/14/type_traits:2195:59: error: template argument 1 is invalid 2195 | __alignof__(typename __aligned_storage_msa<_Len>::__type)> | ^ /usr/include/c++/14/type_traits:2202:30: error: '_Len' was not declared in this scope 2202 | unsigned char __data[_Len]; | ^~~~ /usr/include/c++/14/type_traits:2203:44: error: '_Align' was not declared in this scope 2203 | struct __attribute__((__aligned__((_Align)))) { } __align; | ^~~~~~ /usr/include/c++/14/bits/char_traits.h:144:61: error: 'std::size_t' has not been declared 144 | compare(const char_type* __s1, const char_type* __s2, std::size_t __n); | ^~~ /usr/include/c++/14/bits/char_traits.h:146:40: error: 'size_t' in namespace 'std' does not name a type 146 | static _GLIBCXX14_CONSTEXPR std::size_t | ^~~~~~ /usr/include/c++/14/bits/char_traits.h:150:34: error: 'std::size_t' has not been declared 150 | find(const char_type* __s, std::size_t __n, const char_type& __a); | ^~~ /usr/include/c++/14/bits/char_traits.h:153:52: error: 'std::size_t' has not been declared 153 | move(char_type* __s1, const char_type* __s2, std::size_t __n); | ^~~ /usr/include/c++/14/bits/char_traits.h:156:52: error: 'std::size_t' has not been declared 156 | copy(char_type* __s1, const char_type* __s2, std::size_t __n); | ^~~ /usr/include/c++/14/bits/char_traits.h:159:30: error: 'std::size_t' has not been declared 159 | assign(char_type* __s, std::size_t __n, char_type __a); | ^~~ /usr/include/c++/14/bits/char_traits.h:187:59: error: 'std::size_t' has not been declared 187 | compare(const char_type* __s1, const char_type* __s2, std::size_t __n) | ^~~ /usr/include/c++/14/bits/char_traits.h: In static member function 'static constexpr int __gnu_cxx::char_traits<_CharT>::compare(const char_type*, const char_type*, int)': /usr/include/c++/14/bits/char_traits.h:189:17: error: 'size_t' is not a member of 'std'; did you mean 'size_t'? 189 | for (std::size_t __i = 0; __i < __n; ++__i) | ^~~~~~ /usr/lib/gcc/x86_64-linux-gnu/14/include/stddef.h:214:23: note: 'size_t' declared here 214 | typedef __SIZE_TYPE__ size_t; | ^~~~~~ /usr/include/c++/14/bits/char_traits.h:189:33: error: '__i' was not declared in this scope; did you mean '__n'? 189 | for (std::size_t __i = 0; __i < __n; ++__i) | ^~~ | __n /usr/include/c++/14/bits/char_traits.h: At global scope: /usr/include/c++/14/bits/char_traits.h:198:31: error: 'size_t' in namespace 'std' does not name a type 198 | _GLIBCXX14_CONSTEXPR std::size_t |
s361847027
p00445
C++
#include <stdio.h> int main(void) { int i,joi,ioi; char s[11000]; while (scanf("%s",s) != EOF){ joi = 0; ioi = 0; for(i = 0;i <= 10998;i++){ if(s[i] == 'J' && s[i + 1] == 'O' && s[i + 2] == 'I'){ joi++; } if(s[i] == 'I' && s[i + 1] == 'O' && s[i + 2] == 'I'){ ioi++; } } printf("%d\n%d\n",joi,ioi); } return 0;
a.cc: In function 'int main()': a.cc:19:18: error: expected '}' at end of input 19 | return 0; | ^ a.cc:3:16: note: to match this '{' 3 | int main(void) { | ^
s517345431
p00445
C++
#include <iostream> #include <string> using namespace std; int main() { int IOI, JOI; string krsw[10000] = {}; cin >> krsw[10000]; for(int i = 0; i < 10000; i++){ if(krsw[i] = 'I') if(krsw[i + 1] = 'O') if(krsw[i + 2] = 'I') IOI = IOI + 1; if(krsw[i] = 'J') if(krsw[i + 1] = 'O') if(krsw[i + 2] = 'I') JOI = JOI + 1; } cout << JOI << IOI <<endl; return 0; }
a.cc: In function 'int main()': a.cc:10:28: error: could not convert 'krsw[i].std::__cxx11::basic_string<char>::operator=(73)' from 'std::__cxx11::basic_string<char>' to 'bool' 10 | if(krsw[i] = 'I') | ~~~~~~~~^~~~~ | | | std::__cxx11::basic_string<char> a.cc:11:40: error: could not convert 'krsw[(i + 1)].std::__cxx11::basic_string<char>::operator=(79)' from 'std::__cxx11::basic_string<char>' to 'bool' 11 | if(krsw[i + 1] = 'O') | ~~~~~~~~~~~~^~~~~ | | | std::__cxx11::basic_string<char> a.cc:12:48: error: could not convert 'krsw[(i + 2)].std::__cxx11::basic_string<char>::operator=(73)' from 'std::__cxx11::basic_string<char>' to 'bool' 12 | if(krsw[i + 2] = 'I') | ~~~~~~~~~~~~^~~~~ | | | std::__cxx11::basic_string<char> a.cc:14:28: error: could not convert 'krsw[i].std::__cxx11::basic_string<char>::operator=(74)' from 'std::__cxx11::basic_string<char>' to 'bool' 14 | if(krsw[i] = 'J') | ~~~~~~~~^~~~~ | | | std::__cxx11::basic_string<char> a.cc:15:40: error: could not convert 'krsw[(i + 1)].std::__cxx11::basic_string<char>::operator=(79)' from 'std::__cxx11::basic_string<char>' to 'bool' 15 | if(krsw[i + 1] = 'O') | ~~~~~~~~~~~~^~~~~ | | | std::__cxx11::basic_string<char> a.cc:16:48: error: could not convert 'krsw[(i + 2)].std::__cxx11::basic_string<char>::operator=(73)' from 'std::__cxx11::basic_string<char>' to 'bool' 16 | if(krsw[i + 2] = 'I') | ~~~~~~~~~~~~^~~~~ | | | std::__cxx11::basic_string<char>
s462294567
p00445
C++
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 #include <iostream> #include <string> using namespace std; int main() { int joi=0,ioi=0; string str; cin >> str; for(int i=0;i<str.size()-2;i++){ if(str[i+1]=='O'&&str[i+2]=='I'){ if(str[i]=='J') joi++; if(str[i]=='I') ioi++; } } cout << joi << endl << ioi << endl; return 0; }
a.cc:2:1: error: expected unqualified-id before numeric constant 2 | 1 | ^ 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:22: /usr/include/c++/14/bits/postypes.h:68:11: error: 'ptrdiff_t' does not name a type 68 | typedef ptrdiff_t streamsize; // Signed integral type | ^~~~~~~~~ /usr/include/c++/14/bits/postypes.h:41:1: note: 'ptrdiff_t' is defined in header '<cstddef>'; this is probably fixable by adding '#include <cstddef>' 40 | #include <cwchar> // For mbstate_t +++ |+#include <cstddef> 41 | In file included from /usr/include/c++/14/bits/exception_ptr.h:38, from /usr/include/c++/14/exception:166, from /usr/include/c++/14/ios:41: /usr/include/c++/14/new:131:26: error: declaration of 'operator new' as non-function 131 | _GLIBCXX_NODISCARD void* operator new(std::size_t) _GLIBCXX_THROW (std::bad_alloc) | ^~~~~~~~ /usr/include/c++/14/new:131:44: error: 'size_t' is not a member of 'std'; did you mean 'size_t'? 131 | _GLIBCXX_NODISCARD void* operator new(std::size_t) _GLIBCXX_THROW (std::bad_alloc) | ^~~~~~ In file included from /usr/include/wchar.h:35, from /usr/include/c++/14/cwchar:44, from /usr/include/c++/14/bits/postypes.h:40: /usr/lib/gcc/x86_64-linux-gnu/14/include/stddef.h:214:23: note: 'size_t' declared here 214 | typedef __SIZE_TYPE__ size_t; | ^~~~~~ /usr/include/c++/14/new:132:41: error: attributes after parenthesized initializer ignored [-fpermissive] 132 | __attribute__((__externally_visible__)); | ^ /usr/include/c++/14/new:133:26: error: declaration of 'operator new []' as non-function 133 | _GLIBCXX_NODISCARD void* operator new[](std::size_t) _GLIBCXX_THROW (std::bad_alloc) | ^~~~~~~~ /usr/include/c++/14/new:133:46: error: 'size_t' is not a member of 'std'; did you mean 'size_t'? 133 | _GLIBCXX_NODISCARD void* operator new[](std::size_t) _GLIBCXX_THROW (std::bad_alloc) | ^~~~~~ /usr/lib/gcc/x86_64-linux-gnu/14/include/stddef.h:214:23: note: 'size_t' declared here 214 | typedef __SIZE_TYPE__ size_t; | ^~~~~~ /usr/include/c++/14/new:134:41: error: attributes after parenthesized initializer ignored [-fpermissive] 134 | __attribute__((__externally_visible__)); | ^ /usr/include/c++/14/new:140:29: error: 'std::size_t' has not been declared 140 | void operator delete(void*, std::size_t) _GLIBCXX_USE_NOEXCEPT | ^~~ /usr/include/c++/14/new:142:31: error: 'std::size_t' has not been declared 142 | void operator delete[](void*, std::size_t) _GLIBCXX_USE_NOEXCEPT | ^~~ /usr/include/c++/14/new:145:26: error: declaration of 'operator new' as non-function 145 | _GLIBCXX_NODISCARD void* operator new(std::size_t, const std::nothrow_t&) _GLIBCXX_USE_NOEXCEPT | ^~~~~~~~ /usr/include/c++/14/new:145:44: error: 'size_t' is not a member of 'std'; did you mean 'size_t'? 145 | _GLIBCXX_NODISCARD void* operator new(std::size_t, const std::nothrow_t&) _GLIBCXX_USE_NOEXCEPT | ^~~~~~ /usr/lib/gcc/x86_64-linux-gnu/14/include/stddef.h:214:23: note: 'size_t' declared here 214 | typedef __SIZE_TYPE__ size_t; | ^~~~~~ /usr/include/c++/14/new:145:52: error: expected primary-expression before 'const' 145 | _GLIBCXX_NODISCARD void* operator new(std::size_t, const std::nothrow_t&) _GLIBCXX_USE_NOEXCEPT | ^~~~~ /usr/include/c++/14/new:147:26: error: declaration of 'operator new []' as non-function 147 | _GLIBCXX_NODISCARD void* operator new[](std::size_t, const std::nothrow_t&) _GLIBCXX_USE_NOEXCEPT | ^~~~~~~~ /usr/include/c++/14/new:147:46: error: 'size_t' is not a member of 'std'; did you mean 'size_t'? 147 | _GLIBCXX_NODISCARD void* operator new[](std::size_t, const std::nothrow_t&) _GLIBCXX_USE_NOEXCEPT | ^~~~~~ /usr/lib/gcc/x86_64-linux-gnu/14/include/stddef.h:214:23: note: 'size_t' declared here 214 | typedef __SIZE_TYPE__ size_t; | ^~~~~~ /usr/include/c++/14/new:147:54: error: expected primary-expression before 'const' 147 | _GLIBCXX_NODISCARD void* operator new[](std::size_t, const std::nothrow_t&) _GLIBCXX_USE_NOEXCEPT | ^~~~~ /usr/include/c++/14/new:154:26: error: declaration of 'operator new' as non-function 154 | _GLIBCXX_NODISCARD void* operator new(std::size_t, std::align_val_t) | ^~~~~~~~ /usr/include/c++/14/new:154:44: error: 'size_t' is not a member of 'std'; did you mean 'size_t'? 154 | _GLIBCXX_NODISCARD void* operator new(std::size_t, std::align_val_t) | ^~~~~~ /usr/lib/gcc/x86_64-linux-gnu/14/include/stddef.h:214:23: note: 'size_t' declared here 214 | typedef __SIZE_TYPE__ size_t; | ^~~~~~ /usr/include/c++/14/new:154:68: error: expected primary-expression before ')' token 154 | _GLIBCXX_NODISCARD void* operator new(std::size_t, std::align_val_t) | ^ /usr/include/c++/14/new:155:73: error: attributes after parenthesized initializer ignored [-fpermissive] 155 | __attribute__((__externally_visible__, __alloc_size__ (1), __malloc__)); | ^ /usr/include/c++/14/new:156:26: error: declaration of 'operator new' as non-function 156 | _GLIBCXX_NODISCARD void* operator new(std::size_t, std::align_val_t, const std::nothrow_t&) | ^~~~~~~~ /usr/include/c++/14/new:156:44: error: 'size_t' is not a member of 'std'; did you mean 'size_t'? 156 | _GLIBCXX_NODISCARD void* operator new(std::size_t, std::align_val_t, const std::nothrow_t&) | ^~~~~~ /usr/lib/gcc/x86_64-linux-gnu/14/include/stddef.h:214:23: note: 'size_t' declared here 214 | typedef __SIZE_TYPE__ size_t; | ^~~~~~ /usr/include/c++/14/new:156:68: error: expected primary-expression before ',' token 156 | _GLIBCXX_NODISCARD void* operator new(std::size_t, std::align_val_t, const std::nothrow_t&) | ^ /usr/include/c++/14/new:156:70: error: expected primary-expression before 'const' 156 | _GLIBCXX_NODISCARD void* operator new(std::size_t, std::align_val_t, const std::nothrow_t&) | ^~~~~ /usr/include/c++/14/new:162:26: error: declaration of 'operator new []' as non-function 162 | _GLIBCXX_NODISCARD void* operator new[](std::size_t, std::align_val_t) | ^~~~~~~~ /usr/include/c++/14/new:162:46: error: 'size_t' is not a member of 'std'; did you mean 'size_t'? 162 | _GLIBCXX_NODISCARD void* operator new[](std::size_t, std::align_val_t) | ^~~~~~ /usr/lib/gcc/x86_64-linux-gnu/14/include/stddef.h:214:23: note: 'size_t' declared here 214 | typedef __SIZE_TYPE__ size_t; | ^~~~~~ /usr/include/c++/14/new:162:70: error: expected primary-expression before ')' token 162 | _GLIBCXX_NODISCARD void* operator new[](std::size_t, std::align_val_t) | ^ /usr/include/c++/14/new:163:73: error: attributes after parenthesized initializer ignored [-fpermissive] 163 | __attribute__((__externally_visible__, __alloc_size__ (1), __malloc__)); | ^ /usr/include/c++/14/new:164:26: error: declaration of 'operator new []' as non-function 164 | _GLIBCXX_NODISCARD void* operator new[](std::size_t, std::align_val_t, const std::nothrow_t&) | ^~~~~~~~ /usr/include/c++/14/new:164:46: error: 'size_t' is not a member of 'std'; did you mean 'size_t'? 164 | _GLIBCXX_NODISCARD void* operator new[](std::size_t, std::align_val_t, const std::nothrow_t&) | ^~~~~~ /usr/lib/gcc/x86_64-linux-gnu/14/include/stddef.h:214:23: note: 'size_t' declared here 214 | typedef __SIZE_TYPE__ size_t; | ^~~~~~ /usr/include/c++/14/new:164:70: error: expected primary-expression before ',' token 164 | _GLIBCXX_NODISCARD void* operator new[](std::size_t, std::align_val_t, const std::nothrow_t&) | ^ /usr/include/c++/14/new:164:72: error: expected primary-expression before 'const' 164 | _GLIBCXX_NODISCARD void* operator new[](std::size_t, std::align_val_t, const std::nothrow_t&) | ^~~~~ /usr/include/c++/14/new:171:29: error: 'std::size_t' has not been declared 171 | void operator delete(void*, std::size_t, std::align_val_t) | ^~~ /usr/include/c++/14/new:173:31: error: 'std::size_t' has not been declared 173 | void operator delete[](void*, std::size_t, std::align_val_t) | ^~~ /usr/include/c++/14/new:179:33: error: declaration of 'operator new' as non-function 179 | _GLIBCXX_NODISCARD inline void* operator new(std::size_t, void* __p) _GLIBCXX_USE_NOEXCEPT | ^~~~~~~~ /usr/include/c++/14/new:179:51: error: 'size_t' is not a member of 'std'; did you mean 'size_t'? 179 | _GLIBCXX_NODI
s760914898
p00445
C++
#include <cstdio> #include <iostream> #include <functional> #include <algorithm> #include <climits> #include <string> #include <vector> #include <map> #include <cmath> using namespace std; #define println(s) cout << s << '\n'; #define rep(i, n) for (int i=0; i<int(n); i++) #define all(c) (c).begin(), (c).end() char str[10001]; int main() { while(cin >> str) { int count_joi = 0; int count_ioi = 0; for (int i=0; i<strlen(str)-2; i++) { if (str[i+0] == 'J' && str[i+1] == 'O' && str[i+2] == 'I') count_joi++; if (str[i+0] == 'I' && str[i+1] == 'O' && str[i+2] == 'I') count_ioi++; } println(count_joi); println(count_ioi); } return 0; }
a.cc: In function 'int main()': a.cc:24:21: error: 'strlen' was not declared in this scope 24 | for (int i=0; i<strlen(str)-2; i++) { | ^~~~~~ a.cc:10:1: note: 'strlen' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>' 9 | #include <cmath> +++ |+#include <cstring> 10 |
s738808956
p00445
C++
#define _USE_MATH_DEFINES #include <iostream> #include <algorithm> #include <functional> #include <vector> #include <cstdio> #include <string> #include <cmath> #include <cfloat> #include <map> #include <queue> #include <stack> #include <list> using namespace std; int main(){ char s[12000]; while(scanf("%s",s)!=EOF){ int len = strlen(s); int n=0,m=0; for(int i=0;i<len-2;i++){ if(s[i]=='J'&&s[i+1]=='O'&&s[i+2]=='I') n++; else if(s[i]=='I'&&s[i+1]=='O'&&s[i+2]=='I') m++; } cout<<n<<endl; cout<<m<<endl; } }
a.cc: In function 'int main()': a.cc:20:27: error: 'strlen' was not declared in this scope 20 | int len = strlen(s); | ^~~~~~ a.cc:14:1: note: 'strlen' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>' 13 | #include <list> +++ |+#include <cstring> 14 | using namespace std;
s482906444
p00445
C++
#define _USE_MATH_DEFINES #include <iostream> #include <algorithm> #include <functional> #include <vector> #include <cstdio> #include <string> #include <cmath> #include <cfloat> #include <map> #include <queue> #include <stack> #include <list> using namespace std; int main(){ char s[12000]; while(scanf("%s",s)!=EOF){ int len = strlen(s); int n=0,m=0; for(int i=0;i<len-2;i++){ if(s[i]=='J'&&s[i+1]=='O'&&s[i+2]=='I') n++; else if(s[i]=='I'&&s[i+1]=='O'&&s[i+2]=='I') m++; } cout<<n<<endl; cout<<m<<endl; } }
a.cc: In function 'int main()': a.cc:20:27: error: 'strlen' was not declared in this scope 20 | int len = strlen(s); | ^~~~~~ a.cc:14:1: note: 'strlen' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>' 13 | #include <list> +++ |+#include <cstring> 14 | using namespace std;
s891633676
p00445
C++
#include<cstdio> #include<cmath> #include<iostream> #include<algorithm> #include<string> using namespace std; int main() { int cnt[2] = {0}; string target[] = {"JOI", "IOI"}; string a; cin >> a; for(int i = 0;i < 2;i++){ for (int j = 0; j < a.size(); j++) { b = a.find(target[i], j); if(b != string::npos){ cnt[i]++; i = i + b; } } } cout << cnt << endl; return 0; }
a.cc: In function 'int main()': a.cc:17:17: error: 'b' was not declared in this scope 17 | b = a.find(target[i], j); | ^
s057841481
p00445
C++
#include<cstdio> #include<cmath> #include<iostream> #include<string> #include<algorithm> using namespace std; int count1, count2,i; int main(){ char str[10001]; while(1){ count1=0; count2=0; i=0; for(int i=0;i<1000a;i++){ scanf("%s",&str[i]); if(EOF)break; } for (int i = 0; i < 10000; i++) { if (str[i] == 'J'&&str[i+1]=='O'&&str[i+2]=='I'){ count1++; } if (str[i] == 'I'&&str[i + 1] == 'O'&&str[i + 2] == 'I'){ count2++; } } cout << count1 << endl; cout << count2 << endl; } return 0; }
a.cc: In function 'int main()': a.cc:15:19: error: unable to find numeric literal operator 'operator""a' 15 | for(int i=0;i<1000a;i++){ | ^~~~~
s677189915
p00445
C++
#include <iostream> #include <algorithm> #include <string> #include <stack> #include <queue> #include <set> using namespace std; int main() { char ch[1000000]; cin >> ch; int count = 0, bcount = 0; for (int i = 0; i < strlen(ch); i++) { if (ch[i] == 'J'&&ch[i + 1] == 'O'&&ch[i + 2] == 'I') { count++; } if (ch[i] == 'I'&&ch[i + 1] == 'O'&&ch[i + 2] == 'I') { bcount++; } } cout << count << endl << bcount << endl; return 0; }
a.cc: In function 'int main()': a.cc:15:29: error: 'strlen' was not declared in this scope 15 | for (int i = 0; i < strlen(ch); i++) | ^~~~~~ a.cc:7:1: note: 'strlen' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>' 6 | #include <set> +++ |+#include <cstring> 7 |
s891037850
p00445
C++
#include<iostream> using namespace std; int main(){ char text[10000],joi,ioi; while(1){ cin>>text; if(text[0]== "EOF") break; for(int i=0;i<9998;i++){ if(text[i]=='J'&& text[i+1]=='O' && text[i+2]=='I')joi++; if(text[i]=='I'&& text[i+1]=='O' && text[i+2]=='I')ioi++; } cout<<joi<<endl<<ioi<<endl; joi=0;ioi=0; } return 0; }
a.cc: In function 'int main()': a.cc:7:11: error: ISO C++ forbids comparison between pointer and integer [-fpermissive] 7 | if(text[0]== "EOF") break; | ~~~~~~~^~~~~~~~
s122196667
p00445
C++
#include<iostream> using namespace std; int main(){ char text[10000]; int joi,ioi; while(1){ cin>>text; if(text[0]== "EOF") break; for(int i=0;i<9998;i++){ if(text[i]=='J'&& text[i+1]=='O' && text[i+2]=='I')joi++; if(text[i]=='I'&& text[i+1]=='O' && text[i+2]=='I')ioi++; } cout<<joi<<endl<<ioi<<endl; joi=0;ioi=0; } return 0; }
a.cc: In function 'int main()': a.cc:8:11: error: ISO C++ forbids comparison between pointer and integer [-fpermissive] 8 | if(text[0]== "EOF") break; | ~~~~~~~^~~~~~~~
s935848986
p00445
C++
#include<iostream> using namespace std; int main(){ char text[10000]; int joi,ioi; while(cin>>text){ for(int i=0;i<9998;i++){ if(text[i]=='J'&& text[i+1]=='O' && text[i+2]=='I')joi++; if(text[i]=='I'&& text[i+1]=='O' && text[i+2]=='I')ioi++; } cout<<joi<<endl<<ioi<<endl; joi=0;ioi=0; text=""; } return 0; }
a.cc: In function 'int main()': a.cc:13:5: error: incompatible types in assignment of 'const char [1]' to 'char [10000]' 13 | text=""; | ~~~~^~~
s552092460
p00445
C++
#include<iostream> using namespace std; int main(){ char text[10000]; int joi,ioi; while(cin>>text){ for(int i=0;i<9998;i++){ if(text[i]=='J'&& text[i+1]=='O' && text[i+2]=='I')joi++; if(text[i]=='I'&& text[i+1]=='O' && text[i+2]=='I')ioi++; } cout<<joi<<endl<<ioi<<endl; joi=0;ioi=0; text=""; } return 0; }
a.cc: In function 'int main()': a.cc:13:5: error: incompatible types in assignment of 'const char [1]' to 'char [10000]' 13 | text=""; | ~~~~^~~
s577820363
p00445
C++
#include<iostream> using namespace std; int main(){ char text[]; int joi,ioi; while(cin>>text){ for(int i=0;i<9998;i++){ if(text[i]=='J'&& text[i+1]=='O' && text[i+2]=='I')joi++; if(text[i]=='I'&& text[i+1]=='O' && text[i+2]=='I')ioi++; } cout<<joi<<endl<<ioi<<endl; joi=0;ioi=0; } return 0; }
a.cc: In function 'int main()': a.cc:4:6: error: storage size of 'text' isn't known 4 | char text[]; | ^~~~
s854017110
p00445
C++
#include<iostream> using namespace std; int main(){ char text[]; int joi,ioi; while(cin>>text){ for(int i=0;i<9998;i++){ if(text[i]=='J'&& text[i+1]=='O' && text[i+2]=='I')joi++; if(text[i]=='I'&& text[i+1]=='O' && text[i+2]=='I')ioi++; } cout<<joi<<endl<<ioi<<endl; joi=0;ioi=0; } return 0; }
a.cc: In function 'int main()': a.cc:4:6: error: storage size of 'text' isn't known 4 | char text[]; | ^~~~
s390009130
p00445
C++
#include <iostream> #include <cstring> using namespace std; #define REP(i,n) for (int i=0;i<(n);++i) int main() { char str[10001]; while (cin >> str != NULL) { int joi = 0, ioi = 0; REP(i,strlen(str) - 2) { if (strncmp(&str[i], "IOI", 3) == 0) ioi++; else if (strncmp(&str[i], "JOI", 3) == 0) joi++; } printf("%d\n%d\n", joi, ioi); } return 0; }
a.cc: In function 'int main()': a.cc:11:27: error: no match for 'operator!=' (operand types are 'std::basic_istream<char>' and 'long int') 11 | while (cin >> str != NULL) { | ^ a.cc:11:27: note: candidate: 'operator!=(int, long int)' (built-in) a.cc:11:27: note: no known conversion for argument 1 from 'std::basic_istream<char>' to 'int' 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:197:5: note: candidate: 'template<class _StateT> bool std::operator!=(const fpos<_StateT>&, const fpos<_StateT>&)' 197 | operator!=(const fpos<_StateT>& __lhs, const fpos<_StateT>& __rhs) | ^~~~~~~~ /usr/include/c++/14/bits/postypes.h:197:5: note: template argument deduction/substitution failed: In file included from /usr/include/strings.h:23, from /usr/include/string.h:462, from /usr/include/c++/14/cstring:43, from a.cc:2: a.cc:11:30: note: 'std::basic_istream<char>' is not derived from 'const std::fpos<_StateT>' 11 | while (cin >> str != NULL) { | ^~~~ 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:243:5: note: candidate: 'template<class _T1, class _T2> bool std::operator!=(const allocator<_CharT>&, const allocator<_T2>&)' 243 | operator!=(const allocator<_T1>&, const allocator<_T2>&) | ^~~~~~~~ /usr/include/c++/14/bits/allocator.h:243:5: note: template argument deduction/substitution failed: a.cc:11:30: note: 'std::basic_istream<char>' is not derived from 'const std::allocator<_CharT>' 11 | while (cin >> str != NULL) { | ^~~~ In file included from /usr/include/c++/14/string:48: /usr/include/c++/14/bits/stl_iterator.h:455:5: note: candidate: 'template<class _Iterator> constexpr bool std::operator!=(const reverse_iterator<_Iterator>&, const reverse_iterator<_Iterator>&)' 455 | operator!=(const reverse_iterator<_Iterator>& __x, | ^~~~~~~~ /usr/include/c++/14/bits/stl_iterator.h:455:5: note: template argument deduction/substitution failed: a.cc:11:30: note: 'std::basic_istream<char>' is not derived from 'const std::reverse_iterator<_Iterator>' 11 | while (cin >> str != NULL) { | ^~~~ /usr/include/c++/14/bits/stl_iterator.h:500:5: note: candidate: 'template<class _IteratorL, class _IteratorR> constexpr bool std::operator!=(const reverse_iterator<_Iterator>&, const reverse_iterator<_IteratorR>&)' 500 | operator!=(const reverse_iterator<_IteratorL>& __x, | ^~~~~~~~ /usr/include/c++/14/bits/stl_iterator.h:500:5: note: template argument deduction/substitution failed: a.cc:11:30: note: 'std::basic_istream<char>' is not derived from 'const std::reverse_iterator<_Iterator>' 11 | while (cin >> str != NULL) { | ^~~~ /usr/include/c++/14/bits/stl_iterator.h:1686:5: note: candidate: 'template<class _IteratorL, class _IteratorR> constexpr bool std::operator!=(const move_iterator<_IteratorL>&, const move_iterator<_IteratorR>&)' 1686 | operator!=(const move_iterator<_IteratorL>& __x, | ^~~~~~~~ /usr/include/c++/14/bits/stl_iterator.h:1686:5: note: template argument deduction/substitution failed: a.cc:11:30: note: 'std::basic_istream<char>' is not derived from 'const std::move_iterator<_IteratorL>' 11 | while (cin >> str != NULL) { | ^~~~ /usr/include/c++/14/bits/stl_iterator.h:1753:5: note: candidate: 'template<class _Iterator> constexpr bool std::operator!=(const move_iterator<_IteratorL>&, const move_iterator<_IteratorL>&)' 1753 | operator!=(const move_iterator<_Iterator>& __x, | ^~~~~~~~ /usr/include/c++/14/bits/stl_iterator.h:1753:5: note: template argument deduction/substitution failed: a.cc:11:30: note: 'std::basic_istream<char>' is not derived from 'const std::move_iterator<_IteratorL>' 11 | while (cin >> str != NULL) { | ^~~~ 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:1052:5: note: candidate: 'template<class _T1, class _T2> constexpr bool std::operator!=(const pair<_T1, _T2>&, const pair<_T1, _T2>&)' 1052 | operator!=(const pair<_T1, _T2>& __x, const pair<_T1, _T2>& __y) | ^~~~~~~~ /usr/include/c++/14/bits/stl_pair.h:1052:5: note: template argument deduction/substitution failed: a.cc:11:30: note: 'std::basic_istream<char>' is not derived from 'const std::pair<_T1, _T2>' 11 | while (cin >> str != NULL) { | ^~~~ 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:651:5: note: candidate: 'template<class _CharT, class _Traits> constexpr bool std::operator!=(basic_string_view<_CharT, _Traits>, basic_string_view<_CharT, _Traits>)' 651 | operator!=(basic_string_view<_CharT, _Traits> __x, | ^~~~~~~~ /usr/include/c++/14/string_view:651:5: note: template argument deduction/substitution failed: a.cc:11:30: note: 'std::basic_istream<char>' is not derived from 'std::basic_string_view<_CharT, _Traits>' 11 | while (cin >> str != NULL) { | ^~~~ /usr/include/c++/14/string_view:658: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> >)' 658 | operator!=(basic_string_view<_CharT, _Traits> __x, | ^~~~~~~~ /usr/include/c++/14/string_view:658:5: note: template argument deduction/substitution failed: a.cc:11:30: note: 'std::basic_istream<char>' is not derived from 'std::basic_string_view<_CharT, _Traits>' 11 | while (cin >> str != NULL) { | ^~~~ /usr/include/c++/14/string_view:666: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>)' 666 | operator!=(__type_identity_t<basic_string_view<_CharT, _Traits>> __x, | ^~~~~~~~ /usr/include/c++/14/string_view:666:5: note: template argument deduction/substitution failed: a.cc:11:30: note: mismatched types 'std::basic_string_view<_CharT, _Traits>' and 'long int' 11 | while (cin >> str != NULL) { | ^~~~ /usr/include/c++/14/bits/basic_string.h:3833: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>&)' 3833 | operator!=(const basic_string<_CharT, _Traits, _Alloc>& __lhs, | ^~~~~~~~ /usr/include/c++/14/bits/basic_string.h:3833:5: note: template argument deduction/substitution failed: a.cc:11:30: note: 'std::basic_istream<char>' is not derived from 'const std::__cxx11::basic_string<_CharT, _Traits, _Allocator>' 11 | while (cin >> str != NULL) { | ^~~~ /usr/include/c++/14/bits/basic_string.h:3847:5: note: candidate: 'template<class _CharT, class _Traits, class _Alloc> bool std::operator!=(const _CharT*, const __cxx11::basic_string<_CharT, _Traits, _Allocator>&)' 3847 | operator!=(const _CharT* __lhs, | ^~~~~~~~ /usr/include/c++/14/bits/basic_string.h:3847:5: note: template argument deduction/substitution failed: a.cc:11:30: note: mismatched types 'const _CharT*' and 'std::basic_istream<char>' 11 | while (cin >> str != NULL) { | ^~~~ /usr/include/c++/14/bits/basic_string.h:3860:5: note: candidate: 'template<class _CharT, class _Traits, class _Alloc> bool std::operator!=(const __cxx11::basic_string<_CharT, _Traits, _Allocator>&, const _CharT*)' 3860 | operator!=(const basic_string<_CharT, _Traits, _Alloc>& __lhs, | ^~~~~~~~ /usr/include/c++/14/bits/basic_string.h:3860:5: note: template argument deduction/substitution failed: a.cc:11:30: note: 'std::basic_istream<char>' is not derived from 'const std::__cxx11::basic_string<_CharT, _Traits, _Allocator>' 11 | while (cin >> str != NULL) { | ^~~~ 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:2613:5: note: candidate: 'template<class ... _TElements, class ... _UElements> constexpr bool std::operator!=(const tuple<_UTypes ...>&, const tuple<_Elements ...>&)' 2613 | operator!=(const tuple<_TElements...>& __t, | ^~~~~~~~ /usr/include/c++/14/tuple:2613:5: note: template argument deduction/substitution failed: a.cc:11:30: note: 'std::basic_istream<char>' is not derived from 'const std::tuple<_UTypes ...>' 11 | while (cin >> str != NULL) { | ^~~~ 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:242:5: note: candidate: 'template<class _CharT, class _Traits> bool std::operator!=(const istreambuf_iterator<_CharT, _Traits>&, const istreambuf_iterator<_CharT, _Traits>&)' 242 | operator!=(const istreambuf_iterator<_CharT, _Traits>& __a, | ^~~~~~~~ /usr/include/c++/14/bits/streambuf_iterator.h:242:5: note: template argument deduction/substitution failed: a.cc:11:30: note: 'std::basic_istream
s932881056
p00445
C++
#include <iostream> #include <cstring> using namespace std; int main(){ char str[1001]; char JOI[4] = "JOI"; char IOI[4] = "IOI"; int length = strlen(str); bool joiSame = true; bool ioiSame = true; int joiSameCount = 0; int ioiSameCount = 0; while(true){ cin >> str; if(str == null){ break; } for(int i=0;i<length-2;i++){ joiSame = true; ioiSame = true; for(int j=0;j<3;j++){ if(str[i+j] != JOI[j]){ joiSame = false; } if(str[i+j] != IOI[j]){ ioiSame = false; } if(!joiSame && !ioiSame){ break; } } if(joiSame){ joiSameCount++; }else if(ioiSame){ ioiSameCount++; } } cout << joiSameCount << '\n' << ioiSameCount << '\n'; } return 0; }
a.cc: In function 'int main()': a.cc:17:19: error: 'null' was not declared in this scope 17 | if(str == null){ | ^~~~
s212381331
p00445
C++
#include<iostream> using namespace std; int main(){ char str[10001]; int joi=0,ioi=0; bool check::eof() while(!check){ cin >> str; for(int i=0;str[i+2] != '\0'; i++){ if(str[i] == 'I'&&str[i+1] == 'O'&& str[i+2] == 'I') ioi++; else if(str[i] == 'J'&&str[i+1] == 'O'&& str[i+2] == 'I') joi++; } cout << joi <<endl << ioi <<endl; } }
a.cc: In function 'int main()': a.cc:10:9: error: 'check' has not been declared 10 | bool check::eof() | ^~~~~ a.cc:10:19: error: qualified-id in declaration before '(' token 10 | bool check::eof() | ^
s305922305
p00445
C++
#include<iostream> using namespace std; int main(){ char str[10001]; int joi=0,ioi=0; bool check::eof(); while(!check){ cin >> str; for(int i=0;str[i+2] != '\0'; i++){ if(str[i] == 'I'&&str[i+1] == 'O'&& str[i+2] == 'I') ioi++; else if(str[i] == 'J'&&str[i+1] == 'O'&& str[i+2] == 'I') joi++; } cout << joi <<endl << ioi <<endl; } }
a.cc: In function 'int main()': a.cc:10:9: error: 'check' has not been declared 10 | bool check::eof(); | ^~~~~ a.cc:10:19: error: qualified-id in declaration before '(' token 10 | bool check::eof(); | ^ a.cc:12:11: error: 'check' was not declared in this scope 12 | while(!check){ | ^~~~~
s128246817
p00445
C++
#include<iostream> using namespace std; int main(){ char str[10001]; int joi=0,ioi=0; cin >> str; while(!str.eof()){ joi=0;ioi=0; for(int i=0;str[i+2] != '\0'; i++){ if(str[i] == 'I'&&str[i+1] == 'O'&& str[i+2] == 'I') ioi++; else if(str[i] == 'J'&&str[i+1] == 'O'&& str[i+2] == 'I') joi++; } cout << joi <<endl << ioi <<endl; } }
a.cc: In function 'int main()': a.cc:12:15: error: request for member 'eof' in 'str', which is of non-class type 'char [10001]' 12 | while(!str.eof()){ | ^~~
s309405247
p00445
C++
#include<iostream> #include<string> using namespace std; int main(){ string str; int joi=0,ioi=0,i=0; while(cin >> str){ if(str == 0) break; while(i < str.size()){ if(str.find(JOI,i)){ i = str.find(JOI,i); joi++; } i = 0; while(i < str.size()){ if(str.find(IOI,i)){ i = str.find(IOI,i); ioi++; } } cout << joi <<endl << ioi <<endl; }
a.cc: In function 'int main()': a.cc:13:12: error: no match for 'operator==' (operand types are 'std::string' {aka 'std::__cxx11::basic_string<char>'} and 'int') 13 | if(str == 0) break; | ~~~ ^~ ~ | | | | | int | std::string {aka std::__cxx11::basic_string<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:13:15: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::fpos<_StateT>' 13 | if(str == 0) break; | ^ 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:13:15: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::allocator<_CharT>' 13 | if(str == 0) break; | ^ 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:13:15: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::reverse_iterator<_Iterator>' 13 | if(str == 0) break; | ^ /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:13:15: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::reverse_iterator<_Iterator>' 13 | if(str == 0) break; | ^ /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:13:15: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::move_iterator<_IteratorL>' 13 | if(str == 0) break; | ^ /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:13:15: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::move_iterator<_IteratorL>' 13 | if(str == 0) break; | ^ 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:13:15: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::pair<_T1, _T2>' 13 | if(str == 0) break; | ^ 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:13:15: note: 'std::__cxx11::basic_string<char>' is not derived from 'std::basic_string_view<_CharT, _Traits>' 13 | if(str == 0) break; | ^ /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:13:15: note: 'std::__cxx11::basic_string<char>' is not derived from 'std::basic_string_view<_CharT, _Traits>' 13 | if(str == 0) break; | ^ /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:13:15: note: mismatched types 'std::basic_string_view<_CharT, _Traits>' and 'int' 13 | if(str == 0) break; | ^ /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:13:15: note: mismatched types 'const std::__cxx11::basic_string<_CharT, _Traits, _Allocator>' and 'int' 13 | if(str == 0) break; | ^ /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:13:15: note: mismatched types 'const _CharT*' and 'int' 13 | if(str == 0) break; | ^ /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:13:15: note: mismatched types 'const _CharT*' and 'std::__cxx11::basic_string<char>' 13 | if(str == 0) break; | ^ 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:13:15: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::tuple<_UTypes ...>' 13 | if(str == 0) break; | ^ 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:13:15: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::istreambuf_iterator<_CharT, _Traits>' 13 | if(str == 0) break; | ^ In file included from /usr/include/x86_64-linux-gnu/c++/14/bits/c++allocator.h:33, from /usr/include/c++/14/bits/allocator.h:46: /usr/include/c++/14/bits/new_allocator.h:215:9: note: candidate: 'template<class _Up> bool std::operator==(const __new_allocator<char>&, const __new_allocator<_Tp>&)' 215 | operator==(const __n
s120800061
p00445
C++
//AOJ0522 #include<iostream> #include<string> using namespace std; int main(){ while(1){ string str; cin>>str; int cntJOI,cntIOI; cntJOI=0,cntIOI=0; for(int i=0;i<str.size()-2;i++){ if(str[i+1]=='O'&&str[i+2]=='I'){ if(str[i]=='J'){ cntJOI++; } else if(str[i]=='I'){ cntIOI++; } } } } cout<<cntJOI<<"\n"<<cntIOI<<"\n"; return 0; }
a.cc: In function 'int main()': a.cc:28:9: error: 'cntJOI' was not declared in this scope 28 | cout<<cntJOI<<"\n"<<cntIOI<<"\n"; | ^~~~~~ a.cc:28:23: error: 'cntIOI' was not declared in this scope 28 | cout<<cntJOI<<"\n"<<cntIOI<<"\n"; | ^~~~~~
s849563934
p00445
C++
#include <cstdio> #include <cstring> using namespace std; char s[10002]; int J,I; int main() { while(1){ scanf("%s",s); if(s==EOF) return 0; J=0; I=0; for(int i=0;i<strlen(s)-2;i++){ if(s[i]=='J'&&s[i+1]=='O'&&s[i+2]=='I') J++; if(s[i]=='I'&&s[i+1]=='O'&&s[i+2]=='I') I++; } printf("%d\n%d\n",J,I); }}
a.cc: In function 'int main()': a.cc:9:6: error: ISO C++ forbids comparison between pointer and integer [-fpermissive] 9 | if(s==EOF) return 0; | ^
s330079254
p00445
C++
#include <cstdio> #include <cstring> using namespace std; char s[10002]; int J,I; int main() { while(1){ scanf("%s",s); if(s[0]==\0) return 0; J=0; I=0; for(int i=0;i<strlen(s)-2;i++){ if(s[i]=='J'&&s[i+1]=='O'&&s[i+2]=='I') J++; if(s[i]=='I'&&s[i+1]=='O'&&s[i+2]=='I') I++; } printf("%d\n%d\n",J,I); }}
a.cc:9:11: error: stray '\' in program 9 | if(s[0]==\0) return 0; | ^
s595096617
p00445
C++
#include<iostream> #include<string> #include<cstring> using namespace std; int main() { char test1; while(cin>>test1){ int num1=0,num2=0,num3=0; num1=strlen(test1); for(int i=0;i<num1-2;i++){ if(test1[i]=='J'&&test1[i+1]=='O'&&test1[i+2]=='I'){ num2=num2+1; } if(test1[i]=='I'&&test1[i+1]=='O'&&test1[i+2]=='I'){ num3=num3+1; } } cout<<num2; cout<<"\n"; cout<<num3; cout<<"\n"; num2=0; num3=0; } return 0; }
a.cc: In function 'int main()': a.cc:10:29: error: invalid conversion from 'char' to 'const char*' [-fpermissive] 10 | num1=strlen(test1); | ^~~~~ | | | char In file included from /usr/include/c++/14/cstring:43, from a.cc:3: /usr/include/string.h:407:35: note: initializing argument 1 of 'size_t strlen(const char*)' 407 | extern size_t strlen (const char *__s) | ~~~~~~~~~~~~^~~ a.cc:12:33: error: invalid types 'char[int]' for array subscript 12 | if(test1[i]=='J'&&test1[i+1]=='O'&&test1[i+2]=='I'){ | ^ a.cc:12:48: error: invalid types 'char[int]' for array subscript 12 | if(test1[i]=='J'&&test1[i+1]=='O'&&test1[i+2]=='I'){ | ^ a.cc:12:65: error: invalid types 'char[int]' for array subscript 12 | if(test1[i]=='J'&&test1[i+1]=='O'&&test1[i+2]=='I'){ | ^ a.cc:15:33: error: invalid types 'char[int]' for array subscript 15 | if(test1[i]=='I'&&test1[i+1]=='O'&&test1[i+2]=='I'){ | ^ a.cc:15:48: error: invalid types 'char[int]' for array subscript 15 | if(test1[i]=='I'&&test1[i+1]=='O'&&test1[i+2]=='I'){ | ^ a.cc:15:65: error: invalid types 'char[int]' for array subscript 15 | if(test1[i]=='I'&&test1[i+1]=='O'&&test1[i+2]=='I'){ | ^
s161129226
p00445
C++
#include <iostream> using namespace std; int main(){ int moji,count1=0,count2=0; char str[10000]; cin>>str; moji=strlen(str); for(int j=0;j<moji;j++){ if(str[j]=='J' && str[j+1]=='O' && str[j+2]=='I'){ count1+=1; } if(str[j]=='I' && str[j+1]=='O' && str[j+2]=='I'){ count2+=1; } } cout<<count1<<endl<<count2<<endl; }
a.cc: In function 'int main()': a.cc:7:10: error: 'strlen' was not declared in this scope 7 | moji=strlen(str); | ^~~~~~ a.cc:2:1: note: 'strlen' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>' 1 | #include <iostream> +++ |+#include <cstring> 2 | using namespace std;
s711390664
p00445
C++
#include <stdio.h> #include <algorithm> using namespace std; char str[12345]; int main(){ int joi_ans; int ioi_ans; while (1){ memset(str, 0, sizeof(str)); if (scanf("%s", str) == EOF) return 0; joi_ans = 0; ioi_ans = 0; for (int a = 0;; a++){ if (str[a] == 'J' && str[a + 1] == 'O' && str[a + 2] == 'I') joi_ans++; if (str[a] == 'I' && str[a + 1] == 'O' && str[a + 2] == 'I') ioi_ans++; if (str[a + 1] == 0) break; } printf("%d\n%d\n", joi_ans, ioi_ans); } }
a.cc: In function 'int main()': a.cc:11:17: error: 'memset' was not declared in this scope 11 | memset(str, 0, sizeof(str)); | ^~~~~~ a.cc:3:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>' 2 | #include <algorithm> +++ |+#include <cstring> 3 | using namespace std;
s268070621
p00445
C++
#include <bits/stdc++.h> using namespace std; #define Rep(i,N) for(int i = 0;i < N;i++) int main() { while(cin >> s) { int jcnt = 0,icnt = 0; Rep(i,s.size() - 2) { if(s[i + 2] == 'I' && s[i + 1] == 'O') { if(s[i] == 'J') { jcnt++; }else if(s[i] == 'I') { icnt++; } } } cout << jcnt << endl << icnt << endl; } return 0; }
a.cc: In function 'int main()': a.cc:6:16: error: 's' was not declared in this scope 6 | while(cin >> s) { | ^
s784543999
p00445
C++
#include <iostream> #include <string> using namespace std; int solve(string s){ int joi=0,ioi=0; for(int i=0;i<s.size()-2;i++){ if(s.substr(i,3)=="JOI")joi++; else if(s.substr(i,3)=="IOI")ioi++; } cout<<joi<<endl; cout<<ioi<<endl; return 0; } int main(){ string s; whlie(cin>>s){ solve(s); } return 0; }
a.cc: In function 'int main()': a.cc:18:3: error: 'whlie' was not declared in this scope 18 | whlie(cin>>s){ | ^~~~~
s108836564
p00445
C++
#include<iostream> #include<string> using namespace std; #include<string.h> int main(){ string a; cin>>a; while(cin >> s, !cin.eof()) { int i,ioi=0,joi=0; for(i=0;i<s.size()-2;i++){ if(a[i]=='J'&&a[i+1]=='O'&&a[i+2]=='I') joi++; if(a[i]=='I'&&a[i+1]=='O'&&a[i+2]=='I') ioi++; } } cout<<joi << endl; cout<<ioi << endl; return 0; }
a.cc: In function 'int main()': a.cc:8:22: error: 's' was not declared in this scope 8 | while(cin >> s, !cin.eof()) { | ^ a.cc:17:15: error: 'joi' was not declared in this scope 17 | cout<<joi << endl; | ^~~ a.cc:18:15: error: 'ioi' was not declared in this scope 18 | cout<<ioi << endl; | ^~~
s343283062
p00445
C++
#include<iostream> #include<string> using namespace std; #include<string.h> int main(){ string a; cin>>a; while(cin >> s, !cin.eof()) { int i,ioi=0,joi=0; for(i=0;i<s.size()-2;i++){ if(a[i]=='J'&&a[i+1]=='O'&&a[i+2]=='I') joi++; if(a[i]=='I'&&a[i+1]=='O'&&a[i+2]=='I') ioi++; } cout<<joi << endl; cout<<ioi << endl; } return 0; }
a.cc: In function 'int main()': a.cc:8:22: error: 's' was not declared in this scope 8 | while(cin >> s, !cin.eof()) { | ^
s432561642
p00445
C++
#include<iostream> #include<string> using namespace std; #include<string.h> int main(){ string a; cin>>a; while(cin >> s,){ int i,ioi=0,joi=0; for(i=0;i<s.size()-2;i++){ if(a[i]=='J'&&a[i+1]=='O'&&a[i+2]=='I') joi++; if(a[i]=='I'&&a[i+1]=='O'&&a[i+2]=='I') ioi++; } cout<<joi << endl; cout<<ioi << endl; } }
a.cc: In function 'int main()': a.cc:8:22: error: 's' was not declared in this scope 8 | while(cin >> s,){ | ^ a.cc:8:24: error: expected primary-expression before ')' token 8 | while(cin >> s,){ | ^
s055600334
p00445
C++
#include<iostream> #include<string> using namespace std; int main(){ string a; cin>>a; while(cin >> s,){ int i,ioi=0,joi=0; for(i=0;i<s.size()-2;i++){ if(a[i]=='J'&&a[i+1]=='O'&&a[i+2]=='I') joi++; if(a[i]=='I'&&a[i+1]=='O'&&a[i+2]=='I') ioi++; } cout<<joi << endl; cout<<ioi << endl; } }
a.cc: In function 'int main()': a.cc:7:22: error: 's' was not declared in this scope 7 | while(cin >> s,){ | ^ a.cc:7:24: error: expected primary-expression before ')' token 7 | while(cin >> s,){ | ^
s543584838
p00445
C++
#include<iostream> #include<string> using namespace std; int main(){ string a; cin>>a; while(cin >> a){ int i,ioi=0,joi=0; for(i=0;i<s.size()-2;i++){ if(a[i]=='J'&&a[i+1]=='O'&&a[i+2]=='I') joi++; if(a[i]=='I'&&a[i+1]=='O'&&a[i+2]=='I') ioi++; } cout<<joi << endl; cout<<ioi << endl; } }
a.cc: In function 'int main()': a.cc:9:19: error: 's' was not declared in this scope 9 | for(i=0;i<s.size()-2;i++){ | ^
s019183800
p00445
C++
#include<iostream> #include<string> using namespace std; int main(){ string a; cin>>a; while(cin >> a,!cin.eof()){ int i,ioi=0,joi=0; for(i=0;i<s.size()-2;i++){ if(a[i]=='J'&&a[i+1]=='O'&&a[i+2]=='I') joi++; i+=1; if(a[i]=='I'&&a[i+1]=='O'&&a[i+2]=='I') ioi++; i+=1; } cout<<joi << endl; cout<<ioi << endl; } }
a.cc: In function 'int main()': a.cc:9:19: error: 's' was not declared in this scope 9 | for(i=0;i<s.size()-2;i++){ | ^
s835112167
p00445
C++
#include<iostream> #include<string> using namespace std; int main(){ string a; int i,ioi=0,joi=0; while(cin >> a,!cin.eof()){ joi=0; ioi=0; for(i=0;i<s.size()-2;i++){ if(a[i]=='J'&&a[i+1]=='O'&&a[i+2]=='I') joi++; i+=1; if(a[i]=='I'&&a[i+1]=='O'&&a[i+2]=='I') ioi++; i+=1; } cout<<joi << endl; cout<<ioi << endl; } }
a.cc: In function 'int main()': a.cc:10:19: error: 's' was not declared in this scope 10 | for(i=0;i<s.size()-2;i++){ | ^
s213341310
p00445
C++
#include<iostream> #include<string> using namespace std; int main(){ string a; int i,ioi,joi; while(cin >> s, !cin.eof()) { ????????joi = 0; ????????ioi = 0; ????????for(i=0;i<s.size()-2;i++) { ????????????????if(a[i]=='J') { ????????????????????????if(a[i+1]=='O') { ????????????????????????????????if(a[i+2]=='I') { ????????????????????????????????????????joi++; ????????????????????????????????????????i += 1; ????????????????????????????????} ????????????????????????} ????????????????} ??????????????????????if(a[i]=='I') { ????????????????????????if(a[i+1]=='O') { ????????????????????????????????if(a[i+2]=='I') { ????????????????????????????????????????ioi++; ????????????????????????????????????????i += 1; ????????????????????????????????} ????????????????????????} ????????????????} ????????}?? cout<<joi << endl; cout<<ioi << endl; } }
a.cc: In function 'int main()': a.cc:7:14: error: 's' was not declared in this scope 7 | while(cin >> s, !cin.eof()) { | ^ a.cc:8:1: error: expected primary-expression before '?' token 8 | ????????joi = 0; | ^ a.cc:8:2: error: expected primary-expression before '?' token 8 | ????????joi = 0; | ^ a.cc:8:3: error: expected primary-expression before '?' token 8 | ????????joi = 0; | ^ a.cc:8:4: error: expected primary-expression before '?' token 8 | ????????joi = 0; | ^ a.cc:8:5: error: expected primary-expression before '?' token 8 | ????????joi = 0; | ^ a.cc:8:6: error: expected primary-expression before '?' token 8 | ????????joi = 0; | ^ a.cc:8:7: error: expected primary-expression before '?' token 8 | ????????joi = 0; | ^ a.cc:8:8: error: expected primary-expression before '?' token 8 | ????????joi = 0; | ^ a.cc:8:16: error: expected ':' before ';' token 8 | ????????joi = 0; | ^ | : a.cc:8:16: error: expected primary-expression before ';' token a.cc:8:16: error: expected ':' before ';' token 8 | ????????joi = 0; | ^ | : a.cc:8:16: error: expected primary-expression before ';' token a.cc:8:16: error: expected ':' before ';' token 8 | ????????joi = 0; | ^ | : a.cc:8:16: error: expected primary-expression before ';' token a.cc:8:16: error: expected ':' before ';' token 8 | ????????joi = 0; | ^ | : a.cc:8:16: error: expected primary-expression before ';' token a.cc:8:16: error: expected ':' before ';' token 8 | ????????joi = 0; | ^ | : a.cc:8:16: error: expected primary-expression before ';' token a.cc:8:16: error: expected ':' before ';' token 8 | ????????joi = 0; | ^ | : a.cc:8:16: error: expected primary-expression before ';' token a.cc:8:16: error: expected ':' before ';' token 8 | ????????joi = 0; | ^ | : a.cc:8:16: error: expected primary-expression before ';' token a.cc:8:16: error: expected ':' before ';' token 8 | ????????joi = 0; | ^ | : a.cc:8:16: error: expected primary-expression before ';' token a.cc:9:1: error: expected primary-expression before '?' token 9 | ????????ioi = 0; | ^ a.cc:9:2: error: expected primary-expression before '?' token 9 | ????????ioi = 0; | ^ a.cc:9:3: error: expected primary-expression before '?' token 9 | ????????ioi = 0; | ^ a.cc:9:4: error: expected primary-expression before '?' token 9 | ????????ioi = 0; | ^ a.cc:9:5: error: expected primary-expression before '?' token 9 | ????????ioi = 0; | ^ a.cc:9:6: error: expected primary-expression before '?' token 9 | ????????ioi = 0; | ^ a.cc:9:7: error: expected primary-expression before '?' token 9 | ????????ioi = 0; | ^ a.cc:9:8: error: expected primary-expression before '?' token 9 | ????????ioi = 0; | ^ a.cc:9:16: error: expected ':' before ';' token 9 | ????????ioi = 0; | ^ | : a.cc:9:16: error: expected primary-expression before ';' token a.cc:9:16: error: expected ':' before ';' token 9 | ????????ioi = 0; | ^ | : a.cc:9:16: error: expected primary-expression before ';' token a.cc:9:16: error: expected ':' before ';' token 9 | ????????ioi = 0; | ^ | : a.cc:9:16: error: expected primary-expression before ';' token a.cc:9:16: error: expected ':' before ';' token 9 | ????????ioi = 0; | ^ | : a.cc:9:16: error: expected primary-expression before ';' token a.cc:9:16: error: expected ':' before ';' token 9 | ????????ioi = 0; | ^ | : a.cc:9:16: error: expected primary-expression before ';' token a.cc:9:16: error: expected ':' before ';' token 9 | ????????ioi = 0; | ^ | : a.cc:9:16: error: expected primary-expression before ';' token a.cc:9:16: error: expected ':' before ';' token 9 | ????????ioi = 0; | ^ | : a.cc:9:16: error: expected primary-expression before ';' token a.cc:9:16: error: expected ':' before ';' token 9 | ????????ioi = 0; | ^ | : a.cc:9:16: error: expected primary-expression before ';' token a.cc:10:1: error: expected primary-expression before '?' token 10 | ????????for(i=0;i<s.size()-2;i++) { | ^ a.cc:10:2: error: expected primary-expression before '?' token 10 | ????????for(i=0;i<s.size()-2;i++) { | ^ a.cc:10:3: error: expected primary-expression before '?' token 10 | ????????for(i=0;i<s.size()-2;i++) { | ^ a.cc:10:4: error: expected primary-expression before '?' token 10 | ????????for(i=0;i<s.size()-2;i++) { | ^ a.cc:10:5: error: expected primary-expression before '?' token 10 | ????????for(i=0;i<s.size()-2;i++) { | ^ a.cc:10:6: error: expected primary-expression before '?' token 10 | ????????for(i=0;i<s.size()-2;i++) { | ^ a.cc:10:7: error: expected primary-expression before '?' token 10 | ????????for(i=0;i<s.size()-2;i++) { | ^ a.cc:10:8: error: expected primary-expression before '?' token 10 | ????????for(i=0;i<s.size()-2;i++) { | ^ a.cc:10:9: error: expected primary-expression before 'for' 10 | ????????for(i=0;i<s.size()-2;i++) { | ^~~ a.cc:10:9: error: expected ':' before 'for' 10 | ????????for(i=0;i<s.size()-2;i++) { | ^~~ | : a.cc:10:9: error: expected primary-expression before 'for' 10 | ????????for(i=0;i<s.size()-2;i++) { | ^~~ a.cc:10:9: error: expected ':' before 'for' 10 | ????????for(i=0;i<s.size()-2;i++) { | ^~~ | : a.cc:10:9: error: expected primary-expression before 'for' 10 | ????????for(i=0;i<s.size()-2;i++) { | ^~~ a.cc:10:9: error: expected ':' before 'for' 10 | ????????for(i=0;i<s.size()-2;i++) { | ^~~ | : a.cc:10:9: error: expected primary-expression before 'for' 10 | ????????for(i=0;i<s.size()-2;i++) { | ^~~ a.cc:10:9: error: expected ':' before 'for' 10 | ????????for(i=0;i<s.size()-2;i++) { | ^~~ | : a.cc:10:9: error: expected primary-expression before 'for' 10 | ????????for(i=0;i<s.size()-2;i++) { | ^~~ a.cc:10:9: error: expected ':' before 'for' 10 | ????????for(i=0;i<s.size()-2;i++) { | ^~~ | : a.cc:10:9: error: expected primary-expression before 'for' 10 | ????????for(i=0;i<s.size()-2;i++) { | ^~~ a.cc:10:9: error: expected ':' before 'for' 10 | ????????for(i=0;i<s.size()-2;i++) { | ^~~ | : a.cc:10:9: error: expected primary-expression before 'for' 10 | ????????for(i=0;i<s.size()-2;i++) { | ^~~ a.cc:10:9: error: expected ':' before 'for' 10 | ????????for(i=0;i<s.size()-2;i++) { | ^~~ | : a.cc:10:9: error: expected primary-expression before 'for' 10 | ????????for(i=0;i<s.size()-2;i++) { | ^~~ a.cc:10:9: error: expected ':' before 'for' 10 | ????????for(i=0;i<s.size()-2;i++) { | ^~~ | : a.cc:10:9: error: expected primary-expression before 'for' 10 | ????????for(i=0;i<s.size()-2;i++) { | ^~~ a.cc:10:33: error: expected ';' before ')' token 10 | ????????for(i=0;i<s.size()-2;i++) { | ^ | ; a.cc:27:10: error: expected primary-expression before '?' token 27 | ????????}?? | ^ a.cc:27:11: error: expected primary-expression before '?' token 27 | ????????}?? | ^ a.cc:28:26: error: expected ':' before ';' token 28 | cout<<joi << endl; | ^ | : a.cc:28:26: error: expected primary-expression before ';' token a.cc:28:26: error: expected ':' before ';' token 28 | cout<<joi << endl; | ^ | : a.cc:28:26: error: expected primary-expression before ';' token
s845958233
p00445
C++
#include <iostream> #include <string> using namespace std; int main () { string a; int i, joi, ioi; while(cin >> s, !cin.eof()) { joi = 0; ioi = 0; for(i=0;i<a.size()-2;i++) { if(a[i]=='J') { if(a[i+1]=='O') { if(a[i+2]=='I') { joi++; i += 1; } } } if(a[i]=='I') { if(a[i+1]=='O') { if(a[i+2]=='I') { ioi++; i += 1; } } } } cout << joi << endl; cout <<ioi << endl; } }
a.cc: In function 'int main()': a.cc:7:14: error: 's' was not declared in this scope 7 | while(cin >> s, !cin.eof()) { | ^
s921513242
p00445
C++
#include <iostream> #include <string> using namespace std; ?? int main () { ????????string s; ????????int i, joi, ioi; while(cin >> s, !cin.eof()) { ????????joi = 0; ????????ioi = 0; ????????for(i=0;i<s.size()-2;i++) { ????????????????if(s[i]=='J') { ????????????????????????if(s[i+1]=='O') { ????????????????????????????????if(s[i+2]=='I') { ????????????????????????????????????????joi++; ????????????????????????????????????????i += 1; ????????????????????????????????} ????????????????????????} ????????????????} ??????????????????????if(s[i]=='I') { ????????????????????????if(s[i+1]=='O') { ????????????????????????????????if(s[i+2]=='I') { ????????????????????????????????????????ioi++; ????????????????????????????????????????i += 1; ????????????????????????????????} ????????????????????????} ????????????????} ????????}?????????? cout << joi << endl; cout <<ioi << endl; } }
a.cc:4:1: error: expected unqualified-id before '?' token 4 | ?? | ^
s748634115
p00445
C++
#include<iostream> #include<string.h> using namespace std; int main(){ char a[10000]; int i,ioi,joi; while(cin>>a,!cin.eof())[ joi=0; ioi=0; for(i=0;i<strlen(a);i++){ if(a[i]=='J',a[i+1]=='O',a[i+2]=='I') joi++; if(a[i]=='I',a[i+1]=='O',a[i+2]=='I') ioi++; } cout << joi << endl; cout << ioi << endl; } return 0; }
a.cc: In function 'int main()': a.cc:8:22: error: expected ',' before ';' token 8 | joi=0; | ^ | , a.cc:8:22: error: expected identifier before ';' token a.cc:8:22: error: expected ']' before ';' token 8 | joi=0; | ^ | ] a.cc: In lambda function: a.cc:8:22: error: expected '{' before ';' token a.cc: At global scope: a.cc:19:9: error: expected unqualified-id before 'return' 19 | return 0; | ^~~~~~ a.cc:20:1: error: expected declaration before '}' token 20 | } | ^
s967356696
p00445
C++
#include<iostream> #include<string.h> using namespace std; int main(){ char a[10001]; int i,ioi,joi; while(cin>>a,!cin.eof())[ joi=0; ioi=0; for(i=0;i<strlen(a);i++){ if(a[i]=='J',a[i+1]=='O',a[i+2]=='I') joi++; else if(a[i]=='I',a[i+1]=='O',a[i+2]=='I') ioi++; } cout << joi << endl; cout << ioi << endl; } return 0; }
a.cc: In function 'int main()': a.cc:8:22: error: expected ',' before ';' token 8 | joi=0; | ^ | , a.cc:8:22: error: expected identifier before ';' token a.cc:8:22: error: expected ']' before ';' token 8 | joi=0; | ^ | ] a.cc: In lambda function: a.cc:8:22: error: expected '{' before ';' token a.cc: At global scope: a.cc:19:9: error: expected unqualified-id before 'return' 19 | return 0; | ^~~~~~ a.cc:20:1: error: expected declaration before '}' token 20 | } | ^
s049322230
p00445
C++
#include<stdio.h> #include<string.h> int main() { ????????char str[10000] = { 0 }, str2[10000]; ????????int i, m, n, j, joi, ioi; ????????while (scanf("%s", str) != EOF){ ????????????????joi = 0; ????????????????ioi = 0; ????????????????n = strlen(str); ????????????????for (i = 0; i < n; i++) { ????????????????????????if (str[i] == 'J'&&str[i + 1] == 'O'&&str[i + 2] == 'I') { ????????????????????????????????joi++; ????????????????????????} ????????????????????????if (str[i] == 'I'&&str[i + 1] == 'O'&&str[i + 2] == 'I') { ????????????????????????????????ioi++; ????????????????????????} ????????????????} ????????????????printf("%d\n%d\n", joi,ioi); ????????} }
a.cc: In function 'int main()': a.cc:5:1: error: expected primary-expression before '?' token 5 | ????????char str[10000] = { 0 }, str2[10000]; | ^ a.cc:5:2: error: expected primary-expression before '?' token 5 | ????????char str[10000] = { 0 }, str2[10000]; | ^ a.cc:5:3: error: expected primary-expression before '?' token 5 | ????????char str[10000] = { 0 }, str2[10000]; | ^ a.cc:5:4: error: expected primary-expression before '?' token 5 | ????????char str[10000] = { 0 }, str2[10000]; | ^ a.cc:5:5: error: expected primary-expression before '?' token 5 | ????????char str[10000] = { 0 }, str2[10000]; | ^ a.cc:5:6: error: expected primary-expression before '?' token 5 | ????????char str[10000] = { 0 }, str2[10000]; | ^ a.cc:5:7: error: expected primary-expression before '?' token 5 | ????????char str[10000] = { 0 }, str2[10000]; | ^ a.cc:5:8: error: expected primary-expression before '?' token 5 | ????????char str[10000] = { 0 }, str2[10000]; | ^ a.cc:5:9: error: expected primary-expression before 'char' 5 | ????????char str[10000] = { 0 }, str2[10000]; | ^~~~ a.cc:5:9: error: expected ':' before 'char' 5 | ????????char str[10000] = { 0 }, str2[10000]; | ^~~~ | : a.cc:5:9: error: expected primary-expression before 'char' 5 | ????????char str[10000] = { 0 }, str2[10000]; | ^~~~ a.cc:5:9: error: expected ':' before 'char' 5 | ????????char str[10000] = { 0 }, str2[10000]; | ^~~~ | : a.cc:5:9: error: expected primary-expression before 'char' 5 | ????????char str[10000] = { 0 }, str2[10000]; | ^~~~ a.cc:5:9: error: expected ':' before 'char' 5 | ????????char str[10000] = { 0 }, str2[10000]; | ^~~~ | : a.cc:5:9: error: expected primary-expression before 'char' 5 | ????????char str[10000] = { 0 }, str2[10000]; | ^~~~ a.cc:5:9: error: expected ':' before 'char' 5 | ????????char str[10000] = { 0 }, str2[10000]; | ^~~~ | : a.cc:5:9: error: expected primary-expression before 'char' 5 | ????????char str[10000] = { 0 }, str2[10000]; | ^~~~ a.cc:5:9: error: expected ':' before 'char' 5 | ????????char str[10000] = { 0 }, str2[10000]; | ^~~~ | : a.cc:5:9: error: expected primary-expression before 'char' 5 | ????????char str[10000] = { 0 }, str2[10000]; | ^~~~ a.cc:5:9: error: expected ':' before 'char' 5 | ????????char str[10000] = { 0 }, str2[10000]; | ^~~~ | : a.cc:5:9: error: expected primary-expression before 'char' 5 | ????????char str[10000] = { 0 }, str2[10000]; | ^~~~ a.cc:5:9: error: expected ':' before 'char' 5 | ????????char str[10000] = { 0 }, str2[10000]; | ^~~~ | : a.cc:5:9: error: expected primary-expression before 'char' 5 | ????????char str[10000] = { 0 }, str2[10000]; | ^~~~ a.cc:5:9: error: expected ':' before 'char' 5 | ????????char str[10000] = { 0 }, str2[10000]; | ^~~~ | : a.cc:5:9: error: expected primary-expression before 'char' 5 | ????????char str[10000] = { 0 }, str2[10000]; | ^~~~ a.cc:5:32: error: expected primary-expression before ',' token 5 | ????????char str[10000] = { 0 }, str2[10000]; | ^ a.cc:5:34: error: 'str2' was not declared in this scope 5 | ????????char str[10000] = { 0 }, str2[10000]; | ^~~~ a.cc:6:1: error: expected primary-expression before '?' token 6 | ????????int i, m, n, j, joi, ioi; | ^ a.cc:6:2: error: expected primary-expression before '?' token 6 | ????????int i, m, n, j, joi, ioi; | ^ a.cc:6:3: error: expected primary-expression before '?' token 6 | ????????int i, m, n, j, joi, ioi; | ^ a.cc:6:4: error: expected primary-expression before '?' token 6 | ????????int i, m, n, j, joi, ioi; | ^ a.cc:6:5: error: expected primary-expression before '?' token 6 | ????????int i, m, n, j, joi, ioi; | ^ a.cc:6:6: error: expected primary-expression before '?' token 6 | ????????int i, m, n, j, joi, ioi; | ^ a.cc:6:7: error: expected primary-expression before '?' token 6 | ????????int i, m, n, j, joi, ioi; | ^ a.cc:6:8: error: expected primary-expression before '?' token 6 | ????????int i, m, n, j, joi, ioi; | ^ a.cc:6:9: error: expected primary-expression before 'int' 6 | ????????int i, m, n, j, joi, ioi; | ^~~ a.cc:6:9: error: expected ':' before 'int' 6 | ????????int i, m, n, j, joi, ioi; | ^~~ | : a.cc:6:9: error: expected primary-expression before 'int' 6 | ????????int i, m, n, j, joi, ioi; | ^~~ a.cc:6:9: error: expected ':' before 'int' 6 | ????????int i, m, n, j, joi, ioi; | ^~~ | : a.cc:6:9: error: expected primary-expression before 'int' 6 | ????????int i, m, n, j, joi, ioi; | ^~~ a.cc:6:9: error: expected ':' before 'int' 6 | ????????int i, m, n, j, joi, ioi; | ^~~ | : a.cc:6:9: error: expected primary-expression before 'int' 6 | ????????int i, m, n, j, joi, ioi; | ^~~ a.cc:6:9: error: expected ':' before 'int' 6 | ????????int i, m, n, j, joi, ioi; | ^~~ | : a.cc:6:9: error: expected primary-expression before 'int' 6 | ????????int i, m, n, j, joi, ioi; | ^~~ a.cc:6:9: error: expected ':' before 'int' 6 | ????????int i, m, n, j, joi, ioi; | ^~~ | : a.cc:6:9: error: expected primary-expression before 'int' 6 | ????????int i, m, n, j, joi, ioi; | ^~~ a.cc:6:9: error: expected ':' before 'int' 6 | ????????int i, m, n, j, joi, ioi; | ^~~ | : a.cc:6:9: error: expected primary-expression before 'int' 6 | ????????int i, m, n, j, joi, ioi; | ^~~ a.cc:6:9: error: expected ':' before 'int' 6 | ????????int i, m, n, j, joi, ioi; | ^~~ | : a.cc:6:9: error: expected primary-expression before 'int' 6 | ????????int i, m, n, j, joi, ioi; | ^~~ a.cc:6:9: error: expected ':' before 'int' 6 | ????????int i, m, n, j, joi, ioi; | ^~~ | : a.cc:6:9: error: expected primary-expression before 'int' 6 | ????????int i, m, n, j, joi, ioi; | ^~~ a.cc:7:1: error: expected primary-expression before '?' token 7 | ????????while (scanf("%s", str) != EOF){ | ^ a.cc:7:2: error: expected primary-expression before '?' token 7 | ????????while (scanf("%s", str) != EOF){ | ^ a.cc:7:3: error: expected primary-expression before '?' token 7 | ????????while (scanf("%s", str) != EOF){ | ^ a.cc:7:4: error: expected primary-expression before '?' token 7 | ????????while (scanf("%s", str) != EOF){ | ^ a.cc:7:5: error: expected primary-expression before '?' token 7 | ????????while (scanf("%s", str) != EOF){ | ^ a.cc:7:6: error: expected primary-expression before '?' token 7 | ????????while (scanf("%s", str) != EOF){ | ^ a.cc:7:7: error: expected primary-expression before '?' token 7 | ????????while (scanf("%s", str) != EOF){ | ^ a.cc:7:8: error: expected primary-expression before '?' token 7 | ????????while (scanf("%s", str) != EOF){ | ^ a.cc:7:9: error: expected primary-expression before 'while' 7 | ????????while (scanf("%s", str) != EOF){ | ^~~~~ a.cc:7:9: error: expected ':' before 'while' 7 | ????????while (scanf("%s", str) != EOF){ | ^~~~~ | : a.cc:7:9: error: expected primary-expression before 'while' 7 | ????????while (scanf("%s", str) != EOF){ | ^~~~~ a.cc:7:9: error: expected ':' before 'while' 7 | ????????while (scanf("%s", str) != EOF){ | ^~~~~ | : a.cc:7:9: error: expected primary-expression before 'while' 7 | ????????while (scanf("%s", str) != EOF){ | ^~~~~ a.cc:7:9: error: expected ':' before 'while' 7 | ????????while (scanf("%s", str) != EOF){ | ^~~~~ | : a.cc:7:9: error: expected primary-expression before 'while' 7 | ????????while (scanf("%s", str) != EOF){ | ^~~~~ a.cc:7:9: error: expected ':' before 'while' 7 | ????????while (scanf("%s", str) != EOF){ | ^~~~~ | : a.cc:7:9: error: expected primary-expression before 'while' 7 | ????????while (scanf("%s", str) != EOF){ | ^~~~~ a.cc:7:9: error: expected ':' before 'while' 7 | ????????while (scanf("%s", str) != EOF){ | ^~~~~ | : a.cc:7:9: error: expected primary-expression before 'while' 7 | ????????while (scanf("%s", str) != EOF){ | ^~~~~ a.cc:7:9: error: expected ':' before 'while' 7 | ????????while (scanf("%s", str) != EOF){ | ^~~~~ | : a.cc:7:9: error: expected primary-expression before 'while' 7 | ????????while (scanf("%s", str) != EOF){ | ^~~~~ a.cc:7:9: error: expected ':' before 'while' 7 | ????????while (scanf("%s", str) != EOF){ | ^~~~~ | : a.cc:7:9: error: expected primary-expression before 'while' 7 | ????????while (scanf("%s", str) != EOF){ | ^~~~~ a.cc:7:9: error: expected ':' before 'while' 7 | ????????while (scanf("%s", str) != EOF){ | ^~~~~ | : a.cc:7:9: error: expected primary-expression before 'while' 7 | ????????while (scanf("%s", str) != EOF){ | ^~~~~
s096722972
p00445
C++
#include <iostream> #include<string> #include<algorithm> using namespace std; int main(){ int JOI=0,IOI=0; int i; cin>>a; int s=a.size(); if(a.substr(i,3)=="JOI");{ JOI++; } if(b.substr(i,3)=="IOI");{ IOI++; } cout<<JOI<<endl; cout<<IOI<<endl; }
a.cc: In function 'int main()': a.cc:9:10: error: 'a' was not declared in this scope 9 | cin>>a; | ^ a.cc:14:9: error: 'b' was not declared in this scope 14 | if(b.substr(i,3)=="IOI");{ | ^
s202557837
p00445
C++
#include <iostream> #include<string> #include<algorithm> using namespace std; int main(){ int JOI=0,IOI=0; int i; cin>>a; int s=a.size(); if(a.substr(i,3)=="JOI");{ JOI++; } if(b.substr(i,3)=="IOI");{ IOI++; } cout<<JOI<<endl; cout<<IOI<<endl; }
a.cc: In function 'int main()': a.cc:9:10: error: 'a' was not declared in this scope 9 | cin>>a; | ^ a.cc:14:9: error: 'b' was not declared in this scope 14 | if(b.substr(i,3)=="IOI");{ | ^
s119026758
p00445
C++
#include <iostream> #include<string> #include<algorithm> using namespace std; int main(){ string a[100001]; int JOI=0,IOI=0; int i; cin>>a; int s=a.size(); if(a.substr(i,3)=="JOI");{ JOI++; } if(a.substr(i,3)=="IOI");{ IOI++; } cout<<JOI<<endl; cout<<IOI<<endl; }
a.cc: In function 'int main()': a.cc:9:8: error: no match for 'operator>>' (operand types are 'std::istream' {aka 'std::basic_istream<char>'} and 'std::string [100001]' {aka 'std::__cxx11::basic_string<char> [100001]'}) 9 | cin>>a; | ~~~^~~ | | | | | std::string [100001] {aka std::__cxx11::basic_string<char> [100001]} | 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:9:10: error: cannot bind non-const lvalue reference of type 'bool&' to a value of type 'std::string*' {aka 'std::__cxx11::basic_string<char>*'} 9 | cin>>a; | ^ /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:9:10: error: invalid conversion from 'std::string*' {aka 'std::__cxx11::basic_string<char>*'} to 'short int' [-fpermissive] 9 | cin>>a; | ^ | | | std::string* {aka std::__cxx11::basic_string<char>*} a.cc:9:10: error: cannot bind rvalue '(short int)((std::string*)(& a))' 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:9:10: error: invalid conversion from 'std::string*' {aka 'std::__cxx11::basic_string<char>*'} to 'short unsigned int' [-fpermissive] 9 | cin>>a; | ^ | | | std::string* {aka std::__cxx11::basic_string<char>*} a.cc:9:10: error: cannot bind rvalue '(short unsigned int)((std::string*)(& a))' 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:9:10: error: invalid conversion from 'std::string*' {aka 'std::__cxx11::basic_string<char>*'} to 'int' [-fpermissive] 9 | cin>>a; | ^ | | | std::string* {aka std::__cxx11::basic_string<char>*} a.cc:9:10: error: cannot bind rvalue '(int)((std::string*)(& a))' 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:9:10: error: invalid conversion from 'std::string*' {aka 'std::__cxx11::basic_string<char>*'} to 'unsigned int' [-fpermissive] 9 | cin>>a; | ^ | | | std::string* {aka std::__cxx11::basic_string<char>*} a.cc:9:10: error: cannot bind rvalue '(unsigned int)((std::string*)(& a))' 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:9:10: error: invalid conversion from 'std::string*' {aka 'std::__cxx11::basic_string<char>*'} to 'long int' [-fpermissive] 9 | cin>>a; | ^ | | | std::string* {aka std::__cxx11::basic_string<char>*} a.cc:9:10: error: cannot bind rvalue '(long int)((std::string*)(& a))' 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:9:10: error: invalid conversion from 'std::string*' {aka 'std::__cxx11::basic_string<char>*'} to 'long unsigned int' [-fpermissive] 9 | cin>>a; | ^ | | | std::string* {aka std::__cxx11::basic_string<char>*} a.cc:9:10: error: cannot bind rvalue '(long unsigned int)((std::string*)(& a))' 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:9:10: error: invalid conversion from 'std::string*' {aka 'std::__cxx11::basic_string<char>*'} to 'long long int' [-fpermissive] 9 | cin>>a; | ^ | | | std::string* {aka std::__cxx11::basic_string<char>*} a.cc:9:10: error: cannot bind rvalue '(long long int)((std::string*)(& a))' 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:9:10: error: invalid conversion from 'std::string*' {aka 'std::__cxx11::basic_string<char>*'} to 'long long unsigned int' [-fpermissive] 9 | cin>>a; | ^ | | | std::string* {aka std::__cxx11::basic_string<char>*} a.cc:9:10: error: cannot bind rvalue '(long long unsigned int)((std::string*)(& a))' 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:9:10: error: cannot bind non-const lvalue reference of type 'void*&' to an rvalue of type 'void*' 9 | cin>>a; | ^ /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 [100001]' {aka 'std::__cxx11::basic_string<char> [100001]'} 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 [100001]' {aka 'std::__cxx11::basic_string<char> [100001]'} 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::string [100001]' {aka 'std::__cxx11::basic_string<char> [100001]'} 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::string [100001]' {aka 'std::__cxx11::basic_string<char> [100001]'} to 'std::basic_istream<char>::__istream_type& (*)(std::basic_istream<char>::__istr
s604697859
p00445
C++
#include <bits/stdc++.h> using namespace std; #define FOR(i, j, k) for(int i = j; i < k; ++i) #define rep(i, j) FOR(i, 0, j) #define repr(i, j) for(int i = j; i >= 0; --i) #define INF (1 << 30) #define MOD 1e9 + 7 typedef long long ll; typedef unsigned long long ull; typedef pair<int, int> P; int main() { string s; while(cin >> s) { int joi = 0, ioi = 0; rep(i, s.size() - 2) { if(s[i] == 'J' && s[i + 1] == 'O' && s[i + 2] == 'I') ++joi; if(s[i] == 'I' && s[i + 1] == 'O' && s[i + 2] == 'I') ++ioi; } } printf("%d\n%d\n", joi, ioi); return 0; }
a.cc: In function 'int main()': a.cc:24:28: error: 'joi' was not declared in this scope 24 | printf("%d\n%d\n", joi, ioi); | ^~~ a.cc:24:33: error: 'ioi' was not declared in this scope 24 | printf("%d\n%d\n", joi, ioi); | ^~~
s588146589
p00445
C++
#include <iostream> using namespace std; int main(){ int joi=0,ioi=0,i=0; string s; while(1){ cin >> s; if(s == EOF) break; for(i=0;i<s.size()-3;i++){ if(s[i] == 'J'){ if(s[i+1] == 'O' && s[i+2] == 'I'){ joi++; } } if(s[i] == 'I'){ if(s[i+1] == 'O' && s[i+2] == 'I'){ ioi++; } } } cout << joi << endl << ioi << endl; } return 0; }
a.cc: In function 'int main()': a.cc:9:10: error: no match for 'operator==' (operand types are 'std::string' {aka 'std::__cxx11::basic_string<char>'} and 'int') 9 | if(s == EOF) | ~ ^~ | | | std::string {aka std::__cxx11::basic_string<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: In file included from /usr/include/c++/14/cstdio:42, from /usr/include/c++/14/ext/string_conversions.h:45, from /usr/include/c++/14/bits/basic_string.h:4154, 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: a.cc:9:13: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::fpos<_StateT>' 9 | if(s == EOF) | ^~~ In file included from /usr/include/c++/14/string:43: /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:9:13: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::allocator<_CharT>' 9 | if(s == EOF) | ^~~ 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:9:13: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::reverse_iterator<_Iterator>' 9 | if(s == EOF) | ^~~ /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:9:13: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::reverse_iterator<_Iterator>' 9 | if(s == EOF) | ^~~ /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:9:13: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::move_iterator<_IteratorL>' 9 | if(s == EOF) | ^~~ /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:9:13: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::move_iterator<_IteratorL>' 9 | if(s == EOF) | ^~~ 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:9:13: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::pair<_T1, _T2>' 9 | if(s == EOF) | ^~~ In file included from /usr/include/c++/14/bits/basic_string.h:47: /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:9:13: note: 'std::__cxx11::basic_string<char>' is not derived from 'std::basic_string_view<_CharT, _Traits>' 9 | if(s == EOF) | ^~~ /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:9:13: note: 'std::__cxx11::basic_string<char>' is not derived from 'std::basic_string_view<_CharT, _Traits>' 9 | if(s == EOF) | ^~~ /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:9:13: note: mismatched types 'std::basic_string_view<_CharT, _Traits>' and 'int' 9 | if(s == EOF) | ^~~ /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:9:13: note: mismatched types 'const std::__cxx11::basic_string<_CharT, _Traits, _Allocator>' and 'int' 9 | if(s == EOF) | ^~~ /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:9:13: note: mismatched types 'const _CharT*' and 'int' 9 | if(s == EOF) | ^~~ /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:9:13: note: mismatched types 'const _CharT*' and 'std::__cxx11::basic_string<char>' 9 | if(s == EOF) | ^~~ 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:9:13: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::tuple<_UTypes ...>' 9 | if(s == EOF) | ^~~ 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:9:13: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::istreambuf_iterator<_CharT, _Traits>' 9 | if(s == EOF) | ^~~ In file included from /usr/include/x86_64-linux-gnu/c++/14/bits/c++allocator.h:33, from /usr/include/c++/14/bits/allocator.h:46: /usr/include/c++/14/bits/new_allocator.h:215:9: note: candidate: 'template<class _Up> bool std::operator==(const __new_allocator<char>&, const __new_allocator<_Tp>&)' 215 |
s054469325
p00445
C++
#include <iostream> using namespace std; int main(){ int joi=0,ioi=0,i=0; string s; cin >> s; for(i=0;i<s.size()-2;i++){ if(s.substr(i,3) == "JOI"){ joi++; i++ } if(s.subst(i,3) == "IOI"){ ioi++; i++; } } cout << joi << endl << ioi << endl; return 0; }
a.cc: In function 'int main()': a.cc:12:14: error: expected ';' before '}' token 12 | i++ | ^ | ; 13 | } | ~ a.cc:14:12: error: 'std::string' {aka 'class std::__cxx11::basic_string<char>'} has no member named 'subst'; did you mean 'substr'? 14 | if(s.subst(i,3) == "IOI"){ | ^~~~~ | substr
s824336566
p00445
C++
#include <iostream> using namespace std; int main(){ int joi=0,ioi=0,i=0; string s; cin >> s; for(i=0;i<s.size()-2;i++){ if(s.substr(i,3) == "JOI"){ joi++; i++ } if(s.substr(i,3) == "IOI"){ ioi++; i++; } } cout << joi << endl << ioi << endl; return 0; }
a.cc: In function 'int main()': a.cc:12:14: error: expected ';' before '}' token 12 | i++ | ^ | ; 13 | } | ~
s653390653
p00445
C++
#include <list> #include <vector> #include <deque> #include <numeric> using namespace std; int main() { char str[10000]; int joi = 0, ioi = 0; for (int i = 0; i < 5; i++) { if (gets_s(str) == NULL) break; for (int j = 0; j < strlen(str)-2; j++) { if (str[j] == 'J'&&str[j + 1] == 'O' && str[j + 2] == 'I')joi++; if (str[j] == 'I'&&str[j + 1] == 'O' && str[j + 2] == 'I')ioi++; } cout << joi << endl << ioi << endl; joi = 0; ioi = 0; } }
a.cc: In function 'int main()': a.cc:11:21: error: 'gets_s' was not declared in this scope 11 | if (gets_s(str) == NULL) break; | ^~~~~~ a.cc:12:37: error: 'strlen' was not declared in this scope 12 | for (int j = 0; j < strlen(str)-2; j++) { | ^~~~~~ a.cc:5:1: note: 'strlen' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>' 4 | #include <numeric> +++ |+#include <cstring> 5 | a.cc:16:17: error: 'cout' was not declared in this scope 16 | cout << joi << endl << ioi << endl; | ^~~~ a.cc:5:1: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>' 4 | #include <numeric> +++ |+#include <iostream> 5 | a.cc:16:32: error: 'endl' was not declared in this scope 16 | cout << joi << endl << ioi << endl; | ^~~~ a.cc:5:1: note: 'std::endl' is defined in header '<ostream>'; this is probably fixable by adding '#include <ostream>' 4 | #include <numeric> +++ |+#include <ostream> 5 |
s316049255
p00445
C++
#include <iostream> #include <string> #include <list> #include <vector> #include <deque> #include <numeric> using namespace std; int main() { char str[10000]; int joi = 0, ioi = 0; for (int i = 0; i < 5; i++) { if (gets_s(str) == NULL) break; for (int j = 0; j < strlen(str)-2; j++) { if (str[j] == 'J'&&str[j + 1] == 'O' && str[j + 2] == 'I')joi++; if (str[j] == 'I'&&str[j + 1] == 'O' && str[j + 2] == 'I')ioi++; } cout << joi << endl << ioi << endl; joi = 0; ioi = 0; } }
a.cc: In function 'int main()': a.cc:13:21: error: 'gets_s' was not declared in this scope 13 | if (gets_s(str) == NULL) break; | ^~~~~~ a.cc:14:37: error: 'strlen' was not declared in this scope 14 | for (int j = 0; j < strlen(str)-2; j++) { | ^~~~~~ a.cc:7:1: note: 'strlen' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>' 6 | #include <numeric> +++ |+#include <cstring> 7 |
s394948716
p00445
C++
#include <iostream> #include <string> #include <string.h> #include <list> #include <vector> #include <deque> #include <numeric> using namespace std; int main() { char str[10000]; int joi = 0, ioi = 0; for (int i = 0; i < 5; i++) { if (gets(str) == NULL) break; for (int j = 0; j < strlen(str)-2; j++) { if (str[j] == 'J'&&str[j + 1] == 'O' && str[j + 2] == 'I')joi++; if (str[j] == 'I'&&str[j + 1] == 'O' && str[j + 2] == 'I')ioi++; } cout << joi << endl << ioi << endl; joi = 0; ioi = 0; } }
a.cc: In function 'int main()': a.cc:14:21: error: 'gets' was not declared in this scope; did you mean 'getw'? 14 | if (gets(str) == NULL) break; | ^~~~ | getw
s575486538
p00445
C++
#include<string> using namespace std; int main(void) { string set; int joi=0; int ioi=0; for (int a=0;a<3;a++) { cin>>set; lnog long b=set.size(); for (int c=0;c<b-2;c++) { if (set.substr(c,3)=="JOI") joi++; if (set.substr(c,3)=="IOI") ioi++; } cout<<joi<<endl<<ioi<<endl; joi=0; ioi=0; } return 0; }
a.cc: In function 'int main()': a.cc:10:17: error: 'cin' was not declared in this scope 10 | cin>>set; | ^~~ a.cc:2:1: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>' 1 | #include<string> +++ |+#include <iostream> 2 | using namespace std; a.cc:11:17: error: 'lnog' was not declared in this scope; did you mean 'long'? 11 | lnog long b=set.size(); | ^~~~ | long a.cc:12:32: error: 'b' was not declared in this scope 12 | for (int c=0;c<b-2;c++) | ^ a.cc:17:17: error: 'cout' was not declared in this scope 17 | cout<<joi<<endl<<ioi<<endl; | ^~~~ a.cc:17:17: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>' a.cc:17:28: error: 'endl' was not declared in this scope 17 | cout<<joi<<endl<<ioi<<endl; | ^~~~ a.cc:2:1: note: 'std::endl' is defined in header '<ostream>'; this is probably fixable by adding '#include <ostream>' 1 | #include<string> +++ |+#include <ostream> 2 | using namespace std;
s900074465
p00445
C++
using namespace std; int main(void) { string set; int joi=0; int ioi=0; for (int a=0;a<5;a++) { cin>>set; long b=set.size(); for (int c=0;c<b-2;c++) { if (set.substr(c,3)=="JOI") joi++; if (set.substr(c,3)=="IOI") ioi++; } cout<<joi<<endl<<ioi<<endl; joi=0; ioi=0; } return 0; }
a.cc: In function 'int main()': a.cc:4:9: error: 'string' was not declared in this scope 4 | string set; | ^~~~~~ a.cc:1:1: note: 'std::string' is defined in header '<string>'; this is probably fixable by adding '#include <string>' +++ |+#include <string> 1 | using namespace std; a.cc:9:17: error: 'cin' was not declared in this scope 9 | cin>>set; | ^~~ a.cc:1:1: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>' +++ |+#include <iostream> 1 | using namespace std; a.cc:9:22: error: 'set' was not declared in this scope 9 | cin>>set; | ^~~ a.cc:1:1: note: 'std::set' is defined in header '<set>'; this is probably fixable by adding '#include <set>' +++ |+#include <set> 1 | using namespace std; a.cc:16:17: error: 'cout' was not declared in this scope 16 | cout<<joi<<endl<<ioi<<endl; | ^~~~ a.cc:16:17: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>' a.cc:16:28: error: 'endl' was not declared in this scope 16 | cout<<joi<<endl<<ioi<<endl; | ^~~~ a.cc:1:1: note: 'std::endl' is defined in header '<ostream>'; this is probably fixable by adding '#include <ostream>' +++ |+#include <ostream> 1 | using namespace std;
s636895071
p00445
C++
#include <iostream> #include<string.h> using namespace std; int main() { int len,coj=0,coi=0; char mozi[10005]={}; while(cin>>mozi){ len=0; coj=0; coi=0; len=strlen(mozi); for(int i=0;i<len;i++){ if(mozi[i]=="J"){ if(mozi[i+1]=="O"){ if(mozi[i+2]=="I"){ coj++; } } } if(mozi[i]=="I"){ if(mozi[i+1]=="O"){ if(mozi[i+2]=="I"){ coi++; } } } } cout<<coj<<endl<<coi<<endl; } return 0; }
a.cc: In function 'int main()': a.cc:14:35: error: ISO C++ forbids comparison between pointer and integer [-fpermissive] 14 | if(mozi[i]=="J"){ | ~~~~~~~^~~~~ a.cc:15:45: error: ISO C++ forbids comparison between pointer and integer [-fpermissive] 15 | if(mozi[i+1]=="O"){ | ~~~~~~~~~^~~~~ a.cc:16:53: error: ISO C++ forbids comparison between pointer and integer [-fpermissive] 16 | if(mozi[i+2]=="I"){ | ~~~~~~~~~^~~~~ a.cc:22:35: error: ISO C++ forbids comparison between pointer and integer [-fpermissive] 22 | if(mozi[i]=="I"){ | ~~~~~~~^~~~~ a.cc:23:45: error: ISO C++ forbids comparison between pointer and integer [-fpermissive] 23 | if(mozi[i+1]=="O"){ | ~~~~~~~~~^~~~~ a.cc:24:53: error: ISO C++ forbids comparison between pointer and integer [-fpermissive] 24 | if(mozi[i+2]=="I"){ | ~~~~~~~~~^~~~~
s412979535
p00445
C++
TJOILEJOISQMJOIZWZDJOIEEILCXUCDJKIHTMGBBHZYIJOIKGVUYWWJOIMZNRIAKRHUKVOWXUAJOIUGJOIBSUUJOIMJJQJOIOKDUDMPIDXJWJJOIGJOIDJOIRKDJOIEPYFNKTXTAFWIJOIAQWTAAQDSQVNGYETRMTDLFIJCKYOIFJNKADVWFCMFQREMSVEPGNZAPUIFTPCVAARIBPXEWOJOIZZEKLZOPIFHD WLLFIIOITIOIJUOQUIGUKOIOIRFQKXRVLIOIMQBYMJTIOIKZNDIOICRYIOILTIOIZIOIAJUQNJGDPYZURIOINSJPKFCOQBCJFWAOWKXAUEDOIOIEJIOIBSCIOISIOIGXHEKVALKDLNDLFUDVJSYRURTVKWIOIANJWVIWFKJWMRFIOIDRKDCIJMOKBBOSDWNNUYIERMTWHIOIIILYQSEEZDITUZYFHPCQRIOIYIOIWJZCP QAJXAIOILDZRSGSWUEVIRVLIOIIIYOQXDTKKUFSGLKCBZJOIZXBZOIQULJOIISLXOKIVKPFJTPBSRXZIOINJIRJOISKZCNOTYAXZRTHHXPEXDUZBUBNHKTUITJOIVOLYGKEROXOYVREKHPCJOIRNRJVHZDHIPGELHZVZZIOIXMFVYQVXJOIDAOZZRTLIOIZHIOITJUXHCGIUFTJOIAXIOIOJOIZDOWGDE XJOIVPIOIFJOITPJLXCUBKLZJOIKHEIOIQXVCMLCCYPCKHQQCQHLXVWXHTKPYXZVXJOIVQZIOIPPYJBFOIXRGXNVRCFSLINOGIPXOYTJTIJIOIIXTQYVUYZANIYCRLLNIOINJOIKACIOIQTZHNBHREPOPBYJOIPDHRFLOXFPSAHGWRHSCLAETJOIDZIOIIOIOICKIOIAIOIOIZAIHCHFJOIWEYFNFPMALOBAZDZEUYVIHZPIOIWHZTVRMTVQOUOARVXZIOIOIBTGBSIOIGYZCFBJQYAADRIOIOIVBGPHEGUMATIOIIUXIYCZAMJGZLRXIOIOIQJSQTOQIHEPLSWJOIQAAIOIFFEPJOIQKMYXNIOIOIBPHSXUJOIIWLBBPAIOIQORWKJOIWJOIOHZHJOWBZIOIUSKAIOIVVPOUECVTZYABPIOINJOIXUIOIOSSLJCVVZQTNTOIOICIOIYJOIJJOILVKGLOTEGHSUJENGOQOGVWNPWQSTIOIPKNPAZBRYMNFBXTBFIOIZGGRWBXGDGAMNUTIDJOIVSSQIKRPAHIOIPHJOIGOSHAFMAUIOIXYYLMHKOBIOIJDUTIOIOIZJHQJOINJOILENIXVTFRWLOSBFZALWHIIGVPIOIKLNWLZXBTSWHJITDIOIRDRPMYERMYRGREOIOIKOIDTQEYIOIZMMXZFHZHHGTIOIIFOAVSGTIJOIRYBWZTWSJOIEHMIYHIPEYGGJLIOIVJOIRRTOUGAIOIAPVALXIVUNSJOITYUSGFSKJOIVMIOIROHCITOIOIPLAIBEYJOICPYELJOIFXJEIOIOIJMEIUALUISJBZIOICUHNHYBRIOIOIHIEYWAHJOIPSQMNDRIIOIKDIOIOIHYCIOIOICHUZUMLMHUWUBQLOFIOIGUOIOIRLXWALSOVHSTCPIUFWXEXJOIFCOTZOHIOIOIYDFVTBXLVPUYUGIOITVKIOIOIOIIFHOVJOIZEVIOIAIOIOIFPWGNQXIOIOJTFGYXGJOISJUIOIKBQKIEHXKPYREOEJOIXDQIIQQFQABIOITBIHWRIWCXYBEZUXUJOINPNJOIYZCIOIOIENQIAQIBOXRRIOIOIEOFIOIASTGKYDNKTWHMKIOIIENMKSYBZVFMCPBJOIVUIJOIWKWKOPSLJOIJJOIJFFAPEJOIWMMCFHXVEWQRHELYJOIWTAIOIHSFOLIOIVHHMIOIWICMLNMIHCNVISFQSPBRUVYIOIOFZDDTIOICJZOJOILWNKNYKIOISYNJOIXLZSQIVJTBIOIUVXINLTGDRTAHPPDWSKTMMBOEWAJOIDGZDQRQEDIOIIIJOIJIOIMEOJNUQEIOIFHUZEBQKJOIWHIOIRRSEGVNWOIOIVIOIETLGJOIPKJOITFWPJOIH FJOIIGXFUPLIOIOZIOIYKIOIDJIJZULZMGJOIIFLCLZUNMVJOIUIIADZKSAYGTWXZLFMKYSNTJOIBEREJSYQVNVYCQOQZKBGJOIXFQVNDAXLSTFEDIOIKKCNQJOIEJOITJOIOIOIVHMWIOIZIOIHEQUZJRLGJOIOIXQMAOQQVIOIOJOIOILGMAEMBKNPJIOIYXLODBUCJOIGREVXBIOXLIOIVUCPOLMODLIOIOLPQJOIXRXTYJAAFNHGJOIXADWQCRMUOZAKIOIJAIOIQDSRLFBDHNTUTKJOILEMGTYBJJILRIOIRLMFJJBJOIBEYIOIPJVQVXTQYMPXMIOIJRYTIARKUSAIOIXVBDJEBTRGSSJOICDHIYRYKMRURJOIOIKFRMJOIFDUJOIGXSAEIMYTVIOIKGNCJOIJIOISZSTMHURKIOIXZIXEWYMIOIWVZOZVZXXYWYWJOIXRWZYZBAZWHRFLCBOIOIGTWPBAWARJKODFLSFVZWEJVQIOITNLKIOIWRDOGAPXIOIDPABPFSTJISAEFZNRDSQXSTOLWILEZOYSJIOIOIJOIOIIKIOIWRSLCOWHUADKJYMXZVIOIPIOWDTFXSSALKPOLJBNZXHGJOIQZXQETQOECZERBIQIOIIDVSRJOIUJWOBSIJOIIOIRQWXVHWLHJOIUBHPUORJEDTJOIHHMYXSMXNKGSMIOIPCAIOIVDWGNTQXGLJOIPBTMGXEXPIOINWECYEICLIDDYFXEBIOIBPYCRCLWRTYJUXTQGAHEVZITYKHBBERKBZUQYBYBULQQJJOIPEDNUKXFVSLYICTSWYIMLAHJIOIOIZIOITHJOITWYBNOTIFWZKIOIJRJOIOIRXXNFJOIOILBFDLFETIOIXVJOIRCQADNCGPYJOIBRLQAVMIYJOIHMIOILQHRCWDFIOIOIFIMJXRAIOICHGBVAUDKDCJOINPJOIOIIAJOILNTUBJOIZKGXLTJZNRRDKIZJOITRUIVMNIOIBTQCASIOIOIPFIOIMLEFUELXAIIOIUQGNLUXPTTGIOIOITEIOIVIOIIGKJOIRKIOIFPFFVPIOIIGMOKFYHIOIRIOIQILBOGCCJOILZSJIDCTIOIEBBBPDVGUHAAWRGHPRJQNSXPMJFOPJOIZIOIERWGJIOIOILGPUDGIOIXSIOIWATHSLKAEMNRTJSNAPRJOIOIHLNRRBWJOIXOTXJOIPKASWFIOISAKIOIYOCOHQTJOISEKYPNTTEZWBDRPRNPVAAFJOIVPMMSAATCQAJOIJOIOIRRENBXQKYVPTUSVTJOIPTIOIOIARRFDGRJOITAJOIRMOTDCWXJOIPNXVABJOIGFRZYJJOIGJOILLVIOITHRJOIIOIZHNBIOIWPCBGLNFUIOIKTJNORMRDLQRXARRLCQDJOIIOICPIOIAJGNLVIPANXWOKLUAUXJOIVYTMYKRIOINHFBCKGHPZBRZXVUMGLUAJOIHIOIOIPLCYOIOIBSQIOIOISBZIOIMGSMENNXZYQPSJIXIOIPQJIOINUZLDYXRIOIDJOIHVCJLCSNYTYXGXYEDKXKXJMCSGSBFZCIWGCIOIOHXCIMAMTWGJOIMSBZIOJPIOIZUFNEDLJOINMQEIOILJXIOILJMWKOBXEJOIAOBBFLKOJOIWIOIFPHCVBIOIQWLKTFFAOYZCATSJUJOIXCZRKCJOIIHKBJRMQBJOIBCCVWJCCIOIPQGVMDKJOILOGNEAZEDPCZIOIXYGRPFUFBRAIRTDJOIMTULFXSCIOIUEEQQCYMXWIJOIOIFYSXJXDAHKPPXLOOMIOIEIOIXSBIMJOIVCKUIOIXUJVAGORHTIOIAZIOIPOVGWWIUHHKZHMFNPGMHLVJIWORHJOISPJOIOITMVJAKRUJOIAWHACDJOIIOIKHZOVGXATCIOIMIOITMHJTWFZIZIPEIYTDPJOIAIOIIIOIOITJOIOIMDJOISVPISWKVTKJWXQQIOIOAFIOIAGBJOICOIKWAUJOZHJOIZKVVYBCTVMRWLWIFTSUDIOIBDFQJGFJOIXKTWSZIOIOIJEIUHYLVJOIOICMAJOIOIFJOIWJOIJMPIOIHVDFSNEOJOIINJOIFSYJOIFAIPEOIOHZMINEOLOHMIMMENYVKCCRPEMKIOIGYZJUKSDZBJIOIJTVAEJOIWBJOIXRPUHHXMZIJIOITKUIOINCRTISDKBEJTEIOIOBJOIKTTZGGDOVOEWMIOIKPXTJTAXGSTIOIWZJRSCSIWRMMAIOIXLBIJOIKZGOBJOIVINPJOIMRETEAHPIETJOIIOIAQSCSIOIFUJOIOIWHFMLALLDUDEYNRYBEIOIDSBEPNMIGLHKXGWGFQJMJOIBNYAIOINIPJOIZSAEVIOIDVGPQGIOITNTYJYIWIOIOIGRQTIOIZLHKWFLVQLXUIJOIDCSQIVPMBTATZGLJJDFXCLQXXTDXTKAJOIMKIXJOIIOIPFLOWNHRSRGPUHJOIIOISJOIUIJOIBUSIRQYXKIOIGEUDIOINIDURZCJXGASXJOIIOISEIUNCQJVLAUDVJOIJMNJOILSWCIOIOIYZJOIPMRIOIHJIEKIOIOIQZKNERSJOIOIOHZUPIALIOIJOIOIEZCXSWSKJFJEWIOIYVHNUIMWEVLJOICNWJOIBAPCGJOIOIWOVUOLVNYKWIUJWFJQJOIMNJKVBBWDJOIAZPDIAWGVWALYIOIJAWAIOIRRXKUHZJOIXCYVBWCAIOIRENHNSPUWFHWZSTDJGIRJOIXDWBCDEGPIWSEHCVIOIGQFQAFIOILQRQFDOHJOIHDIOIOJIVRRBUMXVBVDIOIKNPYIOIDTLMAQPHXFYPUQSWNDMUULFJOIIOIOJTBNZEIITVNTAJOIOIYBLIICXNTJOINPGJOIQLTDLVSXGIOIMFQCVIOIAJOIGMUQWYZHUKRDJOIRJOIHIOIRDIOIGIOIOISQTCJEJTTVCUSDVUZXZJOIOIHKAPNBMIOIOICRJOLAOIAFARDCIBBCVBZKKSMMFKIOISRSPTNLGDEEYWINJAAJOITGASMJOIOIXJBPFYCRBMHNCYMELGAIOIIAQVGBQOPQJOIXDZSIJOIIOIQGNGBHOFKLJSHPJOINLYOIPIOIJWCDQGOIOITIAFSXUZJOIFJOIWXCVJOIVJOIHUJOIBJOIDWLWIOIOIDJOIOIESFBJOFAIOIVPNQKSANLATHNIOIPUINBYNPYJOIIOIETGFWJOILYDZNHMGUJFDBDGUPPOIOIAQNXNKPHRUSIOIBZMDFGSHZBYJJPAJOITLGJUFJOIBIJIUDZJOIOINAEGJOIOINALSWFEJFAJOIRJOIDNKUTNFQZKWIOIOIWXIOIIXNBHOVGENDTRRITGHYRJOIPIOIBRNPPXKQARVFBSOIOIVBLZRAQQBZOMNACHHRWDXMZPCPBOJIOIOIJHKDXSLVANZZIOIZCLIOIKLZPJOIOIVXNOUZEHOIOIGGHIBFVUYIOIELOFUTBADJOIOIEPSTIOILDUPLWFIOIBOOJOIDIIOICWLWICPIJOINCEUCRBSDWJOIEZIOIOIZWCCGVIOIOIGUUFWJSVTCJOIRZUNAQPHMSNWMIOIFBRQFZTFNIOIJUNGSGRJOIGGCZZJOIABDRJOICLTWJKDRTJOIOIGCDFKJZRYSJOIOIFKIOIWIOIKHJKOKFDTUMXWIDFJOIXOONJEAPNJMOJOIOIOIDFXZHKDBBZVOSMOFCWXIOIFGWSTNEZHABJMVYCIUVQJOIJIOINJDAKWXJJOISCCLJDLTCCXZLQJHQXXCKZIOITSJOIAJOIYAIOILXLSGLYJPQUSFIOIKOIOIVIOIVHQEYSJOIZWVYLSOJVJOIFJOIOIVMCDZFBBPXIZJOIHIOIQAZRIIQIOIVSPISKPFQDTJOINJOIALRXBNIOIPOIOICGFCJRINJOIOIHNFCMBROVWBFAMUNIOIOIQIJOICIOIYEPGALWAIBZZODAPGIOIUUQTYQIOIIFZFJOIOITTAXHSKIFJOIQXCJJOIHKSIOIZANBBHXPNASEJOIAJOICEWVRIZHBZIOIGILMMTBJOIPSVXMCZJOIIOIRGWVHLATBLNWPONAFMNUJXRYCEKNYWJOIOIRJOIZLPNPNIYEVZZJOICVLTJOIOUVZMHSMIOIOIMHYYSVJOIHONWXIJOIMNIVIOIZIOIOIMFTLNLYYYCCJOISIOIYGJOIYEYZJOIDMFJOIDQGSKNNYEIOIUXLVXFRXPIASBKAQDRRRJOIJLPQYTFTDKMHZQRXEJIVJUYKRYCUJUQQUUKRTQJOIVTUHQAUIOIALRBIIDZJOIOINZEKIPICHIOIIUCGZBJRQNUXVJOILIOIUJOIULTQAMJOILKRVFIOIIYZTYAIOIPKTBOIIMZLBMKJPWUYOALDTMNDGWNGQUVXTXHSHVJOIPFEIOIVPKDBZKHHJOIVLGGPSPPKXDORCXEEJCMUVLEPAIHZNVJOILEJIFYCLGSLMEIAMRFDUGBNTLLJIJOIMCIOIOIAYNVPOSVRIOIOKMNYQJOIGJOIAIOIOIQSHRLZLVSYBJOIKMQAWYFESJOIQBABIEQLWXLSYGDKKNKNNPJYGJOISIOIYHWQIOIJBIOINRPHVGZJVAEZUIOIRKIOIOIOJOIIOICTJOIRSBVDLGTKWJMIOIOIPSDYCNIOIOISVGFNYHZJOIFYTDDIOIQOVVQBGHVJJUYVOTILIKQIOICSUVWFVNPWIBQLDLRMGZDZDVBHSJOIOIHZLYJOIXBIQUMIOILZLJJPCZOSHNZGKNZJOIZKDHMIKAYLOIGIOIOIXJOICQJOIIOIPHIXASAIEUYLNFSCSLTWTZYIUOZUZJDIOICJCTRUZPHPYIOIJHMOIOIFGGIQZIVCCJOILDPMHJILMLROJZZGIOIWLWSSSCREYILFJOILVEPNNCUEXNZOIOIEEGVVFKJOIKRTWXRWUJOIQHVMMMIOIUNQIOIOIWYHZKLJJOIOIBDBEQFNKMTEWKIOIUQZKXIOILMIOIIOIOIOXKFYPHTEIOIOIWSZDKLAQPWPYBOTNQAJRMNJOIPLFVGKJOIQZGZRAQOTIUZXCMMKJOIGJOIRPUJOIKIOIEMEWMIOIUZCYOSVCVQHZOJOIOITNQYKJDIOIKPIZZIJHICGWJHNEKOJSJOIBAWEZAJOIQIOIOIYIOIOIUTFIMFUIOIECJOIPWJOIGIJOIGDQZLRPNUIOIVPDIOIJHDCZAEUJOICJLCWGYKMCGJOIZOTXJOIKGMKAXIOIOIMUJJUZWZIXWIOIPIOICZFAIFMFNJOIUEXOZDNNITMORFCMIADTDYMWYXKJOIJKVIOIJOIOIPNSGYHFBMFJRIXWIOIGCBFHRKBHNIBJGCJOIDEIOIOFYIOIOINPLZIOIZMTGJOIPKAQDYZJOIQJOIDPULIOITSZMLVAVIOIUZHAKPBIOISXIOILLDRAOQWJOITGQUGIKLTUHSOSIIIBIOIOIKBSBGEXJOIYBXRBYQJIDJBMMVAGMOZWYRTIOIFJLAMIOIUIYPZCBFZIOIZGIJOIWRPVQQJOIOMZDJOIOIYCIYADGGRHAFNFSJOIIOISZQQSMVPIPWIOIEWYBIOIPJJOIHCOPQQDBYIOIQAZAEBELIOIOIBFXXWIOIXTZFXTJOIOBAZCOCJOIOIJRCECIOECRIJOIQNOEKYXDHCTLJOIYXJDWMOIOIGWGWKGLMFLEFCCRQUGMQVGJDGWDZMSEBXDOSBIZETAHEKWIDSHJIOIOIUPAHNGSPTVYBDKPVGZCJIKPQRUIOIIXRRLXVSYKKFURIOIOKXBLOLYGQIYBIHUKFURYQZOJOIUYBYMIOIOIWJOIXBIOIBZVUXIOIFBZBDPYPUPOWFLQYLRIOIBKJOINNCIOIOIOYHSLWXQKIMKSAJJKCJCIOIDWJIOIOSZPNAJERRGMIOIWSXETETZXZICYAPYSYTQCNGJOIHGRUZIOIIXROCJKPENNHLEIOITCGEPAESBDNRFSVJOICRQJOINQAWERIBQWPPHILOOIOITLTIIOILKRBUWEFOMWLJOIGFGIOIEMDIQWJOIBJOIOIJYCJOIAPATJOIPPNXAAPOHLOEDGCKIOIOIDZOJRBIOIOIOHWPGVUIOIINKNNEMQTIOIOIVVMJOIOIRHMCFGVUQWNIOIOWKBFRHNLIOIQRBQVCDIOILLGPQLFWLFMMEGDUSGIOIOIDHEIMTHIOIOIJIOIYFLIKIOIOHIOIOCAWSHHROCMHINRTQJJOIFJOIWSMXCGIOIPNNCJOILDMLNMIVVIOIIXJOIOIKFAEQNITGOGOLEXJOIHAQUKSVUWIIOIGKFIOIPLIRWTMXMYQIJYYJMWIREVASDMGWKXMTEAFFAKLPOIOIIOIOIWZQDMZQFAMSFTIBTIOIQTJOIITYLFFQODTQPLWOJOIPINYIOMKHHMTAIOIOICITISIJOIMHXRUQIOIRWQVOXSEJOIQMZXNIOILDHWIZMOAPNBBJOINDCYDIODNEFPFGHJOIVWZUSOTNXIKIOIDLFQUSIOISEGXRFAFIOIATOEFJOIWOJTVJOIOIUHGOSHOLOOYQAZRIOIXQRSNXQTYYJOIJFVHSNZXQIOIOIEGIOIONCPQUIOIJBHMRWTZTCMVBJOIFQGZMIOIUKXCONNBPNEWFXJFJOIJOIOIRSTTATRNRFIOIOIDGZJNZXYJIOIOIZFGTVZBXNCEEXVBUNIOIXNPYWJOIAIOIXUIJOIOIPCAJOIOICSDJOIPKLPBIIOIWJOIBXFDJOIEUXYMFYBWFYLAVCGKIOIYFXGBQCDYXOGOIOIKXDZQMEIOIZRQEVJJOIOJOIBNRDFVTUNQLSSHKTXIOIFRVBLFJOIXCEQYNZDIHJOIAJOIIOINGIOITKTLOULDVPAUCRYTGQKFHJNZDLURSWEGJOILYJOIRVSCGQLBPBWJOIZGJOIZHTNILEWGMSHJEPCBYNPVFINIOIWSJOIJKVXHQJOICIOIZQIIOIDDMKQIOILYIEIZWYIUCIXJY
a.cc:1:1: error: 'TJOILEJOISQMJOIZWZDJOIEEILCXUCDJKIHTMGBBHZYIJOIKGVUYWWJOIMZNRIAKRHUKVOWXUAJOIUGJOIBSUUJOIMJJQJOIOKDUDMPIDXJWJJOIGJOIDJOIRKDJOIEPYFNKTXTAFWIJOIAQWTAAQDSQVNGYETRMTDLFIJCKYOIFJNKADVWFCMFQREMSVEPGNZAPUIFTPCVAARIBPXEWOJOIZZEKLZOPIFHD' does not name a type 1 | TJOILEJOISQMJOIZWZDJOIEEILCXUCDJKIHTMGBBHZYIJOIKGVUYWWJOIMZNRIAKRHUKVOWXUAJOIUGJOIBSUUJOIMJJQJOIOKDUDMPIDXJWJJOIGJOIDJOIRKDJOIEPYFNKTXTAFWIJOIAQWTAAQDSQVNGYETRMTDLFIJCKYOIFJNKADVWFCMFQREMSVEPGNZAPUIFTPCVAARIBPXEWOJOIZZEKLZOPIFHD | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
s058417964
p00445
C++
#include<iostream> using namespace std; int main() { for(;;){ char str[1000]; int joi = 0, ioi = 0; if(scanf("%s",str) == EOF){ break; } //JOIツ板サツ津ィ for(int i = 0; i < (unsigned)strlen(str); i++){ if(str[i] == 'J' && str[i+1] == 'O' && str[i+2] == 'I'){ joi++; } } for(int i = 0; i < strlen(str); i++){ if(str[i] == 'I' && str[i+1] == 'O' && str[i+2] == 'I'){ ioi++; } } cout << joi << endl; cout << ioi << endl; } }
a.cc: In function 'int main()': a.cc:16:46: error: 'strlen' was not declared in this scope 16 | for(int i = 0; i < (unsigned)strlen(str); i++){ | ^~~~~~ a.cc:2:1: note: 'strlen' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>' 1 | #include<iostream> +++ |+#include <cstring> 2 | a.cc:21:36: error: 'strlen' was not declared in this scope 21 | for(int i = 0; i < strlen(str); i++){ | ^~~~~~ a.cc:21:36: note: 'strlen' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
s110681219
p00445
C++
#include<iostream> #include<string> using namespace std; int main() { for(;;){ char str[1000]; int joi = 0, ioi = 0; if(scanf("%s",str) == EOF){ break; } //JOIツ板サツ津ィ for(int i = 0; i < (unsigned)strlen(str); i++){ if(str[i] == 'J' && str[i+1] == 'O' && str[i+2] == 'I'){ joi++; } } for(int i = 0; i < strlen(str); i++){ if(str[i] == 'I' && str[i+1] == 'O' && str[i+2] == 'I'){ ioi++; } } cout << joi << endl; cout << ioi << endl; } }
a.cc: In function 'int main()': a.cc:17:46: error: 'strlen' was not declared in this scope 17 | for(int i = 0; i < (unsigned)strlen(str); i++){ | ^~~~~~ a.cc:2:1: note: 'strlen' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>' 1 | #include<iostream> +++ |+#include <cstring> 2 | #include<string> a.cc:22:36: error: 'strlen' was not declared in this scope 22 | for(int i = 0; i < strlen(str); i++){ | ^~~~~~ a.cc:22:36: note: 'strlen' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
s521001275
p00445
C++
#include<stdio.h> int main(){ int i,j,k; char s[10002]; scanf("%s",s)ツ; i=0;j=0; for(k=0;s[k]!='\n';k++){ if(s[k+1]=='O' && s[k+2]=='I'){ if(s[k]=='J')j++; if(s[k]=='I')i++; } } printf("%d\n%d\n",j,i); }
a.cc: In function 'int main()': a.cc:6:22: error: expected ';' before '\U000030c4\U0000ff1b' 6 | scanf("%s",s)ツ; | ^~~~ | ;
s893222337
p00445
C++
include<stdio.h> #include<string.h> int main(void){ int i, j; int joi, ioi; int len; char str[100000], jd[256]; memset(str,'\0',sizeof(str)); memset(jd,'\0',sizeof(jd)); while (scanf("%s", str) != EOF){ len = strlen(str); joi = ioi = 0; for (i = 0;i < len - 2;i++){ if (str[i] == 'J' && str[i+1] == 'O' && str[i+2] =='I'){ joi++; } if (str[i] == 'I' && str[i+1] == 'O' && str[i+2] =='I'){ ioi++; } } printf("%d\n%d\n", joi, ioi); } return 0; }
a.cc:1:1: error: 'include' does not name a type 1 | include<stdio.h> | ^~~~~~~ a.cc: In function 'int main()': a.cc:10:3: error: 'memset' was not declared in this scope 10 | memset(str,'\0',sizeof(str)); | ^~~~~~ a.cc:3:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>' 2 | #include<string.h> +++ |+#include <cstring> 3 | a.cc:13:10: error: 'scanf' was not declared in this scope 13 | while (scanf("%s", str) != EOF){ | ^~~~~ a.cc:13:30: error: 'EOF' was not declared in this scope 13 | while (scanf("%s", str) != EOF){ | ^~~ a.cc:3:1: note: 'EOF' is defined in header '<cstdio>'; this is probably fixable by adding '#include <cstdio>' 2 | #include<string.h> +++ |+#include <cstdio> 3 | a.cc:15:15: error: 'strlen' was not declared in this scope 15 | len = strlen(str); | ^~~~~~ a.cc:15:15: note: 'strlen' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>' a.cc:28:9: error: 'printf' was not declared in this scope 28 | printf("%d\n%d\n", joi, ioi); | ^~~~~~ a.cc:28:9: note: 'printf' is defined in header '<cstdio>'; this is probably fixable by adding '#include <cstdio>'
s592926913
p00445
C++
#include <stdio.h> #include <stdlib.h> int main(void) { int i=0,joi=0,ioi=0; char string[10000]; while((string[i]=getc())!=EOF){ if (i<2){i++; continue; } if((string[i]=='I')&&(string[i-1]=='O')&&(string[i-2]=='J')) joi++; if((string[i]=='I')&&(string[i-1]=='O')&&(string[i-2]=='I')) ioi++; i++; } printf("%d\n%d",joi,ioi); return EXIT_SUCCESS; }
a.cc: In function 'int main()': a.cc:7:30: error: too few arguments to function 'int getc(FILE*)' 7 | while((string[i]=getc())!=EOF){ | ~~~~^~ In file included from a.cc:1: /usr/include/stdio.h:576:12: note: declared here 576 | extern int getc (FILE *__stream) __nonnull ((1)); | ^~~~
s095372435
p00445
C++
#include<iostream> #include<string> using namespace std; int main() { string s; cin>>s; int ans1=0,ans2=0; for(int i=0;i<s.size()-2;i++){ string t=""; t+=s[i]; t+=s[i+1]; t+=s[i+2]; if(t=="JOI") ans1++; if(t=="IOI") ans2++; } cout>>ans1<<" "<<ans2<<endl; }
a.cc: In function 'int main()': a.cc:20:5: error: no match for 'operator>>' (operand types are 'std::ostream' {aka 'std::basic_ostream<char>'} and 'int') 20 | cout>>ans1<<" "<<ans2<<endl; | ~~~~^~~~~~ | | | | | int | std::ostream {aka std::basic_ostream<char>} a.cc:20:5: note: candidate: 'operator>>(int, int)' (built-in) 20 | cout>>ans1<<" "<<ans2<<endl; | ~~~~^~~~~~ a.cc:20:5: note: no known conversion for argument 1 from 'std::ostream' {aka 'std::basic_ostream<char>'} to 'int' In file included from /usr/include/c++/14/string:55, 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/basic_string.tcc:835:5: note: candidate: 'template<class _CharT, class _Traits, class _Alloc> std::basic_istream<_CharT, _Traits>& std::operator>>(basic_istream<_CharT, _Traits>&, __cxx11::basic_string<_CharT, _Traits, _Allocator>&)' 835 | operator>>(basic_istream<_CharT, _Traits>& __in, | ^~~~~~~~ /usr/include/c++/14/bits/basic_string.tcc:835:5: note: template argument deduction/substitution failed: a.cc:20:7: note: 'std::ostream' {aka 'std::basic_ostream<char>'} is not derived from 'std::basic_istream<_CharT, _Traits>' 20 | cout>>ans1<<" "<<ans2<<endl; | ^~~~ 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:131:5: note: candidate: 'template<class _IntegerType> constexpr std::__byte_op_t<_IntegerType> std::operator>>(byte, _IntegerType)' 131 | operator>>(byte __b, _IntegerType __shift) noexcept | ^~~~~~~~ /usr/include/c++/14/cstddef:131:5: note: template argument deduction/substitution failed: a.cc:20:1: note: cannot convert 'std::cout' (type 'std::ostream' {aka 'std::basic_ostream<char>'}) to type 'std::byte' 20 | cout>>ans1<<" "<<ans2<<endl; | ^~~~ In file included from /usr/include/c++/14/istream:1109, from /usr/include/c++/14/iostream:42: /usr/include/c++/14/bits/istream.tcc:978:5: note: candidate: 'template<class _CharT, class _Traits> std::basic_istream<_CharT, _Traits>& std::operator>>(basic_istream<_CharT, _Traits>&, _CharT&)' 978 | operator>>(basic_istream<_CharT, _Traits>& __in, _CharT& __c) | ^~~~~~~~ /usr/include/c++/14/bits/istream.tcc:978:5: note: template argument deduction/substitution failed: a.cc:20:7: note: 'std::ostream' {aka 'std::basic_ostream<char>'} is not derived from 'std::basic_istream<_CharT, _Traits>' 20 | cout>>ans1<<" "<<ans2<<endl; | ^~~~ /usr/include/c++/14/istream:849:5: note: candidate: 'template<class _Traits> std::basic_istream<char, _Traits>& std::operator>>(basic_istream<char, _Traits>&, unsigned char&)' 849 | operator>>(basic_istream<char, _Traits>& __in, unsigned char& __c) | ^~~~~~~~ /usr/include/c++/14/istream:849:5: note: template argument deduction/substitution failed: a.cc:20:7: note: 'std::ostream' {aka 'std::basic_ostream<char>'} is not derived from 'std::basic_istream<char, _Traits>' 20 | cout>>ans1<<" "<<ans2<<endl; | ^~~~ /usr/include/c++/14/istream:854:5: note: candidate: 'template<class _Traits> std::basic_istream<char, _Traits>& std::operator>>(basic_istream<char, _Traits>&, signed char&)' 854 | operator>>(basic_istream<char, _Traits>& __in, signed char& __c) | ^~~~~~~~ /usr/include/c++/14/istream:854:5: note: template argument deduction/substitution failed: a.cc:20:7: note: 'std::ostream' {aka 'std::basic_ostream<char>'} is not derived from 'std::basic_istream<char, _Traits>' 20 | cout>>ans1<<" "<<ans2<<endl; | ^~~~ /usr/include/c++/14/istream:896:5: note: candidate: 'template<class _CharT, class _Traits> std::basic_istream<_CharT, _Traits>& std::operator>>(basic_istream<_CharT, _Traits>&, _CharT*)' 896 | operator>>(basic_istream<_CharT, _Traits>& __in, _CharT* __s) | ^~~~~~~~ /usr/include/c++/14/istream:896:5: note: template argument deduction/substitution failed: a.cc:20:7: note: 'std::ostream' {aka 'std::basic_ostream<char>'} is not derived from 'std::basic_istream<_CharT, _Traits>' 20 | cout>>ans1<<" "<<ans2<<endl; | ^~~~ /usr/include/c++/14/istream:939:5: note: candidate: 'template<class _Traits> std::basic_istream<char, _Traits>& std::operator>>(basic_istream<char, _Traits>&, unsigned char*)' 939 | operator>>(basic_istream<char, _Traits>& __in, unsigned char* __s) | ^~~~~~~~ /usr/include/c++/14/istream:939:5: note: template argument deduction/substitution failed: a.cc:20:7: note: 'std::ostream' {aka 'std::basic_ostream<char>'} is not derived from 'std::basic_istream<char, _Traits>' 20 | cout>>ans1<<" "<<ans2<<endl; | ^~~~ /usr/include/c++/14/istream:945:5: note: candidate: 'template<class _Traits> std::basic_istream<char, _Traits>& std::operator>>(basic_istream<char, _Traits>&, signed char*)' 945 | operator>>(basic_istream<char, _Traits>& __in, signed char* __s) | ^~~~~~~~ /usr/include/c++/14/istream:945:5: note: template argument deduction/substitution failed: a.cc:20:7: note: 'std::ostream' {aka 'std::basic_ostream<char>'} is not derived from 'std::basic_istream<char, _Traits>' 20 | cout>>ans1<<" "<<ans2<<endl; | ^~~~ /usr/include/c++/14/istream:1099:5: note: candidate: 'template<class _Istream, class _Tp> _Istream&& std::operator>>(_Istream&&, _Tp&&)' 1099 | operator>>(_Istream&& __is, _Tp&& __x) | ^~~~~~~~ /usr/include/c++/14/istream:1099:5: note: template argument deduction/substitution failed: /usr/include/c++/14/istream: In substitution of 'template<class _Istream, class _Tp> _Istream&& std::operator>>(_Istream&&, _Tp&&) [with _Istream = std::basic_ostream<char>&; _Tp = int&]': a.cc:20:7: required from here 20 | cout>>ans1<<" "<<ans2<<endl; | ^~~~ /usr/include/c++/14/istream:1099:5: error: no type named 'type' in 'struct std::enable_if<false, void>' 1099 | operator>>(_Istream&& __is, _Tp&& __x) | ^~~~~~~~
s306810411
p00445
C++
#include <iostream> #include <cstdio> #include <string> using namespace std; int main(void) { char c[10000]; int len; int joi=0, ioi=0; scanf("%s",c); len = strlen(c); for(int i = 0 ; i < len ; i++) { if(c[i] == 'J' && c[i+1] == 'O' && c[i+2] == 'I') joi++; if(c[i] == 'I' && c[i+1] == 'O' && c[i+2] == 'I') ioi++; } cout << joi << endl << ioi << endl; return 0; }
a.cc: In function 'int main()': a.cc:12:9: error: 'strlen' was not declared in this scope 12 | len = strlen(c); | ^~~~~~ a.cc:3:1: note: 'strlen' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>' 2 | #include <cstdio> +++ |+#include <cstring> 3 | #include <string>
s932227284
p00445
C++
#include <iostream> #include <cstdio> #include <string> using namespace std; int main(void) { char c[10000]; int len; int joi=0, ioi=0; while(scanf("%s",c) != EOF) { len = strlen(c); for(int i = 0 ; i < len ; i++) { if(c[i] == 'J' && c[i+1] == 'O' && c[i+2] == 'I') joi++; if(c[i] == 'I' && c[i+1] == 'O' && c[i+2] == 'I') ioi++; } cout << joi << endl << ioi << endl; joi = 0, ioi = 0; } return 0; }
a.cc: In function 'int main()': a.cc:12:11: error: 'strlen' was not declared in this scope 12 | len = strlen(c); | ^~~~~~ a.cc:3:1: note: 'strlen' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>' 2 | #include <cstdio> +++ |+#include <cstring> 3 | #include <string>
s781125846
p00445
C++
bitoku@bitoku-Lenovo ~/tempro/AOJ $ cat 0522.cpp #include<iostream> #include<string> using namespace std; int main(){ string str; int joi, ioi; while(cin >> str){ joi = 0; ioi = 0; for(int i=0;i<str.size()-2;i++){ if(str[i] == 'J' && str[i+1] == 'O' && str[i+2] == 'I'){ joi++; }else if(str[i] == 'I' && str[i+1] == 'O' && str[i+2] == 'I'){ ioi++; } } cout << joi << endl << ioi << endl; } }
a.cc:1:7: error: stray '@' in program 1 | bitoku@bitoku-Lenovo ~/tempro/AOJ $ cat 0522.cpp | ^ a.cc:1:1: error: 'bitoku' does not name a type 1 | bitoku@bitoku-Lenovo ~/tempro/AOJ $ cat 0522.cpp | ^~~~~~ 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:2: /usr/include/c++/14/bits/postypes.h:68:11: error: 'ptrdiff_t' does not name a type 68 | typedef ptrdiff_t streamsize; // Signed integral type | ^~~~~~~~~ /usr/include/c++/14/bits/postypes.h:41:1: note: 'ptrdiff_t' is defined in header '<cstddef>'; this is probably fixable by adding '#include <cstddef>' 40 | #include <cwchar> // For mbstate_t +++ |+#include <cstddef> 41 | In file included from /usr/include/c++/14/bits/exception_ptr.h:38, from /usr/include/c++/14/exception:166, from /usr/include/c++/14/ios:41: /usr/include/c++/14/new:131:26: error: declaration of 'operator new' as non-function 131 | _GLIBCXX_NODISCARD void* operator new(std::size_t) _GLIBCXX_THROW (std::bad_alloc) | ^~~~~~~~ /usr/include/c++/14/new:131:44: error: 'size_t' is not a member of 'std'; did you mean 'size_t'? 131 | _GLIBCXX_NODISCARD void* operator new(std::size_t) _GLIBCXX_THROW (std::bad_alloc) | ^~~~~~ In file included from /usr/include/wchar.h:35, from /usr/include/c++/14/cwchar:44, from /usr/include/c++/14/bits/postypes.h:40: /usr/lib/gcc/x86_64-linux-gnu/14/include/stddef.h:214:23: note: 'size_t' declared here 214 | typedef __SIZE_TYPE__ size_t; | ^~~~~~ /usr/include/c++/14/new:132:41: error: attributes after parenthesized initializer ignored [-fpermissive] 132 | __attribute__((__externally_visible__)); | ^ /usr/include/c++/14/new:133:26: error: declaration of 'operator new []' as non-function 133 | _GLIBCXX_NODISCARD void* operator new[](std::size_t) _GLIBCXX_THROW (std::bad_alloc) | ^~~~~~~~ /usr/include/c++/14/new:133:46: error: 'size_t' is not a member of 'std'; did you mean 'size_t'? 133 | _GLIBCXX_NODISCARD void* operator new[](std::size_t) _GLIBCXX_THROW (std::bad_alloc) | ^~~~~~ /usr/lib/gcc/x86_64-linux-gnu/14/include/stddef.h:214:23: note: 'size_t' declared here 214 | typedef __SIZE_TYPE__ size_t; | ^~~~~~ /usr/include/c++/14/new:134:41: error: attributes after parenthesized initializer ignored [-fpermissive] 134 | __attribute__((__externally_visible__)); | ^ /usr/include/c++/14/new:140:29: error: 'std::size_t' has not been declared 140 | void operator delete(void*, std::size_t) _GLIBCXX_USE_NOEXCEPT | ^~~ /usr/include/c++/14/new:142:31: error: 'std::size_t' has not been declared 142 | void operator delete[](void*, std::size_t) _GLIBCXX_USE_NOEXCEPT | ^~~ /usr/include/c++/14/new:145:26: error: declaration of 'operator new' as non-function 145 | _GLIBCXX_NODISCARD void* operator new(std::size_t, const std::nothrow_t&) _GLIBCXX_USE_NOEXCEPT | ^~~~~~~~ /usr/include/c++/14/new:145:44: error: 'size_t' is not a member of 'std'; did you mean 'size_t'? 145 | _GLIBCXX_NODISCARD void* operator new(std::size_t, const std::nothrow_t&) _GLIBCXX_USE_NOEXCEPT | ^~~~~~ /usr/lib/gcc/x86_64-linux-gnu/14/include/stddef.h:214:23: note: 'size_t' declared here 214 | typedef __SIZE_TYPE__ size_t; | ^~~~~~ /usr/include/c++/14/new:145:52: error: expected primary-expression before 'const' 145 | _GLIBCXX_NODISCARD void* operator new(std::size_t, const std::nothrow_t&) _GLIBCXX_USE_NOEXCEPT | ^~~~~ /usr/include/c++/14/new:147:26: error: declaration of 'operator new []' as non-function 147 | _GLIBCXX_NODISCARD void* operator new[](std::size_t, const std::nothrow_t&) _GLIBCXX_USE_NOEXCEPT | ^~~~~~~~ /usr/include/c++/14/new:147:46: error: 'size_t' is not a member of 'std'; did you mean 'size_t'? 147 | _GLIBCXX_NODISCARD void* operator new[](std::size_t, const std::nothrow_t&) _GLIBCXX_USE_NOEXCEPT | ^~~~~~ /usr/lib/gcc/x86_64-linux-gnu/14/include/stddef.h:214:23: note: 'size_t' declared here 214 | typedef __SIZE_TYPE__ size_t; | ^~~~~~ /usr/include/c++/14/new:147:54: error: expected primary-expression before 'const' 147 | _GLIBCXX_NODISCARD void* operator new[](std::size_t, const std::nothrow_t&) _GLIBCXX_USE_NOEXCEPT | ^~~~~ /usr/include/c++/14/new:154:26: error: declaration of 'operator new' as non-function 154 | _GLIBCXX_NODISCARD void* operator new(std::size_t, std::align_val_t) | ^~~~~~~~ /usr/include/c++/14/new:154:44: error: 'size_t' is not a member of 'std'; did you mean 'size_t'? 154 | _GLIBCXX_NODISCARD void* operator new(std::size_t, std::align_val_t) | ^~~~~~ /usr/lib/gcc/x86_64-linux-gnu/14/include/stddef.h:214:23: note: 'size_t' declared here 214 | typedef __SIZE_TYPE__ size_t; | ^~~~~~ /usr/include/c++/14/new:154:68: error: expected primary-expression before ')' token 154 | _GLIBCXX_NODISCARD void* operator new(std::size_t, std::align_val_t) | ^ /usr/include/c++/14/new:155:73: error: attributes after parenthesized initializer ignored [-fpermissive] 155 | __attribute__((__externally_visible__, __alloc_size__ (1), __malloc__)); | ^ /usr/include/c++/14/new:156:26: error: declaration of 'operator new' as non-function 156 | _GLIBCXX_NODISCARD void* operator new(std::size_t, std::align_val_t, const std::nothrow_t&) | ^~~~~~~~ /usr/include/c++/14/new:156:44: error: 'size_t' is not a member of 'std'; did you mean 'size_t'? 156 | _GLIBCXX_NODISCARD void* operator new(std::size_t, std::align_val_t, const std::nothrow_t&) | ^~~~~~ /usr/lib/gcc/x86_64-linux-gnu/14/include/stddef.h:214:23: note: 'size_t' declared here 214 | typedef __SIZE_TYPE__ size_t; | ^~~~~~ /usr/include/c++/14/new:156:68: error: expected primary-expression before ',' token 156 | _GLIBCXX_NODISCARD void* operator new(std::size_t, std::align_val_t, const std::nothrow_t&) | ^ /usr/include/c++/14/new:156:70: error: expected primary-expression before 'const' 156 | _GLIBCXX_NODISCARD void* operator new(std::size_t, std::align_val_t, const std::nothrow_t&) | ^~~~~ /usr/include/c++/14/new:162:26: error: declaration of 'operator new []' as non-function 162 | _GLIBCXX_NODISCARD void* operator new[](std::size_t, std::align_val_t) | ^~~~~~~~ /usr/include/c++/14/new:162:46: error: 'size_t' is not a member of 'std'; did you mean 'size_t'? 162 | _GLIBCXX_NODISCARD void* operator new[](std::size_t, std::align_val_t) | ^~~~~~ /usr/lib/gcc/x86_64-linux-gnu/14/include/stddef.h:214:23: note: 'size_t' declared here 214 | typedef __SIZE_TYPE__ size_t; | ^~~~~~ /usr/include/c++/14/new:162:70: error: expected primary-expression before ')' token 162 | _GLIBCXX_NODISCARD void* operator new[](std::size_t, std::align_val_t) | ^ /usr/include/c++/14/new:163:73: error: attributes after parenthesized initializer ignored [-fpermissive] 163 | __attribute__((__externally_visible__, __alloc_size__ (1), __malloc__)); | ^ /usr/include/c++/14/new:164:26: error: declaration of 'operator new []' as non-function 164 | _GLIBCXX_NODISCARD void* operator new[](std::size_t, std::align_val_t, const std::nothrow_t&) | ^~~~~~~~ /usr/include/c++/14/new:164:46: error: 'size_t' is not a member of 'std'; did you mean 'size_t'? 164 | _GLIBCXX_NODISCARD void* operator new[](std::size_t, std::align_val_t, const std::nothrow_t&) | ^~~~~~ /usr/lib/gcc/x86_64-linux-gnu/14/include/stddef.h:214:23: note: 'size_t' declared here 214 | typedef __SIZE_TYPE__ size_t; | ^~~~~~ /usr/include/c++/14/new:164:70: error: expected primary-expression before ',' token 164 | _GLIBCXX_NODISCARD void* operator new[](std::size_t, std::align_val_t, const std::nothrow_t&) | ^ /usr/include/c++/14/new:164:72: error: expected primary-expression before 'const' 164 | _GLIBCXX_NODISCARD void* operator new[](std::size_t, std::align_val_t, const std::nothrow_t&) | ^~~~~ /usr/include/c++/14/new:171:29: error: 'std::size_t' has not been declared 171 | void operator delete(void*, std::size_t, std::align_val_t) | ^~~ /usr/include/c++/14/new:173:31: error: 'std::size_t' has not been declared 173 | void operator delete[](void*, std::size_t, std::align_val_t) | ^~~ /usr/include/c++/14/new:179:33: error: declaration of 'operator new' as non-function 179 | _GLIBCXX_NODISCARD inline void* operator new(std::size_t, void* __p) _GLIBCXX_USE_NOEXCEPT |
s435855477
p00445
C++
import java.util.*; public class Main { private void doit() { Scanner sc = new Scanner(System.in); while(sc.hasNext()){ int n = sc.nextInt(); String str = sc.next(); HashMap<Character, Integer> map = new HashMap<Character, Integer>(); int len = str.length(); for(int i = 0; i < len; i++){ char temp = str.charAt(i); if(map.containsKey(temp)){ int value = map.get(temp); map.put(temp, value + 1); } else{ map.put(temp, 1); } } boolean isOK = true; for(char key: map.keySet()){ int temp = map.get(key); if(temp % n != 0){ isOK = false; } } if(! isOK){ System.out.println(-1); } else{ StringBuilder sb = new StringBuilder(); for(int ni = 0; ni < n; ni++){ for(char key: map.keySet()){ int times = map.get(key) / n; for(int i = 0; i < times; i++){ sb.append(key); } } } System.out.println(sb.toString()); } } } public static void main(String[] args) { Main obj = new Main(); obj.doit(); } }
a.cc:1:1: error: 'import' does not name a type 1 | import java.util.*; | ^~~~~~ a.cc:1:1: note: C++20 'import' only available with '-fmodules-ts' a.cc:2:1: error: expected unqualified-id before 'public' 2 | public class Main { | ^~~~~~
s964560353
p00445
C++
#include<string> int main(){ static char str[10010]; int i, len, joiCount = 0, ioiCount = 0; scanf("%s", str); len = strlen(str); for(i = 2; i < len; i++){ if(str[i-2] == 'J' && str[i-1] == 'O' && str[i] == 'I'){ joiCount++; } if(str[i-2] == 'I' && str[i-1] == 'O' && str[i] == 'I'){ ioiCount++; } } printf("%d\n%d\n", joiCount, ioiCount); return 0; }
a.cc: In function 'int main()': a.cc:7:15: error: 'strlen' was not declared in this scope 7 | len = strlen(str); | ^~~~~~ a.cc:2:1: note: 'strlen' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>' 1 | #include<string> +++ |+#include <cstring> 2 |
s018115186
p00445
C++
#include <iostream> using namespace std; #include <string> int main(){ string a; int f; cin >> a; f=a.size() int c; c=0; int d[f]; while(c<f){ string b(a,c,1); if(b=="J"){d[c]=1;} if(b=="O"){d[c]=2;} if(b=="I"){d[c]=3;} c=c+1;} c=0; int g; int h; g=0; h=0; while(c<10000){ if(d[c]==1){if(d[c+1]==2){if(d[c+2]==3){g=g+1;}}} if(d[c]==3){if(d[c+1]==2){if(d[c+2]==3){h=h+1;}}} c=c+1;} cout << g <<endl; cout << h <<endl; }
a.cc: In function 'int main()': a.cc:10:11: error: expected ';' before 'int' 10 | f=a.size() | ^ | ; 11 | int c; | ~~~ a.cc:12:1: error: 'c' was not declared in this scope 12 | c=0; | ^
s079270075
p00445
C++
#include <cstdio> #include <cstring> int main() { while(true) { char str[20000]; if(scanf("%s", str) == EOF) break; int len = strlen(str); int joi = 0. ioi = 0; char joistr[] = "JOI", ioistr[] = "IOI"; for(int it = 0; it < len - 2; ++it) { bool joivalid = true, ioivalid = true; for(int i = 0; i < 3; ++i) { if(joistr[i] != str[i + it]) joivalid = false; if(ioistr[i] != str[i + it]) ioivalid = false; } if(joivalid) ++joi; if(ioivalid) ++ioi; } printf("%d\n%d\n", joi, ioi); } return 0; }
a.cc: In function 'int main()': a.cc:11:14: error: expected ',' or ';' before 'ioi' 11 | int joi = 0. ioi = 0; | ^~~ a.cc:22:16: error: 'ioi' was not declared in this scope; did you mean 'joi'? 22 | if(ioivalid) ++ioi; | ^~~ | joi a.cc:24:25: error: 'ioi' was not declared in this scope; did you mean 'joi'? 24 | printf("%d\n%d\n", joi, ioi); | ^~~ | joi
s324645756
p00445
C++
#include<iostream> #include<string> using namespace std; int main() { string word; int count; while(cin>>word) { for(int i=0,count=0;(i=word.find("JOI",i))!=word.npos; i++) count++; cout<<count<<endl; for(int i=0,count=0;(i=word.find("IOI",i))!=word.npos; i++) numb++; cout<<numb<<endl; } return 0; }
a.cc: In function 'int main()': a.cc:18:25: error: 'numb' was not declared in this scope 18 | numb++; | ^~~~ a.cc:19:31: error: 'numb' was not declared in this scope 19 | cout<<numb<<endl; | ^~~~
s072884233
p00445
C++
#include <iostream> #include <cstdio> #include <string> using namespace std; int main(){ int joi,ioi; char JOI[4]="JOI"; char IOI[4]="IOI"; char s[10004]; char than[4]; while(scanf("%s",s) != EOF){ joi=0; ioi=0; for(int i=0;s[i]!='\0';i++){ than[0] = s[i]; than[1] = s[i+1]; than[2] = s[i+2]; if(strcmp(than,JOI) == 0){ joi++; } else if(strcmp(than,IOI) == 0){ ioi++; } } cout << joi << endl; cout << ioi << endl; } }
a.cc: In function 'int main()': a.cc:19:16: error: 'strcmp' was not declared in this scope 19 | if(strcmp(than,JOI) == 0){ | ^~~~~~ a.cc:3:1: note: 'strcmp' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>' 2 | #include <cstdio> +++ |+#include <cstring> 3 | #include <string>
s334278121
p00445
C++
#include<iostream> #include<cstdio> using namespace std; int main(){ int n,JOI=0,IOI=0; char s[10000]; while(scanf("%s",s)!=EOF){ n=strlen(s); for(int i=0;i<n;i++){ if(s[i]=='J'){ if(s[i+1]=='O'){ if(s[i+2]=='I'){ JOI++; } } } else if(s[i]=='I'){ if(s[i+1]=='O'){ if(s[i+2]=='I'){ IOI++; } } } } cout << JOI << endl << IOI << endl; JOI=0; IOI=0; } return (0); }
a.cc: In function 'int main()': a.cc:8:7: error: 'strlen' was not declared in this scope 8 | n=strlen(s); | ^~~~~~ a.cc:3:1: note: 'strlen' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>' 2 | #include<cstdio> +++ |+#include <cstring> 3 | using namespace std;