submission_id
stringlengths
10
10
problem_id
stringlengths
6
6
language
stringclasses
3 values
code
stringlengths
1
522k
compiler_output
stringlengths
43
10.2k
s976772544
p04044
C++
#include <bits/stdc++.h> using namespace std; int main() { int N, L; cin >> N >> L; vector<string> S(N); for (int i= 0; i < N; i++) { cin >> S.at(i); } sort(S.begin(), S.end()); string out = ""; for (int i = 0; i < N; i++) { out += S.at(i); S.pop_front; } cout << out << endl; }
a.cc: In function 'int main()': a.cc:15:7: error: 'class std::vector<std::__cxx11::basic_string<char> >' has no member named 'pop_front' 15 | S.pop_front; | ^~~~~~~~~
s670649468
p04044
C++
#include <bits/stdc++.h> using namespace std; int main() { int N, L; cin >> N >> L; vector<string> S(N); for (int i= 0; i < N; i++) { cin >> S.at(i); } sort(S.begin(), S.end()); string out ""; for (int i = 0; i < N; i++) { out += S.at(i); S.pop_front; } cout << out << endl; }
a.cc: In function 'int main()': a.cc:12:14: error: expected initializer before string constant 12 | string out ""; | ^~ a.cc:14:5: error: 'out' was not declared in this scope 14 | out += S.at(i); | ^~~ a.cc:15:7: error: 'class std::vector<std::__cxx11::basic_string<char> >' has no member named 'pop_front' 15 | S.pop_front; | ^~~~~~~~~ a.cc:17:11: error: 'out' was not declared in this scope 17 | cout << out << endl; | ^~~
s710391946
p04044
C++
#define _GLIBCXX_DEBUG #include <bits/stdc++.h> using namespace std; template<class T, class U> inline bool chmax(T& a,U b) { if (a < b) { a = b; return 1; } return 0; } template<class T, class U> inline bool chmin(T& a,U b) { if (a > b) { a = b; return 1; } return 0; } int main() { int n, l: cin >> n >> l; vector<string> s(n); for (auto& e : s) cin >> e; sort(s.begin(), s.end()); for (auto e : s) cout << e; cout << endl; return 0; }
a.cc: In function 'int main()': a.cc:8:13: error: found ':' in nested-name-specifier, expected '::' 8 | int n, l: | ^ | :: a.cc:8:12: error: 'l' has not been declared 8 | int n, l: | ^ a.cc:9:9: error: qualified-id in declaration before '>>' token 9 | cin >> n >> l; | ^~
s868017816
p04044
Java
import java.util.*; public class Main { static int n,l; public static void main(String[] args) { Scanner scan = new Scanner(System.in); String[] str = scan.nextLine().split(" "); n = Integer.valueOf(str[0]); l = Integer.valueOf(str[1]); List<i> list = new ArrayList<i>(); for (int i = 0;; i++) { if (count == n) break; String str1 = scan.nextLine(); if (!str1.isEmpty()) { list.add(new i(str1)); count++; } } Collections.sort(list); for(int i=0;i<n;i++) { System.out.println(list.get(i).getStr()); } } } class i implements java.lang.Comparable<i> { private String str; public i(String str) { super(); this.str = str; } public String getStr() { return str; } public void setStr(String str) { this.str = str; } @Override public int compareTo(i o) { int j = 0; int result = 0; while(j<str.length()) { result = this.str.charAt(j)-o.str.charAt(j); if(result == 0) { j++; result = this.str.charAt(j)-o.str.charAt(j); } else break; } return result; } }
Main.java:11: error: cannot find symbol if (count == n) ^ symbol: variable count location: class Main Main.java:16: error: cannot find symbol count++; ^ symbol: variable count location: class Main 2 errors
s467080626
p04044
C++
#include <bits/stdc++.h> using namespace std; int main(){ int N, L; cin >> N >> L; vector<string> data(N); for(int i = 0; i < N; i++){ cin << data[i]; } sort(data.begin(), data.end()); for(int i = 0; i < N; i++){ cout << data[i]; } cout << endl; }
a.cc: In function 'int main()': a.cc:9:9: error: no match for 'operator<<' (operand types are 'std::istream' {aka 'std::basic_istream<char>'} and '__gnu_cxx::__alloc_traits<std::allocator<std::__cxx11::basic_string<char> >, std::__cxx11::basic_string<char> >::value_type' {aka 'std::__cxx11::basic_string<char>'}) 9 | cin << data[i]; 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:1715:5: note: candidate: 'template<class _Ch_type, class _Ch_traits, class _Bi_iter> std::basic_ostream<_CharT, _Traits>& std::__cxx11::operator<<(std::basic_ostream<_CharT, _Traits>&, const sub_match<_Bi_iter>&)' 1715 | operator<<(basic_ostream<_Ch_type, _Ch_traits>& __os, | ^~~~~~~~ /usr/include/c++/14/bits/regex.h:1715:5: note: template argument deduction/substitution failed: a.cc:9:18: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<_CharT, _Traits>' 9 | cin << data[i]; | ^ In file included from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:41: /usr/include/c++/14/cstddef:125:5: note: candidate: 'template<class _IntegerType> constexpr std::__byte_op_t<_IntegerType> std::operator<<(byte, _IntegerType)' 125 | operator<<(byte __b, _IntegerType __shift) noexcept | ^~~~~~~~ /usr/include/c++/14/cstddef:125:5: note: template argument deduction/substitution failed: a.cc:9:5: note: cannot convert 'std::cin' (type 'std::istream' {aka 'std::basic_istream<char>'}) to type 'std::byte' 9 | cin << data[i]; | ^~~ 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:763:5: note: candidate: 'template<class _CharT, class _Traits> std::basic_ostream<_CharT, _Traits>& std::operator<<(basic_ostream<_CharT, _Traits>&, basic_string_view<_CharT, _Traits>)' 763 | operator<<(basic_ostream<_CharT, _Traits>& __os, | ^~~~~~~~ /usr/include/c++/14/string_view:763:5: note: template argument deduction/substitution failed: a.cc:9:18: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<_CharT, _Traits>' 9 | cin << data[i]; | ^ /usr/include/c++/14/bits/basic_string.h:4077:5: note: candidate: 'template<class _CharT, class _Traits, class _Alloc> std::basic_ostream<_CharT, _Traits>& std::operator<<(basic_ostream<_CharT, _Traits>&, const __cxx11::basic_string<_CharT, _Traits, _Allocator>&)' 4077 | operator<<(basic_ostream<_CharT, _Traits>& __os, | ^~~~~~~~ /usr/include/c++/14/bits/basic_string.h:4077:5: note: template argument deduction/substitution failed: a.cc:9:18: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<_CharT, _Traits>' 9 | cin << data[i]; | ^ /usr/include/c++/14/bitset:1687:5: note: candidate: 'template<class _CharT, class _Traits, long unsigned int _Nb> std::basic_ostream<_CharT, _Traits>& std::operator<<(basic_ostream<_CharT, _Traits>&, const bitset<_Nb>&)' 1687 | operator<<(std::basic_ostream<_CharT, _Traits>& __os, | ^~~~~~~~ /usr/include/c++/14/bitset:1687:5: note: template argument deduction/substitution failed: a.cc:9:18: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<_CharT, _Traits>' 9 | cin << data[i]; | ^ In file included from /usr/include/c++/14/bits/ios_base.h:46, from /usr/include/c++/14/streambuf:43, from /usr/include/c++/14/bits/streambuf_iterator.h:35, from /usr/include/c++/14/iterator:66, from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:54: /usr/include/c++/14/system_error:339:5: note: candidate: 'template<class _CharT, class _Traits> std::basic_ostream<_CharT, _Traits>& std::operator<<(basic_ostream<_CharT, _Traits>&, const error_code&)' 339 | operator<<(basic_ostream<_CharT, _Traits>& __os, const error_code& __e) | ^~~~~~~~ /usr/include/c++/14/system_error:339:5: note: template argument deduction/substitution failed: a.cc:9:18: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<_CharT, _Traits>' 9 | cin << data[i]; | ^ In file included from /usr/include/c++/14/memory:80, from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:56: /usr/include/c++/14/bits/shared_ptr.h:70:5: note: candidate: 'template<class _Ch, class _Tr, class _Tp, __gnu_cxx::_Lock_policy _Lp> std::basic_ostream<_CharT, _Traits>& std::operator<<(basic_ostream<_CharT, _Traits>&, const __shared_ptr<_Tp, _Lp>&)' 70 | operator<<(std::basic_ostream<_Ch, _Tr>& __os, | ^~~~~~~~ /usr/include/c++/14/bits/shared_ptr.h:70:5: note: template argument deduction/substitution failed: a.cc:9:18: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<_CharT, _Traits>' 9 | cin << data[i]; | ^ 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:563:5: note: candidate: 'template<class _CharT, class _Traits> std::basic_ostream<_CharT, _Traits>& std::operator<<(basic_ostream<_CharT, _Traits>&, _CharT)' 563 | operator<<(basic_ostream<_CharT, _Traits>& __out, _CharT __c) | ^~~~~~~~ /usr/include/c++/14/ostream:563:5: note: template argument deduction/substitution failed: a.cc:9:18: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<_CharT, _Traits>' 9 | cin << data[i]; | ^ /usr/include/c++/14/ostream:573:5: note: candidate: 'template<class _CharT, class _Traits> std::basic_ostream<_CharT, _Traits>& std::operator<<(basic_ostream<_CharT, _Traits>&, char)' 573 | operator<<(basic_ostream<_CharT, _Traits>& __out, char __c) | ^~~~~~~~ /usr/include/c++/14/ostream:573:5: note: template argument deduction/substitution failed: a.cc:9:18: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<_CharT, _Traits>' 9 | cin << data[i]; | ^ /usr/include/c++/14/ostream:579:5: note: candidate: 'template<class _Traits> std::basic_ostream<char, _Traits>& std::operator<<(basic_ostream<char, _Traits>&, char)' 579 | operator<<(basic_ostream<char, _Traits>& __out, char __c) | ^~~~~~~~ /usr/include/c++/14/ostream:579:5: note: template argument deduction/substitution failed: a.cc:9:18: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<char, _Traits>' 9 | cin << data[i]; | ^ /usr/include/c++/14/ostream:590:5: note: candidate: 'template<class _Traits> std::basic_ostream<char, _Traits>& std::operator<<(basic_ostream<char, _Traits>&, signed char)' 590 | operator<<(basic_ostream<char, _Traits>& __out, signed char __c) | ^~~~~~~~ /usr/include/c++/14/ostream:590:5: note: template argument deduction/substitution failed: a.cc:9:18: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<char, _Traits>' 9 | cin << data[i]; | ^ /usr/include/c++/14/ostream:595:5: note: candidate: 'template<class _Traits> std::basic_ostream<char, _Traits>& std::operator<<(basic_ostream<char, _Traits>&, unsigned char)' 595 | operator<<(basic_ostream<char, _Traits>& __out, unsigned char __c) | ^~~~~~~~ /usr/include/c++/14/ostream:595:5: note: template argument deduction/substitution failed: a.cc:9:18: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<char, _Traits>' 9 | cin << data[i]; | ^ /usr/include/c++/14/ostream:654:5: note: candidate: 'template<class _CharT, class _Traits> std::basic_ostream<_CharT, _Traits>& std::operator<<(basic_ostream<_CharT, _Traits>&, const _CharT*)' 654 | operator<<(basic_ostream<_CharT, _Traits>& __out, const _CharT* __s) | ^~~~~~~~ /usr/include/c++/14/ostream:654:5: note: template argument deduction/substitution failed: a.cc:9:18: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<_CharT, _Traits>' 9 | cin << data[i]; | ^ In file included from /usr/include/c++/14/ostream:1022: /usr/include/c++/14/bits/ostream.tcc:307:5: note: candidate: 'template<class _CharT, class _Traits> std::basic_ostream<_CharT, _Traits>& std::operator<<(basic_ostream<_CharT, _Traits>&, const char*)' 307 | operator<<(basic_ostream<_CharT, _Traits>& __out, const char* __s) | ^~~~~~~~ /usr/include/c++/14/bits/ostream.tcc:307:5: note: template argument deduction/substitution failed: a.cc:9:18: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<_CharT, _Traits>' 9 | cin << data[i]; | ^ /usr/include/c++/14/ostream:671:5: note: candidate: 'template<class _Traits> std::basic_ostream<char, _Traits>& std::operator<<(basic_ostream<char, _Traits>&, const char*)' 671 | operator<<(basic_ostream<char, _Traits>& __out, const char* __s) | ^~~~~~~~ /usr/include/c++/14/ostream:671:5: note: template argument deduction/substitution failed: a.cc:9:18: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<char, _Traits>' 9 | cin << data[i]; | ^ /usr/include/c++/14/ostream:684:5: note: candidate: 'template<class _Traits> std::basic_ostream<char, _Traits>&
s623191462
p04044
C++
#include <bits/stdc++.h> using namespace std; int main() { int N,L; cin >> N >> L; vector<char> a(N); for(int i=0;i<N;i++){ getline(cin,a.at(i)); } sort(a.begin(),a.end()); string s; for(int i=0;i<N;i++){ s.push_back(a.at(i)); } cout << s << endl; }
a.cc: In function 'int main()': a.cc:9:14: error: no matching function for call to 'getline(std::istream&, __gnu_cxx::__alloc_traits<std::allocator<char>, char>::value_type&)' 9 | getline(cin,a.at(i)); | ~~~~~~~^~~~~~~~~~~~~ In file included from /usr/include/c++/14/string:55, from /usr/include/c++/14/bitset:52, from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:52, from a.cc:1: /usr/include/c++/14/bits/basic_string.tcc:907:5: note: candidate: 'template<class _CharT, class _Traits, class _Alloc> std::basic_istream<_CharT, _Traits>& std::getline(basic_istream<_CharT, _Traits>&, __cxx11::basic_string<_CharT, _Traits, _Allocator>&, _CharT)' 907 | getline(basic_istream<_CharT, _Traits>& __in, | ^~~~~~~ /usr/include/c++/14/bits/basic_string.tcc:907:5: note: candidate expects 3 arguments, 2 provided In file included from /usr/include/c++/14/string:54: /usr/include/c++/14/bits/basic_string.h:4117:5: note: candidate: 'template<class _CharT, class _Traits, class _Alloc> std::basic_istream<_CharT, _Traits>& std::getline(basic_istream<_CharT, _Traits>&, __cxx11::basic_string<_CharT, _Traits, _Allocator>&)' 4117 | getline(basic_istream<_CharT, _Traits>& __is, | ^~~~~~~ /usr/include/c++/14/bits/basic_string.h:4117:5: note: template argument deduction/substitution failed: a.cc:9:14: note: mismatched types 'std::__cxx11::basic_string<_CharT, _Traits, _Allocator>' and '__gnu_cxx::__alloc_traits<std::allocator<char>, char>::value_type' {aka 'char'} 9 | getline(cin,a.at(i)); | ~~~~~~~^~~~~~~~~~~~~ /usr/include/c++/14/bits/basic_string.h:4125:5: note: candidate: 'template<class _CharT, class _Traits, class _Alloc> std::basic_istream<_CharT, _Traits>& std::getline(basic_istream<_CharT, _Traits>&&, __cxx11::basic_string<_CharT, _Traits, _Allocator>&, _CharT)' 4125 | getline(basic_istream<_CharT, _Traits>&& __is, | ^~~~~~~ /usr/include/c++/14/bits/basic_string.h:4125:5: note: candidate expects 3 arguments, 2 provided /usr/include/c++/14/bits/basic_string.h:4132:5: note: candidate: 'template<class _CharT, class _Traits, class _Alloc> std::basic_istream<_CharT, _Traits>& std::getline(basic_istream<_CharT, _Traits>&&, __cxx11::basic_string<_CharT, _Traits, _Allocator>&)' 4132 | getline(basic_istream<_CharT, _Traits>&& __is, | ^~~~~~~ /usr/include/c++/14/bits/basic_string.h:4132:5: note: template argument deduction/substitution failed: a.cc:9:14: note: mismatched types 'std::__cxx11::basic_string<_CharT, _Traits, _Allocator>' and '__gnu_cxx::__alloc_traits<std::allocator<char>, char>::value_type' {aka 'char'} 9 | getline(cin,a.at(i)); | ~~~~~~~^~~~~~~~~~~~~ In file included from /usr/include/c++/14/cstdio:42, from /usr/include/c++/14/ext/string_conversions.h:45, from /usr/include/c++/14/bits/basic_string.h:4154: /usr/include/stdio.h:697:18: note: candidate: '__ssize_t getline(char**, size_t*, FILE*)' 697 | extern __ssize_t getline (char **__restrict __lineptr, | ^~~~~~~ /usr/include/stdio.h:697:18: note: candidate expects 3 arguments, 2 provided
s842493888
p04044
C++
#include <bits/stdc++.h> using namespace std; int main() { int N,L; cin >> N >> L; vector<char> a(N); cin >> a; sort(a.begin(),a.end()); for(int i=0;i<N;i++){ cout << a.at(i); } cout << endl; }
a.cc: In function 'int main()': a.cc:8:9: error: no match for 'operator>>' (operand types are 'std::istream' {aka 'std::basic_istream<char>'} and 'std::vector<char>') 8 | cin >> a; | ~~~ ^~ ~ | | | | | std::vector<char> | std::istream {aka std::basic_istream<char>} In file included from /usr/include/c++/14/sstream:40, from /usr/include/c++/14/complex:45, from /usr/include/c++/14/ccomplex:39, from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:127, from a.cc:1: /usr/include/c++/14/istream:170:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(bool&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' 170 | operator>>(bool& __n) | ^~~~~~~~ /usr/include/c++/14/istream:170:24: note: no known conversion for argument 1 from 'std::vector<char>' to 'bool&' 170 | operator>>(bool& __n) | ~~~~~~^~~ /usr/include/c++/14/istream:174:7: note: candidate: 'std::basic_istream<_CharT, _Traits>& std::basic_istream<_CharT, _Traits>::operator>>(short int&) [with _CharT = char; _Traits = std::char_traits<char>]' 174 | operator>>(short& __n); | ^~~~~~~~ /usr/include/c++/14/istream:174:25: note: no known conversion for argument 1 from 'std::vector<char>' to 'short int&' 174 | operator>>(short& __n); | ~~~~~~~^~~ /usr/include/c++/14/istream:177:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(short unsigned int&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' 177 | operator>>(unsigned short& __n) | ^~~~~~~~ /usr/include/c++/14/istream:177:34: note: no known conversion for argument 1 from 'std::vector<char>' to 'short unsigned int&' 177 | operator>>(unsigned short& __n) | ~~~~~~~~~~~~~~~~^~~ /usr/include/c++/14/istream:181:7: note: candidate: 'std::basic_istream<_CharT, _Traits>& std::basic_istream<_CharT, _Traits>::operator>>(int&) [with _CharT = char; _Traits = std::char_traits<char>]' 181 | operator>>(int& __n); | ^~~~~~~~ /usr/include/c++/14/istream:181:23: note: no known conversion for argument 1 from 'std::vector<char>' to 'int&' 181 | operator>>(int& __n); | ~~~~~^~~ /usr/include/c++/14/istream:184:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(unsigned int&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' 184 | operator>>(unsigned int& __n) | ^~~~~~~~ /usr/include/c++/14/istream:184:32: note: no known conversion for argument 1 from 'std::vector<char>' to 'unsigned int&' 184 | operator>>(unsigned int& __n) | ~~~~~~~~~~~~~~^~~ /usr/include/c++/14/istream:188:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(long int&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' 188 | operator>>(long& __n) | ^~~~~~~~ /usr/include/c++/14/istream:188:24: note: no known conversion for argument 1 from 'std::vector<char>' to 'long int&' 188 | operator>>(long& __n) | ~~~~~~^~~ /usr/include/c++/14/istream:192:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(long unsigned int&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' 192 | operator>>(unsigned long& __n) | ^~~~~~~~ /usr/include/c++/14/istream:192:33: note: no known conversion for argument 1 from 'std::vector<char>' to 'long unsigned int&' 192 | operator>>(unsigned long& __n) | ~~~~~~~~~~~~~~~^~~ /usr/include/c++/14/istream:199:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(long long int&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' 199 | operator>>(long long& __n) | ^~~~~~~~ /usr/include/c++/14/istream:199:29: note: no known conversion for argument 1 from 'std::vector<char>' to 'long long int&' 199 | operator>>(long long& __n) | ~~~~~~~~~~~^~~ /usr/include/c++/14/istream:203:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(long long unsigned int&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' 203 | operator>>(unsigned long long& __n) | ^~~~~~~~ /usr/include/c++/14/istream:203:38: note: no known conversion for argument 1 from 'std::vector<char>' to 'long long unsigned int&' 203 | operator>>(unsigned long long& __n) | ~~~~~~~~~~~~~~~~~~~~^~~ /usr/include/c++/14/istream:219:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(float&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' 219 | operator>>(float& __f) | ^~~~~~~~ /usr/include/c++/14/istream:219:25: note: no known conversion for argument 1 from 'std::vector<char>' to 'float&' 219 | operator>>(float& __f) | ~~~~~~~^~~ /usr/include/c++/14/istream:223:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(double&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' 223 | operator>>(double& __f) | ^~~~~~~~ /usr/include/c++/14/istream:223:26: note: no known conversion for argument 1 from 'std::vector<char>' to 'double&' 223 | operator>>(double& __f) | ~~~~~~~~^~~ /usr/include/c++/14/istream:227:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(long double&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' 227 | operator>>(long double& __f) | ^~~~~~~~ /usr/include/c++/14/istream:227:31: note: no known conversion for argument 1 from 'std::vector<char>' to 'long double&' 227 | operator>>(long double& __f) | ~~~~~~~~~~~~~^~~ /usr/include/c++/14/istream:328:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(void*&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' 328 | operator>>(void*& __p) | ^~~~~~~~ /usr/include/c++/14/istream:328:25: note: no known conversion for argument 1 from 'std::vector<char>' to 'void*&' 328 | operator>>(void*& __p) | ~~~~~~~^~~ /usr/include/c++/14/istream:122:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(__istream_type& (*)(__istream_type&)) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' 122 | operator>>(__istream_type& (*__pf)(__istream_type&)) | ^~~~~~~~ /usr/include/c++/14/istream:122:36: note: no known conversion for argument 1 from 'std::vector<char>' to 'std::basic_istream<char>::__istream_type& (*)(std::basic_istream<char>::__istream_type&)' {aka 'std::basic_istream<char>& (*)(std::basic_istream<char>&)'} 122 | operator>>(__istream_type& (*__pf)(__istream_type&)) | ~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~ /usr/include/c++/14/istream:126:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(__ios_type& (*)(__ios_type&)) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>; __ios_type = std::basic_ios<char>]' 126 | operator>>(__ios_type& (*__pf)(__ios_type&)) | ^~~~~~~~ /usr/include/c++/14/istream:126:32: note: no known conversion for argument 1 from 'std::vector<char>' to 'std::basic_istream<char>::__ios_type& (*)(std::basic_istream<char>::__ios_type&)' {aka 'std::basic_ios<char>& (*)(std::basic_ios<char>&)'} 126 | operator>>(__ios_type& (*__pf)(__ios_type&)) | ~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~ /usr/include/c++/14/istream:133:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(std::ios_base& (*)(std::ios_base&)) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' 133 | operator>>(ios_base& (*__pf)(ios_base&)) | ^~~~~~~~ /usr/include/c++/14/istream:133:30: note: no known conversion for argument 1 from 'std::vector<char>' to 'std::ios_base& (*)(std::ios_base&)' 133 | operator>>(ios_base& (*__pf)(ios_base&)) | ~~~~~~~~~~~~^~~~~~~~~~~~~~~~ /usr/include/c++/14/istream:352:7: note: candidate: 'std::basic_istream<_CharT, _Traits>& std::basic_istream<_CharT, _Traits>::operator>>(__streambuf_type*) [with _CharT = char; _Traits = std::char_traits<char>; __streambuf_type = std::basic_streambuf<char>]' 352 | operator>>(__streambuf_type* __sb); | ^~~~~~~~ /usr/include/c++/14/istream:352:36: note: no known conversion for argument 1 from 'std::vector<char>' to 'std::basic_istream<char>::__streambuf_type*' {aka 'std::basic_streambuf<char>*'} 352 | operator>>(__streambuf_type* __sb); | ~~~~~~~~~~~~~~~~~~^~~~ In file included from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:41: /usr
s146391923
p04044
C++
#include <bits/stdc++.h> using namespace std; int main() { int N,L; cin >> N >> L; vector<char> a(N); cin >> a sort(a.begin(),a.end()); for(int i=0;i<N;i++){ cout << a.at(i); } cout << endl; }
a.cc: In function 'int main()': a.cc:8:9: error: no match for 'operator>>' (operand types are 'std::istream' {aka 'std::basic_istream<char>'} and 'std::vector<char>') 8 | cin >> a | ~~~ ^~ ~ | | | | | std::vector<char> | std::istream {aka std::basic_istream<char>} In file included from /usr/include/c++/14/sstream:40, from /usr/include/c++/14/complex:45, from /usr/include/c++/14/ccomplex:39, from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:127, from a.cc:1: /usr/include/c++/14/istream:170:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(bool&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' 170 | operator>>(bool& __n) | ^~~~~~~~ /usr/include/c++/14/istream:170:24: note: no known conversion for argument 1 from 'std::vector<char>' to 'bool&' 170 | operator>>(bool& __n) | ~~~~~~^~~ /usr/include/c++/14/istream:174:7: note: candidate: 'std::basic_istream<_CharT, _Traits>& std::basic_istream<_CharT, _Traits>::operator>>(short int&) [with _CharT = char; _Traits = std::char_traits<char>]' 174 | operator>>(short& __n); | ^~~~~~~~ /usr/include/c++/14/istream:174:25: note: no known conversion for argument 1 from 'std::vector<char>' to 'short int&' 174 | operator>>(short& __n); | ~~~~~~~^~~ /usr/include/c++/14/istream:177:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(short unsigned int&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' 177 | operator>>(unsigned short& __n) | ^~~~~~~~ /usr/include/c++/14/istream:177:34: note: no known conversion for argument 1 from 'std::vector<char>' to 'short unsigned int&' 177 | operator>>(unsigned short& __n) | ~~~~~~~~~~~~~~~~^~~ /usr/include/c++/14/istream:181:7: note: candidate: 'std::basic_istream<_CharT, _Traits>& std::basic_istream<_CharT, _Traits>::operator>>(int&) [with _CharT = char; _Traits = std::char_traits<char>]' 181 | operator>>(int& __n); | ^~~~~~~~ /usr/include/c++/14/istream:181:23: note: no known conversion for argument 1 from 'std::vector<char>' to 'int&' 181 | operator>>(int& __n); | ~~~~~^~~ /usr/include/c++/14/istream:184:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(unsigned int&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' 184 | operator>>(unsigned int& __n) | ^~~~~~~~ /usr/include/c++/14/istream:184:32: note: no known conversion for argument 1 from 'std::vector<char>' to 'unsigned int&' 184 | operator>>(unsigned int& __n) | ~~~~~~~~~~~~~~^~~ /usr/include/c++/14/istream:188:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(long int&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' 188 | operator>>(long& __n) | ^~~~~~~~ /usr/include/c++/14/istream:188:24: note: no known conversion for argument 1 from 'std::vector<char>' to 'long int&' 188 | operator>>(long& __n) | ~~~~~~^~~ /usr/include/c++/14/istream:192:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(long unsigned int&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' 192 | operator>>(unsigned long& __n) | ^~~~~~~~ /usr/include/c++/14/istream:192:33: note: no known conversion for argument 1 from 'std::vector<char>' to 'long unsigned int&' 192 | operator>>(unsigned long& __n) | ~~~~~~~~~~~~~~~^~~ /usr/include/c++/14/istream:199:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(long long int&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' 199 | operator>>(long long& __n) | ^~~~~~~~ /usr/include/c++/14/istream:199:29: note: no known conversion for argument 1 from 'std::vector<char>' to 'long long int&' 199 | operator>>(long long& __n) | ~~~~~~~~~~~^~~ /usr/include/c++/14/istream:203:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(long long unsigned int&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' 203 | operator>>(unsigned long long& __n) | ^~~~~~~~ /usr/include/c++/14/istream:203:38: note: no known conversion for argument 1 from 'std::vector<char>' to 'long long unsigned int&' 203 | operator>>(unsigned long long& __n) | ~~~~~~~~~~~~~~~~~~~~^~~ /usr/include/c++/14/istream:219:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(float&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' 219 | operator>>(float& __f) | ^~~~~~~~ /usr/include/c++/14/istream:219:25: note: no known conversion for argument 1 from 'std::vector<char>' to 'float&' 219 | operator>>(float& __f) | ~~~~~~~^~~ /usr/include/c++/14/istream:223:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(double&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' 223 | operator>>(double& __f) | ^~~~~~~~ /usr/include/c++/14/istream:223:26: note: no known conversion for argument 1 from 'std::vector<char>' to 'double&' 223 | operator>>(double& __f) | ~~~~~~~~^~~ /usr/include/c++/14/istream:227:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(long double&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' 227 | operator>>(long double& __f) | ^~~~~~~~ /usr/include/c++/14/istream:227:31: note: no known conversion for argument 1 from 'std::vector<char>' to 'long double&' 227 | operator>>(long double& __f) | ~~~~~~~~~~~~~^~~ /usr/include/c++/14/istream:328:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(void*&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' 328 | operator>>(void*& __p) | ^~~~~~~~ /usr/include/c++/14/istream:328:25: note: no known conversion for argument 1 from 'std::vector<char>' to 'void*&' 328 | operator>>(void*& __p) | ~~~~~~~^~~ /usr/include/c++/14/istream:122:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(__istream_type& (*)(__istream_type&)) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' 122 | operator>>(__istream_type& (*__pf)(__istream_type&)) | ^~~~~~~~ /usr/include/c++/14/istream:122:36: note: no known conversion for argument 1 from 'std::vector<char>' to 'std::basic_istream<char>::__istream_type& (*)(std::basic_istream<char>::__istream_type&)' {aka 'std::basic_istream<char>& (*)(std::basic_istream<char>&)'} 122 | operator>>(__istream_type& (*__pf)(__istream_type&)) | ~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~ /usr/include/c++/14/istream:126:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(__ios_type& (*)(__ios_type&)) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>; __ios_type = std::basic_ios<char>]' 126 | operator>>(__ios_type& (*__pf)(__ios_type&)) | ^~~~~~~~ /usr/include/c++/14/istream:126:32: note: no known conversion for argument 1 from 'std::vector<char>' to 'std::basic_istream<char>::__ios_type& (*)(std::basic_istream<char>::__ios_type&)' {aka 'std::basic_ios<char>& (*)(std::basic_ios<char>&)'} 126 | operator>>(__ios_type& (*__pf)(__ios_type&)) | ~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~ /usr/include/c++/14/istream:133:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(std::ios_base& (*)(std::ios_base&)) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' 133 | operator>>(ios_base& (*__pf)(ios_base&)) | ^~~~~~~~ /usr/include/c++/14/istream:133:30: note: no known conversion for argument 1 from 'std::vector<char>' to 'std::ios_base& (*)(std::ios_base&)' 133 | operator>>(ios_base& (*__pf)(ios_base&)) | ~~~~~~~~~~~~^~~~~~~~~~~~~~~~ /usr/include/c++/14/istream:352:7: note: candidate: 'std::basic_istream<_CharT, _Traits>& std::basic_istream<_CharT, _Traits>::operator>>(__streambuf_type*) [with _CharT = char; _Traits = std::char_traits<char>; __streambuf_type = std::basic_streambuf<char>]' 352 | operator>>(__streambuf_type* __sb); | ^~~~~~~~ /usr/include/c++/14/istream:352:36: note: no known conversion for argument 1 from 'std::vector<char>' to 'std::basic_istream<char>::__streambuf_type*' {aka 'std::basic_streambuf<char>*'} 352 | operator>>(__streambuf_type* __sb); | ~~~~~~~~~~~~~~~~~~^~~~ In file included from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:41: /usr/
s273339363
p04044
C++
#include <bits/stdc++.h> using namespace std; int main() { int N, L; cin >> N >> L; vector<int> S(N); for (int i = 0; i < N; i++) { cin >> S.at(i); } sort(S.begin(), S.end()); string ans = S.at(0); for (int i = 1; i < N; i++) { ans += S.at(i); } cout << ans << endl; }
a.cc: In function 'int main()': a.cc:12:20: error: conversion from '__gnu_cxx::__alloc_traits<std::allocator<int>, int>::value_type' {aka 'int'} to non-scalar type 'std::string' {aka 'std::__cxx11::basic_string<char>'} requested 12 | string ans = S.at(0); | ~~~~^~~
s203180475
p04044
C++
#include <bits/stdc++.h> using namespace std; int main() { int N, L; cin >> N >> L; vector<int> S(N); for (int i = 0; i < N; i++) { cin >> S.at(i); } sort(S.begin(), S.end()); for (int i = 0; i < N; i++) { cout << (string)(S.at(i)); } cout << endl; }
a.cc: In function 'int main()': a.cc:13:29: error: no matching function for call to 'std::__cxx11::basic_string<char>::basic_string(__gnu_cxx::__alloc_traits<std::allocator<int>, int>::value_type&)' 13 | cout << (string)(S.at(i)); | ^ In file included from /usr/include/c++/14/string:54, from /usr/include/c++/14/bitset:52, from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:52, from a.cc:1: /usr/include/c++/14/bits/basic_string.h:800:9: note: candidate: 'template<class _Tp, class> std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::basic_string(const _Tp&, const _Alloc&) [with <template-parameter-2-2> = _Tp; _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>]' 800 | basic_string(const _Tp& __t, const _Alloc& __a = _Alloc()) | ^~~~~~~~~~~~ /usr/include/c++/14/bits/basic_string.h:800:9: note: template argument deduction/substitution failed: In file included from /usr/include/c++/14/bits/stl_pair.h:60, from /usr/include/c++/14/bits/stl_algobase.h:64, from /usr/include/c++/14/algorithm:60, from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:51: /usr/include/c++/14/type_traits: In substitution of 'template<bool _Cond, class _Tp> using std::enable_if_t = typename std::enable_if::type [with bool _Cond = false; _Tp = void]': /usr/include/c++/14/bits/basic_string.h:149:8: required by substitution of 'template<class _CharT, class _Traits, class _Alloc> template<class _Tp, class _Res> using std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::_If_sv = std::enable_if_t<((bool)std::__and_<std::is_convertible<const _Tp&, std::basic_string_view<_CharT, _Traits> >, std::__not_<std::is_convertible<const _Tp*, const std::__cxx11::basic_string<_CharT, _Traits, _Alloc>*> >, std::__not_<std::is_convertible<const _Tp&, const _CharT*> > >::value), _Res> [with _Tp = int; _Res = void; _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>]' 149 | using _If_sv = enable_if_t< | ^~~~~~ /usr/include/c++/14/bits/basic_string.h:797:30: required from here 797 | template<typename _Tp, typename = _If_sv<_Tp, void>> | ^~~~~~~~ /usr/include/c++/14/type_traits:2711:11: error: no type named 'type' in 'struct std::enable_if<false, void>' 2711 | using enable_if_t = typename enable_if<_Cond, _Tp>::type; | ^~~~~~~~~~~ /usr/include/c++/14/bits/basic_string.h:788:9: note: candidate: 'template<class _Tp, class> std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::basic_string(const _Tp&, size_type, size_type, const _Alloc&) [with <template-parameter-2-2> = _Tp; _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>]' 788 | basic_string(const _Tp& __t, size_type __pos, size_type __n, | ^~~~~~~~~~~~ /usr/include/c++/14/bits/basic_string.h:788:9: note: candidate expects 3 arguments, 1 provided /usr/include/c++/14/bits/basic_string.h:765:9: note: candidate: 'template<class _InputIterator, class> std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::basic_string(_InputIterator, _InputIterator, const _Alloc&) [with <template-parameter-2-2> = _InputIterator; _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>]' 765 | basic_string(_InputIterator __beg, _InputIterator __end, | ^~~~~~~~~~~~ /usr/include/c++/14/bits/basic_string.h:765:9: note: candidate expects 2 arguments, 1 provided /usr/include/c++/14/bits/basic_string.h:669:7: note: candidate: 'template<class> std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::basic_string(size_type, _CharT, const _Alloc&) [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>]' 669 | basic_string(size_type __n, _CharT __c, const _Alloc& __a = _Alloc()) | ^~~~~~~~~~~~ /usr/include/c++/14/bits/basic_string.h:669:7: note: candidate expects 2 arguments, 1 provided /usr/include/c++/14/bits/basic_string.h:646:7: note: candidate: 'template<class> std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::basic_string(const _CharT*, const _Alloc&) [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>]' 646 | basic_string(const _CharT* __s, const _Alloc& __a = _Alloc()) | ^~~~~~~~~~~~ /usr/include/c++/14/bits/basic_string.h:646:7: note: template argument deduction/substitution failed: a.cc:13:26: note: cannot convert 'S.std::vector<int>::at(((std::vector<int>::size_type)i))' (type '__gnu_cxx::__alloc_traits<std::allocator<int>, int>::value_type' {aka 'int'}) to type 'const char*' 13 | cout << (string)(S.at(i)); | ~~~~~^~~~ /usr/include/c++/14/bits/basic_string.h:721:7: note: candidate: 'std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::basic_string(std::__cxx11::basic_string<_CharT, _Traits, _Alloc>&&, const _Alloc&) [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>]' 721 | basic_string(basic_string&& __str, const _Alloc& __a) | ^~~~~~~~~~~~ /usr/include/c++/14/bits/basic_string.h:721:7: note: candidate expects 2 arguments, 1 provided /usr/include/c++/14/bits/basic_string.h:716:7: note: candidate: 'std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::basic_string(const std::__cxx11::basic_string<_CharT, _Traits, _Alloc>&, const _Alloc&) [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>]' 716 | basic_string(const basic_string& __str, const _Alloc& __a) | ^~~~~~~~~~~~ /usr/include/c++/14/bits/basic_string.h:716:7: note: candidate expects 2 arguments, 1 provided /usr/include/c++/14/bits/basic_string.h:711:7: note: candidate: 'std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::basic_string(std::initializer_list<_Tp>, const _Alloc&) [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>]' 711 | basic_string(initializer_list<_CharT> __l, const _Alloc& __a = _Alloc()) | ^~~~~~~~~~~~ /usr/include/c++/14/bits/basic_string.h:711:45: note: no known conversion for argument 1 from '__gnu_cxx::__alloc_traits<std::allocator<int>, int>::value_type' {aka 'int'} to 'std::initializer_list<char>' 711 | basic_string(initializer_list<_CharT> __l, const _Alloc& __a = _Alloc()) | ~~~~~~~~~~~~~~~~~~~~~~~~~^~~ /usr/include/c++/14/bits/basic_string.h:682:7: note: candidate: 'std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::basic_string(std::__cxx11::basic_string<_CharT, _Traits, _Alloc>&&) [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>]' 682 | basic_string(basic_string&& __str) noexcept | ^~~~~~~~~~~~ /usr/include/c++/14/bits/basic_string.h:682:35: note: no known conversion for argument 1 from '__gnu_cxx::__alloc_traits<std::allocator<int>, int>::value_type' {aka 'int'} to 'std::__cxx11::basic_string<char>&&' 682 | basic_string(basic_string&& __str) noexcept | ~~~~~~~~~~~~~~~^~~~~ /usr/include/c++/14/bits/basic_string.h:624:7: note: candidate: 'std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::basic_string(const _CharT*, size_type, const _Alloc&) [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>; size_type = long unsigned int]' 624 | basic_string(const _CharT* __s, size_type __n, | ^~~~~~~~~~~~ /usr/include/c++/14/bits/basic_string.h:624:7: note: candidate expects 3 arguments, 1 provided /usr/include/c++/14/bits/basic_string.h:604:7: note: candidate: 'std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::basic_string(const std::__cxx11::basic_string<_CharT, _Traits, _Alloc>&, size_type, size_type, const _Alloc&) [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>; size_type = long unsigned int]' 604 | basic_string(const basic_string& __str, size_type __pos, | ^~~~~~~~~~~~ /usr/include/c++/14/bits/basic_string.h:604:7: note: candidate expects 4 arguments, 1 provided /usr/include/c++/14/bits/basic_string.h:586:7: note: candidate: 'std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::basic_string(const std::__cxx11::basic_string<_CharT, _Traits, _Alloc>&, size_type, size_type) [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>; size_type = long unsigned int]' 586 | basic_string(const basic_string& __str, size_type __pos, | ^~~~~~~~~~~~ /usr/include/c++/14/bits/basic_string.h:586:7: note: candidate expects 3 arguments, 1 provided /usr/include/c++/14/bits/basic_string.h:569:7: note: candidate: 'std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::basic_string(const std::__cxx11::basic_string<_CharT, _Traits, _Alloc>&, size_type, const _Alloc&) [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>; size_type = long unsigned int]' 569 | basic_string(const basic_string& __str, size_type __pos, | ^~~~~~~~~~~~ /usr/include/c++/14/bits/basic_string.h:569:7: note: candidate expects 3 arguments, 1 provided /usr/include/c++/14/bits/basic_string.h:552:7: note: candidate: 'std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::basic_string(const std::__cxx11::basic_string<_CharT, _Traits, _Alloc>&) [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>]' 552 | basic_string(const basic_string& __str) | ^~~~~~~~~~~~ /usr/include/c++/14/bits/basic_string.h:552:40: note: no known conversion for argument 1 from '__gnu_cxx::__alloc_traits<std::allocator<int>, int>::value_type' {aka 'int'} to 'const std::__cxx11::basic_string<char>&' 552 | basic_string(const basic_string& __str) | ~~~~~~~~~~~~~~~~~~~~^~~~~ /usr/include/c++/14/bits/basic_string.h:540:7: note: candidate: 'std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::basic_string(const _Alloc&) [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>]' 540 | basic_string(const _Al
s622405804
p04044
C++
#include <bits/stdc++.h> using namespace std; int main() { int N, L; cin >> N >> L; vector<int> S(N); for (int i = 0; i < N; i++) { cin >> S.at(i); } sort(S.begin(), S.end()); for (int i = 0; i < N; i++) { cout << (string)S.at(i); } cout << endl; }
a.cc: In function 'int main()': a.cc:13:27: error: no matching function for call to 'std::__cxx11::basic_string<char>::basic_string(__gnu_cxx::__alloc_traits<std::allocator<int>, int>::value_type&)' 13 | cout << (string)S.at(i); | ^ In file included from /usr/include/c++/14/string:54, from /usr/include/c++/14/bitset:52, from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:52, from a.cc:1: /usr/include/c++/14/bits/basic_string.h:800:9: note: candidate: 'template<class _Tp, class> std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::basic_string(const _Tp&, const _Alloc&) [with <template-parameter-2-2> = _Tp; _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>]' 800 | basic_string(const _Tp& __t, const _Alloc& __a = _Alloc()) | ^~~~~~~~~~~~ /usr/include/c++/14/bits/basic_string.h:800:9: note: template argument deduction/substitution failed: In file included from /usr/include/c++/14/bits/stl_pair.h:60, from /usr/include/c++/14/bits/stl_algobase.h:64, from /usr/include/c++/14/algorithm:60, from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:51: /usr/include/c++/14/type_traits: In substitution of 'template<bool _Cond, class _Tp> using std::enable_if_t = typename std::enable_if::type [with bool _Cond = false; _Tp = void]': /usr/include/c++/14/bits/basic_string.h:149:8: required by substitution of 'template<class _CharT, class _Traits, class _Alloc> template<class _Tp, class _Res> using std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::_If_sv = std::enable_if_t<((bool)std::__and_<std::is_convertible<const _Tp&, std::basic_string_view<_CharT, _Traits> >, std::__not_<std::is_convertible<const _Tp*, const std::__cxx11::basic_string<_CharT, _Traits, _Alloc>*> >, std::__not_<std::is_convertible<const _Tp&, const _CharT*> > >::value), _Res> [with _Tp = int; _Res = void; _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>]' 149 | using _If_sv = enable_if_t< | ^~~~~~ /usr/include/c++/14/bits/basic_string.h:797:30: required from here 797 | template<typename _Tp, typename = _If_sv<_Tp, void>> | ^~~~~~~~ /usr/include/c++/14/type_traits:2711:11: error: no type named 'type' in 'struct std::enable_if<false, void>' 2711 | using enable_if_t = typename enable_if<_Cond, _Tp>::type; | ^~~~~~~~~~~ /usr/include/c++/14/bits/basic_string.h:788:9: note: candidate: 'template<class _Tp, class> std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::basic_string(const _Tp&, size_type, size_type, const _Alloc&) [with <template-parameter-2-2> = _Tp; _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>]' 788 | basic_string(const _Tp& __t, size_type __pos, size_type __n, | ^~~~~~~~~~~~ /usr/include/c++/14/bits/basic_string.h:788:9: note: candidate expects 3 arguments, 1 provided /usr/include/c++/14/bits/basic_string.h:765:9: note: candidate: 'template<class _InputIterator, class> std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::basic_string(_InputIterator, _InputIterator, const _Alloc&) [with <template-parameter-2-2> = _InputIterator; _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>]' 765 | basic_string(_InputIterator __beg, _InputIterator __end, | ^~~~~~~~~~~~ /usr/include/c++/14/bits/basic_string.h:765:9: note: candidate expects 2 arguments, 1 provided /usr/include/c++/14/bits/basic_string.h:669:7: note: candidate: 'template<class> std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::basic_string(size_type, _CharT, const _Alloc&) [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>]' 669 | basic_string(size_type __n, _CharT __c, const _Alloc& __a = _Alloc()) | ^~~~~~~~~~~~ /usr/include/c++/14/bits/basic_string.h:669:7: note: candidate expects 2 arguments, 1 provided /usr/include/c++/14/bits/basic_string.h:646:7: note: candidate: 'template<class> std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::basic_string(const _CharT*, const _Alloc&) [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>]' 646 | basic_string(const _CharT* __s, const _Alloc& __a = _Alloc()) | ^~~~~~~~~~~~ /usr/include/c++/14/bits/basic_string.h:646:7: note: template argument deduction/substitution failed: a.cc:13:25: note: cannot convert 'S.std::vector<int>::at(((std::vector<int>::size_type)i))' (type '__gnu_cxx::__alloc_traits<std::allocator<int>, int>::value_type' {aka 'int'}) to type 'const char*' 13 | cout << (string)S.at(i); | ~~~~^~~ /usr/include/c++/14/bits/basic_string.h:721:7: note: candidate: 'std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::basic_string(std::__cxx11::basic_string<_CharT, _Traits, _Alloc>&&, const _Alloc&) [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>]' 721 | basic_string(basic_string&& __str, const _Alloc& __a) | ^~~~~~~~~~~~ /usr/include/c++/14/bits/basic_string.h:721:7: note: candidate expects 2 arguments, 1 provided /usr/include/c++/14/bits/basic_string.h:716:7: note: candidate: 'std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::basic_string(const std::__cxx11::basic_string<_CharT, _Traits, _Alloc>&, const _Alloc&) [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>]' 716 | basic_string(const basic_string& __str, const _Alloc& __a) | ^~~~~~~~~~~~ /usr/include/c++/14/bits/basic_string.h:716:7: note: candidate expects 2 arguments, 1 provided /usr/include/c++/14/bits/basic_string.h:711:7: note: candidate: 'std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::basic_string(std::initializer_list<_Tp>, const _Alloc&) [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>]' 711 | basic_string(initializer_list<_CharT> __l, const _Alloc& __a = _Alloc()) | ^~~~~~~~~~~~ /usr/include/c++/14/bits/basic_string.h:711:45: note: no known conversion for argument 1 from '__gnu_cxx::__alloc_traits<std::allocator<int>, int>::value_type' {aka 'int'} to 'std::initializer_list<char>' 711 | basic_string(initializer_list<_CharT> __l, const _Alloc& __a = _Alloc()) | ~~~~~~~~~~~~~~~~~~~~~~~~~^~~ /usr/include/c++/14/bits/basic_string.h:682:7: note: candidate: 'std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::basic_string(std::__cxx11::basic_string<_CharT, _Traits, _Alloc>&&) [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>]' 682 | basic_string(basic_string&& __str) noexcept | ^~~~~~~~~~~~ /usr/include/c++/14/bits/basic_string.h:682:35: note: no known conversion for argument 1 from '__gnu_cxx::__alloc_traits<std::allocator<int>, int>::value_type' {aka 'int'} to 'std::__cxx11::basic_string<char>&&' 682 | basic_string(basic_string&& __str) noexcept | ~~~~~~~~~~~~~~~^~~~~ /usr/include/c++/14/bits/basic_string.h:624:7: note: candidate: 'std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::basic_string(const _CharT*, size_type, const _Alloc&) [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>; size_type = long unsigned int]' 624 | basic_string(const _CharT* __s, size_type __n, | ^~~~~~~~~~~~ /usr/include/c++/14/bits/basic_string.h:624:7: note: candidate expects 3 arguments, 1 provided /usr/include/c++/14/bits/basic_string.h:604:7: note: candidate: 'std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::basic_string(const std::__cxx11::basic_string<_CharT, _Traits, _Alloc>&, size_type, size_type, const _Alloc&) [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>; size_type = long unsigned int]' 604 | basic_string(const basic_string& __str, size_type __pos, | ^~~~~~~~~~~~ /usr/include/c++/14/bits/basic_string.h:604:7: note: candidate expects 4 arguments, 1 provided /usr/include/c++/14/bits/basic_string.h:586:7: note: candidate: 'std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::basic_string(const std::__cxx11::basic_string<_CharT, _Traits, _Alloc>&, size_type, size_type) [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>; size_type = long unsigned int]' 586 | basic_string(const basic_string& __str, size_type __pos, | ^~~~~~~~~~~~ /usr/include/c++/14/bits/basic_string.h:586:7: note: candidate expects 3 arguments, 1 provided /usr/include/c++/14/bits/basic_string.h:569:7: note: candidate: 'std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::basic_string(const std::__cxx11::basic_string<_CharT, _Traits, _Alloc>&, size_type, const _Alloc&) [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>; size_type = long unsigned int]' 569 | basic_string(const basic_string& __str, size_type __pos, | ^~~~~~~~~~~~ /usr/include/c++/14/bits/basic_string.h:569:7: note: candidate expects 3 arguments, 1 provided /usr/include/c++/14/bits/basic_string.h:552:7: note: candidate: 'std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::basic_string(const std::__cxx11::basic_string<_CharT, _Traits, _Alloc>&) [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>]' 552 | basic_string(const basic_string& __str) | ^~~~~~~~~~~~ /usr/include/c++/14/bits/basic_string.h:552:40: note: no known conversion for argument 1 from '__gnu_cxx::__alloc_traits<std::allocator<int>, int>::value_type' {aka 'int'} to 'const std::__cxx11::basic_string<char>&' 552 | basic_string(const basic_string& __str) | ~~~~~~~~~~~~~~~~~~~~^~~~~ /usr/include/c++/14/bits/basic_string.h:540:7: note: candidate: 'std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::basic_string(const _Alloc&) [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>]' 540 | basic_string(const _Alloc& __a
s464502586
p04044
C++
#include <bits/stdc++.h> using namespace std; int main() { int N,L; cin >> N >> L; vector<string> S(N); for (int i = 0;i < N;i++) { cin >> S.at(i); } for (int i = 0;i < N;i++) { for (int j = 0;j < N;j++) { if (S.at(j-1) < S.at(j)) { string m = S.at(j) S.at(j) = S.at(j-1) S.at(j-1) = m } } } for (int i = 0;i < N;i++) { cout << S.at(i); } cout << endl; }
a.cc: In function 'int main()': a.cc:15:11: error: expected ',' or ';' before 'S' 15 | S.at(j) = S.at(j-1) | ^
s116608845
p04044
C++
#include <bits/stdc++.h> using namespace std; int main() { int N,L; cin >> N >> L; vector<string> S(N); for (i = 0;i < N;i++) { cin >> S.at(i); } for (i = 0;i < N;i++) { for (j = 0;j < N;j++) { if (S.at(j-1) < S.at(j)) { string m = S.at(j) S.at(j) = S.at(j-1) S.at(j-1) = m } } } for (i = 0;i < N;i++) { cout << S.at(i); } cout << endl; }
a.cc: In function 'int main()': a.cc:8:8: error: 'i' was not declared in this scope 8 | for (i = 0;i < N;i++) { | ^ a.cc:11:8: error: 'i' was not declared in this scope 11 | for (i = 0;i < N;i++) { | ^ a.cc:12:10: error: 'j' was not declared in this scope 12 | for (j = 0;j < N;j++) { | ^ a.cc:17:7: error: expected ',' or ';' before '}' token 17 | } | ^ a.cc:20:8: error: 'i' was not declared in this scope 20 | for (i = 0;i < N;i++) { | ^
s261076673
p04044
C++
#include <algorithm> #include <iostream> #include <string> using namespace std; int main() { string a[10000],n,t; cin >> n >> t; for(int i = 0;i < n;i++) { cin >> a[i]; } sort(a,a+n); for(int i = 0;i < n;i++) { cout << a[i]; } cout << endl; return 0; }
a.cc: In function 'int main()': a.cc:9:21: error: no match for 'operator<' (operand types are 'int' and 'std::string' {aka 'std::__cxx11::basic_string<char>'}) 9 | for(int i = 0;i < n;i++) | ~ ^ ~ | | | | int std::string {aka std::__cxx11::basic_string<char>} In file included from /usr/include/c++/14/bits/stl_algobase.h:64, from /usr/include/c++/14/algorithm:60, from a.cc:1: /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:9:23: note: mismatched types 'const std::pair<_T1, _T2>' and 'int' 9 | for(int i = 0;i < n;i++) | ^ 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:9:23: note: mismatched types 'const std::reverse_iterator<_Iterator>' and 'int' 9 | for(int i = 0;i < n;i++) | ^ /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:9:23: note: mismatched types 'const std::reverse_iterator<_Iterator>' and 'int' 9 | for(int i = 0;i < n;i++) | ^ /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:9:23: note: mismatched types 'const std::move_iterator<_IteratorL>' and 'int' 9 | for(int i = 0;i < n;i++) | ^ /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:9:23: note: mismatched types 'const std::move_iterator<_IteratorL>' and 'int' 9 | for(int i = 0;i < n;i++) | ^ In file included from /usr/include/c++/14/bits/basic_string.h:47, from /usr/include/c++/14/string:54, from /usr/include/c++/14/bits/locale_classes.h:40, from /usr/include/c++/14/bits/ios_base.h:41, from /usr/include/c++/14/ios:44, from /usr/include/c++/14/ostream:40, from /usr/include/c++/14/iostream:41, from a.cc:2: /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:9:23: note: mismatched types 'std::basic_string_view<_CharT, _Traits>' and 'int' 9 | for(int i = 0;i < n;i++) | ^ /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:9:23: note: mismatched types 'std::basic_string_view<_CharT, _Traits>' and 'int' 9 | for(int i = 0;i < n;i++) | ^ /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:9:23: note: 'std::__cxx11::basic_string<char>' is not derived from 'std::basic_string_view<_CharT, _Traits>' 9 | for(int i = 0;i < n;i++) | ^ /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:9:23: note: mismatched types 'const std::__cxx11::basic_string<_CharT, _Traits, _Allocator>' and 'int' 9 | for(int i = 0;i < n;i++) | ^ /usr/include/c++/14/bits/basic_string.h:3888:5: note: candidate: 'template<class _CharT, class _Traits, class _Alloc> bool std::operator<(const __cxx11::basic_string<_CharT, _Traits, _Allocator>&, const _CharT*)' 3888 | operator<(const basic_string<_CharT, _Traits, _Alloc>& __lhs, | ^~~~~~~~ /usr/include/c++/14/bits/basic_string.h:3888:5: note: template argument deduction/substitution failed: a.cc:9:23: note: mismatched types 'const std::__cxx11::basic_string<_CharT, _Traits, _Allocator>' and 'int' 9 | for(int i = 0;i < n;i++) | ^ /usr/include/c++/14/bits/basic_string.h:3901:5: note: candidate: 'template<class _CharT, class _Traits, class _Alloc> bool std::operator<(const _CharT*, const __cxx11::basic_string<_CharT, _Traits, _Allocator>&)' 3901 | operator<(const _CharT* __lhs, | ^~~~~~~~ /usr/include/c++/14/bits/basic_string.h:3901:5: note: template argument deduction/substitution failed: a.cc:9:23: note: mismatched types 'const _CharT*' and 'int' 9 | for(int i = 0;i < n;i++) | ^ In file included from /usr/include/c++/14/bits/memory_resource.h:47, from /usr/include/c++/14/string:68: /usr/include/c++/14/tuple:2600:5: note: candidate: 'template<class ... _TElements, class ... _UElements> constexpr bool std::operator<(const tuple<_UTypes ...>&, const tuple<_Elements ...>&)' 2600 | operator<(const tuple<_TElements...>& __t, | ^~~~~~~~ /usr/include/c++/14/tuple:2600:5: note: template argument deduction/substitution failed: a.cc:9:23: note: mismatched types 'const std::tuple<_UTypes ...>' and 'int' 9 | for(int i = 0;i < n;i++) | ^ In file included from /usr/include/c++/14/bits/ios_base.h:46: /usr/include/c++/14/system_error:324:3: note: candidate: 'bool std::operator<(const error_code&, const error_code&)' 324 | operator<(const error_code& __lhs, const error_code& __rhs) noexcept | ^~~~~~~~ /usr/include/c++/14/system_error:324:31: note: no known conversion for argument 1 from 'int' to 'const std::error_code&' 324 | operator<(const error_code& __lhs, const error_code& __rhs) noexcept | ~~~~~~~~~~~~~~~~~~^~~~~ /usr/include/c++/14/system_error:507:3: note: candidate: 'bool std::operator<(const error_condition&, const error_condition&)' 507 | operator<(const error_condition& __lhs, | ^~~~~~~~ /usr/include/c++/14/system_error:507:36: note: no known conversion for argument 1 from 'int' to 'const std::error_condition&' 507 | operator<(const error_condition& __lhs, | ~~~~~~~~~~~~~~~~~~~~~~~^~~~~ a.cc:13:13: error: no match for 'operator+' (operand types are 'std::string [10000]' {aka 'std::__cxx11::basic_string<char> [10000]'} and 'std::string' {aka 'std::__cxx11::basic_string<char>'}) 13 | sort(a,a+n); | ~^~ | | | | | std::string {aka std::__cxx11::basic_string<char>} | std::string [10000] {aka std::__cxx11::basic_string<char> [10000]} /usr/include/c++/14/bits/stl_iterator.h:627:5: note: candidate: 'template<class _Iterator> constexpr std::reverse_iterator<_Iterator> std::operator+(typename reverse_iterator<_Iterator>::difference_type, const reverse_iterator<_Iterator>&)' 627 | operator+(typename reverse_iterator<_Iterator>::difference_type __n, | ^~~~~~~~ /usr/include/c++/14/bits/stl_iterator.h:627:5: note: template argument deduction/substitution failed: a.cc:13:14: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::reverse_iterator<_Iterator>' 13 | sort(a,a+n); | ^ /usr/include/c++/14/bits/stl_iterator.h:1798:5: note: candidate: 'template<class _Iterator> constexpr std::move_iterator<_IteratorL> std::operator+(typename move_iterator<_IteratorL>::difference_type, const move_iterator<_IteratorL>&)' 1798 | operator+(typename move_iterator<_Iterator>::difference_type __n, | ^~~~~~~~ /usr/include/c++/14/bits/stl_iterator.h:1798:5: note: template argument deduction/substitution failed: a.cc:13:14: note: 'std::string' {aka 'std::__cxx11::ba
s303412347
p04044
C++
#include<bits/stdc++.h> using namespace std; int main() { int i,N,L; string ans=""; cin >> N >> L; vector<string> v(N); for(i = 0;i < n;i++) cin >> v[i]; sort(v.begin(),v.end()); for(i = 0;i < n;i++) ans += v[i]; cout << ans << endl; return 0; }
a.cc: In function 'int main()': a.cc:9:17: error: 'n' was not declared in this scope 9 | for(i = 0;i < n;i++) | ^ a.cc:12:17: error: 'n' was not declared in this scope 12 | for(i = 0;i < n;i++) | ^
s598871575
p04044
C++
#include <iostream> using namespace std; int main() { int N, L; string result; cin >> N >> L; string a[N]; for (int i=0; i<N; i++) cin >> a[i]; sort(a, a+N, <string>()); for(int i=0; i<N; i++){ result += a[i]; } cout << result << endl; }
a.cc: In function 'int main()': a.cc:12:14: error: expected primary-expression before '<' token 12 | sort(a, a+N, <string>()); | ^ a.cc:12:21: error: expected primary-expression before '>' token 12 | sort(a, a+N, <string>()); | ^ a.cc:12:23: error: expected primary-expression before ')' token 12 | sort(a, a+N, <string>()); | ^ a.cc:12:1: error: 'sort' was not declared in this scope; did you mean 'short'? 12 | sort(a, a+N, <string>()); | ^~~~ | short
s685044058
p04044
C++
#include <iostream> using namespace std; int main() { int N, L; string result; cin >> N >> L; string a[N]; for (int i=0; i<N; i++) cin >> a[i]; sort(a, a+N); for(int i=0; i<N; i++){ result += a[i]; } cout << result << endl; }
a.cc: In function 'int main()': a.cc:12:1: error: 'sort' was not declared in this scope; did you mean 'short'? 12 | sort(a, a+N); | ^~~~ | short
s208120612
p04044
C++
#include <iostream> using namespace std; int main() { int N, L; string result; cin >> N >> L; string a[N]; for (int i=0; i<N; i++) cin >> a[i]; sort(a, a+N); for(int i=0; i<N; i++){ result += a[i]; } cout << result << endl; }
a.cc: In function 'int main()': a.cc:12:1: error: 'sort' was not declared in this scope; did you mean 'short'? 12 | sort(a, a+N); | ^~~~ | short
s720549956
p04044
C++
#include <iostream> using namespace std; int main() { int N, L; string result; cin >> N >> L; string a[N]; for (int i=0; i<N; i++) cin >> a[i]; sort(a, a+N); for(int i=0; i<N; i++){ result += a[i]; } cout << result << endl; }
a.cc: In function 'int main()': a.cc:12:1: error: 'sort' was not declared in this scope; did you mean 'short'? 12 | sort(a, a+N); | ^~~~ | short
s261256129
p04044
C++
#include <iostream> using namespace std; int main() { int N, L; string result; cin >> N >> L; string a[N]; for (int i=0; i<N; i++) cin >> a[i]; sort(a, a+N); for(int i=0; i<N; i++){ result += a[i]; } cout << result << endl; }
a.cc: In function 'int main()': a.cc:12:1: error: 'sort' was not declared in this scope; did you mean 'short'? 12 | sort(a, a+N); | ^~~~ | short
s242552417
p04044
Java
import java.util.*; public class Main { public static void main(String[] args) { Scanner scan = new Scanner(System.in); int a, b = scan.nextInt(), scan.nextInt(); String[] ABC = new int[a]; String small = ABC[0]; String output = ""; for (int x : ABC) { ABC[x] = scan.next(); } for (int i = 1; i < ABC.length;i++) { for (int x = 1; x < ABC.length;x++) if (small > ABC[x]) small = ABC[x]; output+=small; } System.out.println(small); } }
Main.java:6: error: ';' expected int a, b = scan.nextInt(), scan.nextInt(); ^ 1 error
s511924008
p04044
Java
import java.util.*; public class Main{ public static void main(String args[]){ Scanner in = new Scanner(System.in); int n, l; n = in.nextInt(); l = in.nextInt(); String[] S = new String[n]; for (int i = 0; i < n; i++) S[i] = in.nextInt(); S.sort(); for (int i = 0; i < n; i++) System.out.print(S[i]); System.out.println(); } }
Main.java:11: error: incompatible types: int cannot be converted to String for (int i = 0; i < n; i++) S[i] = in.nextInt(); ^ Main.java:12: error: cannot find symbol S.sort(); ^ symbol: method sort() location: variable S of type String[] 2 errors
s121084318
p04044
Java
import java.util.*; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int n = sc.nextInt(); int l = sc.nextInt(); String[] s = new String[n]; for(int i = 0; i < n; i++) { s[i] = sc.next(); } Collections.sort(s); String ans = ""; for(int i = 0; i < n; i++) { ans += s[i]; } System.out.println(ans); } }
Main.java:12: error: no suitable method found for sort(String[]) Collections.sort(s); ^ method Collections.<T#1>sort(List<T#1>) is not applicable (cannot infer type-variable(s) T#1 (argument mismatch; String[] cannot be converted to List<T#1>)) method Collections.<T#2>sort(List<T#2>,Comparator<? super T#2>) is not applicable (cannot infer type-variable(s) T#2 (actual and formal argument lists differ in length)) where T#1,T#2 are type-variables: T#1 extends Comparable<? super T#1> declared in method <T#1>sort(List<T#1>) T#2 extends Object declared in method <T#2>sort(List<T#2>,Comparator<? super T#2>) 1 error
s530824346
p04044
Java
import java.util.Scanner; public class Main{ public static void main(String[] args){ Scanner sc = new Scanner(System.in); int length = sc.nextInt(); int number = sc.nextInt(); String[] strings = new String[number]; for(int i = 0; i < number; i++) strings[i] = sc.next(); for(int i = 0; i < strings.length; i++){ for(int j = number - 1; j > i; j--){ //バブルソート if(strings[j-1].compareTo(strings[j]) > 0){ String swap = strings[j-1]; strings[j-1] = strings[j]; strings[j] = swap; } } } for(int i = 0; i < strings.length; i++){ StringBuffer sb = new StringBuffer(); sb.append(strings[i]); } System.out.println(sb); } }
Main.java:24: error: cannot find symbol System.out.println(sb); ^ symbol: variable sb location: class Main 1 error
s656054539
p04044
Java
import java.util.Scanner; public class Main{ public static void main(String[] args){ Scanner sc = new Scanner(System.in); int length = sc.nextInt(); int number = sc.nextInt(); String[] strings = new String[number]; for(int i = 0; i < number; i++) strings[i] = sc.next(); for(int i = 0; i < strings.length; i++){ for(int j = number - 1; j > i; j--){ //バブルソート if(strings[j-1].compareTo(strings[j] > 0){ String swap = strings[j-1]; strings[j-1] = strings[j]; strings[j] = swap; } } } for(int i = 0; i < strings.length; i++){ StringBuffer sb = new StringBuffer(); sb.append(strings[i]); } System.out.println(sb); } }
Main.java:13: error: ')' expected if(strings[j-1].compareTo(strings[j] > 0){ ^ 1 error
s837550934
p04044
C++
#include <bits/stdc++.h> #include <iostream> #include <string> using namespace std; #define REP(i,m,n) for(int i=(int)(m) ; i < (int) (n) ; ++i ) #define rep(i,n) REP(i,0,n) int main() { int N,L,i,j; cin >> N >> L; vector<string> v(N); rep(i,N){ cin >> v(i); } sort(v.begin(),v.end()); rep(i,N){ cout << v(i); } cout << endl; return 0; }
a.cc: In function 'int main()': a.cc:13:13: error: no match for call to '(std::vector<std::__cxx11::basic_string<char> >) (int&)' 13 | cin >> v(i); | ~^~~ a.cc:17:14: error: no match for call to '(std::vector<std::__cxx11::basic_string<char> >) (int&)' 17 | cout << v(i); | ~^~~
s432999910
p04044
C++
#include <bits/stdc++.h> using namespace std; int main() { vector <string> v; int n; cin >> n; while(n--) { string s; cin >> s; v.push_back(s); v.sort(v.begin(), v.end()); } for(int i = 0 ; i < v.end(); i++) cout<<v[i]; return 0; }
a.cc: In function 'int main()': a.cc:13:7: error: 'class std::vector<std::__cxx11::basic_string<char> >' has no member named 'sort' 13 | v.sort(v.begin(), v.end()); | ^~~~ a.cc:15:21: error: no match for 'operator<' (operand types are 'int' and 'std::vector<std::__cxx11::basic_string<char> >::iterator') 15 | for(int i = 0 ; i < v.end(); i++) | ~ ^ ~~~~~~~ | | | | int std::vector<std::__cxx11::basic_string<char> >::iterator 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:15:29: note: mismatched types 'const std::__cxx11::sub_match<_BiIter>' and 'int' 15 | for(int i = 0 ; i < v.end(); i++) | ^ /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:15:29: note: mismatched types 'std::__cxx11::__sub_match_string<_Bi_iter, _Ch_traits, _Ch_alloc>' and 'int' 15 | for(int i = 0 ; i < v.end(); i++) | ^ /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:15:29: note: mismatched types 'const std::__cxx11::sub_match<_BiIter>' and 'int' 15 | for(int i = 0 ; i < v.end(); i++) | ^ /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:15:29: note: 'std::vector<std::__cxx11::basic_string<char> >::iterator' is not derived from 'const std::__cxx11::sub_match<_BiIter>' 15 | for(int i = 0 ; i < v.end(); i++) | ^ /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:15:29: note: mismatched types 'const std::__cxx11::sub_match<_BiIter>' and 'int' 15 | for(int i = 0 ; i < v.end(); i++) | ^ /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:15:29: note: 'std::vector<std::__cxx11::basic_string<char> >::iterator' is not derived from 'const std::__cxx11::sub_match<_BiIter>' 15 | for(int i = 0 ; i < v.end(); i++) | ^ /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:15:29: note: mismatched types 'const std::__cxx11::sub_match<_BiIter>' and 'int' 15 | for(int i = 0 ; i < v.end(); i++) | ^ 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:15:29: note: mismatched types 'const std::pair<_T1, _T2>' and 'int' 15 | for(int i = 0 ; i < v.end(); i++) | ^ 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:15:29: note: mismatched types 'const std::reverse_iterator<_Iterator>' and 'int' 15 | for(int i = 0 ; i < v.end(); i++) | ^ /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:15:29: note: mismatched types 'const std::reverse_iterator<_Iterator>' and 'int' 15 | for(int i = 0 ; i < v.end(); i++) | ^ /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:15:29: note: mismatched types 'const std::move_iterator<_IteratorL>' and 'int' 15 | for(int i = 0 ; i < v.end(); i++) | ^ /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:15:29: note: mismatched types 'const std::move_iterator<_IteratorL>' and 'int' 15 | for(int i = 0 ; i < v.end(); i++) | ^ 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:15:29: note: mismatched types 'std::basic_string_view<_CharT, _Traits>' and 'int' 15 | for(int i = 0 ; i < v.end(); i++) | ^ /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:15:29: note: mismatched types 'std::basic_string_view<_CharT, _Traits>' and 'int' 15 | for(int i = 0 ; i < v.end(); i++) | ^ /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:15:29: note: '__gnu_cxx::__normal_iterator<std::__cxx11::basic_string<char>*, std::vector<std::__cxx11::basic_string<char> > >' is not derived from 'std::basic_string_view<_CharT, _Traits>' 15 | for(int i = 0 ; i < v.end(); i++) | ^ /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/ba
s446798105
p04044
C++
// _/ _/ _/_/_/ _/ //_/_/_/_/ _/_/ _/_/_/_/ _/_/ _/ _/_/ // _/ _/ _/ _/ _/ _/ _/_/_/ _/ //_/ _/ _/ _/ _/ _/ _/ _/ _/ // _/_/ _/_/ _/_/ _/_/ _/_/ _/ #include<iostream> #include<algorithm> #include<cmath> #include<iomanip> #include<set> #include<map> #include<queue> #include<vector> #include<string> using namespace std; typedef long long ll; const int MOD=1e9+7; const double pi=3.14159265358979323846; const int inf=2e9; const ll INF=5e18; typedef pair<int,int> P; signed main() { cin.tie(0),cout.tie(0); ios::sync_with_stdio(false); int n; string s[105]={}; cin >> n; for(int i=0; i<n; i++) { cin > s[i]; } sort(s,s+n); for(int i=0; i<n; i++) { cout << s[i]; } cout << endl; }
a.cc: In function 'int main()': a.cc:29:9: error: no match for 'operator>' (operand types are 'std::istream' {aka 'std::basic_istream<char>'} and 'std::string' {aka 'std::__cxx11::basic_string<char>'}) 29 | cin > s[i]; | ~~~ ^ ~~~~ | | | | | std::string {aka std::__cxx11::basic_string<char>} | std::istream {aka std::basic_istream<char>} In file included from /usr/include/c++/14/string:48, from /usr/include/c++/14/bits/locale_classes.h:40, from /usr/include/c++/14/bits/ios_base.h:41, from /usr/include/c++/14/ios:44, from /usr/include/c++/14/ostream:40, from /usr/include/c++/14/iostream:41, from a.cc:6: /usr/include/c++/14/bits/stl_iterator.h:462:5: note: candidate: 'template<class _Iterator> constexpr bool std::operator>(const reverse_iterator<_Iterator>&, const reverse_iterator<_Iterator>&)' 462 | operator>(const reverse_iterator<_Iterator>& __x, | ^~~~~~~~ /usr/include/c++/14/bits/stl_iterator.h:462:5: note: template argument deduction/substitution failed: a.cc:29:14: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'const std::reverse_iterator<_Iterator>' 29 | cin > s[i]; | ^ /usr/include/c++/14/bits/stl_iterator.h:507:5: note: candidate: 'template<class _IteratorL, class _IteratorR> constexpr bool std::operator>(const reverse_iterator<_Iterator>&, const reverse_iterator<_IteratorR>&)' 507 | operator>(const reverse_iterator<_IteratorL>& __x, | ^~~~~~~~ /usr/include/c++/14/bits/stl_iterator.h:507:5: note: template argument deduction/substitution failed: a.cc:29:14: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'const std::reverse_iterator<_Iterator>' 29 | cin > s[i]; | ^ /usr/include/c++/14/bits/stl_iterator.h:1714:5: note: candidate: 'template<class _IteratorL, class _IteratorR> constexpr bool std::operator>(const move_iterator<_IteratorL>&, const move_iterator<_IteratorR>&)' 1714 | operator>(const move_iterator<_IteratorL>& __x, | ^~~~~~~~ /usr/include/c++/14/bits/stl_iterator.h:1714:5: note: template argument deduction/substitution failed: a.cc:29:14: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'const std::move_iterator<_IteratorL>' 29 | cin > s[i]; | ^ /usr/include/c++/14/bits/stl_iterator.h:1774:5: note: candidate: 'template<class _Iterator> constexpr bool std::operator>(const move_iterator<_IteratorL>&, const move_iterator<_IteratorL>&)' 1774 | operator>(const move_iterator<_Iterator>& __x, | ^~~~~~~~ /usr/include/c++/14/bits/stl_iterator.h:1774:5: note: template argument deduction/substitution failed: a.cc:29:14: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'const std::move_iterator<_IteratorL>' 29 | cin > s[i]; | ^ In file included from /usr/include/c++/14/bits/stl_algobase.h:64, from /usr/include/c++/14/string:51: /usr/include/c++/14/bits/stl_pair.h:1058:5: note: candidate: 'template<class _T1, class _T2> constexpr bool std::operator>(const pair<_T1, _T2>&, const pair<_T1, _T2>&)' 1058 | operator>(const pair<_T1, _T2>& __x, const pair<_T1, _T2>& __y) | ^~~~~~~~ /usr/include/c++/14/bits/stl_pair.h:1058:5: note: template argument deduction/substitution failed: a.cc:29:14: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'const std::pair<_T1, _T2>' 29 | cin > s[i]; | ^ In file included from /usr/include/c++/14/bits/basic_string.h:47, from /usr/include/c++/14/string:54: /usr/include/c++/14/string_view:695:5: note: candidate: 'template<class _CharT, class _Traits> constexpr bool std::operator>(basic_string_view<_CharT, _Traits>, basic_string_view<_CharT, _Traits>)' 695 | operator> (basic_string_view<_CharT, _Traits> __x, | ^~~~~~~~ /usr/include/c++/14/string_view:695:5: note: template argument deduction/substitution failed: a.cc:29:14: note: 'std::basic_istream<char>' is not derived from 'std::basic_string_view<_CharT, _Traits>' 29 | cin > s[i]; | ^ /usr/include/c++/14/string_view:702:5: note: candidate: 'template<class _CharT, class _Traits> constexpr bool std::operator>(basic_string_view<_CharT, _Traits>, __type_identity_t<basic_string_view<_CharT, _Traits> >)' 702 | operator> (basic_string_view<_CharT, _Traits> __x, | ^~~~~~~~ /usr/include/c++/14/string_view:702:5: note: template argument deduction/substitution failed: a.cc:29:14: note: 'std::basic_istream<char>' is not derived from 'std::basic_string_view<_CharT, _Traits>' 29 | cin > s[i]; | ^ /usr/include/c++/14/string_view:710:5: note: candidate: 'template<class _CharT, class _Traits> constexpr bool std::operator>(__type_identity_t<basic_string_view<_CharT, _Traits> >, basic_string_view<_CharT, _Traits>)' 710 | operator> (__type_identity_t<basic_string_view<_CharT, _Traits>> __x, | ^~~~~~~~ /usr/include/c++/14/string_view:710:5: note: template argument deduction/substitution failed: a.cc:29:14: note: 'std::__cxx11::basic_string<char>' is not derived from 'std::basic_string_view<_CharT, _Traits>' 29 | cin > s[i]; | ^ /usr/include/c++/14/bits/basic_string.h:3915:5: note: candidate: 'template<class _CharT, class _Traits, class _Alloc> bool std::operator>(const __cxx11::basic_string<_CharT, _Traits, _Allocator>&, const __cxx11::basic_string<_CharT, _Traits, _Allocator>&)' 3915 | operator>(const basic_string<_CharT, _Traits, _Alloc>& __lhs, | ^~~~~~~~ /usr/include/c++/14/bits/basic_string.h:3915:5: note: template argument deduction/substitution failed: a.cc:29:14: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'const std::__cxx11::basic_string<_CharT, _Traits, _Allocator>' 29 | cin > s[i]; | ^ /usr/include/c++/14/bits/basic_string.h:3929:5: note: candidate: 'template<class _CharT, class _Traits, class _Alloc> bool std::operator>(const __cxx11::basic_string<_CharT, _Traits, _Allocator>&, const _CharT*)' 3929 | operator>(const basic_string<_CharT, _Traits, _Alloc>& __lhs, | ^~~~~~~~ /usr/include/c++/14/bits/basic_string.h:3929:5: note: template argument deduction/substitution failed: a.cc:29:14: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'const std::__cxx11::basic_string<_CharT, _Traits, _Allocator>' 29 | cin > s[i]; | ^ /usr/include/c++/14/bits/basic_string.h:3942:5: note: candidate: 'template<class _CharT, class _Traits, class _Alloc> bool std::operator>(const _CharT*, const __cxx11::basic_string<_CharT, _Traits, _Allocator>&)' 3942 | operator>(const _CharT* __lhs, | ^~~~~~~~ /usr/include/c++/14/bits/basic_string.h:3942:5: note: template argument deduction/substitution failed: a.cc:29:14: note: mismatched types 'const _CharT*' and 'std::basic_istream<char>' 29 | cin > s[i]; | ^ In file included from /usr/include/c++/14/bits/memory_resource.h:47, from /usr/include/c++/14/string:68: /usr/include/c++/14/tuple:2619:5: note: candidate: 'template<class ... _TElements, class ... _UElements> constexpr bool std::operator>(const tuple<_UTypes ...>&, const tuple<_Elements ...>&)' 2619 | operator>(const tuple<_TElements...>& __t, | ^~~~~~~~ /usr/include/c++/14/tuple:2619:5: note: template argument deduction/substitution failed: a.cc:29:14: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'const std::tuple<_UTypes ...>' 29 | cin > s[i]; | ^ In file included from /usr/include/c++/14/set:63, from a.cc:10: /usr/include/c++/14/bits/stl_set.h:1039:5: note: candidate: 'template<class _Key, class _Compare, class _Alloc> bool std::operator>(const set<_Key, _Compare, _Allocator>&, const set<_Key, _Compare, _Allocator>&)' 1039 | operator>(const set<_Key, _Compare, _Alloc>& __x, | ^~~~~~~~ /usr/include/c++/14/bits/stl_set.h:1039:5: note: template argument deduction/substitution failed: a.cc:29:14: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'const std::set<_Key, _Compare, _Allocator>' 29 | cin > s[i]; | ^ In file included from /usr/include/c++/14/set:64: /usr/include/c++/14/bits/stl_multiset.h:1025:5: note: candidate: 'template<class _Key, class _Compare, class _Alloc> bool std::operator>(const multiset<_Key, _Compare, _Allocator>&, const multiset<_Key, _Compare, _Allocator>&)' 1025 | operator>(const multiset<_Key,_Compare,_Alloc>& __x, | ^~~~~~~~ /usr/include/c++/14/bits/stl_multiset.h:1025:5: note: template argument deduction/substitution failed: a.cc:29:14: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'const std::multiset<_Key, _Compare, _Allocator>' 29 | cin > s[i]; | ^ In file included from /usr/include/c++/14/map:63, from a.cc:11: /usr/include/c++/14/bits/stl_map.h:1564:5: note: candidate: 'template<class _Key, class _Tp, class _Compare, class _Alloc> bool std::operator>(const map<_Key, _Tp, _Compare, _Allocator>&, const map<_Key, _Tp, _Compare, _Allocator>&)' 1564 | operator>(const map<_Key, _Tp, _Compare, _Alloc>& __x, | ^~~~~~~~ /usr/include/c++/14/bits/stl_map.h:1564:5: note: template argument deduction/substitution failed: a.cc:29:14: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'const std::map<_Key, _Tp, _Compare, _Allocator>' 29 | cin > s[i]; | ^ In file included from /usr/include/c++/14/map:64: /usr/include/c++/14/bits/stl_multimap.h:1186:5: note: candidate: 'template<class _Key, class _Tp, class _Compare, class _Alloc> bool std::operator>(const multimap<_Key, _Tp, _Compare, _Allocator>&, const multimap<_Key, _Tp, _Compare, _Allocator>&)' 1186 | operator>(const multimap<_Key, _Tp, _
s576081394
p04044
C++
#include<iostream> #include<string> #include<algorithm> using namespace std ; int main(){ int n,l ; cin >> n >> l ; vector<string> a(n) ; for(int i=0;i<n;i++) cin >> a.at(i) ; sort(a.begin(),a.end()) ; for(auto i:a) cout << i ; cout << endl ; }
a.cc: In function 'int main()': a.cc:9:3: error: 'vector' was not declared in this scope 9 | vector<string> a(n) ; | ^~~~~~ a.cc:4:1: note: 'std::vector' is defined in header '<vector>'; this is probably fixable by adding '#include <vector>' 3 | #include<algorithm> +++ |+#include <vector> 4 | using namespace std ; a.cc:9:16: error: expected primary-expression before '>' token 9 | vector<string> a(n) ; | ^ a.cc:9:18: error: 'a' was not declared in this scope 9 | vector<string> a(n) ; | ^
s153950296
p04044
C++
#include <iostream> #include <vector> #include <string> using namespace std; int main(void) { int n ; int l ; vector<string> s(n) ; cin >> n >> l ; for(int i=0;i<n;i++){ cin >> s[i] ; } sort(s.begin(), s.end()); for(int i=0;i<n;i++){ cout << s[i] ; } return 0; }
a.cc: In function 'int main()': a.cc:17:2: error: 'sort' was not declared in this scope; did you mean 'short'? 17 | sort(s.begin(), s.end()); | ^~~~ | short
s011055325
p04044
C++
#include <iostream> #include <iomanip> #include <vector> #include <string> #include <algoritm> using namespace std; int main() { int n, l; cin >> n >> l; vector<string> strVec(n); for (int i = 0; i < n; i++) { cin >> setw(l) >> strVec[i]; } sort(strVec.begin(), strVec.end()); string res = ""; for (int i = 0; i < n; i++) { res = res + strVec[i]; } cout << res << endl; }
a.cc:5:10: fatal error: algoritm: No such file or directory 5 | #include <algoritm> | ^~~~~~~~~~ compilation terminated.
s057183896
p04044
C++
#include <iostream> #include <iomanip> #include <vector> #include <string> using namespace std; int main() { int n, l; cin >> n >> l; vector<string> strVec(n); for (int i = 0; i < n; i++) { cin >> setw(l) >> strVec[i]; } sort(strVec.begin(), strVec.end()); string res = ""; for (int i = 0; i < n; i++) { res = res + strVec[i]; } cout << res << endl; }
a.cc: In function 'int main()': a.cc:14:3: error: 'sort' was not declared in this scope; did you mean 'short'? 14 | sort(strVec.begin(), strVec.end()); | ^~~~ | short
s549016767
p04044
C++
int main(){ int n,l; cin >> n; cin >> l; string str[l]; string ans; for(int i=0;i<n;i++){ cin >> str[i]; } sort(str,str+n); for(int i=0;i<n;i++){ cout << str[i]; } }
a.cc: In function 'int main()': a.cc:3:5: error: 'cin' was not declared in this scope 3 | cin >> n; | ^~~ a.cc:5:5: error: 'string' was not declared in this scope 5 | string str[l]; | ^~~~~~ a.cc:6:11: error: expected ';' before 'ans' 6 | string ans; | ^~~~ | ; a.cc:9:16: error: 'str' was not declared in this scope; did you mean 'std'? 9 | cin >> str[i]; | ^~~ | std a.cc:11:10: error: 'str' was not declared in this scope; did you mean 'std'? 11 | sort(str,str+n); | ^~~ | std a.cc:11:5: error: 'sort' was not declared in this scope; did you mean 'short'? 11 | sort(str,str+n); | ^~~~ | short a.cc:13:9: error: 'cout' was not declared in this scope 13 | cout << str[i]; | ^~~~
s553733266
p04044
C++
#include <iostream> #include <vector> #include <string> #include <algorithm> using namespace std; int main(void){ int N,L; string s; cin >> N >> L; vector<string> v_s; while(getline(cin, s)){ v_s.push_back(s); } sort(v_s.begin(),v_s.end()); s = ""; for(auto& t_s : v_s){ s += t_s; } cout << t_s; }
a.cc: In function 'int main()': a.cc:20:13: error: 't_s' was not declared in this scope; did you mean 'v_s'? 20 | cout << t_s; | ^~~ | v_s
s169783930
p04044
C++
#include <iostream> #include <vector> #include <string> #include <algorithm> using namespace std; int main(void){ int N,L,i string s; cin << N << L; vector<string> v_s; while(getline(cin, s)){ v_s.push_back(s); } sort(v_s.begin(),v_s.end()); s = ""; for(auto& t_s : v_s){ s += t_s; } cout << t_s; }
a.cc: In function 'int main()': a.cc:9:5: error: expected initializer before 'string' 9 | string s; | ^~~~~~ a.cc:10:9: error: no match for 'operator<<' (operand types are 'std::istream' {aka 'std::basic_istream<char>'} and 'int') 10 | cin << N << L; | ~~~ ^~ ~ | | | | | int | std::istream {aka std::basic_istream<char>} a.cc:10:9: note: candidate: 'operator<<(int, int)' (built-in) 10 | cin << N << L; | ~~~~^~~~ a.cc:10:9: note: no known conversion for argument 1 from 'std::istream' {aka 'std::basic_istream<char>'} to 'int' In file included from /usr/include/c++/14/bits/basic_string.h:47, from /usr/include/c++/14/string:54, from /usr/include/c++/14/bits/locale_classes.h:40, from /usr/include/c++/14/bits/ios_base.h:41, from /usr/include/c++/14/ios:44, from /usr/include/c++/14/ostream:40, from /usr/include/c++/14/iostream:41, from a.cc:1: /usr/include/c++/14/string_view:763:5: note: candidate: 'template<class _CharT, class _Traits> std::basic_ostream<_CharT, _Traits>& std::operator<<(basic_ostream<_CharT, _Traits>&, basic_string_view<_CharT, _Traits>)' 763 | operator<<(basic_ostream<_CharT, _Traits>& __os, | ^~~~~~~~ /usr/include/c++/14/string_view:763:5: note: template argument deduction/substitution failed: a.cc:10:12: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<_CharT, _Traits>' 10 | cin << N << L; | ^ /usr/include/c++/14/bits/basic_string.h:4077:5: note: candidate: 'template<class _CharT, class _Traits, class _Alloc> std::basic_ostream<_CharT, _Traits>& std::operator<<(basic_ostream<_CharT, _Traits>&, const __cxx11::basic_string<_CharT, _Traits, _Allocator>&)' 4077 | operator<<(basic_ostream<_CharT, _Traits>& __os, | ^~~~~~~~ /usr/include/c++/14/bits/basic_string.h:4077:5: note: template argument deduction/substitution failed: a.cc:10:12: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<_CharT, _Traits>' 10 | cin << N << L; | ^ In file included from /usr/include/c++/14/bits/memory_resource.h:38, from /usr/include/c++/14/string:68: /usr/include/c++/14/cstddef:125:5: note: candidate: 'template<class _IntegerType> constexpr std::__byte_op_t<_IntegerType> std::operator<<(byte, _IntegerType)' 125 | operator<<(byte __b, _IntegerType __shift) noexcept | ^~~~~~~~ /usr/include/c++/14/cstddef:125:5: note: template argument deduction/substitution failed: a.cc:10:5: note: cannot convert 'std::cin' (type 'std::istream' {aka 'std::basic_istream<char>'}) to type 'std::byte' 10 | cin << N << L; | ^~~ In file included from /usr/include/c++/14/bits/ios_base.h:46: /usr/include/c++/14/system_error:339:5: note: candidate: 'template<class _CharT, class _Traits> std::basic_ostream<_CharT, _Traits>& std::operator<<(basic_ostream<_CharT, _Traits>&, const error_code&)' 339 | operator<<(basic_ostream<_CharT, _Traits>& __os, const error_code& __e) | ^~~~~~~~ /usr/include/c++/14/system_error:339:5: note: template argument deduction/substitution failed: a.cc:10:12: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<_CharT, _Traits>' 10 | cin << N << L; | ^ /usr/include/c++/14/ostream:563:5: note: candidate: 'template<class _CharT, class _Traits> std::basic_ostream<_CharT, _Traits>& std::operator<<(basic_ostream<_CharT, _Traits>&, _CharT)' 563 | operator<<(basic_ostream<_CharT, _Traits>& __out, _CharT __c) | ^~~~~~~~ /usr/include/c++/14/ostream:563:5: note: template argument deduction/substitution failed: a.cc:10:12: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<_CharT, _Traits>' 10 | cin << N << L; | ^ /usr/include/c++/14/ostream:573:5: note: candidate: 'template<class _CharT, class _Traits> std::basic_ostream<_CharT, _Traits>& std::operator<<(basic_ostream<_CharT, _Traits>&, char)' 573 | operator<<(basic_ostream<_CharT, _Traits>& __out, char __c) | ^~~~~~~~ /usr/include/c++/14/ostream:573:5: note: template argument deduction/substitution failed: a.cc:10:12: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<_CharT, _Traits>' 10 | cin << N << L; | ^ /usr/include/c++/14/ostream:579:5: note: candidate: 'template<class _Traits> std::basic_ostream<char, _Traits>& std::operator<<(basic_ostream<char, _Traits>&, char)' 579 | operator<<(basic_ostream<char, _Traits>& __out, char __c) | ^~~~~~~~ /usr/include/c++/14/ostream:579:5: note: template argument deduction/substitution failed: a.cc:10:12: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<char, _Traits>' 10 | cin << N << L; | ^ /usr/include/c++/14/ostream:590:5: note: candidate: 'template<class _Traits> std::basic_ostream<char, _Traits>& std::operator<<(basic_ostream<char, _Traits>&, signed char)' 590 | operator<<(basic_ostream<char, _Traits>& __out, signed char __c) | ^~~~~~~~ /usr/include/c++/14/ostream:590:5: note: template argument deduction/substitution failed: a.cc:10:12: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<char, _Traits>' 10 | cin << N << L; | ^ /usr/include/c++/14/ostream:595:5: note: candidate: 'template<class _Traits> std::basic_ostream<char, _Traits>& std::operator<<(basic_ostream<char, _Traits>&, unsigned char)' 595 | operator<<(basic_ostream<char, _Traits>& __out, unsigned char __c) | ^~~~~~~~ /usr/include/c++/14/ostream:595:5: note: template argument deduction/substitution failed: a.cc:10:12: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<char, _Traits>' 10 | cin << N << L; | ^ /usr/include/c++/14/ostream:654:5: note: candidate: 'template<class _CharT, class _Traits> std::basic_ostream<_CharT, _Traits>& std::operator<<(basic_ostream<_CharT, _Traits>&, const _CharT*)' 654 | operator<<(basic_ostream<_CharT, _Traits>& __out, const _CharT* __s) | ^~~~~~~~ /usr/include/c++/14/ostream:654:5: note: template argument deduction/substitution failed: a.cc:10:12: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<_CharT, _Traits>' 10 | cin << N << L; | ^ In file included from /usr/include/c++/14/ostream:1022: /usr/include/c++/14/bits/ostream.tcc:307:5: note: candidate: 'template<class _CharT, class _Traits> std::basic_ostream<_CharT, _Traits>& std::operator<<(basic_ostream<_CharT, _Traits>&, const char*)' 307 | operator<<(basic_ostream<_CharT, _Traits>& __out, const char* __s) | ^~~~~~~~ /usr/include/c++/14/bits/ostream.tcc:307:5: note: template argument deduction/substitution failed: a.cc:10:12: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<_CharT, _Traits>' 10 | cin << N << L; | ^ /usr/include/c++/14/ostream:671:5: note: candidate: 'template<class _Traits> std::basic_ostream<char, _Traits>& std::operator<<(basic_ostream<char, _Traits>&, const char*)' 671 | operator<<(basic_ostream<char, _Traits>& __out, const char* __s) | ^~~~~~~~ /usr/include/c++/14/ostream:671:5: note: template argument deduction/substitution failed: a.cc:10:12: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<char, _Traits>' 10 | cin << N << L; | ^ /usr/include/c++/14/ostream:684:5: note: candidate: 'template<class _Traits> std::basic_ostream<char, _Traits>& std::operator<<(basic_ostream<char, _Traits>&, const signed char*)' 684 | operator<<(basic_ostream<char, _Traits>& __out, const signed char* __s) | ^~~~~~~~ /usr/include/c++/14/ostream:684:5: note: template argument deduction/substitution failed: a.cc:10:12: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<char, _Traits>' 10 | cin << N << L; | ^ /usr/include/c++/14/ostream:689:5: note: candidate: 'template<class _Traits> std::basic_ostream<char, _Traits>& std::operator<<(basic_ostream<char, _Traits>&, const unsigned char*)' 689 | operator<<(basic_ostream<char, _Traits>& __out, const unsigned char* __s) | ^~~~~~~~ /usr/include/c++/14/ostream:689:5: note: template argument deduction/substitution failed: a.cc:10:12: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<char, _Traits>' 10 | cin << N << L; | ^ /usr/include/c++/14/ostream:810:5: note: candidate: 'template<class _Ostream, class _Tp> _Ostream&& std::operator<<(_Ostream&&, const _Tp&)' 810 | operator<<(_Ostream&& __os, const _Tp& __x) | ^~~~~~~~ /usr/include/c++/14/ostream:810:5: note: template argument deduction/substitution failed: /usr/include/c++/14/ostream: In substitution of 'template<class _Ostream, class _Tp> _Ostream&& std::operator<<(_Ostream&&, const _Tp&) [with _Ostream = std::basic_istream<char>&; _Tp = int]': a.cc:10:12: required from here 10 | cin << N << L; | ^ /usr/include/c++/14/ostream:810:5: error: no type named 'type' in 'struct std::enable_if<false, void>' 810 | operator<<(_Ostream&& __os, const _Tp& __x) | ^~~~~~~~ a.cc:12:24: error: 's' was not declared in this scope 12 | while(getline(cin, s)){ | ^ a.cc:16:9: error: 's' was not declared in this scope 16 | s = ""; | ^ a.cc:20:13: error: 't_s' was not declared in this scope; did you mean 'v_s'? 20 | cout << t_s; | ^~~ | v_s
s898101104
p04044
C++
#include<iostream> #include<string> using namespace std; bool Smaller(char a[], int a_length, char b[], int b_length){ int i; int min_length = a_length < b_length ? a_length : b_length; for(i=0; i<min_length; i++){ if(a[i] < b[i])return true; else if(a[i] > b[i]) return false; } return false; } void Swap(char a[], char b[], int length){ int i; for(i=0;i<length;i++){ char c; c = a[i]; a[i] = b[i]; b[i] = c; } return; } int main(){ cin >> string_length >> string_num; char strContainer[string_num][string_length]; int i; for(i=0;i<string_num;i++){ cin >> strContainer[i]; } //今回はバブルソートで bool sorting = true; while(sorting){ sorting=false; for(i=0;i<sorting_num-1;i++){ if(!Smaller(strContainer[i], string_length, strContainer[i+1], string_length){ Swap(strContainer[i], strContainer[i+1], string_length); sorting=true; } } char result[] = ""; for(i=0; i < string_num;i++){ cout << strContainer[i]; } } return 0; }
a.cc: In function 'int main()': a.cc:27:10: error: 'string_length' was not declared in this scope 27 | cin >> string_length >> string_num; | ^~~~~~~~~~~~~ a.cc:27:27: error: 'string_num' was not declared in this scope 27 | cin >> string_length >> string_num; | ^~~~~~~~~~ a.cc:34:12: error: 'strContainer' was not declared in this scope 34 | cin >> strContainer[i]; | ^~~~~~~~~~~~ a.cc:41:15: error: 'sorting_num' was not declared in this scope; did you mean 'sorting'? 41 | for(i=0;i<sorting_num-1;i++){ | ^~~~~~~~~~~ | sorting a.cc:42:19: error: 'strContainer' was not declared in this scope 42 | if(!Smaller(strContainer[i], string_length, strContainer[i+1], string_length){ | ^~~~~~~~~~~~ a.cc:42:84: error: expected ')' before '{' token 42 | if(!Smaller(strContainer[i], string_length, strContainer[i+1], string_length){ | ~ ^ | ) a.cc:46:5: error: expected primary-expression before '}' token 46 | } | ^ a.cc:51:15: error: 'strContainer' was not declared in this scope 51 | cout << strContainer[i]; | ^~~~~~~~~~~~
s113253550
p04044
C++
#include<iostream> #include<string> using namespace std; bool Smaller(char a*, int a_length, char b*, int b_length){ int i; int min_length = a_length < b_length ? a_length : b_length; for(i=0; i<min_length; i++){ if(a[i] < b[i])return true; else if(a[i] > b[i]) return false; } return false; } void Swap(char a*, char b*, int length){ int i; for(i=0;i<length;i++){ char c; c = a[i]; a[i] = b[i]; b[i] = c; } return; } int main(){ cin >> string_length >> string_num; char strContainer[string_num][string_length]; int i; for(i=0;i<string_num;i++){ cin >> strContainer[i]; } //今回はバブルソートで bool sorting = true; while(sorting){ sorting=false; for(i=0;i<sorting_num-1;i++){ if(!Smaller(strContainer[i], string_length, strContainer[i+1], string_length){ Swap(strContainer[i], strContainer[i+1], string_length); sorting=true; } } char result[] = ""; for(i=0; i < string_num;i++){ cout << strContainer[i]; } } return 0; }
a.cc:5:20: error: expected ',' or '...' before '*' token 5 | bool Smaller(char a*, int a_length, char b*, int b_length){ | ^ a.cc: In function 'bool Smaller(char)': a.cc:7:26: error: 'a_length' was not declared in this scope; did you mean 'min_length'? 7 | int min_length = a_length < b_length ? a_length : b_length; | ^~~~~~~~ | min_length a.cc:7:37: error: 'b_length' was not declared in this scope; did you mean 'min_length'? 7 | int min_length = a_length < b_length ? a_length : b_length; | ^~~~~~~~ | min_length a.cc:9:11: error: invalid types 'char[int]' for array subscript 9 | if(a[i] < b[i])return true; | ^ a.cc:9:17: error: 'b' was not declared in this scope 9 | if(a[i] < b[i])return true; | ^ a.cc:10:16: error: invalid types 'char[int]' for array subscript 10 | else if(a[i] > b[i]) return false; | ^ a.cc: At global scope: a.cc:15:17: error: expected ',' or '...' before '*' token 15 | void Swap(char a*, char b*, int length){ | ^ a.cc: In function 'void Swap(char)': a.cc:17:13: error: 'length' was not declared in this scope 17 | for(i=0;i<length;i++){ | ^~~~~~ a.cc:19:10: error: invalid types 'char[int]' for array subscript 19 | c = a[i]; | ^ a.cc:20:10: error: invalid types 'char[int]' for array subscript 20 | a[i] = b[i]; | ^ a.cc:20:16: error: 'b' was not declared in this scope 20 | a[i] = b[i]; | ^ a.cc: In function 'int main()': a.cc:27:10: error: 'string_length' was not declared in this scope 27 | cin >> string_length >> string_num; | ^~~~~~~~~~~~~ a.cc:27:27: error: 'string_num' was not declared in this scope 27 | cin >> string_length >> string_num; | ^~~~~~~~~~ a.cc:34:12: error: 'strContainer' was not declared in this scope 34 | cin >> strContainer[i]; | ^~~~~~~~~~~~ a.cc:41:15: error: 'sorting_num' was not declared in this scope; did you mean 'sorting'? 41 | for(i=0;i<sorting_num-1;i++){ | ^~~~~~~~~~~ | sorting a.cc:42:19: error: 'strContainer' was not declared in this scope 42 | if(!Smaller(strContainer[i], string_length, strContainer[i+1], string_length){ | ^~~~~~~~~~~~ a.cc:42:84: error: expected ')' before '{' token 42 | if(!Smaller(strContainer[i], string_length, strContainer[i+1], string_length){ | ~ ^ | ) a.cc:46:5: error: expected primary-expression before '}' token 46 | } | ^ a.cc:51:15: error: 'strContainer' was not declared in this scope 51 | cout << strContainer[i]; | ^~~~~~~~~~~~
s247390772
p04044
C++
#include<iostream> #include<string> #include<vector> int main(){ int string_length; int string_num; std::cin >> string_length >> string_num; std::vector<std::string> strings; int i; for(i=0; i < string_num; i++){ std::string input; std::cin >> input; strings.push_back(input); } std::string result; while(strings.size() > 0){ std::string minimum; int minimum_pos; minimum = strings[0]; minimum_pos = 0; for(i=0; i<strings.size(); i++){ if(strings[i].compare(minimum) < 0){ minimum = strings[i]; minimum_pos = i; } } result = result + minimum; strings.erase(strings.begin() + minimum_pos); } std::cout << result << endl; return 0; }
a.cc: In function 'int main()': a.cc:39:26: error: 'endl' was not declared in this scope; did you mean 'std::endl'? 39 | std::cout << result << endl; | ^~~~ | std::endl In file included from /usr/include/c++/14/iostream:41, from a.cc:1: /usr/include/c++/14/ostream:744:5: note: 'std::endl' declared here 744 | endl(basic_ostream<_CharT, _Traits>& __os) | ^~~~
s309144444
p04044
C++
#include<iostream> #include<string> int main(){ int string_length; int string_num; cin >> string_length >> string_num; std::vector<string> strings; int i; for(i=0; i < string_num; i++){ string input; cin >> input; strings.push_back(input); } string result; while(strings.size > 0){ string minimum; int minimum_pos; minimum = strings[0]; minimum_pos = 0; for(i=0; i<strings.size; i++){ if(strings[i].compare(minimum) < 0){ minimum = strings[i]; minimum_pos = i; } } result = result + minimum; strings.erase(minimum_pos); } cout << result; return 0; }
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 >> string_length >> string_num; | ^~~ | 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:10:8: error: 'vector' is not a member of 'std' 10 | std::vector<string> strings; | ^~~~~~ a.cc:2:1: note: 'std::vector' is defined in header '<vector>'; this is probably fixable by adding '#include <vector>' 1 | #include<iostream> +++ |+#include <vector> 2 | #include<string> a.cc:10:15: error: 'string' was not declared in this scope 10 | std::vector<string> strings; | ^~~~~~ a.cc:10:15: 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:10:23: error: 'strings' was not declared in this scope; did you mean 'stdin'? 10 | std::vector<string> strings; | ^~~~~~~ | stdin a.cc:14:11: error: expected ';' before 'input' 14 | string input; | ^~~~~~ | ; a.cc:15:12: error: 'input' was not declared in this scope; did you mean 'int'? 15 | cin >> input; | ^~~~~ | int a.cc:20:9: error: expected ';' before 'result' 20 | string result; | ^~~~~~~ | ; a.cc:23:11: error: expected ';' before 'minimum' 23 | string minimum; | ^~~~~~~~ | ; a.cc:26:9: error: 'minimum' was not declared in this scope; did you mean 'minimum_pos'? 26 | minimum = strings[0]; | ^~~~~~~ | minimum_pos a.cc:35:5: error: 'result' was not declared in this scope 35 | result = result + minimum; | ^~~~~~ a.cc:39:3: error: 'cout' was not declared in this scope; did you mean 'std::cout'? 39 | cout << result; | ^~~~ | std::cout /usr/include/c++/14/iostream:63:18: note: 'std::cout' declared here 63 | extern ostream cout; ///< Linked to standard output | ^~~~ a.cc:39:11: error: 'result' was not declared in this scope 39 | cout << result; | ^~~~~~
s851995505
p04044
C++
#include <iostream> #include <cstdio> #include <math.h> #include <vector> using namespace std; typedef long long int ll; #define rep(i,n) for(int i = 0; i < (n); ++i) #define vsort(a) sort(a.begin(), a.end()) #define rev(a) reverse(a.begin(), a.end()); const int MOD = 1000000007; const int INF = INT_MAX; const double PI = 3.14159265358979323846; int main(int argc, char const *argv[]) { int n, l; cin >> n >> l; string s[n]; for (int i=0; i < n; i++){ cin >> s[i]; } sort(s, s+n); for (int i=0; i < n; i++){ cout << s[i]; } cout << endl; return 0; } // g++ -std=c++1z
a.cc:17:17: error: 'INT_MAX' was not declared in this scope 17 | const int INF = INT_MAX; | ^~~~~~~ a.cc:5:1: note: 'INT_MAX' is defined in header '<climits>'; this is probably fixable by adding '#include <climits>' 4 | #include <vector> +++ |+#include <climits> 5 | a.cc: In function 'int main(int, const char**)': a.cc:32:5: error: 'sort' was not declared in this scope; did you mean 'sqrt'? 32 | sort(s, s+n); | ^~~~ | sqrt
s896013784
p04044
C++
#include <iostream> #include <cstdio> #include <math.h> #include <vector> using namespace std; typedef long long int ll; #define rep(i,n) for(int i = 0; i < (n); ++i) #define vsort(a) sort(a.begin(), a.end()) #define rev(a) reverse(a.begin(), a.end()); const int MOD = 1000000007; const int INF = INT_MAX; const double PI = 3.14159265358979323846; int main(int argc, char const *argv[]) { int n, l; cin >> n >> l; string s[n]; for (int i=0; i < n; i++){ cin >> s[i]; } sort(s, s+n); for (int i=0; i < n; i++){ cout << s[i]; } return 0; } // g++ -std=c++1z
a.cc:17:17: error: 'INT_MAX' was not declared in this scope 17 | const int INF = INT_MAX; | ^~~~~~~ a.cc:5:1: note: 'INT_MAX' is defined in header '<climits>'; this is probably fixable by adding '#include <climits>' 4 | #include <vector> +++ |+#include <climits> 5 | a.cc: In function 'int main(int, const char**)': a.cc:32:5: error: 'sort' was not declared in this scope; did you mean 'sqrt'? 32 | sort(s, s+n); | ^~~~ | sqrt
s509497501
p04044
C++
#include <bits/stdc++.h> using namespace std; int main(){ string ans, ct[109]; int n, l; cin >> n >> l; for(int i = 0; i < n; i++) cin >> ct[i]; sort(ct.begin(),ct.end()); ans = ct[0]; for(int i = 1; i < n; i++) ans = ans + ct[i]; cout << ans << endl; }
a.cc: In function 'int main()': a.cc:10:11: error: request for member 'begin' in 'ct', which is of non-class type 'std::string [109]' {aka 'std::__cxx11::basic_string<char> [109]'} 10 | sort(ct.begin(),ct.end()); | ^~~~~ a.cc:10:22: error: request for member 'end' in 'ct', which is of non-class type 'std::string [109]' {aka 'std::__cxx11::basic_string<char> [109]'} 10 | sort(ct.begin(),ct.end()); | ^~~
s918025019
p04044
C++
#include <bits/stdc++.h> using namespace std; int main(){ string ans, ct[109]; int n, l; cin >> n >> l; for(int i = 0; i < n; i++) ct.push_back(i); sort(ct.begin(),ct.end()); ans = ct[0]; for(int i = 1; i < n; i++) ans = ans + ct[i]; cout << ans << endl; }
a.cc: In function 'int main()': a.cc:9:8: error: request for member 'push_back' in 'ct', which is of non-class type 'std::string [109]' {aka 'std::__cxx11::basic_string<char> [109]'} 9 | ct.push_back(i); | ^~~~~~~~~ a.cc:10:11: error: request for member 'begin' in 'ct', which is of non-class type 'std::string [109]' {aka 'std::__cxx11::basic_string<char> [109]'} 10 | sort(ct.begin(),ct.end()); | ^~~~~ a.cc:10:22: error: request for member 'end' in 'ct', which is of non-class type 'std::string [109]' {aka 'std::__cxx11::basic_string<char> [109]'} 10 | sort(ct.begin(),ct.end()); | ^~~
s003799130
p04044
C++
#include<iostream> #include<stack> #include<string> using namespace std; int main() { int n,l; cin>>n>>l; string s[n]; for(int i=0;i<n;i++) { cin>>s[i]; } sort(s,s+n); string res; for(int i=0;i<n;i++) { res+=s[i]; } cout<<res<<endl; return 0; }
a.cc: In function 'int main()': a.cc:16:9: error: 'sort' was not declared in this scope; did you mean 'short'? 16 | sort(s,s+n); | ^~~~ | short
s146335317
p04044
Java
public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); String line = sc.nextLine(); String[] arr = line.split("\\s"); int n = Integer.parseInt(arr[0]); int l = Integer.parseInt(arr[1]); List<String> ss = new ArrayList<>(); while(sc.hasNextLine()) { ss.add(sc.nextLine()); } Collections.sort(ss); StringBuilder sb = new StringBuilder(); for(String s : ss) { sb.append(s); } return sb.toString(); } }
Main.java:3: error: cannot find symbol Scanner sc = new Scanner(System.in); ^ symbol: class Scanner location: class Main Main.java:3: error: cannot find symbol Scanner sc = new Scanner(System.in); ^ symbol: class Scanner location: class Main Main.java:8: error: cannot find symbol List<String> ss = new ArrayList<>(); ^ symbol: class List location: class Main Main.java:8: error: cannot find symbol List<String> ss = new ArrayList<>(); ^ symbol: class ArrayList location: class Main Main.java:13: error: cannot find symbol Collections.sort(ss); ^ symbol: variable Collections location: class Main Main.java:19: error: incompatible types: unexpected return value return sb.toString(); ^ 6 errors
s517653814
p04044
C++
n,l = map(int,input().split()) s=[] for _ in range(n): s.append(input()) s.sort() print(''.join(s))
a.cc:6:7: error: empty character constant 6 | print(''.join(s)) | ^~ a.cc:1:1: error: 'n' does not name a type 1 | n,l = map(int,input().split()) | ^
s007177879
p04044
C++
#include<iostream> #include<stdlib.h> #include<string> #include<string.h> using namespace std; int main(){ int N,L; cin>>N>>L; if(N<1){cout<<"N value should be >=1"<<endl; exit(0);} if(L<1||L>100){cout<<"L value out of bounds... 1<=L<100"<<endl;exit(0);} char A[N][L],b,T[L*N]; for(int i=0;i<N-1;i++) if(strcmp(A[i],A[i+1])>0) {b=A[i];A[i]=A[i+1];A[i+1]=b;} for(int i=0;i<N;i++) strcat(T,A[i]); return 0;}
a.cc: In function 'int main()': a.cc:15:7: error: invalid conversion from 'char*' to 'char' [-fpermissive] 15 | {b=A[i];A[i]=A[i+1];A[i+1]=b;} | ~~~^ | | | char* a.cc:15:13: error: invalid array assignment 15 | {b=A[i];A[i]=A[i+1];A[i+1]=b;} | ~~~~^~~~~~~ a.cc:15:27: error: incompatible types in assignment of 'char' to 'char [L]' 15 | {b=A[i];A[i]=A[i+1];A[i+1]=b;} | ~~~~~~^~
s818399396
p04044
C++
#include<iostream> #include<stdlib.h> #include<string> #include<string.h> using namespace std; int main(){ int N,L; cin>>N>>L; if(N<1){cout<<"N value should be >=1"<<endl; exit(0);} if(L<1||L>100){cout<<"L value out of bounds... 1<=L<100"<<endl;exit(0);} string A[N],b,T; for(int i=0;i<N-1;i++) if(strcmp(A[i],A[i+1])>0) {b=A[i];A[i]=A[i+1];A[i+1]=b;} T=A[i]; for(i=1;i<N;i++) T=T+A[i]; return 0;}
a.cc: In function 'int main()': a.cc:14:14: error: cannot convert 'std::string' {aka 'std::__cxx11::basic_string<char>'} to 'const char*' 14 | if(strcmp(A[i],A[i+1])>0) | ~~~^ | | | std::string {aka std::__cxx11::basic_string<char>} In file included from a.cc:4: /usr/include/string.h:156:32: note: initializing argument 1 of 'int strcmp(const char*, const char*)' 156 | extern int strcmp (const char *__s1, const char *__s2) | ~~~~~~~~~~~~^~~~ a.cc:16:5: error: 'i' was not declared in this scope 16 | T=A[i]; | ^
s828956797
p04044
C++
#include<iostream> #include<stdlib.h> #include<string> using namespace std; int main(){ int N,L; cin>>N>>L; if(N<1){cout<<"N value should be >=1"<<endl; exit(0);} if(L<1||L>100){cout<<"L value out of bounds... 1<=L<100"<<endl;exit(0);} string A[N],b,T; for(int i=0;i<N-1;i++) if(strcmp(A[i],A[i+1])>0) {b=A[i];A[i]=A[i+1];A[i+1]=b;} T=A[i]; for(i=1;i<N;i++) T=T+A[i]; return 0;}
a.cc: In function 'int main()': a.cc:12:4: error: 'strcmp' was not declared in this scope 12 | if(strcmp(A[i],A[i+1])>0) | ^~~~~~ a.cc:3:1: note: 'strcmp' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>' 2 | #include<stdlib.h> +++ |+#include <cstring> 3 | #include<string> a.cc:14:5: error: 'i' was not declared in this scope 14 | T=A[i]; | ^
s190706510
p04044
C++
#include<iostream.h> #include<stdlib.h> #include<string> using namespace std; int main(){ int N,L; cin>>N>>L; if(N<1){cout<<"N value should be >=1"<<endl; exit(0);} if(L<1||L>100){cout<<"L value out of bounds... 1<=L<100"<<endl;exit(0);} string A[N],b,T; for(int i=0;i<N-1;i++) if(strcmp(A[i],A[i+1])>0) {b=A[i];A[i]=A[i+1];A[i+1]=b;} T=A[i]; for(i=1;i<N;i++) T=T+A[i]; return 0;}
a.cc:1:9: fatal error: iostream.h: No such file or directory 1 | #include<iostream.h> | ^~~~~~~~~~~~ compilation terminated.
s354404998
p04044
C++
# cook your dish here s=input() m=s.split() n=int(s[0]); l=int(s[2]); list=[] for i in range(n): st=input() list.append(st) list.sort() for i in list: print(i,end="")
a.cc:1:3: error: invalid preprocessing directive #cook 1 | # cook your dish here | ^~~~ a.cc:2:1: error: 's' does not name a type 2 | s=input() | ^ a.cc:5:1: error: 'l' does not name a type 5 | l=int(s[2]); | ^ a.cc:6:1: error: 'list' does not name a type 6 | list=[] | ^~~~
s978195225
p04044
C++
#include<iostream> #include<vector> #include<algorithm> using namespace std; int main() { int N, L, i; cin >> N; cin >> L; vector<int> A(S, S+N); for (i=0; i<N; i++){ cin >> A[i]; } sort(A.begin(), A.end()); for(i=0; i<N; i++){ cout << A[i]; } return 0; }
a.cc: In function 'int main()': a.cc:10:19: error: 'S' was not declared in this scope 10 | vector<int> A(S, S+N); | ^
s567142102
p04044
C++
#include<iostream> #include<vector> #include<algorithm> using namespace std; int main() { int N, L, i; cin >> N; cin >> L; vector<int> A(data, data+N); for (i=0; i<N; i++){ cin >> A[i]; } sort(A.begin(), A.end()); for(i=0; i<N; i++){ cout << A[i]; } return 0; }
a.cc: In function 'int main()': a.cc:10:29: error: invalid operands of types '<unresolved overloaded function type>' and 'int' to binary 'operator+' 10 | vector<int> A(data, data+N); | ~~~~^~
s571280046
p04044
C++
#include<iostream> #include<vector> #include<algorithm> using namespace std; int main() { int N, L, i; cin >> N; cin >> L; vector<int> A(data, data+N) for (i=0; i<N; i++){ cin >> A[i]; } sort(A.begin(), A.end()); for(i=0; i<N; i++){ cout << A[i]; } return 0; }
a.cc: In function 'int main()': a.cc:10:29: error: invalid operands of types '<unresolved overloaded function type>' and 'int' to binary 'operator+' 10 | vector<int> A(data, data+N) | ~~~~^~ a.cc:12:5: error: expected ',' or ';' before 'for' 12 | for (i=0; i<N; i++){ | ^~~ a.cc:12:23: error: expected ';' before ')' token 12 | for (i=0; i<N; i++){ | ^ | ;
s451381830
p04044
C++
#include<iostream> using namespace std; int main() { int N, L, i; cin >> N; cin >> L; string S; for (i=0; i<N; i++){ cin >> S[i]; } sort(S.begin(), S.end)); for(i=0; i<N; i++){ cout << s[i]; } return 0; }
a.cc: In function 'int main()': a.cc:13:5: error: 'sort' was not declared in this scope; did you mean 'short'? 13 | sort(S.begin(), S.end)); | ^~~~ | short a.cc:16:17: error: 's' was not declared in this scope 16 | cout << s[i]; | ^
s640400069
p04044
C++
#include<iostream> using namespace std; int main() { int N, L, i; cin >> N; cin >> L; steing S; for (i=0; i<N; i++){ cin >> S[i]; } sort(S.begin(), S.end)); for(i=0; i<N; i++){ cout << s[i]; } return 0; }
a.cc: In function 'int main()': a.cc:9:5: error: 'steing' was not declared in this scope; did you mean 'stdin'? 9 | steing S; | ^~~~~~ | stdin a.cc:11:16: error: 'S' was not declared in this scope 11 | cin >> S[i]; | ^ a.cc:13:10: error: 'S' was not declared in this scope 13 | sort(S.begin(), S.end)); | ^ a.cc:13:5: error: 'sort' was not declared in this scope; did you mean 'short'? 13 | sort(S.begin(), S.end)); | ^~~~ | short a.cc:16:17: error: 's' was not declared in this scope 16 | cout << s[i]; | ^
s208262929
p04044
C++
#include<iostream> using namespace std; int main() { int N, L, i; cin >> N; cin >> L; steing s; for (i=0; i<N; i++){ cin >> s[i]; } sort(A.begin(), A.end)); for(i=0; i<N; i++){ cout << s[i]; } return 0; }
a.cc: In function 'int main()': a.cc:9:5: error: 'steing' was not declared in this scope; did you mean 'stdin'? 9 | steing s; | ^~~~~~ | stdin a.cc:11:16: error: 's' was not declared in this scope 11 | cin >> s[i]; | ^ a.cc:13:10: error: 'A' was not declared in this scope 13 | sort(A.begin(), A.end)); | ^ a.cc:13:5: error: 'sort' was not declared in this scope; did you mean 'short'? 13 | sort(A.begin(), A.end)); | ^~~~ | short a.cc:16:17: error: 's' was not declared in this scope 16 | cout << s[i]; | ^
s362380474
p04044
C++
#include <bits/stdc++.h> using namespace std; #include <algorithm> #define rep(i, N) for (int i = 0; i < (N); i++) #define all(a) (a).begin(), (a).end() #define pb push_back using ll = long long; using i_i = tuple<int, int>; int main(){ int N,L; cin >> N >> L; vector<string> S(N); rep(i, N) cin >> S[i]; sort(S.begin(),S.end()); cout << join(S,""); return 0; }
a.cc: In function 'int main()': a.cc:19:13: error: 'join' was not declared in this scope 19 | cout << join(S,""); | ^~~~
s834146578
p04044
C++
#include <bits/stdc++.h> using namespaces td; int main() { int n, l; cin >> n >> l; vector<string> v(n); for (int i = 0; i < n; i++) cin >> v[i]; sort(v.begin(), v.end()); for (int i = 0; i < n; i++) cout << v[i]; cout << endl; }
a.cc:2:7: error: expected nested-name-specifier before 'namespaces' 2 | using namespaces td; | ^~~~~~~~~~ a.cc: In function 'int main()': a.cc:4:13: error: 'cin' was not declared in this scope; did you mean 'std::cin'? 4 | int n, l; cin >> n >> l; | ^~~ | 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:5:3: error: 'vector' was not declared in this scope 5 | vector<string> v(n); | ^~~~~~ a.cc:5:3: note: suggested alternatives: In file included from /usr/include/c++/14/vector:66, from /usr/include/c++/14/functional:64, from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:53: /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:5:10: error: 'string' was not declared in this scope 5 | vector<string> v(n); | ^~~~~~ a.cc:5:10: 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: /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:5:18: error: 'v' was not declared in this scope 5 | vector<string> v(n); | ^ a.cc:7:3: error: 'sort' was not declared in this scope; did you mean 'std::sort'? 7 | sort(v.begin(), v.end()); | ^~~~ | std::sort In file included from /usr/include/c++/14/algorithm:86, from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:51: /usr/include/c++/14/pstl/glue_algorithm_defs.h:296:1: note: 'std::sort' declared here 296 | sort(_ExecutionPolicy&& __exec, _RandomAccessIterator __first, _RandomAccessIterator __last); | ^~~~ a.cc:8:31: error: 'cout' was not declared in this scope; did you mean 'std::cout'? 8 | for (int i = 0; i < n; i++) cout << v[i]; | ^~~~ | std::cout /usr/include/c++/14/iostream:63:18: note: 'std::cout' declared here 63 | extern ostream cout; ///< Linked to standard output | ^~~~ a.cc:9:3: error: 'cout' was not declared in this scope; did you mean 'std::cout'? 9 | cout << 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:9:11: error: 'endl' was not declared in this scope; did you mean 'std::endl'? 9 | cout << 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) | ^~~~
s423256341
p04044
Java
import java.util.*; import java.io.*; class Main{ public static void main(String[] args){ Scanner scan = new Scanner(System.in); String str = scan.next(); int N = Integer.parseInt(str); str = scan.next(); int L = Integer.parseInt(str); List<String> list = new ArrayList<>(); for(int i = 0; i < N; i++){ String input = scan.next(); list.add(input); } Arrays.sort(list); String ans = new String; for(i = 0; 2 ; i++){ input = list.get(i); ans = ans + input; } System.out.println(ans); } }
Main.java:18: error: '(' or '[' expected String ans = new String; ^ 1 error
s433392167
p04044
C++
#include <bits/stdc++.h> using namespace std; int main() { int N; int L; cin >> N >> L; vector<string> S(N); for (int i = 0; i < N; i++) { cin >> S.at(i); } sort(S.begin(), S.end()); // 昇順にソート for (int i = 0; i < N; i++) { cout >> S.at(i); } return 0; }
a.cc: In function 'int main()': a.cc:19:22: error: no match for 'operator>>' (operand types are 'std::ostream' {aka 'std::basic_ostream<char>'} and '__gnu_cxx::__alloc_traits<std::allocator<std::__cxx11::basic_string<char> >, std::__cxx11::basic_string<char> >::value_type' {aka 'std::__cxx11::basic_string<char>'}) 19 | cout >> S.at(i); | ~~~~ ^~ ~~~~~~~ | | | | | __gnu_cxx::__alloc_traits<std::allocator<std::__cxx11::basic_string<char> >, std::__cxx11::basic_string<char> >::value_type {aka std::__cxx11::basic_string<char>} | std::ostream {aka std::basic_ostream<char>} In file included from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:41, from a.cc:1: /usr/include/c++/14/cstddef:131:5: note: candidate: 'template<class _IntegerType> constexpr std::__byte_op_t<_IntegerType> std::operator>>(byte, _IntegerType)' 131 | operator>>(byte __b, _IntegerType __shift) noexcept | ^~~~~~~~ /usr/include/c++/14/cstddef:131:5: note: template argument deduction/substitution failed: a.cc:19:17: note: cannot convert 'std::cout' (type 'std::ostream' {aka 'std::basic_ostream<char>'}) to type 'std::byte' 19 | cout >> S.at(i); | ^~~~ In file included from /usr/include/c++/14/string:55, from /usr/include/c++/14/bitset:52, from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:52: /usr/include/c++/14/bits/basic_string.tcc:835:5: note: candidate: 'template<class _CharT, class _Traits, class _Alloc> std::basic_istream<_CharT, _Traits>& std::operator>>(basic_istream<_CharT, _Traits>&, __cxx11::basic_string<_CharT, _Traits, _Allocator>&)' 835 | operator>>(basic_istream<_CharT, _Traits>& __in, | ^~~~~~~~ /usr/include/c++/14/bits/basic_string.tcc:835:5: note: template argument deduction/substitution failed: a.cc:19:31: note: 'std::ostream' {aka 'std::basic_ostream<char>'} is not derived from 'std::basic_istream<_CharT, _Traits>' 19 | cout >> S.at(i); | ^ /usr/include/c++/14/bitset:1597:5: note: candidate: 'template<class _CharT, class _Traits, long unsigned int _Nb> std::basic_istream<_CharT, _Traits>& std::operator>>(basic_istream<_CharT, _Traits>&, bitset<_Nb>&)' 1597 | operator>>(std::basic_istream<_CharT, _Traits>& __is, bitset<_Nb>& __x) | ^~~~~~~~ /usr/include/c++/14/bitset:1597:5: note: template argument deduction/substitution failed: a.cc:19:31: note: 'std::ostream' {aka 'std::basic_ostream<char>'} is not derived from 'std::basic_istream<_CharT, _Traits>' 19 | cout >> S.at(i); | ^ In file included from /usr/include/c++/14/istream:1109, 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/bits/istream.tcc:978:5: note: candidate: 'template<class _CharT, class _Traits> std::basic_istream<_CharT, _Traits>& std::operator>>(basic_istream<_CharT, _Traits>&, _CharT&)' 978 | operator>>(basic_istream<_CharT, _Traits>& __in, _CharT& __c) | ^~~~~~~~ /usr/include/c++/14/bits/istream.tcc:978:5: note: template argument deduction/substitution failed: a.cc:19:31: note: 'std::ostream' {aka 'std::basic_ostream<char>'} is not derived from 'std::basic_istream<_CharT, _Traits>' 19 | cout >> S.at(i); | ^ /usr/include/c++/14/istream:849:5: note: candidate: 'template<class _Traits> std::basic_istream<char, _Traits>& std::operator>>(basic_istream<char, _Traits>&, unsigned char&)' 849 | operator>>(basic_istream<char, _Traits>& __in, unsigned char& __c) | ^~~~~~~~ /usr/include/c++/14/istream:849:5: note: template argument deduction/substitution failed: a.cc:19:31: note: 'std::ostream' {aka 'std::basic_ostream<char>'} is not derived from 'std::basic_istream<char, _Traits>' 19 | cout >> S.at(i); | ^ /usr/include/c++/14/istream:854:5: note: candidate: 'template<class _Traits> std::basic_istream<char, _Traits>& std::operator>>(basic_istream<char, _Traits>&, signed char&)' 854 | operator>>(basic_istream<char, _Traits>& __in, signed char& __c) | ^~~~~~~~ /usr/include/c++/14/istream:854:5: note: template argument deduction/substitution failed: a.cc:19:31: note: 'std::ostream' {aka 'std::basic_ostream<char>'} is not derived from 'std::basic_istream<char, _Traits>' 19 | cout >> S.at(i); | ^ /usr/include/c++/14/istream:896:5: note: candidate: 'template<class _CharT, class _Traits> std::basic_istream<_CharT, _Traits>& std::operator>>(basic_istream<_CharT, _Traits>&, _CharT*)' 896 | operator>>(basic_istream<_CharT, _Traits>& __in, _CharT* __s) | ^~~~~~~~ /usr/include/c++/14/istream:896:5: note: template argument deduction/substitution failed: a.cc:19:31: note: 'std::ostream' {aka 'std::basic_ostream<char>'} is not derived from 'std::basic_istream<_CharT, _Traits>' 19 | cout >> S.at(i); | ^ /usr/include/c++/14/istream:939:5: note: candidate: 'template<class _Traits> std::basic_istream<char, _Traits>& std::operator>>(basic_istream<char, _Traits>&, unsigned char*)' 939 | operator>>(basic_istream<char, _Traits>& __in, unsigned char* __s) | ^~~~~~~~ /usr/include/c++/14/istream:939:5: note: template argument deduction/substitution failed: a.cc:19:31: note: 'std::ostream' {aka 'std::basic_ostream<char>'} is not derived from 'std::basic_istream<char, _Traits>' 19 | cout >> S.at(i); | ^ /usr/include/c++/14/istream:945:5: note: candidate: 'template<class _Traits> std::basic_istream<char, _Traits>& std::operator>>(basic_istream<char, _Traits>&, signed char*)' 945 | operator>>(basic_istream<char, _Traits>& __in, signed char* __s) | ^~~~~~~~ /usr/include/c++/14/istream:945:5: note: template argument deduction/substitution failed: a.cc:19:31: note: 'std::ostream' {aka 'std::basic_ostream<char>'} is not derived from 'std::basic_istream<char, _Traits>' 19 | cout >> S.at(i); | ^ /usr/include/c++/14/istream:1099:5: note: candidate: 'template<class _Istream, class _Tp> _Istream&& std::operator>>(_Istream&&, _Tp&&)' 1099 | operator>>(_Istream&& __is, _Tp&& __x) | ^~~~~~~~ /usr/include/c++/14/istream:1099:5: note: template argument deduction/substitution failed: /usr/include/c++/14/istream: In substitution of 'template<class _Istream, class _Tp> _Istream&& std::operator>>(_Istream&&, _Tp&&) [with _Istream = std::basic_ostream<char>&; _Tp = std::__cxx11::basic_string<char>&]': a.cc:19:17: required from here 19 | cout >> S.at(i); | ^ /usr/include/c++/14/istream:1099:5: error: no type named 'type' in 'struct std::enable_if<false, void>' 1099 | operator>>(_Istream&& __is, _Tp&& __x) | ^~~~~~~~ /usr/include/c++/14/complex:509:5: note: candidate: 'template<class _Tp, class _CharT, class _Traits> std::basic_istream<_CharT, _Traits>& std::operator>>(basic_istream<_CharT, _Traits>&, complex<_Tp>&)' 509 | operator>>(basic_istream<_CharT, _Traits>& __is, complex<_Tp>& __x) | ^~~~~~~~ /usr/include/c++/14/complex:509:5: note: template argument deduction/substitution failed: a.cc:19:31: note: 'std::ostream' {aka 'std::basic_ostream<char>'} is not derived from 'std::basic_istream<_CharT, _Traits>' 19 | cout >> S.at(i); | ^ In file included from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:143: /usr/include/c++/14/iomanip:76:5: note: candidate: 'template<class _CharT, class _Traits> std::basic_istream<_CharT, _Traits>& std::operator>>(basic_istream<_CharT, _Traits>&, _Resetiosflags)' 76 | operator>>(basic_istream<_CharT, _Traits>& __is, _Resetiosflags __f) | ^~~~~~~~ /usr/include/c++/14/iomanip:76:5: note: template argument deduction/substitution failed: a.cc:19:31: note: 'std::ostream' {aka 'std::basic_ostream<char>'} is not derived from 'std::basic_istream<_CharT, _Traits>' 19 | cout >> S.at(i); | ^ /usr/include/c++/14/iomanip:106:5: note: candidate: 'template<class _CharT, class _Traits> std::basic_istream<_CharT, _Traits>& std::operator>>(basic_istream<_CharT, _Traits>&, _Setiosflags)' 106 | operator>>(basic_istream<_CharT, _Traits>& __is, _Setiosflags __f) | ^~~~~~~~ /usr/include/c++/14/iomanip:106:5: note: template argument deduction/substitution failed: a.cc:19:31: note: 'std::ostream' {aka 'std::basic_ostream<char>'} is not derived from 'std::basic_istream<_CharT, _Traits>' 19 | cout >> S.at(i); | ^ /usr/include/c++/14/iomanip:137:5: note: candidate: 'template<class _CharT, class _Traits> std::basic_istream<_CharT, _Traits>& std::operator>>(basic_istream<_CharT, _Traits>&, _Setbase)' 137 | operator>>(basic_istream<_CharT, _Traits>& __is, _Setbase __f) | ^~~~~~~~ /usr/include/c++/14/iomanip:137:5: note: template argument deduction/substitution failed: a.cc:19:31: note: 'std::ostream' {aka 'std::basic_ostream<char>'} is not derived from 'std::basic_istream<_CharT, _Traits>' 19 | cout >> S.at(i); | ^ /usr/include/c++/14/iomanip:177:5: note: candidate: 'template<class _CharT, class _Traits> std::basic_istream<_CharT, _Traits>& std::operator>>(basic_istream<_CharT, _Traits>&, _Setfill<_CharT>)' 177 | operator>>(basic_istream<_CharT, _Traits>& __is, _Setfill<_CharT> __f) | ^~~~~~~~ /usr/include/c++/14/iomanip:177:5: note: template argument deduction/substitution failed: a.cc:19:31: note: 'std::ostream'
s126675379
p04044
C++
#include <bits/stdc++.h> using namespace std; int main() { int N; int L; cin >> N >> L; vector<string> S(L); for (int i = 0; i < N; i++) { cin >> S.at(i); } sort(S.begin(), S.end()); // 昇順にソート for (int i = 0; i < N; i++) { cout >> S.at(i); } return 0; }
a.cc: In function 'int main()': a.cc:19:22: error: no match for 'operator>>' (operand types are 'std::ostream' {aka 'std::basic_ostream<char>'} and '__gnu_cxx::__alloc_traits<std::allocator<std::__cxx11::basic_string<char> >, std::__cxx11::basic_string<char> >::value_type' {aka 'std::__cxx11::basic_string<char>'}) 19 | cout >> S.at(i); | ~~~~ ^~ ~~~~~~~ | | | | | __gnu_cxx::__alloc_traits<std::allocator<std::__cxx11::basic_string<char> >, std::__cxx11::basic_string<char> >::value_type {aka std::__cxx11::basic_string<char>} | std::ostream {aka std::basic_ostream<char>} In file included from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:41, from a.cc:1: /usr/include/c++/14/cstddef:131:5: note: candidate: 'template<class _IntegerType> constexpr std::__byte_op_t<_IntegerType> std::operator>>(byte, _IntegerType)' 131 | operator>>(byte __b, _IntegerType __shift) noexcept | ^~~~~~~~ /usr/include/c++/14/cstddef:131:5: note: template argument deduction/substitution failed: a.cc:19:17: note: cannot convert 'std::cout' (type 'std::ostream' {aka 'std::basic_ostream<char>'}) to type 'std::byte' 19 | cout >> S.at(i); | ^~~~ In file included from /usr/include/c++/14/string:55, from /usr/include/c++/14/bitset:52, from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:52: /usr/include/c++/14/bits/basic_string.tcc:835:5: note: candidate: 'template<class _CharT, class _Traits, class _Alloc> std::basic_istream<_CharT, _Traits>& std::operator>>(basic_istream<_CharT, _Traits>&, __cxx11::basic_string<_CharT, _Traits, _Allocator>&)' 835 | operator>>(basic_istream<_CharT, _Traits>& __in, | ^~~~~~~~ /usr/include/c++/14/bits/basic_string.tcc:835:5: note: template argument deduction/substitution failed: a.cc:19:31: note: 'std::ostream' {aka 'std::basic_ostream<char>'} is not derived from 'std::basic_istream<_CharT, _Traits>' 19 | cout >> S.at(i); | ^ /usr/include/c++/14/bitset:1597:5: note: candidate: 'template<class _CharT, class _Traits, long unsigned int _Nb> std::basic_istream<_CharT, _Traits>& std::operator>>(basic_istream<_CharT, _Traits>&, bitset<_Nb>&)' 1597 | operator>>(std::basic_istream<_CharT, _Traits>& __is, bitset<_Nb>& __x) | ^~~~~~~~ /usr/include/c++/14/bitset:1597:5: note: template argument deduction/substitution failed: a.cc:19:31: note: 'std::ostream' {aka 'std::basic_ostream<char>'} is not derived from 'std::basic_istream<_CharT, _Traits>' 19 | cout >> S.at(i); | ^ In file included from /usr/include/c++/14/istream:1109, 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/bits/istream.tcc:978:5: note: candidate: 'template<class _CharT, class _Traits> std::basic_istream<_CharT, _Traits>& std::operator>>(basic_istream<_CharT, _Traits>&, _CharT&)' 978 | operator>>(basic_istream<_CharT, _Traits>& __in, _CharT& __c) | ^~~~~~~~ /usr/include/c++/14/bits/istream.tcc:978:5: note: template argument deduction/substitution failed: a.cc:19:31: note: 'std::ostream' {aka 'std::basic_ostream<char>'} is not derived from 'std::basic_istream<_CharT, _Traits>' 19 | cout >> S.at(i); | ^ /usr/include/c++/14/istream:849:5: note: candidate: 'template<class _Traits> std::basic_istream<char, _Traits>& std::operator>>(basic_istream<char, _Traits>&, unsigned char&)' 849 | operator>>(basic_istream<char, _Traits>& __in, unsigned char& __c) | ^~~~~~~~ /usr/include/c++/14/istream:849:5: note: template argument deduction/substitution failed: a.cc:19:31: note: 'std::ostream' {aka 'std::basic_ostream<char>'} is not derived from 'std::basic_istream<char, _Traits>' 19 | cout >> S.at(i); | ^ /usr/include/c++/14/istream:854:5: note: candidate: 'template<class _Traits> std::basic_istream<char, _Traits>& std::operator>>(basic_istream<char, _Traits>&, signed char&)' 854 | operator>>(basic_istream<char, _Traits>& __in, signed char& __c) | ^~~~~~~~ /usr/include/c++/14/istream:854:5: note: template argument deduction/substitution failed: a.cc:19:31: note: 'std::ostream' {aka 'std::basic_ostream<char>'} is not derived from 'std::basic_istream<char, _Traits>' 19 | cout >> S.at(i); | ^ /usr/include/c++/14/istream:896:5: note: candidate: 'template<class _CharT, class _Traits> std::basic_istream<_CharT, _Traits>& std::operator>>(basic_istream<_CharT, _Traits>&, _CharT*)' 896 | operator>>(basic_istream<_CharT, _Traits>& __in, _CharT* __s) | ^~~~~~~~ /usr/include/c++/14/istream:896:5: note: template argument deduction/substitution failed: a.cc:19:31: note: 'std::ostream' {aka 'std::basic_ostream<char>'} is not derived from 'std::basic_istream<_CharT, _Traits>' 19 | cout >> S.at(i); | ^ /usr/include/c++/14/istream:939:5: note: candidate: 'template<class _Traits> std::basic_istream<char, _Traits>& std::operator>>(basic_istream<char, _Traits>&, unsigned char*)' 939 | operator>>(basic_istream<char, _Traits>& __in, unsigned char* __s) | ^~~~~~~~ /usr/include/c++/14/istream:939:5: note: template argument deduction/substitution failed: a.cc:19:31: note: 'std::ostream' {aka 'std::basic_ostream<char>'} is not derived from 'std::basic_istream<char, _Traits>' 19 | cout >> S.at(i); | ^ /usr/include/c++/14/istream:945:5: note: candidate: 'template<class _Traits> std::basic_istream<char, _Traits>& std::operator>>(basic_istream<char, _Traits>&, signed char*)' 945 | operator>>(basic_istream<char, _Traits>& __in, signed char* __s) | ^~~~~~~~ /usr/include/c++/14/istream:945:5: note: template argument deduction/substitution failed: a.cc:19:31: note: 'std::ostream' {aka 'std::basic_ostream<char>'} is not derived from 'std::basic_istream<char, _Traits>' 19 | cout >> S.at(i); | ^ /usr/include/c++/14/istream:1099:5: note: candidate: 'template<class _Istream, class _Tp> _Istream&& std::operator>>(_Istream&&, _Tp&&)' 1099 | operator>>(_Istream&& __is, _Tp&& __x) | ^~~~~~~~ /usr/include/c++/14/istream:1099:5: note: template argument deduction/substitution failed: /usr/include/c++/14/istream: In substitution of 'template<class _Istream, class _Tp> _Istream&& std::operator>>(_Istream&&, _Tp&&) [with _Istream = std::basic_ostream<char>&; _Tp = std::__cxx11::basic_string<char>&]': a.cc:19:17: required from here 19 | cout >> S.at(i); | ^ /usr/include/c++/14/istream:1099:5: error: no type named 'type' in 'struct std::enable_if<false, void>' 1099 | operator>>(_Istream&& __is, _Tp&& __x) | ^~~~~~~~ /usr/include/c++/14/complex:509:5: note: candidate: 'template<class _Tp, class _CharT, class _Traits> std::basic_istream<_CharT, _Traits>& std::operator>>(basic_istream<_CharT, _Traits>&, complex<_Tp>&)' 509 | operator>>(basic_istream<_CharT, _Traits>& __is, complex<_Tp>& __x) | ^~~~~~~~ /usr/include/c++/14/complex:509:5: note: template argument deduction/substitution failed: a.cc:19:31: note: 'std::ostream' {aka 'std::basic_ostream<char>'} is not derived from 'std::basic_istream<_CharT, _Traits>' 19 | cout >> S.at(i); | ^ In file included from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:143: /usr/include/c++/14/iomanip:76:5: note: candidate: 'template<class _CharT, class _Traits> std::basic_istream<_CharT, _Traits>& std::operator>>(basic_istream<_CharT, _Traits>&, _Resetiosflags)' 76 | operator>>(basic_istream<_CharT, _Traits>& __is, _Resetiosflags __f) | ^~~~~~~~ /usr/include/c++/14/iomanip:76:5: note: template argument deduction/substitution failed: a.cc:19:31: note: 'std::ostream' {aka 'std::basic_ostream<char>'} is not derived from 'std::basic_istream<_CharT, _Traits>' 19 | cout >> S.at(i); | ^ /usr/include/c++/14/iomanip:106:5: note: candidate: 'template<class _CharT, class _Traits> std::basic_istream<_CharT, _Traits>& std::operator>>(basic_istream<_CharT, _Traits>&, _Setiosflags)' 106 | operator>>(basic_istream<_CharT, _Traits>& __is, _Setiosflags __f) | ^~~~~~~~ /usr/include/c++/14/iomanip:106:5: note: template argument deduction/substitution failed: a.cc:19:31: note: 'std::ostream' {aka 'std::basic_ostream<char>'} is not derived from 'std::basic_istream<_CharT, _Traits>' 19 | cout >> S.at(i); | ^ /usr/include/c++/14/iomanip:137:5: note: candidate: 'template<class _CharT, class _Traits> std::basic_istream<_CharT, _Traits>& std::operator>>(basic_istream<_CharT, _Traits>&, _Setbase)' 137 | operator>>(basic_istream<_CharT, _Traits>& __is, _Setbase __f) | ^~~~~~~~ /usr/include/c++/14/iomanip:137:5: note: template argument deduction/substitution failed: a.cc:19:31: note: 'std::ostream' {aka 'std::basic_ostream<char>'} is not derived from 'std::basic_istream<_CharT, _Traits>' 19 | cout >> S.at(i); | ^ /usr/include/c++/14/iomanip:177:5: note: candidate: 'template<class _CharT, class _Traits> std::basic_istream<_CharT, _Traits>& std::operator>>(basic_istream<_CharT, _Traits>&, _Setfill<_CharT>)' 177 | operator>>(basic_istream<_CharT, _Traits>& __is, _Setfill<_CharT> __f) | ^~~~~~~~ /usr/include/c++/14/iomanip:177:5: note: template argument deduction/substitution failed: a.cc:19:31: note: 'std::ostream'
s059851871
p04044
C++
#include <bits/stdc++.h> using namespace std; int main() { int n, l; cin >> n >> l; string s[n]; for(int i = 0; i < n; i++) cin >> s[i]; sort(s.begin(), s.end()); for(int i = 0; i < n; i++) cout << s[i]; cout << endl; return 0; }
a.cc: In function 'int main()': a.cc:11:10: error: request for member 'begin' in 's', which is of non-class type 'std::string [n]' {aka 'std::__cxx11::basic_string<char> [n]'} 11 | sort(s.begin(), s.end()); | ^~~~~ a.cc:11:21: error: request for member 'end' in 's', which is of non-class type 'std::string [n]' {aka 'std::__cxx11::basic_string<char> [n]'} 11 | sort(s.begin(), s.end()); | ^~~
s363390956
p04044
C++
#include <bits/stdc++.h> #define rep(i, k) for (ll i = 0; i < k; i++) #define pair(x, y) make_pair((x), (y)) using namespace std; typedef long long ll; typedef pair<int, int> pii; int main() { int ans = 0; int n, l; cin >> n >> l; vector<string> s(n); rep(i, n) { cin >> s[i]; } sort(s.begin, s.end); rep(i, n) { cout << s[i]; } }
a.cc: In function 'int main()': a.cc:16:9: error: no matching function for call to 'sort(<unresolved overloaded function type>, <unresolved overloaded function type>)' 16 | sort(s.begin, s.end); | ~~~~^~~~~~~~~~~~~~~~ In file included from /usr/include/c++/14/algorithm:61, from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:51, from a.cc:1: /usr/include/c++/14/bits/stl_algo.h:4762:5: note: candidate: 'template<class _RAIter> void std::sort(_RAIter, _RAIter)' 4762 | sort(_RandomAccessIterator __first, _RandomAccessIterator __last) | ^~~~ /usr/include/c++/14/bits/stl_algo.h:4762:5: note: template argument deduction/substitution failed: a.cc:16:9: note: couldn't deduce template parameter '_RAIter' 16 | sort(s.begin, s.end); | ~~~~^~~~~~~~~~~~~~~~ /usr/include/c++/14/bits/stl_algo.h:4793:5: note: candidate: 'template<class _RAIter, class _Compare> void std::sort(_RAIter, _RAIter, _Compare)' 4793 | sort(_RandomAccessIterator __first, _RandomAccessIterator __last, | ^~~~ /usr/include/c++/14/bits/stl_algo.h:4793:5: note: candidate expects 3 arguments, 2 provided In file included from /usr/include/c++/14/algorithm:86: /usr/include/c++/14/pstl/glue_algorithm_defs.h:292:1: note: candidate: 'template<class _ExecutionPolicy, class _RandomAccessIterator, class _Compare> __pstl::__internal::__enable_if_execution_policy<_ExecutionPolicy, void> std::sort(_ExecutionPolicy&&, _RandomAccessIterator, _RandomAccessIterator, _Compare)' 292 | sort(_ExecutionPolicy&& __exec, _RandomAccessIterator __first, _RandomAccessIterator __last, _Compare __comp); | ^~~~ /usr/include/c++/14/pstl/glue_algorithm_defs.h:292:1: note: candidate expects 4 arguments, 2 provided /usr/include/c++/14/pstl/glue_algorithm_defs.h:296:1: note: candidate: 'template<class _ExecutionPolicy, class _RandomAccessIterator> __pstl::__internal::__enable_if_execution_policy<_ExecutionPolicy, void> std::sort(_ExecutionPolicy&&, _RandomAccessIterator, _RandomAccessIterator)' 296 | sort(_ExecutionPolicy&& __exec, _RandomAccessIterator __first, _RandomAccessIterator __last); | ^~~~ /usr/include/c++/14/pstl/glue_algorithm_defs.h:296:1: note: candidate expects 3 arguments, 2 provided
s215890714
p04044
C++
#include <bits/stdc++.h> using namespace std; int main() { int n,l; cin >>n>>l; vector<string> vecS; while(n--) { string s; cin >> s; vecS.push_back(s); } sort(vecS.begin(), vecS.end()); for(auto i: vecS) { cout << i; } cout << endl; } ~ ~
a.cc:22:121: error: expected class-name before '~' token 22 | ~ ~ | ^
s930331843
p04044
C++
#include <iostream> #include <algorithm> #include <string> #include <math.h> #include <vector> #define rep(i,n) for(int i=0; i< int(n); i++) using namespace std; int main(){ int n, l; cin >> n >> l; string s[n]; rep(i,n) cin >> s[i]; sort(s, s+n); string ans ; rep(i,l) ans += s[i] cout << ans << endl; }
a.cc: In function 'int main()': a.cc:17:29: error: expected ';' before 'cout' 17 | rep(i,l) ans += s[i] | ^ | ; 18 | cout << ans << endl; | ~~~~
s726651346
p04044
C++
#include <iostream> #include <algorithm> #include <string> #include <math.h> #include <vector> #define rep(i,n) for(int i=0; i< int(n); i++) using namespace std; int main(){ int n, l; cin >> n >> l; rep(i,n) cin >> s[i]; sort(s, s+n); string ans ; rep(i,l) ans += s[i] cout << ans << endl; }
a.cc: In function 'int main()': a.cc:13:25: error: 's' was not declared in this scope 13 | rep(i,n) cin >> s[i]; | ^ a.cc:14:14: error: 's' was not declared in this scope 14 | sort(s, s+n); | ^
s958416786
p04044
C++
#include <iostream> #include <algorithm> #include <string> #include <math.h> #include <vector> #define rep(i,n) for(int i=0; i< int(n); i++) using namespace std; int main(){ int n, l; string s; cin >> n >> l >> s; sort(s, s+n); string ans ; rep(i,l) ans += s[i] cout << ans << endl; }
a.cc: In function 'int main()': a.cc:14:18: error: no match for 'operator+' (operand types are 'std::string' {aka 'std::__cxx11::basic_string<char>'} and 'int') 14 | sort(s, s+n); | ~^~ | | | | | int | std::string {aka std::__cxx11::basic_string<char>} In file included from /usr/include/c++/14/string:48, from /usr/include/c++/14/bits/locale_classes.h:40, from /usr/include/c++/14/bits/ios_base.h:41, from /usr/include/c++/14/ios:44, from /usr/include/c++/14/ostream:40, from /usr/include/c++/14/iostream:41, from a.cc:1: /usr/include/c++/14/bits/stl_iterator.h:627:5: note: candidate: 'template<class _Iterator> constexpr std::reverse_iterator<_Iterator> std::operator+(typename reverse_iterator<_Iterator>::difference_type, const reverse_iterator<_Iterator>&)' 627 | operator+(typename reverse_iterator<_Iterator>::difference_type __n, | ^~~~~~~~ /usr/include/c++/14/bits/stl_iterator.h:627:5: note: template argument deduction/substitution failed: a.cc:14:19: note: mismatched types 'const std::reverse_iterator<_Iterator>' and 'int' 14 | sort(s, s+n); | ^ /usr/include/c++/14/bits/stl_iterator.h:1798:5: note: candidate: 'template<class _Iterator> constexpr std::move_iterator<_IteratorL> std::operator+(typename move_iterator<_IteratorL>::difference_type, const move_iterator<_IteratorL>&)' 1798 | operator+(typename move_iterator<_Iterator>::difference_type __n, | ^~~~~~~~ /usr/include/c++/14/bits/stl_iterator.h:1798:5: note: template argument deduction/substitution failed: a.cc:14:19: note: mismatched types 'const std::move_iterator<_IteratorL>' and 'int' 14 | sort(s, s+n); | ^ In file included from /usr/include/c++/14/string:54: /usr/include/c++/14/bits/basic_string.h:3598:5: note: candidate: 'template<class _CharT, class _Traits, class _Alloc> std::__cxx11::basic_string<_CharT, _Traits, _Allocator> std::operator+(const __cxx11::basic_string<_CharT, _Traits, _Allocator>&, const __cxx11::basic_string<_CharT, _Traits, _Allocator>&)' 3598 | operator+(const basic_string<_CharT, _Traits, _Alloc>& __lhs, | ^~~~~~~~ /usr/include/c++/14/bits/basic_string.h:3598:5: note: template argument deduction/substitution failed: a.cc:14:19: note: mismatched types 'const std::__cxx11::basic_string<_CharT, _Traits, _Allocator>' and 'int' 14 | sort(s, s+n); | ^ /usr/include/c++/14/bits/basic_string.h:3616:5: note: candidate: 'template<class _CharT, class _Traits, class _Alloc> std::__cxx11::basic_string<_CharT, _Traits, _Allocator> std::operator+(const _CharT*, const __cxx11::basic_string<_CharT, _Traits, _Allocator>&)' 3616 | operator+(const _CharT* __lhs, | ^~~~~~~~ /usr/include/c++/14/bits/basic_string.h:3616:5: note: template argument deduction/substitution failed: a.cc:14:19: note: mismatched types 'const _CharT*' and 'std::__cxx11::basic_string<char>' 14 | sort(s, s+n); | ^ /usr/include/c++/14/bits/basic_string.h:3635:5: note: candidate: 'template<class _CharT, class _Traits, class _Alloc> std::__cxx11::basic_string<_CharT, _Traits, _Allocator> std::operator+(_CharT, const __cxx11::basic_string<_CharT, _Traits, _Allocator>&)' 3635 | operator+(_CharT __lhs, const basic_string<_CharT,_Traits,_Alloc>& __rhs) | ^~~~~~~~ /usr/include/c++/14/bits/basic_string.h:3635:5: note: template argument deduction/substitution failed: a.cc:14:19: note: mismatched types 'const std::__cxx11::basic_string<_CharT, _Traits, _Allocator>' and 'int' 14 | sort(s, s+n); | ^ /usr/include/c++/14/bits/basic_string.h:3652:5: note: candidate: 'template<class _CharT, class _Traits, class _Alloc> std::__cxx11::basic_string<_CharT, _Traits, _Allocator> std::operator+(const __cxx11::basic_string<_CharT, _Traits, _Allocator>&, const _CharT*)' 3652 | operator+(const basic_string<_CharT, _Traits, _Alloc>& __lhs, | ^~~~~~~~ /usr/include/c++/14/bits/basic_string.h:3652:5: note: template argument deduction/substitution failed: a.cc:14:19: note: mismatched types 'const _CharT*' and 'int' 14 | sort(s, s+n); | ^ /usr/include/c++/14/bits/basic_string.h:3670:5: note: candidate: 'template<class _CharT, class _Traits, class _Alloc> std::__cxx11::basic_string<_CharT, _Traits, _Allocator> std::operator+(const __cxx11::basic_string<_CharT, _Traits, _Allocator>&, _CharT)' 3670 | operator+(const basic_string<_CharT, _Traits, _Alloc>& __lhs, _CharT __rhs) | ^~~~~~~~ /usr/include/c++/14/bits/basic_string.h:3670:5: note: template argument deduction/substitution failed: a.cc:14:19: note: deduced conflicting types for parameter '_CharT' ('char' and 'int') 14 | sort(s, s+n); | ^ /usr/include/c++/14/bits/basic_string.h:3682:5: note: candidate: 'template<class _CharT, class _Traits, class _Alloc> std::__cxx11::basic_string<_CharT, _Traits, _Allocator> std::operator+(__cxx11::basic_string<_CharT, _Traits, _Allocator>&&, const __cxx11::basic_string<_CharT, _Traits, _Allocator>&)' 3682 | operator+(basic_string<_CharT, _Traits, _Alloc>&& __lhs, | ^~~~~~~~ /usr/include/c++/14/bits/basic_string.h:3682:5: note: template argument deduction/substitution failed: a.cc:14:19: note: mismatched types 'const std::__cxx11::basic_string<_CharT, _Traits, _Allocator>' and 'int' 14 | sort(s, s+n); | ^ /usr/include/c++/14/bits/basic_string.h:3689:5: note: candidate: 'template<class _CharT, class _Traits, class _Alloc> std::__cxx11::basic_string<_CharT, _Traits, _Allocator> std::operator+(const __cxx11::basic_string<_CharT, _Traits, _Allocator>&, __cxx11::basic_string<_CharT, _Traits, _Allocator>&&)' 3689 | operator+(const basic_string<_CharT, _Traits, _Alloc>& __lhs, | ^~~~~~~~ /usr/include/c++/14/bits/basic_string.h:3689:5: note: template argument deduction/substitution failed: a.cc:14:19: note: mismatched types 'std::__cxx11::basic_string<_CharT, _Traits, _Allocator>' and 'int' 14 | sort(s, s+n); | ^ /usr/include/c++/14/bits/basic_string.h:3696:5: note: candidate: 'template<class _CharT, class _Traits, class _Alloc> std::__cxx11::basic_string<_CharT, _Traits, _Allocator> std::operator+(__cxx11::basic_string<_CharT, _Traits, _Allocator>&&, __cxx11::basic_string<_CharT, _Traits, _Allocator>&&)' 3696 | operator+(basic_string<_CharT, _Traits, _Alloc>&& __lhs, | ^~~~~~~~ /usr/include/c++/14/bits/basic_string.h:3696:5: note: template argument deduction/substitution failed: a.cc:14:19: note: mismatched types 'std::__cxx11::basic_string<_CharT, _Traits, _Allocator>' and 'int' 14 | sort(s, s+n); | ^ /usr/include/c++/14/bits/basic_string.h:3719:5: note: candidate: 'template<class _CharT, class _Traits, class _Alloc> std::__cxx11::basic_string<_CharT, _Traits, _Allocator> std::operator+(const _CharT*, __cxx11::basic_string<_CharT, _Traits, _Allocator>&&)' 3719 | operator+(const _CharT* __lhs, | ^~~~~~~~ /usr/include/c++/14/bits/basic_string.h:3719:5: note: template argument deduction/substitution failed: a.cc:14:19: note: mismatched types 'const _CharT*' and 'std::__cxx11::basic_string<char>' 14 | sort(s, s+n); | ^ /usr/include/c++/14/bits/basic_string.h:3726:5: note: candidate: 'template<class _CharT, class _Traits, class _Alloc> std::__cxx11::basic_string<_CharT, _Traits, _Allocator> std::operator+(_CharT, __cxx11::basic_string<_CharT, _Traits, _Allocator>&&)' 3726 | operator+(_CharT __lhs, | ^~~~~~~~ /usr/include/c++/14/bits/basic_string.h:3726:5: note: template argument deduction/substitution failed: a.cc:14:19: note: mismatched types 'std::__cxx11::basic_string<_CharT, _Traits, _Allocator>' and 'int' 14 | sort(s, s+n); | ^ /usr/include/c++/14/bits/basic_string.h:3733:5: note: candidate: 'template<class _CharT, class _Traits, class _Alloc> std::__cxx11::basic_string<_CharT, _Traits, _Allocator> std::operator+(__cxx11::basic_string<_CharT, _Traits, _Allocator>&&, const _CharT*)' 3733 | operator+(basic_string<_CharT, _Traits, _Alloc>&& __lhs, | ^~~~~~~~ /usr/include/c++/14/bits/basic_string.h:3733:5: note: template argument deduction/substitution failed: a.cc:14:19: note: mismatched types 'const _CharT*' and 'int' 14 | sort(s, s+n); | ^ /usr/include/c++/14/bits/basic_string.h:3740:5: note: candidate: 'template<class _CharT, class _Traits, class _Alloc> std::__cxx11::basic_string<_CharT, _Traits, _Allocator> std::operator+(__cxx11::basic_string<_CharT, _Traits, _Allocator>&&, _CharT)' 3740 | operator+(basic_string<_CharT, _Traits, _Alloc>&& __lhs, | ^~~~~~~~ /usr/include/c++/14/bits/basic_string.h:3740:5: note: template argument deduction/substitution failed: a.cc:14:19: note: deduced conflicting types for parameter '_CharT' ('char' and 'int') 14 | sort(s, s+n); | ^ a.cc:16:29: error: expected ';' before 'cout' 16 | rep(i,l) ans += s[i] | ^ | ; 17 | cout << ans << endl; | ~~~~
s750743913
p04044
C++
#include <iostream> #include <string> using namespace std; int main(){ int N, L; cin >> N >> L; string tmp; string str[N]; for(int i = 0; i < N; i++){ cin >> str[i]; } for(int i = 0; i < N; i++){ for(int j = i + 1; j < N; j++){ if(str[i].conpare(str[j]) < 0){ tmp = str[i]; str[i] = str[j]; str[j] = tmp; } } } for(int i = 1; i < N; i++){ str[0] += str[i]; } cout << str[0] << endl; }
a.cc: In function 'int main()': a.cc:17:17: error: 'std::string' {aka 'class std::__cxx11::basic_string<char>'} has no member named 'conpare'; did you mean 'compare'? 17 | if(str[i].conpare(str[j]) < 0){ | ^~~~~~~ | compare
s322912710
p04044
C++
#pragma once #include <string> #include <sstream> #include <iostream> #include <fstream> #include <stdlib.h> #include <queue> #include <list> #include <vector> #include <array> #include <algorithm> #include <iterator> bool compare(const std::string& _lhs, const std::string& _rhs) { for (int i = 0; i < _lhs.size(); i++) { if (i >= _rhs.size() ) return false; if (_lhs[i] > _rhs[i]) return false; else if (_lhs[i] < _rhs[i]) return true; } return _lhs.size() <= _rhs.size(); } int abc_042_b() { int N, L = -1; std::vector<std::string> inputVector; std::string first; std::getline(std::cin, first); std::istringstream ifst(first); ifst >> N >> L; for (int i = 0; i < N; i++) { std::string s; std::getline(std::cin, s); std::istringstream iss(s); inputVector.push_back(iss.str()); } std::sort(inputVector.begin(), inputVector.end(), compare); std::ostringstream os; //std::copy(inputVector.begin(), inputVector.end(), std::ostream_iterator<std::string>(os)); std::copy(inputVector.begin(), inputVector.end(), std::ostream_iterator<std::string>(os)); std::string s = os.str(); std::cout << s << std::endl; return 0; }
a.cc:1:9: warning: #pragma once in main file 1 | #pragma once | ^~~~ /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
s677514288
p04044
C++
bool compare(const std::string& _lhs, const std::string& _rhs) { for (int i = 0; i < _lhs.size(); i++) { if (i >= _rhs.size() ) return false; if (_lhs[i] > _rhs[i]) return false; else if (_lhs[i] < _rhs[i]) return true; } return _lhs.size() <= _rhs.size(); } int main() { int N, L = -1; std::vector<std::string> inputVector; std::string first; std::getline(std::cin, first); std::istringstream ifst(first); ifst >> N >> L; for (int i = 0; i < N; i++) { std::string s; std::getline(std::cin, s); std::istringstream iss(s); inputVector.push_back(iss.str()); } std::sort(inputVector.begin(), inputVector.end(), compare); std::ostringstream os; std::copy(inputVector.begin(), inputVector.end(), std::ostream_iterator<std::string>(os)); std::string s = os.str(); std::cout << s << std::endl; return 0; }
a.cc:1:25: error: 'string' in namespace 'std' does not name a type 1 | bool compare(const std::string& _lhs, const std::string& _rhs) | ^~~~~~ a.cc:1:1: note: 'std::string' is defined in header '<string>'; this is probably fixable by adding '#include <string>' +++ |+#include <string> 1 | bool compare(const std::string& _lhs, const std::string& _rhs) a.cc:1:50: error: 'string' in namespace 'std' does not name a type 1 | bool compare(const std::string& _lhs, const std::string& _rhs) | ^~~~~~ a.cc:1:45: note: 'std::string' is defined in header '<string>'; this is probably fixable by adding '#include <string>' 1 | bool compare(const std::string& _lhs, const std::string& _rhs) | ^~~ a.cc: In function 'bool compare(const int&, const int&)': a.cc:3:34: error: request for member 'size' in '_lhs', which is of non-class type 'const int' 3 | for (int i = 0; i < _lhs.size(); i++) | ^~~~ a.cc:5:31: error: request for member 'size' in '_rhs', which is of non-class type 'const int' 5 | if (i >= _rhs.size() ) return false; | ^~~~ a.cc:6:25: error: invalid types 'const int[int]' for array subscript 6 | if (_lhs[i] > _rhs[i]) return false; | ^ a.cc:6:35: error: invalid types 'const int[int]' for array subscript 6 | if (_lhs[i] > _rhs[i]) return false; | ^ a.cc:7:30: error: invalid types 'const int[int]' for array subscript 7 | else if (_lhs[i] < _rhs[i]) return true; | ^ a.cc:7:40: error: invalid types 'const int[int]' for array subscript 7 | else if (_lhs[i] < _rhs[i]) return true; | ^ a.cc:10:21: error: request for member 'size' in '_lhs', which is of non-class type 'const int' 10 | return _lhs.size() <= _rhs.size(); | ^~~~ a.cc:10:36: error: request for member 'size' in '_rhs', which is of non-class type 'const int' 10 | return _lhs.size() <= _rhs.size(); | ^~~~ a.cc: In function 'int main()': a.cc:18:14: error: 'vector' is not a member of 'std' 18 | std::vector<std::string> inputVector; | ^~~~~~ a.cc:1:1: note: 'std::vector' is defined in header '<vector>'; this is probably fixable by adding '#include <vector>' +++ |+#include <vector> 1 | bool compare(const std::string& _lhs, const std::string& _rhs) a.cc:18:26: error: 'string' is not a member of 'std' 18 | std::vector<std::string> inputVector; | ^~~~~~ a.cc:18:26: note: 'std::string' is defined in header '<string>'; this is probably fixable by adding '#include <string>' a.cc:18:34: error: 'inputVector' was not declared in this scope 18 | std::vector<std::string> inputVector; | ^~~~~~~~~~~ a.cc:20:14: error: 'string' is not a member of 'std' 20 | std::string first; | ^~~~~~ a.cc:20:14: note: 'std::string' is defined in header '<string>'; this is probably fixable by adding '#include <string>' a.cc:21:14: error: 'getline' is not a member of 'std' 21 | std::getline(std::cin, first); | ^~~~~~~ a.cc:21:27: error: 'cin' is not a member of 'std' 21 | std::getline(std::cin, first); | ^~~ a.cc:1:1: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>' +++ |+#include <iostream> 1 | bool compare(const std::string& _lhs, const std::string& _rhs) a.cc:21:32: error: 'first' was not declared in this scope 21 | std::getline(std::cin, first); | ^~~~~ a.cc:22:14: error: 'istringstream' is not a member of 'std' 22 | std::istringstream ifst(first); | ^~~~~~~~~~~~~ a.cc:1:1: note: 'std::istringstream' is defined in header '<sstream>'; this is probably fixable by adding '#include <sstream>' +++ |+#include <sstream> 1 | bool compare(const std::string& _lhs, const std::string& _rhs) a.cc:24:9: error: 'ifst' was not declared in this scope 24 | ifst >> N >> L; | ^~~~ a.cc:28:22: error: 'string' is not a member of 'std' 28 | std::string s; | ^~~~~~ a.cc:28:22: note: 'std::string' is defined in header '<string>'; this is probably fixable by adding '#include <string>' a.cc:29:22: error: 'getline' is not a member of 'std' 29 | std::getline(std::cin, s); | ^~~~~~~ a.cc:29:35: error: 'cin' is not a member of 'std' 29 | std::getline(std::cin, s); | ^~~ a.cc:29:35: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>' a.cc:29:40: error: 's' was not declared in this scope 29 | std::getline(std::cin, s); | ^ a.cc:30:22: error: 'istringstream' is not a member of 'std' 30 | std::istringstream iss(s); | ^~~~~~~~~~~~~ a.cc:30:22: note: 'std::istringstream' is defined in header '<sstream>'; this is probably fixable by adding '#include <sstream>' a.cc:31:39: error: 'iss' was not declared in this scope 31 | inputVector.push_back(iss.str()); | ^~~ a.cc:35:14: error: 'sort' is not a member of 'std' 35 | std::sort(inputVector.begin(), inputVector.end(), compare); | ^~~~ a.cc:37:14: error: 'ostringstream' is not a member of 'std' 37 | std::ostringstream os; | ^~~~~~~~~~~~~ a.cc:37:14: note: 'std::ostringstream' is defined in header '<sstream>'; this is probably fixable by adding '#include <sstream>' a.cc:38:14: error: 'copy' is not a member of 'std' 38 | std::copy(inputVector.begin(), inputVector.end(), std::ostream_iterator<std::string>(os)); | ^~~~ a.cc:38:64: error: 'ostream_iterator' is not a member of 'std' 38 | std::copy(inputVector.begin(), inputVector.end(), std::ostream_iterator<std::string>(os)); | ^~~~~~~~~~~~~~~~ a.cc:1:1: note: 'std::ostream_iterator' is defined in header '<iterator>'; this is probably fixable by adding '#include <iterator>' +++ |+#include <iterator> 1 | bool compare(const std::string& _lhs, const std::string& _rhs) a.cc:38:86: error: 'string' is not a member of 'std' 38 | std::copy(inputVector.begin(), inputVector.end(), std::ostream_iterator<std::string>(os)); | ^~~~~~ a.cc:38:86: note: 'std::string' is defined in header '<string>'; this is probably fixable by adding '#include <string>' a.cc:38:94: error: 'os' was not declared in this scope 38 | std::copy(inputVector.begin(), inputVector.end(), std::ostream_iterator<std::string>(os)); | ^~ a.cc:39:14: error: 'string' is not a member of 'std' 39 | std::string s = os.str(); | ^~~~~~ a.cc:39:14: note: 'std::string' is defined in header '<string>'; this is probably fixable by adding '#include <string>' a.cc:41:14: error: 'cout' is not a member of 'std' 41 | std::cout << s << std::endl; | ^~~~ a.cc:41:14: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>' a.cc:41:22: error: 's' was not declared in this scope 41 | std::cout << s << std::endl; | ^ a.cc:41:32: error: 'endl' is not a member of 'std' 41 | std::cout << s << std::endl; | ^~~~ a.cc:1:1: note: 'std::endl' is defined in header '<ostream>'; this is probably fixable by adding '#include <ostream>' +++ |+#include <ostream> 1 | bool compare(const std::string& _lhs, const std::string& _rhs)
s128220049
p04044
C++
#include <bits/stdc++.h> using namespace std; int main() { int N,L;cin>>N,L; vector<string> S(N); string A=""; for(int i=0; i<N; i++){ cin>>S.at(i);} sort(S.begin(),b.end()); for(int i=0; i<N; i++){ A += S.at(i);} cout<<A<<endl; }
a.cc: In function 'int main()': a.cc:12:16: error: 'b' was not declared in this scope 12 | sort(S.begin(),b.end()); | ^
s093208251
p04044
C++
#include<bits/stdc++.h> using namespace std; int main(){ int a,b; cin >> a >> b; vector<string>s(b); for(int i=0;i<n;i++){ cin >> s[i]; } sort(s.begin(),s.end()); for(int i=0;i<n;i++){ cout << s[i]; } }
a.cc: In function 'int main()': a.cc:7:23: error: 'n' was not declared in this scope 7 | for(int i=0;i<n;i++){ | ^ a.cc:11:23: error: 'n' was not declared in this scope 11 | for(int i=0;i<n;i++){ | ^
s595456205
p04044
C++
#include<bits/stdc++.h> using namespace std; int main(){ int a,b; cin >> a >> b; vector<string>s(n); for(int i=0;i<n;i++){ cin >> s[i]; } sort(s.begin(),s.end()); for(int i=0;i<n;i++){ cout << s[i]; } }
a.cc: In function 'int main()': a.cc:6:19: error: 'n' was not declared in this scope 6 | vector<string>s(n); | ^
s322204717
p04044
C++
#include<bits/stdc++.h> using namespace std; int main(){ int a,b; cin >> a >> b; string s[b]; for(int i=0;i<b;i++){ cin >> s[i]; } for(int i=0;i<n;i++){ for(int j=0;j<n;j++){ if(s[i]>s[j]){ swap(s[i],s[j]); } } } for(int i=0;i<b;i++){ cout << s[i]; } }
a.cc: In function 'int main()': a.cc:10:17: error: 'n' was not declared in this scope 10 | for(int i=0;i<n;i++){ | ^
s152897604
p04044
C++
#include<bits/stdc++.h> using namespace std; int main(){ int a,b; cin >> a >> b; string s[b]; for(int i=0;i<b;i++){ cin >> s[i]; } sort(s,s+b); for(int i=00;i<b;i++){ cout << s[i]; }
a.cc: In function 'int main()': a.cc:13:4: error: expected '}' at end of input 13 | } | ^ a.cc:3:11: note: to match this '{' 3 | int main(){ | ^
s146920653
p04044
C++
#include<bits/stdc++.h> using namespace std; int main() { int n, l; cin>>n>>l; vector<string> arr(n); for(int i=0;i<n;i++) { cin>>arr[i]; } sort(arr.begin(), arr.end()); for(int i=0;i<n;i++) { cout<<arr[i]<<endl; } return 0;
a.cc: In function 'int main()': a.cc:18:12: error: expected '}' at end of input 18 | return 0; | ^ a.cc:5:1: note: to match this '{' 5 | { | ^
s535638296
p04044
C++
#include<bits/stdc++.h> using namespace std; int main() { int n,l; cin>>n>>l; vector< string > s(n); for(int i=0;i<n;i++) cin>>s.at(i); sort(s.begin(),s.end()); for(i=1;i<n;i++) s.at(0)=s.at(0)+s.at(i); cout<<s.at(0)<<endl; }
a.cc: In function 'int main()': a.cc:11:13: error: 'i' was not declared in this scope 11 | for(i=1;i<n;i++) | ^
s071672060
p04044
C++
#include <bits/stdc++.h> #include<ext/pb_ds/assoc_container.hpp> #include<ext/pb_ds/tree_policy.hpp> using namespace std; using namespace __gnu_pbds; template <typename T> using ordered_set = tree<T, null_type, less<T>, rb_tree_tag, tree_order_statistics_node_update>; typedef long long int ll; typedef unsigned long long ull; typedef long double ld; typedef vector<int> vi; typedef vector<long long int> vl; typedef vector<vector<int>> vvi; typedef vector<vector<long long int>> vvl; typedef pair<int, int> pii; typedef pair<long long int, long long int> pll; typedef vector<pair<int, int>> vii; typedef vector<pair<long long int, long long int>> vll; #define fast() ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0) #define test() long long int t; cin >> t; cin.ignore(); while(t--) #define ff first #define ss second #define pb push_back #define pf push_front #define mp make_pair #define MOD 1000000007 #define SMOD 998244353 #define pq priority_queue #define all(x) x.begin(),x.end() #define SP(x) setprecision(x) #define sp " " #define inp(a) ll a;cin>>a;cin.ignore() #define inps(a,b) ll a,b;cin>>a>>b;cin.ignore() #define out(a) cout<<SP(20)<<a<<'\n' #define outs(a,b) cout<<SP(20)<<a<<" "<<b<<'\n' #define ins insert #define er erase #define lb lower_bound #define ub upper_bound #define printclock cerr<<"Time : "<<1000*(ld)clock()/(ld)CLOCKS_PER_SEC<<"ms\n"; #define inpa(a,n) ll a[n]; for(int i=0; i<n; i++){cin>>a[i];} #define inpv(a,n) vl a; for(int i=0; i<n; i++){inp(x);a.pb(x);} #define outa(a,n) for(int i=0;i<n;i++){cout<<a[i]<<" ";}cout<<'\n'; #define outv(v) for(auto i:v){cout<<i<<;}cout<<'\n'; set<char> vow = {'a','e','i','o','u','A','E','I','O','U'}; ll xpow(ll n, ll m){if(m==0){return 1;}else{ll x = xpow(n, m/2);if(m&1){return x*x*n;}else{return x*x;}}} ll xmod(ll a, ll m){return (((a%m)+m)%m);} ll xmodpow(ll n, ll m, ll y){if(m==0){return 1;}else{ll x = xmodpow(n, m/2, y);if(m&1){return xmod((xmod((xmod(x,y)*xmod(x,y)),y)*xmod(n,y)),y);}else{return xmod((xmod(x,y)*xmod(x,y)),y);}}} int main(){ fast(); /* you get what you work for not what you wish for */ ll n, l; cin >> n >> l; vector <string> a(n); for(int i=0; i<n; i++){ cin >> a[i]; } sort(all(a)); outv(a); }
a.cc: In function 'int main()': a.cc:44:40: error: expected primary-expression before ';' token 44 | #define outv(v) for(auto i:v){cout<<i<<;}cout<<'\n'; | ^ a.cc:62:5: note: in expansion of macro 'outv' 62 | outv(a); | ^~~~
s727421860
p04044
C++
clude<bits/stdc++.h> using namespace std; int main() { int n; cin>>n; string s[100]; for(int i=0;i<n;i++){ cin>>s[i]; } sort(s,s+n); for(int i=0;i<n;i++0) { cout<<s[i]; } }
a.cc:1:1: error: 'clude' does not name a type 1 | clude<bits/stdc++.h> | ^~~~~ a.cc: In function 'int main()': a.cc:6:3: error: 'cin' was not declared in this scope 6 | cin>>n; | ^~~ a.cc:7:7: error: 'string' was not declared in this scope 7 | string s[100]; | ^~~~~~ a.cc:10:10: error: 's' was not declared in this scope 10 | cin>>s[i]; | ^ a.cc:12:8: error: 's' was not declared in this scope 12 | sort(s,s+n); | ^ a.cc:12:3: error: 'sort' was not declared in this scope; did you mean 'short'? 12 | sort(s,s+n); | ^~~~ | short a.cc:13:22: error: expected ')' before numeric constant 13 | for(int i=0;i<n;i++0) | ~ ^ | ) a.cc:13:23: error: expected ';' before ')' token 13 | for(int i=0;i<n;i++0) | ^ | ;
s145999958
p04044
C++
#include<bits/stdc++.h> using namespace std; int main() { int n; cin>>n; string s[100]; for(int i=0;i<n;i++){ cin>>s[i]; } sort(s,s+n); for(int i=0;i<n;i++0 { cout<<s[i]; } }
a.cc: In function 'int main()': a.cc:13:22: error: expected ')' before numeric constant 13 | for(int i=0;i<n;i++0 | ~ ^ | ) a.cc:13:23: error: expected ';' before '{' token 13 | for(int i=0;i<n;i++0 | ^ | ; 14 | { | ~
s535270253
p04044
C++
n,l=map(int,input().split()) s=sorted([input() for i in range(n)]) print(*s,sep="")
a.cc:1:1: error: 'n' does not name a type 1 | n,l=map(int,input().split()) | ^
s888630879
p04044
C++
#include<iostream> #include<vector> using namesapce std; vector<string> v; int main(){ string s1; int n,m; cin>>n>>m; for(int i = 0; i < n; ++i){ cin>>s1; v.push_back(s1); } sort(v.begin(), v.end()); for (string &s : v) cout << s; }
a.cc:3:7: error: expected nested-name-specifier before 'namesapce' 3 | using namesapce std; | ^~~~~~~~~ a.cc:5:1: error: 'vector' does not name a type 5 | vector<string> v; | ^~~~~~ a.cc: In function 'int main()': a.cc:7:9: error: 'string' was not declared in this scope 7 | string s1; | ^~~~~~ a.cc:7:9: note: suggested alternatives: In file included from /usr/include/c++/14/iosfwd:41, from /usr/include/c++/14/ios:40, from /usr/include/c++/14/ostream:40, from /usr/include/c++/14/iostream:41, from a.cc:1: /usr/include/c++/14/bits/stringfwd.h:77:33: note: 'std::string' 77 | typedef basic_string<char> string; | ^~~~~~ In file included from /usr/include/c++/14/bits/locale_classes.h:40, from /usr/include/c++/14/bits/ios_base.h:41, from /usr/include/c++/14/ios:44: /usr/include/c++/14/string:76:11: note: 'std::pmr::string' 76 | using string = basic_string<char>; | ^~~~~~ a.cc:9:5: error: 'cin' was not declared in this scope; did you mean 'std::cin'? 9 | cin>>n>>m; | ^~~ | std::cin /usr/include/c++/14/iostream:62:18: note: 'std::cin' declared here 62 | extern istream cin; ///< Linked to standard input | ^~~ a.cc:11:14: error: 's1' was not declared in this scope 11 | cin>>s1; | ^~ a.cc:12:9: error: 'v' was not declared in this scope 12 | v.push_back(s1); | ^ a.cc:15:10: error: 'v' was not declared in this scope 15 | sort(v.begin(), v.end()); | ^ a.cc:15:5: error: 'sort' was not declared in this scope; did you mean 'short'? 15 | sort(v.begin(), v.end()); | ^~~~ | short a.cc:16:20: error: found ':' in nested-name-specifier, expected '::' 16 | for (string &s : v) | ^ | :: a.cc:16:18: error: 's' has not been declared 16 | for (string &s : v) | ^ a.cc:20:1: error: expected primary-expression before '}' token 20 | } | ^ a.cc:17:19: error: expected ';' before '}' token 17 | cout << s; | ^ | ; ...... 20 | } | ~ a.cc:20:1: error: expected primary-expression before '}' token 20 | } | ^ a.cc:17:19: error: expected ')' before '}' token 17 | cout << s; | ^ | ) ...... 20 | } | ~ a.cc:16:9: note: to match this '(' 16 | for (string &s : v) | ^ a.cc:20:1: error: expected primary-expression before '}' token 20 | } | ^
s920253619
p04044
C++
// // main.cpp // Practice // // Created by Hajime Sakamoto on 2019/12/17. // Copyright © 2019 Hajime Sakamoto. All rights reserved. // http://7ujm.net/stl/sort.html #include <iostream> #include <algorithm> #include <vector> #include <string> #include <sstream> using namespace std; //数N,長さLの文字列を辞書順にソートして結合するクラス class Iroha { public: int N; int L; vector<string> data; string s; string s_outPut; void s_input(){ data.clear(); // while(1) { // cin >> s; // if (cin.eof()) break; // data.push_back(s); // } for(int i = 0; i<N; i++) { cin >> s; data.push_back(s); } } void s_sort(){ std::sort(data.begin(),data.end());//昇順ソート } void s_join(){//ostream_iteratorクラスで結合処理を実現 std::ostringstream os; std::copy(data.begin(), data.end(), std::ostream_iterator<std::string>(os)); s_outPut = os.str(); // 文字列結合 } }; int main(int argc, const char * argv[]) { Iroha Prc; cin >> Prc.N; cin >> Prc.L; Prc.s_input(); Prc.s_sort(); Prc.s_join(); cout << Prc.s_outPut; return 0; }
a.cc: In member function 'void Iroha::s_join()': a.cc:47:50: error: 'ostream_iterator' is not a member of 'std' 47 | std::copy(data.begin(), data.end(), std::ostream_iterator<std::string>(os)); | ^~~~~~~~~~~~~~~~ a.cc:14:1: note: 'std::ostream_iterator' is defined in header '<iterator>'; this is probably fixable by adding '#include <iterator>' 13 | #include <sstream> +++ |+#include <iterator> 14 | a.cc:47:78: error: expected primary-expression before '>' token 47 | std::copy(data.begin(), data.end(), std::ostream_iterator<std::string>(os)); | ^
s899883396
p04044
C++
#include <bits/stdc++.h> #include <vector> using namespace std; int main(){ int L,N; int flag = 1; vector<string> S(N); cin >> L >> N; for(int i=0;i<N;i++){ cin >> S.at(i); } for(i : S){ if(i.size != L) flag = 0; } sort(S.begin(),S.end()); string sum; for(auto S_dash : S){ sum = sum + S_dash; } if(flag = 1) cout << sum << endl; else cout << -1 <<endl; }
a.cc:8:15: error: extended character   is not valid in an identifier 8 | int flag = 1; | ^ a.cc: In function 'int main()': a.cc:8:15: error: '\U000030001' was not declared in this scope 8 | int flag = 1; | ^~~ a.cc:15:11: error: found ':' in nested-name-specifier, expected '::' 15 | for(i : S){ | ^ | :: a.cc:15:9: error: 'i' has not been declared 15 | for(i : S){ | ^ a.cc:20:9: error: could not convert 'std::sort<__gnu_cxx::__normal_iterator<__cxx11::basic_string<char>*, vector<__cxx11::basic_string<char> > > >(S.std::vector<std::__cxx11::basic_string<char> >::begin(), S.std::vector<std::__cxx11::basic_string<char> >::end())' from 'void' to 'bool' 20 | sort(S.begin(),S.end()); | ~~~~^~~~~~~~~~~~~~~~~~~ | | | void a.cc:21:12: error: expected primary-expression before 'sum' 21 | string sum; | ^~~ a.cc:21:11: error: expected ')' before 'sum' 21 | string sum; | ^~~~ | ) a.cc:15:8: note: to match this '(' 15 | for(i : S){ | ^ a.cc:21:12: error: 'sum' was not declared in this scope 21 | string sum; | ^~~ a.cc:23:9: error: 'sum' was not declared in this scope 23 | sum = sum + S_dash; | ^~~ a.cc:26:13: error: 'sum' was not declared in this scope 26 | cout << sum << endl; | ^~~
s679007892
p04044
C++
#include <bits/stdc++.h> //#include <vector> using namespace std; int main(){ int L,N; vector<string> S(N); cin >> L >> N; for(int i=0;i<N;i++){ cin >> S.at(i); } sort(S.begin(),S.end()); string sum; for(aut S_dash : S){ sum = S_dash; } cout << sum << endl; }
a.cc: In function 'int main()': a.cc:16:9: error: 'aut' was not declared in this scope; did you mean 'auto'? 16 | for(aut S_dash : S){ | ^~~ | auto a.cc:20:1: error: expected primary-expression before '}' token 20 | } | ^ a.cc:19:25: error: expected ')' before '}' token 19 | cout << sum << endl; | ^ | ) 20 | } | ~ a.cc:16:8: note: to match this '(' 16 | for(aut S_dash : S){ | ^ a.cc:20:1: error: expected primary-expression before '}' token 20 | } | ^
s288305476
p04044
C++
#include <stdio.h> #include <string.h> char c[110][110],d[150]; int n,l,i,j; int main() { scanf("%d%d",&n,&l); getchar(); for(i=0;i<n;i++) gets(c[i]); for(i=0;i<n-1;i++) { for(j=0;j<n-i-1;j++) if(strcmp(c[j],c[j+1])>0) { strcpy(d,c[j]); strcpy(c[j],c[j+1]); strcpy(c[j+1],d); } } for(i=0;i<=n;i++) printf("%s",c[i]); }
a.cc: In function 'int main()': a.cc:11:9: error: 'gets' was not declared in this scope; did you mean 'getw'? 11 | gets(c[i]); | ^~~~ | getw
s096099601
p04044
C++
#include <stdio.h> #include <string.h> char c[110][110],d[150]; int n,l,i,j; int main() { scanf("%d%d",&n,&l); getchar(); for(i=0;i<n;i++) gets(c[i]); for(i=0;i<n-1;i++) { for(j=0;j<n-i-1;j++) if(strcmp(c[j],c[j+1])>0) { strcpy(d,c[j]); strcpy(c[j],c[j+1]); strcpy(c[j+1],d); } } for(i=0;i<=n;i++) printf("%s",c[i]); }
a.cc: In function 'int main()': a.cc:11:9: error: 'gets' was not declared in this scope; did you mean 'getw'? 11 | gets(c[i]); | ^~~~ | getw
s747706014
p04044
C++
#pragma GCC optimize ("O3") #pragma GCC target ("sse4") #include <bits/stdc++.h> #include <ext/pb_ds/tree_policy.hpp> #include <ext/rope> using namespace std; using namespace __gnu_pbds; using namespace __gnu_cxx; #define Unknown ios_base::sync_with_stdio(0);ios::sync_with_stdio(0);cin.tie(nullptr);cout.tie(nullptr); #define percision(x) cout << fixed << setprecision(x); #define nl '\n' #define fo(i, a, n) for(int i{ (int) (a) };i < (int)(n);i++) #define fr(i, a, n) for(int i{ (int) (a) };i <= (int)(n);i++) #define frr(i, a, n) for(int i{ (int) (a) };i > (int) (n);i--) #define frrr(i, a, n) for(int i{ (int) (a) };i >= (int) (n);i--) #define trav(i, x) for(auto &i : x) #define mp make_pair #define eb emplace_back #define f first #define s second #define lb lower_bound #define ub upper_bound #define sz(x) (int)x.size() #define all(x) begin(x), end(x) typedef long long ll; typedef long double ld; typedef unsigned long long ull; typedef complex<ld> cd; typedef pair<int, int> pi; typedef pair<ll,ll> pl; typedef pair<ld,ld> pd; typedef pair<ull, ull> pul; typedef vector<int> vi; typedef vector<ld> vd; typedef vector<ll> vl; typedef vector<pi> vpi; typedef vector<pl> vpl; typedef vector<cd> vcd; typedef vector<pul> vpul; const double PI = 2 * acos(0.0); const double EPS = (1e-10); const double inf = 1.0/0.0; const int OO = 0x3f3f3f3f; const int N = 1e5 + 20; const int MOD = (int)(1e9) + 7;/// 998244353 int dx8[8] = {0, 1, 1, 1, 0, -1, -1, -1};int dy8[8] = {1, 1, 0, -1, -1, -1, 0, 1}; ///8 Direction int dx4[4] = {1, 0, -1, 0};int dy4[4] = {0, 1, 0, -1}; ///4 Direction template<class... T> inline re(T&... args) { ((cin >> args), ...); } template<class T> inline cmin(T &a, T b) { a = min(a, b); } template<class T> inline cmax(T &a, T b) { a = max(a, b); } int main(){ Unknown int n{}, l{}; re(n, l); string str[n], tmp{}; fo(i, 0, n){ re(str[i]); } sort(str, str + n); fo(i, 0, n){ tmp += str[i]; } cout << tmp; return 0; }
a.cc:57:29: error: ISO C++ forbids declaration of 're' with no type [-fpermissive] 57 | template<class... T> inline re(T&... args) { ((cin >> args), ...); } | ^~ a.cc: In function 'int re(T& ...)': a.cc:57:68: warning: no return statement in function returning non-void [-Wreturn-type] 57 | template<class... T> inline re(T&... args) { ((cin >> args), ...); } | ^ a.cc: At global scope: a.cc:58:26: error: ISO C++ forbids declaration of 'cmin' with no type [-fpermissive] 58 | template<class T> inline cmin(T &a, T b) { a = min(a, b); } | ^~~~ a.cc: In function 'int cmin(T&, T)': a.cc:58:59: warning: no return statement in function returning non-void [-Wreturn-type] 58 | template<class T> inline cmin(T &a, T b) { a = min(a, b); } | ^ a.cc: At global scope: a.cc:59:26: error: ISO C++ forbids declaration of 'cmax' with no type [-fpermissive] 59 | template<class T> inline cmax(T &a, T b) { a = max(a, b); } | ^~~~ a.cc: In function 'int cmax(T&, T)': a.cc:59:59: warning: no return statement in function returning non-void [-Wreturn-type] 59 | template<class T> inline cmax(T &a, T b) { a = max(a, b); } | ^
s347787705
p04044
C
#include<stdio.h> int main() { int N,L,i=1,j=1,S[101],T[101]; //char scanf("%d%d",&N,&L); for(;j<=100;j++) //定义 “字典” { S[j]=('a'+j-1); } j=1; while(j<=100) { printf("%c\n",S[j]); //验证是否成功赋值 j++; }*/ for(;i<=N;i++) //输入N个字符串 { scanf("%s",&T[i]); } T[1]=1,T[2]=2; printf("%d%d\n",T[1],T[2]); return 0; } //先比较每个字符串的开头,再把于字典中小的放前面 ,然后除每个字符串开头的剩余部分接在开头后不变
main.c: In function 'main': main.c:16:11: error: expected expression before '/' token 16 | }*/ | ^
s459469161
p04044
C++
#include <bits/stdc++.h> #include <stdio.h> #include <iostream> #include <cstdio> #include <bitset> #include <algorithm> #include <vector> #include <list> #include <queue> #include <stack> #include <string> #include <string.h> #include <cmath> #include <utility> #include <functional> #include <map> #include <set> #include <cctype> #include <fstream> #include <numeric> #include <iomanip> #include <cstring> using namespace std; using ll = long long; #define ALL(a) (a).begin(), (a).end() #define FOR(i, a, b) for (long long int i = (a); i <= (b); i++) #define RFOR(i, a, b) for (long long int i = (a); i >= (b); i--) #define MOD 1000000007 #define LLONG_MAXs 9223372036854775800 / 2 #define ALL(a) (a).begin(), (a).end() #include <iostream> #include <cmath> using namespace std; bool isPrimeNum(ll x) { // 素数である場合 true を返す if (x <= 1) { // 1以下である場合は素数でないことがすぐにわかる return false; } // sqrt( double型 ) は引数の平方根を double型で返すので、int型でキャスト int n = (int)sqrt((double)x); for (int i = 2; i <= n; i++) { if (x % i == 0) { // 割り切る整数がある場合、即判定終了 return false; } } return true; // 割り切る整数がない場合、素数である } ll myPow(ll x, ll n, ll m) { if (n == 0) return 1; if (n % 2 == 0) return myPow(x * x % m, n / 2, m); else return x * myPow(x, n - 1, m) % m; } constexpr ll gcd(ll a, ll b) { return b ? gcd(b, a % b) : a; } constexpr ll lcm(ll a, ll b) { return a * b / gcd(a, b); } constexpr ll abs(ll a, ll b) { if (a >= b) return a - b; if (a < b) return b - a; } constexpr double dabs(double a, double b) { if (a >= b) return a - b; if (a < b) return b - a; } constexpr ll min(ll a, ll b) { if (a >= b) return b; if (a < b) return a; } constexpr ll max(ll a, ll b) { if (a >= b) return a; if (a < b) return b; } int dx[4] = {1, 0, -1, 0}; int dy[4] = {0, 1, 0, -1}; int dx8[8] = {1, 0, -1, 0, 1, -1, 1, -1}; int dy8[8] = {0, 1, 0, -1, 1, 1, -1, -1}; class UnionFind { public: //親の番号を格納する。親だった場合は-(その集合のサイズ) vector<int> Parent; //作るときはParentの値を全て-1にする //こうすると全てバラバラになる UnionFind(int N) { Parent = vector<int>(N, -1); } //Aがどのグループに属しているか調べる int root(int A) { if (Parent[A] < 0) return A; return Parent[A] = root(Parent[A]); } //自分のいるグループの頂点数を調べる int size(int A) { return -Parent[root(A)]; //親をとってきたい] } bool issame(int x, int y) { return root(x) == root(y); } //AとBをくっ付ける bool connect(int A, int B) { //AとBを直接つなぐのではなく、root(A)にroot(B)をくっつける A = root(A); B = root(B); if (A == B) { //すでにくっついてるからくっ付けない return false; } //大きい方(A)に小さいほう(B)をくっ付けたい //大小が逆だったらひっくり返しちゃう。 if (size(A) < size(B)) swap(A, B); //Aのサイズを更新する Parent[A] += Parent[B]; //Bの親をAに変更する Parent[B] = A; return true; } }; long long fac[510000], finv[510000], inv[510000]; // テーブルを作る前処理 void COMinit() { fac[0] = fac[1] = 1; finv[0] = finv[1] = 1; inv[1] = 1; for (int i = 2; i < 510000; i++) { fac[i] = fac[i - 1] * i % MOD; inv[i] = MOD - inv[MOD % i] * (MOD / i) % MOD; finv[i] = finv[i - 1] * inv[i] % MOD; } } // 二項係数計算 long long COM(int n, int k) { if (n < k) return 0; if (n < 0 || k < 0) return 0; return fac[n] * (finv[k] * finv[n - k] % MOD) % MOD; } long long modinv(long long a, long long m) { long long b = m, u = 1, v = 0; while (b) { long long t = a / b; a -= t * b; swap(a, b); u -= t * v; swap(u, v); } u %= m; if (u < 0) u += m; return u; } string replaceAll(string &replacedStr, string from, string to) { unsigned int pos = replacedStr.find(from); int toLen = to.length(); if (from.empty()) { return replacedStr; } while ((pos = replacedStr.find(from, pos)) != std::string::npos) { replacedStr.replace(pos, from.length(), to); pos += toLen; } return replacedStr; } void yn(bool flag) { if (flag) { cout << "Yes" << endl; } else { cout << "No" << endl; } return; } void YN(bool flag) { if (flag) { cout << "YES" << endl; } else { cout << "NO" << endl; } return; } std::vector<ll> enum_div(ll n) //nの約数を列挙 { std::vector<ll> ret; for (ll i = 1; i * i <= n; ++i) { if (n % i == 0) { ret.push_back(i); if (i != 1 && i * i != n) { ret.push_back(n / i); } } } ret.push_back(n); return ret; } void Ssort(int no, char *month[]) { int i, j; char *temp; for (i = 0; i < no; i++) { for (j = i + 1; j < no; j++) { if (strcmp((month[i]), (month[j])) > 0) { temp = *(month + i); *(month + i) = *(month + j); *(month + j) = temp; } } } } // グラフセット struct Edge { ll to; // 辺の行き先 ll weight; // 辺の重み Edge(int t, int w) : to(t), weight(w) {} }; //using Graph = vector<vector<Edge>>; using Graph = vector<vector<int>>; int main() { ll N, x2, x3, x4; cin >> N >> x2; priority_queue<string, vector<int>, greater<int>> p; FOR(i, 0, N - 1) { string tp; cin >> tp; p.push(tp); } while (!p.empty()) { cout << p.top(); p.pop(); } cout << endl; return 0; }
In file included from /usr/include/c++/14/queue:66, from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:157, from a.cc:1: /usr/include/c++/14/bits/stl_queue.h: In instantiation of 'class std::priority_queue<std::__cxx11::basic_string<char>, std::vector<int>, std::greater<int> >': a.cc:296:55: required from here 296 | priority_queue<string, vector<int>, greater<int>> p; | ^ /usr/include/c++/14/bits/stl_queue.h:520:67: error: static assertion failed: value_type must be the same as the underlying container 520 | static_assert(is_same<_Tp, typename _Sequence::value_type>::value, | ^~~~~ /usr/include/c++/14/bits/stl_queue.h:520:67: note: 'std::integral_constant<bool, false>::value' evaluates to false a.cc: In function 'int main()': a.cc:301:15: error: no matching function for call to 'std::priority_queue<std::__cxx11::basic_string<char>, std::vector<int>, std::greater<int> >::push(std::string&)' 301 | p.push(tp); | ~~~~~~^~~~ /usr/include/c++/14/bits/stl_queue.h:736:7: note: candidate: 'void std::priority_queue<_Tp, _Sequence, _Compare>::push(const value_type&) [with _Tp = std::__cxx11::basic_string<char>; _Sequence = std::vector<int>; _Compare = std::greater<int>; value_type = int]' 736 | push(const value_type& __x) | ^~~~ /usr/include/c++/14/bits/stl_queue.h:736:30: note: no known conversion for argument 1 from 'std::string' {aka 'std::__cxx11::basic_string<char>'} to 'const std::priority_queue<std::__cxx11::basic_string<char>, std::vector<int>, std::greater<int> >::value_type&' {aka 'const int&'} 736 | push(const value_type& __x) | ~~~~~~~~~~~~~~~~~~^~~ /usr/include/c++/14/bits/stl_queue.h:744:7: note: candidate: 'void std::priority_queue<_Tp, _Sequence, _Compare>::push(value_type&&) [with _Tp = std::__cxx11::basic_string<char>; _Sequence = std::vector<int>; _Compare = std::greater<int>; value_type = int]' 744 | push(value_type&& __x) | ^~~~ /usr/include/c++/14/bits/stl_queue.h:744:25: note: no known conversion for argument 1 from 'std::string' {aka 'std::__cxx11::basic_string<char>'} to 'std::priority_queue<std::__cxx11::basic_string<char>, std::vector<int>, std::greater<int> >::value_type&&' {aka 'int&&'} 744 | push(value_type&& __x) | ~~~~~~~~~~~~~^~~
s998845420
p04044
C++
#include <bits/stdc++.h> #include <stdio.h> #include <iostream> #include <cstdio> #include <bitset> #include <algorithm> #include <vector> #include <list> #include <queue> #include <stack> #include <string> #include <string.h> #include <cmath> #include <utility> #include <functional> #include <map> #include <set> #include <cctype> #include <fstream> #include <numeric> #include <iomanip> #include <cstring> using namespace std; using ll = long long; #define ALL(a) (a).begin(), (a).end() #define FOR(i, a, b) for (long long int i = (a); i <= (b); i++) #define RFOR(i, a, b) for (long long int i = (a); i >= (b); i--) #define MOD 1000000007 #define LLONG_MAXs 9223372036854775800 / 2 #define ALL(a) (a).begin(), (a).end() #include <iostream> #include <cmath> using namespace std; bool isPrimeNum(ll x) { // 素数である場合 true を返す if (x <= 1) { // 1以下である場合は素数でないことがすぐにわかる return false; } // sqrt( double型 ) は引数の平方根を double型で返すので、int型でキャスト int n = (int)sqrt((double)x); for (int i = 2; i <= n; i++) { if (x % i == 0) { // 割り切る整数がある場合、即判定終了 return false; } } return true; // 割り切る整数がない場合、素数である } ll myPow(ll x, ll n, ll m) { if (n == 0) return 1; if (n % 2 == 0) return myPow(x * x % m, n / 2, m); else return x * myPow(x, n - 1, m) % m; } constexpr ll gcd(ll a, ll b) { return b ? gcd(b, a % b) : a; } constexpr ll lcm(ll a, ll b) { return a * b / gcd(a, b); } constexpr ll abs(ll a, ll b) { if (a >= b) return a - b; if (a < b) return b - a; } constexpr double dabs(double a, double b) { if (a >= b) return a - b; if (a < b) return b - a; } constexpr ll min(ll a, ll b) { if (a >= b) return b; if (a < b) return a; } constexpr ll max(ll a, ll b) { if (a >= b) return a; if (a < b) return b; } int dx[4] = {1, 0, -1, 0}; int dy[4] = {0, 1, 0, -1}; int dx8[8] = {1, 0, -1, 0, 1, -1, 1, -1}; int dy8[8] = {0, 1, 0, -1, 1, 1, -1, -1}; class UnionFind { public: //親の番号を格納する。親だった場合は-(その集合のサイズ) vector<int> Parent; //作るときはParentの値を全て-1にする //こうすると全てバラバラになる UnionFind(int N) { Parent = vector<int>(N, -1); } //Aがどのグループに属しているか調べる int root(int A) { if (Parent[A] < 0) return A; return Parent[A] = root(Parent[A]); } //自分のいるグループの頂点数を調べる int size(int A) { return -Parent[root(A)]; //親をとってきたい] } bool issame(int x, int y) { return root(x) == root(y); } //AとBをくっ付ける bool connect(int A, int B) { //AとBを直接つなぐのではなく、root(A)にroot(B)をくっつける A = root(A); B = root(B); if (A == B) { //すでにくっついてるからくっ付けない return false; } //大きい方(A)に小さいほう(B)をくっ付けたい //大小が逆だったらひっくり返しちゃう。 if (size(A) < size(B)) swap(A, B); //Aのサイズを更新する Parent[A] += Parent[B]; //Bの親をAに変更する Parent[B] = A; return true; } }; long long fac[510000], finv[510000], inv[510000]; // テーブルを作る前処理 void COMinit() { fac[0] = fac[1] = 1; finv[0] = finv[1] = 1; inv[1] = 1; for (int i = 2; i < 510000; i++) { fac[i] = fac[i - 1] * i % MOD; inv[i] = MOD - inv[MOD % i] * (MOD / i) % MOD; finv[i] = finv[i - 1] * inv[i] % MOD; } } // 二項係数計算 long long COM(int n, int k) { if (n < k) return 0; if (n < 0 || k < 0) return 0; return fac[n] * (finv[k] * finv[n - k] % MOD) % MOD; } long long modinv(long long a, long long m) { long long b = m, u = 1, v = 0; while (b) { long long t = a / b; a -= t * b; swap(a, b); u -= t * v; swap(u, v); } u %= m; if (u < 0) u += m; return u; } string replaceAll(string &replacedStr, string from, string to) { unsigned int pos = replacedStr.find(from); int toLen = to.length(); if (from.empty()) { return replacedStr; } while ((pos = replacedStr.find(from, pos)) != std::string::npos) { replacedStr.replace(pos, from.length(), to); pos += toLen; } return replacedStr; } void yn(bool flag) { if (flag) { cout << "Yes" << endl; } else { cout << "No" << endl; } return; } void YN(bool flag) { if (flag) { cout << "YES" << endl; } else { cout << "NO" << endl; } return; } std::vector<ll> enum_div(ll n) //nの約数を列挙 { std::vector<ll> ret; for (ll i = 1; i * i <= n; ++i) { if (n % i == 0) { ret.push_back(i); if (i != 1 && i * i != n) { ret.push_back(n / i); } } } ret.push_back(n); return ret; } void Ssort(int no, char *month[]) { int i, j; char *temp; for (i = 0; i < no; i++) { for (j = i + 1; j < no; j++) { if (strcmp((month[i]), (month[j])) > 0) { temp = *(month + i); *(month + i) = *(month + j); *(month + j) = temp; } } } } // グラフセット struct Edge { ll to; // 辺の行き先 ll weight; // 辺の重み Edge(int t, int w) : to(t), weight(w) {} }; //using Graph = vector<vector<Edge>>; using Graph = vector<vector<int>>; int main() { ll N, x2, x3, x4; cin >> N >> x2; priority_queue<string, vector<string>, greater<int>> p; FOR(i, 0, N - 1) { string tp; cin >> tp; p.push(tp); } while (!p.empty()) { cout << p.top(); p.pop(); } cout << endl; return 0; }
In file included from /usr/include/c++/14/bits/stl_algobase.h:71, from /usr/include/c++/14/algorithm:60, from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:51, from a.cc:1: /usr/include/c++/14/bits/predefined_ops.h: In instantiation of 'bool __gnu_cxx::__ops::_Iter_comp_val<_Compare>::operator()(_Iterator, _Value&) [with _Iterator = __gnu_cxx::__normal_iterator<std::__cxx11::basic_string<char>*, std::vector<std::__cxx11::basic_string<char> > >; _Value = std::__cxx11::basic_string<char>; _Compare = std::greater<int>]': /usr/include/c++/14/bits/stl_heap.h:140:48: required from 'void std::__push_heap(_RandomAccessIterator, _Distance, _Distance, _Tp, _Compare&) [with _RandomAccessIterator = __gnu_cxx::__normal_iterator<__cxx11::basic_string<char>*, vector<__cxx11::basic_string<char> > >; _Distance = long int; _Tp = __cxx11::basic_string<char>; _Compare = __gnu_cxx::__ops::_Iter_comp_val<greater<int> >]' 140 | while (__holeIndex > __topIndex && __comp(__first + __parent, __value)) | ~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~ /usr/include/c++/14/bits/stl_heap.h:216:23: required from 'void std::push_heap(_RAIter, _RAIter, _Compare) [with _RAIter = __gnu_cxx::__normal_iterator<__cxx11::basic_string<char>*, vector<__cxx11::basic_string<char> > >; _Compare = greater<int>]' 216 | std::__push_heap(__first, _DistanceType((__last - __first) - 1), | ~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 217 | _DistanceType(0), _GLIBCXX_MOVE(__value), __cmp); | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ /usr/include/c++/14/bits/stl_queue.h:739:16: required from 'void std::priority_queue<_Tp, _Sequence, _Compare>::push(const value_type&) [with _Tp = std::__cxx11::basic_string<char>; _Sequence = std::vector<std::__cxx11::basic_string<char> >; _Compare = std::greater<int>; value_type = std::__cxx11::basic_string<char>]' 739 | std::push_heap(c.begin(), c.end(), comp); | ~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~ a.cc:301:15: required from here 301 | p.push(tp); | ~~~~~~^~~~ /usr/include/c++/14/bits/predefined_ops.h:196:30: error: no match for call to '(std::greater<int>) (std::__cxx11::basic_string<char>&, std::__cxx11::basic_string<char>&)' 196 | { return bool(_M_comp(*__it, __val)); } | ~~~~~~~^~~~~~~~~~~~~~ In file included from /usr/include/c++/14/string:49, from /usr/include/c++/14/bitset:52, from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:52: /usr/include/c++/14/bits/stl_function.h:394:7: note: candidate: 'constexpr bool std::greater<_Tp>::operator()(const _Tp&, const _Tp&) const [with _Tp = int]' 394 | operator()(const _Tp& __x, const _Tp& __y) const | ^~~~~~~~ /usr/include/c++/14/bits/stl_function.h:394:29: note: no known conversion for argument 1 from 'std::__cxx11::basic_string<char>' to 'const int&' 394 | operator()(const _Tp& __x, const _Tp& __y) const | ~~~~~~~~~~~^~~ /usr/include/c++/14/bits/predefined_ops.h: In instantiation of 'constexpr bool __gnu_cxx::__ops::_Iter_comp_iter<_Compare>::operator()(_Iterator1, _Iterator2) [with _Iterator1 = __gnu_cxx::__normal_iterator<std::__cxx11::basic_string<char>*, std::vector<std::__cxx11::basic_string<char> > >; _Iterator2 = __gnu_cxx::__normal_iterator<std::__cxx11::basic_string<char>*, std::vector<std::__cxx11::basic_string<char> > >; _Compare = std::greater<int>]': /usr/include/c++/14/bits/stl_heap.h:232:14: required from 'void std::__adjust_heap(_RandomAccessIterator, _Distance, _Distance, _Tp, _Compare) [with _RandomAccessIterator = __gnu_cxx::__normal_iterator<__cxx11::basic_string<char>*, vector<__cxx11::basic_string<char> > >; _Distance = long int; _Tp = __cxx11::basic_string<char>; _Compare = __gnu_cxx::__ops::_Iter_comp_iter<greater<int> >]' 232 | if (__comp(__first + __secondChild, | ~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~ 233 | __first + (__secondChild - 1))) | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ /usr/include/c++/14/bits/stl_heap.h:264:25: required from 'void std::__pop_heap(_RandomAccessIterator, _RandomAccessIterator, _RandomAccessIterator, _Compare&) [with _RandomAccessIterator = __gnu_cxx::__normal_iterator<__cxx11::basic_string<char>*, vector<__cxx11::basic_string<char> > >; _Compare = __gnu_cxx::__ops::_Iter_comp_iter<greater<int> >]' 264 | std::__adjust_heap(__first, _DistanceType(0), | ~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~ 265 | _DistanceType(__last - __first), | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 266 | _GLIBCXX_MOVE(__value), __comp); | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ /usr/include/c++/14/bits/stl_heap.h:333:19: required from 'void std::pop_heap(_RAIter, _RAIter, _Compare) [with _RAIter = __gnu_cxx::__normal_iterator<__cxx11::basic_string<char>*, vector<__cxx11::basic_string<char> > >; _Compare = greater<int>]' 333 | std::__pop_heap(__first, __last, __last, __cmp); | ~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ /usr/include/c++/14/bits/stl_queue.h:774:15: required from 'void std::priority_queue<_Tp, _Sequence, _Compare>::pop() [with _Tp = std::__cxx11::basic_string<char>; _Sequence = std::vector<std::__cxx11::basic_string<char> >; _Compare = std::greater<int>]' 774 | std::pop_heap(c.begin(), c.end(), comp); | ~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~ a.cc:307:14: required from here 307 | p.pop(); | ~~~~~^~ /usr/include/c++/14/bits/predefined_ops.h:158:30: error: no match for call to '(std::greater<int>) (std::__cxx11::basic_string<char>&, std::__cxx11::basic_string<char>&)' 158 | { return bool(_M_comp(*__it1, *__it2)); } | ~~~~~~~^~~~~~~~~~~~~~~~ /usr/include/c++/14/bits/stl_function.h:394:7: note: candidate: 'constexpr bool std::greater<_Tp>::operator()(const _Tp&, const _Tp&) const [with _Tp = int]' 394 | operator()(const _Tp& __x, const _Tp& __y) const | ^~~~~~~~ /usr/include/c++/14/bits/stl_function.h:394:29: note: no known conversion for argument 1 from 'std::__cxx11::basic_string<char>' to 'const int&' 394 | operator()(const _Tp& __x, const _Tp& __y) const | ~~~~~~~~~~~^~~
s058557605
p04044
C
#include<stdio.h> #include<string.h> void str_swap(char str1[],char str2[]) { char str[128]; strcpy(str,str1); strcpy(str1,str2); strcpy(str2,str); } int dictionary(char str1[],char str2[]) { int ans,i,len; if(strlen(str1) < strlen(str2)) { len = strlen(str1); ans = 1; }else { len = strlen(str2); ans = 2; } for(i=0;i<len;i++) { if(str1[i]>str2[i]) { ans = 2; break; }else if(str1[i]<str2[i]) { ans = 1; break; } } return ans; } int main(void) { int num,len; char str[128]; fgets(str,sizeof(str),stdin); sscanf(str,"%d %d",&num,&len); char matrix[num+2][len+2]; for(i=0;i<num;i++) { fgets(&matrix[i],len+2,stdin); } for(i=0;i<num-1;i++) { for(j=0;j<num-i;j++) { if(dictionary(&matrix[i+j],&matrix[i+j+1] == 2) { str_swap(&matrix[i+j],&matrix[i+j+1]); } } } for(i=0;i<num;i++) { for(j=0;j<len;j++) { printf("%c",matrix[i][j]); } } return 0; }
main.c: In function 'main': main.c:49:13: error: 'i' undeclared (first use in this function) 49 | for(i=0;i<num;i++) | ^ main.c:49:13: note: each undeclared identifier is reported only once for each function it appears in main.c:56:21: error: 'j' undeclared (first use in this function) 56 | for(j=0;j<num-i;j++) | ^ main.c:58:72: error: expected ')' before '{' token 58 | if(dictionary(&matrix[i+j],&matrix[i+j+1] == 2) | ~ ^ | ) 59 | { | ~ main.c:62:17: error: expected expression before '}' token 62 | } | ^
s466680706
p04044
C
#include<stdio.h> #include<string.h> void str_swap(char str1[],char str2[]) { char str[128]; strcpy(str,str1); strcpy(str1,str2); strcpy(str2,str); } int dictionary(char str1[],char str2[]) { int ans,i,len; if(strlen(str1) < strlen(str2)) { len = strlen(str1); ans = 1; }else { len = strlen(str2); ans = 2; } for(i=0;i<len;i++) { if(str1[i]>str2[i]) { ans = 2; break; }else if(str1[i]<str2[i]) { ans = 1; break; } } return ans; } int main(void) { int num,len; char str[128]; fgets(str,sizeof(str),stdin); sscanf(str,"%d %d",&num,&len); char matrix[num+2][len+2]; for(i=0;i<num;i++) { fgets(&matrix[i],len+2,stdin); } for(i=0;i<num-1;i++) { for(j=0;j<num-i;j++) { if(dictionary(&matrix[i+j],&matrix[i+j+1] == 2) { str_swap(&matrix[i+j],&matrix[i+j+1]); } } } for(i=0;i<num;i++) { for(j=0;j<len;j++) { printf("%c",matrix[i][j]); } } return 0; }
main.c: In function 'main': main.c:49:13: error: 'i' undeclared (first use in this function) 49 | for(i=0;i<num;i++) | ^ main.c:49:13: note: each undeclared identifier is reported only once for each function it appears in main.c:56:21: error: 'j' undeclared (first use in this function) 56 | for(j=0;j<num-i;j++) | ^ main.c:58:72: error: expected ')' before '{' token 58 | if(dictionary(&matrix[i+j],&matrix[i+j+1] == 2) | ~ ^ | ) 59 | { | ~ main.c:62:17: error: expected expression before '}' token 62 | } | ^
s407350851
p04044
C++
import math line = input() n, l = [int(x) for x in line.split()] strings = [] for i in range (n): strings.append(input()) strings.sort() seperator = '' print(seperator.join(strings))
a.cc:9:13: error: empty character constant 9 | seperator = '' | ^~ a.cc:1:1: error: 'import' does not name a type 1 | import math | ^~~~~~ a.cc:1:1: note: C++20 'import' only available with '-fmodules-ts'
s580857966
p04044
C++
#include<iosream> #include<algorithm> #include<string> #include<vector> int main() { int N, L; std::cin >> N >> L; std::vector<std::string> data(N); for (int i=0; i<N; i++) { std::cin >> data.at(i); } std::sort(data.begin(), data.end()); for (int i=0; i<N; i++) { std::cout << data.at(i); } std::cout << std::endl; }
a.cc:1:9: fatal error: iosream: No such file or directory 1 | #include<iosream> | ^~~~~~~~~ compilation terminated.
s659537504
p04044
Java
import java.util.Arrays; import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner scanner = new Scanner(System.in); String[] strings = new String[Integer.parseInt(scanner.nextLine().split(" ")[1])]; for(int i = 0; i < strings.length; i++) { strings[i] = scanner.nextLine(); } System.out.println(Arrays.stream(strings).sorted().collect( StringBuilder::new, StringBuilder::append, StringBuilder::append)); } }
Main.java:13: error: reference to println is ambiguous System.out.println(Arrays.stream(strings).sorted().collect( ^ both method println(char[]) in PrintStream and method println(String) in PrintStream match Main.java:13: error: incompatible types: inference variable R has incompatible bounds System.out.println(Arrays.stream(strings).sorted().collect( ^ upper bounds: char[],Object lower bounds: StringBuilder where R,T are type-variables: R extends Object declared in method <R>collect(Supplier<R>,BiConsumer<R,? super T>,BiConsumer<R,R>) T extends Object declared in interface Stream Note: Some messages have been simplified; recompile with -Xdiags:verbose to get full output 2 errors
s321351019
p04044
Java
import java.util.Arrays; import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner scanner = new Scanner(System.in); String[] strings = new String[Integer.parseInt(scanner.nextLine().split(" ")[1])]; for(int i = 0; i < strings.length; i++) { strings[i] = scanner.nextLine(); } System.out.println(Arrays.stream(strings).sorted().collect( StringBuilder::new, StringBuilder::append, StringBuilder::append)); } }
Main.java:13: error: reference to println is ambiguous System.out.println(Arrays.stream(strings).sorted().collect( ^ both method println(char[]) in PrintStream and method println(String) in PrintStream match Main.java:13: error: incompatible types: inference variable R has incompatible bounds System.out.println(Arrays.stream(strings).sorted().collect( ^ upper bounds: char[],Object lower bounds: StringBuilder where R,T are type-variables: R extends Object declared in method <R>collect(Supplier<R>,BiConsumer<R,? super T>,BiConsumer<R,R>) T extends Object declared in interface Stream Note: Some messages have been simplified; recompile with -Xdiags:verbose to get full output 2 errors
s242951276
p04044
C
#include<stdio.h> void sort(int left,int right); int strcom(char *pword1,char *pword2); char *pstr[100]; int main(){ int N,L; int i,j,k=0,len=0; char str[101]; scanf("%d %d",&N,&L); char word[N*(L+1)]; *pstr[k++]=word[0]; for(i=0;i<N;i++){ scanf("%s",str); j=0; do{ word[len++]=str[j++]; }while(str[j]!='\0'); *pstr[k++]=word[len]; } sort(0,N-1); for(i=0;i<N;i++)printf("%s",pstr[i]); } void sort(int left,int right){ char *bor; char *high[100],*low[100]; int i,h=0,l=0,len=right-left; bor=pstr[left]; for(i=left+1;i<=left+len;i++){ if(strcom(bor,pstr[i])==1){ low[l++]=pstr[i]; }else if(strcom(bor,pstr[i])==-1){ high[h++]=pstr[i]; } } for(i=0;i<l;i++)pstr[i+left]=low[i]; for(i=0;i<len-h-l+1;i++)pstr[left+l+i]=bor; for(i=0;i<h;i++)pstr[left+len-h+1+i]=high[i]; if(l>1)sort(left,left+l-1); if(h>1)sort(right-h+1,right); } int strcom(char *pword1,char *pword2){ int i; if(*pword1>*pword2)return 1; else if(*pword1<*pword2)return -1; else if(*pword1==*pword2){ if(*(pword+1)!='\0')return strcom(pword+1,pword+1); else return 0; } }
main.c: In function 'strcom': main.c:48:10: error: 'pword' undeclared (first use in this function); did you mean 'pword2'? 48 | if(*(pword+1)!='\0')return strcom(pword+1,pword+1); | ^~~~~ | pword2 main.c:48:10: note: each undeclared identifier is reported only once for each function it appears in
s325384456
p04044
C
#include<stdio.h> void sort(int left,int right); int strcom(char *pword1,char *pword2); char *pstr[100]; int main(){ int N,L; int i,j,k=0,len=0; char str[101]; scanf("%d %d",&N &L); char word[N*(L+1)]; *pstr[k++]=word[0]; for(i=0;i<N;i++){ scanf("%s",str); j=0; do{ word[len++]=str[j++]; }while(str[j]!='\0'); *pstr[k++]=word[len]; } sort(0,N-1); for(i=0;i<N;i++)printf("%s",pstr[i]); } void sort(int left,int right){ char *bor; char *high[100],*low[100]; int i,h=0,l=0,len=right-left; bor=pstr[left]; for(i=left+1;i<=left+len;i++){ if(strcom(bor,pstr+i)==1){ low[l++]=pstr[i]; }else if(strcom(bor,pstr+i)==-1){ high[h++]=pstr[i]; } } for(i=0;i<l;i++)pstr[i+left]=low[i]; for(i=0;i<len-h-l+1;i++)pstr[left+l+i]=bor; for(i=0;i<h;i++)pstr[left+len-h+1+i]=high[i]; if(l>1)sort(left,left+l-1); if(h>1)sort(right-h+1,right); } int strcom(char *pword1,char *pword2){ int i; if(*pword1>*pword2)return 1; else if(*pword1<*pword2)retun -1; else if(*pword1==*pword2){ if(*(pword+1)!='\0')return strcom(*(pword+1),*(pword+1)); else return 0; } }
main.c: In function 'main': main.c:10:20: error: invalid operands to binary & (have 'int *' and 'int') 10 | scanf("%d %d",&N &L); | ~~ ^ | | | int * main.c: In function 'sort': main.c:31:23: error: passing argument 2 of 'strcom' from incompatible pointer type [-Wincompatible-pointer-types] 31 | if(strcom(bor,pstr+i)==1){ | ~~~~^~ | | | char ** main.c:3:31: note: expected 'char *' but argument is of type 'char **' 3 | int strcom(char *pword1,char *pword2); | ~~~~~~^~~~~~ main.c:33:29: error: passing argument 2 of 'strcom' from incompatible pointer type [-Wincompatible-pointer-types] 33 | }else if(strcom(bor,pstr+i)==-1){ | ~~~~^~ | | | char ** main.c:3:31: note: expected 'char *' but argument is of type 'char **' 3 | int strcom(char *pword1,char *pword2); | ~~~~~~^~~~~~ main.c: In function 'strcom': main.c:46:27: error: 'retun' undeclared (first use in this function) 46 | else if(*pword1<*pword2)retun -1; | ^~~~~ main.c:46:27: note: each undeclared identifier is reported only once for each function it appears in main.c:48:10: error: 'pword' undeclared (first use in this function); did you mean 'pword2'? 48 | if(*(pword+1)!='\0')return strcom(*(pword+1),*(pword+1)); | ^~~~~ | pword2