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(st...
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 heade...
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.prin...
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(" ", "...
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++...
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 cann...
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...
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_stri...
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++){ ...
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]^...
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<...
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 includ...
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...
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 bee...
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]); } ...
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...
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: decl...
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++){ ...
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 ...
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]]...
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 ...
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; ...
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)...
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, in...
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...
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+...
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 << ...
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]; ...
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.ou...
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: erro...
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().so...
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()); ...
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: varia...
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)...
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(te...
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/...
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(te...
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/...
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,...
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) | ~...
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 ...
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){ ...
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 ...
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(st...
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.sor...
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.sor...
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.sor...
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(st...
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(st...
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 ...
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 st...
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...
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 's...
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 sc...
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_ba...
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 /...
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 /us...
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(Sy...
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 '-fmod...
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/i...
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) { ...
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]); s...
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 ma...
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::...
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 ini...
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 <<...
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[...
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; ...
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 ...
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; } re...
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) ret...
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 ...
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, ...
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, fro...
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()); } Collect...
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....
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...
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....
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){...
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=1000000007L...
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; } ...
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_str...
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...
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...
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 subs...
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 */ ...
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 concatena...
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(); ...
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: inv...
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++) { ...
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**' [-fpermissi...
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...
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]); | ...
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 *), str...
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 (*)(cons...
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 ...
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 c...
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 | ^