submission_id
stringlengths
10
10
problem_id
stringlengths
6
6
language
stringclasses
3 values
code
stringlengths
1
522k
compiler_output
stringlengths
43
10.2k
s495443219
p03636
C++
#include<bits/stdc++.h> main(){ string s;cin>>s; std::cout<<s[0]<<s.size()-2<<s[s.size()-1]<<'\n'; }
a.cc:2:1: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type] 2 | main(){ | ^~~~ a.cc: In function 'int main()': a.cc:3:3: error: 'string' was not declared in this scope 3 | string s;cin>>s; | ^~~~~~ a.cc:3:3: note: suggested alternatives: In file included from /usr/include/c++/14/string:41, from /usr/include/c++/14/bitset:52, from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:52, from a.cc:1: /usr/include/c++/14/bits/stringfwd.h:77:33: note: 'std::string' 77 | typedef basic_string<char> string; | ^~~~~~ /usr/include/c++/14/string:76:11: note: 'std::pmr::string' 76 | using string = basic_string<char>; | ^~~~~~ a.cc:3:12: error: 'cin' was not declared in this scope; did you mean 'std::cin'? 3 | string s;cin>>s; | ^~~ | std::cin In file included from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:146: /usr/include/c++/14/iostream:62:18: note: 'std::cin' declared here 62 | extern istream cin; ///< Linked to standard input | ^~~ a.cc:3:17: error: 's' was not declared in this scope 3 | string s;cin>>s; | ^
s856754784
p03636
C++
#include<bits/stdc++.h> main(){ string s;cin>>s; cout<<s[0]<<s.size()-2<<s[s.size()-1]<<endl; }
a.cc:2:1: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type] 2 | main(){ | ^~~~ a.cc: In function 'int main()': a.cc:3:3: error: 'string' was not declared in this scope 3 | string s;cin>>s; | ^~~~~~ a.cc:3:3: note: suggested alternatives: In file included from /usr/include/c++/14/string:41, from /usr/include/c++/14/bitset:52, from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:52, from a.cc:1: /usr/include/c++/14/bits/stringfwd.h:77:33: note: 'std::string' 77 | typedef basic_string<char> string; | ^~~~~~ /usr/include/c++/14/string:76:11: note: 'std::pmr::string' 76 | using string = basic_string<char>; | ^~~~~~ a.cc:3:12: error: 'cin' was not declared in this scope; did you mean 'std::cin'? 3 | string s;cin>>s; | ^~~ | std::cin In file included from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:146: /usr/include/c++/14/iostream:62:18: note: 'std::cin' declared here 62 | extern istream cin; ///< Linked to standard input | ^~~ a.cc:3:17: error: 's' was not declared in this scope 3 | string s;cin>>s; | ^ a.cc:4:3: error: 'cout' was not declared in this scope; did you mean 'std::cout'? 4 | cout<<s[0]<<s.size()-2<<s[s.size()-1]<<endl; | ^~~~ | std::cout /usr/include/c++/14/iostream:63:18: note: 'std::cout' declared here 63 | extern ostream cout; ///< Linked to standard output | ^~~~ a.cc:4:42: error: 'endl' was not declared in this scope; did you mean 'std::endl'? 4 | cout<<s[0]<<s.size()-2<<s[s.size()-1]<<endl; | ^~~~ | std::endl In file included from /usr/include/c++/14/istream:41, from /usr/include/c++/14/sstream:40, from /usr/include/c++/14/complex:45, from /usr/include/c++/14/ccomplex:39, from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:127: /usr/include/c++/14/ostream:744:5: note: 'std::endl' declared here 744 | endl(basic_ostream<_CharT, _Traits>& __os) | ^~~~
s511430823
p03636
C
#include<iostream> #include<string> using namespace std; int main() { char s[101]; scanf("%s",s); int i; int l=strlen(s); char a=s[0]; char b=s[l-1]; int c=l-2; printf("%c%d%c\n",a,c,b); }
main.c:1:9: fatal error: iostream: No such file or directory 1 | #include<iostream> | ^~~~~~~~~~ compilation terminated.
s712387495
p03636
C++
#include<iostream> #include<string> using namespace std; int main() { char s[101]; scanf("%s",s); int i; int l=strlen(s); char a=s[0]; char b=s[l-1]; int c=l-2; printf("%c%d%c\n",a,c,b); }
a.cc: In function 'int main()': a.cc:9:15: error: 'strlen' was not declared in this scope 9 | int l=strlen(s); | ^~~~~~ 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>
s815937485
p03636
C++
#include<iostream> using namespace std; main() { string s;cin>>s; cout<<s[0]<<s.length()-2<<s[n-1]; }
a.cc:3:1: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type] 3 | main() | ^~~~ a.cc: In function 'int main()': a.cc:6:31: error: 'n' was not declared in this scope 6 | cout<<s[0]<<s.length()-2<<s[n-1]; | ^
s637810731
p03636
C++
#include<iostream> #include<string> using namespace std; int main(){ string yan; cin>>yan; cout<< yan,begin<<size(yan)-2<<yan,end<<endl; }
a.cc: In function 'int main()': a.cc:8:17: error: invalid operands of types '<unresolved overloaded function type>' and 'std::__cxx11::basic_string<char>::size_type' {aka 'long unsigned int'} to binary 'operator<<' 8 | cout<< yan,begin<<size(yan)-2<<yan,end<<endl; | ~~~~~^~~~~~~~~~~~~ a.cc:8:39: error: invalid operands of types '<unresolved overloaded function type>' and '<unresolved overloaded function type>' to binary 'operator<<' 8 | cout<< yan,begin<<size(yan)-2<<yan,end<<endl; | ~~~^~~~~~
s582573068
p03636
C++
internationalization
a.cc:1:1: error: 'internationalization' does not name a type 1 | internationalization | ^~~~~~~~~~~~~~~~~~~~
s727038838
p03636
C++
#include <stdio.h> #include <string.h> int main2() { char c[101]; char num,chl; scanf("%s", &c); num = strlen(c); chl = c[(num - 1)]; printf("%c%d%c",c[0],(num-2),chl); return 0; }
/usr/bin/ld: /usr/lib/gcc/x86_64-linux-gnu/14/../../../x86_64-linux-gnu/Scrt1.o: in function `_start': (.text+0x17): undefined reference to `main' collect2: error: ld returned 1 exit status
s614606312
p03636
C++
#include<iostream> #include<math.h> #include<cstdio> #include<stdio.h> #include<cstring> #include<string> #include<string.h> #include<cmath> #include<map> #include<vector> #include<set> #include<algorithm> using namespace std; int main() { char s[200]; gets(s); cout<<s[0]<<strlen(s)-2<<s[strlen(s)-1]; return 0; }
a.cc: In function 'int main()': a.cc:17:9: error: 'gets' was not declared in this scope; did you mean 'getw'? 17 | gets(s); | ^~~~ | getw
s704718697
p03636
C++
#include <stdio.h> #include <stdlib.h> #include <strings.h> int main() { char c[101]; char num,chl; scanf("%s", &c); num = strlen(c); chl = c[(num - 1)]; printf("%c%d%c",c[0],(num-2),chl); return 0; }
a.cc: In function 'int main()': a.cc:12:15: error: 'strlen' was not declared in this scope 12 | num = strlen(c); | ^~~~~~ a.cc:4:1: note: 'strlen' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>' 3 | #include <strings.h> +++ |+#include <cstring> 4 |
s791117064
p03636
C++
#include <algorithm> #include <cmath> #include <iomanip> #include <iostream> #include <string> #include <utility> #include <vector> using namespace std; int main() { string a; cin >> a; cout << a[a.begin()] << sizeof(a) - 2 << a[a.end()] << endl; return 0; }
a.cc: In function 'int main()': a.cc:14:12: error: no match for 'operator[]' (operand types are 'std::string' {aka 'std::__cxx11::basic_string<char>'} and 'std::__cxx11::basic_string<char>::iterator') 14 | cout << a[a.begin()] << sizeof(a) - 2 << a[a.end()] << endl; | ^ In file included 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/iomanip:42, from a.cc:3: /usr/include/c++/14/bits/basic_string.h:1247:7: note: candidate: 'std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::const_reference std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::operator[](size_type) const [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>; const_reference = const char&; size_type = long unsigned int]' 1247 | operator[] (size_type __pos) const _GLIBCXX_NOEXCEPT | ^~~~~~~~ /usr/include/c++/14/bits/basic_string.h:1247:29: note: no known conversion for argument 1 from 'std::__cxx11::basic_string<char>::iterator' to 'std::__cxx11::basic_string<char>::size_type' {aka 'long unsigned int'} 1247 | operator[] (size_type __pos) const _GLIBCXX_NOEXCEPT | ~~~~~~~~~~^~~~~ /usr/include/c++/14/bits/basic_string.h:1265:7: note: candidate: 'std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::reference std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::operator[](size_type) [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>; reference = char&; size_type = long unsigned int]' 1265 | operator[](size_type __pos) | ^~~~~~~~ /usr/include/c++/14/bits/basic_string.h:1265:28: note: no known conversion for argument 1 from 'std::__cxx11::basic_string<char>::iterator' to 'std::__cxx11::basic_string<char>::size_type' {aka 'long unsigned int'} 1265 | operator[](size_type __pos) | ~~~~~~~~~~^~~~~ a.cc:14:45: error: no match for 'operator[]' (operand types are 'std::string' {aka 'std::__cxx11::basic_string<char>'} and 'std::__cxx11::basic_string<char>::iterator') 14 | cout << a[a.begin()] << sizeof(a) - 2 << a[a.end()] << endl; | ^ /usr/include/c++/14/bits/basic_string.h:1247:7: note: candidate: 'std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::const_reference std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::operator[](size_type) const [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>; const_reference = const char&; size_type = long unsigned int]' 1247 | operator[] (size_type __pos) const _GLIBCXX_NOEXCEPT | ^~~~~~~~ /usr/include/c++/14/bits/basic_string.h:1247:29: note: no known conversion for argument 1 from 'std::__cxx11::basic_string<char>::iterator' to 'std::__cxx11::basic_string<char>::size_type' {aka 'long unsigned int'} 1247 | operator[] (size_type __pos) const _GLIBCXX_NOEXCEPT | ~~~~~~~~~~^~~~~ /usr/include/c++/14/bits/basic_string.h:1265:7: note: candidate: 'std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::reference std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::operator[](size_type) [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>; reference = char&; size_type = long unsigned int]' 1265 | operator[](size_type __pos) | ^~~~~~~~ /usr/include/c++/14/bits/basic_string.h:1265:28: note: no known conversion for argument 1 from 'std::__cxx11::basic_string<char>::iterator' to 'std::__cxx11::basic_string<char>::size_type' {aka 'long unsigned int'} 1265 | operator[](size_type __pos) | ~~~~~~~~~~^~~~~
s230775845
p03636
C
#include<cstring> #include<cstdio> int main() { while(gets(a)) { int n=strlen(a); printf("%c",a[0]); printf("%d",n-2); printf("%c\n",a[n-1]); } }
main.c:2:9: fatal error: cstring: No such file or directory 2 | #include<cstring> | ^~~~~~~~~ compilation terminated.
s320060069
p03636
C++
#include<bits\stdc++.h> using namespace std; int main() { char s[200]; gets(s); cout<<s[0]<<strlen(s)-2<<s[strlen(s)-1]; return 0; }
a.cc:1:9: fatal error: bits\stdc++.h: No such file or directory 1 | #include<bits\stdc++.h> | ^~~~~~~~~~~~~~~ compilation terminated.
s515708618
p03636
C++
#include<cstring> #include<cstdio> using namespace std; int main() { string a; cin>>a; int m=s.size(); cout<<s[0]<<n-2<<s[n-1]<<endl; }
a.cc: In function 'int main()': a.cc:9:6: error: 'string' was not declared in this scope 9 | string a; | ^~~~~~ a.cc:4:1: note: 'std::string' is defined in header '<string>'; this is probably fixable by adding '#include <string>' 3 | #include<cstdio> +++ |+#include <string> 4 | a.cc:10:6: error: 'cin' was not declared in this scope 10 | cin>>a; | ^~~ a.cc:4:1: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>' 3 | #include<cstdio> +++ |+#include <iostream> 4 | a.cc:10:11: error: 'a' was not declared in this scope 10 | cin>>a; | ^ a.cc:11:12: error: 's' was not declared in this scope 11 | int m=s.size(); | ^ a.cc:12:6: error: 'cout' was not declared in this scope 12 | cout<<s[0]<<n-2<<s[n-1]<<endl; | ^~~~ a.cc:12:6: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>' a.cc:12:18: error: 'n' was not declared in this scope 12 | cout<<s[0]<<n-2<<s[n-1]<<endl; | ^ a.cc:12:31: error: 'endl' was not declared in this scope 12 | cout<<s[0]<<n-2<<s[n-1]<<endl; | ^~~~ a.cc:4:1: note: 'std::endl' is defined in header '<ostream>'; this is probably fixable by adding '#include <ostream>' 3 | #include<cstdio> +++ |+#include <ostream> 4 |
s363963176
p03636
C++
#include<iostream> #include<math.h> #include<cstdio> #include<stdio.h> #include<cstring> #include<string> #include<string.h> #include<cmath> #include<map> #include<vector> #include<set> #include<algorithm> using namespace std; int main() { char s[200]; gets(s); cout<<s[0]<<strlen(s)-2<<s[strlen(s)-1]; return 0; }
a.cc: In function 'int main()': a.cc:17:9: error: 'gets' was not declared in this scope; did you mean 'getw'? 17 | gets(s); | ^~~~ | getw
s439108678
p03636
C
#include<string.h> #include<stdio.h> const int N=100; char a[N]; int main() { while(gets(a)) { int n=strlen(a); printf("%c",a[0]); printf("%d",n-2); printf("%c\n",a[n-1]); } }
main.c:5:6: error: variably modified 'a' at file scope 5 | char a[N]; | ^ main.c: In function 'main': main.c:9:13: error: implicit declaration of function 'gets'; did you mean 'fgets'? [-Wimplicit-function-declaration] 9 | while(gets(a)) | ^~~~ | fgets
s459420075
p03636
C++
#include<iostream> #include<math.h> #include<cstdio> #include<stdio.h> #include<cstring> #include<string> #include<string.h> #include<cmath> #include<map> #include<vector> #include<set> #include<algorithm> #include<bits\stdc++.h> using namespace std; int main() { char s[200]; gets(s); cout<<s[0]<<strlen(s)-2<<s[strlen(s)-1]; return 0; }
a.cc:13:9: fatal error: bits\stdc++.h: No such file or directory 13 | #include<bits\stdc++.h> | ^~~~~~~~~~~~~~~ compilation terminated.
s614725213
p03636
C
#include<string.h> #include<stdio.h> const int N=100; char a[N]; int main() { gets(a); int n=strlen(a); printf("%c",a[0]); printf("%d",n-2); printf("%c\n",a[n-1]); }
main.c:5:6: error: variably modified 'a' at file scope 5 | char a[N]; | ^ main.c: In function 'main': main.c:9:7: error: implicit declaration of function 'gets'; did you mean 'fgets'? [-Wimplicit-function-declaration] 9 | gets(a); | ^~~~ | fgets
s898546916
p03636
C++
#include<iostream> #include<cstring> #include<cstdio> const int N=100; char a[N]; using namespace std; int main() { gets(a); int n=strlen(a),sum=0; for(int i=1;i<strlen(a)-1;i++) { sum++; } printf("%c",a[0]); printf("%d",sum); printf("%c",a[n-1]); }
a.cc: In function 'int main()': a.cc:9:7: error: 'gets' was not declared in this scope; did you mean 'getw'? 9 | gets(a); | ^~~~ | getw
s053220566
p03636
C++
#include<iostream> #include<cstring> #include<cstdio> const int N=100; char a[N]; using namespace std; int main() { gets(a); int n=strlen(a),sum=0; for(int i=1;i<strlen(a)-1;i++) { sum++; } printf("%c",a[0]); printf("%d",sum); printf("%c",a[n-1]); }
a.cc: In function 'int main()': a.cc:9:7: error: 'gets' was not declared in this scope; did you mean 'getw'? 9 | gets(a); | ^~~~ | getw
s493512571
p03636
C++
#include<iostream> #include<math.h> #include<cstdio> #include<cstring> #include<string> #include<string.h> #include<cmath> #include<map> #include<vector> #include<set> #include<algorithm> using namespace std; int main() { char s[200]; gets(s); cout<<s[0]<<strlen(s)-2<<s[strlen(a)-1]; }
a.cc: In function 'int main()': a.cc:16:9: error: 'gets' was not declared in this scope; did you mean 'getw'? 16 | gets(s); | ^~~~ | getw a.cc:17:43: error: 'a' was not declared in this scope 17 | cout<<s[0]<<strlen(s)-2<<s[strlen(a)-1]; | ^
s188782799
p03636
C++
#include<iostream> #include<cstring> #include<cstdio> #include<cmath> #include<iomanip> using namespace std; int main() { char a[101]; gets(a); int len=strlen(a); cout<<a[0]<<(len-2)<<a[len-1]; return 0; }
a.cc: In function 'int main()': a.cc:10:5: error: 'gets' was not declared in this scope; did you mean 'getw'? 10 | gets(a); | ^~~~ | getw
s643891054
p03636
C++
#include<iostream> #include<cstring> #include<cstdio> #include<cmath> #include<iomanip> using namespace std; int main() { char a[101]; gets(a); int len=strlen(a); cout<<a[0]<<(len-2)<<a[len-1]; return 0; }
a.cc: In function 'int main()': a.cc:10:5: error: 'gets' was not declared in this scope; did you mean 'getw'? 10 | gets(a); | ^~~~ | getw
s713232679
p03636
C++
#include <iostream> using namespace std; int main() { string s; char x[100]; cin >> s; int l = s.length() - 2; for (int i = 0; i < s.length(); i++) { x[i] = s[i]; } int last = i - 1; cout << c[0] << l << c[last]; return 0; }
a.cc: In function 'int main()': a.cc:13:14: error: 'i' was not declared in this scope 13 | int last = i - 1; | ^ a.cc:15:11: error: 'c' was not declared in this scope 15 | cout << c[0] << l << c[last]; | ^
s827851901
p03636
C++
#include <iostream> #include <vector> #include <utility> #include <string> #include <algorithm> #include <numeric> #include <cmath> #define REP(i,j,n) for(int i=j;i<n;i++) #define SORT(x) sort(x.begin(),x.end()) using namespace std; int main() { char s[101]; int x; cin >> s; x = strlen(s); cout << s[0] << strlen(s) - 2 << s[x - 1] << endl; return 0; }
a.cc: In function 'int main()': a.cc:19:13: error: 'strlen' was not declared in this scope 19 | x = strlen(s); | ^~~~~~ a.cc:8:1: note: 'strlen' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>' 7 | #include <cmath> +++ |+#include <cstring> 8 | #define REP(i,j,n) for(int i=j;i<n;i++)
s157369706
p03636
C++
#include <iostream> #include <cstdio> #include <cstring> using namespace std; int main() { char ch[110]; gets(ch); int len=strlen(ch); printf("%c%d%c\n",ch[0],len-2,ch[len-1]); return 0; }
a.cc: In function 'int main()': a.cc:10:5: error: 'gets' was not declared in this scope; did you mean 'getw'? 10 | gets(ch); | ^~~~ | getw
s679432203
p03636
C++
#include <bits/stdc++.h> using namespace std; int main(){ string s[]; cin >> s[]; cout << s.begin() << s.size()-2 << s.end() << endl; return 0; }
a.cc: In function 'int main()': a.cc:5:10: error: array size missing in 's' 5 | string s[]; | ^ a.cc:7:12: error: expected primary-expression before ']' token 7 | cin >> s[]; | ^ a.cc:9:13: error: request for member 'begin' in 's', which is of non-class type 'std::string [1]' {aka 'std::__cxx11::basic_string<char> [1]'} 9 | cout << s.begin() << s.size()-2 << s.end() << endl; | ^~~~~ a.cc:9:26: error: request for member 'size' in 's', which is of non-class type 'std::string [1]' {aka 'std::__cxx11::basic_string<char> [1]'} 9 | cout << s.begin() << s.size()-2 << s.end() << endl; | ^~~~ a.cc:9:40: error: request for member 'end' in 's', which is of non-class type 'std::string [1]' {aka 'std::__cxx11::basic_string<char> [1]'} 9 | cout << s.begin() << s.size()-2 << s.end() << endl; | ^~~
s812396976
p03636
C++
#include <cstdio> #include <cstdio> #include <cstdio> #include <cstring> #include <cmath> #include <algorithm> using namespace std; int main () { char s[109]; gets(s); int len = strlen(s); printf("%c%d%c",s[0],len-2,s[len-1]); }
a.cc: In function 'int main()': a.cc:11:9: error: 'gets' was not declared in this scope; did you mean 'getw'? 11 | gets(s); | ^~~~ | getw
s787374594
p03636
C++
#include <cstdio> #include <cstdio> #include <cstdio> #include <cstring> #include <cmath> #include <algorithm> using namespace std; int main () { char s[109]; gets(s); int len = strlen(s); printf("%c%d%c",s[0],len-2,s[len-1]); }
a.cc: In function 'int main()': a.cc:11:9: error: 'gets' was not declared in this scope; did you mean 'getw'? 11 | gets(s); | ^~~~ | getw
s713184057
p03636
C
//#include <bits/stdc++.h> #include <stdio.h> #include <string.h> using namespace std; int main() { char a[101]; gets(a); int n = strlen(a); printf("%c%d%c", *a, n - 2, *(a + n - 1)); return 0; }
main.c:4:1: error: unknown type name 'using' 4 | using namespace std; | ^~~~~ main.c:4:17: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'std' 4 | using namespace std; | ^~~ main.c: In function 'main': main.c:9:5: error: implicit declaration of function 'gets'; did you mean 'fgets'? [-Wimplicit-function-declaration] 9 | gets(a); | ^~~~ | fgets
s387168927
p03636
C
//#include <bits/stdc++.h> #include <cstdio> #include <cstring> using namespace std; int main() { char a[101]; gets(a); int n = strlen(a); printf("%c%d%c", *a, n - 2, *(a + n - 1)); return 0; }
main.c:2:10: fatal error: cstdio: No such file or directory 2 | #include <cstdio> | ^~~~~~~~ compilation terminated.
s861245172
p03636
C++
import java.io.OutputStream; import java.io.IOException; import java.io.InputStream; import java.io.PrintWriter; import java.util.ArrayList; import java.util.Comparator; import java.util.Iterator; import java.util.Random; import java.util.StringTokenizer; import java.util.TreeSet; import java.io.BufferedReader; import java.io.InputStreamReader; /** * Built using CHelper plug-in Actual solution is at the top */ public class Main { public final static double MAX_T = 1000000; public final static double MIN_T = 0; public static int s = 0; public static void main(String[] args) { InputStream inputStream = System.in; OutputStream outputStream = System.out; InputReader in = new InputReader(inputStream); PrintWriter out = new PrintWriter(outputStream); TaskC solver = new TaskC(); solver.solve(1, in, out); out.close(); } static class TaskC { public void solve(int testNumber, InputReader in, PrintWriter out) { char[] s = in.next().toCharArray(); out.println((char) s[0] + "" + (s.length - 2) + "" + (char) s[s.length - 1]); } } static class InputReader { public BufferedReader reader; public StringTokenizer tokenizer; public InputReader(InputStream stream) { reader = new BufferedReader(new InputStreamReader(stream), 32768); tokenizer = null; } public String next() { while (tokenizer == null || !tokenizer.hasMoreTokens()) { try { tokenizer = new StringTokenizer(reader.readLine()); } catch (IOException e) { throw new RuntimeException(e); } } return tokenizer.nextToken(); } public int nextInt() { return Integer.parseInt(next()); } public long nextLong() { return Long.parseLong(next()); } public double nextFloat() { return Double.parseDouble(next()); } public double nextDouble() { return Double.parseDouble(next()); } } }
a.cc:1:1: error: 'import' does not name a type 1 | import java.io.OutputStream; | ^~~~~~ a.cc:1:1: note: C++20 'import' only available with '-fmodules-ts' a.cc:2:1: error: 'import' does not name a type 2 | import java.io.IOException; | ^~~~~~ a.cc:2:1: note: C++20 'import' only available with '-fmodules-ts' a.cc:3:1: error: 'import' does not name a type 3 | import java.io.InputStream; | ^~~~~~ a.cc:3:1: note: C++20 'import' only available with '-fmodules-ts' a.cc:4:1: error: 'import' does not name a type 4 | import java.io.PrintWriter; | ^~~~~~ a.cc:4:1: note: C++20 'import' only available with '-fmodules-ts' a.cc:5:1: error: 'import' does not name a type 5 | import java.util.ArrayList; | ^~~~~~ a.cc:5:1: note: C++20 'import' only available with '-fmodules-ts' a.cc:6:1: error: 'import' does not name a type 6 | import java.util.Comparator; | ^~~~~~ a.cc:6:1: note: C++20 'import' only available with '-fmodules-ts' a.cc:7:1: error: 'import' does not name a type 7 | import java.util.Iterator; | ^~~~~~ a.cc:7:1: note: C++20 'import' only available with '-fmodules-ts' a.cc:8:1: error: 'import' does not name a type 8 | import java.util.Random; | ^~~~~~ a.cc:8:1: note: C++20 'import' only available with '-fmodules-ts' a.cc:9:1: error: 'import' does not name a type 9 | import java.util.StringTokenizer; | ^~~~~~ a.cc:9:1: note: C++20 'import' only available with '-fmodules-ts' a.cc:10:1: error: 'import' does not name a type 10 | import java.util.TreeSet; | ^~~~~~ a.cc:10:1: note: C++20 'import' only available with '-fmodules-ts' a.cc:11:1: error: 'import' does not name a type 11 | import java.io.BufferedReader; | ^~~~~~ a.cc:11:1: note: C++20 'import' only available with '-fmodules-ts' a.cc:12:1: error: 'import' does not name a type 12 | import java.io.InputStreamReader; | ^~~~~~ a.cc:12:1: note: C++20 'import' only available with '-fmodules-ts' a.cc:17:1: error: expected unqualified-id before 'public' 17 | public class Main { | ^~~~~~
s206314539
p03636
C
#include <bits/stdc++.h> using namespace std; int main() { char a[101]; gets(a); int n = strlen(a); printf("%c%d%c", *a, n - 2, *(a + n - 1)); return 0; }
main.c:1:10: fatal error: bits/stdc++.h: No such file or directory 1 | #include <bits/stdc++.h> | ^~~~~~~~~~~~~~~ compilation terminated.
s088065445
p03636
C++
#include<iostream> #include<math.h> #include<cstdio> #include<cstring> #include<string> #include<string.h> #include<cmath> #include<map> #include<vector> #include<set> #include<algorithm> using namespace std; int main() { char a[2000]; gets(a); cout<<a[0]<<strlen(a)-2<<a[strlen(a)-1]; }
a.cc: In function 'int main()': a.cc:16:9: error: 'gets' was not declared in this scope; did you mean 'getw'? 16 | gets(a); | ^~~~ | getw
s641314685
p03636
C++
#include <bits/stdc++.h> using namespace std; int main() { char a[101]; gets(a); int n = strlen(a); printf("%c%d%c", *a, n - 2, *(a + n - 1)); return 0; }
a.cc: In function 'int main()': a.cc:7:5: error: 'gets' was not declared in this scope; did you mean 'getw'? 7 | gets(a); | ^~~~ | getw
s654231350
p03636
C++
#include <iostream> #include <cstdio> #include <cstring> using namespace std; int main() { char ch[110]; while(gets(ch)) { int len=strlen(ch); printf("%c%d%c\n",ch[0],len-2,ch[len-1]); } return 0; }
a.cc: In function 'int main()': a.cc:10:11: error: 'gets' was not declared in this scope; did you mean 'getw'? 10 | while(gets(ch)) | ^~~~ | getw
s140903496
p03636
C++
#include <bits/stdc++.h> using namespace std; int main() { char a[101]; gets(a); int n = strlen(a); cout << a[0] << n - 2 << a[n - 1] << endl; return 0; }
a.cc: In function 'int main()': a.cc:7:5: error: 'gets' was not declared in this scope; did you mean 'getw'? 7 | gets(a); | ^~~~ | getw
s726426539
p03636
C++
#include <stdio.h> #include <string.h> int main() { char s[101]; while(gets(s)) { int len = strlen(s); printf("%c%d%c\n", s[0], len-2, s[len-1]); } return 0; }
a.cc: In function 'int main()': a.cc:6:15: error: 'gets' was not declared in this scope; did you mean 'getw'? 6 | while(gets(s)) | ^~~~ | getw
s822171545
p03636
C++
#include <iostream> #include <cstdio> #include <algorithm> using namespace std; int main (){ char s[150] = {0}; int len = 0; cin >> s; len = strlen(s); cout << s[0] << len - 2 << s[len-1] << "\n"; return 0; }
a.cc: In function 'int main()': a.cc:12:11: error: 'strlen' was not declared in this scope 12 | len = strlen(s); | ^~~~~~ a.cc:4:1: note: 'strlen' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>' 3 | #include <algorithm> +++ |+#include <cstring> 4 | using namespace std;
s712728432
p03636
C++
#include <iostream> #include <cstdio> #include <algorithm> using namespace std; int main (){ char s[150] = {0}; int len = 0; cin >> s; len = strlen(s); cout << s[0] << len - 2 << s[len-1] << "\n"; return 0; }
a.cc: In function 'int main()': a.cc:12:11: error: 'strlen' was not declared in this scope 12 | len = strlen(s); | ^~~~~~ a.cc:4:1: note: 'strlen' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>' 3 | #include <algorithm> +++ |+#include <cstring> 4 | using namespace std;
s723939305
p03636
C++
#include<iostream> #include<vector> #include<cstring> #include<queue> #include<algorithm> #include<string> #include<cstdio> #include<cstdlib> #include <math.h> #define INF 0x3f3f3f3f using namespace std; int main() { char s[100]; gets(s); int len=strlen(s); printf("%c%d%c",s[0],len-2,s[len-1]); }
a.cc: In function 'int main()': a.cc:15:1: error: 'gets' was not declared in this scope; did you mean 'getw'? 15 | gets(s); | ^~~~ | getw
s698828314
p03636
C++
#include <string> #include <iostream> using namespace std; string s; int main(){ cin>>s; cout<<s[0]<<s.size()-2<<s[s.size-1]<<endl; }
a.cc: In function 'int main()': a.cc:7:29: error: invalid use of member function 'std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::size_type std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::size() const [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>; size_type = long unsigned int]' (did you forget the '()' ?) 7 | cout<<s[0]<<s.size()-2<<s[s.size-1]<<endl; | ~~^~~~ | ()
s701561455
p03636
C++
1 #include <iostream> 2 #include <cstdio> 3 #include <algorithm> 4 #include <cmath> 5 #include <vector> 6 7 using namespace std; 8 9 int main() { 10 11 string s; 12 cin >> s; 13 cout << s[0] << (int)s.size() - 2 << s[(int)s.size() - 1] << endl; 14 15 return 0; 16 }
a.cc:1:5: error: stray '#' in program 1 | 1 #include <iostream> | ^ a.cc:2:5: error: stray '#' in program 2 | 2 #include <cstdio> | ^ a.cc:3:5: error: stray '#' in program 3 | 3 #include <algorithm> | ^ a.cc:4:5: error: stray '#' in program 4 | 4 #include <cmath> | ^ a.cc:5:5: error: stray '#' in program 5 | 5 #include <vector> | ^ a.cc:1:3: error: expected unqualified-id before numeric constant 1 | 1 #include <iostream> | ^ a.cc:8:3: error: expected unqualified-id before numeric constant 8 | 8 | ^
s485533715
p03636
C++
#include <stdio.h> #include <string.h> char s[105]; int main(){ int n; gets(s); n=strlen(s); printf("%c%d%c\n",s[0],n-2,s[n-1]); }
a.cc: In function 'int main()': a.cc:7:9: error: 'gets' was not declared in this scope; did you mean 'getw'? 7 | gets(s); | ^~~~ | getw
s113430283
p03636
C++
#include <iostream> #include <algorithm> #include <cmath> #include <string> #include <utility> using namespace std; const int INT__MAX = 2147483647; const int MOD = 1000000007; int main() { string s; cin >> s; cout << s[0] << s.length - 2 << s[s.length-1] << endl; return 0; }
a.cc: In function 'int main()': a.cc:17:27: error: invalid use of member function 'std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::size_type std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::length() const [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>; size_type = long unsigned int]' (did you forget the '()' ?) 17 | cout << s[0] << s.length - 2 << s[s.length-1] << endl; | ~~^~~~~~ | () a.cc:17:45: error: invalid use of member function 'std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::size_type std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::length() const [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>; size_type = long unsigned int]' (did you forget the '()' ?) 17 | cout << s[0] << s.length - 2 << s[s.length-1] << endl; | ~~^~~~~~ | ()
s518604620
p03636
C++
#include <cstdio> #include <cstring> #include <algorithm> using namespace std; #define ll long long char s[105]; int main(){ int n; gets(s); n=strlen(s); printf("%c%d%c\n",s[0],n-2,s[n-1]); }
a.cc: In function 'int main()': a.cc:10:9: error: 'gets' was not declared in this scope; did you mean 'getw'? 10 | gets(s); | ^~~~ | getw
s900274722
p03636
C++
#include <iostream> #include <algorithm> #include <cmath> #include <string> #include <utility> using namespace std; const int INT__MAX = 2147483647; const int MOD = 1000000007; int main() { string s; cin >> s; cout << s.begin << s.length - 2 << s.end << endl; return 0; }
a.cc: In function 'int main()': a.cc:17:14: error: no match for 'operator<<' (operand types are 'std::ostream' {aka 'std::basic_ostream<char>'} and '<unresolved overloaded function type>') 17 | cout << s.begin << s.length - 2 << s.end << endl; | ~~~~ ^~ ~~~~~~~ | | | | | <unresolved overloaded function type> | std::ostream {aka std::basic_ostream<char>} In file included from /usr/include/c++/14/iostream:41, from a.cc:1: /usr/include/c++/14/ostream:116:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(__ostream_type& (*)(__ostream_type&)) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>]' 116 | operator<<(__ostream_type& (*__pf)(__ostream_type&)) | ^~~~~~~~ /usr/include/c++/14/ostream:116:36: note: no known conversion for argument 1 from '<unresolved overloaded function type>' to 'std::basic_ostream<char>::__ostream_type& (*)(std::basic_ostream<char>::__ostream_type&)' {aka 'std::basic_ostream<char>& (*)(std::basic_ostream<char>&)'} 116 | operator<<(__ostream_type& (*__pf)(__ostream_type&)) | ~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~ /usr/include/c++/14/ostream:125:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(__ios_type& (*)(__ios_type&)) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>; __ios_type = std::basic_ios<char>]' 125 | operator<<(__ios_type& (*__pf)(__ios_type&)) | ^~~~~~~~ /usr/include/c++/14/ostream:125:32: note: no known conversion for argument 1 from '<unresolved overloaded function type>' to 'std::basic_ostream<char>::__ios_type& (*)(std::basic_ostream<char>::__ios_type&)' {aka 'std::basic_ios<char>& (*)(std::basic_ios<char>&)'} 125 | operator<<(__ios_type& (*__pf)(__ios_type&)) | ~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~ /usr/include/c++/14/ostream:135:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(std::ios_base& (*)(std::ios_base&)) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>]' 135 | operator<<(ios_base& (*__pf) (ios_base&)) | ^~~~~~~~ /usr/include/c++/14/ostream:135:30: note: no known conversion for argument 1 from '<unresolved overloaded function type>' to 'std::ios_base& (*)(std::ios_base&)' 135 | operator<<(ios_base& (*__pf) (ios_base&)) | ~~~~~~~~~~~~^~~~~~~~~~~~~~~~~ /usr/include/c++/14/ostream:174:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(long int) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>]' 174 | operator<<(long __n) | ^~~~~~~~ /usr/include/c++/14/ostream:174:23: note: no known conversion for argument 1 from '<unresolved overloaded function type>' to 'long int' 174 | operator<<(long __n) | ~~~~~^~~ /usr/include/c++/14/ostream:178:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(long unsigned int) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>]' 178 | operator<<(unsigned long __n) | ^~~~~~~~ /usr/include/c++/14/ostream:178:32: note: no known conversion for argument 1 from '<unresolved overloaded function type>' to 'long unsigned int' 178 | operator<<(unsigned long __n) | ~~~~~~~~~~~~~~^~~ /usr/include/c++/14/ostream:182:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(bool) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>]' 182 | operator<<(bool __n) | ^~~~~~~~ /usr/include/c++/14/ostream:182:23: note: no known conversion for argument 1 from '<unresolved overloaded function type>' to 'bool' 182 | operator<<(bool __n) | ~~~~~^~~ In file included from /usr/include/c++/14/ostream:1022: /usr/include/c++/14/bits/ostream.tcc:96:5: note: candidate: 'std::basic_ostream<_CharT, _Traits>& std::basic_ostream<_CharT, _Traits>::operator<<(short int) [with _CharT = char; _Traits = std::char_traits<char>]' 96 | basic_ostream<_CharT, _Traits>:: | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ /usr/include/c++/14/bits/ostream.tcc:97:22: note: no known conversion for argument 1 from '<unresolved overloaded function type>' to 'short int' 97 | operator<<(short __n) | ~~~~~~^~~ /usr/include/c++/14/ostream:189:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(short unsigned int) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>]' 189 | operator<<(unsigned short __n) | ^~~~~~~~ /usr/include/c++/14/ostream:189:33: note: no known conversion for argument 1 from '<unresolved overloaded function type>' to 'short unsigned int' 189 | operator<<(unsigned short __n) | ~~~~~~~~~~~~~~~^~~ /usr/include/c++/14/bits/ostream.tcc:110:5: note: candidate: 'std::basic_ostream<_CharT, _Traits>& std::basic_ostream<_CharT, _Traits>::operator<<(int) [with _CharT = char; _Traits = std::char_traits<char>]' 110 | basic_ostream<_CharT, _Traits>:: | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ /usr/include/c++/14/bits/ostream.tcc:111:20: note: no known conversion for argument 1 from '<unresolved overloaded function type>' to 'int' 111 | operator<<(int __n) | ~~~~^~~ /usr/include/c++/14/ostream:200:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(unsigned int) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>]' 200 | operator<<(unsigned int __n) | ^~~~~~~~ /usr/include/c++/14/ostream:200:31: note: no known conversion for argument 1 from '<unresolved overloaded function type>' to 'unsigned int' 200 | operator<<(unsigned int __n) | ~~~~~~~~~~~~~^~~ /usr/include/c++/14/ostream:211:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(long long int) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>]' 211 | operator<<(long long __n) | ^~~~~~~~ /usr/include/c++/14/ostream:211:28: note: no known conversion for argument 1 from '<unresolved overloaded function type>' to 'long long int' 211 | operator<<(long long __n) | ~~~~~~~~~~^~~ /usr/include/c++/14/ostream:215:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(long long unsigned int) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>]' 215 | operator<<(unsigned long long __n) | ^~~~~~~~ /usr/include/c++/14/ostream:215:37: note: no known conversion for argument 1 from '<unresolved overloaded function type>' to 'long long unsigned int' 215 | operator<<(unsigned long long __n) | ~~~~~~~~~~~~~~~~~~~^~~ /usr/include/c++/14/ostream:231:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(double) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>]' 231 | operator<<(double __f) | ^~~~~~~~ /usr/include/c++/14/ostream:231:25: note: no known conversion for argument 1 from '<unresolved overloaded function type>' to 'double' 231 | operator<<(double __f) | ~~~~~~~^~~ /usr/include/c++/14/ostream:235:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(float) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>]' 235 | operator<<(float __f) | ^~~~~~~~ /usr/include/c++/14/ostream:235:24: note: no known conversion for argument 1 from '<unresolved overloaded function type>' to 'float' 235 | operator<<(float __f) | ~~~~~~^~~ /usr/include/c++/14/ostream:243:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(long double) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>]' 243 | operator<<(long double __f) | ^~~~~~~~ /usr/include/c++/14/ostream:243:30: note: no known conversion for argument 1 from '<unresolved overloaded function type>' to 'long double' 243 | operator<<(long double __f) | ~~~~~~~~~~~~^~~ /usr/include/c++/14/ostream:301:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(const void*) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>]' 301 | operator<<(const void* __p) | ^~~~~~~~ /usr/include/c++/14/ostream:301:30: note: no known conversion for argument 1 from '<unresolved overloaded function type>' to 'const void*' 301 | operator<<(const void* __p) | ~~~~~~~~~~~~^~~ /usr/include/c++/14/ostream:306:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(std::nullptr_t) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>; std::nullptr_t = std::nullptr_t]' 306 | operator<<(nullptr_t) |
s204370619
p03637
Java
import java.util.Scanner; public class Main099 { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int n = sc.nextInt(); long[] a = new long[n]; int count4 = 0; int count2 = 0; int count = 0; for (int i = 0; i < a.length; i++) { a[i] = sc.nextLong(); if(a[i] % 4 == 0) { count4++; } else if(a[i] % 2 == 0) { count2++; } else { count++; } } double b = Math.ceil((n -1) / 2.0); double c = b - count4; if(b <= count4) { System.out.println("Yes"); } else if(n == count2){ System.out.println("Yes"); } else if (count2 > c){ System.out.println("Yes"); } else { System.out.println("No"); } } }
Main.java:3: error: class Main099 is public, should be declared in a file named Main099.java public class Main099 { ^ 1 error
s756047092
p03637
C++
#include "bits/stdc++.h" #define MOD 1000000007 #define rep(i, n) for(ll i=0; i < (n); i++) #define rrep(i, n) for(ll i=(n)-1; i >=0; i--) #define ALL(v) v.begin(),v.end() #define rALL(v) v.rbegin(),v.rend() #define FOR(i, j, k) for(ll i=j;i<k;i++) #define debug_print(var) cerr << #var << "=" << var <<endl; #define DUMP(i, v)for(ll i=0;i<v.size();i++)cerr<<v[i]<<" " using namespace std; typedef long long int ll; typedef vector<ll> llvec; typedef vector<double> dvec; typedef pair<ll, ll> P; typedef long double ld; struct edge{ll x, c;}; ll mod(ll a, ll mod){ ll res = a%mod; if(res<0)res=res + mod; return res; } ll modpow(ll a, ll n, ll mod){ ll res=1; while(n>0){ if(n&1) res=res*a%mod; a=a*a%mod; n>>=1; } return res; } ll modinv(ll a, ll mod){ return modpow(a, mod-2, mod); } ll gcd(ll a, ll b){ ll r = a%b; if(r==0) return b; else return gcd(b, a%b); } bool is_prime(ll n){ ll i = 2; if(n==1)return false; if(n==2)return true; bool res = true; while(i*i <n){ if(n%i==0){ res = false; } i = i+1; } //if(i==1)res = false; if(n%i==0)res=false; return res; } struct UnionFind{ ll N; llvec p; llvec cnt; UnionFind(ll n){ N = n; p=llvec(N); cnt=llvec(N, 0); rep(i, N){ p[i] = i; cnt[i] = 1; } } void con(ll a, ll b){ P at = root(a); P bt = root(b); if(at.second!=bt.second){ if(at.first>bt.first){ swap(at, bt); swap(a, b); } p[at.second] = bt.second; cnt[bt.second]+=cnt[at.second]; p[a]=bt.second; } } P root(ll a){ ll atmp = a; ll c=0; while(atmp!=p[atmp]){ atmp = p[atmp]; c++; } p[a] = atmp; return {c, atmp}; } bool is_con(ll a, ll b){ P at=root(a); P bt=root(b); return at.second == bt.second; } }; struct dijkstra{ ll N; llvec d; vector<vector<edge>> e; dijkstra(ll n){ N = n; //d = llvec(N, 1e18); e = vector<vector<edge>>(N); } void add_edge(ll from, ll to, ll cost){ e[from].push_back({to, cost}); } void run(ll start){ priority_queue<P, vector<P>, greater<P>> que; que.push({0, start}); d = llvec(N, 1e18); d[start]=0; while(!que.empty()){ P q = que.top();que.pop(); ll dc = q.first; ll x = q.second; if(dc>d[x]){ continue; }else{ for(auto ip: e[x]){ if(d[ip.x]<=d[x]+ip.c){ continue; }else{ d[ip.x]= d[x]+ip.c; que.push({d[ip.x], ip.x}); } } } } } }; /************************************** ** A main function starts from here ** ***************************************/ int main(){ ll N; cin >> N; llvec a(N); llvec c(3, 0); rep(i, N){ cin >> a[i]; if(a[i]%4==0){ c[0]++; }else if(a[i]%2==0){ c[1]++; }else{ c[2]++; } } if(c[2]+c[0]==N){ cout << "Yes"; }else{ if(c[2]=<c[0]){ cout << "Yes"; }else{ cout << "No"; } } return 0; }
a.cc: In function 'int main()': a.cc:171:13: error: expected primary-expression before '<' token 171 | if(c[2]=<c[0]){ | ^
s786411118
p03637
C++
#include<bits/stdc++.h> using namespace std; int main(){ int n; cin >> n; queue<int> four; queue<int> two; queue<int> one; for(int i=0;i<n;i++){ int a; cin >> a; if(a%4==0)four.push(a); else if(a%2==0)two.push(a); else one.push(a); } long long int x[n]; for(int i=0;i<n;i++){ if(i%2==0 && !one.empty()){ x[i]=one.top(); one.pop(); } else if(i%2==0 && !two.empty()){ x[i]=two.top(); two.pop(); } else if(i%2==0 && !four.empty()){ x[i]=four.top(); four.pop(); } else if(i%2==1 && !four.empty()){ x[i]=one.top(); four.pop(); } else if(i%2==1 && !two.empty()){ x[i]=two.top(); two.pop(); } else if(i%2==1 && !two.empty()){ x[i]=one.top(); one.pop(); } } for(int i=0;i<n-1;i++){ if((x[i]*x[i+1])%4!=0){ cout << "No"; return 0; } } cout << "Yes"; }
a.cc: In function 'int main()': a.cc:19:22: error: 'class std::queue<int>' has no member named 'top'; did you mean 'pop'? 19 | x[i]=one.top(); | ^~~ | pop a.cc:23:22: error: 'class std::queue<int>' has no member named 'top'; did you mean 'pop'? 23 | x[i]=two.top(); | ^~~ | pop a.cc:27:23: error: 'class std::queue<int>' has no member named 'top'; did you mean 'pop'? 27 | x[i]=four.top(); | ^~~ | pop a.cc:31:22: error: 'class std::queue<int>' has no member named 'top'; did you mean 'pop'? 31 | x[i]=one.top(); | ^~~ | pop a.cc:35:22: error: 'class std::queue<int>' has no member named 'top'; did you mean 'pop'? 35 | x[i]=two.top(); | ^~~ | pop a.cc:39:22: error: 'class std::queue<int>' has no member named 'top'; did you mean 'pop'? 39 | x[i]=one.top(); | ^~~ | pop
s092564941
p03637
C++
#include <bits/stdc++.h> using namespace std; int main() { int N; cin >> N; vector<int> A(N); for (int i = 0; i < N; i++) cin >> A.at(i); int a = 0, b = 0, c = 0; for (auto a : A) if (a % 4 == 0) ? a++ : (a % 2 == 0) ? b++ : c++; b %= 2; c += b; cout << ((c - a < 1) ? "Yes" : "No") << "\n"; }
a.cc: In function 'int main()': a.cc:10:36: error: expected primary-expression before '?' token 10 | for (auto a : A) if (a % 4 == 0) ? a++ : (a % 2 == 0) ? b++ : c++; | ^
s863587346
p03637
C++
#include<bits/stdc++.h> #include<ctype.h> # define pb push_back #define fst first #define sec second #define For(i,a,b) for(int i=a;i<b;i++) #define ll long long int #define ull unsigned long long int #define mod 1000000007 #define fo(i,n) for(ll i=0;i<n;i++) #define endl "\n" #define rev(i,n) for(ll i=n-1;i>=0;i--) #define fo1(i,n) for(ll i=1;i<=n;i++) #define boolsize 1000001 #define pi pair<ll,ll> #define vi vector<ll> #define vii vector<pi> using namespace std; template<typename T> void showvector(vector <T> v) { for(T x:v) cout<<x<<" "; cout<<endl; } template<typename T> void showvector1(vector <T> v) { ll n=v.size(); fo1(i,n-1) cout<<v[i]<<endl; } template<typename T> void showset(set <T> s) { for(T x: s) cout<<x<<" "; cout<<endl; } template<class T> void showvectorpair(vector<T> v) { for(auto it=v.begin();it!=v.end();it++) cout<<it->first<<" "<<it->second<<endl; cout<<endl; } template<typename T,typename P> void showmap(map <T,P> m) { for(auto it=m.begin();it!=m.end();it++) cout<<it->first<<" "<<it->second<<endl; cout<<endl; } template<typename T> bool comp(T a,T b) { return (a>b); } template<class T> bool comppair(T a,T b) { if(a.first==b.first) return(a.second>b.second); return (a.first>b.first); } bool sameparity(ll a,ll b) { return (a%2==b%2); } bool difparity(ll a,ll b) { return !(a%2==b%2); } bool isprime(ll x) { if(x<=1) return false; for(ll i=2;i<=sqrt(x);i++) { if(x%i==0) return false; } return true; } bool iseven(ll x) { return !(x%2); } bool isodd(ll x) { return (x%2); } /// check for test case before submitting void vfun() { ll n,k; cin>>n; vector <ll> v(n); fo(i,n) cin>>v[i]; } int main() { #ifndef ONLINE_JUDGE freopen("inputh.txt", "r", stdin); freopen("outputh.txt", "w", stdout); #endif ios_base::sync_with_stdio(0); ///cant use scanf, printf cin.tie(0);cout.tie(0); /// no longer auto flush cout before each cin, remove for interactive //cout << fixed << setprecision(11); /// no scientific output ll test=1; //cin>>test; while(test--) { ll n; cin>>n; vi v; ll x,flag=0,cnt=0; fo(i,n) { cin>>x; if(x==2) flag=1; else { if(x%4==0) cnt++; v.pb(x); } } ll siz=v.size(); if(siz==0) {cout<<"YES\n";return;} if(flag==1) siz+=1; if(cnt>=siz/2) cout<<"Yes\n"; else cout<<"No\n"; // if(vfun()) // cout<<"YES\n"; // else // cout<<"NO\n"; } } ///before sub /// check for value of zero and single input in array ///loop vars,1LL in mult, equal, one, bounds, int v ll, endl, finish taking inputs /// check whether test cases are given or not
a.cc: In function 'int main()': a.cc:136:28: error: return-statement with no value, in function returning 'int' [-fpermissive] 136 | {cout<<"YES\n";return;} | ^~~~~~
s369040617
p03637
C++
#include <bits/stdc++.h> using namespace std; #define rep(i, n) for (int i = 0; i < (int)(n); i++) #define all(v) v.begin(), v.end() #define ll int64_t #define _GLIBCXX_DEBUG const int dx[4] = {1, 0, -1, 0}; const int dy[4] = {0, 1, 0, -1}; //約数列挙(√N) vector< int64_t > divisor(int64_t n) { vector< int64_t > ret; for(int64_t i = 1; i * i <= n; i++) { if(n % i == 0) { ret.push_back(i); if(i * i != n) ret.push_back(n / i); } } sort(begin(ret), end(ret)); return (ret); } //素因数分解(√N) map< int64_t, int > prime_factor(int64_t n) { map< int64_t, int > ret; for(int64_t i = 2; i * i <= n; i++) { while(n % i == 0) { ret[i]++; n /= i; } } if(n != 1) ret[n] = 1; return ret; } //素数テーブル(NloglogN) vector< bool > prime_table(int n) { vector< bool > prime(n + 1, true); if(n >= 0) prime[0] = false; if(n >= 1) prime[1] = false; for(int i = 2; i * i <= n; i++) { if(!prime[i]) continue; for(int j = i + i; j <= n; j += i) { prime[j] = false; } } return prime; } //二項係数(K) template< typename T > T binomial(int64_t N, int64_t K) { if(K < 0 || N < K) return 0; T ret = 1; for(T i = 1; i <= K; ++i) { ret *= N--; ret /= i; } return ret; } //二項係数テーブル(N^2) template< typename T > vector< vector< T > > binomial_table(int N) { vector< vector< T > > mat(N + 1, vector< T >(N + 1)); for(int i = 0; i <= N; i++) { for(int j = 0; j <= i; j++) { if(j == 0 || j == i) mat[i][j] = 1; else mat[i][j] = mat[i - 1][j - 1] + mat[i - 1][j]; } } return mat; } int main(){ int c2=0,c4=0; int n; cin >> n; vector<int> a(n); rep(i,n){ cin >> a.at(i); if(!(a.at(i)%4))c4++; else if(!(a.at(i)%2))c2++; } if(c2==0){ if(c4*2+1>=n)cout << "Yes" << endl; else cout << "No" << endl; } else{ if(C4*2+c2>=n)cout << "Yes" << endl; else cout << "No" << endl; } }
a.cc: In function 'int main()': a.cc:84:8: error: 'C4' was not declared in this scope; did you mean 'c4'? 84 | if(C4*2+c2>=n)cout << "Yes" << endl; | ^~ | c4
s322211276
p03637
C++
int main(void) { int N; cin >> N; vector<int> a(N); int four = 0; int two = 0; for (int i = 0; i < N; i++) { cin >> a[i]; // 4の倍数 if (a[i] % 4 == 0) { four++; } else if (a[i] % 2 == 0) { two++; } } // printf("four = %d, two = %d\n", four, two); string ans; int sum; if (two % 2 == 0) { sum = four * 4 + two * 2; } else { sum = four * 4 + (two - 1) * 2; } // printf("left = %d, sum = %d\n", (N / 2) * 4, sum); if ((N / 2) * 4 <= sum) { ans = "Yes"; } else { ans = "No"; } cout << ans << endl; return (0); }
a.cc: In function 'int main()': a.cc:4:5: error: 'cin' was not declared in this scope 4 | cin >> N; | ^~~ a.cc:5:5: error: 'vector' was not declared in this scope 5 | vector<int> a(N); | ^~~~~~ a.cc:5:12: error: expected primary-expression before 'int' 5 | vector<int> a(N); | ^~~ a.cc:10:16: error: 'a' was not declared in this scope 10 | cin >> a[i]; | ^ a.cc:23:5: error: 'string' was not declared in this scope 23 | string ans; | ^~~~~~ a.cc:36:9: error: 'ans' was not declared in this scope 36 | ans = "Yes"; | ^~~ a.cc:40:9: error: 'ans' was not declared in this scope 40 | ans = "No"; | ^~~ a.cc:42:5: error: 'cout' was not declared in this scope 42 | cout << ans << endl; | ^~~~ a.cc:42:13: error: 'ans' was not declared in this scope 42 | cout << ans << endl; | ^~~ a.cc:42:20: error: 'endl' was not declared in this scope 42 | cout << ans << endl; | ^~~~
s865296139
p03637
C++
#include <iostream> // cout, endl, cin #include <string> // string, to_string, stoi #include <vector> // vector #include <algorithm> // min, max, swap, sort, reverse, lower_bound, upper_bound #include <utility> // pair, make_pair #include <tuple> // tuple, make_tuple #include <cstdint> // int64_t, int*_t #include <cstdio> // printf #include <map> // map #include <queue> // queue, priority_queue #include <set> // set #include <stack> // stack #include <deque> // deque #include <unordered_map> // unordered_map #include <unordered_set> // unordered_set #include <bitset> // bitset #include <cctype> // isupper, islower, isdigit, toupper, tolower #include<math.h> #define rep(i,n) for(int i = 0;i<(int)(n);i++); using namespace std; using ll = long long; const ll INF = 100100100100100; ll two(ll a) {//何回2で割れるか 2以上は変わらないので2にする ll cnt = 0; while (true) { if (a % 2 == 0) { a /= 2; cnt++; } else break; } if (cnt >= 2) return 2; else return cnt; } int main() { ll N; cin >> N; vector<ll> a(N); ll count = 0; for (int i = 0; i < N; i++) { cin >> count; a[i] = two(cnt); }//{1 2 4 8}ならa ={0 1 2 2} vector<ll> twonum(3);//{0の数,1の数,2の数} for (int i = 0; i < N; i++) twonum[a[i]]++; if (twonum[1] == 1)twonum[0] += 1; if (twonum[0] <= twonum[2] * 2)cout << "Yes" << endl; else cout << "No" << endl; }
a.cc: In function 'int main()': a.cc:43:28: error: 'cnt' was not declared in this scope; did you mean 'int'? 43 | a[i] = two(cnt); | ^~~ | int
s945993388
p03637
C++
nclude <iostream> // cout, endl, cin #include <string> // string, to_string, stoi #include <vector> // vector #include <algorithm> // min, max, swap, sort, reverse, lower_bound, upper_bound #include <utility> // pair, make_pair #include <tuple> // tuple, make_tuple #include <cstdint> // int64_t, int*_t #include <cstdio> // printf #include <map> // map #include <queue> // queue, priority_queue #include <set> // set #include <stack> // stack #include <deque> // deque #include <unordered_map> // unordered_map #include <unordered_set> // unordered_set #include <bitset> // bitset #include <cctype> // isupper, islower, isdigit, toupper, tolower #include<math.h> #define rep(i,n) for(int i = 0;i<(int)(n);i++); using namespace std; using ll = long long; const ll INF = 100100100100100; ll two(ll a) {//何回2で割れるか 2以上は変わらないので2にする ll cnt = 0; while (true) { if (a % 2 == 0) { a /= 2; cnt++; } else break; } if (cnt >= 2) return 2; else return cnt; } int main() { ll N; cin >> N; vector<ll> a(N); ll count = 0; for (int i = 0; i < N; i++) { cin >> count; a[i] = two(cnt); }//{1 2 4 8}ならa ={0 1 2 2} vector<ll> twonum(3);//{0の数,1の数,2の数} for (int i = 0; i < N; i++) twonum[a[i]]++; if (twonum[1] == 1)twonum[0] += 1; if (twonum[0] <= twonum[2] * 2)cout << "Yes" << endl; else cout << "No" << endl; }
a.cc:1:1: error: 'nclude' does not name a type 1 | nclude <iostream> // cout, endl, cin | ^~~~~~ 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
s039870354
p03637
C++
#include <bits/stdc++.h> using namespace std; int main() { int t; cin>>t; int k=t; int d=0; while(t--){ int tg; cin>>tg; if(tg%4==0) d+=4; else if(tg%2==0) d++; } if(d>=k*2) cout<<"Yes"; else cout<"No"; }
a.cc: In function 'int main()': a.cc:18:10: error: no match for 'operator<' (operand types are 'std::ostream' {aka 'std::basic_ostream<char>'} and 'const char [3]') 18 | else cout<"No"; | ~~~~^~~~~ | | | | | const char [3] | std::ostream {aka std::basic_ostream<char>} In file included from /usr/include/c++/14/regex:68, from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:181, from a.cc:1: /usr/include/c++/14/bits/regex.h:1143:5: note: candidate: 'template<class _BiIter> bool std::__cxx11::operator<(const sub_match<_BiIter>&, const sub_match<_BiIter>&)' 1143 | operator<(const sub_match<_BiIter>& __lhs, const sub_match<_BiIter>& __rhs) | ^~~~~~~~ /usr/include/c++/14/bits/regex.h:1143:5: note: template argument deduction/substitution failed: a.cc:18:11: note: 'std::ostream' {aka 'std::basic_ostream<char>'} is not derived from 'const std::__cxx11::sub_match<_BiIter>' 18 | else cout<"No"; | ^~~~ /usr/include/c++/14/bits/regex.h:1224:5: note: candidate: 'template<class _Bi_iter, class _Ch_traits, class _Ch_alloc> bool std::__cxx11::operator<(__sub_match_string<_Bi_iter, _Ch_traits, _Ch_alloc>&, const sub_match<_BiIter>&)' 1224 | operator<(const __sub_match_string<_Bi_iter, _Ch_traits, _Ch_alloc>& __lhs, | ^~~~~~~~ /usr/include/c++/14/bits/regex.h:1224:5: note: template argument deduction/substitution failed: a.cc:18:11: note: 'std::ostream' {aka 'std::basic_ostream<char>'} is not derived from 'std::__cxx11::__sub_match_string<_Bi_iter, _Ch_traits, _Ch_alloc>' 18 | else cout<"No"; | ^~~~ /usr/include/c++/14/bits/regex.h:1317:5: note: candidate: 'template<class _Bi_iter, class _Ch_traits, class _Ch_alloc> bool std::__cxx11::operator<(const sub_match<_BiIter>&, __sub_match_string<_Bi_iter, _Ch_traits, _Ch_alloc>&)' 1317 | operator<(const sub_match<_Bi_iter>& __lhs, | ^~~~~~~~ /usr/include/c++/14/bits/regex.h:1317:5: note: template argument deduction/substitution failed: a.cc:18:11: note: 'std::ostream' {aka 'std::basic_ostream<char>'} is not derived from 'const std::__cxx11::sub_match<_BiIter>' 18 | else cout<"No"; | ^~~~ /usr/include/c++/14/bits/regex.h:1391:5: note: candidate: 'template<class _Bi_iter> bool std::__cxx11::operator<(const typename std::iterator_traits<_Iter>::value_type*, const sub_match<_BiIter>&)' 1391 | operator<(typename iterator_traits<_Bi_iter>::value_type const* __lhs, | ^~~~~~~~ /usr/include/c++/14/bits/regex.h:1391:5: note: template argument deduction/substitution failed: a.cc:18:11: note: mismatched types 'const std::__cxx11::sub_match<_BiIter>' and 'const char [3]' 18 | else cout<"No"; | ^~~~ /usr/include/c++/14/bits/regex.h:1485:5: note: candidate: 'template<class _Bi_iter> bool std::__cxx11::operator<(const sub_match<_BiIter>&, const typename std::iterator_traits<_Iter>::value_type*)' 1485 | operator<(const sub_match<_Bi_iter>& __lhs, | ^~~~~~~~ /usr/include/c++/14/bits/regex.h:1485:5: note: template argument deduction/substitution failed: a.cc:18:11: note: 'std::ostream' {aka 'std::basic_ostream<char>'} is not derived from 'const std::__cxx11::sub_match<_BiIter>' 18 | else cout<"No"; | ^~~~ /usr/include/c++/14/bits/regex.h:1560:5: note: candidate: 'template<class _Bi_iter> bool std::__cxx11::operator<(const typename std::iterator_traits<_Iter>::value_type&, const sub_match<_BiIter>&)' 1560 | operator<(typename iterator_traits<_Bi_iter>::value_type const& __lhs, | ^~~~~~~~ /usr/include/c++/14/bits/regex.h:1560:5: note: template argument deduction/substitution failed: a.cc:18:11: note: mismatched types 'const std::__cxx11::sub_match<_BiIter>' and 'const char [3]' 18 | else cout<"No"; | ^~~~ /usr/include/c++/14/bits/regex.h:1660:5: note: candidate: 'template<class _Bi_iter> bool std::__cxx11::operator<(const sub_match<_BiIter>&, const typename std::iterator_traits<_Iter>::value_type&)' 1660 | operator<(const sub_match<_Bi_iter>& __lhs, | ^~~~~~~~ /usr/include/c++/14/bits/regex.h:1660:5: note: template argument deduction/substitution failed: a.cc:18:11: note: 'std::ostream' {aka 'std::basic_ostream<char>'} is not derived from 'const std::__cxx11::sub_match<_BiIter>' 18 | else cout<"No"; | ^~~~ In file included from /usr/include/c++/14/bits/stl_algobase.h:64, from /usr/include/c++/14/algorithm:60, from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:51: /usr/include/c++/14/bits/stl_pair.h:1045:5: note: candidate: 'template<class _T1, class _T2> constexpr bool std::operator<(const pair<_T1, _T2>&, const pair<_T1, _T2>&)' 1045 | operator<(const pair<_T1, _T2>& __x, const pair<_T1, _T2>& __y) | ^~~~~~~~ /usr/include/c++/14/bits/stl_pair.h:1045:5: note: template argument deduction/substitution failed: a.cc:18:11: note: 'std::ostream' {aka 'std::basic_ostream<char>'} is not derived from 'const std::pair<_T1, _T2>' 18 | else cout<"No"; | ^~~~ In file included from /usr/include/c++/14/bits/stl_algobase.h:67: /usr/include/c++/14/bits/stl_iterator.h:448:5: note: candidate: 'template<class _Iterator> constexpr bool std::operator<(const reverse_iterator<_Iterator>&, const reverse_iterator<_Iterator>&)' 448 | operator<(const reverse_iterator<_Iterator>& __x, | ^~~~~~~~ /usr/include/c++/14/bits/stl_iterator.h:448:5: note: template argument deduction/substitution failed: a.cc:18:11: note: 'std::ostream' {aka 'std::basic_ostream<char>'} is not derived from 'const std::reverse_iterator<_Iterator>' 18 | else cout<"No"; | ^~~~ /usr/include/c++/14/bits/stl_iterator.h:493:5: note: candidate: 'template<class _IteratorL, class _IteratorR> constexpr bool std::operator<(const reverse_iterator<_Iterator>&, const reverse_iterator<_IteratorR>&)' 493 | operator<(const reverse_iterator<_IteratorL>& __x, | ^~~~~~~~ /usr/include/c++/14/bits/stl_iterator.h:493:5: note: template argument deduction/substitution failed: a.cc:18:11: note: 'std::ostream' {aka 'std::basic_ostream<char>'} is not derived from 'const std::reverse_iterator<_Iterator>' 18 | else cout<"No"; | ^~~~ /usr/include/c++/14/bits/stl_iterator.h:1694:5: note: candidate: 'template<class _IteratorL, class _IteratorR> constexpr bool std::operator<(const move_iterator<_IteratorL>&, const move_iterator<_IteratorR>&)' 1694 | operator<(const move_iterator<_IteratorL>& __x, | ^~~~~~~~ /usr/include/c++/14/bits/stl_iterator.h:1694:5: note: template argument deduction/substitution failed: a.cc:18:11: note: 'std::ostream' {aka 'std::basic_ostream<char>'} is not derived from 'const std::move_iterator<_IteratorL>' 18 | else cout<"No"; | ^~~~ /usr/include/c++/14/bits/stl_iterator.h:1760:5: note: candidate: 'template<class _Iterator> constexpr bool std::operator<(const move_iterator<_IteratorL>&, const move_iterator<_IteratorL>&)' 1760 | operator<(const move_iterator<_Iterator>& __x, | ^~~~~~~~ /usr/include/c++/14/bits/stl_iterator.h:1760:5: note: template argument deduction/substitution failed: a.cc:18:11: note: 'std::ostream' {aka 'std::basic_ostream<char>'} is not derived from 'const std::move_iterator<_IteratorL>' 18 | else cout<"No"; | ^~~~ In file included from /usr/include/c++/14/bits/basic_string.h:47, from /usr/include/c++/14/string:54, from /usr/include/c++/14/bitset:52, from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:52: /usr/include/c++/14/string_view:673:5: note: candidate: 'template<class _CharT, class _Traits> constexpr bool std::operator<(basic_string_view<_CharT, _Traits>, basic_string_view<_CharT, _Traits>)' 673 | operator< (basic_string_view<_CharT, _Traits> __x, | ^~~~~~~~ /usr/include/c++/14/string_view:673:5: note: template argument deduction/substitution failed: a.cc:18:11: note: 'std::basic_ostream<char>' is not derived from 'std::basic_string_view<_CharT, _Traits>' 18 | else cout<"No"; | ^~~~ /usr/include/c++/14/string_view:680:5: note: candidate: 'template<class _CharT, class _Traits> constexpr bool std::operator<(basic_string_view<_CharT, _Traits>, __type_identity_t<basic_string_view<_CharT, _Traits> >)' 680 | operator< (basic_string_view<_CharT, _Traits> __x, | ^~~~~~~~ /usr/include/c++/14/string_view:680:5: note: template argument deduction/substitution failed: a.cc:18:11: note: 'std::basic_ostream<char>' is not derived from 'std::basic_string_view<_CharT, _Traits>' 18 | else cout<"No"; | ^~~~ /usr/include/c++/14/string_view:688:5: note: candidate: 'template<class _CharT, class _Traits> constexpr bool std::operator<(__type_identity_t<basic_string_view<_CharT, _Traits> >, basic_string_view<_CharT, _Traits>)' 688 | operator< (__type_identity_t<basic_string_view<_CharT, _Traits>> __x, | ^~~~~~~~ /usr/include/c++/14/string_view:688:5: note: template argument deduction/substitution failed: a.cc:18:11: note: mismatched types 'std::basic_string_view<_CharT, _Traits>' and 'const char*' 18 | else cout<"No"; | ^~~~ /usr/include/c++/14/bits/basic_string.h:3874:5: note: candidate: 'template<class _CharT, class _Traits, class _Alloc> bool std::operator<(const __cxx11::basic_string<_CharT, _Traits, _Allocator>&, const __cxx11::basic_string<_CharT, _Traits, _Allocator>&)' 3874 | operator<(const basic_string<_CharT, _Traits, _Alloc>& __lhs, | ^~~~~~~~ /usr/include/c++/14/bits/basic_string.h:3874:5: note: template argument deduction/substitution failed: a.cc:18:11: note: 'std::ostream' {aka 'std::basic_ostream<char>'} is not derived from 'const std::__cxx11::basic_string<_CharT, _Traits, _Allocator>' 18 | else cout<"No"; | ^~~~ /usr/include/c++/14/bits/basic_string.h:3888:5: note: candidate: 'template<class _CharT, class _Traits, class _Alloc> bool std::operator<(const __cxx11::basic_string<_CharT, _Traits, _Allocator
s548539938
p03637
C++
#include <bits/stdc++.h> using namespace std; int main() { int t; cin>>t; int k=t; int d=0; while(t--){ int tg; cin>>tg; if(tg%4==0) d+=2; else if(tg%2==0) d++; } if(d>=k) cout<<"Yes"; else cout<"No"; }
a.cc: In function 'int main()': a.cc:18:10: error: no match for 'operator<' (operand types are 'std::ostream' {aka 'std::basic_ostream<char>'} and 'const char [3]') 18 | else cout<"No"; | ~~~~^~~~~ | | | | | const char [3] | std::ostream {aka std::basic_ostream<char>} In file included from /usr/include/c++/14/regex:68, from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:181, from a.cc:1: /usr/include/c++/14/bits/regex.h:1143:5: note: candidate: 'template<class _BiIter> bool std::__cxx11::operator<(const sub_match<_BiIter>&, const sub_match<_BiIter>&)' 1143 | operator<(const sub_match<_BiIter>& __lhs, const sub_match<_BiIter>& __rhs) | ^~~~~~~~ /usr/include/c++/14/bits/regex.h:1143:5: note: template argument deduction/substitution failed: a.cc:18:11: note: 'std::ostream' {aka 'std::basic_ostream<char>'} is not derived from 'const std::__cxx11::sub_match<_BiIter>' 18 | else cout<"No"; | ^~~~ /usr/include/c++/14/bits/regex.h:1224:5: note: candidate: 'template<class _Bi_iter, class _Ch_traits, class _Ch_alloc> bool std::__cxx11::operator<(__sub_match_string<_Bi_iter, _Ch_traits, _Ch_alloc>&, const sub_match<_BiIter>&)' 1224 | operator<(const __sub_match_string<_Bi_iter, _Ch_traits, _Ch_alloc>& __lhs, | ^~~~~~~~ /usr/include/c++/14/bits/regex.h:1224:5: note: template argument deduction/substitution failed: a.cc:18:11: note: 'std::ostream' {aka 'std::basic_ostream<char>'} is not derived from 'std::__cxx11::__sub_match_string<_Bi_iter, _Ch_traits, _Ch_alloc>' 18 | else cout<"No"; | ^~~~ /usr/include/c++/14/bits/regex.h:1317:5: note: candidate: 'template<class _Bi_iter, class _Ch_traits, class _Ch_alloc> bool std::__cxx11::operator<(const sub_match<_BiIter>&, __sub_match_string<_Bi_iter, _Ch_traits, _Ch_alloc>&)' 1317 | operator<(const sub_match<_Bi_iter>& __lhs, | ^~~~~~~~ /usr/include/c++/14/bits/regex.h:1317:5: note: template argument deduction/substitution failed: a.cc:18:11: note: 'std::ostream' {aka 'std::basic_ostream<char>'} is not derived from 'const std::__cxx11::sub_match<_BiIter>' 18 | else cout<"No"; | ^~~~ /usr/include/c++/14/bits/regex.h:1391:5: note: candidate: 'template<class _Bi_iter> bool std::__cxx11::operator<(const typename std::iterator_traits<_Iter>::value_type*, const sub_match<_BiIter>&)' 1391 | operator<(typename iterator_traits<_Bi_iter>::value_type const* __lhs, | ^~~~~~~~ /usr/include/c++/14/bits/regex.h:1391:5: note: template argument deduction/substitution failed: a.cc:18:11: note: mismatched types 'const std::__cxx11::sub_match<_BiIter>' and 'const char [3]' 18 | else cout<"No"; | ^~~~ /usr/include/c++/14/bits/regex.h:1485:5: note: candidate: 'template<class _Bi_iter> bool std::__cxx11::operator<(const sub_match<_BiIter>&, const typename std::iterator_traits<_Iter>::value_type*)' 1485 | operator<(const sub_match<_Bi_iter>& __lhs, | ^~~~~~~~ /usr/include/c++/14/bits/regex.h:1485:5: note: template argument deduction/substitution failed: a.cc:18:11: note: 'std::ostream' {aka 'std::basic_ostream<char>'} is not derived from 'const std::__cxx11::sub_match<_BiIter>' 18 | else cout<"No"; | ^~~~ /usr/include/c++/14/bits/regex.h:1560:5: note: candidate: 'template<class _Bi_iter> bool std::__cxx11::operator<(const typename std::iterator_traits<_Iter>::value_type&, const sub_match<_BiIter>&)' 1560 | operator<(typename iterator_traits<_Bi_iter>::value_type const& __lhs, | ^~~~~~~~ /usr/include/c++/14/bits/regex.h:1560:5: note: template argument deduction/substitution failed: a.cc:18:11: note: mismatched types 'const std::__cxx11::sub_match<_BiIter>' and 'const char [3]' 18 | else cout<"No"; | ^~~~ /usr/include/c++/14/bits/regex.h:1660:5: note: candidate: 'template<class _Bi_iter> bool std::__cxx11::operator<(const sub_match<_BiIter>&, const typename std::iterator_traits<_Iter>::value_type&)' 1660 | operator<(const sub_match<_Bi_iter>& __lhs, | ^~~~~~~~ /usr/include/c++/14/bits/regex.h:1660:5: note: template argument deduction/substitution failed: a.cc:18:11: note: 'std::ostream' {aka 'std::basic_ostream<char>'} is not derived from 'const std::__cxx11::sub_match<_BiIter>' 18 | else cout<"No"; | ^~~~ In file included from /usr/include/c++/14/bits/stl_algobase.h:64, from /usr/include/c++/14/algorithm:60, from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:51: /usr/include/c++/14/bits/stl_pair.h:1045:5: note: candidate: 'template<class _T1, class _T2> constexpr bool std::operator<(const pair<_T1, _T2>&, const pair<_T1, _T2>&)' 1045 | operator<(const pair<_T1, _T2>& __x, const pair<_T1, _T2>& __y) | ^~~~~~~~ /usr/include/c++/14/bits/stl_pair.h:1045:5: note: template argument deduction/substitution failed: a.cc:18:11: note: 'std::ostream' {aka 'std::basic_ostream<char>'} is not derived from 'const std::pair<_T1, _T2>' 18 | else cout<"No"; | ^~~~ In file included from /usr/include/c++/14/bits/stl_algobase.h:67: /usr/include/c++/14/bits/stl_iterator.h:448:5: note: candidate: 'template<class _Iterator> constexpr bool std::operator<(const reverse_iterator<_Iterator>&, const reverse_iterator<_Iterator>&)' 448 | operator<(const reverse_iterator<_Iterator>& __x, | ^~~~~~~~ /usr/include/c++/14/bits/stl_iterator.h:448:5: note: template argument deduction/substitution failed: a.cc:18:11: note: 'std::ostream' {aka 'std::basic_ostream<char>'} is not derived from 'const std::reverse_iterator<_Iterator>' 18 | else cout<"No"; | ^~~~ /usr/include/c++/14/bits/stl_iterator.h:493:5: note: candidate: 'template<class _IteratorL, class _IteratorR> constexpr bool std::operator<(const reverse_iterator<_Iterator>&, const reverse_iterator<_IteratorR>&)' 493 | operator<(const reverse_iterator<_IteratorL>& __x, | ^~~~~~~~ /usr/include/c++/14/bits/stl_iterator.h:493:5: note: template argument deduction/substitution failed: a.cc:18:11: note: 'std::ostream' {aka 'std::basic_ostream<char>'} is not derived from 'const std::reverse_iterator<_Iterator>' 18 | else cout<"No"; | ^~~~ /usr/include/c++/14/bits/stl_iterator.h:1694:5: note: candidate: 'template<class _IteratorL, class _IteratorR> constexpr bool std::operator<(const move_iterator<_IteratorL>&, const move_iterator<_IteratorR>&)' 1694 | operator<(const move_iterator<_IteratorL>& __x, | ^~~~~~~~ /usr/include/c++/14/bits/stl_iterator.h:1694:5: note: template argument deduction/substitution failed: a.cc:18:11: note: 'std::ostream' {aka 'std::basic_ostream<char>'} is not derived from 'const std::move_iterator<_IteratorL>' 18 | else cout<"No"; | ^~~~ /usr/include/c++/14/bits/stl_iterator.h:1760:5: note: candidate: 'template<class _Iterator> constexpr bool std::operator<(const move_iterator<_IteratorL>&, const move_iterator<_IteratorL>&)' 1760 | operator<(const move_iterator<_Iterator>& __x, | ^~~~~~~~ /usr/include/c++/14/bits/stl_iterator.h:1760:5: note: template argument deduction/substitution failed: a.cc:18:11: note: 'std::ostream' {aka 'std::basic_ostream<char>'} is not derived from 'const std::move_iterator<_IteratorL>' 18 | else cout<"No"; | ^~~~ In file included from /usr/include/c++/14/bits/basic_string.h:47, from /usr/include/c++/14/string:54, from /usr/include/c++/14/bitset:52, from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:52: /usr/include/c++/14/string_view:673:5: note: candidate: 'template<class _CharT, class _Traits> constexpr bool std::operator<(basic_string_view<_CharT, _Traits>, basic_string_view<_CharT, _Traits>)' 673 | operator< (basic_string_view<_CharT, _Traits> __x, | ^~~~~~~~ /usr/include/c++/14/string_view:673:5: note: template argument deduction/substitution failed: a.cc:18:11: note: 'std::basic_ostream<char>' is not derived from 'std::basic_string_view<_CharT, _Traits>' 18 | else cout<"No"; | ^~~~ /usr/include/c++/14/string_view:680:5: note: candidate: 'template<class _CharT, class _Traits> constexpr bool std::operator<(basic_string_view<_CharT, _Traits>, __type_identity_t<basic_string_view<_CharT, _Traits> >)' 680 | operator< (basic_string_view<_CharT, _Traits> __x, | ^~~~~~~~ /usr/include/c++/14/string_view:680:5: note: template argument deduction/substitution failed: a.cc:18:11: note: 'std::basic_ostream<char>' is not derived from 'std::basic_string_view<_CharT, _Traits>' 18 | else cout<"No"; | ^~~~ /usr/include/c++/14/string_view:688:5: note: candidate: 'template<class _CharT, class _Traits> constexpr bool std::operator<(__type_identity_t<basic_string_view<_CharT, _Traits> >, basic_string_view<_CharT, _Traits>)' 688 | operator< (__type_identity_t<basic_string_view<_CharT, _Traits>> __x, | ^~~~~~~~ /usr/include/c++/14/string_view:688:5: note: template argument deduction/substitution failed: a.cc:18:11: note: mismatched types 'std::basic_string_view<_CharT, _Traits>' and 'const char*' 18 | else cout<"No"; | ^~~~ /usr/include/c++/14/bits/basic_string.h:3874:5: note: candidate: 'template<class _CharT, class _Traits, class _Alloc> bool std::operator<(const __cxx11::basic_string<_CharT, _Traits, _Allocator>&, const __cxx11::basic_string<_CharT, _Traits, _Allocator>&)' 3874 | operator<(const basic_string<_CharT, _Traits, _Alloc>& __lhs, | ^~~~~~~~ /usr/include/c++/14/bits/basic_string.h:3874:5: note: template argument deduction/substitution failed: a.cc:18:11: note: 'std::ostream' {aka 'std::basic_ostream<char>'} is not derived from 'const std::__cxx11::basic_string<_CharT, _Traits, _Allocator>' 18 | else cout<"No"; | ^~~~ /usr/include/c++/14/bits/basic_string.h:3888:5: note: candidate: 'template<class _CharT, class _Traits, class _Alloc> bool std::operator<(const __cxx11::basic_string<_CharT, _Traits, _Allocator
s289154451
p03637
C++
#include <bits/stdc++.h> using namespace std; int main() { int t; cin>>t; int k=t; int d=0; while(t--){ int tg; cin>>tg; if(tg%4==0) d+=2; else if(tg%2==0) d++; } if(d>=k) cout<<"Yes"; else cout<"No"; }
a.cc: In function 'int main()': a.cc:18:10: error: no match for 'operator<' (operand types are 'std::ostream' {aka 'std::basic_ostream<char>'} and 'const char [3]') 18 | else cout<"No"; | ~~~~^~~~~ | | | | | const char [3] | std::ostream {aka std::basic_ostream<char>} In file included from /usr/include/c++/14/regex:68, from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:181, from a.cc:1: /usr/include/c++/14/bits/regex.h:1143:5: note: candidate: 'template<class _BiIter> bool std::__cxx11::operator<(const sub_match<_BiIter>&, const sub_match<_BiIter>&)' 1143 | operator<(const sub_match<_BiIter>& __lhs, const sub_match<_BiIter>& __rhs) | ^~~~~~~~ /usr/include/c++/14/bits/regex.h:1143:5: note: template argument deduction/substitution failed: a.cc:18:11: note: 'std::ostream' {aka 'std::basic_ostream<char>'} is not derived from 'const std::__cxx11::sub_match<_BiIter>' 18 | else cout<"No"; | ^~~~ /usr/include/c++/14/bits/regex.h:1224:5: note: candidate: 'template<class _Bi_iter, class _Ch_traits, class _Ch_alloc> bool std::__cxx11::operator<(__sub_match_string<_Bi_iter, _Ch_traits, _Ch_alloc>&, const sub_match<_BiIter>&)' 1224 | operator<(const __sub_match_string<_Bi_iter, _Ch_traits, _Ch_alloc>& __lhs, | ^~~~~~~~ /usr/include/c++/14/bits/regex.h:1224:5: note: template argument deduction/substitution failed: a.cc:18:11: note: 'std::ostream' {aka 'std::basic_ostream<char>'} is not derived from 'std::__cxx11::__sub_match_string<_Bi_iter, _Ch_traits, _Ch_alloc>' 18 | else cout<"No"; | ^~~~ /usr/include/c++/14/bits/regex.h:1317:5: note: candidate: 'template<class _Bi_iter, class _Ch_traits, class _Ch_alloc> bool std::__cxx11::operator<(const sub_match<_BiIter>&, __sub_match_string<_Bi_iter, _Ch_traits, _Ch_alloc>&)' 1317 | operator<(const sub_match<_Bi_iter>& __lhs, | ^~~~~~~~ /usr/include/c++/14/bits/regex.h:1317:5: note: template argument deduction/substitution failed: a.cc:18:11: note: 'std::ostream' {aka 'std::basic_ostream<char>'} is not derived from 'const std::__cxx11::sub_match<_BiIter>' 18 | else cout<"No"; | ^~~~ /usr/include/c++/14/bits/regex.h:1391:5: note: candidate: 'template<class _Bi_iter> bool std::__cxx11::operator<(const typename std::iterator_traits<_Iter>::value_type*, const sub_match<_BiIter>&)' 1391 | operator<(typename iterator_traits<_Bi_iter>::value_type const* __lhs, | ^~~~~~~~ /usr/include/c++/14/bits/regex.h:1391:5: note: template argument deduction/substitution failed: a.cc:18:11: note: mismatched types 'const std::__cxx11::sub_match<_BiIter>' and 'const char [3]' 18 | else cout<"No"; | ^~~~ /usr/include/c++/14/bits/regex.h:1485:5: note: candidate: 'template<class _Bi_iter> bool std::__cxx11::operator<(const sub_match<_BiIter>&, const typename std::iterator_traits<_Iter>::value_type*)' 1485 | operator<(const sub_match<_Bi_iter>& __lhs, | ^~~~~~~~ /usr/include/c++/14/bits/regex.h:1485:5: note: template argument deduction/substitution failed: a.cc:18:11: note: 'std::ostream' {aka 'std::basic_ostream<char>'} is not derived from 'const std::__cxx11::sub_match<_BiIter>' 18 | else cout<"No"; | ^~~~ /usr/include/c++/14/bits/regex.h:1560:5: note: candidate: 'template<class _Bi_iter> bool std::__cxx11::operator<(const typename std::iterator_traits<_Iter>::value_type&, const sub_match<_BiIter>&)' 1560 | operator<(typename iterator_traits<_Bi_iter>::value_type const& __lhs, | ^~~~~~~~ /usr/include/c++/14/bits/regex.h:1560:5: note: template argument deduction/substitution failed: a.cc:18:11: note: mismatched types 'const std::__cxx11::sub_match<_BiIter>' and 'const char [3]' 18 | else cout<"No"; | ^~~~ /usr/include/c++/14/bits/regex.h:1660:5: note: candidate: 'template<class _Bi_iter> bool std::__cxx11::operator<(const sub_match<_BiIter>&, const typename std::iterator_traits<_Iter>::value_type&)' 1660 | operator<(const sub_match<_Bi_iter>& __lhs, | ^~~~~~~~ /usr/include/c++/14/bits/regex.h:1660:5: note: template argument deduction/substitution failed: a.cc:18:11: note: 'std::ostream' {aka 'std::basic_ostream<char>'} is not derived from 'const std::__cxx11::sub_match<_BiIter>' 18 | else cout<"No"; | ^~~~ In file included from /usr/include/c++/14/bits/stl_algobase.h:64, from /usr/include/c++/14/algorithm:60, from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:51: /usr/include/c++/14/bits/stl_pair.h:1045:5: note: candidate: 'template<class _T1, class _T2> constexpr bool std::operator<(const pair<_T1, _T2>&, const pair<_T1, _T2>&)' 1045 | operator<(const pair<_T1, _T2>& __x, const pair<_T1, _T2>& __y) | ^~~~~~~~ /usr/include/c++/14/bits/stl_pair.h:1045:5: note: template argument deduction/substitution failed: a.cc:18:11: note: 'std::ostream' {aka 'std::basic_ostream<char>'} is not derived from 'const std::pair<_T1, _T2>' 18 | else cout<"No"; | ^~~~ In file included from /usr/include/c++/14/bits/stl_algobase.h:67: /usr/include/c++/14/bits/stl_iterator.h:448:5: note: candidate: 'template<class _Iterator> constexpr bool std::operator<(const reverse_iterator<_Iterator>&, const reverse_iterator<_Iterator>&)' 448 | operator<(const reverse_iterator<_Iterator>& __x, | ^~~~~~~~ /usr/include/c++/14/bits/stl_iterator.h:448:5: note: template argument deduction/substitution failed: a.cc:18:11: note: 'std::ostream' {aka 'std::basic_ostream<char>'} is not derived from 'const std::reverse_iterator<_Iterator>' 18 | else cout<"No"; | ^~~~ /usr/include/c++/14/bits/stl_iterator.h:493:5: note: candidate: 'template<class _IteratorL, class _IteratorR> constexpr bool std::operator<(const reverse_iterator<_Iterator>&, const reverse_iterator<_IteratorR>&)' 493 | operator<(const reverse_iterator<_IteratorL>& __x, | ^~~~~~~~ /usr/include/c++/14/bits/stl_iterator.h:493:5: note: template argument deduction/substitution failed: a.cc:18:11: note: 'std::ostream' {aka 'std::basic_ostream<char>'} is not derived from 'const std::reverse_iterator<_Iterator>' 18 | else cout<"No"; | ^~~~ /usr/include/c++/14/bits/stl_iterator.h:1694:5: note: candidate: 'template<class _IteratorL, class _IteratorR> constexpr bool std::operator<(const move_iterator<_IteratorL>&, const move_iterator<_IteratorR>&)' 1694 | operator<(const move_iterator<_IteratorL>& __x, | ^~~~~~~~ /usr/include/c++/14/bits/stl_iterator.h:1694:5: note: template argument deduction/substitution failed: a.cc:18:11: note: 'std::ostream' {aka 'std::basic_ostream<char>'} is not derived from 'const std::move_iterator<_IteratorL>' 18 | else cout<"No"; | ^~~~ /usr/include/c++/14/bits/stl_iterator.h:1760:5: note: candidate: 'template<class _Iterator> constexpr bool std::operator<(const move_iterator<_IteratorL>&, const move_iterator<_IteratorL>&)' 1760 | operator<(const move_iterator<_Iterator>& __x, | ^~~~~~~~ /usr/include/c++/14/bits/stl_iterator.h:1760:5: note: template argument deduction/substitution failed: a.cc:18:11: note: 'std::ostream' {aka 'std::basic_ostream<char>'} is not derived from 'const std::move_iterator<_IteratorL>' 18 | else cout<"No"; | ^~~~ In file included from /usr/include/c++/14/bits/basic_string.h:47, from /usr/include/c++/14/string:54, from /usr/include/c++/14/bitset:52, from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:52: /usr/include/c++/14/string_view:673:5: note: candidate: 'template<class _CharT, class _Traits> constexpr bool std::operator<(basic_string_view<_CharT, _Traits>, basic_string_view<_CharT, _Traits>)' 673 | operator< (basic_string_view<_CharT, _Traits> __x, | ^~~~~~~~ /usr/include/c++/14/string_view:673:5: note: template argument deduction/substitution failed: a.cc:18:11: note: 'std::basic_ostream<char>' is not derived from 'std::basic_string_view<_CharT, _Traits>' 18 | else cout<"No"; | ^~~~ /usr/include/c++/14/string_view:680:5: note: candidate: 'template<class _CharT, class _Traits> constexpr bool std::operator<(basic_string_view<_CharT, _Traits>, __type_identity_t<basic_string_view<_CharT, _Traits> >)' 680 | operator< (basic_string_view<_CharT, _Traits> __x, | ^~~~~~~~ /usr/include/c++/14/string_view:680:5: note: template argument deduction/substitution failed: a.cc:18:11: note: 'std::basic_ostream<char>' is not derived from 'std::basic_string_view<_CharT, _Traits>' 18 | else cout<"No"; | ^~~~ /usr/include/c++/14/string_view:688:5: note: candidate: 'template<class _CharT, class _Traits> constexpr bool std::operator<(__type_identity_t<basic_string_view<_CharT, _Traits> >, basic_string_view<_CharT, _Traits>)' 688 | operator< (__type_identity_t<basic_string_view<_CharT, _Traits>> __x, | ^~~~~~~~ /usr/include/c++/14/string_view:688:5: note: template argument deduction/substitution failed: a.cc:18:11: note: mismatched types 'std::basic_string_view<_CharT, _Traits>' and 'const char*' 18 | else cout<"No"; | ^~~~ /usr/include/c++/14/bits/basic_string.h:3874:5: note: candidate: 'template<class _CharT, class _Traits, class _Alloc> bool std::operator<(const __cxx11::basic_string<_CharT, _Traits, _Allocator>&, const __cxx11::basic_string<_CharT, _Traits, _Allocator>&)' 3874 | operator<(const basic_string<_CharT, _Traits, _Alloc>& __lhs, | ^~~~~~~~ /usr/include/c++/14/bits/basic_string.h:3874:5: note: template argument deduction/substitution failed: a.cc:18:11: note: 'std::ostream' {aka 'std::basic_ostream<char>'} is not derived from 'const std::__cxx11::basic_string<_CharT, _Traits, _Allocator>' 18 | else cout<"No"; | ^~~~ /usr/include/c++/14/bits/basic_string.h:3888:5: note: candidate: 'template<class _CharT, class _Traits, class _Alloc> bool std::operator<(const __cxx11::basic_string<_CharT, _Traits, _Allocator
s054821178
p03637
C++
#include <bits/stdc++.h> using namespace std; #define rep(i,n) for(int i=0;i<n;i++) #define ll long long int int sage(int n){ if(n%2==1){ return n/2+1; }else { return n/2; } } int main(){ int n; cin>>n; ll a[n]; int count2=0,count4=0; rep(i,n){ cin>>a[i]; if(a[i]%4==0){ count4++; } else if(a[i]%2==0){ count2++; } } if(count2>1&&sage(n-count2-count4)<=count4){ cout<<"Yes"<<endl; }else if(count<=1&&sage(n-count4)<=count4){ cout<<"Yes"<<endl; } else { cout<<"No"<<endl; } return 0; }
a.cc: In function 'int main()': a.cc:34:15: error: invalid operands of types '<unresolved overloaded function type>' and 'int' to binary 'operator<=' 34 | }else if(count<=1&&sage(n-count4)<=count4){ | ~~~~~^~~
s300978567
p03637
C++
using namespace std; #define all(v) v.begin(), v.end() #define rep(i, n) for (int i = 0; i < n; i++) typedef long long ll; int main() { int n; cin >> n; ll cnt1 = 0, cnt2 = 0; for(int i = 0; i < n; i++){ ll a; cin >> a; if(a % 4 == 0) cnt1++; if(a % 2 == 0) cnt2++; } if(cnt1 == 0){ if(cnt2 == n){ cout << "Yes" << endl; }else{ cout << "No" << endl; } }else if((n % 2 == 1 && cnt1 % 2 == 1) || (n % 2 == 0 && cnt1 % 2 == 0)){ cout << "Yes" << endl; }else{ cout << "No" << endl; } }
a.cc: In function 'int main()': a.cc:8:12: error: 'cin' was not declared in this scope 8 | int n; cin >> n; | ^~~ 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:17:13: error: 'cout' was not declared in this scope 17 | cout << "Yes" << endl; | ^~~~ a.cc:17:13: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>' a.cc:17:30: error: 'endl' was not declared in this scope 17 | cout << "Yes" << 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; a.cc:19:13: error: 'cout' was not declared in this scope 19 | cout << "No" << endl; | ^~~~ a.cc:19:13: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>' a.cc:19:29: error: 'endl' was not declared in this scope 19 | cout << "No" << endl; | ^~~~ a.cc:19:29: note: 'std::endl' is defined in header '<ostream>'; this is probably fixable by adding '#include <ostream>' a.cc:22:9: error: 'cout' was not declared in this scope 22 | cout << "Yes" << endl; | ^~~~ a.cc:22:9: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>' a.cc:22:26: error: 'endl' was not declared in this scope 22 | cout << "Yes" << endl; | ^~~~ a.cc:22:26: note: 'std::endl' is defined in header '<ostream>'; this is probably fixable by adding '#include <ostream>' a.cc:24:9: error: 'cout' was not declared in this scope 24 | cout << "No" << endl; | ^~~~ a.cc:24:9: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>' a.cc:24:25: error: 'endl' was not declared in this scope 24 | cout << "No" << endl; | ^~~~ a.cc:24:25: note: 'std::endl' is defined in header '<ostream>'; this is probably fixable by adding '#include <ostream>'
s795350080
p03637
C++
#include<bits/stdc++.h> using namespace std; int main(){ int N; cin>>N; vector<int>A(N); for(int j=0;j<N;j++){ int x; cin>>x; int sum=0; for(int i=0; ;i++){ if(x%2==0){ x/=2; sum++; }else break; if(sum==2) break; }A.at(i)=sum; }int a1=0; int a2=0; for(int i=0;i<N;i++){ if(A.at(i)==1) a1++; if(A.at(i)==2) a2++; }if(3*a2+a1-1<N) cout<<"No"<<endl; else cout<<"Yes"<<endl; return 0; }
a.cc: In function 'int main()': a.cc:18:11: error: 'i' was not declared in this scope 18 | }A.at(i)=sum; | ^
s858632963
p03637
C++
#include<bits/stdc++.h> using namespace std; int main(){ int N; cin>>N; vector<int>A(N){ int x; cin>>x; int sum=0; for(int i=0; ;i++){ if(x%2==0){ x/=2; sum++; }else break; if(sum==2) break; }A.at(i)=sum; }int a1=0; int a2=0; for(int i=0;i<N;i++){ if(A.at(i)==1) a1++; if(A.at(i)==2) a2++; }if(3*a2+a1-1<N) cout<<"No"<<endl; else cout<<"Yes"<<endl; return 0; }
a.cc: In function 'int main()': a.cc:6:18: error: expected ',' or ';' before '{' token 6 | vector<int>A(N){ | ^
s196231256
p03637
C++
n = int(input()) a = list(map(int, input().split())) odd_cnt = 0 multi_4 = 0 for i in range(n): if a[i] % 4 == 0: multi_4 += 1 elif a[i] % 2 == 1: odd_cnt += 1 if multi_4 + odd_cnt == n: print("Yes" if multi_4 >= odd_cnt - 1 else "No") else: print("Yes" if multi_4 >= odd_cnt else "No")
a.cc:1:1: error: 'n' does not name a type 1 | n = int(input()) | ^
s298270197
p03637
C++
#include <iostream> #include <cstdio> #include <string> #include <cmath> #include <cctype> #include <cstdlib> #include <stack> #include <queue> #include <vector> #include <algorithm> #include <list> #include <map> #include <set> using namespace std; long long skb(long long i, long long j) { int n, a, x = 0, y = 0; cin >> n; for (int i = 0; i < n; i++) { if (a % 4 == 0) x++; else if (a % 2 != 0) y++; } if (y == x + 1 && x + y == n || x >= y) cout << "Yes" << endl; else cout << "No" << endl; }
a.cc: In function 'long long int skb(long long int, long long int)': a.cc:25:1: warning: no return statement in function returning non-void [-Wreturn-type] 25 | } | ^ /usr/bin/ld: /usr/lib/gcc/x86_64-linux-gnu/14/../../../x86_64-linux-gnu/Scrt1.o: in function `_start': (.text+0x17): undefined reference to `main' collect2: error: ld returned 1 exit status
s886894098
p03637
C++
#include <bits/stdc++.h> using namespace std; int main(int argc, char *argv[]) { int N; cin >> N; int even = 0; int four = 0; for (int i = 0; i < N; i++) { int cur; cin >> cur; if (cur % 2 == 0 && cur % 4 != 0) even++; if (cur % 4 == 0) four++; } int sum = four * 3 + ((cur / 2) * 2); cout << ((sum >= N) ? "YES" : "NO") << endl; return 0; }
a.cc: In function 'int main(int, char**)': a.cc:17:28: error: 'cur' was not declared in this scope 17 | int sum = four * 3 + ((cur / 2) * 2); | ^~~
s455906916
p03637
C++
#include <bits/stdc++.h> using namespace std; #define int long long signed main(){ int N; cin >> N; int c2 = 0, c4 = 0; for(int i = 0; i < N; i++){ int a; cin >> a; if(a % 4 == 0) c4++; else if(a % 2 == 0) c2++; } if(c2 == 0) len = 2 * c4 + 1; else len = 2 * c4 + c2; if(len >= N) cout << "Yes" << endl; else cout << "No" << endl; }
a.cc: In function 'int main()': a.cc:13:17: error: 'len' was not declared in this scope 13 | if(c2 == 0) len = 2 * c4 + 1; | ^~~ a.cc:14:10: error: 'len' was not declared in this scope 14 | else len = 2 * c4 + c2; | ^~~ a.cc:15:8: error: 'len' was not declared in this scope 15 | if(len >= N) cout << "Yes" << endl; | ^~~
s180852302
p03637
C++
#include<iostream> #include<vector> #include<map> #include<string> #include<cstdio> #include<cmath> #include<algorithm> using namespace std; #define rep(i,x,n) for(int i=x;i<n;i++) using ll=long long; int n; vector<ll> T(100); ll gcl(ll x,ll y){ if(x<y) swap(x,y); while(y>0){ ll t=x%y; x=y; y=t; } return x; } int main(){ cin>>n; int count0=0,count2=0,count4=0; rep(i,0,n){ int a;cin>>a; if(a%2==1) count0++; if(a%4==0) count4++; if(a%4==2) count2++; } if(count0<=count4||(n%2==1&&count4=n/2&&count2==n/2+1)) cout<<"Yes"<<endl; else cout<<"No"<<endl; }
a.cc: In function 'int main()': a.cc:34:31: error: lvalue required as left operand of assignment 34 | if(count0<=count4||(n%2==1&&count4=n/2&&count2==n/2+1)) cout<<"Yes"<<endl; | ~~~~~~^~~~~~~~
s239775672
p03637
C++
#include <bits/stdc++.h> using namespace std; typedef long long ll; #define rep(i, n) for(ll i = 0; i < (ll)(n); i++) #define rep2(i, a, n) for(ll i = a; i < (ll)(n); i++) #define memi cout << endl #define kono(n) cout << fixed << setprecision(n) #define all(c) (c).begin(), (c).end() #define pb push_back #define hina cout << ' ' #define in(n) cin >> n #define in2(n, m) cin >> n >> m #define in3(n, m, l) cin >> n >> m >> l #define out(n) cout << n const ll mei = (ll)1e9 + 7; int main(){ ll n, a, b, d; in(n); vector<ll> c(n); rep(i, n); in(c[i]); rep(i, n){ if(c[i] % 4 == 0) c[i] = 2; else if(c[i] % 2 == 0) c[i] = 1; else c[i] = 0; } a = b = 0; rep(i, n){ if(c[i] == 0) a++; if(c[i] == 2) b++; } if(a > b) out("No"); else out("Yes"); memi; }
a.cc: In function 'int main()': a.cc:22:10: error: 'i' was not declared in this scope 22 | in(c[i]); | ^ a.cc:11:22: note: in definition of macro 'in' 11 | #define in(n) cin >> n | ^
s986690515
p03637
C++
#include <bits/stdc++.h> using namespace std; typedef long long ll; #define rep(i, n) for(ll i = 0; i < (ll)(n); i++) #define rep2(i, a, n) for(ll i = a; i < (ll)(n); i++) #define memi cout << endl #define kono(n) cout << fixed << setprecision(n) #define all(c) (c).begin(), (c).end() #define pb push_back #define hina cout << ' ' #define in(n) cin >> n #define in2(n, m) cin >> n >> m #define in3(n, m, l) cin >> n >> m >> l #define out(n) cout << n const ll mei = (ll)1e9 + 7; int main(){ ll n, a, b, d; in(n); vector<ll> c(n); in(c[i]); rep(i, n){ if(c[i] % 4 == 0) c[i] = 2; else if(c[i] % 2 == 0) c[i] = 1; else c[i] = 0; } a = b = 0; rep(i, n){ if(c[i] == 0) a++; if(c[i] == 2) b++; } if(a > b) out("No"); else out("Yes"); memi; }
a.cc: In function 'int main()': a.cc:21:8: error: 'i' was not declared in this scope 21 | in(c[i]); | ^ a.cc:11:22: note: in definition of macro 'in' 11 | #define in(n) cin >> n | ^
s673860441
p03637
C++
#include <bits/stdc++.h> using namespace std; int main() { int N; int a[100001]; cin >>N; double counteven2=0; double counteven4=0; for(int i=0;i<N;i++){ cin>>a[i]; if(a[i]%4==0){ counteven4+=3.0; }else if(a[i]%2==0){ counteven2++; } } if(counteven4>=N||N-counteven4<=counteven2||){ cout<<"Yes"; }else cout<<"No"; return 0; }
a.cc: In function 'int main()': a.cc:18:49: error: expected primary-expression before ')' token 18 | if(counteven4>=N||N-counteven4<=counteven2||){ | ^
s534666019
p03637
C++
#include<bits/stdc++.h> using namespace std; #define ll long long #define endl '\n' #define FASTINOUT ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL); const ll mod = 1000000007; const double PI = 3.141592653589793238463; const int N=4e5+100; int a[4]; int main() { FASTINOUT; int x; cin>>x; int y[x]; for (int i=0;i<x;i++){ cin>>y[i]; a[y[i]%4]++; } cout<<(y[0]>=y[1]+y[3]-(y[2]==0))?"Yes":"No"); return 0; }
a.cc: In function 'int main()': a.cc:20:49: error: expected ';' before ')' token 20 | cout<<(y[0]>=y[1]+y[3]-(y[2]==0))?"Yes":"No"); | ^ | ;
s609089705
p03637
C++
n = int(input()) l=list(map(int ,input().split())) four=0 two=0 one=0 for i in range(n): if l[i]%2==0: if l[i]==2: two+=1 else: four+=1 elif l[i]==1: one+=1 if one>=1: if n/2>=four>=one/2: print('Yes') else: print('No') elif two==1: if n/2>=four: print('Yes') else: print('No') elif four+two>=n/2: print('Yes') else: print('No')
a.cc:17:23: warning: multi-character character constant [-Wmultichar] 17 | print('Yes') | ^~~~~ a.cc:19:23: warning: multi-character character constant [-Wmultichar] 19 | print('No') | ^~~~ a.cc:22:23: warning: multi-character character constant [-Wmultichar] 22 | print('Yes') | ^~~~~ a.cc:24:23: warning: multi-character character constant [-Wmultichar] 24 | print('No') | ^~~~ a.cc:26:15: warning: multi-character character constant [-Wmultichar] 26 | print('Yes') | ^~~~~ a.cc:28:15: warning: multi-character character constant [-Wmultichar] 28 | print('No') | ^~~~ a.cc:1:1: error: 'n' does not name a type 1 | n = int(input()) | ^
s188206140
p03637
C++
#include<bits/stdc++.h> using namespace std; const int maxn = 1e5 + 5; int x,cnt[3];//1 2 4 int main() { while(scanf("%d",&n)==1){ memset(cnt,0,sizeof cnt); for(int i=1;i<=n;i++){ scanf("%d",&x); if(x%4==0) cnt[0]++; else if(x%2==0) cnt[1]++; else cnt[2]++; } if(cnt[0]>=cnt[2]+(cnt[1]>0?1:0)) puts("Yes"); else puts("No"); } return 0; }
a.cc: In function 'int main()': a.cc:9:23: error: 'n' was not declared in this scope; did you mean 'yn'? 9 | while(scanf("%d",&n)==1){ | ^ | yn
s624446102
p03637
C++
#include<cstdio> #include<cstring> //long long const int len = 1e5 + 5; int a[len],cnt[5]; int main(void) { scanf("%d", &N); for (int i = 0; i < N; ++i) { scanf("%d", &a[i]); if (a[i] % 4 == 0) ++cnt[4]; else if (!(a[i] & 01)) ++cnt[2]; else ++ cnt[1]; } if (cnt[2] == 0 && cnt[4] >= cnt[1] - 1) printf("Yes"); else if (cnt[4] >= cnt[1]) printf("Yes"); else printf("No"); return 0; }
a.cc: In function 'int main()': a.cc:9:22: error: 'N' was not declared in this scope 9 | scanf("%d", &N); | ^
s325033218
p03637
C++
import java.util.* fun main(args: Array<String>) { val sc = Scanner(System.`in`) val n = sc.nextInt() val a = (0 until n).map { sc.next().toLong() } println(problem069c(n, a)) } fun problem069c(n: Int, a: List<Long>): String { val fours = a.filter { it % 4 == 0L } val twos = a.filter { it % 4 == 2L } val ones = a.filter { it % 2 == 1L } return if (ones.size <= fours.size) "Yes" else "No" }
a.cc:4:29: error: stray '`' in program 4 | val sc = Scanner(System.`in`) | ^ a.cc:4:32: error: stray '`' in program 4 | val sc = Scanner(System.`in`) | ^ 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:10:1: error: 'fun' does not name a type 10 | fun problem069c(n: Int, a: List<Long>): String { | ^~~
s741301535
p03637
Java
import java.util.Scanner; public class Adjacent { public static void main(String[] args) { Scanner scan = new Scanner(System.in); int n = scan.nextInt(); if (2 <= n && n <= 1.0e5) { int[] sunukenoaho = new int[n]; for (int i = 0; i < n ; i++) { sunukenoaho[i] = scan.nextInt(); } int n4 = 0; int nodd = 0; int neven = 0; for (int i = 0; i < n; i++) { if (sunukenoaho[i] % 4 == 0) { n4++; } else if(sunukenoaho[i] % 2 == 0) { neven++; } else { nodd++; } } if (neven > 0) { nodd++; } if (n4 >= nodd - 1) { System.out.println("Yes"); } else { System.out.println("No"); } } } }
Main.java:4: error: class Adjacent is public, should be declared in a file named Adjacent.java public class Adjacent { ^ 1 error
s711256879
p03637
Java
import java.util.Scanner; public class Adjacent { public static void main(String[] args) { Scanner scan = new Scanner(System.in); int n = scan.nextInt(); if (2 <= n && n <= 1.0e5) { int[] sunukenoaho = new int[n]; for (int i = 0; i < n ; i++) { sunukenoaho[i] = scan.nextInt(); sunukenoaho[i] = sunukenoaho[i] % 4; } int sum = 0; for (int i = 1; i < n; i++) { if (sunukenoaho[i] * sunukenoaho[i - 1] % 4 == 0) { sum++; } } if (sum == n - 1) { System.out.println("Yes"); } else { System.out.println("No"); } } } }
Main.java:4: error: class Adjacent is public, should be declared in a file named Adjacent.java public class Adjacent { ^ 1 error
s960758792
p03637
Java
import java.util.*; class Main public static void main(String[] args){ Scanner scan=new Scanner(System.in); int N=scan.nextInt(); int[] a=new int[N]; for(int i=0;i<N;i++){ a[i]=scan.nextInt(); } int count4=0; int count2=0; for(int i=0;i<N;i++){ if(a[i]%4==0){ count4++; } else if(a[i]%2==0){ count2++; } } if(count4>=N/2){ System.out.println("Yes"); } else if(count2>=2||count4-1==N/2){ System.out.println("Yes"); }else if(count2==N){ System.out.println("Yes"); } else{ System.out.println("No"); } } }
Main.java:2: error: '{' expected class Main ^ Main.java:3: error: unnamed classes are a preview feature and are disabled by default. public static void main(String[] args){ ^ (use --enable-preview to enable unnamed classes) Main.java:33: error: class, interface, enum, or record expected } ^ 3 errors
s517924204
p03637
C++
#include<bits/stdc++.h> using namespace std; #define fs first #define sc second #define pb push_back #define mp make_pair #define eb emplace_back #define ALL(A) A.begin(),A.end() #define RALL(A) A.rbegin(),A.rend() typedef long long ll; typedef pair<ll,ll> P; const ll mod=1000000007; const ll LINF=1LL<<60; const int INF=1<<30; int main(){ ll n,l,tmp = 0; cin >> n; ll m = n; ll flag = 0; ll count = 0; for(ll i = 0; i < n; i++) { cin >> l; if (l == 2){ count ++; } else if(l % 4 == 0){ tmp += 1; } else{ flag++; } } if (count != n && count != 0){ flag += 1 } // cout << m << endl; if (flag <= tmp + 1|| count == n){ cout << "Yes" << endl; } else{ cout << "No" << endl; } return 0; }
a.cc: In function 'int main()': a.cc:35:26: error: expected ';' before '}' token 35 | flag += 1 | ^ | ; 36 | } | ~
s576852082
p03637
C++
#include<iostream> #include<string> #include<vector> #include<algorithm> #include<bits/stdc++.h> #include<cmath> #include<bitset> #include<queue> #define ll long long #define itn int #define co(ans) cout<<ans<<endl; #define COYE cout<<"YES"<<endl; #define COYe cout<<"Yes"<<endl; #define COye cout<<"yes"<<endl; #define CONO cout<<"NO"<<endl; #define CONo cout<<"No"<<endl; #define COno cout<<"no"<<endl; #define FOR(i,a,b) for(int i=(a);i<(b);++i) #define FFOR(i,a,b) for(int i=(a);i<=(b);++i) #define REP(i,n) FOR(i,0,n) #define RREP(i,n) FFOR(i,1,n) #define SORT(V) sort((V).begin(),(V).end()) #define REVERSE(V) reverse((V).begin(),(V).end()) #define INF ((1LL<<62)-(1LL<<31)) #define MOD 1000000007 template<class T>bool chmax(T &a, const T &b) { if (a<b) { a=b; return 1; } return 0; } template<class T>bool chmin(T &a, const T &b) { if (b<a) { a=b; return 1; } return 0; } using namespace std; int main(){ ll N; cin>>N; ll A[N],L[3]; REP(i,3) L[i]=0; REP(i,N){ cin>>A[i]; if(A[i]%4==0) L[2]++; else if(A[i]%4==2) L[1]++; else L[0]++; } if(L[1]>0) L[0]++; if(L[2]>=L[0]) COYe; else CONo; }
a.cc: In function 'int main()': a.cc:47:3: error: 'else' without a previous 'if' 47 | else CONo; | ^~~~
s890937600
p03637
C++
#include<bits/stdc++.h> signed main(){ int n; cin>>n; int f = 0,t=0,o=0; for(int i=0;i<n;i++){ int k; cin>>k; if(k%4==0)f++; else if(k%2==0)t++; else o++; } if(t==0){ if(f>=o-1)cout<<"Yes"<<endl; else cout<<"No"<<endl; } else{ if(f>=o)cout<<"Yes"<<endl; else cout<<"No"<<endl; } }
a.cc: In function 'int main()': a.cc:4:5: error: 'cin' was not declared in this scope; did you mean 'std::cin'? 4 | cin>>n; | ^~~ | std::cin In file included from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:146, from a.cc:1: /usr/include/c++/14/iostream:62:18: note: 'std::cin' declared here 62 | extern istream cin; ///< Linked to standard input | ^~~ a.cc:14:19: error: 'cout' was not declared in this scope; did you mean 'std::cout'? 14 | if(f>=o-1)cout<<"Yes"<<endl; | ^~~~ | std::cout /usr/include/c++/14/iostream:63:18: note: 'std::cout' declared here 63 | extern ostream cout; ///< Linked to standard output | ^~~~ a.cc:14:32: error: 'endl' was not declared in this scope; did you mean 'std::endl'? 14 | if(f>=o-1)cout<<"Yes"<<endl; | ^~~~ | std::endl In file included from /usr/include/c++/14/istream:41, from /usr/include/c++/14/sstream:40, from /usr/include/c++/14/complex:45, from /usr/include/c++/14/ccomplex:39, from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:127: /usr/include/c++/14/ostream:744:5: note: 'std::endl' declared here 744 | endl(basic_ostream<_CharT, _Traits>& __os) | ^~~~ a.cc:15:14: error: 'cout' was not declared in this scope; did you mean 'std::cout'? 15 | else cout<<"No"<<endl; | ^~~~ | std::cout /usr/include/c++/14/iostream:63:18: note: 'std::cout' declared here 63 | extern ostream cout; ///< Linked to standard output | ^~~~ a.cc:15:26: error: 'endl' was not declared in this scope; did you mean 'std::endl'? 15 | else cout<<"No"<<endl; | ^~~~ | std::endl /usr/include/c++/14/ostream:744:5: note: 'std::endl' declared here 744 | endl(basic_ostream<_CharT, _Traits>& __os) | ^~~~ a.cc:18:17: error: 'cout' was not declared in this scope; did you mean 'std::cout'? 18 | if(f>=o)cout<<"Yes"<<endl; | ^~~~ | std::cout /usr/include/c++/14/iostream:63:18: note: 'std::cout' declared here 63 | extern ostream cout; ///< Linked to standard output | ^~~~ a.cc:18:30: error: 'endl' was not declared in this scope; did you mean 'std::endl'? 18 | if(f>=o)cout<<"Yes"<<endl; | ^~~~ | std::endl /usr/include/c++/14/ostream:744:5: note: 'std::endl' declared here 744 | endl(basic_ostream<_CharT, _Traits>& __os) | ^~~~ a.cc:19:14: error: 'cout' was not declared in this scope; did you mean 'std::cout'? 19 | else cout<<"No"<<endl; | ^~~~ | std::cout /usr/include/c++/14/iostream:63:18: note: 'std::cout' declared here 63 | extern ostream cout; ///< Linked to standard output | ^~~~ a.cc:19:26: error: 'endl' was not declared in this scope; did you mean 'std::endl'? 19 | else cout<<"No"<<endl; | ^~~~ | std::endl /usr/include/c++/14/ostream:744:5: note: 'std::endl' declared here 744 | endl(basic_ostream<_CharT, _Traits>& __os) | ^~~~
s178590030
p03637
C++
/** * author: tourist * created: 20.11.2019 08:37:52 **/ #include <bits/stdc++.h> using namespace std; int main() { ios::sync_with_stdio(false); cin.tie(0); int n; cin >> n; vector<int> a(n); for (int i = 0; i < n; i++) cin >> a[i]; int k1 = 0, k2 = 0, k4 = 0; for (int x : a[i]) if (x % 4 == 0) ++k4; else if (x % 2 == 0) ++k2; else ++k1; if (k2 == 0 && k4 >= k1 - 1 || k4 >= k1) cout << "Yes"; else cout << "No"; return 0; }
a.cc: In function 'int main()': a.cc:17:18: error: 'i' was not declared in this scope 17 | for (int x : a[i]) if (x % 4 == 0) ++k4; else if (x % 2 == 0) ++k2; else ++k1; | ^
s903926952
p03637
C++
/** * author: tourist * created: 20.11.2019 08:37:52 **/ #include <bits/stdc++.h> using namespace std; int main() { ios::sync_with_stdio(false); cin.tie(0); int n; cin >> n; vector<int> a(n); for (int i = 0; i < n; i++) cin >> a[i]; int k1 = 0, k2 = 0, k4 = 0; for (int x : a[i]) if (a[i] % 4 == 0) ++k4; else if (a[i] % 2 == 0) ++k2; else ++k1; if (k2 == 0 && k4 >= k1 - 1 || k4 >= k1) cout << "Yes"; else cout << "No"; return 0; }
a.cc: In function 'int main()': a.cc:17:18: error: 'i' was not declared in this scope 17 | for (int x : a[i]) if (a[i] % 4 == 0) ++k4; else if (a[i] % 2 == 0) ++k2; else ++k1; | ^
s221840299
p03637
C++
#include<iostream>
/usr/bin/ld: /usr/lib/gcc/x86_64-linux-gnu/14/../../../x86_64-linux-gnu/Scrt1.o: in function `_start': (.text+0x17): undefined reference to `main' collect2: error: ld returned 1 exit status
s202775701
p03637
C++
#include<iostream> #include<cstdio> #include<iomanip> #include<algorithm> #include<vector> #include<string> #include<cstring> #include<cmath> #define vint vector<int> #define vstr vector<string> #define vll vector<long long> #define ll long long #define pf printf #define sf scanf #define pft printf("\t") #define pfn printf("\n") #define pfk printf(" ") #define N 1000000007 #define PI 3.1415926 using namespace std; int main() { int n; sfd(n); int num; ll ans = 1; for( int i=0; i<n; i++ ) { sfd(num); ans *= num; } if( ans%4==0 ) { pf("Yes"); }else { pf("No"); } return 0; }
a.cc: In function 'int main()': a.cc:26:9: error: 'sfd' was not declared in this scope; did you mean 'std'? 26 | sfd(n); | ^~~ | std
s047199989
p03637
C++
#include<bits/stdc++.h> using namespace std; using ll = long long; const int INF = (int)1e7; using p = pair<int,int>; using v = vector<ll>; auto used = v(50,0); int n,m; int main(){ int n; cin >> n; auto a=v(n,0); for (int i = 0; i < n; i++) { cin >> a[i]; } ll ans4 = 0; ll ans2 = 0; for (int i = 0; i < n; i++) { if(a[i]%4==0) { ans4++; }else if(a[i]%4==2){ ans2++; } } if(ans4>=ans+ans2%2-1){ cout << "Yes"<<endl; }else{ cout << "No"<<endl; } }
a.cc: In function 'int main()': a.cc:29:13: error: 'ans' was not declared in this scope; did you mean 'ans2'? 29 | if(ans4>=ans+ans2%2-1){ | ^~~ | ans2
s623782561
p03637
C++
#include<bits/stdc++.h> int main(){ std::cout<<"Yes"<<std::endl: }
a.cc: In function 'int main()': a.cc:3:30: error: expected ';' before ':' token 3 | std::cout<<"Yes"<<std::endl: | ^ | ;
s971992182
p03637
C++
#include <bits/stdc++.h> using namespace std; typedef long long ll; // DAME: int main() { int n; cin >> n; vector<ll> a(3, 0); string ans; for(int i=0; i<n; i++){ int aa; cin >> aa; if(aa%4==0){ a[2]++; }else if(aa%4==2){ a[1]++; }else{ a[0]++; } } // 1の隣は必ず4, 2の隣は2か4 // 2がない時、1の数は4の数+1以下 1414141 if(a[1]==0){ if(a[0] <= a[2]+1){ ans = "Yes"; }else{ ans = "No"; } }else{ if(a[0] <= b[2]){ ans = "Yes"; }else{ ans = "No"; } } cout << ans << endl; return 0; }
a.cc: In function 'int main()': a.cc:36:20: error: 'b' was not declared in this scope 36 | if(a[0] <= b[2]){ | ^
s341551182
p03637
Java
import java.util.*; public class Main{ public static void main(String[] args){ Scanner sc = new Scanner(System.in); int n = sc.nextInt(); int cnt = 0; for(int i = 0;i < n;i++){ int x = sc.nextInt(); while(x%2==0){ cnt++; x =x/2; } } if(x >= n)System.out.println("Yes"); else System.out.println("No"); } }
Main.java:14: error: cannot find symbol if(x >= n)System.out.println("Yes"); ^ symbol: variable x location: class Main 1 error
s548872396
p03637
Java
import java.util.*; public class MAin{ public static void main(String[] args){ Scanner sc = new Scanner(System.in); int n = sc.nextInt(); int cnt = 0; for(int i = 0;i < n;i++){ int x = sc.nextInt(); while(x%2==0){ cnt++; x =x/2; } } if(x >= n)System.out.println("Yes"); else System.out.println("No"); } }
Main.java:2: error: class MAin is public, should be declared in a file named MAin.java public class MAin{ ^ Main.java:14: error: cannot find symbol if(x >= n)System.out.println("Yes"); ^ symbol: variable x location: class MAin 2 errors
s290227110
p03637
C++
#include<bit_s/stdc++.h> #define rep(i, n) for (int i = 0; i < (n); i++) #define ll long long using namespace std; int main() { int n; cin >> n; vector<int> cnt(4); rep(i, n) { int x; cin >> x; cnt[x%4]++; } int x = cnt[1] + cnt[3]; int y = cnt[0]; if(y + 1 < x)cout<<"No"<<endl; else cout<<"Yes"<<endl; }
a.cc:1:9: fatal error: bit_s/stdc++.h: No such file or directory 1 | #include<bit_s/stdc++.h> | ^~~~~~~~~~~~~~~~ compilation terminated.
s865144579
p03637
C++
#include<bit_s/stdc++.h> #define rep(i, n) for (int i = 0; i < (n); i++) #define ll long long using namespace std; int main() { int n; cin >> n; vector<int> cnt(4); rep(i, n) { int x; cin >> x; cnt[x%4]++; } int x = cnt[1] + cnt[3]; int y = cnt[0]; if(y + 1 < x)cout<<"No"<<endl; else cout<<"Yes"<<endl; }
a.cc:1:9: fatal error: bit_s/stdc++.h: No such file or directory 1 | #include<bit_s/stdc++.h> | ^~~~~~~~~~~~~~~~ compilation terminated.
s667222076
p03637
C++
#include<iostream> using namespace std; int main(){ int n; int odd_count = 0; int multi4_count = 0; int even_not_multi4_count = 0; cin >> n; for(int i=0; i<n; i++) { int tmp; cin >> tmp; if(tmp%2) { odd_count++; } else if(tmp%4){ even_not_multi4_count++; } else { multi4_count++; } } if(even_not_multi4_count) { if(odd_count=<multi4_count){ cout << "Yes"; } else { cout << "No"; } } else { if(odd_count=<multi4_count + 1){ cout << "Yes"; } else { cout << "No"; } } }
a.cc: In function 'int main()': a.cc:22:30: error: expected primary-expression before '<' token 22 | if(odd_count=<multi4_count){ | ^ a.cc:28:30: error: expected primary-expression before '<' token 28 | if(odd_count=<multi4_count + 1){ | ^
s644055368
p03637
C++
#include <iostream> #include <string> #include <vector> #include <map> #include <set> #include <queue> #include <stack> #include <cmath> #include <iomanip> #include <algorithm> using namespace std; using ll = long long; void print_ans(bool flag){ if(flag){ cout << "Yes" << endl; } else { cout << "No" << endl; } } int main(){ int n; cin >> n; ll a; int x = 0; int y = 0; int z = 0; for(int i = 0; i < n; i++){ cin >> a; if(a % 4 == 0){ x++; } else if(a % 2 == 0){ y++; } else { z++; } } print_ans((x >= z) || ((x == z - 1) && (y == 0)); return 0; }
a.cc: In function 'int main()': a.cc:39:53: error: expected ')' before ';' token 39 | print_ans((x >= z) || ((x == z - 1) && (y == 0)); | ~ ^ | )
s028731537
p03637
C++
#include <iostream> #include <vector> using namespace std; int main(){ int N; cin >> N; vector <long long int> V(N); int x2 = 0; int x4 = 0; for(int i = 0; i < N; i++){ cin >> V[i]; if(V[i] % 2 == 0) x2++; if(V[i] % 4 == 0) x4++; //x2 - x4 devidable only by 2 } string ans = ""; if(x2 >= N) ans = "Yes"; //else if(x4 >= (N+1) /2) ans = "Yes"; else{ if(N-(x2-x4) % 2 == 0){ if(x4 >= 2 + (N - (x2-x4) - 1)/2){ ans = "Yes"; }else{ ans = "No"; } else{ if(x4 >= 1 + (N - (x2-x4) - 1)/2){ ans = "Yes"; }else{ ans = "No"; } } } cout << ans; }
a.cc: In function 'int main()': a.cc:31:5: error: expected '}' before 'else' 31 | else{ | ^~~~ a.cc:25:27: note: to match this '{' 25 | if(N-(x2-x4) % 2 == 0){ | ^
s779306975
p03637
C++
#include <iostream> #include <vector> using namespace std; int main(){ int N; cin >> N; vector <long long int> V(N); int x2 = 0; int x4 = 0; for(int i = 0; i < N; i++){ cin >> V[i]; if(V[i] % 2 == 0) x2++; if(V[i] % 4 == 0) x4++; //x2 - x4 devidable only by 2 } string ans = ""; if(x2 >= N) ans = "YES"; esle if(x4 >= (N+1) /2) ans = "YES"; else if(2*x4 - x2 >= (N - (x2-x4) + 1)/2) ans = "YES"; else ans = "NO"; cout << ans; }
a.cc: In function 'int main()': a.cc:23:3: error: 'esle' was not declared in this scope 23 | esle if(x4 >= (N+1) /2) ans = "YES"; | ^~~~ a.cc:24:3: error: 'else' without a previous 'if' 24 | else if(2*x4 - x2 >= (N - (x2-x4) + 1)/2) ans = "YES"; | ^~~~
s993906832
p03637
C++
#include <iostream> #include <vector> using namesapce std; int main(){ int N; cin >> N; vector <long long int> V(N); int x2 = 0; int x4 = 0; for(int i = 0; i < N; i++){ cin >> V[i]; if(V[i] % 2 == 0) x2++; if(V[i] % 4 == 0) x4++; //x2 - x4 devidable only by 2 } string ans = ""; if(x2 >= N) ans = "YES"; esle if(x4 >= (N+1) /2) ans = "YES"; else if(2*x4 - x2 >= (N - (x2-x4) + 1)/2) ans = "YES"; else ans = "NO"; cout << ans; }
a.cc:4:7: error: expected nested-name-specifier before 'namesapce' 4 | using namesapce std; | ^~~~~~~~~ a.cc: In function 'int main()': a.cc:8:3: error: 'cin' was not declared in this scope; did you mean 'std::cin'? 8 | cin >> N; | ^~~ | std::cin In file included from a.cc:1: /usr/include/c++/14/iostream:62:18: note: 'std::cin' declared here 62 | extern istream cin; ///< Linked to standard input | ^~~ a.cc:9:3: error: 'vector' was not declared in this scope 9 | vector <long long int> V(N); | ^~~~~~ a.cc:9:3: note: suggested alternatives: In file included from /usr/include/c++/14/vector:66, from a.cc:2: /usr/include/c++/14/bits/stl_vector.h:428:11: note: 'std::vector' 428 | class vector : protected _Vector_base<_Tp, _Alloc> | ^~~~~~ /usr/include/c++/14/vector:93:13: note: 'std::pmr::vector' 93 | using vector = std::vector<_Tp, polymorphic_allocator<_Tp>>; | ^~~~~~ a.cc:9:11: error: expected primary-expression before 'long' 9 | vector <long long int> V(N); | ^~~~ a.cc:15:12: error: 'V' was not declared in this scope 15 | cin >> V[i]; | ^ a.cc:21:3: error: 'string' was not declared in this scope 21 | string ans = ""; | ^~~~~~ a.cc:21:3: note: suggested alternatives: In file included from /usr/include/c++/14/iosfwd:41, from /usr/include/c++/14/ios:40, from /usr/include/c++/14/ostream:40, from /usr/include/c++/14/iostream:41: /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:22:15: error: 'ans' was not declared in this scope; did you mean 'abs'? 22 | if(x2 >= N) ans = "YES"; | ^~~ | abs a.cc:23:3: error: 'esle' was not declared in this scope 23 | esle if(x4 >= (N+1) /2) ans = "YES"; | ^~~~ a.cc:24:3: error: 'else' without a previous 'if' 24 | else if(2*x4 - x2 >= (N - (x2-x4) + 1)/2) ans = "YES"; | ^~~~ a.cc:24:45: error: 'ans' was not declared in this scope; did you mean 'abs'? 24 | else if(2*x4 - x2 >= (N - (x2-x4) + 1)/2) ans = "YES"; | ^~~ | abs a.cc:25:8: error: 'ans' was not declared in this scope; did you mean 'abs'? 25 | else ans = "NO"; | ^~~ | abs a.cc:27:3: error: 'cout' was not declared in this scope; did you mean 'std::cout'? 27 | cout << ans; | ^~~~ | std::cout /usr/include/c++/14/iostream:63:18: note: 'std::cout' declared here 63 | extern ostream cout; ///< Linked to standard output | ^~~~ a.cc:27:11: error: 'ans' was not declared in this scope; did you mean 'abs'? 27 | cout << ans; | ^~~ | abs
s165726196
p03637
C++
#include <iostream> #include <cstring> #include <map> #include <iomanip> #include <algorithm> #include <cmath> #include <set> #include <vector> #include <queue> #include <list> #include <numeric> #include <stdio.h> #include <string> #include <cstdlib> #include <math.h> #include <stack> #include <climits> #include <bitset> using namespace std; typedef long long ll; //最小公倍数 ll gcd(ll x, ll y) { ll tmp = 0; if (x < y){ tmp=x; x=y; y=tmp; } while (y > 0) { ll r = x % y; x = y; y = r; } return x; } //最大公倍数 ll lcm(ll x,ll y){ return x/gcd(x,y)*y; } //for(int i = ; i < ; i++){} int main(){ int n; cin>>n; int c1=0; int c2=0; int c4=0; for(int i = 0; i < n; i++){ int s; cin>>s; if(s%4==0){ c4++; } else if(s%2==0){ c2++; } else{ c1++; } } if(b1<=b4) cout<<"Yes"<<endl; else cout<<"No"<<endl; return 0; }
a.cc: In function 'int main()': a.cc:66:6: error: 'b1' was not declared in this scope; did you mean 'c1'? 66 | if(b1<=b4) cout<<"Yes"<<endl; | ^~ | c1 a.cc:66:10: error: 'b4' was not declared in this scope; did you mean 'c4'? 66 | if(b1<=b4) cout<<"Yes"<<endl; | ^~ | c4
s567640378
p03637
C++
#define _CRT_SECURE_NO_WARNINGS #include<bits/stdc++.h> using namespace std; #ifndef FAST_IO #define IOS ios_base::sync_with_stdio(false);cin.tie(nullptr); #endif #define FILE_IO freopen("input.txt","r",stdin) #define int long long #define f first #define s second #define endl '\n' #define all(c) c.begin(),c.end() #define debug(x) cerr << #x << " = " << x << endl; const int MOD=1e9+7; const int INF=1<<29; mt19937 rng(chrono::steady_clock::now().time_since_epoch().count()); template<typename T>void print(T t){for(auto &it:t)cout<<it<<" ";} inline int powerexp(int a,int b,int m=MOD){int res=1;while(b){if(b&1)res=res*a%m;a=a*a%m,b>>=1;}return res%m;} inline int modinv(int a){return powerexp(a,MOD-2,MOD);} inline int lcm(int a,int b){int g=__gcd(a,b);return a/g*b;} //-------------------< start here >-------------------------// const int N=1e5+11; int a[N]; void solve(){ int n; int a=0,b=0,c=0; cin>>n; for(int i=0;i<n;i++){ cin>>a[i]; } for(int i=0;i<n;i++){ if(a[i]%4==0)a++; else if(a[i]%2==0)b++; else c++; } if(c<=a)cout<<"Yes"; else if(a+1<c)cout<<"No"; else if(b>0)cout<<"No"; else cout<<"Yes"; } //----------------------------- //comment from here for TOPCODER int32_t main(){ IOS; solve(); #ifdef LOCAL_DEFINE cerr<<"time elapsed "<<(double)clock()/CLOCKS_PER_SEC<<endl; #endif }
a.cc: In function 'void solve()': a.cc:34:19: error: invalid types 'long long int[long long int]' for array subscript 34 | cin>>a[i]; | ^ a.cc:37:16: error: invalid types 'long long int[long long int]' for array subscript 37 | if(a[i]%4==0)a++; | ^ a.cc:38:21: error: invalid types 'long long int[long long int]' for array subscript 38 | else if(a[i]%2==0)b++; | ^