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::string' {aka 'std::__cxx11::basic_string<char>'} requested
11 | string ans ='';
| ^~
|
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 | for(int i=0;i<n;i++) cout << s(i);
| ~^~~
|
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 for member 'at' in 's', which is of non-class type 'int'
8 | for(int i=0;i<n;i++) cin >> s.at(i);
| ^~
a.cc:9:10: error: request for member 'begin' in 's', which is of non-class type 'int'
9 | sort(s.begin(),s.end());
| ^~~~~
a.cc:9:20: error: request for member 'end' in 's', which is of non-class type 'int'
9 | sort(s.begin(),s.end());
| ^~~
a.cc:10:34: error: request for member 'at' in 's', which is of non-class type 'int'
10 | for(int j=0;j<n;j++) cout << s.at(i);
| ^~
a.cc:10:37: error: 'i' was not declared in this scope
10 | for(int j=0;j<n;j++) cout << s.at(i);
| ^
|
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<std::__cxx11::basic_string<char> >) (int&)'
18 | s += vec(i);
| ~~~^~~
|
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/include/c++/14/bits/stl_algo.h:4762:5: note: candidate: 'template<class _RAIter> void std::sort(_RAIter, _RAIter)'
4762 | sort(_RandomAccessIterator __first, _RandomAccessIterator __last)
| ^~~~
/usr/include/c++/14/bits/stl_algo.h:4762:5: note: template argument deduction/substitution failed:
a.cc:15:7: note: couldn't deduce template parameter '_RAIter'
15 | sort(s.begin,s.end);
| ~~~~^~~~~~~~~~~~~~~
/usr/include/c++/14/bits/stl_algo.h:4793:5: note: candidate: 'template<class _RAIter, class _Compare> void std::sort(_RAIter, _RAIter, _Compare)'
4793 | sort(_RandomAccessIterator __first, _RandomAccessIterator __last,
| ^~~~
/usr/include/c++/14/bits/stl_algo.h:4793:5: note: candidate expects 3 arguments, 2 provided
In file included from /usr/include/c++/14/algorithm:86:
/usr/include/c++/14/pstl/glue_algorithm_defs.h:292:1: note: candidate: 'template<class _ExecutionPolicy, class _RandomAccessIterator, class _Compare> __pstl::__internal::__enable_if_execution_policy<_ExecutionPolicy, void> std::sort(_ExecutionPolicy&&, _RandomAccessIterator, _RandomAccessIterator, _Compare)'
292 | sort(_ExecutionPolicy&& __exec, _RandomAccessIterator __first, _RandomAccessIterator __last, _Compare __comp);
| ^~~~
/usr/include/c++/14/pstl/glue_algorithm_defs.h:292:1: note: candidate expects 4 arguments, 2 provided
/usr/include/c++/14/pstl/glue_algorithm_defs.h:296:1: note: candidate: 'template<class _ExecutionPolicy, class _RandomAccessIterator> __pstl::__internal::__enable_if_execution_policy<_ExecutionPolicy, void> std::sort(_ExecutionPolicy&&, _RandomAccessIterator, _RandomAccessIterator)'
296 | sort(_ExecutionPolicy&& __exec, _RandomAccessIterator __first, _RandomAccessIterator __last);
| ^~~~
/usr/include/c++/14/pstl/glue_algorithm_defs.h:296:1: note: candidate expects 3 arguments, 2 provided
|
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: candidate: 'template<class _RAIter> void std::sort(_RAIter, _RAIter)'
4762 | sort(_RandomAccessIterator __first, _RandomAccessIterator __last)
| ^~~~
/usr/include/c++/14/bits/stl_algo.h:4762:5: note: candidate expects 2 arguments, 1 provided
/usr/include/c++/14/bits/stl_algo.h:4793:5: note: candidate: 'template<class _RAIter, class _Compare> void std::sort(_RAIter, _RAIter, _Compare)'
4793 | sort(_RandomAccessIterator __first, _RandomAccessIterator __last,
| ^~~~
/usr/include/c++/14/bits/stl_algo.h:4793:5: note: candidate expects 3 arguments, 1 provided
In file included from /usr/include/c++/14/algorithm:86:
/usr/include/c++/14/pstl/glue_algorithm_defs.h:292:1: note: candidate: 'template<class _ExecutionPolicy, class _RandomAccessIterator, class _Compare> __pstl::__internal::__enable_if_execution_policy<_ExecutionPolicy, void> std::sort(_ExecutionPolicy&&, _RandomAccessIterator, _RandomAccessIterator, _Compare)'
292 | sort(_ExecutionPolicy&& __exec, _RandomAccessIterator __first, _RandomAccessIterator __last, _Compare __comp);
| ^~~~
/usr/include/c++/14/pstl/glue_algorithm_defs.h:292:1: note: candidate expects 4 arguments, 1 provided
/usr/include/c++/14/pstl/glue_algorithm_defs.h:296:1: note: candidate: 'template<class _ExecutionPolicy, class _RandomAccessIterator> __pstl::__internal::__enable_if_execution_policy<_ExecutionPolicy, void> std::sort(_ExecutionPolicy&&, _RandomAccessIterator, _RandomAccessIterator)'
296 | sort(_ExecutionPolicy&& __exec, _RandomAccessIterator __first, _RandomAccessIterator __last);
| ^~~~
/usr/include/c++/14/pstl/glue_algorithm_defs.h:296:1: note: candidate expects 3 arguments, 1 provided
|
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 << endl;
}
|
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] = scanner.next();
}
Arrays.sort(arrayOfWords);
for(int i = 0; i < N - 1; i++) {
String answer = answer + arrayOfWords[i];
}
System.out.println(answer);
}
}
|
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] = scanner.next();
}
Arrays.sort(arrayOfWords);
for(int i = 0; i < N - 1; i++) {
String answer = arrayOfWords[i] + arrayOfWords[i + 1];
}
System.out.println(answer);
}
}
|
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] = scanner.next();
}
Arrays.sort(arrayOfWords);
for(int i = 0; i < N - 1; i++) {
String answer = arrayOfWords[i] + arrayOfWords[i + 1];
}
System.out.println(answer);
}
}
|
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
location: class Main
Main.java:17: error: cannot find symbol
String answer = arrayOfWords[i] + arrayOfWords[i + 1];
^
symbol: variable arrayOfWords
location: class Main
Main.java:20: error: cannot find symbol
System.out.println(answer);
^
symbol: variable answer
location: class Main
4 errors
|
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] = scanner.next();
}
Arrays.sort(arrayOfWords);
for(i = 0; i < N-1; i++) {
String answer = arrayOfWords[i] + arrayOfWords[i + 1];
}
System.out.println(answer);
}
}
|
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 symbol
for(i = 0; i < N-1; i++) {
^
symbol: variable i
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:17: error: cannot find symbol
String answer = arrayOfWords[i] + arrayOfWords[i + 1];
^
symbol: variable arrayOfWords
location: class Main
Main.java:17: error: cannot find symbol
String answer = arrayOfWords[i] + arrayOfWords[i + 1];
^
symbol: variable i
location: class Main
Main.java:17: error: cannot find symbol
String answer = arrayOfWords[i] + arrayOfWords[i + 1];
^
symbol: variable arrayOfWords
location: class Main
Main.java:17: error: cannot find symbol
String answer = arrayOfWords[i] + arrayOfWords[i + 1];
^
symbol: variable i
location: class Main
Main.java:20: error: cannot find symbol
System.out.println(answer);
^
symbol: variable answer
location: class Main
9 errors
|
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++) {
str[i] = sc.next();
}
Arrays.sort(str);
for(int i = 0;int<str.length;i++){
System.out.println(str[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++) {
str[i] = sc.next();
}
Arrays.sort(str);
for(int i = 0;int<str.length;i++){
System.out.println(str.get[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<String>();
for (int i = 0; i < N; i++) {
String S = sc.next();
SArray.add(S);
}
Collections.sort(SArray);
for (int i = 0; i < N; i++) {
System.out.print(SArray.get(i));
}
}
}
|
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[g];
}
}
}
}
for(i=0;i<n;i++)
{
if(a[i][0]==a[i+1][0])
{
for(int t=1;t<m;t++)
{
if(a[i][t]>a[i+1][t])
{
char b[150];
for(int g=0;g<m;g++)
{
b[g]=a[i][g];
a[i][g]=a[i+1][g];
a[i+1][g]=b[g];
}
break;
}
}
}
}
for(i=0;i<n;i++)
printf("%s",a[i]);
}
|
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][g];
a[j][g]=b[g];
}
}
}
}
for(i=0;i<n;i++)
{
if(a[i][0]==a[i+1][0])
{
for(int t=1;t<m;t++)
{
if(a[i][t]>a[i+1][t])
{
char b[150];
for(int g=0;g<m;g++)
{
b[g]=a[i][g];
a[i][g]=a[i+1][g];
a[i+1][g]=b[g];
}
break;
}
}
}
}
for(i=0;i<n;i++)
printf("%s",a[i]);
}
|
a.cc: In function 'int main()':
a.cc:11:9: error: 'gets' was not declared in this scope; did you mean 'getw'?
11 | gets(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][g];
a[j][g]=b[g];
}
}
}
}
for(i=0;i<n;i++)
{
if(a[i][0]==a[i+1][0])
{
for(int t=1;t<m;t++)
{
if(a[i][t]>a[i+1][t])
{
char b[150];
for(int g=0;g<m;g++)
{
b[g]=a[i][g];
a[i][g]=a[i+1][g];
a[i+1][g]=b[g];
}
break;
}
}
}
}
for(i=0;i<n;i++)
printf("%s",a[i]);
}
|
a.cc: In function 'int main()':
a.cc:11:9: error: 'gets' was not declared in this scope; did you mean 'getw'?
11 | gets(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");
}
}printf("\n");
}
}
|
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");
}
}printf("\n");
}
}
|
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");
}
}printf("\n");
}
}
|
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("\n");
}
}
|
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("\n");
}
}
|
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;
}
for(int k = 1; k < L; ++k){
for(int j = i; j > 0; --j){
if(s[j][k-1] != s[j-1][k-1] || s[j][k] > s[j-1][k])
break;
string t = s[j];
s[j] = s[j-1];
s[j-1] = t;
}
}
}
for(int i = N - 1; i >= 0; --i)
cout << s[i];
cout << endl;
|
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 = 0;a < N;a++){
System.out.print(S.get(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
2 errors
|
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 < N;a++){
System.out.print(S.get(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();
}
Arrays.sort(array);
for(int i = 0; i < n; i++) {
System.out.print(array[i]);
}
}
}
|
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.print(a[j]);
}
}
}
|
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.println(a[j]);
}
}
}
|
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> >::iterator]'
14 | sort<s.begin(),s.end());
| ~~~~~~~^~
In file included from /usr/include/c++/14/vector:66,
from /usr/include/c++/14/functional:64,
from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:53,
from a.cc:1:
/usr/include/c++/14/bits/stl_vector.h:873:7: note: '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> >::iterator]' declared here
873 | begin() _GLIBCXX_NOEXCEPT
| ^~~~~
a.cc:14:23: error: call to non-'constexpr' function 'std::vector<_Tp, _Alloc>::iterator std::vector<_Tp, _Alloc>::end() [with _Tp = std::__cxx11::basic_string<char>; _Alloc = std::allocator<std::__cxx11::basic_string<char> >; iterator = std::vector<std::__cxx11::basic_string<char> >::iterator]'
14 | sort<s.begin(),s.end());
| ~~~~~^~
/usr/include/c++/14/bits/stl_vector.h:893:7: note: 'std::vector<_Tp, _Alloc>::iterator std::vector<_Tp, _Alloc>::end() [with _Tp = std::__cxx11::basic_string<char>; _Alloc = std::allocator<std::__cxx11::basic_string<char> >; iterator = std::vector<std::__cxx11::basic_string<char> >::iterator]' declared here
893 | end() _GLIBCXX_NOEXCEPT
| ^~~
a.cc:14:3: error: parse error in template argument list
14 | sort<s.begin(),s.end());
| ^~~~~~~~~~~~~~~~~~~~~~
a.cc:14:25: error: expected ';' before ')' token
14 | sort<s.begin(),s.end());
| ^
| ;
a.cc:14:3: error: statement cannot resolve address of overloaded function
14 | sort<s.begin(),s.end());
| ^~~~~~~~~~~~~~~~~~~~~~
|
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; ++i){
scanf("%[^\n]", s[i]);
scanf("%*c");
}
qsort(s, n, sizeof(s[0]), cmpstr);
for (int i = 0; i < n; ++i){
printf("%s", s[i]);
}
printf("\n");
return 0;
}
|
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 conversion from 'const void*' to 'const char*' [-fpermissive]
6 | const char *x = a, *y = b;
| ^
| |
| const void*
|
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]),cmpstr)
for(int i =0;i<n;++i)
printf("%s",s[i]);
printf("\n");
return 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-qualifiers]
8 | char *x = a,*y = b;
| ^
main.c: In function 'main':
main.c:17:9: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'scanf'
17 | scanf("%d %d",&n,&l);
| ^~~~~
main.c:19:28: error: 's' undeclared (first use in this function)
19 | scanf("%s",s[i]);
| ^
main.c:19:28: note: each undeclared identifier is reported only once for each function it appears in
main.c:23:39: error: expected ';' before 'for'
23 | qsort(s,n,sizeof(s[0]),cmpstr)
| ^
| ;
24 | for(int i =0;i<n;++i)
| ~~~
|
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);
for(i=0;i<n;i++){
printf("%s", s[i]);
}
printf("\n");
return 0;
}
|
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)
6 | return strcmp(x,y);
| ^
|
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);
for (int i = 0; i < n; ++i)
printf("%s", s[i]);
printf("\n");
return 0;
}
|
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:32: note: initializing argument 1 of 'int strcmp(const char*, const char*)'
156 | extern int strcmp (const char *__s1, const char *__s2)
| ~~~~~~~~~~~~^~~~
a.cc:7:20: error: invalid conversion from 'const void*' to 'const char*' [-fpermissive]
7 | return strcmp(a, b);
| ^
| |
| const void*
/usr/include/string.h:156:50: note: initializing argument 2 of 'int strcmp(const char*, const char*)'
156 | extern int strcmp (const char *__s1, const char *__s2)
| ~~~~~~~~~~~~^~~~
|
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]);
}
qsort(nome, x, sizeof(nome[0]), cmp);
for(int i = 0; i < x; ++i){
printf("%s", nome[i]);
}
printf("\n");
return 0;
}
|
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 'const void*' to 'const char*' [-fpermissive]
8 | const char* y = b;
| ^
| |
| const void*
|
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 (int i=0; i<n; ++i)
printf("%s", str[i]);
printf("\n");
return 0;
}
|
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:156:32: note: initializing argument 1 of 'int strcmp(const char*, const char*)'
156 | extern int strcmp (const char *__s1, const char *__s2)
| ~~~~~~~~~~~~^~~~
a.cc:6:20: error: invalid conversion from 'const void*' to 'const char*' [-fpermissive]
6 | return strcmp(a, b);
| ^
| |
| const void*
/usr/include/string.h:156:50: note: initializing argument 2 of 'int strcmp(const char*, const char*)'
156 | extern int strcmp (const char *__s1, const char *__s2)
| ~~~~~~~~~~~~^~~~
|
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, sizeof(str[0]), compare);
for (int i=0; i<n; ++i)
printf("%s", str[i]);
printf("\n");
return 0;
}
|
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 conversion from 'const void*' to 'const char*' [-fpermissive]
6 | const char *x = a, *y = b;
| ^
| |
| 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:32: note: initializing argument 1 of 'int strcmp(const char*, const char*)'
156 | extern int strcmp (const char *__s1, const char *__s2)
| ~~~~~~~~~~~~^~~~
a.cc:7:20: error: invalid conversion from 'const void*' to 'const char*' [-fpermissive]
7 | return strcmp(a, b);
| ^
| |
| const void*
/usr/include/string.h:156:50: note: initializing argument 2 of 'int strcmp(const char*, const char*)'
156 | extern int strcmp (const char *__s1, const char *__s2)
| ~~~~~~~~~~~~^~~~
|
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);
for(int i=0;i<n;i++){
scanf("%s",nome[i]);
}
qsort(nome,n,sizeof(nome[0]),ord);
for(int i=0;i<n;i++)
printf("%s",nome[i]);
puts("");
return 0;
}
|
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: invalid conversion from 'const void*' to 'const char*' [-fpermissive]
7 | const char *a = x, *b=y;
| ^
| |
| const void*
|
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 ll long long
#define mod (1000000007)
#define YES cout << "YES" << endl;
#define Yes cout << "Yes" << endl;
#define NO cout << "NO" << endl;
#define No cout << "No" << endl;
int asc(const void *a, const void *b) {
return *(int *)a - *(int *)b;
}
int desc(const void *a, const void *b) {
return *(int *)b - *(int *)a;
}
int main()
{
int n,l;
cin >> n >> l;
vector <string> s.at(n);
sort(s.begin(), s.end());
rep(i, n)cout << s.at(n);
cout << endl;
return 0;
}
|
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 ];
}
return 0;
}
|
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>
+++ |+#include <vector>
2 | #include<string>
a.cc:11:28: error: expected primary-expression before '>' token
11 | std::vector< std::string > s( L );
| ^
a.cc:11:30: error: 's' was not declared in this scope
11 | std::vector< std::string > s( L );
| ^
a.cc:16:8: error: 'sort' is not a member of 'std'; did you mean 'qsort'?
16 | std::sort( s.begin(), s.end() );
| ^~~~
| qsort
|
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; i++){
System.out.print(stateList.get(i));
}
}
}
|
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: variable i
location: class Main
Main.java:13: error: cannot find symbol
System.out.print(stateList.get(i));
^
symbol: variable i
location: class Main
4 errors
|
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 i++){
System.out.print(stateList.get(i));
}
}
}
|
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(S.begin(), S.end());
for (int i = 0; i < N; i++){
cout << S[i];
}
cout << endl;
}
|
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(S.begin(), S.end());
for (int i = 0; i < N; i++){
cout << S[i];
}
cout << endl;
}
|
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;
}
return res;
}
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;
return 0;
}
|
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::string [N]' {aka 'std::__cxx11::basic_string<char> [N]'}
31 | sort(S.begin(), S.end());
| ^~~
|
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;
}
return res;
}
int main(void){
//入力
int N, L;
cin >> N >> L;
//配列
string S[N];
rep(i, N) cin >> S[i];
//配列のソート
sort(S, S.size());
//小さいものから出力
rep(i, N) cout << S[i];
cout << endl;
return 0;
}
|
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 | vactor<string> s(n);
| ^
|
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 << endl;
}
|
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 included from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:41,
from a.cc:1:
/usr/include/c++/14/cstddef:131:5: note: candidate: 'template<class _IntegerType> constexpr std::__byte_op_t<_IntegerType> std::operator>>(byte, _IntegerType)'
131 | operator>>(byte __b, _IntegerType __shift) noexcept
| ^~~~~~~~
/usr/include/c++/14/cstddef:131:5: note: template argument deduction/substitution failed:
a.cc:17:3: note: cannot convert 'std::cout' (type 'std::ostream' {aka 'std::basic_ostream<char>'}) to type 'std::byte'
17 | cout>>"\n";
| ^~~~
In file included from /usr/include/c++/14/string:55,
from /usr/include/c++/14/bitset:52,
from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:52:
/usr/include/c++/14/bits/basic_string.tcc:835:5: note: candidate: 'template<class _CharT, class _Traits, class _Alloc> std::basic_istream<_CharT, _Traits>& std::operator>>(basic_istream<_CharT, _Traits>&, __cxx11::basic_string<_CharT, _Traits, _Allocator>&)'
835 | operator>>(basic_istream<_CharT, _Traits>& __in,
| ^~~~~~~~
/usr/include/c++/14/bits/basic_string.tcc:835:5: note: template argument deduction/substitution failed:
a.cc:17:9: note: 'std::ostream' {aka 'std::basic_ostream<char>'} is not derived from 'std::basic_istream<_CharT, _Traits>'
17 | cout>>"\n";
| ^~~~
/usr/include/c++/14/bitset:1597:5: note: candidate: 'template<class _CharT, class _Traits, long unsigned int _Nb> std::basic_istream<_CharT, _Traits>& std::operator>>(basic_istream<_CharT, _Traits>&, bitset<_Nb>&)'
1597 | operator>>(std::basic_istream<_CharT, _Traits>& __is, bitset<_Nb>& __x)
| ^~~~~~~~
/usr/include/c++/14/bitset:1597:5: note: template argument deduction/substitution failed:
a.cc:17:9: note: 'std::ostream' {aka 'std::basic_ostream<char>'} is not derived from 'std::basic_istream<_CharT, _Traits>'
17 | cout>>"\n";
| ^~~~
In file included from /usr/include/c++/14/istream:1109,
from /usr/include/c++/14/sstream:40,
from /usr/include/c++/14/complex:45,
from /usr/include/c++/14/ccomplex:39,
from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:127:
/usr/include/c++/14/bits/istream.tcc:978:5: note: candidate: 'template<class _CharT, class _Traits> std::basic_istream<_CharT, _Traits>& std::operator>>(basic_istream<_CharT, _Traits>&, _CharT&)'
978 | operator>>(basic_istream<_CharT, _Traits>& __in, _CharT& __c)
| ^~~~~~~~
/usr/include/c++/14/bits/istream.tcc:978:5: note: template argument deduction/substitution failed:
a.cc:17:9: note: 'std::ostream' {aka 'std::basic_ostream<char>'} is not derived from 'std::basic_istream<_CharT, _Traits>'
17 | cout>>"\n";
| ^~~~
/usr/include/c++/14/istream:849:5: note: candidate: 'template<class _Traits> std::basic_istream<char, _Traits>& std::operator>>(basic_istream<char, _Traits>&, unsigned char&)'
849 | operator>>(basic_istream<char, _Traits>& __in, unsigned char& __c)
| ^~~~~~~~
/usr/include/c++/14/istream:849:5: note: template argument deduction/substitution failed:
a.cc:17:9: note: 'std::ostream' {aka 'std::basic_ostream<char>'} is not derived from 'std::basic_istream<char, _Traits>'
17 | cout>>"\n";
| ^~~~
/usr/include/c++/14/istream:854:5: note: candidate: 'template<class _Traits> std::basic_istream<char, _Traits>& std::operator>>(basic_istream<char, _Traits>&, signed char&)'
854 | operator>>(basic_istream<char, _Traits>& __in, signed char& __c)
| ^~~~~~~~
/usr/include/c++/14/istream:854:5: note: template argument deduction/substitution failed:
a.cc:17:9: note: 'std::ostream' {aka 'std::basic_ostream<char>'} is not derived from 'std::basic_istream<char, _Traits>'
17 | cout>>"\n";
| ^~~~
/usr/include/c++/14/istream:896:5: note: candidate: 'template<class _CharT, class _Traits> std::basic_istream<_CharT, _Traits>& std::operator>>(basic_istream<_CharT, _Traits>&, _CharT*)'
896 | operator>>(basic_istream<_CharT, _Traits>& __in, _CharT* __s)
| ^~~~~~~~
/usr/include/c++/14/istream:896:5: note: template argument deduction/substitution failed:
a.cc:17:9: note: 'std::ostream' {aka 'std::basic_ostream<char>'} is not derived from 'std::basic_istream<_CharT, _Traits>'
17 | cout>>"\n";
| ^~~~
/usr/include/c++/14/istream:939:5: note: candidate: 'template<class _Traits> std::basic_istream<char, _Traits>& std::operator>>(basic_istream<char, _Traits>&, unsigned char*)'
939 | operator>>(basic_istream<char, _Traits>& __in, unsigned char* __s)
| ^~~~~~~~
/usr/include/c++/14/istream:939:5: note: template argument deduction/substitution failed:
a.cc:17:9: note: 'std::ostream' {aka 'std::basic_ostream<char>'} is not derived from 'std::basic_istream<char, _Traits>'
17 | cout>>"\n";
| ^~~~
/usr/include/c++/14/istream:945:5: note: candidate: 'template<class _Traits> std::basic_istream<char, _Traits>& std::operator>>(basic_istream<char, _Traits>&, signed char*)'
945 | operator>>(basic_istream<char, _Traits>& __in, signed char* __s)
| ^~~~~~~~
/usr/include/c++/14/istream:945:5: note: template argument deduction/substitution failed:
a.cc:17:9: note: 'std::ostream' {aka 'std::basic_ostream<char>'} is not derived from 'std::basic_istream<char, _Traits>'
17 | cout>>"\n";
| ^~~~
/usr/include/c++/14/istream:1099:5: note: candidate: 'template<class _Istream, class _Tp> _Istream&& std::operator>>(_Istream&&, _Tp&&)'
1099 | operator>>(_Istream&& __is, _Tp&& __x)
| ^~~~~~~~
/usr/include/c++/14/istream:1099:5: note: template argument deduction/substitution failed:
/usr/include/c++/14/istream: In substitution of 'template<class _Istream, class _Tp> _Istream&& std::operator>>(_Istream&&, _Tp&&) [with _Istream = std::basic_ostream<char>&; _Tp = const char (&)[2]]':
a.cc:17:9: required from here
17 | cout>>"\n";
| ^~~~
/usr/include/c++/14/istream:1099:5: error: no type named 'type' in 'struct std::enable_if<false, void>'
1099 | operator>>(_Istream&& __is, _Tp&& __x)
| ^~~~~~~~
/usr/include/c++/14/complex:509:5: note: candidate: 'template<class _Tp, class _CharT, class _Traits> std::basic_istream<_CharT, _Traits>& std::operator>>(basic_istream<_CharT, _Traits>&, complex<_Tp>&)'
509 | operator>>(basic_istream<_CharT, _Traits>& __is, complex<_Tp>& __x)
| ^~~~~~~~
/usr/include/c++/14/complex:509:5: note: template argument deduction/substitution failed:
a.cc:17:9: note: 'std::ostream' {aka 'std::basic_ostream<char>'} is not derived from 'std::basic_istream<_CharT, _Traits>'
17 | cout>>"\n";
| ^~~~
In file included from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:143:
/usr/include/c++/14/iomanip:76:5: note: candidate: 'template<class _CharT, class _Traits> std::basic_istream<_CharT, _Traits>& std::operator>>(basic_istream<_CharT, _Traits>&, _Resetiosflags)'
76 | operator>>(basic_istream<_CharT, _Traits>& __is, _Resetiosflags __f)
| ^~~~~~~~
/usr/include/c++/14/iomanip:76:5: note: template argument deduction/substitution failed:
a.cc:17:9: note: 'std::ostream' {aka 'std::basic_ostream<char>'} is not derived from 'std::basic_istream<_CharT, _Traits>'
17 | cout>>"\n";
| ^~~~
/usr/include/c++/14/iomanip:106:5: note: candidate: 'template<class _CharT, class _Traits> std::basic_istream<_CharT, _Traits>& std::operator>>(basic_istream<_CharT, _Traits>&, _Setiosflags)'
106 | operator>>(basic_istream<_CharT, _Traits>& __is, _Setiosflags __f)
| ^~~~~~~~
/usr/include/c++/14/iomanip:106:5: note: template argument deduction/substitution failed:
a.cc:17:9: note: 'std::ostream' {aka 'std::basic_ostream<char>'} is not derived from 'std::basic_istream<_CharT, _Traits>'
17 | cout>>"\n";
| ^~~~
/usr/include/c++/14/iomanip:137:5: note: candidate: 'template<class _CharT, class _Traits> std::basic_istream<_CharT, _Traits>& std::operator>>(basic_istream<_CharT, _Traits>&, _Setbase)'
137 | operator>>(basic_istream<_CharT, _Traits>& __is, _Setbase __f)
| ^~~~~~~~
/usr/include/c++/14/iomanip:137:5: note: template argument deduction/substitution failed:
a.cc:17:9: note: 'std::ostream' {aka 'std::basic_ostream<char>'} is not derived from 'std::basic_istream<_CharT, _Traits>'
17 | cout>>"\n";
| ^~~~
/usr/include/c++/14/iomanip:177:5: note: candidate: 'template<class _CharT, class _Traits> std::basic_istream<_CharT, _Traits>& std::operator>>(basic_istream<_CharT, _Traits>&, _Setfill<_CharT>)'
177 | operator>>(basic_istream<_CharT, _Traits>& __is, _Setfill<_CharT> __f)
| ^~~~~~~~
/usr/include/c++/14/iomanip:177:5: note: template argument deduction/substitution failed:
a.cc:17:9: note: 'std::ostream' {aka 'std::basic_ostream<char>'} is not derived from 'std::basic_istream<_CharT, _Traits>'
17 | cout>>"\n";
| ^~~~
/usr/include/c++/14/iomanip:207:5: note: candidate: 'template<class _CharT, class _Traits> std::basic_istream<_CharT, _Traits>& std::operator>>(basic_istream<_CharT, _Traits>&, _Setprecision)'
207 | operator>>(basic_istream<_CharT, _Traits>& __is, _Setprecision __f)
| ^~~~~~~~
/usr/include/c++/14/iomanip:207:5: note: template argument deduction/substitution failed:
a.cc:17:9: note: 'std::ostream' {aka 'std::basic_ostream<char>'} is not derived from 'std::basic_istream<_CharT, _Traits>'
17 | cout>>"\n";
| ^~~~
/usr/include/c++/14/iomanip:237:5: note: candidate: 'template<class _CharT, class _Traits> std::basic_istream<_CharT, _Traits>& std::operator>>(basic_istream<_CharT, _Traits>&, _Setw)'
237 | operator>>(basic_istream<_CharT, _Traits>& __is, _Setw __f)
|
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++){
| ~^~
a.cc:16:4: error: expected '}' at end of input
16 | }
| ^
a.cc:3:14: note: to match this '{'
3 | signed main(){
| ^
|
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' {aka 'std::__cxx11::basic_string<char>'})
7 | for(int i=0;i<b;i++){
| ~^~
| | |
| | std::string {aka std::__cxx11::basic_string<char>}
| int
In file included from /usr/include/c++/14/regex:68,
from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:181,
from a.cc:1:
/usr/include/c++/14/bits/regex.h:1143:5: note: candidate: 'template<class _BiIter> bool std::__cxx11::operator<(const sub_match<_BiIter>&, const sub_match<_BiIter>&)'
1143 | operator<(const sub_match<_BiIter>& __lhs, const sub_match<_BiIter>& __rhs)
| ^~~~~~~~
/usr/include/c++/14/bits/regex.h:1143:5: note: template argument deduction/substitution failed:
a.cc:7:17: note: mismatched types 'const std::__cxx11::sub_match<_BiIter>' and 'int'
7 | for(int i=0;i<b;i++){
| ^
/usr/include/c++/14/bits/regex.h:1224:5: note: candidate: 'template<class _Bi_iter, class _Ch_traits, class _Ch_alloc> bool std::__cxx11::operator<(__sub_match_string<_Bi_iter, _Ch_traits, _Ch_alloc>&, const sub_match<_BiIter>&)'
1224 | operator<(const __sub_match_string<_Bi_iter, _Ch_traits, _Ch_alloc>& __lhs,
| ^~~~~~~~
/usr/include/c++/14/bits/regex.h:1224:5: note: template argument deduction/substitution failed:
a.cc:7:17: note: mismatched types 'std::__cxx11::__sub_match_string<_Bi_iter, _Ch_traits, _Ch_alloc>' and 'int'
7 | for(int i=0;i<b;i++){
| ^
/usr/include/c++/14/bits/regex.h:1317:5: note: candidate: 'template<class _Bi_iter, class _Ch_traits, class _Ch_alloc> bool std::__cxx11::operator<(const sub_match<_BiIter>&, __sub_match_string<_Bi_iter, _Ch_traits, _Ch_alloc>&)'
1317 | operator<(const sub_match<_Bi_iter>& __lhs,
| ^~~~~~~~
/usr/include/c++/14/bits/regex.h:1317:5: note: template argument deduction/substitution failed:
a.cc:7:17: note: mismatched types 'const std::__cxx11::sub_match<_BiIter>' and 'int'
7 | for(int i=0;i<b;i++){
| ^
/usr/include/c++/14/bits/regex.h:1391:5: note: candidate: 'template<class _Bi_iter> bool std::__cxx11::operator<(const typename std::iterator_traits<_Iter>::value_type*, const sub_match<_BiIter>&)'
1391 | operator<(typename iterator_traits<_Bi_iter>::value_type const* __lhs,
| ^~~~~~~~
/usr/include/c++/14/bits/regex.h:1391:5: note: template argument deduction/substitution failed:
a.cc:7:17: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::__cxx11::sub_match<_BiIter>'
7 | for(int i=0;i<b;i++){
| ^
/usr/include/c++/14/bits/regex.h:1485:5: note: candidate: 'template<class _Bi_iter> bool std::__cxx11::operator<(const sub_match<_BiIter>&, const typename std::iterator_traits<_Iter>::value_type*)'
1485 | operator<(const sub_match<_Bi_iter>& __lhs,
| ^~~~~~~~
/usr/include/c++/14/bits/regex.h:1485:5: note: template argument deduction/substitution failed:
a.cc:7:17: note: mismatched types 'const std::__cxx11::sub_match<_BiIter>' and 'int'
7 | for(int i=0;i<b;i++){
| ^
/usr/include/c++/14/bits/regex.h:1560:5: note: candidate: 'template<class _Bi_iter> bool std::__cxx11::operator<(const typename std::iterator_traits<_Iter>::value_type&, const sub_match<_BiIter>&)'
1560 | operator<(typename iterator_traits<_Bi_iter>::value_type const& __lhs,
| ^~~~~~~~
/usr/include/c++/14/bits/regex.h:1560:5: note: template argument deduction/substitution failed:
a.cc:7:17: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::__cxx11::sub_match<_BiIter>'
7 | for(int i=0;i<b;i++){
| ^
/usr/include/c++/14/bits/regex.h:1660:5: note: candidate: 'template<class _Bi_iter> bool std::__cxx11::operator<(const sub_match<_BiIter>&, const typename std::iterator_traits<_Iter>::value_type&)'
1660 | operator<(const sub_match<_Bi_iter>& __lhs,
| ^~~~~~~~
/usr/include/c++/14/bits/regex.h:1660:5: note: template argument deduction/substitution failed:
a.cc:7:17: note: mismatched types 'const std::__cxx11::sub_match<_BiIter>' and 'int'
7 | for(int i=0;i<b;i++){
| ^
In file included from /usr/include/c++/14/bits/stl_algobase.h:64,
from /usr/include/c++/14/algorithm:60,
from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:51:
/usr/include/c++/14/bits/stl_pair.h:1045:5: note: candidate: 'template<class _T1, class _T2> constexpr bool std::operator<(const pair<_T1, _T2>&, const pair<_T1, _T2>&)'
1045 | operator<(const pair<_T1, _T2>& __x, const pair<_T1, _T2>& __y)
| ^~~~~~~~
/usr/include/c++/14/bits/stl_pair.h:1045:5: note: template argument deduction/substitution failed:
a.cc:7:17: note: mismatched types 'const std::pair<_T1, _T2>' and 'int'
7 | for(int i=0;i<b;i++){
| ^
In file included from /usr/include/c++/14/bits/stl_algobase.h:67:
/usr/include/c++/14/bits/stl_iterator.h:448:5: note: candidate: 'template<class _Iterator> constexpr bool std::operator<(const reverse_iterator<_Iterator>&, const reverse_iterator<_Iterator>&)'
448 | operator<(const reverse_iterator<_Iterator>& __x,
| ^~~~~~~~
/usr/include/c++/14/bits/stl_iterator.h:448:5: note: template argument deduction/substitution failed:
a.cc:7:17: note: mismatched types 'const std::reverse_iterator<_Iterator>' and 'int'
7 | for(int i=0;i<b;i++){
| ^
/usr/include/c++/14/bits/stl_iterator.h:493:5: note: candidate: 'template<class _IteratorL, class _IteratorR> constexpr bool std::operator<(const reverse_iterator<_Iterator>&, const reverse_iterator<_IteratorR>&)'
493 | operator<(const reverse_iterator<_IteratorL>& __x,
| ^~~~~~~~
/usr/include/c++/14/bits/stl_iterator.h:493:5: note: template argument deduction/substitution failed:
a.cc:7:17: note: mismatched types 'const std::reverse_iterator<_Iterator>' and 'int'
7 | for(int i=0;i<b;i++){
| ^
/usr/include/c++/14/bits/stl_iterator.h:1694:5: note: candidate: 'template<class _IteratorL, class _IteratorR> constexpr bool std::operator<(const move_iterator<_IteratorL>&, const move_iterator<_IteratorR>&)'
1694 | operator<(const move_iterator<_IteratorL>& __x,
| ^~~~~~~~
/usr/include/c++/14/bits/stl_iterator.h:1694:5: note: template argument deduction/substitution failed:
a.cc:7:17: note: mismatched types 'const std::move_iterator<_IteratorL>' and 'int'
7 | for(int i=0;i<b;i++){
| ^
/usr/include/c++/14/bits/stl_iterator.h:1760:5: note: candidate: 'template<class _Iterator> constexpr bool std::operator<(const move_iterator<_IteratorL>&, const move_iterator<_IteratorL>&)'
1760 | operator<(const move_iterator<_Iterator>& __x,
| ^~~~~~~~
/usr/include/c++/14/bits/stl_iterator.h:1760:5: note: template argument deduction/substitution failed:
a.cc:7:17: note: mismatched types 'const std::move_iterator<_IteratorL>' and 'int'
7 | for(int i=0;i<b;i++){
| ^
In file included from /usr/include/c++/14/bits/basic_string.h:47,
from /usr/include/c++/14/string:54,
from /usr/include/c++/14/bitset:52,
from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:52:
/usr/include/c++/14/string_view:673:5: note: candidate: 'template<class _CharT, class _Traits> constexpr bool std::operator<(basic_string_view<_CharT, _Traits>, basic_string_view<_CharT, _Traits>)'
673 | operator< (basic_string_view<_CharT, _Traits> __x,
| ^~~~~~~~
/usr/include/c++/14/string_view:673:5: note: template argument deduction/substitution failed:
a.cc:7:17: note: mismatched types 'std::basic_string_view<_CharT, _Traits>' and 'int'
7 | for(int i=0;i<b;i++){
| ^
/usr/include/c++/14/string_view:680:5: note: candidate: 'template<class _CharT, class _Traits> constexpr bool std::operator<(basic_string_view<_CharT, _Traits>, __type_identity_t<basic_string_view<_CharT, _Traits> >)'
680 | operator< (basic_string_view<_CharT, _Traits> __x,
| ^~~~~~~~
/usr/include/c++/14/string_view:680:5: note: template argument deduction/substitution failed:
a.cc:7:17: note: mismatched types 'std::basic_string_view<_CharT, _Traits>' and 'int'
7 | for(int i=0;i<b;i++){
| ^
/usr/include/c++/14/string_view:688:5: note: candidate: 'template<class _CharT, class _Traits> constexpr bool std::operator<(__type_identity_t<basic_string_view<_CharT, _Traits> >, basic_string_view<_CharT, _Traits>)'
688 | operator< (__type_identity_t<basic_string_view<_CharT, _Traits>> __x,
| ^~~~~~~~
/usr/include/c++/14/string_view:688:5: note: template argument deduction/substitution failed:
a.cc:7:17: note: 'std::__cxx11::basic_string<char>' is not derived from 'std::basic_string_view<_CharT, _Traits>'
7 | for(int i=0;i<b;i++){
| ^
/usr/include/c++/14/bits/basic_string.h:3874:5: note: candidate: 'template<class _CharT, class _Traits, class _Alloc> bool std::operator<(const __cxx11::basic_string<_CharT, _Traits, _Allocator>&, const __cxx11::basic_string<_CharT, _Traits, _Allocator>&)'
3874 | operator<(const basic_string<_CharT, _Traits, _Alloc>& __lhs,
| ^~~~~~~~
/usr/include/c++/14/bits/basic_string.h:3874:5: note: template argument deduction/substitution failed:
a.cc:7:17: note: mismatched types 'const std::__cxx11::basic_string<_CharT, _Traits, _Allocator>' and 'int'
7 | for(int i=0;i<b;i++){
| ^
/usr/include/c++/14/bits/basic_string.h:3888:5: note: candidate: 'template<class _CharT, class _Traits, class _Alloc> bool std::operator<(const __cxx11::basic_string<_CharT, _Traits, _Allocator>&, const _Cha
|
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;
}
}
//比較
if(a.compare(b) > 0){
return b;
}else{
return a;
}
}
int main(){
int N,L;
string tmp,smaller,result;
vector<string> vec;
//read
cin >> N >> L;
//vecにSnを格納
for(int i=0; i<N; i++){
cin >> tmp;
vec.push_back(tmp);
}
//sort
sort(vec.begin(),vec.end());
//出力結果作成
for(int i=0;i<N; i++){
result += vec[i];
}
//出力
cout << result << endl;
return 0;
}
|
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<char> >
| std::ostream {aka std::basic_ostream<char>}
In file included from /usr/include/c++/14/istream:41,
from /usr/include/c++/14/sstream:40,
from /usr/include/c++/14/complex:45,
from /usr/include/c++/14/ccomplex:39,
from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:127,
from a.cc:1:
/usr/include/c++/14/ostream:116:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(__ostream_type& (*)(__ostream_type&)) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>]'
116 | operator<<(__ostream_type& (*__pf)(__ostream_type&))
| ^~~~~~~~
/usr/include/c++/14/ostream:116:36: note: no known conversion for argument 1 from 'std::vector<std::__cxx11::basic_string<char> >' to 'std::basic_ostream<char>::__ostream_type& (*)(std::basic_ostream<char>::__ostream_type&)' {aka 'std::basic_ostream<char>& (*)(std::basic_ostream<char>&)'}
116 | operator<<(__ostream_type& (*__pf)(__ostream_type&))
| ~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~
/usr/include/c++/14/ostream:125:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(__ios_type& (*)(__ios_type&)) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>; __ios_type = std::basic_ios<char>]'
125 | operator<<(__ios_type& (*__pf)(__ios_type&))
| ^~~~~~~~
/usr/include/c++/14/ostream:125:32: note: no known conversion for argument 1 from 'std::vector<std::__cxx11::basic_string<char> >' to 'std::basic_ostream<char>::__ios_type& (*)(std::basic_ostream<char>::__ios_type&)' {aka 'std::basic_ios<char>& (*)(std::basic_ios<char>&)'}
125 | operator<<(__ios_type& (*__pf)(__ios_type&))
| ~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~
/usr/include/c++/14/ostream:135:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(std::ios_base& (*)(std::ios_base&)) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>]'
135 | operator<<(ios_base& (*__pf) (ios_base&))
| ^~~~~~~~
/usr/include/c++/14/ostream:135:30: note: no known conversion for argument 1 from 'std::vector<std::__cxx11::basic_string<char> >' to 'std::ios_base& (*)(std::ios_base&)'
135 | operator<<(ios_base& (*__pf) (ios_base&))
| ~~~~~~~~~~~~^~~~~~~~~~~~~~~~~
/usr/include/c++/14/ostream:174:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(long int) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>]'
174 | operator<<(long __n)
| ^~~~~~~~
/usr/include/c++/14/ostream:174:23: note: no known conversion for argument 1 from 'std::vector<std::__cxx11::basic_string<char> >' to 'long int'
174 | operator<<(long __n)
| ~~~~~^~~
/usr/include/c++/14/ostream:178:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(long unsigned int) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>]'
178 | operator<<(unsigned long __n)
| ^~~~~~~~
/usr/include/c++/14/ostream:178:32: note: no known conversion for argument 1 from 'std::vector<std::__cxx11::basic_string<char> >' to 'long unsigned int'
178 | operator<<(unsigned long __n)
| ~~~~~~~~~~~~~~^~~
/usr/include/c++/14/ostream:182:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(bool) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>]'
182 | operator<<(bool __n)
| ^~~~~~~~
/usr/include/c++/14/ostream:182:23: note: no known conversion for argument 1 from 'std::vector<std::__cxx11::basic_string<char> >' to 'bool'
182 | operator<<(bool __n)
| ~~~~~^~~
In file included from /usr/include/c++/14/ostream:1022:
/usr/include/c++/14/bits/ostream.tcc:96:5: note: candidate: 'std::basic_ostream<_CharT, _Traits>& std::basic_ostream<_CharT, _Traits>::operator<<(short int) [with _CharT = char; _Traits = std::char_traits<char>]'
96 | basic_ostream<_CharT, _Traits>::
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/c++/14/bits/ostream.tcc:97:22: note: no known conversion for argument 1 from 'std::vector<std::__cxx11::basic_string<char> >' to 'short int'
97 | operator<<(short __n)
| ~~~~~~^~~
/usr/include/c++/14/ostream:189:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(short unsigned int) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>]'
189 | operator<<(unsigned short __n)
| ^~~~~~~~
/usr/include/c++/14/ostream:189:33: note: no known conversion for argument 1 from 'std::vector<std::__cxx11::basic_string<char> >' to 'short unsigned int'
189 | operator<<(unsigned short __n)
| ~~~~~~~~~~~~~~~^~~
/usr/include/c++/14/bits/ostream.tcc:110:5: note: candidate: 'std::basic_ostream<_CharT, _Traits>& std::basic_ostream<_CharT, _Traits>::operator<<(int) [with _CharT = char; _Traits = std::char_traits<char>]'
110 | basic_ostream<_CharT, _Traits>::
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/c++/14/bits/ostream.tcc:111:20: note: no known conversion for argument 1 from 'std::vector<std::__cxx11::basic_string<char> >' to 'int'
111 | operator<<(int __n)
| ~~~~^~~
/usr/include/c++/14/ostream:200:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(unsigned int) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>]'
200 | operator<<(unsigned int __n)
| ^~~~~~~~
/usr/include/c++/14/ostream:200:31: note: no known conversion for argument 1 from 'std::vector<std::__cxx11::basic_string<char> >' to 'unsigned int'
200 | operator<<(unsigned int __n)
| ~~~~~~~~~~~~~^~~
/usr/include/c++/14/ostream:211:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(long long int) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>]'
211 | operator<<(long long __n)
| ^~~~~~~~
/usr/include/c++/14/ostream:211:28: note: no known conversion for argument 1 from 'std::vector<std::__cxx11::basic_string<char> >' to 'long long int'
211 | operator<<(long long __n)
| ~~~~~~~~~~^~~
/usr/include/c++/14/ostream:215:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(long long unsigned int) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>]'
215 | operator<<(unsigned long long __n)
| ^~~~~~~~
/usr/include/c++/14/ostream:215:37: note: no known conversion for argument 1 from 'std::vector<std::__cxx11::basic_string<char> >' to 'long long unsigned int'
215 | operator<<(unsigned long long __n)
| ~~~~~~~~~~~~~~~~~~~^~~
/usr/include/c++/14/ostream:231:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(double) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>]'
231 | operator<<(double __f)
| ^~~~~~~~
/usr/include/c++/14/ostream:231:25: note: no known conversion for argument 1 from 'std::vector<std::__cxx11::basic_string<char> >' to 'double'
231 | operator<<(double __f)
| ~~~~~~~^~~
/usr/include/c++/14/ostream:235:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(float) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>]'
235 | operator<<(float __f)
| ^~~~~~~~
/usr/include/c++/14/ostream:235:24: note: no known conversion for argument 1 from 'std::vector<std::__cxx11::basic_string<char> >' to 'float'
235 | operator<<(float __f)
| ~~~~~~^~~
/usr/include/c++/14/ostream:243:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(long double) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>]'
243 | operator<<(long double __f)
| ^~~~~~~~
/usr/include/c++/14/ostream:243:30: note: no known conversion for argument 1 from 'std::vector<std::__cxx11::basic_string<char> >' to 'long double'
243 | operator<<(long double __f)
| ~~~~~~~~~~~~^~~
/usr/include/c++/14/ostream:301:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(const void*) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>]'
301 | operator<<(const void* __p)
| ^~~~~~~~
/usr/include/c++/14/ostream:301:30: note: no known conversion for argument 1 from 'std::vector<std::__cxx11::basic_string<char> >' to 'const void*'
301 | operator<<(const void* __p)
| ~~~~~~~~~~~~^~~
/usr/include/c++/14/
|
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);
}
cout << result << endl;
}
|
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<char>}
| int
In file included from /usr/include/c++/14/string:48,
from /usr/include/c++/14/bits/locale_classes.h:40,
from /usr/include/c++/14/bits/ios_base.h:41,
from /usr/include/c++/14/ios:44,
from /usr/include/c++/14/ostream:40,
from /usr/include/c++/14/iostream:41,
from a.cc:2:
/usr/include/c++/14/bits/stl_iterator.h:448:5: note: candidate: 'template<class _Iterator> constexpr bool std::operator<(const reverse_iterator<_Iterator>&, const reverse_iterator<_Iterator>&)'
448 | operator<(const reverse_iterator<_Iterator>& __x,
| ^~~~~~~~
/usr/include/c++/14/bits/stl_iterator.h:448:5: note: template argument deduction/substitution failed:
a.cc:10:19: note: mismatched types 'const std::reverse_iterator<_Iterator>' and 'int'
10 | for(int i=0;i<n;i++)
| ^
/usr/include/c++/14/bits/stl_iterator.h:493:5: note: candidate: 'template<class _IteratorL, class _IteratorR> constexpr bool std::operator<(const reverse_iterator<_Iterator>&, const reverse_iterator<_IteratorR>&)'
493 | operator<(const reverse_iterator<_IteratorL>& __x,
| ^~~~~~~~
/usr/include/c++/14/bits/stl_iterator.h:493:5: note: template argument deduction/substitution failed:
a.cc:10:19: note: mismatched types 'const std::reverse_iterator<_Iterator>' and 'int'
10 | for(int i=0;i<n;i++)
| ^
/usr/include/c++/14/bits/stl_iterator.h:1694:5: note: candidate: 'template<class _IteratorL, class _IteratorR> constexpr bool std::operator<(const move_iterator<_IteratorL>&, const move_iterator<_IteratorR>&)'
1694 | operator<(const move_iterator<_IteratorL>& __x,
| ^~~~~~~~
/usr/include/c++/14/bits/stl_iterator.h:1694:5: note: template argument deduction/substitution failed:
a.cc:10:19: note: mismatched types 'const std::move_iterator<_IteratorL>' and 'int'
10 | for(int i=0;i<n;i++)
| ^
/usr/include/c++/14/bits/stl_iterator.h:1760:5: note: candidate: 'template<class _Iterator> constexpr bool std::operator<(const move_iterator<_IteratorL>&, const move_iterator<_IteratorL>&)'
1760 | operator<(const move_iterator<_Iterator>& __x,
| ^~~~~~~~
/usr/include/c++/14/bits/stl_iterator.h:1760:5: note: template argument deduction/substitution failed:
a.cc:10:19: note: mismatched types 'const std::move_iterator<_IteratorL>' and 'int'
10 | for(int i=0;i<n;i++)
| ^
In file included from /usr/include/c++/14/bits/stl_algobase.h:64,
from /usr/include/c++/14/string:51:
/usr/include/c++/14/bits/stl_pair.h:1045:5: note: candidate: 'template<class _T1, class _T2> constexpr bool std::operator<(const pair<_T1, _T2>&, const pair<_T1, _T2>&)'
1045 | operator<(const pair<_T1, _T2>& __x, const pair<_T1, _T2>& __y)
| ^~~~~~~~
/usr/include/c++/14/bits/stl_pair.h:1045:5: note: template argument deduction/substitution failed:
a.cc:10:19: note: mismatched types 'const std::pair<_T1, _T2>' and 'int'
10 | for(int i=0;i<n;i++)
| ^
In file included from /usr/include/c++/14/bits/basic_string.h:47,
from /usr/include/c++/14/string:54:
/usr/include/c++/14/string_view:673:5: note: candidate: 'template<class _CharT, class _Traits> constexpr bool std::operator<(basic_string_view<_CharT, _Traits>, basic_string_view<_CharT, _Traits>)'
673 | operator< (basic_string_view<_CharT, _Traits> __x,
| ^~~~~~~~
/usr/include/c++/14/string_view:673:5: note: template argument deduction/substitution failed:
a.cc:10:19: note: mismatched types 'std::basic_string_view<_CharT, _Traits>' and 'int'
10 | for(int i=0;i<n;i++)
| ^
/usr/include/c++/14/string_view:680:5: note: candidate: 'template<class _CharT, class _Traits> constexpr bool std::operator<(basic_string_view<_CharT, _Traits>, __type_identity_t<basic_string_view<_CharT, _Traits> >)'
680 | operator< (basic_string_view<_CharT, _Traits> __x,
| ^~~~~~~~
/usr/include/c++/14/string_view:680:5: note: template argument deduction/substitution failed:
a.cc:10:19: note: mismatched types 'std::basic_string_view<_CharT, _Traits>' and 'int'
10 | for(int i=0;i<n;i++)
| ^
/usr/include/c++/14/string_view:688:5: note: candidate: 'template<class _CharT, class _Traits> constexpr bool std::operator<(__type_identity_t<basic_string_view<_CharT, _Traits> >, basic_string_view<_CharT, _Traits>)'
688 | operator< (__type_identity_t<basic_string_view<_CharT, _Traits>> __x,
| ^~~~~~~~
/usr/include/c++/14/string_view:688:5: note: template argument deduction/substitution failed:
a.cc:10:19: note: 'std::__cxx11::basic_string<char>' is not derived from 'std::basic_string_view<_CharT, _Traits>'
10 | for(int i=0;i<n;i++)
| ^
/usr/include/c++/14/bits/basic_string.h:3874:5: note: candidate: 'template<class _CharT, class _Traits, class _Alloc> bool std::operator<(const __cxx11::basic_string<_CharT, _Traits, _Allocator>&, const __cxx11::basic_string<_CharT, _Traits, _Allocator>&)'
3874 | operator<(const basic_string<_CharT, _Traits, _Alloc>& __lhs,
| ^~~~~~~~
/usr/include/c++/14/bits/basic_string.h:3874:5: note: template argument deduction/substitution failed:
a.cc:10:19: note: mismatched types 'const std::__cxx11::basic_string<_CharT, _Traits, _Allocator>' and 'int'
10 | for(int i=0;i<n;i++)
| ^
/usr/include/c++/14/bits/basic_string.h:3888:5: note: candidate: 'template<class _CharT, class _Traits, class _Alloc> bool std::operator<(const __cxx11::basic_string<_CharT, _Traits, _Allocator>&, const _CharT*)'
3888 | operator<(const basic_string<_CharT, _Traits, _Alloc>& __lhs,
| ^~~~~~~~
/usr/include/c++/14/bits/basic_string.h:3888:5: note: template argument deduction/substitution failed:
a.cc:10:19: note: mismatched types 'const std::__cxx11::basic_string<_CharT, _Traits, _Allocator>' and 'int'
10 | for(int i=0;i<n;i++)
| ^
/usr/include/c++/14/bits/basic_string.h:3901:5: note: candidate: 'template<class _CharT, class _Traits, class _Alloc> bool std::operator<(const _CharT*, const __cxx11::basic_string<_CharT, _Traits, _Allocator>&)'
3901 | operator<(const _CharT* __lhs,
| ^~~~~~~~
/usr/include/c++/14/bits/basic_string.h:3901:5: note: template argument deduction/substitution failed:
a.cc:10:19: note: mismatched types 'const _CharT*' and 'int'
10 | for(int i=0;i<n;i++)
| ^
In file included from /usr/include/c++/14/bits/memory_resource.h:47,
from /usr/include/c++/14/string:68:
/usr/include/c++/14/tuple:2600:5: note: candidate: 'template<class ... _TElements, class ... _UElements> constexpr bool std::operator<(const tuple<_UTypes ...>&, const tuple<_Elements ...>&)'
2600 | operator<(const tuple<_TElements...>& __t,
| ^~~~~~~~
/usr/include/c++/14/tuple:2600:5: note: template argument deduction/substitution failed:
a.cc:10:19: note: mismatched types 'const std::tuple<_UTypes ...>' and 'int'
10 | for(int i=0;i<n;i++)
| ^
In file included from /usr/include/c++/14/bits/ios_base.h:46:
/usr/include/c++/14/system_error:324:3: note: candidate: 'bool std::operator<(const error_code&, const error_code&)'
324 | operator<(const error_code& __lhs, const error_code& __rhs) noexcept
| ^~~~~~~~
/usr/include/c++/14/system_error:324:31: note: no known conversion for argument 1 from 'int' to 'const std::error_code&'
324 | operator<(const error_code& __lhs, const error_code& __rhs) noexcept
| ~~~~~~~~~~~~~~~~~~^~~~~
/usr/include/c++/14/system_error:507:3: note: candidate: 'bool std::operator<(const error_condition&, const error_condition&)'
507 | operator<(const error_condition& __lhs,
| ^~~~~~~~
/usr/include/c++/14/system_error:507:36: note: no known conversion for argument 1 from 'int' to 'const std::error_condition&'
507 | operator<(const error_condition& __lhs,
| ~~~~~~~~~~~~~~~~~~~~~~~^~~~~
a.cc:12:13: error: no match for 'operator+' (operand types are 'std::string [100]' {aka 'std::__cxx11::basic_string<char> [100]'} and 'std::string' {aka 'std::__cxx11::basic_string<char>'})
12 | sort(a,a+n);
| ~^~
| | |
| | std::string {aka std::__cxx11::basic_string<char>}
| std::string [100] {aka std::__cxx11::basic_string<char> [100]}
/usr/include/c++/14/bits/stl_iterator.h:627:5: note: candidate: 'template<class _Iterator> constexpr std::reverse_iterator<_Iterator> std::operator+(typename reverse_iterator<_Iterator>::difference_type, const reverse_iterator<_Iterator>&)'
627 | operator+(typename reverse_iterator<_Iterator>::difference_type __n,
| ^~~~~~~~
/usr/include/c++/14/bits/stl_iterator.h:627:5: note: template argument deduction/substitution failed:
a.cc:12:14: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::reverse_iterator<_Iterator>'
12 | sort(a,a+n);
| ^
/usr/include/c++/14/bits/stl_iterator.h:1798:5: note: candidate: 'template<class _Iterator> constexpr std::move_iterator<_IteratorL> std::operator+(typename move_iterator<_IteratorL>::difference_type, const move_iterator<_IteratorL>&)'
1798 | operator+(typename move_iterator<_Iterator>::difference_type __n,
| ^~~~~~~~
/usr/include/c++/14/bits/stl_iterator.h:1798:5: note: template argument deduction/substitution failed:
a.cc:12:14: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::move_iterator<_IteratorL>'
12 | sort(a,a+n);
| ^
|
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,
from /usr/include/c++/14/iostream:41,
from a.cc:1:
/usr/include/c++/14/bits/stringfwd.h:77:33: note: 'std::string'
77 | typedef basic_string<char> string;
| ^~~~~~
In file included from /usr/include/c++/14/bits/locale_classes.h:40,
from /usr/include/c++/14/bits/ios_base.h:41,
from /usr/include/c++/14/ios:44:
/usr/include/c++/14/string:76:11: note: 'std::pmr::string'
76 | using string = basic_string<char>;
| ^~~~~~
a.cc:4:20: error: 'string' was not declared in this scope
4 | bool fun(string a, string b){
| ^~~~~~
a.cc:4:20: note: suggested alternatives:
/usr/include/c++/14/bits/stringfwd.h:77:33: note: 'std::string'
77 | typedef basic_string<char> string;
| ^~~~~~
/usr/include/c++/14/string:76:11: note: 'std::pmr::string'
76 | using string = basic_string<char>;
| ^~~~~~
a.cc:4:28: error: expression list treated as compound expression in initializer [-fpermissive]
4 | bool fun(string a, string b){
| ^
a.cc:8:7: error: expected nested-name-specifier before 'name'
8 | using name space std;
| ^~~~
a.cc: In function 'int main()':
a.cc:11:3: error: 'cin' was not declared in this scope; did you mean 'std::cin'?
11 | cin>>n>>l;
| ^~~
| std::cin
/usr/include/c++/14/iostream:62:18: note: 'std::cin' declared here
62 | extern istream cin; ///< Linked to standard input
| ^~~
a.cc:12:3: error: 'string' was not declared in this scope
12 | string a[n];
| ^~~~~~
a.cc:12:3: note: suggested alternatives:
/usr/include/c++/14/bits/stringfwd.h:77:33: note: 'std::string'
77 | typedef basic_string<char> string;
| ^~~~~~
/usr/include/c++/14/string:76:11: note: 'std::pmr::string'
76 | using string = basic_string<char>;
| ^~~~~~
a.cc:14:10: error: 'a' was not declared in this scope
14 | cin>>a[i];
| ^
a.cc:16:8: error: 'a' was not declared in this scope
16 | sort(a,a+n,fun);
| ^
a.cc:16:3: error: 'sort' was not declared in this scope; did you mean 'std::sort'?
16 | sort(a,a+n,fun);
| ^~~~
| std::sort
In file included from /usr/include/c++/14/algorithm:86,
from a.cc:3:
/usr/include/c++/14/pstl/glue_algorithm_defs.h:296:1: note: 'std::sort' declared here
296 | sort(_ExecutionPolicy&& __exec, _RandomAccessIterator __first, _RandomAccessIterator __last);
| ^~~~
a.cc:18:5: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
18 | cout<<a[i];
| ^~~~
| std::cout
/usr/include/c++/14/iostream:63:18: note: 'std::cout' declared here
63 | extern ostream cout; ///< Linked to standard output
| ^~~~
|
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,
from /usr/include/c++/14/iostream:41,
from a.cc:1:
/usr/include/c++/14/bits/stringfwd.h:77:33: note: 'std::string'
77 | typedef basic_string<char> string;
| ^~~~~~
In file included from /usr/include/c++/14/bits/locale_classes.h:40,
from /usr/include/c++/14/bits/ios_base.h:41,
from /usr/include/c++/14/ios:44:
/usr/include/c++/14/string:76:11: note: 'std::pmr::string'
76 | using string = basic_string<char>;
| ^~~~~~
a.cc:4:20: error: 'string' was not declared in this scope
4 | bool fun(string a, string b){
| ^~~~~~
a.cc:4:20: note: suggested alternatives:
/usr/include/c++/14/bits/stringfwd.h:77:33: note: 'std::string'
77 | typedef basic_string<char> string;
| ^~~~~~
/usr/include/c++/14/string:76:11: note: 'std::pmr::string'
76 | using string = basic_string<char>;
| ^~~~~~
a.cc:4:28: error: expression list treated as compound expression in initializer [-fpermissive]
4 | bool fun(string a, string b){
| ^
a.cc:8:7: error: expected nested-name-specifier before 'name'
8 | using name space std;
| ^~~~
a.cc: In function 'int main()':
a.cc:11:3: error: 'cin' was not declared in this scope; did you mean 'std::cin'?
11 | cin>>n>>l;
| ^~~
| std::cin
/usr/include/c++/14/iostream:62:18: note: 'std::cin' declared here
62 | extern istream cin; ///< Linked to standard input
| ^~~
a.cc:12:3: error: 'string' was not declared in this scope
12 | string a[n];
| ^~~~~~
a.cc:12:3: note: suggested alternatives:
/usr/include/c++/14/bits/stringfwd.h:77:33: note: 'std::string'
77 | typedef basic_string<char> string;
| ^~~~~~
/usr/include/c++/14/string:76:11: note: 'std::pmr::string'
76 | using string = basic_string<char>;
| ^~~~~~
a.cc:14:10: error: 'a' was not declared in this scope
14 | cin>>a[i];
| ^
a.cc:16:8: error: 'a' was not declared in this scope
16 | sort(a,a+n,fun);
| ^
a.cc:16:3: error: 'sort' was not declared in this scope; did you mean 'std::sort'?
16 | sort(a,a+n,fun);
| ^~~~
| std::sort
In file included from /usr/include/c++/14/algorithm:86,
from a.cc:3:
/usr/include/c++/14/pstl/glue_algorithm_defs.h:296:1: note: 'std::sort' declared here
296 | sort(_ExecutionPolicy&& __exec, _RandomAccessIterator __first, _RandomAccessIterator __last);
| ^~~~
a.cc:18:5: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
18 | cout<<a[i];
| ^~~~
| std::cout
/usr/include/c++/14/iostream:63:18: note: 'std::cout' declared here
63 | extern ostream cout; ///< Linked to standard output
| ^~~~
|
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/c++/14/iostream:62:18: note: 'std::cin' declared here
62 | extern istream cin; ///< Linked to standard input
| ^~~
a.cc:8:3: error: 'string' was not declared in this scope
8 | string a[n];
| ^~~~~~
a.cc:8:3: note: suggested alternatives:
In file included from /usr/include/c++/14/iosfwd:41,
from /usr/include/c++/14/ios:40,
from /usr/include/c++/14/ostream:40,
from /usr/include/c++/14/iostream:41:
/usr/include/c++/14/bits/stringfwd.h:77:33: note: 'std::string'
77 | typedef basic_string<char> string;
| ^~~~~~
In file included from /usr/include/c++/14/bits/locale_classes.h:40,
from /usr/include/c++/14/bits/ios_base.h:41,
from /usr/include/c++/14/ios:44:
/usr/include/c++/14/string:76:11: note: 'std::pmr::string'
76 | using string = basic_string<char>;
| ^~~~~~
a.cc:10:10: error: 'a' was not declared in this scope
10 | cin>>a[i];
| ^
a.cc:12:8: error: 'a' was not declared in this scope
12 | sort(a,a+n);
| ^
a.cc:12:3: error: 'sort' was not declared in this scope; did you mean 'std::sort'?
12 | sort(a,a+n);
| ^~~~
| std::sort
In file included from /usr/include/c++/14/algorithm:86,
from a.cc:3:
/usr/include/c++/14/pstl/glue_algorithm_defs.h:296:1: note: 'std::sort' declared here
296 | sort(_ExecutionPolicy&& __exec, _RandomAccessIterator __first, _RandomAccessIterator __last);
| ^~~~
a.cc:14:5: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
14 | cout<<a[i];
| ^~~~
| std::cout
/usr/include/c++/14/iostream:63:18: note: 'std::cout' declared here
63 | extern ostream cout; ///< Linked to standard output
| ^~~~
|
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-class type 'std::string [(n + -1)]' {aka 'std::__cxx11::basic_string<char> [(n + -1)]'}
11 | sort(s.begin(),s.end());
| ^~~
a.cc:12:9: error: 'i' was not declared in this scope
12 | for(i=0;i<n;i++){
| ^
|
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: 'cin' does not name a type
8 | cin >> n,l;
| ^~~
a.cc:9:3: error: expected unqualified-id before 'for'
9 | for(int i=0;i<n;i++){
| ^~~
a.cc:9:15: error: 'i' does not name a type
9 | for(int i=0;i<n;i++){
| ^
a.cc:9:19: error: 'i' does not name a type
9 | for(int i=0;i<n;i++){
| ^
a.cc:13:7: error: expected constructor, destructor, or type conversion before '(' token
13 | sort(vs.begin(),vs.end());
| ^
a.cc:14:3: error: expected unqualified-id before 'for'
14 | for(i=0;i<vs.size();i++){
| ^~~
a.cc:14:11: error: 'i' does not name a type
14 | for(i=0;i<vs.size();i++){
| ^
a.cc:14:23: error: 'i' does not name a type
14 | for(i=0;i<vs.size();i++){
| ^
a.cc:17:3: error: 'cout' does not name a type
17 | cout << result << endl;
| ^~~~
a.cc:18:3: error: expected unqualified-id before 'return'
18 | return 0;
| ^~~~~~
a.cc:19:1: error: expected declaration before '}' token
19 | }
| ^
|
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/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:51,
from a.cc:1:
/usr/include/c++/14/bits/stl_algo.h:4762:5: note: candidate: 'template<class _RAIter> void std::sort(_RAIter, _RAIter)'
4762 | sort(_RandomAccessIterator __first, _RandomAccessIterator __last)
| ^~~~
/usr/include/c++/14/bits/stl_algo.h:4762:5: note: template argument deduction/substitution failed:
a.cc:15:9: note: couldn't deduce template parameter '_RAIter'
15 | sort(a.begin,a.end);
| ~~~~^~~~~~~~~~~~~~~
/usr/include/c++/14/bits/stl_algo.h:4793:5: note: candidate: 'template<class _RAIter, class _Compare> void std::sort(_RAIter, _RAIter, _Compare)'
4793 | sort(_RandomAccessIterator __first, _RandomAccessIterator __last,
| ^~~~
/usr/include/c++/14/bits/stl_algo.h:4793:5: note: candidate expects 3 arguments, 2 provided
In file included from /usr/include/c++/14/algorithm:86:
/usr/include/c++/14/pstl/glue_algorithm_defs.h:292:1: note: candidate: 'template<class _ExecutionPolicy, class _RandomAccessIterator, class _Compare> __pstl::__internal::__enable_if_execution_policy<_ExecutionPolicy, void> std::sort(_ExecutionPolicy&&, _RandomAccessIterator, _RandomAccessIterator, _Compare)'
292 | sort(_ExecutionPolicy&& __exec, _RandomAccessIterator __first, _RandomAccessIterator __last, _Compare __comp);
| ^~~~
/usr/include/c++/14/pstl/glue_algorithm_defs.h:292:1: note: candidate expects 4 arguments, 2 provided
/usr/include/c++/14/pstl/glue_algorithm_defs.h:296:1: note: candidate: 'template<class _ExecutionPolicy, class _RandomAccessIterator> __pstl::__internal::__enable_if_execution_policy<_ExecutionPolicy, void> std::sort(_ExecutionPolicy&&, _RandomAccessIterator, _RandomAccessIterator)'
296 | sort(_ExecutionPolicy&& __exec, _RandomAccessIterator __first, _RandomAccessIterator __last);
| ^~~~
/usr/include/c++/14/pstl/glue_algorithm_defs.h:296:1: note: candidate expects 3 arguments, 2 provided
|
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(<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/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:51,
from a.cc:1:
/usr/include/c++/14/bits/stl_algo.h:4762:5: note: candidate: 'template<class _RAIter> void std::sort(_RAIter, _RAIter)'
4762 | sort(_RandomAccessIterator __first, _RandomAccessIterator __last)
| ^~~~
/usr/include/c++/14/bits/stl_algo.h:4762:5: note: template argument deduction/substitution failed:
a.cc:15:9: note: couldn't deduce template parameter '_RAIter'
15 | sort(a.begin,a.end);
| ~~~~^~~~~~~~~~~~~~~
/usr/include/c++/14/bits/stl_algo.h:4793:5: note: candidate: 'template<class _RAIter, class _Compare> void std::sort(_RAIter, _RAIter, _Compare)'
4793 | sort(_RandomAccessIterator __first, _RandomAccessIterator __last,
| ^~~~
/usr/include/c++/14/bits/stl_algo.h:4793:5: note: candidate expects 3 arguments, 2 provided
In file included from /usr/include/c++/14/algorithm:86:
/usr/include/c++/14/pstl/glue_algorithm_defs.h:292:1: note: candidate: 'template<class _ExecutionPolicy, class _RandomAccessIterator, class _Compare> __pstl::__internal::__enable_if_execution_policy<_ExecutionPolicy, void> std::sort(_ExecutionPolicy&&, _RandomAccessIterator, _RandomAccessIterator, _Compare)'
292 | sort(_ExecutionPolicy&& __exec, _RandomAccessIterator __first, _RandomAccessIterator __last, _Compare __comp);
| ^~~~
/usr/include/c++/14/pstl/glue_algorithm_defs.h:292:1: note: candidate expects 4 arguments, 2 provided
/usr/include/c++/14/pstl/glue_algorithm_defs.h:296:1: note: candidate: 'template<class _ExecutionPolicy, class _RandomAccessIterator> __pstl::__internal::__enable_if_execution_policy<_ExecutionPolicy, void> std::sort(_ExecutionPolicy&&, _RandomAccessIterator, _RandomAccessIterator)'
296 | sort(_ExecutionPolicy&& __exec, _RandomAccessIterator __first, _RandomAccessIterator __last);
| ^~~~
/usr/include/c++/14/pstl/glue_algorithm_defs.h:296:1: note: candidate expects 3 arguments, 2 provided
|
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 function type>)'
15 | sort(a.begin,a.end);
| ~~~~^~~~~~~~~~~~~~~
In file included from /usr/include/c++/14/algorithm:61,
from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:51,
from a.cc:1:
/usr/include/c++/14/bits/stl_algo.h:4762:5: note: candidate: 'template<class _RAIter> void std::sort(_RAIter, _RAIter)'
4762 | sort(_RandomAccessIterator __first, _RandomAccessIterator __last)
| ^~~~
/usr/include/c++/14/bits/stl_algo.h:4762:5: note: template argument deduction/substitution failed:
a.cc:15:9: note: couldn't deduce template parameter '_RAIter'
15 | sort(a.begin,a.end);
| ~~~~^~~~~~~~~~~~~~~
/usr/include/c++/14/bits/stl_algo.h:4793:5: note: candidate: 'template<class _RAIter, class _Compare> void std::sort(_RAIter, _RAIter, _Compare)'
4793 | sort(_RandomAccessIterator __first, _RandomAccessIterator __last,
| ^~~~
/usr/include/c++/14/bits/stl_algo.h:4793:5: note: candidate expects 3 arguments, 2 provided
In file included from /usr/include/c++/14/algorithm:86:
/usr/include/c++/14/pstl/glue_algorithm_defs.h:292:1: note: candidate: 'template<class _ExecutionPolicy, class _RandomAccessIterator, class _Compare> __pstl::__internal::__enable_if_execution_policy<_ExecutionPolicy, void> std::sort(_ExecutionPolicy&&, _RandomAccessIterator, _RandomAccessIterator, _Compare)'
292 | sort(_ExecutionPolicy&& __exec, _RandomAccessIterator __first, _RandomAccessIterator __last, _Compare __comp);
| ^~~~
/usr/include/c++/14/pstl/glue_algorithm_defs.h:292:1: note: candidate expects 4 arguments, 2 provided
/usr/include/c++/14/pstl/glue_algorithm_defs.h:296:1: note: candidate: 'template<class _ExecutionPolicy, class _RandomAccessIterator> __pstl::__internal::__enable_if_execution_policy<_ExecutionPolicy, void> std::sort(_ExecutionPolicy&&, _RandomAccessIterator, _RandomAccessIterator)'
296 | sort(_ExecutionPolicy&& __exec, _RandomAccessIterator __first, _RandomAccessIterator __last);
| ^~~~
/usr/include/c++/14/pstl/glue_algorithm_defs.h:296:1: note: candidate expects 3 arguments, 2 provided
|
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++){
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:14:9: error: no matching function for call to 'sort(<unresolved overloaded function type>, <unresolved overloaded function type>)'
14 | sort(a.at(i).begin,a.at(i).end);
| ~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from /usr/include/c++/14/algorithm:61,
from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:51,
from a.cc:1:
/usr/include/c++/14/bits/stl_algo.h:4762:5: note: candidate: 'template<class _RAIter> void std::sort(_RAIter, _RAIter)'
4762 | sort(_RandomAccessIterator __first, _RandomAccessIterator __last)
| ^~~~
/usr/include/c++/14/bits/stl_algo.h:4762:5: note: template argument deduction/substitution failed:
a.cc:14:9: note: couldn't deduce template parameter '_RAIter'
14 | sort(a.at(i).begin,a.at(i).end);
| ~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/c++/14/bits/stl_algo.h:4793:5: note: candidate: 'template<class _RAIter, class _Compare> void std::sort(_RAIter, _RAIter, _Compare)'
4793 | sort(_RandomAccessIterator __first, _RandomAccessIterator __last,
| ^~~~
/usr/include/c++/14/bits/stl_algo.h:4793:5: note: candidate expects 3 arguments, 2 provided
In file included from /usr/include/c++/14/algorithm:86:
/usr/include/c++/14/pstl/glue_algorithm_defs.h:292:1: note: candidate: 'template<class _ExecutionPolicy, class _RandomAccessIterator, class _Compare> __pstl::__internal::__enable_if_execution_policy<_ExecutionPolicy, void> std::sort(_ExecutionPolicy&&, _RandomAccessIterator, _RandomAccessIterator, _Compare)'
292 | sort(_ExecutionPolicy&& __exec, _RandomAccessIterator __first, _RandomAccessIterator __last, _Compare __comp);
| ^~~~
/usr/include/c++/14/pstl/glue_algorithm_defs.h:292:1: note: candidate expects 4 arguments, 2 provided
/usr/include/c++/14/pstl/glue_algorithm_defs.h:296:1: note: candidate: 'template<class _ExecutionPolicy, class _RandomAccessIterator> __pstl::__internal::__enable_if_execution_policy<_ExecutionPolicy, void> std::sort(_ExecutionPolicy&&, _RandomAccessIterator, _RandomAccessIterator)'
296 | sort(_ExecutionPolicy&& __exec, _RandomAccessIterator __first, _RandomAccessIterator __last);
| ^~~~
/usr/include/c++/14/pstl/glue_algorithm_defs.h:296:1: note: candidate expects 3 arguments, 2 provided
a.cc:17:9: error: no matching function for call to 'sort(<unresolved overloaded function type>, <unresolved overloaded function type>)'
17 | sort(a.begin,a.end);
| ~~~~^~~~~~~~~~~~~~~
/usr/include/c++/14/bits/stl_algo.h:4762:5: note: candidate: 'template<class _RAIter> void std::sort(_RAIter, _RAIter)'
4762 | sort(_RandomAccessIterator __first, _RandomAccessIterator __last)
| ^~~~
/usr/include/c++/14/bits/stl_algo.h:4762:5: note: template argument deduction/substitution failed:
a.cc:17:9: note: couldn't deduce template parameter '_RAIter'
17 | sort(a.begin,a.end);
| ~~~~^~~~~~~~~~~~~~~
/usr/include/c++/14/bits/stl_algo.h:4793:5: note: candidate: 'template<class _RAIter, class _Compare> void std::sort(_RAIter, _RAIter, _Compare)'
4793 | sort(_RandomAccessIterator __first, _RandomAccessIterator __last,
| ^~~~
/usr/include/c++/14/bits/stl_algo.h:4793:5: note: candidate expects 3 arguments, 2 provided
/usr/include/c++/14/pstl/glue_algorithm_defs.h:292:1: note: candidate: 'template<class _ExecutionPolicy, class _RandomAccessIterator, class _Compare> __pstl::__internal::__enable_if_execution_policy<_ExecutionPolicy, void> std::sort(_ExecutionPolicy&&, _RandomAccessIterator, _RandomAccessIterator, _Compare)'
292 | sort(_ExecutionPolicy&& __exec, _RandomAccessIterator __first, _RandomAccessIterator __last, _Compare __comp);
| ^~~~
/usr/include/c++/14/pstl/glue_algorithm_defs.h:292:1: note: candidate expects 4 arguments, 2 provided
/usr/include/c++/14/pstl/glue_algorithm_defs.h:296:1: note: candidate: 'template<class _ExecutionPolicy, class _RandomAccessIterator> __pstl::__internal::__enable_if_execution_policy<_ExecutionPolicy, void> std::sort(_ExecutionPolicy&&, _RandomAccessIterator, _RandomAccessIterator)'
296 | sort(_ExecutionPolicy&& __exec, _RandomAccessIterator __first, _RandomAccessIterator __last);
| ^~~~
/usr/include/c++/14/pstl/glue_algorithm_defs.h:296:1: note: candidate expects 3 arguments, 2 provided
|
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];
| ~~~~ ^~ ~~~~
| | |
| | std::string {aka std::__cxx11::basic_string<char>}
| std::ostream {aka std::basic_ostream<char>}
In file included from /usr/include/c++/14/string:55,
from /usr/include/c++/14/bits/locale_classes.h:40,
from /usr/include/c++/14/bits/ios_base.h:41,
from /usr/include/c++/14/ios:44,
from /usr/include/c++/14/ostream:40,
from /usr/include/c++/14/iostream:41,
from a.cc:1:
/usr/include/c++/14/bits/basic_string.tcc:835:5: note: candidate: 'template<class _CharT, class _Traits, class _Alloc> std::basic_istream<_CharT, _Traits>& std::operator>>(basic_istream<_CharT, _Traits>&, __cxx11::basic_string<_CharT, _Traits, _Allocator>&)'
835 | operator>>(basic_istream<_CharT, _Traits>& __in,
| ^~~~~~~~
/usr/include/c++/14/bits/basic_string.tcc:835:5: note: template argument deduction/substitution failed:
a.cc:11:23: note: 'std::ostream' {aka 'std::basic_ostream<char>'} is not derived from 'std::basic_istream<_CharT, _Traits>'
11 | F(i,N) cout >> S[i];
| ^
In file included from /usr/include/c++/14/bits/memory_resource.h:38,
from /usr/include/c++/14/string:68:
/usr/include/c++/14/cstddef:131:5: note: candidate: 'template<class _IntegerType> constexpr std::__byte_op_t<_IntegerType> std::operator>>(byte, _IntegerType)'
131 | operator>>(byte __b, _IntegerType __shift) noexcept
| ^~~~~~~~
/usr/include/c++/14/cstddef:131:5: note: template argument deduction/substitution failed:
a.cc:11:12: note: cannot convert 'std::cout' (type 'std::ostream' {aka 'std::basic_ostream<char>'}) to type 'std::byte'
11 | F(i,N) cout >> S[i];
| ^~~~
In file included from /usr/include/c++/14/istream:1109,
from /usr/include/c++/14/iostream:42:
/usr/include/c++/14/bits/istream.tcc:978:5: note: candidate: 'template<class _CharT, class _Traits> std::basic_istream<_CharT, _Traits>& std::operator>>(basic_istream<_CharT, _Traits>&, _CharT&)'
978 | operator>>(basic_istream<_CharT, _Traits>& __in, _CharT& __c)
| ^~~~~~~~
/usr/include/c++/14/bits/istream.tcc:978:5: note: template argument deduction/substitution failed:
a.cc:11:23: note: 'std::ostream' {aka 'std::basic_ostream<char>'} is not derived from 'std::basic_istream<_CharT, _Traits>'
11 | F(i,N) cout >> S[i];
| ^
/usr/include/c++/14/istream:849:5: note: candidate: 'template<class _Traits> std::basic_istream<char, _Traits>& std::operator>>(basic_istream<char, _Traits>&, unsigned char&)'
849 | operator>>(basic_istream<char, _Traits>& __in, unsigned char& __c)
| ^~~~~~~~
/usr/include/c++/14/istream:849:5: note: template argument deduction/substitution failed:
a.cc:11:23: note: 'std::ostream' {aka 'std::basic_ostream<char>'} is not derived from 'std::basic_istream<char, _Traits>'
11 | F(i,N) cout >> S[i];
| ^
/usr/include/c++/14/istream:854:5: note: candidate: 'template<class _Traits> std::basic_istream<char, _Traits>& std::operator>>(basic_istream<char, _Traits>&, signed char&)'
854 | operator>>(basic_istream<char, _Traits>& __in, signed char& __c)
| ^~~~~~~~
/usr/include/c++/14/istream:854:5: note: template argument deduction/substitution failed:
a.cc:11:23: note: 'std::ostream' {aka 'std::basic_ostream<char>'} is not derived from 'std::basic_istream<char, _Traits>'
11 | F(i,N) cout >> S[i];
| ^
/usr/include/c++/14/istream:896:5: note: candidate: 'template<class _CharT, class _Traits> std::basic_istream<_CharT, _Traits>& std::operator>>(basic_istream<_CharT, _Traits>&, _CharT*)'
896 | operator>>(basic_istream<_CharT, _Traits>& __in, _CharT* __s)
| ^~~~~~~~
/usr/include/c++/14/istream:896:5: note: template argument deduction/substitution failed:
a.cc:11:23: note: 'std::ostream' {aka 'std::basic_ostream<char>'} is not derived from 'std::basic_istream<_CharT, _Traits>'
11 | F(i,N) cout >> S[i];
| ^
/usr/include/c++/14/istream:939:5: note: candidate: 'template<class _Traits> std::basic_istream<char, _Traits>& std::operator>>(basic_istream<char, _Traits>&, unsigned char*)'
939 | operator>>(basic_istream<char, _Traits>& __in, unsigned char* __s)
| ^~~~~~~~
/usr/include/c++/14/istream:939:5: note: template argument deduction/substitution failed:
a.cc:11:23: note: 'std::ostream' {aka 'std::basic_ostream<char>'} is not derived from 'std::basic_istream<char, _Traits>'
11 | F(i,N) cout >> S[i];
| ^
/usr/include/c++/14/istream:945:5: note: candidate: 'template<class _Traits> std::basic_istream<char, _Traits>& std::operator>>(basic_istream<char, _Traits>&, signed char*)'
945 | operator>>(basic_istream<char, _Traits>& __in, signed char* __s)
| ^~~~~~~~
/usr/include/c++/14/istream:945:5: note: template argument deduction/substitution failed:
a.cc:11:23: note: 'std::ostream' {aka 'std::basic_ostream<char>'} is not derived from 'std::basic_istream<char, _Traits>'
11 | F(i,N) cout >> S[i];
| ^
/usr/include/c++/14/istream:1099:5: note: candidate: 'template<class _Istream, class _Tp> _Istream&& std::operator>>(_Istream&&, _Tp&&)'
1099 | operator>>(_Istream&& __is, _Tp&& __x)
| ^~~~~~~~
/usr/include/c++/14/istream:1099:5: note: template argument deduction/substitution failed:
/usr/include/c++/14/istream: In substitution of 'template<class _Istream, class _Tp> _Istream&& std::operator>>(_Istream&&, _Tp&&) [with _Istream = std::basic_ostream<char>&; _Tp = std::__cxx11::basic_string<char>&]':
a.cc:11:23: required from here
11 | F(i,N) cout >> S[i];
| ^
/usr/include/c++/14/istream:1099:5: error: no type named 'type' in 'struct std::enable_if<false, void>'
1099 | operator>>(_Istream&& __is, _Tp&& __x)
| ^~~~~~~~
|
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];
| ~~~~ ^~ ~~~~
| | |
| | std::string {aka std::__cxx11::basic_string<char>}
| std::ostream {aka std::basic_ostream<char>}
In file included from /usr/include/c++/14/string:55,
from /usr/include/c++/14/bits/locale_classes.h:40,
from /usr/include/c++/14/bits/ios_base.h:41,
from /usr/include/c++/14/ios:44,
from /usr/include/c++/14/ostream:40,
from /usr/include/c++/14/iostream:41,
from a.cc:1:
/usr/include/c++/14/bits/basic_string.tcc:835:5: note: candidate: 'template<class _CharT, class _Traits, class _Alloc> std::basic_istream<_CharT, _Traits>& std::operator>>(basic_istream<_CharT, _Traits>&, __cxx11::basic_string<_CharT, _Traits, _Allocator>&)'
835 | operator>>(basic_istream<_CharT, _Traits>& __in,
| ^~~~~~~~
/usr/include/c++/14/bits/basic_string.tcc:835:5: note: template argument deduction/substitution failed:
a.cc:11:23: note: 'std::ostream' {aka 'std::basic_ostream<char>'} is not derived from 'std::basic_istream<_CharT, _Traits>'
11 | F(i,N) cout >> S[i];
| ^
In file included from /usr/include/c++/14/bits/memory_resource.h:38,
from /usr/include/c++/14/string:68:
/usr/include/c++/14/cstddef:131:5: note: candidate: 'template<class _IntegerType> constexpr std::__byte_op_t<_IntegerType> std::operator>>(byte, _IntegerType)'
131 | operator>>(byte __b, _IntegerType __shift) noexcept
| ^~~~~~~~
/usr/include/c++/14/cstddef:131:5: note: template argument deduction/substitution failed:
a.cc:11:12: note: cannot convert 'std::cout' (type 'std::ostream' {aka 'std::basic_ostream<char>'}) to type 'std::byte'
11 | F(i,N) cout >> S[i];
| ^~~~
In file included from /usr/include/c++/14/istream:1109,
from /usr/include/c++/14/iostream:42:
/usr/include/c++/14/bits/istream.tcc:978:5: note: candidate: 'template<class _CharT, class _Traits> std::basic_istream<_CharT, _Traits>& std::operator>>(basic_istream<_CharT, _Traits>&, _CharT&)'
978 | operator>>(basic_istream<_CharT, _Traits>& __in, _CharT& __c)
| ^~~~~~~~
/usr/include/c++/14/bits/istream.tcc:978:5: note: template argument deduction/substitution failed:
a.cc:11:23: note: 'std::ostream' {aka 'std::basic_ostream<char>'} is not derived from 'std::basic_istream<_CharT, _Traits>'
11 | F(i,N) cout >> S[i];
| ^
/usr/include/c++/14/istream:849:5: note: candidate: 'template<class _Traits> std::basic_istream<char, _Traits>& std::operator>>(basic_istream<char, _Traits>&, unsigned char&)'
849 | operator>>(basic_istream<char, _Traits>& __in, unsigned char& __c)
| ^~~~~~~~
/usr/include/c++/14/istream:849:5: note: template argument deduction/substitution failed:
a.cc:11:23: note: 'std::ostream' {aka 'std::basic_ostream<char>'} is not derived from 'std::basic_istream<char, _Traits>'
11 | F(i,N) cout >> S[i];
| ^
/usr/include/c++/14/istream:854:5: note: candidate: 'template<class _Traits> std::basic_istream<char, _Traits>& std::operator>>(basic_istream<char, _Traits>&, signed char&)'
854 | operator>>(basic_istream<char, _Traits>& __in, signed char& __c)
| ^~~~~~~~
/usr/include/c++/14/istream:854:5: note: template argument deduction/substitution failed:
a.cc:11:23: note: 'std::ostream' {aka 'std::basic_ostream<char>'} is not derived from 'std::basic_istream<char, _Traits>'
11 | F(i,N) cout >> S[i];
| ^
/usr/include/c++/14/istream:896:5: note: candidate: 'template<class _CharT, class _Traits> std::basic_istream<_CharT, _Traits>& std::operator>>(basic_istream<_CharT, _Traits>&, _CharT*)'
896 | operator>>(basic_istream<_CharT, _Traits>& __in, _CharT* __s)
| ^~~~~~~~
/usr/include/c++/14/istream:896:5: note: template argument deduction/substitution failed:
a.cc:11:23: note: 'std::ostream' {aka 'std::basic_ostream<char>'} is not derived from 'std::basic_istream<_CharT, _Traits>'
11 | F(i,N) cout >> S[i];
| ^
/usr/include/c++/14/istream:939:5: note: candidate: 'template<class _Traits> std::basic_istream<char, _Traits>& std::operator>>(basic_istream<char, _Traits>&, unsigned char*)'
939 | operator>>(basic_istream<char, _Traits>& __in, unsigned char* __s)
| ^~~~~~~~
/usr/include/c++/14/istream:939:5: note: template argument deduction/substitution failed:
a.cc:11:23: note: 'std::ostream' {aka 'std::basic_ostream<char>'} is not derived from 'std::basic_istream<char, _Traits>'
11 | F(i,N) cout >> S[i];
| ^
/usr/include/c++/14/istream:945:5: note: candidate: 'template<class _Traits> std::basic_istream<char, _Traits>& std::operator>>(basic_istream<char, _Traits>&, signed char*)'
945 | operator>>(basic_istream<char, _Traits>& __in, signed char* __s)
| ^~~~~~~~
/usr/include/c++/14/istream:945:5: note: template argument deduction/substitution failed:
a.cc:11:23: note: 'std::ostream' {aka 'std::basic_ostream<char>'} is not derived from 'std::basic_istream<char, _Traits>'
11 | F(i,N) cout >> S[i];
| ^
/usr/include/c++/14/istream:1099:5: note: candidate: 'template<class _Istream, class _Tp> _Istream&& std::operator>>(_Istream&&, _Tp&&)'
1099 | operator>>(_Istream&& __is, _Tp&& __x)
| ^~~~~~~~
/usr/include/c++/14/istream:1099:5: note: template argument deduction/substitution failed:
/usr/include/c++/14/istream: In substitution of 'template<class _Istream, class _Tp> _Istream&& std::operator>>(_Istream&&, _Tp&&) [with _Istream = std::basic_ostream<char>&; _Tp = std::__cxx11::basic_string<char>&]':
a.cc:11:23: required from here
11 | F(i,N) cout >> S[i];
| ^
/usr/include/c++/14/istream:1099:5: error: no type named 'type' in 'struct std::enable_if<false, void>'
1099 | operator>>(_Istream&& __is, _Tp&& __x)
| ^~~~~~~~
|
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' was not declared in this scope
10 | sort(S, S+N);
| ^
|
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>
+++ |+#include <vector>
2 | using namespace std;
a.cc:8:18: error: expected primary-expression before '>' token
8 | vector<string> S(N); F(i,N) cin >> S[i];
| ^
a.cc:8:20: error: 'S' was not declared in this scope
8 | vector<string> S(N); F(i,N) cin >> S[i];
| ^
a.cc:9:5: error: 'sort' was not declared in this scope; did you mean 'short'?
9 | sort(S, S+N);
| ^~~~
| short
|
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 in header '<vector>'; this is probably fixable by adding '#include <vector>'
1 | #include<iostream>
+++ |+#include <vector>
2 | using namespace std;
a.cc:8:18: error: expected primary-expression before '>' token
8 | vector<string> S(N); F(i,N) cin >> S[i];
| ^
a.cc:8:20: error: 'S' was not declared in this scope
8 | vector<string> S(N); F(i,N) cin >> S[i];
| ^
a.cc:8:28: error: 'i' was not declared in this scope
8 | vector<string> S(N); F(i,N) cin >> S[i];
| ^
a.cc:8:26: error: 'F' was not declared in this scope
8 | vector<string> S(N); F(i,N) cin >> S[i];
| ^
a.cc:9:5: error: 'sort' was not declared in this scope; did you mean 'short'?
9 | sort(S, S+N);
| ^~~~
| short
|
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++){
k=0;
while (a[j][k]==a[j+1][k]){
k++;
}
if (a[j][k]>a[j+1][k]){
for (k=0;k<l;k++){
swap(a[j][k],a[j+1][k]);
}
}
}
}
for (i=0;i<n;i++){
for (j=0;j<l;j++){
cout<<a[i][j];
}
}
return 0;
} k
|
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="";
for(i=0;i<n;i++){
gattai = gattai + strlist[i];
}
cout << gattai;
return 0;
}
|
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 | using namespace std;
a.cc:12:14: error: expected primary-expression before '>' token
12 | vector<string> strlist(n);
| ^
a.cc:12:16: error: 'strlist' was not declared in this scope
12 | vector<string> strlist(n);
| ^~~~~~~
a.cc:15:5: error: 'i' was not declared in this scope
15 | for(i=0;i<n;i++){
| ^
a.cc:19:1: error: 'sort' was not declared in this scope; did you mean 'short'?
19 | sort(strlist);
| ^~~~
| short
a.cc:21:5: error: 'i' was not declared in this scope
21 | for(i=0;i<n;i++){
| ^
|
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: request for member 'at' in 's', which is of non-class type 'int'
11 | cin >> s.at(i);
| ^~
a.cc:14:10: error: request for member 'begin' in 's', which is of non-class type 'int'
14 | sort(s.begin(), s.end());
| ^~~~~
a.cc:14:21: error: request for member 'end' in 's', which is of non-class type 'int'
14 | sort(s.begin(), s.end());
| ^~~
a.cc:17:19: error: request for member 'at' in 's', which is of non-class type 'int'
17 | cout << s.at(i);
| ^~
|
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(data.begin(), data.end());
for (int i = 0; i < N; i++)
{
cout << data[i];
}
}
|
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 | vector<string> data(N);
| ^~~~
|
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(data.begin(), data.end());
for (int i = 0; i < N; i++)
{
cout << data[i]<<endl;
}
}
|
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 | vector<string> data(N);
| ^~~~
|
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++)
{
cout << vec[i];
}
return 0;
}
|
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>
4 | using namespace std;
a.cc:9:18: error: expected primary-expression before '>' token
9 | vector<string> vec(n);
| ^
a.cc:9:20: error: 'vec' was not declared in this scope
9 | vector<string> vec(n);
| ^~~
|
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 this scope
13 | sort(s+1,s+n+1);
| ^
|
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++){
ary[i] = sc.next();
}
Arrays.sort(ary);
String answer = "";
for(int j=0; j<n; j++){
answer += ary[j];
}
System.out.println(answer);
}
}
|
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++){
ary[i] = sc.next();
}
Arrays.sort(ary);
String answer = "";
for(int j=0; j<n; j++){
answer += ary[i];
}
System.out.println(answer);
}
}
|
Main.java:24: error: cannot find symbol
answer += ary[i];
^
symbol: variable i
location: class Main
1 error
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.