submission_id
stringlengths
10
10
problem_id
stringlengths
6
6
language
stringclasses
3 values
code
stringlengths
1
522k
compiler_output
stringlengths
43
10.2k
s731145014
p04044
C++
#include <bits/stdc++.h> using namespace std; int main() { vector<string> v; int n,l; cin>>n>>l; for(int i=0;i<n;i++) { string s; cin>>s; v.push_back(s); } sort(v.begin(),v.end(),cmp); string ss; for(int i=0;i<n;i++) {ss=ss+v[i];} cout<<ss; return 0; } bool cmp(string a,string b) {return a<b;}
a.cc: In function 'int main()': a.cc:19:26: error: 'cmp' was not declared in this scope; did you mean 'bcmp'? 19 | sort(v.begin(),v.end(),cmp); | ^~~ | bcmp
s570708287
p04044
C++
#include <iostream> #include <vector> #include <string> using namespace std; int main() { vector <string> msg; int n, l; cin >> n >> l; while (--n) { string a; cin >> a; msg.push_back(a); } msg.sort(); string re = ""; for (auto i: msg) { re+=i;} cout<< re; }
a.cc: In function 'int main()': a.cc:17:9: error: 'class std::vector<std::__cxx11::basic_string<char> >' has no member named 'sort' 17 | msg.sort(); | ^~~~
s440128172
p04044
C++
#inclede<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.at(i); } sort(data.begin(),data.end()); for(int i=0; i<N ;i++){ cout << data.at(i); } }
a.cc:1:2: error: invalid preprocessing directive #inclede; did you mean #include? 1 | #inclede<bits/stdc++.h> | ^~~~~~~ | include a.cc: In function 'int main()': a.cc:5:3: error: 'cin' was not declared in this scope 5 | cin >> N >> L ; | ^~~ a.cc:1:1: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>' +++ |+#include <iostream> 1 | #inclede<bits/stdc++.h> a.cc:6:3: error: 'vector' was not declared in this scope 6 | vector<string> data(N) ; | ^~~~~~ a.cc:1:1: note: 'std::vector' is defined in header '<vector>'; this is probably fixable by adding '#include <vector>' +++ |+#include <vector> 1 | #inclede<bits/stdc++.h> a.cc:6:10: error: 'string' was not declared in this scope 6 | vector<string> data(N) ; | ^~~~~~ a.cc:1:1: note: 'std::string' is defined in header '<string>'; this is probably fixable by adding '#include <string>' +++ |+#include <string> 1 | #inclede<bits/stdc++.h> a.cc:6:18: error: 'data' was not declared in this scope 6 | vector<string> data(N) ; | ^~~~ a.cc:10:3: error: 'sort' was not declared in this scope; did you mean 'short'? 10 | sort(data.begin(),data.end()); | ^~~~ | short a.cc:12:5: error: 'cout' was not declared in this scope 12 | cout << data.at(i); | ^~~~ a.cc:12:5: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
s938686174
p04044
Java
import java.util.*; public class test { public static void main(String[] args) { Scanner sc=new Scanner(System.in); int n=sc.nextInt(); int l=sc.nextInt(); ArrayList<String> ar=new ArrayList<String>(); for(int i=0;i<n;i++) ar.add(sc.next()); Collections.sort(ar); for(int i=0;i<n;i++) System.out.print(ar.get(i)); }}
Main.java:2: error: class test is public, should be declared in a file named test.java public class test ^ 1 error
s050185948
p04044
Java
import java.util.*; import java.io.*; import java.lang.reflect.Array; public class A { public static void main(String[] args) { FastReader r = new FastReader(); String[] arr = r.rsaml(r.ria()[0]); Arrays.sort(arr); print(Arrays.toString(arr).replace("[","").replace("]", "").replace(",", "").replaceAll(" ", "")); } public static void rolling(int[] arr) { if (arr.length < 2) return; for (int i = 1; i < arr.length; i++) arr[i] += arr[i - 1]; } public static void rolling(long[] arr) { if (arr.length < 2) return; for (int i = 1; i < arr.length; i++) arr[i] += arr[i - 1]; } public static void reverse(int[] arr) { for (int i = 0; i < arr.length / 2; i++) { int temp = arr[i]; arr[i] = arr[arr.length - 1 - i]; arr[arr.length - 1 - i] = temp; } } public static void print(String s) { System.out.println(s); } public static void print(long s) { System.out.println(s); } public static void print(int s) { System.out.println(s); } static class FastReader { BufferedReader br; StringTokenizer st; public FastReader() { br = new BufferedReader(new InputStreamReader(System.in)); } int ri() { return Integer.parseInt(string()); } long rl() { return Long.parseLong(string()); } double rd() { return Double.parseDouble(string()); } String string() { String str = ""; try { str = br.readLine(); } catch (IOException e) { e.printStackTrace(); } return str; } String[] rsa() { return string().split(" "); } int[] ria() { String[] s = rsa(); int[] arr = new int[s.length]; for (int i = 0; i < arr.length; i++) arr[i] = Integer.parseInt(s[i]); return arr; } long[] rla() { String[] s = rsa(); long[] arr = new long[s.length]; for (int i = 0; i < arr.length; i++) arr[i] = Long.parseLong(s[i]); return arr; } char[] rca() { String s = string(); char[] arr = new char[s.length()]; for (int i = 0; i < arr.length; i++) arr[i] = s.charAt(i); return arr; } String[] rsaml(int m) { String[] arr = new String[m]; for (int i = 0; i < arr.length; i++) arr[i] = string(); return arr; } int[] riaml(int m) { int[] arr = new int[m]; for (int i = 0; i < arr.length; i++) arr[i] = Integer.parseInt(string()); return arr; } long[] rlaml(int m) { long[] arr = new long[m]; for (int i = 0; i < arr.length; i++) arr[i] = Long.parseLong(string()); return arr; } } } class Node { public int val; public boolean visited; public Node(int v) { val=v; } }
Main.java:6: error: class A is public, should be declared in a file named A.java public class A { ^ 1 error
s290266531
p04044
Java
//import java.util.*; class Main{ public static void main(String[]a){ Scanner s=new java.util.Scanner(System.in); int n=s.nextInt(); int i=s.nextInt(); a=new String[n]; for(i=0;i<n;i++)a[i]=s.next(); Arrays.sort(a); for(i=0;i<n;i++)System.out.print(a[i]); } }
Main.java:4: error: cannot find symbol Scanner s=new java.util.Scanner(System.in); ^ symbol: class Scanner location: class Main Main.java:9: error: cannot find symbol Arrays.sort(a); ^ symbol: variable Arrays location: class Main 2 errors
s263568509
p04044
Java
import java.util.Scanner; class Main{ public static void main(String[] args){ Scanner sc = new Scanner(System.in); int stringAmount = Integer.parseInt(sc.next()); int stringLength = Integer.parseInt(sc.next()); String[] stringArray = new String[stringAmount]; for(int i=0; i<stringAmount; i++){ stringArray[i] = sc.next(); } stringArray = merge(stringArray); StringBuilder builder = new StringBuilder(); for(int i=0; i<stringAmount; i++){ builder.append(stringArray[i]); } Syste.out.println(builder.toString()); } private static String[] merge(String[] sArray){ if(sArray.length == 1){ return sArray; }else{ String[] array1 = new String[sArray.length/2]; String[] array2 = new String[sArray.length-sArray.length/2]; for(int i=0; i<array1.length; i++){ array1[i] = sArray[i]; } for(int i=0; i<array2.length; j++){ array2[i] = sArray[array1.length+i]; } array1 = merge(array1); array2 = merge(array2); int i1 = 0; int i2 = 0; while(true){ if(judge(array1[i1], array2[i2])){ sArray[i1+i2] = array1[i1]; i1++; if(i1 == array1.length){ for(int j=0; j<sArray.length-i1-i2; j++){ sArray[i1+i2] = array2[i2]; } break; } }else{ sArray[i1+i2] = array2[i2]; i2++; if(i2 == array2.length){ for(int j=0; j<sArray.length-i1-i2; j++){ sArray[i1+i2] = array1[i1]; } break; } } } return sArray; } } private static void judge(String s1, String s2){ byte[] byte1 = s1.getBytes(); byte[] byte2 = s2.getBytes(); for(int i=0; i<byte1.length; i++){ if((int)byte1[i] < (int)byte2[i]){ return true; }else if((int)byte1[i] > (int)byte2[i]){ return false; } } return true; } }
Main.java:21: error: package Syste does not exist Syste.out.println(builder.toString()); ^ Main.java:33: error: cannot find symbol for(int i=0; i<array2.length; j++){ ^ symbol: variable j location: class Main Main.java:41: error: incompatible types: void cannot be converted to boolean if(judge(array1[i1], array2[i2])){ ^ Main.java:70: error: incompatible types: unexpected return value return true; ^ Main.java:72: error: incompatible types: unexpected return value return false; ^ Main.java:75: error: incompatible types: unexpected return value return true; ^ 6 errors
s920487821
p04044
C++
#include <bits/stdc++.h> using namepsace std; int main(){ int N, L; cin>>N>>L; vector<string> S(N); for(int i=0;i<N;i++) cin>>S[i]; sort(S.begin(), S.end()); string ans = ""; for(int i=0;i<N;i++) ans+=S[i]; cout<<ans; return 0; }
a.cc:2:7: error: expected nested-name-specifier before 'namepsace' 2 | using namepsace std; | ^~~~~~~~~ a.cc: In function 'int main()': a.cc:6:3: error: 'cin' was not declared in this scope; did you mean 'std::cin'? 6 | 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:7:3: error: 'vector' was not declared in this scope 7 | vector<string> S(N); | ^~~~~~ a.cc:7: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:7:10: error: 'string' was not declared in this scope 7 | vector<string> S(N); | ^~~~~~ a.cc:7: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:7:18: error: 'S' was not declared in this scope 7 | vector<string> S(N); | ^ a.cc:9:3: error: 'sort' was not declared in this scope; did you mean 'std::sort'? 9 | sort(S.begin(), S.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:10:9: error: expected ';' before 'ans' 10 | string ans = ""; | ^~~~ | ; a.cc:11:25: error: 'ans' was not declared in this scope; did you mean 'abs'? 11 | for(int i=0;i<N;i++) ans+=S[i]; | ^~~ | abs a.cc:12:3: error: 'cout' was not declared in this scope; did you mean 'std::cout'? 12 | cout<<ans; | ^~~~ | std::cout /usr/include/c++/14/iostream:63:18: note: 'std::cout' declared here 63 | extern ostream cout; ///< Linked to standard output | ^~~~ a.cc:12:9: error: 'ans' was not declared in this scope; did you mean 'abs'? 12 | cout<<ans; | ^~~ | abs
s723146149
p04044
C++
#include <bits/stdc++.h> using namespace std; int main(){ int N, L; vector <string> A(N); cin >> N >> L; for (int i=0; i<N; i++){ cin >> A.at(i); } sort(A.begin(),A.end()); cout << A << endl; }
a.cc: In function 'int main()': a.cc:12:8: error: no match for 'operator<<' (operand types are 'std::ostream' {aka 'std::basic_ostream<char>'} and 'std::vector<std::__cxx11::basic_string<char> >') 12 | cout << A << endl; | ~~~~ ^~ ~ | | | | | std::vector<std::__cxx11::basic_string<char> > | std::ostream {aka std::basic_ostream<char>} 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, from a.cc:1: /usr/include/c++/14/ostream:116:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(__ostream_type& (*)(__ostream_type&)) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>]' 116 | operator<<(__ostream_type& (*__pf)(__ostream_type&)) | ^~~~~~~~ /usr/include/c++/14/ostream:116:36: note: no known conversion for argument 1 from 'std::vector<std::__cxx11::basic_string<char> >' to 'std::basic_ostream<char>::__ostream_type& (*)(std::basic_ostream<char>::__ostream_type&)' {aka 'std::basic_ostream<char>& (*)(std::basic_ostream<char>&)'} 116 | operator<<(__ostream_type& (*__pf)(__ostream_type&)) | ~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~ /usr/include/c++/14/ostream:125:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(__ios_type& (*)(__ios_type&)) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>; __ios_type = std::basic_ios<char>]' 125 | operator<<(__ios_type& (*__pf)(__ios_type&)) | ^~~~~~~~ /usr/include/c++/14/ostream:125:32: note: no known conversion for argument 1 from 'std::vector<std::__cxx11::basic_string<char> >' to 'std::basic_ostream<char>::__ios_type& (*)(std::basic_ostream<char>::__ios_type&)' {aka 'std::basic_ios<char>& (*)(std::basic_ios<char>&)'} 125 | operator<<(__ios_type& (*__pf)(__ios_type&)) | ~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~ /usr/include/c++/14/ostream:135:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(std::ios_base& (*)(std::ios_base&)) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>]' 135 | operator<<(ios_base& (*__pf) (ios_base&)) | ^~~~~~~~ /usr/include/c++/14/ostream:135:30: note: no known conversion for argument 1 from 'std::vector<std::__cxx11::basic_string<char> >' to 'std::ios_base& (*)(std::ios_base&)' 135 | operator<<(ios_base& (*__pf) (ios_base&)) | ~~~~~~~~~~~~^~~~~~~~~~~~~~~~~ /usr/include/c++/14/ostream:174:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(long int) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>]' 174 | operator<<(long __n) | ^~~~~~~~ /usr/include/c++/14/ostream:174:23: note: no known conversion for argument 1 from 'std::vector<std::__cxx11::basic_string<char> >' to 'long int' 174 | operator<<(long __n) | ~~~~~^~~ /usr/include/c++/14/ostream:178:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(long unsigned int) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>]' 178 | operator<<(unsigned long __n) | ^~~~~~~~ /usr/include/c++/14/ostream:178:32: note: no known conversion for argument 1 from 'std::vector<std::__cxx11::basic_string<char> >' to 'long unsigned int' 178 | operator<<(unsigned long __n) | ~~~~~~~~~~~~~~^~~ /usr/include/c++/14/ostream:182:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(bool) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>]' 182 | operator<<(bool __n) | ^~~~~~~~ /usr/include/c++/14/ostream:182:23: note: no known conversion for argument 1 from 'std::vector<std::__cxx11::basic_string<char> >' to 'bool' 182 | operator<<(bool __n) | ~~~~~^~~ In file included from /usr/include/c++/14/ostream:1022: /usr/include/c++/14/bits/ostream.tcc:96:5: note: candidate: 'std::basic_ostream<_CharT, _Traits>& std::basic_ostream<_CharT, _Traits>::operator<<(short int) [with _CharT = char; _Traits = std::char_traits<char>]' 96 | basic_ostream<_CharT, _Traits>:: | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ /usr/include/c++/14/bits/ostream.tcc:97:22: note: no known conversion for argument 1 from 'std::vector<std::__cxx11::basic_string<char> >' to 'short int' 97 | operator<<(short __n) | ~~~~~~^~~ /usr/include/c++/14/ostream:189:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(short unsigned int) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>]' 189 | operator<<(unsigned short __n) | ^~~~~~~~ /usr/include/c++/14/ostream:189:33: note: no known conversion for argument 1 from 'std::vector<std::__cxx11::basic_string<char> >' to 'short unsigned int' 189 | operator<<(unsigned short __n) | ~~~~~~~~~~~~~~~^~~ /usr/include/c++/14/bits/ostream.tcc:110:5: note: candidate: 'std::basic_ostream<_CharT, _Traits>& std::basic_ostream<_CharT, _Traits>::operator<<(int) [with _CharT = char; _Traits = std::char_traits<char>]' 110 | basic_ostream<_CharT, _Traits>:: | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ /usr/include/c++/14/bits/ostream.tcc:111:20: note: no known conversion for argument 1 from 'std::vector<std::__cxx11::basic_string<char> >' to 'int' 111 | operator<<(int __n) | ~~~~^~~ /usr/include/c++/14/ostream:200:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(unsigned int) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>]' 200 | operator<<(unsigned int __n) | ^~~~~~~~ /usr/include/c++/14/ostream:200:31: note: no known conversion for argument 1 from 'std::vector<std::__cxx11::basic_string<char> >' to 'unsigned int' 200 | operator<<(unsigned int __n) | ~~~~~~~~~~~~~^~~ /usr/include/c++/14/ostream:211:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(long long int) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>]' 211 | operator<<(long long __n) | ^~~~~~~~ /usr/include/c++/14/ostream:211:28: note: no known conversion for argument 1 from 'std::vector<std::__cxx11::basic_string<char> >' to 'long long int' 211 | operator<<(long long __n) | ~~~~~~~~~~^~~ /usr/include/c++/14/ostream:215:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(long long unsigned int) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>]' 215 | operator<<(unsigned long long __n) | ^~~~~~~~ /usr/include/c++/14/ostream:215:37: note: no known conversion for argument 1 from 'std::vector<std::__cxx11::basic_string<char> >' to 'long long unsigned int' 215 | operator<<(unsigned long long __n) | ~~~~~~~~~~~~~~~~~~~^~~ /usr/include/c++/14/ostream:231:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(double) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>]' 231 | operator<<(double __f) | ^~~~~~~~ /usr/include/c++/14/ostream:231:25: note: no known conversion for argument 1 from 'std::vector<std::__cxx11::basic_string<char> >' to 'double' 231 | operator<<(double __f) | ~~~~~~~^~~ /usr/include/c++/14/ostream:235:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(float) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>]' 235 | operator<<(float __f) | ^~~~~~~~ /usr/include/c++/14/ostream:235:24: note: no known conversion for argument 1 from 'std::vector<std::__cxx11::basic_string<char> >' to 'float' 235 | operator<<(float __f) | ~~~~~~^~~ /usr/include/c++/14/ostream:243:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(long double) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>]' 243 | operator<<(long double __f) | ^~~~~~~~ /usr/include/c++/14/ostream:243:30: note: no known conversion for argument 1 from 'std::vector<std::__cxx11::basic_string<char> >' to 'long double' 243 | operator<<(long double __f) | ~~~~~~~~~~~~^~~ /usr/include/c++/14/ostream:301:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(const void*) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>]' 301 | operator<<(const void* __p) | ^~~~~~~~ /usr/include/c++/14/ostream:301:30: note: no known conversion for argument 1 from 'std::vector<std::__cxx11::basic_string<char> >' to 'const void*' 301 | operator<<(const void* __p) | ~~~~~~~~~~~~^~~ /usr/include/c++
s348537650
p04044
Java
import java.util.Scanner; import java.util.Arrays; import java.util.Collections; public class Main{ public static void main(String[] args){ Scanner sc = new Scanner(System.in); int N = sc.nextInt(); int L = sc.nextInt(); String[] strs = new String [N]; for (int i =0; i<L ; i++){ strs[i] = sc.nextLine(); } Arrays.sort(strs); Strig str = ""; for (int i =0; i<L ; i++){ str += strs[i]; } System.out.println(str); sc.close(); } }
Main.java:15: error: cannot find symbol Strig str = ""; ^ symbol: class Strig location: class Main 1 error
s281303193
p04044
C
#include<stdio.h> int n,l; char l[100][100]; int a[100]; int le(int x,int y){ int k=0; while(k<l){ if(l[x][k]<l[y][k])return 1; if(l[x][k]>l[y][k])return 0; k++; } return 0; } void q(int s,int t){ int p=a[s],i=s,j=t; if(s<t){ while(1){ while(le(a[i],p))i++; while(le(p,a[j]))j--; if(i>=j)break; a[i]^=a[j]^=a[i]^=a[j]; i++;j--; } q(s,i-1);q(j+1,t); } } int main(){ int i; scanf("%d %d",&n,&l); for(i=0;i<n;i++){scanf("%s",l[i]);a[i]=i;} q(0,n-1); for(i=0;i<n;i++)printf("%s",list[a[i]]); }
main.c:3:6: error: conflicting types for 'l'; have 'char[100][100]' 3 | char l[100][100]; | ^ main.c:2:7: note: previous declaration of 'l' with type 'int' 2 | int n,l; | ^ main.c: In function 'main': main.c:32:31: error: 'list' undeclared (first use in this function) 32 | for(i=0;i<n;i++)printf("%s",list[a[i]]); | ^~~~ main.c:32:31: note: each undeclared identifier is reported only once for each function it appears in
s995728238
p04044
C++
#include <bits/stdc++.h> using namespace std; typedef long long ll; int main(){ int N, M; cin >> N >>M; vector<string> mo(M); for(int i = 0;i<M;i++)cin >> mo[i]; sort(mo,mo+M); for(int i = 0;i<M;i++){ cout<<mo[i]; } cout <<endl; }
a.cc: In function 'int main()': a.cc:12:11: error: no match for 'operator+' (operand types are 'std::vector<std::__cxx11::basic_string<char> >' and 'int') 12 | sort(mo,mo+M); | ~~^~ | | | | | int | std::vector<std::__cxx11::basic_string<char> > In file included from /usr/include/c++/14/bits/stl_algobase.h:67, 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/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:12:12: note: mismatched types 'const std::reverse_iterator<_Iterator>' and 'int' 12 | sort(mo,mo+M); | ^ /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:12:12: note: mismatched types 'const std::move_iterator<_IteratorL>' and 'int' 12 | sort(mo,mo+M); | ^ 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: /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:12:12: note: 'std::vector<std::__cxx11::basic_string<char> >' is not derived from 'const std::__cxx11::basic_string<_CharT, _Traits, _Allocator>' 12 | sort(mo,mo+M); | ^ /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:12:12: note: mismatched types 'const _CharT*' and 'std::vector<std::__cxx11::basic_string<char> >' 12 | sort(mo,mo+M); | ^ /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:12:12: note: mismatched types 'const std::__cxx11::basic_string<_CharT, _Traits, _Allocator>' and 'int' 12 | sort(mo,mo+M); | ^ /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:12:12: note: 'std::vector<std::__cxx11::basic_string<char> >' is not derived from 'const std::__cxx11::basic_string<_CharT, _Traits, _Allocator>' 12 | sort(mo,mo+M); | ^ /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:12:12: note: 'std::vector<std::__cxx11::basic_string<char> >' is not derived from 'const std::__cxx11::basic_string<_CharT, _Traits, _Allocator>' 12 | sort(mo,mo+M); | ^ /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:12:12: note: 'std::vector<std::__cxx11::basic_string<char> >' is not derived from 'std::__cxx11::basic_string<_CharT, _Traits, _Allocator>' 12 | sort(mo,mo+M); | ^ /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:12:12: note: 'std::vector<std::__cxx11::basic_string<char> >' is not derived from 'const std::__cxx11::basic_string<_CharT, _Traits, _Allocator>' 12 | sort(mo,mo+M); | ^ /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:12:12: note: 'std::vector<std::__cxx11::basic_string<char> >' is not derived from 'std::__cxx11::basic_string<_CharT, _Traits, _Allocator>' 12 | sort(mo,mo+M); | ^ /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:12:12: note: mismatched types 'const _CharT*' and 'std::vector<std::__cxx11::basic_string<char> >' 12 | sort(mo,mo+M); | ^ /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:12:12: note: mismatched types 'std::__cxx11::basic_string<_CharT, _Traits, _Allocator>' and 'int' 12 | sort(mo,mo+M); | ^ /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:12:12: note: 'std::vector<std::__cxx11::basic_string<char> >' is not derived from 'std::__cxx11::basic_string<_CharT, _Traits, _Allocator>' 12 | sort(mo,mo+M); | ^ /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:12:12: note: 'std::vector<std::__cxx11::basic_string<char> >' is not derived from 'std::__cxx11::basic_string<_CharT, _Traits, _Allocator>' 12 | sort(mo,mo+M); | ^ In file included from /usr/include/c++/14/ccomplex:39, from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:127: /usr/include/c++/14/complex:340:5: note: candidate: 'template<class _Tp> std::complex<_Tp> std::operator+(const complex<_Tp>&, const complex<_Tp>&)' 340 | operator+(const complex<_Tp>& __x, const complex<_Tp>& __y) | ^~~~~~~~ /usr/include/c++/14/complex:340:5: note: template argument deduction/substitution failed: a.cc:12:12: note: 'std::vector<std::__cxx11::basic_string<char> >' is not derived from 'const std::complex<_Tp>' 12 | sort(mo,mo+M); | ^ /usr/inclu
s052522159
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(); List<String> list = new ArrayList<String>(); for(int i = 0; i<n; i++){ list.add(sc.nextInt()); } Collections.sort(list); for(int i=0; i<list.size(); i++){ System.out.print(stateList.get(i)); } } }
Main.java:9: error: incompatible types: int cannot be converted to String list.add(sc.nextInt()); ^ Main.java:14: error: cannot find symbol System.out.print(stateList.get(i)); ^ symbol: variable stateList location: class Main Note: Some messages have been simplified; recompile with -Xdiags:verbose to get full output 2 errors
s975804120
p04044
C
#include<stdio.h> #include<string.h> int main(void){ int n,l,i,j; char s[100][101],c[101]; scanf("%d %d",&n,&l); for(i=0;i<n;i++) scanf("%s",s[i]);#include<stdio.h> #include<stdio.h> int main(){ int L,N,i,j; scanf("%d %d",&N,&L); char S[100][100]; char tmp[100]; for(i=0;i<N;i++){ scanf("%s",S[i]); } for(i=0;i<N-1;i++){ for(j=N-1;j>i;j--){ if(strcmp(S[j-1],S[j])>0){ strcpy(tmp,S[j-1]); strcpy(S[j-1],S[j]); strcpy(S[j],tmp); } } } for(i=0;i<N;i++) printf("%s",S[i]); return 0; }
main.c: In function 'main': main.c:8:18: error: stray '#' in program 8 | scanf("%s",s[i]);#include<stdio.h> | ^ main.c:8:19: error: 'include' undeclared (first use in this function) 8 | scanf("%s",s[i]);#include<stdio.h> | ^~~~~~~ main.c:8:19: note: each undeclared identifier is reported only once for each function it appears in main.c:8:27: error: 'stdio' undeclared (first use in this function); did you mean 'stdin'? 8 | scanf("%s",s[i]);#include<stdio.h> | ^~~~~ | stdin main.c:10:1: error: expected expression before 'int' 10 | int main(){ | ^~~ main.c:28:1: error: expected declaration or statement at end of input 28 | } | ^
s258506902
p04044
C
#include <stdio.h> int main(void) { int n, l; int i, j; scanf("%d", &n); scanf("%d", &l); char str[n][l]; for(i=0; i<n; i++){ for(j=0; j<l; j++){ scanf("%s", &str[n][j]); printf(%s, &str[n][j]); } } return 0; }
main.c: In function 'main': main.c:16:14: error: expected expression before '%' token 16 | printf(%s, &str[n][j]); | ^
s144309147
p04044
C
#include <stdio.h> int main(void) { int n, l; int i, j; scanf("%d", &n); scanf("%d", &l); char str[n][l]; for(i=0; i<n; i++){ for(j=0; j<l; j++){ scanf("%s", &str[n][j]); printf(%s, str[n][j]); } } return 0; }
main.c: In function 'main': main.c:16:14: error: expected expression before '%' token 16 | printf(%s, str[n][j]); | ^
s921573158
p04044
C
#include <stdio.h> int main(void) { int n, l; int i, j; scanf("%d", &n); scanf("%d", &l); char str[n][l]; for(i=0; i<n; i++){ for(j=0; j<l; j++){ scanf(%s, &str[n][j]); printf("%s",str[n][j]); } }
main.c: In function 'main': main.c:15:13: error: expected expression before '%' token 15 | scanf(%s, &str[n][j]); | ^ main.c:18:3: error: expected declaration or statement at end of input 18 | } | ^
s310843075
p04044
C
#include <stdio.h> int main(void) { int n, l; int i, j; scanf("%d", &n); scanf("%d", &l); char str[n][l]; for(i=0; i<n; i++){ for(j=0; j<l; j++){ scanf(%s, &str[n][j]); printf(); } }
main.c: In function 'main': main.c:15:13: error: expected expression before '%' token 15 | scanf(%s, &str[n][j]); | ^ main.c:16:7: error: too few arguments to function 'printf' 16 | printf(); | ^~~~~~ In file included from main.c:1: /usr/include/stdio.h:363:12: note: declared here 363 | extern int printf (const char *__restrict __format, ...); | ^~~~~~ main.c:18:3: error: expected declaration or statement at end of input 18 | } | ^
s588169562
p04044
C
#include <stdio.h> int main(void) { int n, l; scanf(%d, &n); scanf(%d, &l); char str[n][l]; for(i=0; i<n; i++){ for(j=0; j<l; j++){ scanf(%s, &str[n][j]); printf(); } } return 0; }
main.c: In function 'main': main.c:7:9: error: expected expression before '%' token 7 | scanf(%d, &n); | ^ main.c:8:9: error: expected expression before '%' token 8 | scanf(%d, &l); | ^ main.c:12:7: error: 'i' undeclared (first use in this function) 12 | for(i=0; i<n; i++){ | ^ main.c:12:7: note: each undeclared identifier is reported only once for each function it appears in main.c:13:9: error: 'j' undeclared (first use in this function) 13 | for(j=0; j<l; j++){ | ^ main.c:14:13: error: expected expression before '%' token 14 | scanf(%s, &str[n][j]); | ^ main.c:15:7: error: too few arguments to function 'printf' 15 | printf(); | ^~~~~~ In file included from main.c:1: /usr/include/stdio.h:363:12: note: declared here 363 | extern int printf (const char *__restrict __format, ...); | ^~~~~~
s910373616
p04044
C
for(i=1;i<num;i++){ for(j=1;j<num;j++){ if(strcmp(moji[j-1], moji[j])>0){ strcpy(tmp, moji[j-1]); strcpy(moji[j-1], moji[j]); strcpy(moji[j], tmp); } } }
main.c:1:1: error: expected identifier or '(' before 'for' 1 | for(i=1;i<num;i++){ | ^~~ main.c:1:10: error: expected '=', ',', ';', 'asm' or '__attribute__' before '<' token 1 | for(i=1;i<num;i++){ | ^ main.c:1:16: error: expected '=', ',', ';', 'asm' or '__attribute__' before '++' token 1 | for(i=1;i<num;i++){ | ^~
s289318566
p04044
C++
#include <stdio.h> void main(){ int N, L, i, j, k; scanf("%d %d", &N, &L); char S[N][L]; int s[N], n[N]; for(i=0; i<N; i++){ s[i]=0; n[i]=i; for(j=0; j<L; j++){ scanf("%c", &S[i][j]); s[i]+=S[i][j];} k=s[i]; for(j=i; j>0; j++){ if(s[n[j]]<s[n[j-1]]){ k=s[n[j]]; s[n[j]]=s[n[j-1]]; s[n[j-1]]=k;}}}} for(i=0; i<N; i++) for(j=0; j<L; j++) printf("%c", S[i][j]); return 0;}
a.cc:3:1: error: '::main' must return 'int' 3 | void main(){ | ^~~~ a.cc:21:3: error: expected unqualified-id before 'for' 21 | for(i=0; i<N; i++) | ^~~ a.cc:21:12: error: 'i' does not name a type 21 | for(i=0; i<N; i++) | ^ a.cc:21:17: error: 'i' does not name a type 21 | for(i=0; i<N; i++) | ^ a.cc:22:14: error: 'j' does not name a type 22 | for(j=0; j<L; j++) | ^ a.cc:22:19: error: 'j' does not name a type 22 | for(j=0; j<L; j++) | ^ a.cc:25:1: error: expected unqualified-id before 'return' 25 | return 0;} | ^~~~~~ a.cc:25:10: error: expected declaration before '}' token 25 | return 0;} | ^
s292959813
p04044
C++
// // main.cpp // 042 // // Created by Coma on 2020/05/12. // Copyright © 2020 Coma. All rights reserved. // #include <iostream> #include <string> #include <vector> #include <cstring> using namespace std; int main(int argc, const char * argv[]) { // insert code here... int N, L; cin >> N >> L; vector<string> vs; string stmp; for(int i = 0; i < N; i++) { cin >> stmp; vs.push_back(stmp); } sort(vs.begin(), vs.end()); for_each(vs.begin(), vs.end(), [](string str) { cout << str; });
a.cc: In function 'int main(int, const char**)': a.cc:30:5: error: 'sort' was not declared in this scope; did you mean 'short'? 30 | sort(vs.begin(), vs.end()); | ^~~~ | short a.cc:32:5: error: 'for_each' was not declared in this scope 32 | for_each(vs.begin(), vs.end(), [](string str) | ^~~~~~~~ a.cc:35:8: error: expected '}' at end of input 35 | }); | ^ a.cc:16:41: note: to match this '{' 16 | int main(int argc, const char * argv[]) { | ^
s023721954
p04044
C
#include <stdio.h> #include <stdlib.h> int lex_smaller(char* s1, char* s2) { int i; for (i = 0; s1[i] != 0 && s2[i] != 0; i++) { if (s1[i] < s2[i]) return 1; else if (s1[i] > s2[i]) return -1; } if (s1[i] == s2[i]) return 0; else if (s1[i] == 0) return 1; else return -1; } void push(char* s, char** heap, int* n) { int i = *n; char *tmp; heap[(*n)++] = s; while (1) { if (i == 0) break; else if (lex_smaller(heap[i], heap[(i - 1) / 2]) == 1) { tmp = heap[(i - 1) / 2]; heap[(i - 1) / 2] = heap[i]; heap[i] = tmp; i = (i - 1) / 2; } else break; } } char* pop(char** heap, int* n) { int i = 0, j; char *tmp, *output = heap[0]; heap[0] = heap[--(*n)]; while (1) { if (i * 2 + 1 >= *n) break; else if (i * 2 + 2 >= *n) j = i * 2 + 1; else if (lex_smaller(heap[i * 2 + 1], heap[i * 2 + 2]) == 1) j = i * 2 + 1; else j = i * 2 + 2; if (lex_smaller(heap[j], heap[i]) == 1) { tmp = heap[j]; heap[j] = heap[i]; heap[i] = tmp; i = j; } else break; } return output; } int main() { int i, N, L; char S[101][101]; scanf("%d %d", &N, &L); for (i = 1; i <= N; i++) scanf("%s", S[i]); int j, k, n = 0; char ans[10001] = {}, *tmp, **heap = (char**)malloc(sizeof(char*) * N); for (i = 1, k = 0; i <= N; i++) push(S[i], heap, &m); while (m > 0) { tmp = pop(heap, &m); for (j = 0; j < L; j++) ans[k++] = tmp[j]; } printf("%s\n", ans); fflush(stdout); return 0; }
main.c: In function 'main': main.c:61:59: error: 'm' undeclared (first use in this function) 61 | for (i = 1, k = 0; i <= N; i++) push(S[i], heap, &m); | ^ main.c:61:59: note: each undeclared identifier is reported only once for each function it appears in
s399021162
p04044
C++
#include <bits/stdc++.h> using namespace std; int main() { int N, L; string s[110]; cin >> N >> L; for (int i = 0; i < N; i++) { cin >> s[i]; } sort(s, s + N, greater<string>()); string sum = ''; for (int i = 0; i < N; i++) { sum += s[i]; } cout << sum << endl; }
a.cc:13:16: error: empty character constant 13 | string sum = ''; | ^~ a.cc: In function 'int main()': a.cc:13:16: error: conversion from 'char' to non-scalar type 'std::string' {aka 'std::__cxx11::basic_string<char>'} requested
s116247316
p04044
C++
#include <bits/stdc++.h> using namespace std; int main(){ int n,l; cin>>n>>l; string a [n]; for (int i=0;i<n;i++) { cin>>a[i]; } sort(a+0;a+n); for (int i=0;i<n;i++) { cout<<a[i]; } }
a.cc: In function 'int main()': a.cc:10:11: error: expected ')' before ';' token 10 | sort(a+0;a+n); | ~ ^ | ) a.cc:10:15: error: expected ';' before ')' token 10 | sort(a+0;a+n); | ^ | ;
s598185391
p04044
C++
#include <bits/stdc++.h> using namespace std; int main() { int n, l; cin >> n >> k; vector<string> vec(n); for (int i=0; i<n; i++){ cin >> vec[i]; } sort(vec.begin(), vec.end()); string ans=vec[0]; for (int i=1; i<n; i++){ ans+=vec[i]; } cout << ans << endl; }
a.cc: In function 'int main()': a.cc:6:15: error: 'k' was not declared in this scope 6 | cin >> n >> k; | ^
s893793739
p04044
C++
#include <bits/stdc++.h> using namespace std; int main() { int n,l cin >> n >> l; string a; 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++){ a+= s[i]; } cout << a << endl; }
a.cc: In function 'int main()': a.cc:7:3: error: expected initializer before 'cin' 7 | cin >> n >> l; | ^~~
s792020263
p04044
C++
#include<bits/stdc++.h> using namespace std; int main(){ int n,l; cin>>n>>l; vector<string> v(n); for(int i=0;i<n;i++) cin>>v.at(i); sort(v.begin(),end()); for(int i=0;i<n;i++) cout<<v.at(i); cout<<endl; }
a.cc: In function 'int main()': a.cc:9:21: error: no matching function for call to 'end()' 9 | sort(v.begin(),end()); | ~~~^~ In file included from /usr/include/c++/14/bits/algorithmfwd.h:39, from /usr/include/c++/14/bits/stl_algo.h:59, 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/initializer_list:99:5: note: candidate: 'template<class _Tp> constexpr const _Tp* std::end(initializer_list<_Tp>)' 99 | end(initializer_list<_Tp> __ils) noexcept | ^~~ /usr/include/c++/14/initializer_list:99:5: note: candidate expects 1 argument, 0 provided In file included from /usr/include/c++/14/string:53, 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/range_access.h:74:5: note: candidate: 'template<class _Container> constexpr decltype (__cont.end()) std::end(_Container&)' 74 | end(_Container& __cont) -> decltype(__cont.end()) | ^~~ /usr/include/c++/14/bits/range_access.h:74:5: note: candidate expects 1 argument, 0 provided /usr/include/c++/14/bits/range_access.h:85:5: note: candidate: 'template<class _Container> constexpr decltype (__cont.end()) std::end(const _Container&)' 85 | end(const _Container& __cont) -> decltype(__cont.end()) | ^~~ /usr/include/c++/14/bits/range_access.h:85:5: note: candidate expects 1 argument, 0 provided /usr/include/c++/14/bits/range_access.h:106:5: note: candidate: 'template<class _Tp, long unsigned int _Nm> constexpr _Tp* std::end(_Tp (&)[_Nm])' 106 | end(_Tp (&__arr)[_Nm]) noexcept | ^~~ /usr/include/c++/14/bits/range_access.h:106:5: note: candidate expects 1 argument, 0 provided In file included from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:166: /usr/include/c++/14/valarray:1249:5: note: candidate: 'template<class _Tp> _Tp* std::end(valarray<_Tp>&)' 1249 | end(valarray<_Tp>& __va) noexcept | ^~~ /usr/include/c++/14/valarray:1249:5: note: candidate expects 1 argument, 0 provided /usr/include/c++/14/valarray:1265:5: note: candidate: 'template<class _Tp> const _Tp* std::end(const valarray<_Tp>&)' 1265 | end(const valarray<_Tp>& __va) noexcept | ^~~ /usr/include/c++/14/valarray:1265:5: note: candidate expects 1 argument, 0 provided
s785400976
p04044
C++
#include <bits/stdc++.h> using namespace std; int main(){ int N,L; cin>>N>>L; vector<string>data(110); for(int i=0;i<N;i++){ cin>>data.at(i); } sort(data.begin(),data.end()); for(int i=0;i<data.size();i++){ cout<<data.at(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(){ | ^
s233591747
p04044
C++
#include <bits/stdc++.h> #include <iostream> #include <algorithm> #include <cmath> using namespace std; int main(){ int N,L; cin >> N >> L; string S[110]; for (int i = 0; i < N; ++i) cin >> S[i]; sort(S, S + N); string s; for (int i = 0; i < L; ++i) { s += S[i]; } cout << s << endl;
a.cc: In function 'int main()': a.cc:19:23: error: expected '}' at end of input 19 | cout << s << endl; | ^ a.cc:7:11: note: to match this '{' 7 | int main(){ | ^
s042364008
p04044
C++
#include <bits/stdc++.h> using namespace std; #define int long long #define alpha_size 26 const int N = 100 + 11; int n, l; string s[N]; int32_t main() { ios_base::sync_with_stdio(false); cin.tie(nullptr); cout.tie(nullptr); cin >> n >> l; for (int i = 0; i < n; i++) cin >> s[i]; sort(s, s + n); string ret; for (int i = 0; i < n i++) ret += s[i]; cout << ret << endl; }
a.cc: In function 'int32_t main()': a.cc:20:26: error: expected ';' before 'i' 20 | for (int i = 0; i < n i++) | ^~ | ;
s622549237
p04044
Java
public class Main { public static void main(String[] args) { Scanner in = new Scanner(System.in); int n = in.nextInt(); int k = in.nextInt(); List<String> data= new ArrayList<>(); for (int i = 0; i < k; i++) { data.add(in.nextLine()); } System.out.println(data.stream().sorted().collect(Collectors.joining(""))); } }
Main.java:4: error: cannot find symbol Scanner in = new Scanner(System.in); ^ symbol: class Scanner location: class Main Main.java:4: error: cannot find symbol Scanner in = new Scanner(System.in); ^ symbol: class Scanner location: class Main Main.java:7: error: cannot find symbol List<String> data= new ArrayList<>(); ^ symbol: class List location: class Main Main.java:7: error: cannot find symbol List<String> data= new ArrayList<>(); ^ symbol: class ArrayList location: class Main Main.java:11: error: cannot find symbol System.out.println(data.stream().sorted().collect(Collectors.joining(""))); ^ symbol: variable Collectors location: class Main 5 errors
s504344096
p04044
Java
public static void main(String[] args) { Scanner in = new Scanner(System.in); int n = in.nextInt(); int k = in.nextInt(); List<String> data= new ArrayList<>(); for (int i = 0; i < k; i++) { data.add(in.nextLine()); } System.out.println(data.stream().sorted().collect(Collectors.joining(""))); }
Main.java:1: error: unnamed classes are a preview feature and are disabled by default. public static void main(String[] args) { ^ (use --enable-preview to enable unnamed classes) 1 error
s230822635
p04044
Java
import java.util.*; public class Main1 { public static void main(String[] args) { Scanner in = new Scanner(System.in); int n = in.nextInt(); int k = in.nextInt(); List<String> data= new ArrayList<>(); for (int i = 0; i < k; i++) { data.add(in.nextLine()); } System.out.println(data.stream().sorted().collect(Collectors.joining(""))); } }
Main.java:3: error: class Main1 is public, should be declared in a file named Main1.java public class Main1 { ^ Main.java:13: error: cannot find symbol System.out.println(data.stream().sorted().collect(Collectors.joining(""))); ^ symbol: variable Collectors location: class Main1 2 errors
s520999985
p04044
C++
#include<bits\stdc++.h> using namespace std; int main() { int i,n,l; cin>>n>>l; string s1; vector<string> s; for(i=0;i<n;i++){ cin>>s1; s.push_back(s1); } sort(s.begin(),s.end()); for(i=0;i<n;i++){ cout<<s[i]; } cout<<endl; return 0; }
a.cc:1:9: fatal error: bits\stdc++.h: No such file or directory 1 | #include<bits\stdc++.h> | ^~~~~~~~~~~~~~~ compilation terminated.
s783335237
p04044
C++
#include<bits\stdc++.h> using namespace std; int main() { int i,n,l; cin>>n>>l; string s1; vector<string> s; for(i=0;i<n;i++){ cin>>s1; s.push_back(s1); } sort(s.begin(),s.end()); for(i=0;i<n;i++){ cout<<s[i]; } cout<<endl; return 0; }
a.cc:1:9: fatal error: bits\stdc++.h: No such file or directory 1 | #include<bits\stdc++.h> | ^~~~~~~~~~~~~~~ compilation terminated.
s138738526
p04044
C
#include<stdio.h> #include<stdlib.h> #include<string.h> int main() { int N,L; scanf("%d %d", &N, &L); char text[101][101],senten[10001],tem[101]; int i,j; for(i=0; i<N; i++) { scanf("%s",text[i]); } for(i=1; i<N; i++) { for(j=i; j<N; j++) { if(strcmp(text[i-1], text[j]) => 0) { strcpy(tem, text[j]); strcpy(text[j], text[i-1]); strcpy(text[i-1], tem); } } } for(i=0; i<N; i++) { memcpy(senten + i * L, text[i], L); } printf("%s",senten ); return 0; }
main.c: In function 'main': main.c:23:37: error: expected expression before '>' token 23 | if(strcmp(text[i-1], text[j]) => 0) | ^
s830676543
p04044
C
#include<stdio.h> #include<stdlib.h> #include<string.h> #define N 100 #define L 100 int main() { char text[N],senten[N*L],tem[L]; int i,j; for(i=0; i<N; i++) { scanf("%s",text[i]); } for(i=1; i<L; i++) { for(j=1; j<N; j++) { if(strcmp(text[j-1], text[j]) > 0) { strcpy(tem, text[j-1]); strcpy(text[j-1], text[j]); strcpy(text[j], tem); } } } for(i=0; i<N; i++) { memcpy(senten + i * L, text[i], L); } print("%S",senten ); return 0; }
main.c: In function 'main': main.c:22:20: error: passing argument 1 of 'strcmp' makes pointer from integer without a cast [-Wint-conversion] 22 | if(strcmp(text[j-1], text[j]) > 0) | ~~~~^~~~~ | | | char In file included from main.c:3: /usr/include/string.h:156:32: note: expected 'const char *' but argument is of type 'char' 156 | extern int strcmp (const char *__s1, const char *__s2) | ~~~~~~~~~~~~^~~~ main.c:22:31: error: passing argument 2 of 'strcmp' makes pointer from integer without a cast [-Wint-conversion] 22 | if(strcmp(text[j-1], text[j]) > 0) | ~~~~^~~ | | | char /usr/include/string.h:156:50: note: expected 'const char *' but argument is of type 'char' 156 | extern int strcmp (const char *__s1, const char *__s2) | ~~~~~~~~~~~~^~~~ main.c:24:24: error: passing argument 2 of 'strcpy' makes pointer from integer without a cast [-Wint-conversion] 24 | strcpy(tem, text[j-1]); | ~~~~^~~~~ | | | char /usr/include/string.h:141:70: note: expected 'const char * restrict' but argument is of type 'char' 141 | extern char *strcpy (char *__restrict __dest, const char *__restrict __src) | ~~~~~~~~~~~~~~~~~~~~~~~^~~~~ main.c:25:19: error: passing argument 1 of 'strcpy' makes pointer from integer without a cast [-Wint-conversion] 25 | strcpy(text[j-1], text[j]); | ~~~~^~~~~ | | | char /usr/include/string.h:141:39: note: expected 'char * restrict' but argument is of type 'char' 141 | extern char *strcpy (char *__restrict __dest, const char *__restrict __src) | ~~~~~~~~~~~~~~~~~^~~~~~ main.c:25:30: error: passing argument 2 of 'strcpy' makes pointer from integer without a cast [-Wint-conversion] 25 | strcpy(text[j-1], text[j]); | ~~~~^~~ | | | char /usr/include/string.h:141:70: note: expected 'const char * restrict' but argument is of type 'char' 141 | extern char *strcpy (char *__restrict __dest, const char *__restrict __src) | ~~~~~~~~~~~~~~~~~~~~~~~^~~~~ main.c:26:19: error: passing argument 1 of 'strcpy' makes pointer from integer without a cast [-Wint-conversion] 26 | strcpy(text[j], tem); | ~~~~^~~ | | | char /usr/include/string.h:141:39: note: expected 'char * restrict' but argument is of type 'char' 141 | extern char *strcpy (char *__restrict __dest, const char *__restrict __src) | ~~~~~~~~~~~~~~~~~^~~~~~ main.c:32:36: error: passing argument 2 of 'memcpy' makes pointer from integer without a cast [-Wint-conversion] 32 | memcpy(senten + i * L, text[i], L); | ~~~~^~~ | | | char /usr/include/string.h:43:70: note: expected 'const void * restrict' but argument is of type 'char' 43 | extern void *memcpy (void *__restrict __dest, const void *__restrict __src, | ~~~~~~~~~~~~~~~~~~~~~~~^~~~~ main.c:35:3: error: implicit declaration of function 'print'; did you mean 'printf'? [-Wimplicit-function-declaration] 35 | print("%S",senten ); | ^~~~~ | printf
s460285298
p04044
C
#include<stdio.h> #include<stdlib.h> #include<string.h> #define N 100 #define L 100 int main() { char text[N],senten[N*L],tem[L]; int i,j; for(i=0; i<N; i++) { scanf("%s",text[i]); } for(i=1; i<L; i++) { for(j=1; j<N; j++) { if(strcmp(text[j-1], text[j]) > 0) { strcpy(tem, text[j-1]); strcpy(text[j-1], text[j]); strcpy(text[j], tem); } } } for(i=0; i<N; i++) { memcpy(senten + i * L, text[i], L); } print("%S",senten ); return 0; }
main.c: In function 'main': main.c:22:20: error: passing argument 1 of 'strcmp' makes pointer from integer without a cast [-Wint-conversion] 22 | if(strcmp(text[j-1], text[j]) > 0) | ~~~~^~~~~ | | | char In file included from main.c:3: /usr/include/string.h:156:32: note: expected 'const char *' but argument is of type 'char' 156 | extern int strcmp (const char *__s1, const char *__s2) | ~~~~~~~~~~~~^~~~ main.c:22:31: error: passing argument 2 of 'strcmp' makes pointer from integer without a cast [-Wint-conversion] 22 | if(strcmp(text[j-1], text[j]) > 0) | ~~~~^~~ | | | char /usr/include/string.h:156:50: note: expected 'const char *' but argument is of type 'char' 156 | extern int strcmp (const char *__s1, const char *__s2) | ~~~~~~~~~~~~^~~~ main.c:24:24: error: passing argument 2 of 'strcpy' makes pointer from integer without a cast [-Wint-conversion] 24 | strcpy(tem, text[j-1]); | ~~~~^~~~~ | | | char /usr/include/string.h:141:70: note: expected 'const char * restrict' but argument is of type 'char' 141 | extern char *strcpy (char *__restrict __dest, const char *__restrict __src) | ~~~~~~~~~~~~~~~~~~~~~~~^~~~~ main.c:25:19: error: passing argument 1 of 'strcpy' makes pointer from integer without a cast [-Wint-conversion] 25 | strcpy(text[j-1], text[j]); | ~~~~^~~~~ | | | char /usr/include/string.h:141:39: note: expected 'char * restrict' but argument is of type 'char' 141 | extern char *strcpy (char *__restrict __dest, const char *__restrict __src) | ~~~~~~~~~~~~~~~~~^~~~~~ main.c:25:30: error: passing argument 2 of 'strcpy' makes pointer from integer without a cast [-Wint-conversion] 25 | strcpy(text[j-1], text[j]); | ~~~~^~~ | | | char /usr/include/string.h:141:70: note: expected 'const char * restrict' but argument is of type 'char' 141 | extern char *strcpy (char *__restrict __dest, const char *__restrict __src) | ~~~~~~~~~~~~~~~~~~~~~~~^~~~~ main.c:26:19: error: passing argument 1 of 'strcpy' makes pointer from integer without a cast [-Wint-conversion] 26 | strcpy(text[j], tem); | ~~~~^~~ | | | char /usr/include/string.h:141:39: note: expected 'char * restrict' but argument is of type 'char' 141 | extern char *strcpy (char *__restrict __dest, const char *__restrict __src) | ~~~~~~~~~~~~~~~~~^~~~~~ main.c:32:36: error: passing argument 2 of 'memcpy' makes pointer from integer without a cast [-Wint-conversion] 32 | memcpy(senten + i * L, text[i], L); | ~~~~^~~ | | | char /usr/include/string.h:43:70: note: expected 'const void * restrict' but argument is of type 'char' 43 | extern void *memcpy (void *__restrict __dest, const void *__restrict __src, | ~~~~~~~~~~~~~~~~~~~~~~~^~~~~ main.c:35:3: error: implicit declaration of function 'print'; did you mean 'printf'? [-Wimplicit-function-declaration] 35 | print("%S",senten ); | ^~~~~ | printf
s075933177
p04044
C
#include<stdio.h> #include<stdlib.h> #include<string.h> #define N 100 #define L 100 int main() { char text[N],senten[N*L],tem[L]; int i,j; for(i=0; i<N; i++) { scanf(%s,text[i]); } for(i=1; i<L; i++) { for(j=1; j<N; j++) { if(strcmp(text[j-1], text[j]) > 0) { strcpy(tem, text[j-1]); strcpy(text[j-1], text[j]); strcpy(text[j], tem); } } } for(i=0; i<N; i++) { memcpy(senten, text[i], L); } return 0; }
main.c: In function 'main': main.c:15:10: error: expected expression before '%' token 15 | scanf(%s,text[i]); | ^ main.c:22:20: error: passing argument 1 of 'strcmp' makes pointer from integer without a cast [-Wint-conversion] 22 | if(strcmp(text[j-1], text[j]) > 0) | ~~~~^~~~~ | | | char In file included from main.c:3: /usr/include/string.h:156:32: note: expected 'const char *' but argument is of type 'char' 156 | extern int strcmp (const char *__s1, const char *__s2) | ~~~~~~~~~~~~^~~~ main.c:22:31: error: passing argument 2 of 'strcmp' makes pointer from integer without a cast [-Wint-conversion] 22 | if(strcmp(text[j-1], text[j]) > 0) | ~~~~^~~ | | | char /usr/include/string.h:156:50: note: expected 'const char *' but argument is of type 'char' 156 | extern int strcmp (const char *__s1, const char *__s2) | ~~~~~~~~~~~~^~~~ main.c:24:24: error: passing argument 2 of 'strcpy' makes pointer from integer without a cast [-Wint-conversion] 24 | strcpy(tem, text[j-1]); | ~~~~^~~~~ | | | char /usr/include/string.h:141:70: note: expected 'const char * restrict' but argument is of type 'char' 141 | extern char *strcpy (char *__restrict __dest, const char *__restrict __src) | ~~~~~~~~~~~~~~~~~~~~~~~^~~~~ main.c:25:19: error: passing argument 1 of 'strcpy' makes pointer from integer without a cast [-Wint-conversion] 25 | strcpy(text[j-1], text[j]); | ~~~~^~~~~ | | | char /usr/include/string.h:141:39: note: expected 'char * restrict' but argument is of type 'char' 141 | extern char *strcpy (char *__restrict __dest, const char *__restrict __src) | ~~~~~~~~~~~~~~~~~^~~~~~ main.c:25:30: error: passing argument 2 of 'strcpy' makes pointer from integer without a cast [-Wint-conversion] 25 | strcpy(text[j-1], text[j]); | ~~~~^~~ | | | char /usr/include/string.h:141:70: note: expected 'const char * restrict' but argument is of type 'char' 141 | extern char *strcpy (char *__restrict __dest, const char *__restrict __src) | ~~~~~~~~~~~~~~~~~~~~~~~^~~~~ main.c:26:19: error: passing argument 1 of 'strcpy' makes pointer from integer without a cast [-Wint-conversion] 26 | strcpy(text[j], tem); | ~~~~^~~ | | | char /usr/include/string.h:141:39: note: expected 'char * restrict' but argument is of type 'char' 141 | extern char *strcpy (char *__restrict __dest, const char *__restrict __src) | ~~~~~~~~~~~~~~~~~^~~~~~ main.c:32:28: error: passing argument 2 of 'memcpy' makes pointer from integer without a cast [-Wint-conversion] 32 | memcpy(senten, text[i], L); | ~~~~^~~ | | | char /usr/include/string.h:43:70: note: expected 'const void * restrict' but argument is of type 'char' 43 | extern void *memcpy (void *__restrict __dest, const void *__restrict __src, | ~~~~~~~~~~~~~~~~~~~~~~~^~~~~
s689028228
p04044
C++
#include<bits/stdc++.h> using namespace std; int main() { vector <string> s(n); int n; cin>>n; int l; cin>>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]; }
a.cc: In function 'int main()': a.cc:5:21: error: 'n' was not declared in this scope 5 | vector <string> s(n); | ^
s142627522
p04044
C++
#include<bits/stdc++.h> using namespace std; int main() { vector <string> s(n); int n; cin>>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:5:21: error: 'n' was not declared in this scope 5 | vector <string> s(n); | ^
s148162402
p04044
Java
import java.util.ArrayList; import java.util.Arrays; import java.util.Collections; import java.util.Scanner; /* * To change this license header, choose License Headers in Project Properties. * To change this template file, choose Tools | Templates * and open the template in the editor. */ /** * * @author mix */ public class Problems { public static void main(String[] args) { // TODO code application logic here Scanner s1 = new Scanner(System.in); int N = s1.nextInt(); int L = s1.nextInt(); String[] stringArray=new String[N]; for(int i=0;i<N;i++){ stringArray[i]=s1.next(); } Arrays.sort(stringArray); for(String s : stringArray) System.out.print(s); } }
Main.java:18: error: class Problems is public, should be declared in a file named Problems.java public class Problems { ^ 1 error
s372907255
p04044
C++
#include<iostream> #include<cstdio> #include<cstring> using namespace std; int main(){ int N, L; char ch1[100][100], tmp[100]; scanf("%d %d",&N, &L); for(int i = 0; i < N; i++){ scanf("%s",ch1[i]); } for(int i = 1; i < N; i++){ tmp = ch[i]; int j = i - 1; while( j >= 0 && ch[j] > tmp){ ch[j+1] = ch[j]; j--; } ch[j+1] = tmp; } char tmp[10000] for(int i = 0; i < N; i++){ tmp += ch1[i]; } }
a.cc: In function 'int main()': a.cc:13:11: error: 'ch' was not declared in this scope; did you mean 'ch1'? 13 | tmp = ch[i]; | ^~ | ch1 a.cc:22:3: error: expected initializer before 'for' 22 | for(int i = 0; i < N; i++){ | ^~~ a.cc:22:18: error: 'i' was not declared in this scope 22 | for(int i = 0; i < N; i++){ | ^
s328250530
p04044
Java
import java.util.Arrays; import java.util.Scanner; public class IronaLovesStrings { public static void main(String args[]) { Scanner in = new Scanner(System.in); int n = in.nextInt(); int l = in.nextInt(); String[] strs = new String[n]; for (int i = 0; i < n; i++) strs[i] = in.next(); Arrays.sort(strs); String ans = ""; for (int i = 0; i < n; i++) { ans += strs[i]; } System.out.println(ans); } }
Main.java:4: error: class IronaLovesStrings is public, should be declared in a file named IronaLovesStrings.java public class IronaLovesStrings { ^ 1 error
s285789368
p04044
Java
import java.util.Arrays; import java.util.Scanner; public class IronaLovesStrings { public static void main(String args[]) { Scanner in = new Scanner(System.in); int n = in.nextInt(); int l = in.nextInt(); String[] strs = new String[n]; for (int i = 0; i < n; i++) strs[i] = in.next(); Arrays.sort(strs); String ans = ""; for (int i = 0; i < n; i++) { ans += strs[i]; } System.out.println(ans); } }
Main.java:4: error: class IronaLovesStrings is public, should be declared in a file named IronaLovesStrings.java public class IronaLovesStrings { ^ 1 error
s846731661
p04044
Java
import java.util.Arrays; import java.util.Scanner; public class IronaLovesStrings { public static void main(String args[]) { Scanner in = new Scanner(System.in); int n = in.nextInt(); int l = in.nextInt(); String[] strs = new String[n]; for (int i = 0; i < n; i++) strs[i] = in.next(); Arrays.sort(strs); String ans = ""; for (int i = 0; i < n; i++) { ans += strs[i]; } System.out.println(ans); } }
Main.java:4: error: class IronaLovesStrings is public, should be declared in a file named IronaLovesStrings.java public class IronaLovesStrings { ^ 1 error
s811771314
p04044
Java
import java.util.Arrays; import java.util.Scanner; public class IronaLovesStrings { public static void main(String args[]) { Scanner in = new Scanner(System.in); int n = in.nextInt(); int l = in.nextInt(); String[] strs = new String[n]; for (int i = 0; i < n; i++) strs[i] = in.next(); Arrays.sort(strs); String ans = ""; for (int i = 0; i < n; i++) { ans += strs[i]; } System.out.println(ans); } }
Main.java:4: error: class IronaLovesStrings is public, should be declared in a file named IronaLovesStrings.java public class IronaLovesStrings { ^ 1 error
s746525756
p04044
C++
N, L = map(int,input().split()) S = [input() for i in range(N)] S.sort() r = "" for x in range(N): r += S[x] print(r)
a.cc:1:1: error: 'N' does not name a type 1 | N, L = map(int,input().split()) | ^
s342341171
p04044
C++
n,l=map(int,input().split()) s=sorted([input() for _ in range(n)]) print(''.join(s))
a.cc:3:7: error: empty character constant 3 | print(''.join(s)) | ^~ a.cc:1:1: error: 'n' does not name a type 1 | n,l=map(int,input().split()) | ^
s798266845
p04044
C
#include<stdio.h> #include<string.h> int main(){ int n,l; scanf("%d",&n); scanf("%d",&l); char str[n][l]; char tmp[l]; for(int i=0;i<n;i++){ scanf("%s",&str[i][l]); } for(int j=1;j<n;j++){ for(int k=1;k<n;j++){ if(strcmp(str[k-1],str[k])>0){ strcpy(tmp,str[k-1]); strcpy(str[k-1],str[k]); strcpy(str[k],tmp); } } } for(int m=0;m<n;m++){ printf("%s",s[m]); } return 0; }
main.c: In function 'main': main.c:23:17: error: 's' undeclared (first use in this function) 23 | printf("%s",s[m]); | ^ main.c:23:17: note: each undeclared identifier is reported only once for each function it appears in
s188055992
p04044
C
#include<stdio.h> #include<string.h> int main(){ int n,l; scanf("%d",&n); scanf("%d".&l); char str[n][l]; char tmp[l]; for(int i=0;i<n;i++){ scanf("%d",&str[i][l]); } for(int j=1;j<n;j++){ for(int k=1;k<n;j++){ if(strcmp(str[k-1],str[k])>0){ strcpy(tmp,str[k-1]); strcpy(str[k-1],str[k]); strcpy(str[k],tmp); } } } for(int m=0;m<n;m++){ printf("%s",s[m]); } return 0; }
main.c: In function 'main': main.c:7:14: error: expected identifier before '&' token 7 | scanf("%d".&l); | ^ main.c:23:17: error: 's' undeclared (first use in this function) 23 | printf("%s",s[m]); | ^ main.c:23:17: note: each undeclared identifier is reported only once for each function it appears in
s237392064
p04044
C++
#include<iostream> #include<algorithm> int main(){ int n,l; cin>>n>>l; string a[l]; for(int i=0;i<l;i++){ cin>>a[i]; } sort(a,a+l); for(int i=0;i<n;i++){ cout<<a[i]; } }
a.cc: In function 'int main()': a.cc:6:3: error: 'cin' was not declared in this scope; did you mean 'std::cin'? 6 | cin>>n>>l; | ^~~ | 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:7:3: error: 'string' was not declared in this scope 7 | string a[l]; | ^~~~~~ a.cc:7:3: note: suggested alternatives: In file included from /usr/include/c++/14/iosfwd:41, from /usr/include/c++/14/ios:40, from /usr/include/c++/14/ostream:40, from /usr/include/c++/14/iostream:41: /usr/include/c++/14/bits/stringfwd.h:77:33: note: 'std::string' 77 | typedef basic_string<char> string; | ^~~~~~ In file included from /usr/include/c++/14/bits/locale_classes.h:40, from /usr/include/c++/14/bits/ios_base.h:41, from /usr/include/c++/14/ios:44: /usr/include/c++/14/string:76:11: note: 'std::pmr::string' 76 | using string = basic_string<char>; | ^~~~~~ a.cc:10:10: error: 'a' was not declared in this scope 10 | cin>>a[i]; | ^ a.cc:13:8: error: 'a' was not declared in this scope 13 | sort(a,a+l); | ^ a.cc:13:3: error: 'sort' was not declared in this scope; did you mean 'std::sort'? 13 | sort(a,a+l); | ^~~~ | std::sort In file included from /usr/include/c++/14/algorithm:86, from a.cc:2: /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:16:6: error: 'cout' was not declared in this scope; did you mean 'std::cout'? 16 | cout<<a[i]; | ^~~~ | std::cout /usr/include/c++/14/iostream:63:18: note: 'std::cout' declared here 63 | extern ostream cout; ///< Linked to standard output | ^~~~
s866536674
p04044
C++
#include <iostream> #include<algorithm> #include<functional> #include<string> using namespace std; int main(void) { int N,L; string S; for(int i=0;i<N;i++){ cin>>S[i]; } sort(S,S+N,greater<string>()); cout<<S<<endl; }
a.cc: In function 'int main()': a.cc:12:11: error: no match for 'operator+' (operand types are 'std::string' {aka 'std::__cxx11::basic_string<char>'} and 'int') 12 | sort(S,S+N,greater<string>()); | ~^~ | | | | | 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:12:12: note: mismatched types 'const std::reverse_iterator<_Iterator>' and 'int' 12 | sort(S,S+N,greater<string>()); | ^ /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:12:12: note: mismatched types 'const std::move_iterator<_IteratorL>' and 'int' 12 | sort(S,S+N,greater<string>()); | ^ 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:12:12: note: mismatched types 'const std::__cxx11::basic_string<_CharT, _Traits, _Allocator>' and 'int' 12 | sort(S,S+N,greater<string>()); | ^ /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:12:12: note: mismatched types 'const _CharT*' and 'std::__cxx11::basic_string<char>' 12 | sort(S,S+N,greater<string>()); | ^ /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:12:12: note: mismatched types 'const std::__cxx11::basic_string<_CharT, _Traits, _Allocator>' and 'int' 12 | sort(S,S+N,greater<string>()); | ^ /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:12:12: note: mismatched types 'const _CharT*' and 'int' 12 | sort(S,S+N,greater<string>()); | ^ /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:12:12: note: deduced conflicting types for parameter '_CharT' ('char' and 'int') 12 | sort(S,S+N,greater<string>()); | ^ /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:12:12: note: mismatched types 'const std::__cxx11::basic_string<_CharT, _Traits, _Allocator>' and 'int' 12 | sort(S,S+N,greater<string>()); | ^ /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:12:12: note: mismatched types 'std::__cxx11::basic_string<_CharT, _Traits, _Allocator>' and 'int' 12 | sort(S,S+N,greater<string>()); | ^ /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:12:12: note: mismatched types 'std::__cxx11::basic_string<_CharT, _Traits, _Allocator>' and 'int' 12 | sort(S,S+N,greater<string>()); | ^ /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:12:12: note: mismatched types 'const _CharT*' and 'std::__cxx11::basic_string<char>' 12 | sort(S,S+N,greater<string>()); | ^ /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:12:12: note: mismatched types 'std::__cxx11::basic_string<_CharT, _Traits, _Allocator>' and 'int' 12 | sort(S,S+N,greater<string>()); | ^ /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:12:12: note: mismatched types 'const _CharT*' and 'int' 12 | sort(S,S+N,greater<string>()); | ^ /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:12:12: note: deduced conflicting types for parameter '_CharT' ('char' and 'int') 12 | sort(S,S+N,greater<string>()); | ^
s065763213
p04044
C++
#include <bits/stdc++.h> using namespace std; typedef long long ll; #define rep(i, n) for ( ll i = 0; i < (ll)(n); i++ ) int main( void ) { int n,l; cin >> n >> l; string s[n]; rep(i, n) cin >> s[i]; sort(s.begin(), s.end()); rep(i, n) cout << s[i]; cout << endl; }
a.cc: In function 'int main()': a.cc:14:12: error: request for member 'begin' in 's', which is of non-class type 'std::string [n]' {aka 'std::__cxx11::basic_string<char> [n]'} 14 | sort(s.begin(), s.end()); | ^~~~~ a.cc:14:23: error: request for member 'end' in 's', which is of non-class type 'std::string [n]' {aka 'std::__cxx11::basic_string<char> [n]'} 14 | sort(s.begin(), s.end()); | ^~~
s375546948
p04044
C++
#include <bits/stdc++.h> using namespace std; typedef long long ll; #define rep(i, n) for ( ll i = 0; i < (ll)(n); i++ ) int main( void ) { int n.l; cin >> n >> l; string s[n]; rep(i, n) cin >> s[i]; sort(s.begin(), s.end()); rep(i, n) cout << s[i]; cout << endl; }
a.cc: In function 'int main()': a.cc:8:10: error: expected initializer before '.' token 8 | int n.l; | ^ a.cc:9:12: error: 'n' was not declared in this scope; did you mean 'yn'? 9 | cin >> n >> l; | ^ | yn a.cc:9:17: error: 'l' was not declared in this scope; did you mean 'll'? 9 | cin >> n >> l; | ^ | ll a.cc:12:16: error: 's' was not declared in this scope 12 | cin >> s[i]; | ^ a.cc:14:10: error: 's' was not declared in this scope 14 | sort(s.begin(), s.end()); | ^
s478280101
p04044
C++
#include<bits/stdc++.h> using namespace std; #define f(i,a,b) for(int(i)=int (a);i<=int (b);i++) #define ff(i,a,b) for(int(i)=int (a);i<int (b);i++) #define F(i,a,b) for(int(i)=int (a);i>=int (b);i--) #define foreach(i,x) for(typeof((c).begin()) i=(c).begin();i!=(c).end();i++) #define pb push_back #define eb emplace_back #define fi first #define se second #define vt vector #define ll long long #define lower(p,x) lower_bound(all(p),x) #define upper(p,x) upper_bound(all(p),x) #define ms(a,x) memset(a,x,sizeof a) #define minn(a,b,c,d) min(a,min(b,min(c,d))) typedef pair<int,int> ii; typedef pair<int,ii> iii; const double pi=acos(-1.0);//NOTE:PI const double eps=1e-5; const int INF=1e9,mod=1e9+7,N=1e6+6; int n;int a[N];int b[N]; int main(){ //freopen("BIPERM.inp","r",stdin); //freopen("BIPERM.out","w",stdout); int n,l; cin>>n>>l; vt<string> a(n); ff(i,0,n) cin>>a[i];sort(all(a)); ff(i,1,n) a[0]+=a[i];cout<<a[0]; }
a.cc: In function 'int main()': a.cc:29:34: error: 'all' was not declared in this scope; did you mean 'std::filesystem::perms::all'? 29 | ff(i,0,n) cin>>a[i];sort(all(a)); | ^~~ | std::filesystem::perms::all In file included from /usr/include/c++/14/filesystem:51, from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:200, from a.cc:1: /usr/include/c++/14/bits/fs_fwd.h:158:7: note: 'std::filesystem::perms::all' declared here 158 | all = 0777, | ^~~
s399773543
p04044
C++
#include <bits/stdc++.h> using namespace std; signed main() { int n, l; cin >> n >> l; vector <string> vec(n); for (string &s: vec) cin >> s; sort(vec.begin, vec.end); for (string s: vec) cout << s << '\n'; }
a.cc: In function 'int main()': a.cc:10:7: error: no matching function for call to 'sort(<unresolved overloaded function type>, <unresolved overloaded function type>)' 10 | sort(vec.begin, vec.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:10:7: note: couldn't deduce template parameter '_RAIter' 10 | sort(vec.begin, vec.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
s692162046
p04044
C++
import java.util.ArrayDeque; import java.util.ArrayList; import java.util.Collections; import java.util.HashMap; import java.util.Map; import java.util.Queue; import java.util.Scanner; public class Main { static int a1[]= {0,-1,0,1}; static int b1[]= {-1,0,1,0}; private static Scanner sc = new Scanner(System.in); //result = Math.pow(num1, num3) //StringBuffer str = new StringBuffer(hoge1); //String hoge2 = str.reverse().toString(); //map.containsKey(A) //Map<String, Integer> map = new HashMap<String, Integer>(n); /*for ( キーのデータ型 key : マップの名前.keySet() ) { データのデータ型 data = マップの名前.get( key ); // keyやdataを使った処理; }*/ //int i = Integer.parseInt(s); //Queue<String> qq=new ArrayDeque<>(); //add,poll,peek //Deque<String> qq=new ArrayDeque<>();//push,pop,peek //ArrayList<String> cc = new ArrayList<>(n); //Collections.sort(list); //Array.sort(list); cc.contains(tmp) //Arrays.asList(c).contains("a") //list.set(1,"walk");//1 1 2 3 5 static int K,N; static long mod =1000000007; public static void main(String[] args) { int N=sc.nextInt(); int L=sc.nextInt(); ArrayList<String> cc =new ArrayList<>(N); for(int i=0;i<N;i++) { cc.add(sc.next()); } Collections.sort(cc); String ans=""; for(String i:cc) { ans=ans+i; } p(ans); } //N==S //E==W //83 S //69E //78N //87W //static ArrayList<Integer> cc = new ArrayList<>(10001); static void p(String ans) {System.out.println(ans);}; static void p(int ans) {System.out.println(ans);}; static void p() {System.out.println();}; static void p(long ans) {System.out.println(ans);}; static void p(double ans) {System.out.println(ans);}; public static int gcd(int a, int b) { return b == 0 ? a: gcd(b, a % b); } static String nextPermutation(String s) { ArrayList<Character> list=new ArrayList<>(); for(int i=0;i<s.length();i++) { list.add(s.charAt(i)); } int pivotPos=-1; char pivot=0; for(int i=list.size()-2;i>=0;i--) { if(list.get(i)<list.get(i+1)) { pivotPos=i; pivot=list.get(i); break; } } if(pivotPos==-1&&pivot==0) { return "Final"; } int L=pivotPos+1,R=list.size()-1; int minPos=-1; char min =Character.MAX_VALUE; for(int i=R;i>=L;i--) { if(pivot<list.get(i)) { if(list.get(i)<min) { min=list.get(i); minPos=i; } } } Collections.swap(list, pivotPos, minPos); Collections.sort(list.subList(L, R+1)); StringBuilder sb=new StringBuilder(); for(int i=0;i<list.size();i++) { sb.append(list.get(i)); } return sb.toString(); } }
a.cc:1:1: error: 'import' does not name a type 1 | import java.util.ArrayDeque; | ^~~~~~ a.cc:1:1: note: C++20 'import' only available with '-fmodules-ts' a.cc:2:1: error: 'import' does not name a type 2 | import java.util.ArrayList; | ^~~~~~ a.cc:2:1: note: C++20 'import' only available with '-fmodules-ts' a.cc:3:1: error: 'import' does not name a type 3 | import java.util.Collections; | ^~~~~~ a.cc:3:1: note: C++20 'import' only available with '-fmodules-ts' a.cc:4:1: error: 'import' does not name a type 4 | import java.util.HashMap; | ^~~~~~ a.cc:4:1: note: C++20 'import' only available with '-fmodules-ts' a.cc:5:1: error: 'import' does not name a type 5 | import java.util.Map; | ^~~~~~ a.cc:5:1: note: C++20 'import' only available with '-fmodules-ts' a.cc:6:1: error: 'import' does not name a type 6 | import java.util.Queue; | ^~~~~~ a.cc:6:1: note: C++20 'import' only available with '-fmodules-ts' a.cc:7:1: error: 'import' does not name a type 7 | import java.util.Scanner; | ^~~~~~ a.cc:7:1: note: C++20 'import' only available with '-fmodules-ts' a.cc:11:1: error: expected unqualified-id before 'public' 11 | public class Main { | ^~~~~~
s520916948
p04044
C++
#include <string> #include <vector> #include <iostream> using namespace std; int main(){ int n,l; cin >> n >> l; vector<string> S; for(int i=0;i<n;i++){ string s; cin >> s; S.push_back(s); } sort(S.begin(),S.end()); string ans; for(auto a:S) ans+=a; cout << ans << endl; }
a.cc: In function 'int main()': a.cc:11:3: error: 'sort' was not declared in this scope; did you mean 'short'? 11 | sort(S.begin(),S.end()); | ^~~~ | short
s190232279
p04044
C++
#include<bits/stdc++.h> using namespace std; #define rep(i,n) for(int i = 0; i < (int)(n); i++) int main(){ 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]; } cout << endl; }
a.cc: In function 'int main()': a.cc:11:25: error: no matching function for call to 'end()' 11 | sort(S.begin(),S,end()); | ~~~^~ In file included from /usr/include/c++/14/bits/algorithmfwd.h:39, from /usr/include/c++/14/bits/stl_algo.h:59, 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/initializer_list:99:5: note: candidate: 'template<class _Tp> constexpr const _Tp* std::end(initializer_list<_Tp>)' 99 | end(initializer_list<_Tp> __ils) noexcept | ^~~ /usr/include/c++/14/initializer_list:99:5: note: candidate expects 1 argument, 0 provided In file included from /usr/include/c++/14/string:53, 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/range_access.h:74:5: note: candidate: 'template<class _Container> constexpr decltype (__cont.end()) std::end(_Container&)' 74 | end(_Container& __cont) -> decltype(__cont.end()) | ^~~ /usr/include/c++/14/bits/range_access.h:74:5: note: candidate expects 1 argument, 0 provided /usr/include/c++/14/bits/range_access.h:85:5: note: candidate: 'template<class _Container> constexpr decltype (__cont.end()) std::end(const _Container&)' 85 | end(const _Container& __cont) -> decltype(__cont.end()) | ^~~ /usr/include/c++/14/bits/range_access.h:85:5: note: candidate expects 1 argument, 0 provided /usr/include/c++/14/bits/range_access.h:106:5: note: candidate: 'template<class _Tp, long unsigned int _Nm> constexpr _Tp* std::end(_Tp (&)[_Nm])' 106 | end(_Tp (&__arr)[_Nm]) noexcept | ^~~ /usr/include/c++/14/bits/range_access.h:106:5: note: candidate expects 1 argument, 0 provided In file included from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:166: /usr/include/c++/14/valarray:1249:5: note: candidate: 'template<class _Tp> _Tp* std::end(valarray<_Tp>&)' 1249 | end(valarray<_Tp>& __va) noexcept | ^~~ /usr/include/c++/14/valarray:1249:5: note: candidate expects 1 argument, 0 provided /usr/include/c++/14/valarray:1265:5: note: candidate: 'template<class _Tp> const _Tp* std::end(const valarray<_Tp>&)' 1265 | end(const valarray<_Tp>& __va) noexcept | ^~~ /usr/include/c++/14/valarray:1265:5: note: candidate expects 1 argument, 0 provided
s317397454
p04044
C++
#include <iostream> #include <string> #include <vector> using namespace std; int main() { int N, L; string s; cin >> N >> L; vector<string> mtrx(N); for(int j = 0;j < N; ++j) { cin >> s; mtrx[j] = s; } sort(mtrx.begin(), mtrx.end()); for(int i = 0;i < N; ++i) { cout << mtrx[i]; } }
a.cc: In function 'int main()': a.cc:19:5: error: 'sort' was not declared in this scope; did you mean 'short'? 19 | sort(mtrx.begin(), mtrx.end()); | ^~~~ | short
s449634180
p04044
C
#include<stdio.h> #include<string.h> int main(){ int N,L=0; scanf("%d %d",&N,&L); char S[N][L+1],tmp[L+1]; for(int i=0; i<N; i++){ scanf("%s",&S[i]); } for(int k=0; k<N; k++){ for(int j=0; j<N; j++){ if(strcmp(S[j],S[j+1]>0)){ strcpy(tmp,S[j+1]); strcpy(S[j+1],S[j]); strcpy(S[j],tmp); } } } for(int y=0; y<N; y++){ printf("%s",%S[y]); } return 0; }
main.c: In function 'main': main.c:16:28: error: passing argument 2 of 'strcmp' makes pointer from integer without a cast [-Wint-conversion] 16 | if(strcmp(S[j],S[j+1]>0)){ | ~~~~~~^~ | | | int In file included from main.c:2: /usr/include/string.h:156:50: note: expected 'const char *' but argument is of type 'int' 156 | extern int strcmp (const char *__s1, const char *__s2) | ~~~~~~~~~~~~^~~~ main.c:25:17: error: expected expression before '%' token 25 | printf("%s",%S[y]); | ^
s900828927
p04044
C++
#include <bits/stdc++.h> using namespace std; int main() { int N, L; cin >> N >> L; string a[N]; for (int i = 0; i < N; i++) cin >> a[i]; sort(a.begin(), a.end()); for (int i = 0; i < N; i++) { cout << a[i]; } cout << endl; }
a.cc: In function 'int main()': a.cc:14:10: error: request for member 'begin' in 'a', which is of non-class type 'std::string [N]' {aka 'std::__cxx11::basic_string<char> [N]'} 14 | sort(a.begin(), a.end()); | ^~~~~ a.cc:14:21: error: request for member 'end' in 'a', which is of non-class type 'std::string [N]' {aka 'std::__cxx11::basic_string<char> [N]'} 14 | sort(a.begin(), a.end()); | ^~~
s824555059
p04044
C++
#include <bits/stdc++.h> using namespace std; #define rep(i, n) for (int i = 0; i < (int)(n); i++) typedef long long ll; int main() { int N, L; cin >> N >> L; vector<string> S(N); rep (int i, N) cin >> S.at(i); sort(S.begin(), S.end()); rep (int i, N-1) cout << S.at(i); cout << S.at(N-1) << endl; }
a.cc: In function 'int main()': a.cc:3:24: error: two or more data types in declaration of 'i' 3 | #define rep(i, n) for (int i = 0; i < (int)(n); i++) | ^~~ a.cc:9:3: note: in expansion of macro 'rep' 9 | rep (int i, N) cin >> S.at(i); | ^~~ a.cc:3:37: error: expected initializer before '<' token 3 | #define rep(i, n) for (int i = 0; i < (int)(n); i++) | ^ a.cc:9:3: note: in expansion of macro 'rep' 9 | rep (int i, N) cin >> S.at(i); | ^~~ a.cc:3:37: error: expected ';' before '<' token 3 | #define rep(i, n) for (int i = 0; i < (int)(n); i++) | ^ a.cc:9:3: note: in expansion of macro 'rep' 9 | rep (int i, N) cin >> S.at(i); | ^~~ a.cc:3:37: error: expected primary-expression before '<' token 3 | #define rep(i, n) for (int i = 0; i < (int)(n); i++) | ^ a.cc:9:3: note: in expansion of macro 'rep' 9 | rep (int i, N) cin >> S.at(i); | ^~~ a.cc:3:47: error: expected ')' before ';' token 3 | #define rep(i, n) for (int i = 0; i < (int)(n); i++) | ~ ^ a.cc:9:3: note: in expansion of macro 'rep' 9 | rep (int i, N) cin >> S.at(i); | ^~~ a.cc:3:50: error: expected initializer before '++' token 3 | #define rep(i, n) for (int i = 0; i < (int)(n); i++) | ^~ a.cc:9:3: note: in expansion of macro 'rep' 9 | rep (int i, N) cin >> S.at(i); | ^~~ a.cc:3:24: error: two or more data types in declaration of 'i' 3 | #define rep(i, n) for (int i = 0; i < (int)(n); i++) | ^~~ a.cc:11:3: note: in expansion of macro 'rep' 11 | rep (int i, N-1) cout << S.at(i); | ^~~ a.cc:3:37: error: expected initializer before '<' token 3 | #define rep(i, n) for (int i = 0; i < (int)(n); i++) | ^ a.cc:11:3: note: in expansion of macro 'rep' 11 | rep (int i, N-1) cout << S.at(i); | ^~~ a.cc:3:37: error: expected ';' before '<' token 3 | #define rep(i, n) for (int i = 0; i < (int)(n); i++) | ^ a.cc:11:3: note: in expansion of macro 'rep' 11 | rep (int i, N-1) cout << S.at(i); | ^~~ a.cc:3:37: error: expected primary-expression before '<' token 3 | #define rep(i, n) for (int i = 0; i < (int)(n); i++) | ^ a.cc:11:3: note: in expansion of macro 'rep' 11 | rep (int i, N-1) cout << S.at(i); | ^~~ a.cc:3:47: error: expected ')' before ';' token 3 | #define rep(i, n) for (int i = 0; i < (int)(n); i++) | ~ ^ a.cc:11:3: note: in expansion of macro 'rep' 11 | rep (int i, N-1) cout << S.at(i); | ^~~ a.cc:3:50: error: expected initializer before '++' token 3 | #define rep(i, n) for (int i = 0; i < (int)(n); i++) | ^~ a.cc:11:3: note: in expansion of macro 'rep' 11 | rep (int i, N-1) cout << S.at(i); | ^~~
s992862589
p04044
C++
#include<iostream> #include<string> #include<vector> #include<algorithm> using namespace std; int main() { int n ,l; cin >> n >> l; vector <string> v; for(int i = 0; i < n; i++) { string s; cin >> s; v.push_back(s); } sort(v.begin(), v.end()); for(inti = 0; i < n; i++) { cout << v[i]; } return 0; }
a.cc: In function 'int main()': a.cc:21:7: error: 'inti' was not declared in this scope; did you mean 'int'? 21 | for(inti = 0; i < n; i++) | ^~~~ | int a.cc:21:17: error: 'i' was not declared in this scope 21 | for(inti = 0; i < n; i++) | ^
s197653197
p04044
C++
#include<iostream> #include<string> #include<vector> #include<algoritm> using namespace std; int main() { int n ,l; cin >> n >> l; vector <string> v; for(int i = 0; i < n; i++) { string s; cin >> s; v.push_back(s); } sort(v.begin(), v.end()); for(inti = 0; i < n; i++) { cout << v[i]; } return 0; }
a.cc:4:9: fatal error: algoritm: No such file or directory 4 | #include<algoritm> | ^~~~~~~~~~ compilation terminated.
s324798320
p04044
C++
#include <iostream> #include <vector> using namespace std; int main() { int n, l; cin >> n >> l; vector<string> v; while (n--) { string s; cin >> s; v.push_back(s); } string result = ""; sort(v.begin(), v.end()); for (auto s : v) { result += s; } cout << result; return 0; }
a.cc: In function 'int main()': a.cc:17:5: error: 'sort' was not declared in this scope; did you mean 'short'? 17 | sort(v.begin(), v.end()); | ^~~~ | short
s149942320
p04044
C++
#include <bits/stdc++.h> #include<vector> using namespace std; #define rep(i, n) for(int i=0; i<(int)(n); ++i) int main() { int a; vector<string>b(a); rep(i,a){ cin>>b[i]; } sort(b.begin(), b.end()); rep(i,a){ cout<<b[i]; } }
a.cc: In function 'int main()': a.cc:11:27: error: expected ';' before '\U0000ff1b' 11 | sort(b.begin(), b.end()); | ^~ | ; a.cc:12:9: error: 'i' was not declared in this scope 12 | rep(i,a){ | ^ a.cc:4:39: note: in definition of macro 'rep' 4 | #define rep(i, n) for(int i=0; i<(int)(n); ++i) | ^
s628507111
p04044
C++
#include <iostream> #include <string> #include <vector> #define rep(i,n) for(int (i)=0;(i)<(n);(i)++) int main(){ int n, l; // 入力 std::cin >> n >> l; std::vector<std::string> s(n); std::string ans; rep(i, n){ std::cin >> s[i]; if(s[i].size() != l) return 0; } rep(i, n){ //std::cout << s[i][0] << std::endl; sort(s.begin(), s.end()); } rep(i, n){ ans += s[i]; } std::cout << ans << std::endl; return 0; }
a.cc: In function 'int main()': a.cc:23:9: error: 'sort' was not declared in this scope; did you mean 'short'? 23 | sort(s.begin(), s.end()); | ^~~~ | short
s350330127
p04044
C++
#include <iostream> #include <iostream> #include <string> #include <vector> #define rep(i,n) for(int (i)=0;(i)<(n);(i)++) int main(){ int n, l; // 入力 std::cin >> n >> l; std::vector<std::string> s(n); std::string ans; rep(i, n){ std::cin >> s[i]; if(s[i].size() != l) return 0; } rep(i, n){ //std::cout << s[i][0] << std::endl; std::sort(s.begin(), s.end()); } rep(i, n){ ans += s[i]; } std::cout << ans << std::endl; return 0; }
a.cc: In function 'int main()': a.cc:24:14: error: 'sort' is not a member of 'std'; did you mean 'qsort'? 24 | std::sort(s.begin(), s.end()); | ^~~~ | qsort
s353267689
p04044
C++
\#include <iostream> //#include <bits/stdc++.h> #include <cstdlib> #include <cstdio> #include <cstring> #include <vector> #include <queue> #include <algorithm> #define loop(i,a,b) for(int i=a;i<b;i++) #define pb(x) push_back(x) #define F first #define S second using namespace std; int n; int l; const int N=100; string arr[N]; bool cmp(string a,string b){ int s=0; while(s<l){ if(b[s]-'0'<a[s]-'0') { return false; } s++; } return true; } int main(){ ios_base::sync_with_stdio(false); cin.tie(NULL); cin>>n>>l; string s; loop(i,0,n){ cin.ignore(); cin>>s; arr[i]=s; } sort(arr,arr+n,cmp); loop(i,0,n){ cout<<arr[i]; } cout<<endl; return 0; }
a.cc:1:1: error: stray '\' in program 1 | \#include <iostream> | ^ a.cc:1:2: error: stray '#' in program 1 | \#include <iostream> | ^ a.cc:1:3: error: 'include' does not name a type 1 | \#include <iostream> | ^~~~~~~ In file included from /usr/include/c++/14/bits/stl_algobase.h:62, from /usr/include/c++/14/vector:62, from a.cc:6: /usr/include/c++/14/ext/type_traits.h:164:35: error: 'constexpr const bool __gnu_cxx::__is_null_pointer' redeclared as different kind of entity 164 | __is_null_pointer(std::nullptr_t) | ^ /usr/include/c++/14/ext/type_traits.h:159:5: note: previous declaration 'template<class _Type> constexpr bool __gnu_cxx::__is_null_pointer(_Type)' 159 | __is_null_pointer(_Type) | ^~~~~~~~~~~~~~~~~ /usr/include/c++/14/ext/type_traits.h:164:26: error: 'nullptr_t' is not a member of 'std' 164 | __is_null_pointer(std::nullptr_t) | ^~~~~~~~~ In file included from /usr/include/c++/14/bits/stl_pair.h:60, from /usr/include/c++/14/bits/stl_algobase.h:64: /usr/include/c++/14/type_traits:666:33: error: 'nullptr_t' is not a member of 'std' 666 | struct is_null_pointer<std::nullptr_t> | ^~~~~~~~~ /usr/include/c++/14/type_traits:666:42: error: template argument 1 is invalid 666 | struct is_null_pointer<std::nullptr_t> | ^ /usr/include/c++/14/type_traits:670:48: error: template argument 1 is invalid 670 | struct is_null_pointer<const std::nullptr_t> | ^ /usr/include/c++/14/type_traits:674:51: error: template argument 1 is invalid 674 | struct is_null_pointer<volatile std::nullptr_t> | ^ /usr/include/c++/14/type_traits:678:57: error: template argument 1 is invalid 678 | struct is_null_pointer<const volatile std::nullptr_t> | ^ /usr/include/c++/14/type_traits:1429:37: error: 'size_t' is not a member of 'std'; did you mean 'size_t'? 1429 | : public integral_constant<std::size_t, alignof(_Tp)> | ^~~~~~ In file included from /usr/include/stdlib.h:32, from /usr/include/c++/14/cstdlib:79, from a.cc:3: /usr/lib/gcc/x86_64-linux-gnu/14/include/stddef.h:214:23: note: 'size_t' declared here 214 | typedef __SIZE_TYPE__ size_t; | ^~~~~~ /usr/include/c++/14/type_traits:1429:57: error: template argument 1 is invalid 1429 | : public integral_constant<std::size_t, alignof(_Tp)> | ^ /usr/include/c++/14/type_traits:1429:57: note: invalid template non-type parameter /usr/include/c++/14/type_traits:1438:37: error: 'size_t' is not a member of 'std'; did you mean 'size_t'? 1438 | : public integral_constant<std::size_t, 0> { }; | ^~~~~~ /usr/lib/gcc/x86_64-linux-gnu/14/include/stddef.h:214:23: note: 'size_t' declared here 214 | typedef __SIZE_TYPE__ size_t; | ^~~~~~ /usr/include/c++/14/type_traits:1438:46: error: template argument 1 is invalid 1438 | : public integral_constant<std::size_t, 0> { }; | ^ /usr/include/c++/14/type_traits:1438:46: note: invalid template non-type parameter /usr/include/c++/14/type_traits:1440:26: error: 'std::size_t' has not been declared 1440 | template<typename _Tp, std::size_t _Size> | ^~~ /usr/include/c++/14/type_traits:1441:21: error: '_Size' was not declared in this scope 1441 | struct rank<_Tp[_Size]> | ^~~~~ /usr/include/c++/14/type_traits:1441:27: error: template argument 1 is invalid 1441 | struct rank<_Tp[_Size]> | ^ /usr/include/c++/14/type_traits:1442:37: error: 'size_t' is not a member of 'std'; did you mean 'size_t'? 1442 | : public integral_constant<std::size_t, 1 + rank<_Tp>::value> { }; | ^~~~~~ /usr/lib/gcc/x86_64-linux-gnu/14/include/stddef.h:214:23: note: 'size_t' declared here 214 | typedef __SIZE_TYPE__ size_t; | ^~~~~~ /usr/include/c++/14/type_traits:1442:65: error: template argument 1 is invalid 1442 | : public integral_constant<std::size_t, 1 + rank<_Tp>::value> { }; | ^ /usr/include/c++/14/type_traits:1442:65: note: invalid template non-type parameter /usr/include/c++/14/type_traits:1446:37: error: 'size_t' is not a member of 'std'; did you mean 'size_t'? 1446 | : public integral_constant<std::size_t, 1 + rank<_Tp>::value> { }; | ^~~~~~ /usr/lib/gcc/x86_64-linux-gnu/14/include/stddef.h:214:23: note: 'size_t' declared here 214 | typedef __SIZE_TYPE__ size_t; | ^~~~~~ /usr/include/c++/14/type_traits:1446:65: error: template argument 1 is invalid 1446 | : public integral_constant<std::size_t, 1 + rank<_Tp>::value> { }; | ^ /usr/include/c++/14/type_traits:1446:65: note: invalid template non-type parameter /usr/include/c++/14/type_traits:2086:26: error: 'std::size_t' has not been declared 2086 | template<typename _Tp, std::size_t _Size> | ^~~ /usr/include/c++/14/type_traits:2087:30: error: '_Size' was not declared in this scope 2087 | struct remove_extent<_Tp[_Size]> | ^~~~~ /usr/include/c++/14/type_traits:2087:36: error: template argument 1 is invalid 2087 | struct remove_extent<_Tp[_Size]> | ^ /usr/include/c++/14/type_traits:2099:26: error: 'std::size_t' has not been declared 2099 | template<typename _Tp, std::size_t _Size> | ^~~ /usr/include/c++/14/type_traits:2100:35: error: '_Size' was not declared in this scope 2100 | struct remove_all_extents<_Tp[_Size]> | ^~~~~ /usr/include/c++/14/type_traits:2100:41: error: template argument 1 is invalid 2100 | struct remove_all_extents<_Tp[_Size]> | ^ /usr/include/c++/14/type_traits:2171:12: error: 'std::size_t' has not been declared 2171 | template<std::size_t _Len> | ^~~ /usr/include/c++/14/type_traits:2176:30: error: '_Len' was not declared in this scope 2176 | unsigned char __data[_Len]; | ^~~~ /usr/include/c++/14/type_traits:2194:12: error: 'std::size_t' has not been declared 2194 | template<std::size_t _Len, std::size_t _Align = | ^~~ /usr/include/c++/14/type_traits:2194:30: error: 'std::size_t' has not been declared 2194 | template<std::size_t _Len, std::size_t _Align = | ^~~ /usr/include/c++/14/type_traits:2195:55: error: '_Len' was not declared in this scope 2195 | __alignof__(typename __aligned_storage_msa<_Len>::__type)> | ^~~~ /usr/include/c++/14/type_traits:2195:59: error: template argument 1 is invalid 2195 | __alignof__(typename __aligned_storage_msa<_Len>::__type)> | ^ /usr/include/c++/14/type_traits:2202:30: error: '_Len' was not declared in this scope 2202 | unsigned char __data[_Len]; | ^~~~ /usr/include/c++/14/type_traits:2203:44: error: '_Align' was not declared in this scope 2203 | struct __attribute__((__aligned__((_Align)))) { } __align; | ^~~~~~ In file included from /usr/include/c++/14/bits/stl_algobase.h:65: /usr/include/c++/14/bits/stl_iterator_base_types.h:125:67: error: 'ptrdiff_t' does not name a type 125 | template<typename _Category, typename _Tp, typename _Distance = ptrdiff_t, | ^~~~~~~~~ /usr/include/c++/14/bits/stl_iterator_base_types.h:1:1: note: 'ptrdiff_t' is defined in header '<cstddef>'; this is probably fixable by adding '#include <cstddef>' +++ |+#include <cstddef> 1 | // Types used in iterator implementation -*- C++ -*- /usr/include/c++/14/bits/stl_iterator_base_types.h:214:15: error: 'ptrdiff_t' does not name a type 214 | typedef ptrdiff_t difference_type; | ^~~~~~~~~ /usr/include/c++/14/bits/stl_iterator_base_types.h:214:15: note: 'ptrdiff_t' is defined in header '<cstddef>'; this is probably fixable by adding '#include <cstddef>' /usr/include/c++/14/bits/stl_iterator_base_types.h:225:15: error: 'ptrdiff_t' does not name a type 225 | typedef ptrdiff_t difference_type; | ^~~~~~~~~ /usr/include/c++/14/bits/stl_iterator_base_types.h:225:15: note: 'ptrdiff_t' is defined in header '<cstddef>'; this is probably fixable by adding '#include <cstddef>' In file included from /usr/include/c++/14/bits/stl_algobase.h:66: /usr/include/c++/14/bits/stl_iterator_base_funcs.h:112:5: error: 'ptrdiff_t' does not name a type 112 | ptrdiff_t | ^~~~~~~~~ /usr/include/c++/14/bits/stl_iterator_base_funcs.h:66:1: note: 'ptrdiff_t' is defined in header '<cstddef>'; this is probably fixable by adding '#include <cstddef>' 65 | #include <debug/assertions.h> +++ |+#include <cstddef> 66 | #include <bits/stl_iterator_base_types.h> /usr/include/c++/14/bits/stl_iterator_base_funcs.h:118:5: error: 'ptrdiff_t' does not name a type 118 | ptrdiff_t | ^~~~~~~~~ /usr/include/c++/14/bits/stl_iterator_base_funcs.h:118:5: note: 'ptrdiff_t' is defined in header '<cstddef>'; this is probably fixable by adding '#include <cstddef>' In file included from /usr/include/c++/14/bits/stl_iterator.h:67,
s220348448
p04044
C++
#include<bits/stdc++> using namespace std; int main(){ int A,B; string s; cin>>A>>B; vector<string> S(A); for(int i=0;i<A;i++){ cin>>S[i]; } sort(S.begin(),S.end()); for(int i=0;i<A;i++){ cout<<S[i]; } cout<<endl; return 0; }
a.cc:1:9: fatal error: bits/stdc++: No such file or directory 1 | #include<bits/stdc++> | ^~~~~~~~~~~~~ compilation terminated.
s937332891
p04044
C++
#include<bits/stdc++.h> using namespace std; int main(){ int n,t; cin>>n>>t; vector<string> st; while(n--){ string s; cin>>s; st.push_back(s); } sort(st.begin(),st.end()); for(int i=0;i<st.size();i++){ cout<<v[i]; } }
a.cc: In function 'int main()': a.cc:14:9: error: 'v' was not declared in this scope 14 | cout<<v[i]; | ^
s571114837
p04044
C++
#include<bits/stdc++.h> using namespace std; int main(){ int n,t; cin>>n>>t; set<string> st; while(n--){ string s; cin>>s; st.insert(s); } for(auto i:st){ cout<<*i; } }
a.cc: In function 'int main()': a.cc:13:9: error: no match for 'operator*' (operand type is 'std::__cxx11::basic_string<char>') 13 | cout<<*i; | ^~ In file included 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/complex:400:5: note: candidate: 'template<class _Tp> std::complex<_Tp> std::operator*(const complex<_Tp>&, const complex<_Tp>&)' 400 | operator*(const complex<_Tp>& __x, const complex<_Tp>& __y) | ^~~~~~~~ /usr/include/c++/14/complex:400:5: note: candidate expects 2 arguments, 1 provided /usr/include/c++/14/complex:409:5: note: candidate: 'template<class _Tp> std::complex<_Tp> std::operator*(const complex<_Tp>&, const _Tp&)' 409 | operator*(const complex<_Tp>& __x, const _Tp& __y) | ^~~~~~~~ /usr/include/c++/14/complex:409:5: note: candidate expects 2 arguments, 1 provided /usr/include/c++/14/complex:418:5: note: candidate: 'template<class _Tp> std::complex<_Tp> std::operator*(const _Tp&, const complex<_Tp>&)' 418 | operator*(const _Tp& __x, const complex<_Tp>& __y) | ^~~~~~~~ /usr/include/c++/14/complex:418:5: note: candidate expects 2 arguments, 1 provided In file included from /usr/include/c++/14/valarray:605, from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:166: /usr/include/c++/14/bits/valarray_after.h:407:5: note: candidate: 'template<class _Dom1, class _Dom2> std::_Expr<std::__detail::_BinClos<std::__multiplies, std::_Expr, std::_Expr, _Dom1, _Dom2>, typename std::__fun<std::__multiplies, typename _Dom1::value_type>::result_type> std::operator*(const _Expr<_Dom1, typename _Dom1::value_type>&, const _Expr<_Dom2, typename _Dom2::value_type>&)' 407 | _DEFINE_EXPR_BINARY_OPERATOR(*, struct std::__multiplies) | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~ /usr/include/c++/14/bits/valarray_after.h:407:5: note: candidate expects 2 arguments, 1 provided /usr/include/c++/14/bits/valarray_after.h:407:5: note: candidate: 'template<class _Dom> std::_Expr<std::__detail::_BinClos<std::__multiplies, std::_Expr, std::_Constant, _Dom, typename _Dom::value_type>, typename std::__fun<std::__multiplies, typename _Dom1::value_type>::result_type> std::operator*(const _Expr<_Dom1, typename _Dom1::value_type>&, const typename _Dom::value_type&)' 407 | _DEFINE_EXPR_BINARY_OPERATOR(*, struct std::__multiplies) | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~ /usr/include/c++/14/bits/valarray_after.h:407:5: note: candidate expects 2 arguments, 1 provided /usr/include/c++/14/bits/valarray_after.h:407:5: note: candidate: 'template<class _Dom> std::_Expr<std::__detail::_BinClos<std::__multiplies, std::_Constant, std::_Expr, typename _Dom::value_type, _Dom>, typename std::__fun<std::__multiplies, typename _Dom1::value_type>::result_type> std::operator*(const typename _Dom::value_type&, const _Expr<_Dom1, typename _Dom1::value_type>&)' 407 | _DEFINE_EXPR_BINARY_OPERATOR(*, struct std::__multiplies) | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~ /usr/include/c++/14/bits/valarray_after.h:407:5: note: candidate expects 2 arguments, 1 provided /usr/include/c++/14/bits/valarray_after.h:407:5: note: candidate: 'template<class _Dom> std::_Expr<std::__detail::_BinClos<std::__multiplies, std::_Expr, std::_ValArray, _Dom, typename _Dom::value_type>, typename std::__fun<std::__multiplies, typename _Dom1::value_type>::result_type> std::operator*(const _Expr<_Dom1, typename _Dom1::value_type>&, const valarray<typename _Dom::value_type>&)' 407 | _DEFINE_EXPR_BINARY_OPERATOR(*, struct std::__multiplies) | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~ /usr/include/c++/14/bits/valarray_after.h:407:5: note: candidate expects 2 arguments, 1 provided /usr/include/c++/14/bits/valarray_after.h:407:5: note: candidate: 'template<class _Dom> std::_Expr<std::__detail::_BinClos<std::__multiplies, std::_ValArray, std::_Expr, typename _Dom::value_type, _Dom>, typename std::__fun<std::__multiplies, typename _Dom1::value_type>::result_type> std::operator*(const valarray<typename _Dom::value_type>&, const _Expr<_Dom1, typename _Dom1::value_type>&)' 407 | _DEFINE_EXPR_BINARY_OPERATOR(*, struct std::__multiplies) | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~ /usr/include/c++/14/bits/valarray_after.h:407:5: note: candidate expects 2 arguments, 1 provided /usr/include/c++/14/valarray:1198:1: note: candidate: 'template<class _Tp> std::_Expr<std::__detail::_BinClos<std::__multiplies, std::_ValArray, std::_ValArray, _Tp, _Tp>, typename std::__fun<std::__multiplies, _Tp>::result_type> std::operator*(const valarray<_Tp>&, const valarray<_Tp>&)' 1198 | _DEFINE_BINARY_OPERATOR(*, __multiplies) | ^~~~~~~~~~~~~~~~~~~~~~~ /usr/include/c++/14/valarray:1198:1: note: candidate expects 2 arguments, 1 provided /usr/include/c++/14/valarray:1198:1: note: candidate: 'template<class _Tp> std::_Expr<std::__detail::_BinClos<std::__multiplies, std::_ValArray, std::_Constant, _Tp, _Tp>, typename std::__fun<std::__multiplies, _Tp>::result_type> std::operator*(const valarray<_Tp>&, const typename valarray<_Tp>::value_type&)' 1198 | _DEFINE_BINARY_OPERATOR(*, __multiplies) | ^~~~~~~~~~~~~~~~~~~~~~~ /usr/include/c++/14/valarray:1198:1: note: candidate expects 2 arguments, 1 provided /usr/include/c++/14/valarray:1198:1: note: candidate: 'template<class _Tp> std::_Expr<std::__detail::_BinClos<std::__multiplies, std::_Constant, std::_ValArray, _Tp, _Tp>, typename std::__fun<std::__multiplies, _Tp>::result_type> std::operator*(const typename valarray<_Tp>::value_type&, const valarray<_Tp>&)' 1198 | _DEFINE_BINARY_OPERATOR(*, __multiplies) | ^~~~~~~~~~~~~~~~~~~~~~~ /usr/include/c++/14/valarray:1198:1: note: candidate expects 2 arguments, 1 provided
s640452287
p04044
Java
import java.util.*; class Main{ public static void main(String [] args){ Scanner sc = new Scanner(System.in); int n = sc.nextInt(); int s = sc.nextInt(); List<String> res = new ArrayList(); for(int i = 0; i < n; i++){ res.add(sc.nextLine()); } Collections.sort(res); StringBuffer ret = new StringBuffer(); for(String a : res) ret.append(a); return ret.toString(); } }
Main.java:18: error: incompatible types: unexpected return value return ret.toString(); ^ Note: Main.java uses unchecked or unsafe operations. Note: Recompile with -Xlint:unchecked for details. 1 error
s274375163
p04044
Java
import java.util.Arrays; import java.util.Scanner; public class P8 { public static void main(String[] args) { Scanner s=new Scanner(System.in); int t=s.nextInt(); int n=s.nextInt(); s.nextLine(); String[] arr=new String[t]; for(int i=0;i<t;i++){ arr[i]=s.nextLine(); } Arrays.sort(arr); StringBuilder str=new StringBuilder(); for(int i=0;i<arr.length;i++){ str.append(arr[i]); } System.out.println(str); } }
Main.java:4: error: class P8 is public, should be declared in a file named P8.java public class P8 { ^ 1 error
s185068659
p04044
Java
import java.util.Arrays; import java.util.Scanner; public class Solution { public static void main(String[] args) { Scanner s=new Scanner(System.in); int t=s.nextInt(); int n=s.nextInt(); s.nextLine(); String[] arr=new String[t]; for(int i=0;i<t;i++){ arr[i]=s.nextLine(); } Arrays.sort(arr); StringBuilder str=new StringBuilder(); for(int i=0;i<arr.length;i++){ str.append(arr[i]); } System.out.println(str); } }
Main.java:4: error: class Solution is public, should be declared in a file named Solution.java public class Solution { ^ 1 error
s061671737
p04044
Java
import java.util.Arrays; import java.util.Scanner; public class P8 { public static void main(String[] args) { Scanner s=new Scanner(System.in); int t=s.nextInt(); int n=s.nextInt(); s.nextLine(); String[] arr=new String[t]; for(int i=0;i<t;i++){ arr[i]=s.nextLine(); } Arrays.sort(arr); StringBuilder str=new StringBuilder(); for(int i=0;i<arr.length;i++){ str.append(arr[i]); } System.out.println(str); } }
Main.java:4: error: class P8 is public, should be declared in a file named P8.java public class P8 { ^ 1 error
s044928132
p04044
C++
#include <iostream> using namespace std; int main(){ int N; cin >> N; char *str = new char[N]; cin >> str; sort(str, str+N); cout << str << endl; return 0; }
a.cc: In function 'int main()': a.cc:11:5: error: 'sort' was not declared in this scope; did you mean 'short'? 11 | sort(str, str+N); | ^~~~ | short
s567779279
p04044
C++
#include <iostream> #include <string> using namespace std; int main(){ int N; cin >> N; char *str = new char[N]; cin >> str; sort(str, str+N); cout << str << endl; return 0; }
a.cc: In function 'int main()': a.cc:12:5: error: 'sort' was not declared in this scope; did you mean 'short'? 12 | sort(str, str+N); | ^~~~ | short
s439427927
p04044
C++
#include <iostream> #include <vector> #define rep(i, a, n) for(int i = a; i < n; i++) using namespace std; using ll = long long; using P = pair<int, int>; int main() { int n, l; cin >> n >> l; vector<string> s(n); rep(i, 0, n){ cin >> s[i]; } sort(s.begin(), s.end()); rep(i, 0, n){ cout << s[i]; } cout << endl; return 0; }
a.cc: In function 'int main()': a.cc:16:5: error: 'sort' was not declared in this scope; did you mean 'short'? 16 | sort(s.begin(), s.end()); | ^~~~ | short
s357972478
p04044
C++
//#define _GLIBCXX_DEBUG #include<bits/stdc++.h> #define PI 3.14159265359 using namespace std; #define rep(i, n) for (ll i = 0; i < (ll)(n); i++) const int INF= 1e9+5; typedef long long ll; typedef vector<ll> vl; typedef vector<vector<ll> >vvl; typedef pair<ll,ll> P; typedef tuple<ll,ll,ll> T; const ll MOD=1000000007LL; string abc="abcdefghijklmnopqrstuvwxyz"; string ABC="ABCDEFGHIJKLMNOPQRSTUVWXYZ"; ll factorial(ll x){ if(x==0)return 1; return x*factorial(x-1)%MOD; } int main(){ ll n,l;cin>>n>>l; vector<string>vec(n); rep(i,n)cin>>vec[i]; sort(vec.begin(),vec.end()); string ans=""; rep(i,h)ans+=vec[i]; cout<<ans<<endl; }
a.cc: In function 'int main()': a.cc:26:9: error: 'h' was not declared in this scope 26 | rep(i,h)ans+=vec[i]; | ^ a.cc:6:43: note: in definition of macro 'rep' 6 | #define rep(i, n) for (ll i = 0; i < (ll)(n); i++) | ^
s386445047
p04044
C++
#include <iostream> #include <string> #include <vector> #include <algorithm> using namespace std; int main(){ int n; cin >> n; vector<string> s = {}; for(int i = 0; i < n; i ++){ string str; cin >> str; s.push_back(str); } sort(s.begin(), s.end()); for(string str : s){ cout << s; } return 0; }
a.cc: In function 'int main()': a.cc:20:10: error: no match for 'operator<<' (operand types are 'std::ostream' {aka 'std::basic_ostream<char>'} and 'std::vector<std::__cxx11::basic_string<char> >') 20 | cout << s; | ~~~~ ^~ ~ | | | | | std::vector<std::__cxx11::basic_string<char> > | std::ostream {aka std::basic_ostream<char>} In file included from /usr/include/c++/14/iostream:41, from a.cc:1: /usr/include/c++/14/ostream:116:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(__ostream_type& (*)(__ostream_type&)) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>]' 116 | operator<<(__ostream_type& (*__pf)(__ostream_type&)) | ^~~~~~~~ /usr/include/c++/14/ostream:116:36: note: no known conversion for argument 1 from 'std::vector<std::__cxx11::basic_string<char> >' to 'std::basic_ostream<char>::__ostream_type& (*)(std::basic_ostream<char>::__ostream_type&)' {aka 'std::basic_ostream<char>& (*)(std::basic_ostream<char>&)'} 116 | operator<<(__ostream_type& (*__pf)(__ostream_type&)) | ~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~ /usr/include/c++/14/ostream:125:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(__ios_type& (*)(__ios_type&)) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>; __ios_type = std::basic_ios<char>]' 125 | operator<<(__ios_type& (*__pf)(__ios_type&)) | ^~~~~~~~ /usr/include/c++/14/ostream:125:32: note: no known conversion for argument 1 from 'std::vector<std::__cxx11::basic_string<char> >' to 'std::basic_ostream<char>::__ios_type& (*)(std::basic_ostream<char>::__ios_type&)' {aka 'std::basic_ios<char>& (*)(std::basic_ios<char>&)'} 125 | operator<<(__ios_type& (*__pf)(__ios_type&)) | ~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~ /usr/include/c++/14/ostream:135:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(std::ios_base& (*)(std::ios_base&)) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>]' 135 | operator<<(ios_base& (*__pf) (ios_base&)) | ^~~~~~~~ /usr/include/c++/14/ostream:135:30: note: no known conversion for argument 1 from 'std::vector<std::__cxx11::basic_string<char> >' to 'std::ios_base& (*)(std::ios_base&)' 135 | operator<<(ios_base& (*__pf) (ios_base&)) | ~~~~~~~~~~~~^~~~~~~~~~~~~~~~~ /usr/include/c++/14/ostream:174:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(long int) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>]' 174 | operator<<(long __n) | ^~~~~~~~ /usr/include/c++/14/ostream:174:23: note: no known conversion for argument 1 from 'std::vector<std::__cxx11::basic_string<char> >' to 'long int' 174 | operator<<(long __n) | ~~~~~^~~ /usr/include/c++/14/ostream:178:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(long unsigned int) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>]' 178 | operator<<(unsigned long __n) | ^~~~~~~~ /usr/include/c++/14/ostream:178:32: note: no known conversion for argument 1 from 'std::vector<std::__cxx11::basic_string<char> >' to 'long unsigned int' 178 | operator<<(unsigned long __n) | ~~~~~~~~~~~~~~^~~ /usr/include/c++/14/ostream:182:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(bool) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>]' 182 | operator<<(bool __n) | ^~~~~~~~ /usr/include/c++/14/ostream:182:23: note: no known conversion for argument 1 from 'std::vector<std::__cxx11::basic_string<char> >' to 'bool' 182 | operator<<(bool __n) | ~~~~~^~~ In file included from /usr/include/c++/14/ostream:1022: /usr/include/c++/14/bits/ostream.tcc:96:5: note: candidate: 'std::basic_ostream<_CharT, _Traits>& std::basic_ostream<_CharT, _Traits>::operator<<(short int) [with _CharT = char; _Traits = std::char_traits<char>]' 96 | basic_ostream<_CharT, _Traits>:: | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ /usr/include/c++/14/bits/ostream.tcc:97:22: note: no known conversion for argument 1 from 'std::vector<std::__cxx11::basic_string<char> >' to 'short int' 97 | operator<<(short __n) | ~~~~~~^~~ /usr/include/c++/14/ostream:189:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(short unsigned int) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>]' 189 | operator<<(unsigned short __n) | ^~~~~~~~ /usr/include/c++/14/ostream:189:33: note: no known conversion for argument 1 from 'std::vector<std::__cxx11::basic_string<char> >' to 'short unsigned int' 189 | operator<<(unsigned short __n) | ~~~~~~~~~~~~~~~^~~ /usr/include/c++/14/bits/ostream.tcc:110:5: note: candidate: 'std::basic_ostream<_CharT, _Traits>& std::basic_ostream<_CharT, _Traits>::operator<<(int) [with _CharT = char; _Traits = std::char_traits<char>]' 110 | basic_ostream<_CharT, _Traits>:: | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ /usr/include/c++/14/bits/ostream.tcc:111:20: note: no known conversion for argument 1 from 'std::vector<std::__cxx11::basic_string<char> >' to 'int' 111 | operator<<(int __n) | ~~~~^~~ /usr/include/c++/14/ostream:200:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(unsigned int) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>]' 200 | operator<<(unsigned int __n) | ^~~~~~~~ /usr/include/c++/14/ostream:200:31: note: no known conversion for argument 1 from 'std::vector<std::__cxx11::basic_string<char> >' to 'unsigned int' 200 | operator<<(unsigned int __n) | ~~~~~~~~~~~~~^~~ /usr/include/c++/14/ostream:211:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(long long int) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>]' 211 | operator<<(long long __n) | ^~~~~~~~ /usr/include/c++/14/ostream:211:28: note: no known conversion for argument 1 from 'std::vector<std::__cxx11::basic_string<char> >' to 'long long int' 211 | operator<<(long long __n) | ~~~~~~~~~~^~~ /usr/include/c++/14/ostream:215:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(long long unsigned int) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>]' 215 | operator<<(unsigned long long __n) | ^~~~~~~~ /usr/include/c++/14/ostream:215:37: note: no known conversion for argument 1 from 'std::vector<std::__cxx11::basic_string<char> >' to 'long long unsigned int' 215 | operator<<(unsigned long long __n) | ~~~~~~~~~~~~~~~~~~~^~~ /usr/include/c++/14/ostream:231:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(double) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>]' 231 | operator<<(double __f) | ^~~~~~~~ /usr/include/c++/14/ostream:231:25: note: no known conversion for argument 1 from 'std::vector<std::__cxx11::basic_string<char> >' to 'double' 231 | operator<<(double __f) | ~~~~~~~^~~ /usr/include/c++/14/ostream:235:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(float) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>]' 235 | operator<<(float __f) | ^~~~~~~~ /usr/include/c++/14/ostream:235:24: note: no known conversion for argument 1 from 'std::vector<std::__cxx11::basic_string<char> >' to 'float' 235 | operator<<(float __f) | ~~~~~~^~~ /usr/include/c++/14/ostream:243:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(long double) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>]' 243 | operator<<(long double __f) | ^~~~~~~~ /usr/include/c++/14/ostream:243:30: note: no known conversion for argument 1 from 'std::vector<std::__cxx11::basic_string<char> >' to 'long double' 243 | operator<<(long double __f) | ~~~~~~~~~~~~^~~ /usr/include/c++/14/ostream:301:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(const void*) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>]' 301 | operator<<(const void* __p) | ^~~~~~~~ /usr/include/c++/14/ostream:301:30: note: no known conversion for argument 1 from 'std::vector<std::__cxx11::basic_string<char> >' to 'const void*' 301 | operator<<(const void* __p) | ~~~~~~~~~~~~^~~ /usr/include/c++/14/ostream:306:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(std::nullptr_t) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_
s790476042
p04044
C++
#include <iostream> #include <string> #include <vector> #include <algorithm> using namespace std; int main() { int N; cin >> N; int L; cin >> L; vector<string> x(N); for( int i = 0:i < N; ++i ){ cin >> x[i]; } sort(x.begin(),x.end()); cout << x[0] << endl; return 0; }
a.cc: In function 'int main()': a.cc:14:14: error: initializer in range-based 'for' loop 14 | for( int i = 0:i < N; ++i ){ | ^ a.cc:14:23: error: expected ')' before ';' token 14 | for( int i = 0:i < N; ++i ){ | ~ ^ | ) a.cc:14:27: error: 'i' was not declared in this scope 14 | for( int i = 0:i < N; ++i ){ | ^
s868700225
p04044
C++
#include<bits/stdc++.h> using namespace std; int main() { int n,l; string st=""; cin>>n>>l; string str[n][l]; for(int i=0;i<n;i++) cin>>str[i]; map <string,int> mp; for(int i=0;i<n;i++) mp[str[i]]++; for(auto it=mp.begin();it!=mp.end();it++) { st+=it->first; } cout<<st; return 0; }
a.cc: In function 'int main()': a.cc:11:8: error: no match for 'operator>>' (operand types are 'std::istream' {aka 'std::basic_istream<char>'} and 'std::string [l]' {aka 'std::__cxx11::basic_string<char> [l]'}) 11 | cin>>str[i]; | ~~~^~~~~~~~ | | | | | std::string [l] {aka std::__cxx11::basic_string<char> [l]} | 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>]' (near match) 170 | operator>>(bool& __n) | ^~~~~~~~ /usr/include/c++/14/istream:170:7: note: conversion of argument 1 would be ill-formed: a.cc:11:15: error: cannot bind non-const lvalue reference of type 'bool&' to a value of type 'std::string*' {aka 'std::__cxx11::basic_string<char>*'} 11 | cin>>str[i]; | ~~~~~^ /usr/include/c++/14/istream:174:7: note: candidate: 'std::basic_istream<_CharT, _Traits>& std::basic_istream<_CharT, _Traits>::operator>>(short int&) [with _CharT = char; _Traits = std::char_traits<char>]' (near match) 174 | operator>>(short& __n); | ^~~~~~~~ /usr/include/c++/14/istream:174:7: note: conversion of argument 1 would be ill-formed: a.cc:11:15: error: invalid conversion from 'std::string*' {aka 'std::__cxx11::basic_string<char>*'} to 'short int' [-fpermissive] 11 | cin>>str[i]; | ~~~~~^ | | | std::string* {aka std::__cxx11::basic_string<char>*} a.cc:11:15: error: cannot bind rvalue '(short int)((std::string*)(& str[i]))' to 'short int&' /usr/include/c++/14/istream:177:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(short unsigned int&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' (near match) 177 | operator>>(unsigned short& __n) | ^~~~~~~~ /usr/include/c++/14/istream:177:7: note: conversion of argument 1 would be ill-formed: a.cc:11:15: error: invalid conversion from 'std::string*' {aka 'std::__cxx11::basic_string<char>*'} to 'short unsigned int' [-fpermissive] 11 | cin>>str[i]; | ~~~~~^ | | | std::string* {aka std::__cxx11::basic_string<char>*} a.cc:11:15: error: cannot bind rvalue '(short unsigned int)((std::string*)(& str[i]))' to 'short unsigned int&' /usr/include/c++/14/istream:181:7: note: candidate: 'std::basic_istream<_CharT, _Traits>& std::basic_istream<_CharT, _Traits>::operator>>(int&) [with _CharT = char; _Traits = std::char_traits<char>]' (near match) 181 | operator>>(int& __n); | ^~~~~~~~ /usr/include/c++/14/istream:181:7: note: conversion of argument 1 would be ill-formed: a.cc:11:15: error: invalid conversion from 'std::string*' {aka 'std::__cxx11::basic_string<char>*'} to 'int' [-fpermissive] 11 | cin>>str[i]; | ~~~~~^ | | | std::string* {aka std::__cxx11::basic_string<char>*} a.cc:11:15: error: cannot bind rvalue '(int)((std::string*)(& str[i]))' to 'int&' /usr/include/c++/14/istream:184:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(unsigned int&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' (near match) 184 | operator>>(unsigned int& __n) | ^~~~~~~~ /usr/include/c++/14/istream:184:7: note: conversion of argument 1 would be ill-formed: a.cc:11:15: error: invalid conversion from 'std::string*' {aka 'std::__cxx11::basic_string<char>*'} to 'unsigned int' [-fpermissive] 11 | cin>>str[i]; | ~~~~~^ | | | std::string* {aka std::__cxx11::basic_string<char>*} a.cc:11:15: error: cannot bind rvalue '(unsigned int)((std::string*)(& str[i]))' to 'unsigned int&' /usr/include/c++/14/istream:188:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(long int&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' (near match) 188 | operator>>(long& __n) | ^~~~~~~~ /usr/include/c++/14/istream:188:7: note: conversion of argument 1 would be ill-formed: a.cc:11:15: error: invalid conversion from 'std::string*' {aka 'std::__cxx11::basic_string<char>*'} to 'long int' [-fpermissive] 11 | cin>>str[i]; | ~~~~~^ | | | std::string* {aka std::__cxx11::basic_string<char>*} a.cc:11:15: error: cannot bind rvalue '(long int)((std::string*)(& str[i]))' to 'long int&' /usr/include/c++/14/istream:192:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(long unsigned int&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' (near match) 192 | operator>>(unsigned long& __n) | ^~~~~~~~ /usr/include/c++/14/istream:192:7: note: conversion of argument 1 would be ill-formed: a.cc:11:15: error: invalid conversion from 'std::string*' {aka 'std::__cxx11::basic_string<char>*'} to 'long unsigned int' [-fpermissive] 11 | cin>>str[i]; | ~~~~~^ | | | std::string* {aka std::__cxx11::basic_string<char>*} a.cc:11:15: error: cannot bind rvalue '(long unsigned int)((std::string*)(& str[i]))' to 'long unsigned int&' /usr/include/c++/14/istream:199:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(long long int&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' (near match) 199 | operator>>(long long& __n) | ^~~~~~~~ /usr/include/c++/14/istream:199:7: note: conversion of argument 1 would be ill-formed: a.cc:11:15: error: invalid conversion from 'std::string*' {aka 'std::__cxx11::basic_string<char>*'} to 'long long int' [-fpermissive] 11 | cin>>str[i]; | ~~~~~^ | | | std::string* {aka std::__cxx11::basic_string<char>*} a.cc:11:15: error: cannot bind rvalue '(long long int)((std::string*)(& str[i]))' to 'long long int&' /usr/include/c++/14/istream:203:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(long long unsigned int&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' (near match) 203 | operator>>(unsigned long long& __n) | ^~~~~~~~ /usr/include/c++/14/istream:203:7: note: conversion of argument 1 would be ill-formed: a.cc:11:15: error: invalid conversion from 'std::string*' {aka 'std::__cxx11::basic_string<char>*'} to 'long long unsigned int' [-fpermissive] 11 | cin>>str[i]; | ~~~~~^ | | | std::string* {aka std::__cxx11::basic_string<char>*} a.cc:11:15: error: cannot bind rvalue '(long long unsigned int)((std::string*)(& str[i]))' to 'long long unsigned int&' /usr/include/c++/14/istream:328:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(void*&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' (near match) 328 | operator>>(void*& __p) | ^~~~~~~~ /usr/include/c++/14/istream:328:7: note: conversion of argument 1 would be ill-formed: a.cc:11:15: error: cannot bind non-const lvalue reference of type 'void*&' to an rvalue of type 'void*' 11 | cin>>str[i]; | ~~~~~^ /usr/include/c++/14/istream:219:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(float&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' 219 | operator>>(float& __f) | ^~~~~~~~ /usr/include/c++/14/istream:219:25: note: no known conversion for argument 1 from 'std::string [l]' {aka 'std::__cxx11::basic_string<char> [l]'} to 'float&' 219 | operator>>(float& __f) | ~~~~~~~^~~ /usr/include/c++/14/istream:223:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(double&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' 223 | operator>>(double& __f) | ^~~~~~~~ /usr/include/c++/14/istream:223:26: note: no known conversion for argument 1 from 'std::string [l]' {aka 'std::__cxx11::basic_string<char> [l]'} to 'double&' 223 | operator>>(double& __f) | ~~~~~~~~^~~ /usr/include/c++/14/istream:227:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(long double&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' 227 | operator>>(long double& __f) | ^~~~~~~~ /usr/include/c++/14/istream:227:31: note: no known conversion for argument 1 from 'std::string [l]' {aka 'std::__cxx11::basic_string<char> [l]'} to 'long double&' 227 | operator>>(long double& __f) | ~~~~~~~~~~~~~^~~ /usr/include/c++/14/istream:122:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(__istream_type& (*)(__istream_type&)) [with _CharT = char; _Traits = st
s648685713
p04044
Java
tring allStringsSupersetSoFar = NStrings[0] /* first input String */ for(int i = 1; i < NStrings.length; i++) { allStringsSupersetSoFar = formSuperSetsoFar(NStrings[i], allStringsSupersetSoFar); } /* * Given two strings, finds the superset string in lexicographic order for * which both the input strings are subsequences */ String formSuperSetsoFar(String ithString, String allStringsSupersetSoFar) { int m = allStringsSupersetSoFar.length(); int n = ithString.length(); int i, j = 0; /* i - index to allStringsSupersetSoFar and j - index to ithString StringBuilder superSetString = new StringBuilder(); while ( i < m && j < n) { if(allStringsSupersetSoFar [i] < ithString[j]) { superSetString.append(allStringsSupersetSoFar [i]); i++; } else if (allStringsSupersetSoFar [i] > ithString[j]) { superSetString.append(ithString[j]); j++; } else { i++; j++; superSetString.append(allStringsSupersetSoFar [j]); } } if(j < n) { superSetString.append(ithString.substring(j+1)); } if(i < m) { superSetString.append(allStringsSupersetSoFar.substring(i+1)); } return superSetString; }
Main.java:1: error: unnamed classes are a preview feature and are disabled by default. tring allStringsSupersetSoFar = NStrings[0] /* first input String */ ^ (use --enable-preview to enable unnamed classes) Main.java:1: error: ';' expected tring allStringsSupersetSoFar = NStrings[0] /* first input String */ ^ Main.java:3: error: class, interface, enum, or record expected for(int i = 1; i < NStrings.length; i++) ^ Main.java:3: error: class, interface, enum, or record expected for(int i = 1; i < NStrings.length; i++) ^ Main.java:6: error: class, interface, enum, or record expected } ^ Main.java:16: error: class, interface, enum, or record expected int i, j = 0; /* i - index to allStringsSupersetSoFar and j - index to ithString ^ Main.java:16: error: unclosed comment int i, j = 0; /* i - index to allStringsSupersetSoFar and j - index to ithString ^ Main.java:47: error: reached end of file while parsing } ^ 8 errors
s130944264
p04044
C
using System; class GFG { // function to sort the // array of string static void sort(String []a, int n) { //sort the array for(int i = 0;i < n;i++) { for(int j = i + 1;j < n;j++) { // comparing which of the // two concatenation causes // lexiographically smaller // string if((a[i] + a[j]).CompareTo(a[j] + a[i]) > 0) { String s = a[i]; a[i] = a[j]; a[j] = s; } } } } static String lexsmallest(String []a, int n) { // Sort strings sort(a,n); // Concatenating sorted // strings String answer = ""; for (int i = 0; i < n; i++) answer += a[i]; return answer; } // Driver code public static void Main() { String []a = {"c", "cb", "cba"}; int n = 3; Console.Write("lexiographically smallest string = " + lexsmallest(a, n)); } }
main.c:1:1: error: unknown type name 'using' 1 | using System; | ^~~~~ main.c:3:1: error: unknown type name 'class' 3 | class GFG { | ^~~~~ main.c:3:11: error: expected '=', ',', ';', 'asm' or '__attribute__' before '{' token 3 | class GFG { | ^
s786732637
p04044
Java
import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; import java.util.Scanner; import java.util.Arrays; public class Main { public static void main(String[] args) { Scanner scan = new Scanner(System.in); int N = scan.nextInt(); int L = scan.nextInt(); BufferedReader reader = new BufferedReader(new InputStreamReader(System.in)); for(int i = 0; i < N; i++){ String[] str = new String[N] str[i] = reader.readLine(); } Arrays.sort(str); for(String out : str){ System.out.print(out); } reader.close(); } }
Main.java:16: error: ';' expected String[] str = new String[N] ^ 1 error
s021618550
p04044
C++
#include <bits/stdc++.h> 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()); string ans=""; for(int i=0;i<N;i++){ ans+=a.at(i) } cout<<ans<<endl; }
a.cc: In function 'int main()': a.cc:15:15: error: expected ';' before '}' token 15 | ans+=a.at(i) | ^ | ; 16 | } | ~
s309153833
p04044
C++
#include<bits/stdc++.h> using namespace std;vector<string> n; int N,L; int main(){ cin>>N>>L;string l; for(int i=0;i<N;++i){ cin>>l;n.push_back(l)} sort(n.begin(),n.end()); for(int i=0;i<N;++i)cout<<n[i]; return 0; }
a.cc: In function 'int main()': a.cc:7:26: error: expected ';' before '}' token 7 | cin>>l;n.push_back(l)} | ^ | ;
s624497218
p04044
C++
#include <bits/stdc++.h> using namespace std; int main() { int L,N; cin >> L >> N; vector<stirng> S(N); for (int i = 0; i < N; i++){ cin >> S[i]; } sort(S.begin(),S.end()); string ans = ""; for (int i = 0; i < N; i++){ ans += S[i]; } cout << ans << endl; return 0; }
a.cc: In function 'int main()': a.cc:6:10: error: 'stirng' was not declared in this scope 6 | vector<stirng> S(N); | ^~~~~~ a.cc:6:16: error: template argument 1 is invalid 6 | vector<stirng> S(N); | ^ a.cc:6:16: error: template argument 2 is invalid a.cc:8:13: error: invalid types 'int[int]' for array subscript 8 | cin >> S[i]; | ^ a.cc:10:10: error: request for member 'begin' in 'S', which is of non-class type 'int' 10 | sort(S.begin(),S.end()); | ^~~~~ a.cc:10:20: error: request for member 'end' in 'S', which is of non-class type 'int' 10 | sort(S.begin(),S.end()); | ^~~ a.cc:13:12: error: invalid types 'int[int]' for array subscript 13 | ans += S[i]; | ^
s887181224
p04044
C++
#include <stdio.h> #include <stdlib.h> #include <string.h> int main() { unsigned short N, L, i, j; char *buf, **ptr, *tmp; scanf("%hu %hu", &N, &L); scanf("%*c"); L++; buf = malloc(N * L); ptr = malloc(sizeof(char *) * N); memset(buf, 0, N * L); memset(ptr, 0, sizeof(char *) * N); for (i = 0; i < N; i++) { ptr[i] = buf + i * L; scanf("%100[^\n]%*[^\n]", ptr[i]); scanf("%*c"); for (j = i; 0 < j; j--) { if (strncmp(ptr[j], ptr[j - 1], L) < 0) { tmp = ptr[j]; ptr[j] = ptr[j - 1]; ptr[j - 1] = tmp; } } } for (i = 0; i < N; i++) { printf("%s", ptr[i]); } printf("\n"); free(buf); free(ptr); return 0; }
a.cc: In function 'int main()': a.cc:11:21: error: invalid conversion from 'void*' to 'char*' [-fpermissive] 11 | buf = malloc(N * L); | ~~~~~~^~~~~~~ | | | void* a.cc:12:21: error: invalid conversion from 'void*' to 'char**' [-fpermissive] 12 | ptr = malloc(sizeof(char *) * N); | ~~~~~~^~~~~~~~~~~~~~~~~~~~ | | | void*
s581949613
p04044
C
#include <stdio.h> #include <stdlib.h> #include <string.h> int main(){ int N,L; int i,j; scanf("%d",&N); scanf("%d",&L) char S[N][L+1]; for(i=0;i<N;i++) { scanf("%s",S[i]); } char tmp[L+1]; for(i=1;i<N;i++){ for(j=N-1;j>=i;j--){ if(strcmp(S[j-1],S[j])>0){ strcpy(tmp,S[j-1]); strcpy(S[j-1],S[j]); strcpy(S[j],tmp); } } } for(i=0;i<N;i++){ printf("%s",S[i]); } return 0; }
main.c: In function 'main': main.c:9:17: error: expected ';' before 'char' 9 | scanf("%d",&L) | ^ | ; 10 | char S[N][L+1]; | ~~~~ main.c:13:20: error: 'S' undeclared (first use in this function) 13 | scanf("%s",S[i]); | ^ main.c:13:20: note: each undeclared identifier is reported only once for each function it appears in
s247904474
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=i+1){ cin >> S.at(i); } sort(S.begin(),S.end()); for(int x:S){ cout << x; } cout << endl; }
a.cc: In function 'int main()': a.cc:12:13: error: cannot convert 'std::__cxx11::basic_string<char>' to 'int' in initialization 12 | for(int x:S){ | ^
s331318271
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=i+1){ cin >> S.at(i); } sort(S.begin(),S.end()); for(int x:S){ cout << X; } cout << endl; }
a.cc: In function 'int main()': a.cc:12:13: error: cannot convert 'std::__cxx11::basic_string<char>' to 'int' in initialization 12 | for(int x:S){ | ^ a.cc:13:13: error: 'X' was not declared in this scope 13 | cout << X; | ^
s094871311
p04044
C++
#include <stdio.h> #include <stdlib.h> #include <string.h> int main(void) { char **p; char *s; int n, l, i; scanf("%d %d", &n, &l); p = (char **)malloc(n * sizeof(char *)); for (i = 0; i < n; i++) { p[i] = malloc(l * sizeof(char) + 1); scanf("%s", p[i]); } qsort(p, n, sizeof(char *), strcmp); s = malloc(sizeof(char) * n * l + 1); strcpy(s, p[0]); for (i = 1; i < n; i++) { strcat(s, p[i]); } printf("%s\n", s); return 0; }
a.cc: In function 'int main()': a.cc:14:18: error: invalid conversion from 'void*' to 'char*' [-fpermissive] 14 | p[i] = malloc(l * sizeof(char) + 1); | ~~~~~~^~~~~~~~~~~~~~~~~~~~~~ | | | void* a.cc:18:31: error: invalid conversion from 'int (*)(const char*, const char*) noexcept' to '__compar_fn_t' {aka 'int (*)(const void*, const void*)'} [-fpermissive] 18 | qsort(p, n, sizeof(char *), strcmp); | ^~~~~~ | | | int (*)(const char*, const char*) noexcept In file included from /usr/include/c++/14/cstdlib:79, from /usr/include/c++/14/stdlib.h:36, from a.cc:2: /usr/include/stdlib.h:971:34: note: initializing argument 4 of 'void qsort(void*, size_t, size_t, __compar_fn_t)' 971 | __compar_fn_t __compar) __nonnull ((1, 4)); | ~~~~~~~~~~~~~~^~~~~~~~ a.cc:20:13: error: invalid conversion from 'void*' to 'char*' [-fpermissive] 20 | s = malloc(sizeof(char) * n * l + 1); | ~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~ | | | void*
s427976091
p04044
C++
#include<bits/stdc++.h> using namespace std; int main(){ int N,L; int ans; string S[110] cin >> N >> L; for(int i = 0;i < N;i++)cin >> S[i]; sort(S,S + N); for(int i = 0;i < N;i ++){ ans += S[i]; } cout << ans <<endl; }
a.cc: In function 'int main()': a.cc:8:3: error: expected initializer before 'cin' 8 | cin >> N >> L; | ^~~ a.cc:10:34: error: 'S' was not declared in this scope 10 | for(int i = 0;i < N;i++)cin >> S[i]; | ^ a.cc:12:8: error: 'S' was not declared in this scope 12 | sort(S,S + N); | ^
s870799463
p04044
C++
#include <bits/stdc++.h> using namespace std; 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] << endl; return 0; }
a.cc: In function 'int main()': a.cc:14:2: error: expected '}' at end of input 14 | } | ^ a.cc:4:12: note: to match this '{' 4 | int main() { | ^
s115041047
p04044
C++
#include <bits/stdc++.h> using namespace std; typedef long long ll; #define rep(i, n) for(ll i = 0; i < (ll)(n); i++) #define rep2(i, a, n) for(ll i = a; i < (ll)(n); i++) #define memi cout << endl #define kono(n) cout << fixed << setprecision(n) #define all(c) (c).begin(), (c).end() #define pb push_back #define hina cout << ' ' #define in(n) cin >> n #define in2(n, m) cin >> n >> m #define in3(n, m, l) cin >> n >> m >> l #define out(n) cout << n const ll mei = (ll)1e9 + 7; int main(){ ll n; in(l); ll m; in(m); vector<string> s(n); rep(i, n) in(s[i]); sort(all(s)); rep(i, n) out(s[i]); memi; }
a.cc: In function 'int main()': a.cc:19:6: error: 'l' was not declared in this scope 19 | in(l); | ^ a.cc:11:22: note: in definition of macro 'in' 11 | #define in(n) cin >> n | ^