submission_id
stringlengths
10
10
problem_id
stringlengths
6
6
language
stringclasses
3 values
code
stringlengths
1
522k
compiler_output
stringlengths
43
10.2k
s070983897
p04044
C++
#include<iostream> #include<string> #include <vector> #include <bits/stdc++.h> using namespace std; int main() { int n,k; cin >> n >> k; vector <string> v(n); string s; for (int i = 0; i < k; i++){ cin >> s; v.push_back(s); } sort(v.begin(),v.end()); for (int i= 0; i<v.size(); i++){ cout << v[i]; }
a.cc: In function 'int main()': a.cc:21:2: error: expected '}' at end of input 21 | } | ^ a.cc:8:1: note: to match this '{' 8 | { | ^
s929109272
p04044
C++
#include<bits/stdc++.h> using namespace std; int main(){ int n,l; cin >> n >> l; vector<string>str(n); for(int i=0;i<n;i++){ cin >> str.at(i) } sort(str.begin(),str.end()); string ans =""; for(int i =0;i<n;i++){ ans += str.at(i); } cout << ans << endl; }
a.cc: In function 'int main()': a.cc:8:21: error: expected ';' before '}' token 8 | cin >> str.at(i) | ^ | ; 9 | } | ~
s633072374
p04044
C++
#include<bits/stdc++.h> using namespace std; int main(){ int n,l; cin >> n >> l; vector<string>str(n); for(int i=0;i<n;i++){ cin >> string.at(i) } sort(str.begin(),str.end()); string ans =''; for(int i =0;i<n;i++){ ans += str.at(i); } cout << ans << endl; }
a.cc:11:15: error: empty character constant 11 | string ans =''; | ^~ a.cc: In function 'int main()': a.cc:8:18: error: expected primary-expression before '.' token 8 | cin >> string.at(i) | ^ a.cc:11:15: error: conversion from 'char' to non-scalar type 'std::stri...
s273255965
p04044
C++
#include<bits/stdc++.h> using namespace std; int main(){ int n, l; cin >> n >> l; vector<string> s(n); for(int i=0;i<n;i++) cin >> s(i); sort(s.begin(),s.end()); for(int i=0;i<n;i++) cout << s(i); cout << endl; }
a.cc: In function 'int main()': a.cc:7:32: error: no match for call to '(std::vector<std::__cxx11::basic_string<char> >) (int&)' 7 | for(int i=0;i<n;i++) cin >> s(i); | ~^~~ a.cc:9:33: error: no match for call to '(std::vector<std::__cxx11::basic_string<char> >) (int&)' 9 |...
s341598753
p04044
C++
#include<bits/stdc++.h> using namespace std; int main(){ int n, l; cin >> n >> l; vector<string> s(n); for(i=0;i<n;i++) cin >> s(i); sort(s.begin(),s.end()); for(i=0;i<n;i++) cout << s(i); cout << endl; }
a.cc: In function 'int main()': a.cc:7:7: error: 'i' was not declared in this scope 7 | for(i=0;i<n;i++) cin >> s(i); | ^ a.cc:9:7: error: 'i' was not declared in this scope 9 | for(i=0;i<n;i++) cout << s(i); | ^
s841599111
p04044
C++
#include <bits/stdc++.h> using namespace std; int main(){ int n,l; cin >> n >> l; vector<string> s(n); for(int i=0;i<n;i++) cin >> s.at(i); sort(s.begin(),s.end()); for(int j=0;j<n;j++) cout << s.at(i); cout << endl; return 0; }
a.cc: In function 'int main()': a.cc:10:37: error: 'i' was not declared in this scope 10 | for(int j=0;j<n;j++) cout << s.at(i); | ^
s541242230
p04044
C++
#include <bits/stdc++.h> using namespace std; int main(){ int n,l; cin >> n >> l; vector<strng> s(n); for(int i=0;i<n;i++) cin >> s.at(i); sort(s.begin(),s.end()); for(int j=0;j<n;j++) cout << s.at(i); cout << endl; return 0; }
a.cc: In function 'int main()': a.cc:7:10: error: 'strng' was not declared in this scope 7 | vector<strng> s(n); | ^~~~~ a.cc:7:15: error: template argument 1 is invalid 7 | vector<strng> s(n); | ^ a.cc:7:15: error: template argument 2 is invalid a.cc:8:33: error: request ...
s769063748
p04044
C++
#include<bits/stdc++.h> using namespace std; int main() { int n, l; string s; cin >> n >> l; vector<string> vec(n). for(int i=0; i<n; i++){ cin >> vec.at(i); } sort(vec.begin(), vec.end()); s=vec.at(0); for(int i=1; i<n; i++){ s += vec(i); } cout << s <<endl; }
a.cc: In function 'int main()': a.cc:8:24: error: expected ',' or ';' before '.' token 8 | vector<string> vec(n). | ^ a.cc:10:16: error: 'i' was not declared in this scope 10 | for(int i=0; i<n; i++){ | ^ a.cc:18:13: error: no match for call to '(std::vector<...
s058521840
p04044
C++
#include <iostream> #include <vector> #include <algorithm> using namespace std; int main(void) { int a, b; 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]; return 0; }
a.cc: In function 'int main()': a.cc:15:7: error: no matching function for call to 'sort(<unresolved overloaded function type>, <unresolved overloaded function type>)' 15 | sort(s.begin,s.end); | ~~~~^~~~~~~~~~~~~~~ In file included from /usr/include/c++/14/algorithm:61, from a.cc:3: /usr/...
s812935745
p04044
C++
#include <iostream> #include <vector> #include <algorithm> using namespace std; int main(void) { int a, b; cin >> a >> b; vector<string> s(a); for(int i = 0;i < a; i++) cin >> s[i]; sort(s); for(int i=0;i<a;i++) cout << s[i]; return 0; }
a.cc: In function 'int main()': a.cc:15:7: error: no matching function for call to 'sort(std::vector<std::__cxx11::basic_string<char> >&)' 15 | sort(s); | ~~~~^~~ In file included from /usr/include/c++/14/algorithm:61, from a.cc:3: /usr/include/c++/14/bits/stl_algo.h:4762:5: note: candidat...
s993690682
p04044
C++
#include<bits/stdc++.h> #define rep(i, n) for (int i = 0; i < (int)(n); ++i) #define MAX 1000 using namespace std; int N, ans, cnt, sum; bool flg; int main() { int L; string S[101]; cin >> N >> L; rep(i,N) cin >> S[i]; sort(S, S + N); rep(i, N) cout << S[i] << endl; return 0; }
a.cc:18:31: error: extended character   is not valid in an identifier 18 | rep(i, N) cout << S[i] << endl; | ^ a.cc: In function 'int main()': a.cc:18:31: error: expected ';' before '\U00003000' 18 | rep(i, N) cout << S[i] << endl; | ...
s398716086
p04044
C++
#include <bits/stdc++.h> #include <boost/algorithm/string/join.hpp> using namespace std; using boost::algorithm::join; int main() { int n, l; cin >> n >> l; vector<string> arr(n); for (int i = 0; i < n; ++i) { cin >> arr[i]; } sort(arr.begin(), arr.end()); string s = join(arr, ""); cout << s <<...
a.cc:2:10: fatal error: boost/algorithm/string/join.hpp: No such file or directory 2 | #include <boost/algorithm/string/join.hpp> | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ compilation terminated.
s409104535
p04044
C++
#include "bits/stdc++.h" using namespace std; int main() { long long int n,t,i,l; cin>>n>>t; string s; vector <string> vt; for(i=0;i<n;i++) { cin>>s; v.push_back(s); } sort(v.begin(),v.end()); for(i=0;i<n;i++) { cout<<v[i]; } return 0; }
a.cc: In function 'int main()': a.cc:12:5: error: 'v' was not declared in this scope; did you mean 'vt'? 12 | v.push_back(s); | ^ | vt a.cc:14:8: error: 'v' was not declared in this scope; did you mean 'vt'? 14 | sort(v.begin(),v.end()); | ^ | vt
s290834487
p04044
Java
import java.util.*; public class Main { public static void main(String[] args){ Scanner scanner = new Scanner(System.in); int N = scanner.nextInt(); int L = scanner.nextInt(); String[] arrayOfWords = new String[N]; for(int i = 0; i < N; i++) { arrayOfWords[i] ...
Main.java:21: error: cannot find symbol System.out.println(answer); ^ symbol: variable answer location: class Main 1 error
s001096608
p04044
Java
import java.util.*; public class Main { public static void main(String[] args){ Scanner scanner = new Scanner(System.in); int N = scanner.nextInt(); int L = scanner.nextInt(); String[] arrayOfWords = new String[N]; for(int i = 0; i < N; i++) { arrayOfWords[i] ...
Main.java:21: error: cannot find symbol System.out.println(answer); ^ symbol: variable answer location: class Main 1 error
s740947263
p04044
Java
import java.util.*; public class Main { public static void main(String[] args){ Scanner scanner = new Scanner(System.in); int N = scanner.nextInt(); int L = scanner.nextInt(); for(int i = 0; i < N; i++) { String[] arrayOfWords = new String[N]; arrayOfWords[i]...
Main.java:14: error: cannot find symbol Arrays.sort(arrayOfWords); ^ symbol: variable arrayOfWords location: class Main Main.java:17: error: cannot find symbol String answer = arrayOfWords[i] + arrayOfWords[i + 1]; ^ symbol: variable arrayOfWords l...
s418555962
p04044
Java
import java.util.*; public class Main { public static void main(String[] args){ Scanner scanner = new Scanner(System.in); int N = scanner.nextInt(); int L = scanner.nextInt(); for(int i = 0; i < N; i++) { String[] arrayOfWords = new String[N]; arrayOfWords[i]...
Main.java:14: error: cannot find symbol Arrays.sort(arrayOfWords); ^ symbol: variable arrayOfWords location: class Main Main.java:16: error: cannot find symbol for(i = 0; i < N-1; i++) { ^ symbol: variable i location: class Main Main.java:16: error: cannot find sy...
s245709168
p04044
Java
import java.util.ArrayList; import java.util.Arrays; import java.util.Scanner; public class Main { public static void main(String[] args) throws Exception { Scanner sc = new Scanner(System.in); int num = sc.nextInt(); int length = sc.nextInt(); String[] str = new String[num]; for (int i = 0; i < num; i++) {...
Main.java:16: error: '.class' expected for(int i = 0;int<str.length;i++){ ^ 1 error
s012458946
p04044
Java
import java.util.ArrayList; import java.util.Arrays; import java.util.Scanner; public class Main { public static void main(String[] args) throws Exception { Scanner sc = new Scanner(System.in); int num = sc.nextInt(); int length = sc.nextInt(); String[] str = new String[num]; for (int i = 0; i < num; i++) {...
Main.java:16: error: '.class' expected for(int i = 0;int<str.length;i++){ ^ 1 error
s604401931
p04044
Java
import java.util.ArrayList; import java.util.Collections; import java.util.List; import java.util.Scanner; public class IrohaLoveaStrings { public static void main(String[] args) { Scanner sc = new Scanner(System.in); //入力 int N = sc.nextInt(); int L = sc.nextInt(); List<String> SArray = new ArrayList<Str...
Main.java:6: error: class IrohaLoveaStrings is public, should be declared in a file named IrohaLoveaStrings.java public class IrohaLoveaStrings { ^ 1 error
s057176608
p04044
C++
#include<stdio.h> char a[150][150]; int main() { int n,m; scanf("%d %d",&n,&m); char doo=getchar(); int i; for(i=0;i<n;i++) gets(a[i]); for(i=0;i<n;i++) { for(int j=i+1;j<n;j++) { if(a[i][0]>a[j][0]) { char b[150]; for(int g=0;g<m;g++) { b[g]=a[i][g]; a[i][g]=a[j][g]; a[j][g]=b...
a.cc: In function 'int main()': a.cc:10:9: error: 'gets' was not declared in this scope; did you mean 'getw'? 10 | gets(a[i]); | ^~~~ | getw
s975392019
p04044
C++
#include<stdio.h> #include<string.h> char a[150][150]; int main() { int n,m; scanf("%d %d",&n,&m); char doo=getchar(); int i; for(i=0;i<n;i++) gets(a[i]); for(i=0;i<n;i++) { for(int j=i+1;j<n;j++) { if(a[i][0]>a[j][0]) { char b[150]; for(int g=0;g<m;g++) { b[g]=a[i][g]; a[i][g]=a[j...
a.cc: In function 'int main()': a.cc:11:9: error: 'gets' was not declared in this scope; did you mean 'getw'? 11 | gets(a[i]); | ^~~~ | getw
s475803664
p04044
C++
#include<stdio.h> #include<string.h> char a[150][150]; int main() { int n,m; scanf("%d %d",&n,&m); char doo=getchar(); int i; for(i=0;i<n;i++) gets(a[i]); for(i=0;i<n;i++) { for(int j=i+1;j<n;j++) { if(a[i][0]>a[j][0]) { char b[150]; for(int g=0;g<m;g++) { b[g]=a[i][g]; a[i][g]=a[j...
a.cc: In function 'int main()': a.cc:11:9: error: 'gets' was not declared in this scope; did you mean 'getw'? 11 | gets(a[i]); | ^~~~ | getw
s883809091
p04044
C++
#include<stdio.h> #include<string.h> #include<algorithm> using namespace std; int main() { char a[110]={}; char b[110]={}; int n,l,j,i; while(~scanf("%d%d",&n,&l)){ getchar(); for(i=0;i<n;i++){ gets(a); b[i]=a[0]; }sort(b,b+n); for(i=0;i<n;i++){ printf("%c",b[i]); for(j=1;j<l;j++){ printf("x...
a.cc: In function 'int main()': a.cc:13:25: error: 'gets' was not declared in this scope; did you mean 'getw'? 13 | gets(a); | ^~~~ | getw
s726321350
p04044
C
#include<stdio.h> #include<string.h> #include<algorithm> using namespace std; int main() { char a[110]={}; char b[110]={}; int n,l,j,i; while(~scanf("%d%d",&n,&l)){ getchar(); for(i=0;i<n;i++){ gets(a); b[i]=a[0]; }sort(b,b+n); for(i=0;i<n;i++){ printf("%c",b[i]); for(j=1;j<l;j++){ printf("x...
main.c:3:9: fatal error: algorithm: No such file or directory 3 | #include<algorithm> | ^~~~~~~~~~~ compilation terminated.
s337327058
p04044
C++
#include<stdio.h> #include<string.h> #include<algorithm> using namespace std; int main() { char a[110]={}; char b[110]={}; int n,l,j,i; while(~scanf("%d%d",&n,&l)){ getchar(); for(i=0;i<n;i++){ gets(a); b[i]=a[0]; }sort(b,b+n); for(i=0;i<n;i++){ printf("%c",b[i]); for(j=1;j<l;j++){ printf("x...
a.cc: In function 'int main()': a.cc:13:25: error: 'gets' was not declared in this scope; did you mean 'getw'? 13 | gets(a); | ^~~~ | getw
s396264529
p04044
C
#include<stdio.h> #include<algorithm> using namespace std; int main() { char a[110]={}; char b[110]={}; int n,l,j,i; while(~scanf("%d%d",&n,&l)){ getchar(); for(i=0;i<n;i++){ gets(a); b[i]=a[0]; }sort(b,b+n); for(i=0;i<n;i++){ printf("%c",b[i]); for(j=1;j<l;j++){ printf("x"); } }printf(...
main.c:2:9: fatal error: algorithm: No such file or directory 2 | #include<algorithm> | ^~~~~~~~~~~ compilation terminated.
s517331642
p04044
C++
#include<stdio.h> #include<algorithm> using namespace std; int main() { char a[110]={}; char b[110]={}; int n,l,j,i; while(~scanf("%d%d",&n,&l)){ getchar(); for(i=0;i<n;i++){ gets(a); b[i]=a[0]; }sort(b,b+n); for(i=0;i<n;i++){ printf("%c",b[i]); for(j=1;j<l;j++){ printf("x"); } }printf(...
a.cc: In function 'int main()': a.cc:12:25: error: 'gets' was not declared in this scope; did you mean 'getw'? 12 | gets(a); | ^~~~ | getw
s793006642
p04044
C++
#include<iostream> #include<string> using namespace std; int main(){ int n,L; cin >> n >> L; const int N = n; string s[N]; for(int i = 0; i < N; ++i){ cin >> s[i]; for(int j = i; j > 0; --j){ if(s[j][0] > s[j-1][0]) break; string t = s[j]; s[j] = s[j-1]; s[j-1] = t; } ...
a.cc: In function 'int main()': a.cc:35:16: error: expected '}' at end of input 35 | cout << endl; | ^ a.cc:4:11: note: to match this '{' 4 | int main(){ | ^
s197613395
p04044
Java
import java.util.*; class Main{ public static void main(String[] args){ Scanner sc = new Scanner(System.in); int N = sc.nextInt(); int L = sc.nextInt(); Arraylist<String> S = new Arraylist<String>(); for(int i = 0;i < N;i++){ S.add(sc.next()); } Collections.sort(S); for(int a = ...
Main.java:8: error: cannot find symbol Arraylist<String> S = new Arraylist<String>(); ^ symbol: class Arraylist location: class Main Main.java:8: error: cannot find symbol Arraylist<String> S = new Arraylist<String>(); ^ symbol: class Arraylist location: class Main ...
s959516852
p04044
Java
import java.util.*; class Main{ public static void main(String[] args){ Scanner sc = new Scanner(System.in); int N = sc.nextInt(); int L = sc.nextInt(); Arraylist<String> S = new Arraylist<>(); for(int i = 0;i < N;i++){ S.add(sc.next()); } Collections.sort(S); for(int a = 0;a < ...
Main.java:8: error: cannot find symbol Arraylist<String> S = new Arraylist<>(); ^ symbol: class Arraylist location: class Main Main.java:8: error: cannot find symbol Arraylist<String> S = new Arraylist<>(); ^ symbol: class Arraylist location: class Main 2 errors
s713661578
p04044
Java
package ABC_B; import java.util.Arrays; import java.util.Scanner; public class IrohaLovesStrings { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int n = sc.nextInt(); int l = sc.nextInt(); String[] array = new String[n]; for(int i =0; i < n; i++) { array[i] = sc.next()...
Main.java:6: error: class IrohaLovesStrings is public, should be declared in a file named IrohaLovesStrings.java public class IrohaLovesStrings { ^ 1 error
s644168778
p04044
Java
mport java.util.*; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int n = sc.nextInt(); int l = sc.nextInt(); String[] a = new String[n]; for(int i = 0; i < n; i++) { a[i] = sc.next(); } Arrays.sort(a); for(int j = 0; j < n; j++) { System.out...
Main.java:1: error: class, interface, enum, or record expected mport java.util.*; ^ 1 error
s348488560
p04044
Java
mport java.util.*; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int n = sc.nextInt(); int l = sc.nextInt(); String[] a = new String[n]; for(int i = 0; i < n; i++) { a[i] = sc.next(); } Arrays.sort(a); for(int j = 0; j < n; j++) { System.out...
Main.java:1: error: class, interface, enum, or record expected mport java.util.*; ^ 1 error
s300106221
p04044
C++
#include <bits/stdc++.h> #include <iostream> #include <algorithm> using namespace std; int main() { int n,l; cin >> n >> l; vector<string> s(n); for(int i=0;i<n;i++){ cin >> s.at(i); } sort<s.begin(),s.end()); string t; for(int i=0;i<n;i++){ t += s.at(i); } cout << t << endl; return 0...
a.cc: In function 'int main()': a.cc:14:15: error: call to non-'constexpr' function 'std::vector<_Tp, _Alloc>::iterator std::vector<_Tp, _Alloc>::begin() [with _Tp = std::__cxx11::basic_string<char>; _Alloc = std::allocator<std::__cxx11::basic_string<char> >; iterator = std::vector<std::__cxx11::basic_string<char> >::i...
s238529834
p04044
C++
#include <bits/sdtc++.h> #include <iostream> #include <algorithm> using namespace std; int main() { int n,l; cin >> n >> l; vector<string> s(n); for(int i=0;i<n;i++){ cin >> s.at(i); } sort<s.begin(),s.end()); string t; for(int i=0;i<n;i++){ t += s.at(i); } cout << t << endl; return 0...
a.cc:1:10: fatal error: bits/sdtc++.h: No such file or directory 1 | #include <bits/sdtc++.h> | ^~~~~~~~~~~~~~~ compilation terminated.
s606837470
p04044
C++
#include <stdio.h> #include <stdlib.h> #include <string.h> int cmpstr(const void * a, const void * b){ const char *x = a, *y = b; return strcmp(x,y); } int main(){ int n, l; scanf("%d%d", &n, &l); char s[100][101]; //printf("%p %p\n", s, s[1]); scanf("%*c"); for (int i = 0; i < n; ++...
a.cc: In function 'int cmpstr(const void*, const void*)': a.cc:6:21: error: invalid conversion from 'const void*' to 'const char*' [-fpermissive] 6 | const char *x = a, *y = b; | ^ | | | const void* a.cc:6:29: error: invalid conversio...
s828592445
p04044
C
#include <stdio.h> #include <stdlib.h> #include <string.h> int cmpstr(const void*a,const void*b){ char *x = a,*y = b; return strcmp(x,y); // return 0; } int main(){ int n,l; char s[n][l+1] scanf("%d %d",&n,&l); for(int i = 0;i <= n;++i){ scanf("%s",s[i]); } //ordenar as strings qsort(s,n,sizeof(s[0]),...
main.c: In function 'cmpstr': main.c:8:20: warning: initialization discards 'const' qualifier from pointer target type [-Wdiscarded-qualifiers] 8 | char *x = a,*y = b; | ^ main.c:8:27: warning: initialization discards 'const' qualifier from pointer target type [-Wdiscarded-qualifie...
s796937152
p04044
C
#include <stdio.h> #include <stdlib.h> #include <string.h> int cmpstr(const void*a, const void*b){ return strcmp(x,y); } int main(){ int n, l, i; scanf("%d %d", &n, &l); char s[n][l+1]; for(i=0;i<n;i++){ scanf("%s\n", s[i]); } //ordenar str qsort(s, n, sizeof(s[0]), cmpstr); ...
main.c: In function 'cmpstr': main.c:6:19: error: 'x' undeclared (first use in this function) 6 | return strcmp(x,y); | ^ main.c:6:19: note: each undeclared identifier is reported only once for each function it appears in main.c:6:21: error: 'y' undeclared (first use in this function) ...
s264641910
p04044
C++
#include <stdio.h> #include <stdlib.h> #include <string.h> int cmpstr(const void * a, const void * b){ //const char * x = a, *y = b; return strcmp(a, b); } int main(){ int l, n; scanf("%d%d", &n, &l); char s[n][l+1]; for (int i = 0; i < n; ++i) scanf("%s", s[i]); qsort(s, n, sizeof(s[0]), cmpstr)...
a.cc: In function 'int cmpstr(const void*, const void*)': a.cc:7:17: error: invalid conversion from 'const void*' to 'const char*' [-fpermissive] 7 | return strcmp(a, b); | ^ | | | const void* In file included from a.cc:3: /usr/include/string.h:156...
s040454530
p04044
C++
#include <stdio.h> #include <string.h> #include <stdlib.h> int cmp(const void *a, const void *b){ const char* x = a; const char* y = b; return strcmp(x, y); } int main(){ int x, y; scanf("%d %d", &x, &y); char nome[x][y+1]; for(int i = 0; i < x; ++i){ scanf(" %s", nome[i]); }...
a.cc: In function 'int cmp(const void*, const void*)': a.cc:7:21: error: invalid conversion from 'const void*' to 'const char*' [-fpermissive] 7 | const char* x = a; | ^ | | | const void* a.cc:8:21: error: invalid conversion from 'con...
s451362316
p04044
C++
#include <stdio.h> #include <stdlib.h> #include <string.h> int compare(const void * a, const void * b) { return strcmp(a, b); } int main() { int n, l; scanf("%d %d", &n, &l); char str[n][l+1]; for (int i=0; i<n; ++i) scanf("%s", str[i]); qsort(str, n, sizeof(str[0]), compare); for ...
a.cc: In function 'int compare(const void*, const void*)': a.cc:6:17: error: invalid conversion from 'const void*' to 'const char*' [-fpermissive] 6 | return strcmp(a, b); | ^ | | | const void* In file included from a.cc:3: /usr/include/string.h:15...
s384335592
p04044
C++
#include <stdio.h> #include <stdlib.h> #include <string.h> int compare(const void * a, const void * b) { const char *x = a, *y = b; return strcmp(a, b); } int main() { int n, l; scanf("%d %d", &n, &l); char str[n][l+1]; for (int i=0; i<n; ++i) scanf("%s", str[i]); qsort(str, n, size...
a.cc: In function 'int compare(const void*, const void*)': a.cc:6:21: error: invalid conversion from 'const void*' to 'const char*' [-fpermissive] 6 | const char *x = a, *y = b; | ^ | | | const void* a.cc:6:29: error: invalid conversi...
s416748363
p04044
C++
#include <stdio.h> #include <stdlib.h> #include <math.h> #include <string.h> int ord(const void* x, const void* y){ const char *a = x, *b=y; if(a>b) return -1; if(a<b) return 1; return 0; } int main(){ int n,m; char nome[101][101]; scanf("%d %d",&n,&m...
a.cc: In function 'int ord(const void*, const void*)': a.cc:7:25: error: invalid conversion from 'const void*' to 'const char*' [-fpermissive] 7 | const char *a = x, *b=y; | ^ | | | const void* a.cc:7:31: error: invali...
s601488278
p04044
C++
#include <bits/stdc++.h> using namespace std; #define rep(i,n) for(int (i) = 0; (i) < (n); ++(i)) #define rrep(i,n) for(int (i) = (n) - 1; (i) >= 0; --(i)) //Reversi rep #define nfor(i,a,b) for(int (i) = (a); (i) < (b); ++(i)) //Natural for #define rfor(i,a,b) for(int (i) = (b); (i) >= (a); --(i)) //Reversi for #define...
a.cc: In function 'int main()': a.cc:26:22: error: expected initializer before '.' token 26 | vector <string> s.at(n); | ^ a.cc:27:10: error: 's' was not declared in this scope 27 | sort(s.begin(), s.end()); | ^
s250667881
p04044
C++
#include <bits/stdc++.h> using namespace std; int main(){ int n,l; std::cin >>n>>l ; std::vector<string> s; for(int i = 0; i < (int)(n); i++)std::cin >> s[i]; sort(s.begin(),x.end()); for(int i = 0; i < (int)(n); i++)std::cout << s[i]; std::cout << std::endl; }
a.cc: In function 'int main()': a.cc:10:24: error: 'x' was not declared in this scope 10 | sort(s.begin(),x.end()); | ^
s927594469
p04044
C++
#include<iostream> #include<vector> using namespace std; int main() { int N,L; vector<string> s; std::cin >> N >>L; for(int i = 0;i < N;i++)std::cin >> s[i]; std::sort(s.begin(),s.end()); for(int i = 0;i < N;i++)std::cout << s[i]; std::cout << endl; return 0; }
a.cc: In function 'int main()': a.cc:11:10: error: 'sort' is not a member of 'std'; did you mean 'qsort'? 11 | std::sort(s.begin(),s.end()); | ^~~~ | qsort
s454672898
p04044
C++
#include<iostream> #include<vector> using namespace std; int main() { int N,L; vector<string> s; std::cin >> N >>L; for(int i = 0;i < N;i++)std::cin >> s[i]; sort(s.begin(),s.end()); for(int i = 0;i < N;i++)std::cout << s[i]; std::cout << 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(s.begin(),s.end()); | ^~~~ | short
s493355052
p04044
C++
#include<iostream> #include<vector> using namespace std; int main() { int N,L; vector<string> s; cin >> N >>L; for(int i = 0;i < N;i++)cin >> s[i]; sort(s.begin(),s.end()); for(int i = 0;i < N;i++)cout << s[i]; cout << 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(s.begin(),s.end()); | ^~~~ | short
s177668720
p04044
C++
#include<iostream> #include<string> int main( int argc, char** argv ) { int N, L; std::cin >> N; std::cin >> L; std::vector< std::string > s( L ); for( int i = 0; i < L; ++i ) { std::cin >> s[ i ]; } std::sort( s.begin(), s.end() ); for( int i = 0; i < L; ++i ) { std::cout << s[ i ]; ...
a.cc: In function 'int main(int, char**)': a.cc:11:8: error: 'vector' is not a member of 'std' 11 | std::vector< std::string > s( L ); | ^~~~~~ a.cc:2:1: note: 'std::vector' is defined in header '<vector>'; this is probably fixable by adding '#include <vector>' 1 | #include<iostream> +++ |+#incl...
s768145630
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(); ArrayList<String> stateList = new ArrayList<String>(); for(int i=0; i<n; i++){ stateList.add(sc.next()); } Collections.sort(stateList); for(i=0;i<n...
Main.java:12: error: cannot find symbol for(i=0;i<n; i++){ ^ symbol: variable i location: class Main Main.java:12: error: cannot find symbol for(i=0;i<n; i++){ ^ symbol: variable i location: class Main Main.java:12: error: cannot find symbol for(i=0;i<n; i++){ ^ symbol: va...
s863590588
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(); ArrayList<String> stateList = new ArrayList<String>(); for(int i=0; i<n; i++){ stateList.add(sc.next()); } Collections.sort(stateList); for(i=0;i<n...
Main.java:12: error: ';' expected for(i=0;i<n i++){ ^ 1 error
s457150108
p04044
C++
#include <bits/stdc++.h> using namespace std; #define rep(i, n) for (int i = 0; i < (int)(n); i++) #define rep2(i, s, n) for (int i = (s); i < (int)(n); i++) typedef long long ll; int main() { int N, L; cin >> N >> L; vector<string> S(N); for (int i = 0; i < N; i++){ cin >> S[i]; } sort...
a.cc: In function 'int main()': a.cc:10:24: error: expected ',' or ';' before '\U0000ff1b' 10 | vector<string> S(N); | ^~ a.cc:11:21: error: 'i' was not declared in this scope 11 | for (int i = 0; i < N; i++){ | ^
s923369832
p04044
C++
#include <bits/stdc++.h> using namespace std; #define rep(i, n) for (int i = 0; i < (int)(n); i++) #define rep2(i, s, n) for (int i = (s); i < (int)(n); i++) typedef long long ll; int main() { int N, L; cin >> N >> L; vector<string> S(N) for (int i = 0; i < N; i++){ cin >> S[i]; } sort(...
a.cc: In function 'int main()': a.cc:11:5: error: expected ',' or ';' before 'for' 11 | for (int i = 0; i < N; i++){ | ^~~ a.cc:11:21: error: 'i' was not declared in this scope 11 | for (int i = 0; i < N; i++){ | ^
s996191515
p04044
C++
#include <bits/stdc++.h> using namespace std; int main(){ int N,L; cin >>N >> L ; vector<string> S(N); for(int i= 0;i < N;i++){ cin >> S[i]; } sort(S.begin(),S.end()); for(int i = 0;i < N;i++){ cout << S[i] ; if(i = N-1) cout << <<endl; } }
a.cc: In function 'int main()': a.cc:14:30: error: expected primary-expression before '<<' token 14 | if(i = N-1) cout << <<endl; | ^~
s315861405
p04044
C++
#include<iostream> #include<string> #include<algorithm> #include<cmath> using namespace std; #define INF 1e9 #define rep(i, n) for(int i = 0; i < n; i++) #define sortI(a, b, c) c == 0 ? sort(a, a + b) : sort(a, a + b, greater<int>()) int digit(int n){ int res = 0; while(n > 0){ res += n%10; n /= 10; } ...
a.cc: In function 'int main()': a.cc:31:10: error: request for member 'begin' in 'S', which is of non-class type 'std::string [N]' {aka 'std::__cxx11::basic_string<char> [N]'} 31 | sort(S.begin(), S.end()); | ^~~~~ a.cc:31:21: error: request for member 'end' in 'S', which is of non-class type 'std::...
s465885725
p04044
C++
#include<iostream> #include<string> #include<algorithm> #include<cmath> using namespace std; #define INF 1e9 #define rep(i, n) for(int i = 0; i < n; i++) #define sortI(a, b, c) c == 0 ? sort(a, a + b) : sort(a, a + b, greater<int>()) int digit(int n){ int res = 0; while(n > 0){ res += n%10; n /= 10; } ...
a.cc: In function 'int main()': a.cc:31:13: error: request for member 'size' in 'S', which is of non-class type 'std::string [N]' {aka 'std::__cxx11::basic_string<char> [N]'} 31 | sort(S, S.size()); | ^~~~
s018803372
p04044
C++
#include<iostream> #include<algorithm> #include<vector> #include<string> using namespace std; int main(){ int n,l; cin>>n>>l; vactor<string> s(n); for(int i=0;i<n;i++)cin>>s[i]; sort(s.begin(),s.end()); for(int i=0;i<n;i++)cout<<s[i]; cout<<endl; return 0; }
a.cc: In function 'int main()': a.cc:9:3: error: 'vactor' was not declared in this scope 9 | vactor<string> s(n); | ^~~~~~ a.cc:9:16: error: expected primary-expression before '>' token 9 | vactor<string> s(n); | ^ a.cc:9:18: error: 's' was not declared in this scope 9 | v...
s596849332
p04044
C++
#include<iostream> #include<vector> using namespace std; int main(){ int N, L; cin >> N >> L; vector<string> S(N); string str, result; for(int i = 0; i < N; i++){ cin >> S[i]; } sort(S.begin(), S.end()); for(int i = 0; i < N; i++){ result+=S[i]; } cout << result <...
a.cc: In function 'int main()': a.cc:12:5: error: 'sort' was not declared in this scope; did you mean 'short'? 12 | sort(S.begin(), S.end()); | ^~~~ | short
s737349125
p04044
C++
#include <bits/stdc++.h> using namespace std; int main(){ int N,L; cin >> N >> L; vector<string> S(N); for(int i=0;i<N;i++){ cin >> S.at(i); } sort(S.bigin(),S.end()); for(int i=0;i<N,i++){ cout << S.at(i) ; } }
a.cc: In function 'int main()': a.cc:13:10: error: 'class std::vector<std::__cxx11::basic_string<char> >' has no member named 'bigin'; did you mean 'begin'? 13 | sort(S.bigin(),S.end()); | ^~~~~ | begin a.cc:15:22: error: expected ';' before ')' token 15 | for(int i=0;i<N,i++){ ...
s563606785
p04044
C++
#include<bits/stdc++.h> using namespace std; signed main(){ string a[109000],d; int b,c; cin>>b>>c; for(int i=0;i<b;i++){ cin>>a[i]; } for(int i=0;i<b;i++){ d=a[i]; for(int j=i+1;j<b;j++){ if(d>a[j]) d=a[j]; } cout<<d; } cout>>"\n"; }
a.cc: In function 'int main()': a.cc:17:7: error: no match for 'operator>>' (operand types are 'std::ostream' {aka 'std::basic_ostream<char>'} and 'const char [2]') 17 | cout>>"\n"; | ~~~~^~~~~~ | | | | | const char [2] | std::ostream {aka std::basic_ostream<char>} In file i...
s625972366
p04044
C++
#include<bits/stdc++.h> using namespace std; signed main(){ string a[109000],d; int b,c; cin>>b>>c; for(int i=0;i<b;i++){ cin>>a[i]; } for(int i=0;i<b;i++){ d=a[i]; for(int j=i+1;j<b;j++){ if(d>a[j]) d=a[j]; } cout<<d; }
a.cc: In function 'int main()': a.cc:16:4: error: expected '}' at end of input 16 | } | ^ a.cc:3:14: note: to match this '{' 3 | signed main(){ | ^
s741374892
p04044
C++
#include<bits/stdc++.h> using namespace std; signed main(){ string a[109000],d; int b,c; cin>>b>>c; for(int i=0;i<b;i++){ cin>>a[i]; } for(int i=0;i<a;i++){ d=a[i]; for(int j=i+1;j<a;j++){ if(d>a[j]) d=a[j]; } cout<<d; }
a.cc: In function 'int main()': a.cc:10:16: error: ISO C++ forbids comparison between pointer and integer [-fpermissive] 10 | for(int i=0;i<a;i++){ | ~^~ a.cc:12:20: error: ISO C++ forbids comparison between pointer and integer [-fpermissive] 12 | for(int j=i+1;j<a;j++){ | ...
s644270176
p04044
C++
#include<bits/stdc++.h> using namespace std; signed main(){ string a[109000],b; int b,c; cin>>b>>c; for(int i=0;i<b;i++){ cin>>a[i]; } for(int i=0;i<a;i++){ b=a[i]; for(int j=i+1;j<a;j++){ if(b>a[j]) b=a[j]; } cout<<b; } cout<<"\n"; }
a.cc: In function 'int main()': a.cc:5:7: error: conflicting declaration 'int b' 5 | int b,c; | ^ a.cc:4:20: note: previous declaration as 'std::string b' 4 | string a[109000],b; | ^ a.cc:7:16: error: no match for 'operator<' (operand types are 'int' and 'std::string' {a...
s144153130
p04044
C++
#include <iostream> #include <string> #include <vector> using namespace std; //小さい文字列を返す関数 string compare_str(string a, string b){ int len_a = a.length(); int len_b = b.length(); //(ありえないが)長さが違う場合 if(len_a != len_b){ if(len_a > len_b){ return b; }else{ return a;...
a.cc: In function 'int main()': a.cc:42:5: error: 'sort' was not declared in this scope; did you mean 'short'? 42 | sort(vec.begin(),vec.end()); | ^~~~ | short
s427836703
p04044
C++
#include <iostream> #include <string> 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); string t; for(int i = 0; i < n; ++i) t += s[i]; cout << t << endl; }
a.cc: In function 'int main()': a.cc:11:5: error: 'sort' was not declared in this scope; did you mean 'short'? 11 | sort(s, s + n); | ^~~~ | short
s520800182
p04044
C++
#include <bits/stdc++.h> #define rep(i,n) for(int i = 0;i < (n); ++i) using namespace std; int main(){ int n , l ; cin >> n >> l; vector<string> str(n); rep(i,n)cin >> str[i]; sort(str.begin(),str.end()); string ans; rep(i,n)ans += str[i]; cout << str; return 0; }
a.cc: In function 'int main()': a.cc:18:8: error: no match for 'operator<<' (operand types are 'std::ostream' {aka 'std::basic_ostream<char>'} and 'std::vector<std::__cxx11::basic_string<char> >') 18 | cout << str; | ~~~~ ^~ ~~~ | | | | | std::vector<std::__cxx11::basic_string<c...
s057769444
p04044
C++
#include<iostream> #include<vector> using namespace std; int main () { int N, L; cin >> N >> L; vector<string> S(N); for (int i = 0; i < N; i++) { cin >> S.at(i); } sort(S.begin(), S.end()); string result = ""; for (int i = 0; i < N; i++) { result += S.at(i); } ...
a.cc: In function 'int main()': a.cc:15:5: error: 'sort' was not declared in this scope; did you mean 'short'? 15 | sort(S.begin(), S.end()); | ^~~~ | short
s111575200
p04044
C++
#include <bits/stdc++.h> using namespace std; int ctoi(char c) { if (c >= '0' && c <= '9') { return c - '0'; } return 0; } int main() { int n,l; cin>>n>>l; vector<string> s(n); for(int i=0;i<n;i++){ cin>>s.at(i); } sort(s.begin(),a.end()); for(int i=0;i<n;i++){ cout<<s.at(i); } }
a.cc: In function 'int main()': a.cc:16:18: error: 'a' was not declared in this scope 16 | sort(s.begin(),a.end()); | ^
s931194352
p04044
C++
#include <iostream> using namespace std; int main(){ string a[101]; long long n,i,l; cin>>n>>l; for(i=0;i<n;i++) cin>>a[i]; sort(a,a+n); for(i=0;i<n;i++) cout<<a[i]; return 0; }
a.cc: In function 'int main()': a.cc:9:5: error: 'sort' was not declared in this scope; did you mean 'short'? 9 | sort(a,a+n); | ^~~~ | short
s628303491
p04044
C++
// luogu-judger-enable-o2 #include<iostream> #include<cstdio> #include<algorithm> using namespace std; int main() { string a[100],n,i; scanf("%d%*d",&n); for(int i=0;i<n;i++) cin>>a[i]; sort(a,a+n); for(int i=0;i<n;i++) cout<<a[i]; return 0; }
a.cc: In function 'int main()': a.cc:10:18: error: no match for 'operator<' (operand types are 'int' and 'std::string' {aka 'std::__cxx11::basic_string<char>'}) 10 | for(int i=0;i<n;i++) | ~^~ | | | | | std::string {aka std::__cxx11::basic_string<...
s503243091
p04044
C++
#include<iostream> #include<string.h> #include<algorithm> bool fun(string a, string b){ return a+b<b+a; } using name space std; int main(){ int n,l; cin>>n>>l; string a[n]; for(int i=0;i<n;i++){ cin>>a[i]; } sort(a,a+n,fun); for(int i=0;i<n;i++){ cout<<a[i]; } return 0; }
a.cc:4:10: error: 'string' was not declared in this scope 4 | bool fun(string a, string b){ | ^~~~~~ a.cc:4:10: 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, ...
s011646767
p04044
C++
#include<iostream> #include<string> #include<algorithm> bool fun(string a, string b){ return a+b<b+a; } using name space std; int main(){ int n,l; cin>>n>>l; string a[n]; for(int i=0;i<n;i++){ cin>>a[i]; } sort(a,a+n,fun); for(int i=0;i<n;i++){ cout<<a[i]; } return 0; }
a.cc:4:10: error: 'string' was not declared in this scope 4 | bool fun(string a, string b){ | ^~~~~~ a.cc:4:10: 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, ...
s008597929
p04044
C++
#include<iostream> #include<string> #include<algorithm> using name space std; int main(){ int n,l; cin>>n>>l; string a[n]; for(int i=0;i<n;i++){ cin>>a[i]; } sort(a,a+n); for(int i=0;i<n;i++){ cout<<a[i]; } return 0; }
a.cc:4:7: error: expected nested-name-specifier before 'name' 4 | using name space std; | ^~~~ a.cc: In function 'int main()': a.cc:7:3: error: 'cin' was not declared in this scope; did you mean 'std::cin'? 7 | cin>>n>>l; | ^~~ | std::cin In file included from a.cc:1: /usr/include/...
s253709312
p04044
C++
#include <bits/stdc++.h> using namespace std; int main() { int n,l; cin>>n>>l; string s[n-1]; for(int i=0;i<n;i++){ cin>>s[i]; } sort(s.begin(),s.end()); for(i=0;i<n;i++){ cout<<s[i]; } return 0; }
a.cc: In function 'int main()': a.cc:11:12: error: request for member 'begin' in 's', which is of non-class type 'std::string [(n + -1)]' {aka 'std::__cxx11::basic_string<char> [(n + -1)]'} 11 | sort(s.begin(),s.end()); | ^~~~~ a.cc:11:22: error: request for member 'end' in 's', which is of non-...
s865099571
p04044
C++
#include<iostream> #include<vector> #include<string> using namespace 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()); for(int i=0;i<n;i++){ cout << s[i]; } cout << endl; return 0; }
a.cc: In function 'int main()': a.cc:13:5: error: 'sort' was not declared in this scope; did you mean 'short'? 13 | sort(s.begin(),s.end()); | ^~~~ | short
s459615976
p04044
C++
#include <bits/stdc++.h> using namespace std; int main(){ int N; cin >> N >> L; vector<string> vec(N); for(int i=0 ; i<N ; i++){ cin >> vec.at(i); } sort(vec.begin(), vec.end()); string ans = ""; for(int j=0; j <N ; j++){ ans += vec.at(j); } cout << ans << endl; return 0; }
a.cc: In function 'int main()': a.cc:6:15: error: 'L' was not declared in this scope 6 | cin >> N >> L; | ^
s215671834
p04044
C++
#include <bits/stdc++.h> using namespace std; int main{ int n,l; vector<string> vs; string tmp, result; cin >> n,l; for(int i=0;i<n;i++){ cin >> tmp; vs.push_back(tmp); } sort(vs.begin(),vs.end()); for(i=0;i<vs.size();i++){ result = result + vs(i); } cout << result << endl; return 0; ...
a.cc:4:5: error: cannot declare '::main' to be a global variable 4 | int main{ | ^~~~ a.cc:5:3: error: expected primary-expression before 'int' 5 | int n,l; | ^~~ a.cc:5:3: error: expected '}' before 'int' a.cc:4:9: note: to match this '{' 4 | int main{ | ^ a.cc:8:3: error:...
s826520355
p04044
C++
#include <bits/stdc++.h> using namespace std; int main() { int N, M; cin>>N>>M; vector<vector<char>> a(N,vector<char>(M)); for(int i=0;i<N;i++){ for(int j=0;j<M;j++){ cin>>a[i][j]; } } sort(a.begin,a.end); for(int i=0;i<N;i++){ for(int j=0;j<M;j++){ cout<<a[i][j]; } ...
a.cc: In function 'int main()': a.cc:15:9: error: no matching function for call to 'sort(<unresolved overloaded function type>, <unresolved overloaded function type>)' 15 | sort(a.begin,a.end); | ~~~~^~~~~~~~~~~~~~~ In file included from /usr/include/c++/14/algorithm:61, from /usr/incl...
s679383605
p04044
C++
#include <bits/stdc++.h> using namespace std; int main() { int N, M; cin>>N>>M; vector<vector<char>> a(N,vector<char>(M)); for(int i=0;i<N;i++){ for(int j=0;j<M;j++){ cin>>[i][j]; } } sort(a.begin,a.end); for(int i=0;i<N;i++){ for(int j=0;j<M;j++){ cout<<a[i][j]; } ...
a.cc: In lambda function: a.cc:10:15: error: expected '{' before '[' token 10 | cin>>[i][j]; | ^ a.cc: In function 'int main()': a.cc:10:15: error: no match for 'operator[]' (operand types are 'main()::<lambda()>' and 'int') a.cc:15:9: error: no matching function for call to 'sort(<unresolv...
s969975737
p04044
C++
#include <bits/stdc++.h> using namespace std; int main() { int N, M; cin>>N>>M; vector<vector<char>> a(N,vector<char>(M)); for(int i=0;i<N;i++){ for(int j=0;j<M;j++){ cin[i][j]; } } sort(a.begin,a.end); for(int i=0;i<N;i++){ for(int j=0;j<M;j++){ cout<<a[i][j]; } }...
a.cc: In function 'int main()': a.cc:10:10: error: no match for 'operator[]' (operand types are 'std::istream' {aka 'std::basic_istream<char>'} and 'int') 10 | cin[i][j]; | ^ a.cc:15:9: error: no matching function for call to 'sort(<unresolved overloaded function type>, <unresolved overloaded fu...
s461685311
p04044
C++
#include <bits/stdc++.h> using namespace std; int main() { int N, M; cin>>N>>M; vector<vector<char>> a(N,vector<char>(M)); for(int i=0;i<N;i++){ for(int j=0;j<M;j++){ cin[i][j]; } } for(int i=0;i<N;i++){ sort(a.at(i).begin,a.at(i).end); } sort(a.begin,a.end); for(int i=0;i<N;i++...
a.cc: In function 'int main()': a.cc:10:10: error: no match for 'operator[]' (operand types are 'std::istream' {aka 'std::basic_istream<char>'} and 'int') 10 | cin[i][j]; | ^ a.cc:14:9: error: no matching function for call to 'sort(<unresolved overloaded function type>, <unresolved overloaded fu...
s761485765
p04044
C++
#include<iostream> #include<algorithm> using namespace std; #define F(i,N) for(int i=0;i<N;i++) int main(){ cin.tie(0); ios::sync_with_stdio(false); int N, L; cin >> N >> L; string S[100]; F(i,N) cin >> S[i]; sort(S, S+N); F(i,N) cout >> S[i]; }
a.cc: In function 'int main()': a.cc:11:17: error: no match for 'operator>>' (operand types are 'std::ostream' {aka 'std::basic_ostream<char>'} and 'std::string' {aka 'std::__cxx11::basic_string<char>'}) 11 | F(i,N) cout >> S[i]; | ~~~~ ^~ ~~~~ | | | | ...
s147327454
p04044
C++
#include<iostream> #include<algorithm> using namespace std; #define F(i,N) for(int i=0;i<N;i++) int main(){ cin.tie(0); ios::sync_with_stdio(false); int N, L; cin >> N >> L; string S[N]; F(i,N) cin >> S[i]; sort(S, S+N); F(i,N) cout >> S[i]; }
a.cc: In function 'int main()': a.cc:11:17: error: no match for 'operator>>' (operand types are 'std::ostream' {aka 'std::basic_ostream<char>'} and 'std::string' {aka 'std::__cxx11::basic_string<char>'}) 11 | F(i,N) cout >> S[i]; | ~~~~ ^~ ~~~~ | | | | ...
s315114573
p04044
C++
#include<iostream> #include<algorithm> using namespace std; #define F(i,N) for(int i=0;i<N;i++) int main(){ cin.tie(0); ios::sync_with_stdio(false); int N, L; cin >> N >> L; vstring S[n]; F(i,N) cin >> S[i]; sort(S, S+N); F(i,N) cout >> S[i]; }
a.cc: In function 'int main()': a.cc:9:5: error: 'vstring' was not declared in this scope 9 | vstring S[n]; F(i,N) cin >> S[i]; | ^~~~~~~ a.cc:9:33: error: 'S' was not declared in this scope 9 | vstring S[n]; F(i,N) cin >> S[i]; | ^ a.cc:10:10: error: 'S' ...
s351877045
p04044
C++
#include<iostream> using namespace std; #define F(i,N) for(int i=0;i<N;i++) int main(){ cin.tie(0); ios::sync_with_stdio(false); int N, L; cin >> N >> L; vector<string> S(N); F(i,N) cin >> S[i]; sort(S, S+N); F(i,N) cout >> S[i]; }
a.cc: In function 'int main()': a.cc:8:5: error: 'vector' was not declared in this scope 8 | vector<string> S(N); F(i,N) cin >> S[i]; | ^~~~~~ a.cc:2:1: note: 'std::vector' is defined in header '<vector>'; this is probably fixable by adding '#include <vector>' 1 | #include<iostream> +++ |+#inclu...
s408450292
p04044
C++
#include<iostream> using namespace std; #define for(int i=0;i<N;i++) F(i,N) int main(){ cin.tie(0); ios::sync_with_stdio(false); int N, L; cin >> N >> L; vector<string> S(N); F(i,N) cin >> S[i]; sort(S, S+N); F(i,N) cout >> S[i]; }
a.cc:3:17: error: expected ',' or ')', found "i" 3 | #define for(int i=0;i<N;i++) F(i,N) | ^ a.cc: In function 'int main()': a.cc:8:5: error: 'vector' was not declared in this scope 8 | vector<string> S(N); F(i,N) cin >> S[i]; | ^~~~~~ a.cc:2:1: note: 'std::vector' is defined...
s825441796
p04044
C++
#include <bits/stdc++.h> using namespace std; int main() { //freopen("input1.txt","r",stdin);freopen("output1.txt","w",stdout); int i,j,k,n,l; cin>>n>>l; char a[n][l],b[l]; for (i=0;i<n;i++){ cin>>b; for (j=0;j<l;j++){ a[i][j]=b[j]; } } for (i=0;i<n-1;i++){ for (j=0;j<n-1-i;j...
a.cc:36:25: error: 'k' does not name a type 36 | } k | ^
s730716548
p04044
C++
#include <iostream> #include <string> #include <sstream> using namespace std; int main(){ // cout int n, l; // string s; cin >> n >> l; vector<string> strlist(n); // vector<int> numlist(n); // vector<pair<vector<string>, vector<int>>> pair s for(i=0;i<n;i++){ cin >> strlist[i]; } sort(strlist); string gattai=""; fo...
a.cc: In function 'int main()': a.cc:12:1: error: 'vector' was not declared in this scope 12 | vector<string> strlist(n); | ^~~~~~ a.cc:4:1: note: 'std::vector' is defined in header '<vector>'; this is probably fixable by adding '#include <vector>' 3 | #include <sstream> +++ |+#include <vector> 4 | u...
s018467862
p04044
C++
n,l=map(int,input().split()) s=sorted([input() for i in range(n)]) print(*n,sep='')
a.cc:3:14: error: empty character constant 3 | print(*n,sep='') | ^~ a.cc:1:1: error: 'n' does not name a type 1 | n,l=map(int,input().split()) | ^
s681590788
p04044
C++
n,l=map(int,input().split()) s=sorted([input() for i in range(n)]) print(*n,sep'')
a.cc:3:13: error: empty character constant 3 | print(*n,sep'') | ^~ a.cc:1:1: error: 'n' does not name a type 1 | n,l=map(int,input().split()) | ^
s456290877
p04044
C++
#include<bits/stdc++.h> using namespace std; string a[10002]; int n,i; int main() { cin>>n; for(i=1;i<=n;i++) cin>>a[i]; sort(a+,a+n+1); for(i=1;i<=n;i++) cout<<a[i]; return 0; }
a.cc: In function 'int main()': a.cc:10:12: error: expected primary-expression before ',' token 10 | sort(a+,a+n+1); | ^
s435888240
p04044
C++
#include <bits/stdc++.h> using namespace std; int main() { int n, l; cin >> n >> l; vector<srting> s(n); for(int i = 0; i < n; i++) { cin >> s.at(i); } sort(s.begin(), s.end()); for(int i = 0; i < n; i++) { cout << s.at(i); } cout << endl; }
a.cc: In function 'int main()': a.cc:8:10: error: 'srting' was not declared in this scope 8 | vector<srting> s(n); | ^~~~~~ a.cc:8:16: error: template argument 1 is invalid 8 | vector<srting> s(n); | ^ a.cc:8:16: error: template argument 2 is invalid a.cc:11:18: error: re...
s345675608
p04044
C++
#include <iostream> #include<vector> #include <algorithm> #include <math.h> #include <string> #include <stdexcept> using namespace std; int main(void) { int N, L; cin >> N>>L; vector<string> data(N); vector<vector<char>> data(N, vector<char>(L)); for (int i = 0; i < N; i++) { cin >> data[i]; } sort(da...
a.cc: In function 'int main()': a.cc:13:30: error: conflicting declaration 'std::vector<std::vector<char> > data' 13 | vector<vector<char>> data(N, vector<char>(L)); | ^~~~ a.cc:12:24: note: previous declaration as 'std::vector<std::__cxx11::basic_string<char> > data' 12...
s005075311
p04044
C++
#include <iostream> #include<vector> #include <algorithm> #include <math.h> #include <string> #include <stdexcept> using namespace std; int main(void) { int N, L; cin >> N>>L; vector<string> data(N); vector<vector<char>> data(N, vector<char>(L)); for (int i = 0; i < N; i++) { cin >> data[i]; } sort(d...
a.cc: In function 'int main()': a.cc:14:30: error: conflicting declaration 'std::vector<std::vector<char> > data' 14 | vector<vector<char>> data(N, vector<char>(L)); | ^~~~ a.cc:13:24: note: previous declaration as 'std::vector<std::__cxx11::basic_string<char> > data' 13...
s441922305
p04044
C++
#include <bits/stdc++.h> using namespace std; int main(){ int n, l; cin >> n >> l; vector<string> s(n); for(int i = 0; i < n; i++) cin >> s[i]; sort(s.begin(), s.end()); for(int i = 0; i < n; i+=) cout << s[i]; cout << endl; return 0; }
a.cc: In function 'int main()': a.cc:8:28: error: expected primary-expression before ')' token 8 | for(int i = 0; i < n; i+=) cout << s[i]; | ^
s974923075
p04044
C++
#include <iostream> #include <string> #include <algorithm> using namespace std; int main() { int n,l; cin >> n >> l; vector<string> vec(n); for(int i=0;i<n;i++) { string tmp; cin >> tmp; vec[i] = tmp; } sort(begin(vec),end(vec)); for(int i=0;i<n;i++) { ...
a.cc: In function 'int main()': a.cc:9:5: error: 'vector' was not declared in this scope 9 | vector<string> vec(n); | ^~~~~~ a.cc:4:1: note: 'std::vector' is defined in header '<vector>'; this is probably fixable by adding '#include <vector>' 3 | #include <algorithm> +++ |+#include <vector> ...
s967666567
p04044
C++
#include<iostream> #include<cstdio> #include<string> #include<cstring> #include<algorithm> using namespace std; int main() { int n;string s[101] cin>>n; for(int i=1;i<=n;i++)cin>>s[i]; sort(s+1,s+n+1); for(int i=1;i<=n;i++)cout<<s[i]; }
a.cc: In function 'int main()': a.cc:11:9: error: expected initializer before 'cin' 11 | cin>>n; | ^~~ a.cc:12:35: error: 's' was not declared in this scope 12 | for(int i=1;i<=n;i++)cin>>s[i]; | ^ a.cc:13:14: error: 's' was not declared in thi...
s585912798
p04044
Java
import java.util.Scanner; import java.util.Arrays; public class Main{ public static void main(String args[]){ Scanner sc = new Scanner(System.in); int n, l; String ary[] = new String[n]; n = sc.nextInt(); l = sc.nextInt(); for(int i=0; i<n; i++){ ...
Main.java:11: error: variable n might not have been initialized String ary[] = new String[n]; ^ 1 error
s446403611
p04044
Java
import java.util.Scanner; import java.util.Arrays; public class Main{ public static void main(String args[]){ Scanner sc = new Scanner(System.in); int n, l; String ary[] = new String[n]; n = sc.nextInt(); l = sc.nextInt(); for(int i=0; i<n; i++){ ...
Main.java:24: error: cannot find symbol answer += ary[i]; ^ symbol: variable i location: class Main 1 error