submission_id stringlengths 10 10 | problem_id stringlengths 6 6 | language stringclasses 3
values | code stringlengths 1 522k | compiler_output stringlengths 43 10.2k |
|---|---|---|---|---|
s514660609 | p03712 | C++ | #include<bits/stdc++.h>
using namespace std;
int main(){
int H,W;
cin>>H>>W;
vector<vector<char>> a(H+2)(W+2);
for(int i=1;i<=H;i++){
for(int j=1;j<=W;j++){
cin>>a[i][j];
}
}
for(int i=0;i<H+2;i++){
a[i][0] = '#';
a[i][W+1] = '#';
}
for(int i=0;i<W+2;i++){
a[0][i] = '#';
a[H+1][i] = '#';
}
for(int i=0;i<=H+1;i++){
for(int j=0;j<=W+1;j++){
cout<<a[i][j];
}
cout<<"\n";
}
return 0;
} | a.cc: In function 'int main()':
a.cc:7:32: error: expected ',' or ';' before '(' token
7 | vector<vector<char>> a(H+2)(W+2);
| ^
|
s186803063 | p03712 | C++ | #include <bits/stdc++.h>
using namespace std;
int main() {
int h,w;
cin >> h >> w;
vector<string> a(h);
for(int i=0;i<h;i++){
cin >> a.at(i)
}
for(int i=0;i<h+2;i++){
if(i==0||i==h+1){
for(int j=0;j<w+2;j++){
cout << "#";
}
cout << endl;
}
else{
cout << "#" << a.at(i-1) << "#" << endl;
}
}
}
| a.cc: In function 'int main()':
a.cc:9:19: error: expected ';' before '}' token
9 | cin >> a.at(i)
| ^
| ;
10 | }
| ~
|
s840198316 | p03712 | C++ | #include <bits/stdc++.h>
using namespace std;
int main(){
int H,W;
cin >>H >>W;
vector<string> a(H*W);
for(int i=0; i<H*W; i++)
cin >>a.at(i);
for(int i=0;i<W+2;i++)
cout <<'#' ;
for(int j=0;j<H;j++){
cout <<endl <<'#';
for(int i=0; i<W;i++)
cout <<A.at(j*W+i);
cout <<'#';
}
cout<<endl;
for(int i=0;i<W+2;i++)
cout <<'#' ;
}
| a.cc: In function 'int main()':
a.cc:15:14: error: 'A' was not declared in this scope
15 | cout <<A.at(j*W+i);
| ^
|
s304308958 | p03712 | C++ | #include <bits/stdc++.h>
using namespace std;
int main(){
int H,W;
cin >>H >>W;
vector<string> a(H*W);
for(int i=0; i<H*W; i++)
cin >>a.at(i);
for(int i=0;i<W+2;i++)
cout <<'#' ;
for(int j=0;j<H;j++){
cout <<endl <<'#';
for(int i=0; i<)
cout <<A.at(j*W+i);
cout <<'#';
}
cout<<endl;
for(int i=0;i<W+2;i++)
cout <<'#' ;
}
| a.cc: In function 'int main()':
a.cc:14:20: error: expected primary-expression before ')' token
14 | for(int i=0; i<)
| ^
a.cc:14:20: error: expected ';' before ')' token
14 | for(int i=0; i<)
| ^
| ;
a.cc:15:14: error: 'A' was not declared in this scope
15 | cout <<A.at(j*W+i);
| ^
|
s268918051 | p03712 | C++ | #include <bits/stdc++.h>
using namespace std;
int main(){
int H,W;
cin <<H <<W;
vector<string> a(H*W);
for(int i=0; i<H*W; i++)
cin >>a.at(i);
for(int i=0;i<W+2;i++)
cout <<'#' ;
for(int j=0;j<H;j++){
cout <<endl <<'#';
for(int i=0; i<)
cout <<A.at(j*W+i);
cout <<'#';
}
cout<<endl;
for(int i=0;i<W+2;i++)
cout <<'#' ;
} | a.cc: In function 'int main()':
a.cc:6:7: error: no match for 'operator<<' (operand types are 'std::istream' {aka 'std::basic_istream<char>'} and 'int')
6 | cin <<H <<W;
| ~~~ ^~~
| | |
| | int
| std::istream {aka std::basic_istream<char>}
a.cc:6:7: note: candidate: 'operator<<(int, int)' (built-in)
6 | cin <<H <<W;
| ~~~~^~~
a.cc:6:7: note: no known conversion for argument 1 from 'std::istream' {aka 'std::basic_istream<char>'} to 'int'
In file included from /usr/include/c++/14/regex:68,
from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:181,
from a.cc:1:
/usr/include/c++/14/bits/regex.h:1715:5: note: candidate: 'template<class _Ch_type, class _Ch_traits, class _Bi_iter> std::basic_ostream<_CharT, _Traits>& std::__cxx11::operator<<(std::basic_ostream<_CharT, _Traits>&, const sub_match<_Bi_iter>&)'
1715 | operator<<(basic_ostream<_Ch_type, _Ch_traits>& __os,
| ^~~~~~~~
/usr/include/c++/14/bits/regex.h:1715:5: note: template argument deduction/substitution failed:
a.cc:6:9: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<_CharT, _Traits>'
6 | cin <<H <<W;
| ^
In file included from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:41:
/usr/include/c++/14/cstddef:125:5: note: candidate: 'template<class _IntegerType> constexpr std::__byte_op_t<_IntegerType> std::operator<<(byte, _IntegerType)'
125 | operator<<(byte __b, _IntegerType __shift) noexcept
| ^~~~~~~~
/usr/include/c++/14/cstddef:125:5: note: template argument deduction/substitution failed:
a.cc:6:3: note: cannot convert 'std::cin' (type 'std::istream' {aka 'std::basic_istream<char>'}) to type 'std::byte'
6 | cin <<H <<W;
| ^~~
In file included from /usr/include/c++/14/bits/basic_string.h:47,
from /usr/include/c++/14/string:54,
from /usr/include/c++/14/bitset:52,
from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:52:
/usr/include/c++/14/string_view:763:5: note: candidate: 'template<class _CharT, class _Traits> std::basic_ostream<_CharT, _Traits>& std::operator<<(basic_ostream<_CharT, _Traits>&, basic_string_view<_CharT, _Traits>)'
763 | operator<<(basic_ostream<_CharT, _Traits>& __os,
| ^~~~~~~~
/usr/include/c++/14/string_view:763:5: note: template argument deduction/substitution failed:
a.cc:6:9: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<_CharT, _Traits>'
6 | cin <<H <<W;
| ^
/usr/include/c++/14/bits/basic_string.h:4077:5: note: candidate: 'template<class _CharT, class _Traits, class _Alloc> std::basic_ostream<_CharT, _Traits>& std::operator<<(basic_ostream<_CharT, _Traits>&, const __cxx11::basic_string<_CharT, _Traits, _Allocator>&)'
4077 | operator<<(basic_ostream<_CharT, _Traits>& __os,
| ^~~~~~~~
/usr/include/c++/14/bits/basic_string.h:4077:5: note: template argument deduction/substitution failed:
a.cc:6:9: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<_CharT, _Traits>'
6 | cin <<H <<W;
| ^
/usr/include/c++/14/bitset:1687:5: note: candidate: 'template<class _CharT, class _Traits, long unsigned int _Nb> std::basic_ostream<_CharT, _Traits>& std::operator<<(basic_ostream<_CharT, _Traits>&, const bitset<_Nb>&)'
1687 | operator<<(std::basic_ostream<_CharT, _Traits>& __os,
| ^~~~~~~~
/usr/include/c++/14/bitset:1687:5: note: template argument deduction/substitution failed:
a.cc:6:9: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<_CharT, _Traits>'
6 | cin <<H <<W;
| ^
In file included from /usr/include/c++/14/bits/ios_base.h:46,
from /usr/include/c++/14/streambuf:43,
from /usr/include/c++/14/bits/streambuf_iterator.h:35,
from /usr/include/c++/14/iterator:66,
from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:54:
/usr/include/c++/14/system_error:339:5: note: candidate: 'template<class _CharT, class _Traits> std::basic_ostream<_CharT, _Traits>& std::operator<<(basic_ostream<_CharT, _Traits>&, const error_code&)'
339 | operator<<(basic_ostream<_CharT, _Traits>& __os, const error_code& __e)
| ^~~~~~~~
/usr/include/c++/14/system_error:339:5: note: template argument deduction/substitution failed:
a.cc:6:9: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<_CharT, _Traits>'
6 | cin <<H <<W;
| ^
In file included from /usr/include/c++/14/memory:80,
from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:56:
/usr/include/c++/14/bits/shared_ptr.h:70:5: note: candidate: 'template<class _Ch, class _Tr, class _Tp, __gnu_cxx::_Lock_policy _Lp> std::basic_ostream<_CharT, _Traits>& std::operator<<(basic_ostream<_CharT, _Traits>&, const __shared_ptr<_Tp, _Lp>&)'
70 | operator<<(std::basic_ostream<_Ch, _Tr>& __os,
| ^~~~~~~~
/usr/include/c++/14/bits/shared_ptr.h:70:5: note: template argument deduction/substitution failed:
a.cc:6:9: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<_CharT, _Traits>'
6 | cin <<H <<W;
| ^
In file included from /usr/include/c++/14/istream:41,
from /usr/include/c++/14/sstream:40,
from /usr/include/c++/14/complex:45,
from /usr/include/c++/14/ccomplex:39,
from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:127:
/usr/include/c++/14/ostream:563:5: note: candidate: 'template<class _CharT, class _Traits> std::basic_ostream<_CharT, _Traits>& std::operator<<(basic_ostream<_CharT, _Traits>&, _CharT)'
563 | operator<<(basic_ostream<_CharT, _Traits>& __out, _CharT __c)
| ^~~~~~~~
/usr/include/c++/14/ostream:563:5: note: template argument deduction/substitution failed:
a.cc:6:9: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<_CharT, _Traits>'
6 | cin <<H <<W;
| ^
/usr/include/c++/14/ostream:573:5: note: candidate: 'template<class _CharT, class _Traits> std::basic_ostream<_CharT, _Traits>& std::operator<<(basic_ostream<_CharT, _Traits>&, char)'
573 | operator<<(basic_ostream<_CharT, _Traits>& __out, char __c)
| ^~~~~~~~
/usr/include/c++/14/ostream:573:5: note: template argument deduction/substitution failed:
a.cc:6:9: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<_CharT, _Traits>'
6 | cin <<H <<W;
| ^
/usr/include/c++/14/ostream:579:5: note: candidate: 'template<class _Traits> std::basic_ostream<char, _Traits>& std::operator<<(basic_ostream<char, _Traits>&, char)'
579 | operator<<(basic_ostream<char, _Traits>& __out, char __c)
| ^~~~~~~~
/usr/include/c++/14/ostream:579:5: note: template argument deduction/substitution failed:
a.cc:6:9: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<char, _Traits>'
6 | cin <<H <<W;
| ^
/usr/include/c++/14/ostream:590:5: note: candidate: 'template<class _Traits> std::basic_ostream<char, _Traits>& std::operator<<(basic_ostream<char, _Traits>&, signed char)'
590 | operator<<(basic_ostream<char, _Traits>& __out, signed char __c)
| ^~~~~~~~
/usr/include/c++/14/ostream:590:5: note: template argument deduction/substitution failed:
a.cc:6:9: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<char, _Traits>'
6 | cin <<H <<W;
| ^
/usr/include/c++/14/ostream:595:5: note: candidate: 'template<class _Traits> std::basic_ostream<char, _Traits>& std::operator<<(basic_ostream<char, _Traits>&, unsigned char)'
595 | operator<<(basic_ostream<char, _Traits>& __out, unsigned char __c)
| ^~~~~~~~
/usr/include/c++/14/ostream:595:5: note: template argument deduction/substitution failed:
a.cc:6:9: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<char, _Traits>'
6 | cin <<H <<W;
| ^
/usr/include/c++/14/ostream:654:5: note: candidate: 'template<class _CharT, class _Traits> std::basic_ostream<_CharT, _Traits>& std::operator<<(basic_ostream<_CharT, _Traits>&, const _CharT*)'
654 | operator<<(basic_ostream<_CharT, _Traits>& __out, const _CharT* __s)
| ^~~~~~~~
/usr/include/c++/14/ostream:654:5: note: template argument deduction/substitution failed:
a.cc:6:9: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<_CharT, _Traits>'
6 | cin <<H <<W;
| ^
In file included from /usr/include/c++/14/ostream:1022:
/usr/include/c++/14/bits/ostream.tcc:307:5: note: candidate: 'template<class _CharT, class _Traits> std::basic_ostream<_CharT, _Traits>& std::operator<<(basic_ostream<_CharT, _Traits>&, const char*)'
307 | operator<<(basic_ostream<_CharT, _Traits>& __out, const char* __s)
| ^~~~~~~~
/usr/include/c++/14/bits/ostream.tcc:307:5: note: template argument deduction/substitution failed:
a.cc:6:9: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<_CharT, _Traits>'
6 | cin <<H <<W;
| ^
/usr/include/c++/14/ostream:671:5: note: candidate: 'template<class _Traits> std::basic_ostream<char, _Traits>& std::operator<<(basic_ostream<char, _Traits>&, const char*)'
671 | operator<<(basic_ostream<char, _Traits>& __out, const char* __s)
| ^~~~~~~~
/usr/include/c++/14/ostream:671:5: note: template argument deduction/substitution failed:
a.cc:6:9: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<char, _Traits>'
6 | cin <<H <<W;
| ^
/usr/include/c++/14/ostream:684:5: note: candidate: 'template<class _Traits> std::basic_ostream<char, _Traits>& std::operator<<(basic_ostream<char, _Traits>&, const si |
s795423112 | p03712 | C++ | #include <bits/stdc++.h>
using namespace std;
int main () {
int H, W;
cin >> H >> W;
cout << string(W + 2, '#') << endl;
for (int i = 0; i < H; i++) {
string h;
cin >> h;
cout << '#' << h << '#' << endl;
}
cout << string(W + 2, '#') << endl;
}
#include <bits/stdioc++.h>
using namespace std;
int main () {
int H, W;
cin >> H >> W;
cout << string(W + 2, '#') << endl;
for (int i = 0; i < H; i++) {
string h;
cin >> h;
cout << '#' << h << '#' << endl;
}
cout << string(W + 2, '#') << endl;
}
提出情報 | a.cc:19:10: fatal error: bits/stdioc++.h: No such file or directory
19 | #include <bits/stdioc++.h>
| ^~~~~~~~~~~~~~~~~
compilation terminated.
|
s274254092 | p03712 | C++ | #include <bits/stdioc++.h>
using namespace std;
int main () {
int H, W;
cin >> H >> W;
cout << string(W + 2, '#') << endl;
for (int i = 0; i < H; i++) {
string h;
cin >> h;
cout << '#' << h << '#' << endl;
}
cout << string(W + 2, '#') << endl;
}
| a.cc:1:10: fatal error: bits/stdioc++.h: No such file or directory
1 | #include <bits/stdioc++.h>
| ^~~~~~~~~~~~~~~~~
compilation terminated.
|
s305818437 | p03712 | C++ | #include <bits/stdioc++.h>;
using namespace std;
int main () {
int H, W;
cin >> H >> W;
cout >> string(W + 2, '#') >> endl;
for (int i = 0; i < H + 2; i++) {
string h;
cin >> h;
cout >> '#' >> h >> '#' >> endl;
}
cout >> string(W + 2, '#') >> endl;
}
| a.cc:1:27: warning: extra tokens at end of #include directive
1 | #include <bits/stdioc++.h>;
| ^
a.cc:1:10: fatal error: bits/stdioc++.h: No such file or directory
1 | #include <bits/stdioc++.h>;
| ^~~~~~~~~~~~~~~~~
compilation terminated.
|
s435955373 | p03712 | C++ | #include <bits/stdioc++.h>
using namespace std;
int main () {
int H, W;
cin >> H >> W;
cout >> string(W + 2, '#') >> endl;
for (int i = 0; i < H + 2; i++) {
string h;
cin >> h;
cout >> '#' >> h >> '#' >> endl;
}
cout >> string(W + 2, '#') >> endl;
}
| a.cc:1:10: fatal error: bits/stdioc++.h: No such file or directory
1 | #include <bits/stdioc++.h>
| ^~~~~~~~~~~~~~~~~
compilation terminated.
|
s904173816 | p03712 | C++ | #include <bits/stdc++.h>
using namespace std;
int main() {
int H, W;
cin >> H >> W;
vector<string> output(H);
for (int i = 0; i < H; i++) cin >> vector[i];
cout << '#' * (W + 2) << endl;
for (int i = 0; i < H; i++) cout << '#' << vector[i] << '#' << endl;
cout << '#' * (W + 2) << endl;
}
| a.cc: In function 'int main()':
a.cc:8:44: error: missing template arguments before '[' token
8 | for (int i = 0; i < H; i++) cin >> vector[i];
| ^
a.cc:10:52: error: missing template arguments before '[' token
10 | for (int i = 0; i < H; i++) cout << '#' << vector[i] << '#' << endl;
| ^
|
s736969186 | p03712 | C++ | #include <bits/stdc++.h>
using namespace std;
int main() {
int H, W;
cin >> H >> W;
vector<string> output(H);
for (int i = 0, i < H, i++) cin >> vector[i];
cout << '#' * (W + 2) << endl;
for (int i = 0, i < H, i++) cout << '#' << vector[i] << '#' << endl;
cout << '#' * (W + 2) << endl;
}
| a.cc: In function 'int main()':
a.cc:8:20: error: expected ';' before '<' token
8 | for (int i = 0, i < H, i++) cin >> vector[i];
| ^~
| ;
a.cc:8:21: error: expected primary-expression before '<' token
8 | for (int i = 0, i < H, i++) cin >> vector[i];
| ^
a.cc:8:29: error: expected ';' before ')' token
8 | for (int i = 0, i < H, i++) cin >> vector[i];
| ^
| ;
a.cc:8:44: error: missing template arguments before '[' token
8 | for (int i = 0, i < H, i++) cin >> vector[i];
| ^
a.cc:10:20: error: expected ';' before '<' token
10 | for (int i = 0, i < H, i++) cout << '#' << vector[i] << '#' << endl;
| ^~
| ;
a.cc:10:21: error: expected primary-expression before '<' token
10 | for (int i = 0, i < H, i++) cout << '#' << vector[i] << '#' << endl;
| ^
a.cc:10:29: error: expected ';' before ')' token
10 | for (int i = 0, i < H, i++) cout << '#' << vector[i] << '#' << endl;
| ^
| ;
a.cc:10:52: error: missing template arguments before '[' token
10 | for (int i = 0, i < H, i++) cout << '#' << vector[i] << '#' << endl;
| ^
|
s878486355 | p03712 | C++ | #include <iostream>
using namespace std;
int main(){
int n.m;
cin >> n >> m;
char a[n][m];
for(int i=0;i<n;i++){
for(int j=0;j<m;j++){
cin >> a[i][j];
}
}
char b[n+2][m+2];
for(int i=0;i<n+2;i++){
b[i][0]='#';
b[i][m+1]='#';
}
for(int i=0;i<m+2;i++){
b[0][i]='#';
b[n+1][i]='#';
}
for(int i=1;i<n+1;i++){
for(int j=1;j<m+1;j++){
b[i][j]=a[i-1][j-1];
}
}
for(int i=0;i<n+2;i++){
for(int j=0;j<m+2;j++){
cout << b[i][j];
}
cout << endl;
}
} | a.cc: In function 'int main()':
a.cc:5:8: error: expected initializer before '.' token
5 | int n.m;
| ^
a.cc:6:10: error: 'n' was not declared in this scope
6 | cin >> n >> m;
| ^
a.cc:6:15: error: 'm' was not declared in this scope; did you mean 'tm'?
6 | cin >> n >> m;
| ^
| tm
a.cc:10:14: error: 'a' was not declared in this scope
10 | cin >> a[i][j];
| ^
a.cc:15:5: error: 'b' was not declared in this scope
15 | b[i][0]='#';
| ^
a.cc:19:5: error: 'b' was not declared in this scope
19 | b[0][i]='#';
| ^
a.cc:24:7: error: 'b' was not declared in this scope
24 | b[i][j]=a[i-1][j-1];
| ^
a.cc:24:15: error: 'a' was not declared in this scope
24 | b[i][j]=a[i-1][j-1];
| ^
a.cc:29:15: error: 'b' was not declared in this scope
29 | cout << b[i][j];
| ^
|
s222537581 | p03712 | C++ | #include <bits/stdc++.h>
using namespace std;
int main() {
int a,b;
cin>>a>>b;
for(int i=0; i<b+2; i++){
cout<<'#';
}
cout<<endl;
//最初の#
for(int j=0; j<a; j++){
cout<<'#';
vector<string> vec(b);
fou(int m=0; m<b; m++){
cin>>vec.at(i);
cout<<vec.at(i);
}
cout<<'#';<<endl;
}
for(int i=0; i<b+2; i++){
cout<<'#';
}
cout<<endl;
//最後の#
} | a.cc: In function 'int main()':
a.cc:15:21: error: expected primary-expression before 'int'
15 | fou(int m=0; m<b; m++){
| ^~~
a.cc:15:30: error: 'm' was not declared in this scope
15 | fou(int m=0; m<b; m++){
| ^
a.cc:19:27: error: expected primary-expression before '<<' token
19 | cout<<'#';<<endl;
| ^~
|
s394235356 | p03712 | C++ | #include <bits/stdc++.h>
using namespace std;
int main() {
int a,b;
cin>>a>>b;
for(int i=0; i<b+2; i++){
cout<<'#';
}
cout<<endl;
//最初の#
for(int j=0; j<a; j++){
cout<<'#';
vector<string> vec(b);
fou(int m=0; m<b; m++){
cin>>vec.at(i);
cout<<vec.at(i);
}
cout<<'#';<<endl;
}
for(int i=0; i<b+2; i++){
cout<<'#';
}
cout<<endl;
//最後の#
} | a.cc: In function 'int main()':
a.cc:15:21: error: expected primary-expression before 'int'
15 | fou(int m=0; m<b; m++){
| ^~~
a.cc:15:30: error: 'm' was not declared in this scope
15 | fou(int m=0; m<b; m++){
| ^
a.cc:19:27: error: expected primary-expression before '<<' token
19 | cout<<'#';<<endl;
| ^~
|
s145542927 | p03712 | C++ | #include <bits/stdc++.h>
using namespace std;
int main() {
int N,W;
char R[100][100];
cin >> H >> W;
for(int y=0;y<H+2;y++){
for(int x=0;x<W+2;x++){
if(x==0||y==0)
R[x][y]="#";
else
cin>>R[x][y];
}
}
for(int y=0;y<H+2;y++){
for(int x=0;x<W+2;x++){
cout<<R[x][y];
}
cout<<"\n";
}
return 0;
} | a.cc: In function 'int main()':
a.cc:7:10: error: 'H' was not declared in this scope
7 | cin >> H >> W;
| ^
a.cc:11:17: error: invalid conversion from 'const char*' to 'char' [-fpermissive]
11 | R[x][y]="#";
| ^~~
| |
| const char*
|
s454200891 | p03712 | C++ | #include <bits/stdc++.h>
using namespace std;
int main(){
int h, w, i;
string s;
cin >> h >> w;
for(i=0; i<w+2; i++){
cout << '#'
}
cout << '\n';
for(i=0; i<h; i++){
cout << '#';
cin >> s;
cout << s;
cout << "#\n";
}
for(i=0; i<w+2; i++){
cout << '#'
}
return 0;
} | a.cc: In function 'int main()':
a.cc:9:20: error: expected ';' before '}' token
9 | cout << '#'
| ^
| ;
10 | }
| ~
a.cc:19:20: error: expected ';' before '}' token
19 | cout << '#'
| ^
| ;
20 | }
| ~
|
s527643399 | p03712 | C++ | #include<iostream>
#include<string>
using namespace std;
int main(){
int h,w;
char s[100][100];
cin>>h>>w;
for(int i=0;i<h;++i){
for(int j=0;j<w;++j)cin>>s[i][j];
}
cin>>s;
for(int i=0;i<=h+1;++i)cout<<"#";
cout<<endl;
for(int j=0;j<w;++j){
cout<<"#";
for(int i=0;i<h;++i)cout<<s[i][j];
cout<<"#"<<endl;
}for(int i=0;i<=h+1;++i)cout<<"#";
cout<<endl;
return 0;
} | a.cc: In function 'int main()':
a.cc:12:12: error: no match for 'operator>>' (operand types are 'std::istream' {aka 'std::basic_istream<char>'} and 'char [100][100]')
12 | cin>>s;
| ~~~^~~
| | |
| | char [100][100]
| std::istream {aka std::basic_istream<char>}
In file included from /usr/include/c++/14/iostream:42,
from a.cc:1:
/usr/include/c++/14/istream:170:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(bool&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' (near match)
170 | operator>>(bool& __n)
| ^~~~~~~~
/usr/include/c++/14/istream:170:7: note: conversion of argument 1 would be ill-formed:
a.cc:12:14: error: cannot bind non-const lvalue reference of type 'bool&' to a value of type 'char (*)[100]'
12 | cin>>s;
| ^
/usr/include/c++/14/istream:174:7: note: candidate: 'std::basic_istream<_CharT, _Traits>& std::basic_istream<_CharT, _Traits>::operator>>(short int&) [with _CharT = char; _Traits = std::char_traits<char>]' (near match)
174 | operator>>(short& __n);
| ^~~~~~~~
/usr/include/c++/14/istream:174:7: note: conversion of argument 1 would be ill-formed:
a.cc:12:14: error: invalid conversion from 'char (*)[100]' to 'short int' [-fpermissive]
12 | cin>>s;
| ^
| |
| char (*)[100]
a.cc:12:14: error: cannot bind rvalue '(short int)((char (*)[100])(& s))' to 'short int&'
/usr/include/c++/14/istream:177:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(short unsigned int&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' (near match)
177 | operator>>(unsigned short& __n)
| ^~~~~~~~
/usr/include/c++/14/istream:177:7: note: conversion of argument 1 would be ill-formed:
a.cc:12:14: error: invalid conversion from 'char (*)[100]' to 'short unsigned int' [-fpermissive]
12 | cin>>s;
| ^
| |
| char (*)[100]
a.cc:12:14: error: cannot bind rvalue '(short unsigned int)((char (*)[100])(& s))' to 'short unsigned int&'
/usr/include/c++/14/istream:181:7: note: candidate: 'std::basic_istream<_CharT, _Traits>& std::basic_istream<_CharT, _Traits>::operator>>(int&) [with _CharT = char; _Traits = std::char_traits<char>]' (near match)
181 | operator>>(int& __n);
| ^~~~~~~~
/usr/include/c++/14/istream:181:7: note: conversion of argument 1 would be ill-formed:
a.cc:12:14: error: invalid conversion from 'char (*)[100]' to 'int' [-fpermissive]
12 | cin>>s;
| ^
| |
| char (*)[100]
a.cc:12:14: error: cannot bind rvalue '(int)((char (*)[100])(& s))' to 'int&'
/usr/include/c++/14/istream:184:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(unsigned int&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' (near match)
184 | operator>>(unsigned int& __n)
| ^~~~~~~~
/usr/include/c++/14/istream:184:7: note: conversion of argument 1 would be ill-formed:
a.cc:12:14: error: invalid conversion from 'char (*)[100]' to 'unsigned int' [-fpermissive]
12 | cin>>s;
| ^
| |
| char (*)[100]
a.cc:12:14: error: cannot bind rvalue '(unsigned int)((char (*)[100])(& s))' to 'unsigned int&'
/usr/include/c++/14/istream:188:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(long int&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' (near match)
188 | operator>>(long& __n)
| ^~~~~~~~
/usr/include/c++/14/istream:188:7: note: conversion of argument 1 would be ill-formed:
a.cc:12:14: error: invalid conversion from 'char (*)[100]' to 'long int' [-fpermissive]
12 | cin>>s;
| ^
| |
| char (*)[100]
a.cc:12:14: error: cannot bind rvalue '(long int)((char (*)[100])(& s))' to 'long int&'
/usr/include/c++/14/istream:192:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(long unsigned int&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' (near match)
192 | operator>>(unsigned long& __n)
| ^~~~~~~~
/usr/include/c++/14/istream:192:7: note: conversion of argument 1 would be ill-formed:
a.cc:12:14: error: invalid conversion from 'char (*)[100]' to 'long unsigned int' [-fpermissive]
12 | cin>>s;
| ^
| |
| char (*)[100]
a.cc:12:14: error: cannot bind rvalue '(long unsigned int)((char (*)[100])(& s))' to 'long unsigned int&'
/usr/include/c++/14/istream:199:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(long long int&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' (near match)
199 | operator>>(long long& __n)
| ^~~~~~~~
/usr/include/c++/14/istream:199:7: note: conversion of argument 1 would be ill-formed:
a.cc:12:14: error: invalid conversion from 'char (*)[100]' to 'long long int' [-fpermissive]
12 | cin>>s;
| ^
| |
| char (*)[100]
a.cc:12:14: error: cannot bind rvalue '(long long int)((char (*)[100])(& s))' to 'long long int&'
/usr/include/c++/14/istream:203:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(long long unsigned int&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' (near match)
203 | operator>>(unsigned long long& __n)
| ^~~~~~~~
/usr/include/c++/14/istream:203:7: note: conversion of argument 1 would be ill-formed:
a.cc:12:14: error: invalid conversion from 'char (*)[100]' to 'long long unsigned int' [-fpermissive]
12 | cin>>s;
| ^
| |
| char (*)[100]
a.cc:12:14: error: cannot bind rvalue '(long long unsigned int)((char (*)[100])(& s))' to 'long long unsigned int&'
/usr/include/c++/14/istream:328:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(void*&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' (near match)
328 | operator>>(void*& __p)
| ^~~~~~~~
/usr/include/c++/14/istream:328:7: note: conversion of argument 1 would be ill-formed:
a.cc:12:14: error: cannot bind non-const lvalue reference of type 'void*&' to an rvalue of type 'void*'
12 | cin>>s;
| ^
/usr/include/c++/14/istream:219:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(float&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]'
219 | operator>>(float& __f)
| ^~~~~~~~
/usr/include/c++/14/istream:219:25: note: no known conversion for argument 1 from 'char [100][100]' to 'float&'
219 | operator>>(float& __f)
| ~~~~~~~^~~
/usr/include/c++/14/istream:223:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(double&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]'
223 | operator>>(double& __f)
| ^~~~~~~~
/usr/include/c++/14/istream:223:26: note: no known conversion for argument 1 from 'char [100][100]' to 'double&'
223 | operator>>(double& __f)
| ~~~~~~~~^~~
/usr/include/c++/14/istream:227:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(long double&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]'
227 | operator>>(long double& __f)
| ^~~~~~~~
/usr/include/c++/14/istream:227:31: note: no known conversion for argument 1 from 'char [100][100]' to 'long double&'
227 | operator>>(long double& __f)
| ~~~~~~~~~~~~~^~~
/usr/include/c++/14/istream:122:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(__istream_type& (*)(__istream_type&)) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]'
122 | operator>>(__istream_type& (*__pf)(__istream_type&))
| ^~~~~~~~
/usr/include/c++/14/istream:122:36: note: no known conversion for argument 1 from 'char [100][100]' to 'std::basic_istream<char>::__istream_type& (*)(std::basic_istream<char>::__istream_type&)' {aka 'std::basic_istream<char>& (*)(std::basic_istream<char>&)'}
122 | operator>>(__istream_type& (*__pf)(__istream_type&))
| ~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~
/usr/include/c++/14/istream:126:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(__ios_type& (*)(__ios_type&)) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>; __ios_type = std::basic_ios<char>]'
126 | operator>>(__ios_type& (*__pf)(__ios_type&))
| ^~~~~~~~
/usr/include/c++/14/istream:126:32: note: no known conversion for argument 1 from 'char [100][100]' to 'std::basic_istream<char>::__ios_type& (*)(std::basic_istream<char>::__ios_type&)' {aka 'std::basic_io |
s850345825 | p03712 | C++ | #include <bits/stdc++.h>
using namespace std;
int main() {
int H, W;
cin >> H >> W;
vector<char> a((H+2)*(W+2), "#");
for (int i=0; i<(H+2)*(W+2); i++) {
if ( (i !< W+2) || (i !> (H+2)*(W+2)-(W+2)-1 ) ) {
if ( (i%(W-1)==0) || (i%*W==0) ) {
cin >> a.at(i);
}
}
}
for (int i=0; i<(H+2)*(W+2); i++) {
cout << a.at(i) << flush;
if(i%(W-1)==0) cout << endl;
}
} | a.cc: In function 'int main()':
a.cc:8:34: error: no matching function for call to 'std::vector<char>::vector(int, const char [2])'
8 | vector<char> a((H+2)*(W+2), "#");
| ^
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:569:7: note: candidate: 'std::vector<_Tp, _Alloc>::vector(size_type, const value_type&, const allocator_type&) [with _Tp = char; _Alloc = std::allocator<char>; size_type = long unsigned int; value_type = char; allocator_type = std::allocator<char>]' (near match)
569 | vector(size_type __n, const value_type& __value,
| ^~~~~~
/usr/include/c++/14/bits/stl_vector.h:569:7: note: conversion of argument 2 would be ill-formed:
a.cc:8:31: error: invalid conversion from 'const char*' to 'std::vector<char>::value_type' {aka 'char'} [-fpermissive]
8 | vector<char> a((H+2)*(W+2), "#");
| ^~~
| |
| const char*
/usr/include/c++/14/bits/stl_vector.h:707:9: note: candidate: 'template<class _InputIterator, class> std::vector<_Tp, _Alloc>::vector(_InputIterator, _InputIterator, const allocator_type&) [with <template-parameter-2-2> = _InputIterator; _Tp = char; _Alloc = std::allocator<char>]'
707 | vector(_InputIterator __first, _InputIterator __last,
| ^~~~~~
/usr/include/c++/14/bits/stl_vector.h:707:9: note: template argument deduction/substitution failed:
a.cc:8:34: note: deduced conflicting types for parameter '_InputIterator' ('int' and 'const char*')
8 | vector<char> a((H+2)*(W+2), "#");
| ^
/usr/include/c++/14/bits/stl_vector.h:678:7: note: candidate: 'std::vector<_Tp, _Alloc>::vector(std::initializer_list<_Tp>, const allocator_type&) [with _Tp = char; _Alloc = std::allocator<char>; allocator_type = std::allocator<char>]'
678 | vector(initializer_list<value_type> __l,
| ^~~~~~
/usr/include/c++/14/bits/stl_vector.h:678:43: note: no known conversion for argument 1 from 'int' to 'std::initializer_list<char>'
678 | vector(initializer_list<value_type> __l,
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~
/usr/include/c++/14/bits/stl_vector.h:659:7: note: candidate: 'std::vector<_Tp, _Alloc>::vector(std::vector<_Tp, _Alloc>&&, std::__type_identity_t<_Alloc>&) [with _Tp = char; _Alloc = std::allocator<char>; std::__type_identity_t<_Alloc> = std::allocator<char>]'
659 | vector(vector&& __rv, const __type_identity_t<allocator_type>& __m)
| ^~~~~~
/usr/include/c++/14/bits/stl_vector.h:659:23: note: no known conversion for argument 1 from 'int' to 'std::vector<char>&&'
659 | vector(vector&& __rv, const __type_identity_t<allocator_type>& __m)
| ~~~~~~~~~^~~~
/usr/include/c++/14/bits/stl_vector.h:640:7: note: candidate: 'std::vector<_Tp, _Alloc>::vector(std::vector<_Tp, _Alloc>&&, const allocator_type&, std::false_type) [with _Tp = char; _Alloc = std::allocator<char>; allocator_type = std::allocator<char>; std::false_type = std::false_type]'
640 | vector(vector&& __rv, const allocator_type& __m, false_type)
| ^~~~~~
/usr/include/c++/14/bits/stl_vector.h:640:7: note: candidate expects 3 arguments, 2 provided
/usr/include/c++/14/bits/stl_vector.h:635:7: note: candidate: 'std::vector<_Tp, _Alloc>::vector(std::vector<_Tp, _Alloc>&&, const allocator_type&, std::true_type) [with _Tp = char; _Alloc = std::allocator<char>; allocator_type = std::allocator<char>; std::true_type = std::true_type]'
635 | vector(vector&& __rv, const allocator_type& __m, true_type) noexcept
| ^~~~~~
/usr/include/c++/14/bits/stl_vector.h:635:7: note: candidate expects 3 arguments, 2 provided
/usr/include/c++/14/bits/stl_vector.h:624:7: note: candidate: 'std::vector<_Tp, _Alloc>::vector(const std::vector<_Tp, _Alloc>&, std::__type_identity_t<_Alloc>&) [with _Tp = char; _Alloc = std::allocator<char>; std::__type_identity_t<_Alloc> = std::allocator<char>]'
624 | vector(const vector& __x, const __type_identity_t<allocator_type>& __a)
| ^~~~~~
/usr/include/c++/14/bits/stl_vector.h:624:28: note: no known conversion for argument 1 from 'int' to 'const std::vector<char>&'
624 | vector(const vector& __x, const __type_identity_t<allocator_type>& __a)
| ~~~~~~~~~~~~~~^~~
/usr/include/c++/14/bits/stl_vector.h:620:7: note: candidate: 'std::vector<_Tp, _Alloc>::vector(std::vector<_Tp, _Alloc>&&) [with _Tp = char; _Alloc = std::allocator<char>]'
620 | vector(vector&&) noexcept = default;
| ^~~~~~
/usr/include/c++/14/bits/stl_vector.h:620:7: note: candidate expects 1 argument, 2 provided
/usr/include/c++/14/bits/stl_vector.h:601:7: note: candidate: 'std::vector<_Tp, _Alloc>::vector(const std::vector<_Tp, _Alloc>&) [with _Tp = char; _Alloc = std::allocator<char>]'
601 | vector(const vector& __x)
| ^~~~~~
/usr/include/c++/14/bits/stl_vector.h:601:7: note: candidate expects 1 argument, 2 provided
/usr/include/c++/14/bits/stl_vector.h:556:7: note: candidate: 'std::vector<_Tp, _Alloc>::vector(size_type, const allocator_type&) [with _Tp = char; _Alloc = std::allocator<char>; size_type = long unsigned int; allocator_type = std::allocator<char>]'
556 | vector(size_type __n, const allocator_type& __a = allocator_type())
| ^~~~~~
/usr/include/c++/14/bits/stl_vector.h:556:51: note: no known conversion for argument 2 from 'const char [2]' to 'const std::vector<char>::allocator_type&' {aka 'const std::allocator<char>&'}
556 | vector(size_type __n, const allocator_type& __a = allocator_type())
| ~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~
/usr/include/c++/14/bits/stl_vector.h:542:7: note: candidate: 'std::vector<_Tp, _Alloc>::vector(const allocator_type&) [with _Tp = char; _Alloc = std::allocator<char>; allocator_type = std::allocator<char>]'
542 | vector(const allocator_type& __a) _GLIBCXX_NOEXCEPT
| ^~~~~~
/usr/include/c++/14/bits/stl_vector.h:542:7: note: candidate expects 1 argument, 2 provided
/usr/include/c++/14/bits/stl_vector.h:531:7: note: candidate: 'std::vector<_Tp, _Alloc>::vector() [with _Tp = char; _Alloc = std::allocator<char>]'
531 | vector() = default;
| ^~~~~~
/usr/include/c++/14/bits/stl_vector.h:531:7: note: candidate expects 0 arguments, 2 provided
a.cc:10:12: error: expected ')' before '!' token
10 | if ( (i !< W+2) || (i !> (H+2)*(W+2)-(W+2)-1 ) ) {
| ~ ^~
| )
a.cc:14:6: error: expected ')' before '}' token
14 | }
| ^
| )
15 | }
| ~
a.cc:10:8: note: to match this '('
10 | if ( (i !< W+2) || (i !> (H+2)*(W+2)-(W+2)-1 ) ) {
| ^
a.cc:15:3: error: expected primary-expression before '}' token
15 | }
| ^
|
s692683515 | p03712 | C | #include<iostream>
#include<algorithm>
using namespace std;
int main(){
int h,w;
cin>>h>>w;
for(int i=0;i<w+2;i++)cout<<"#";
cout<<endl;
for(int i=0;i<h;i++){
string s; cin>>s;
cout<<"#"<<s<<"#"<<endl;
}
for(int i=0;i<w+2;i++)cout<<"#";
cout<<endl;
return 0;
} | main.c:1:9: fatal error: iostream: No such file or directory
1 | #include<iostream>
| ^~~~~~~~~~
compilation terminated.
|
s138594784 | p03712 | C++ | #include <bits/stdc++.h>
using namespace std;
int main() {
int H, W;
cin >> H >> W;
vector<char> a((H+2)*(W+2), "#");
for (int i=0; i<(H+2)*(W+2); i++) {
if ( (i !< W+2) || (i !> (H+2)*(W+2)-(W+2)-1 ) ) {
if ( (i%(W-1)==0) || (i%*W==0) ){
cin >> a.at(i);
}
}
}
for (int i=0; i<(H+2)*(W+2); i++) {
cout << a.at(i);
if(i%(W-1)==0) cout << endl;
}
} | a.cc: In function 'int main()':
a.cc:8:34: error: no matching function for call to 'std::vector<char>::vector(int, const char [2])'
8 | vector<char> a((H+2)*(W+2), "#");
| ^
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:569:7: note: candidate: 'std::vector<_Tp, _Alloc>::vector(size_type, const value_type&, const allocator_type&) [with _Tp = char; _Alloc = std::allocator<char>; size_type = long unsigned int; value_type = char; allocator_type = std::allocator<char>]' (near match)
569 | vector(size_type __n, const value_type& __value,
| ^~~~~~
/usr/include/c++/14/bits/stl_vector.h:569:7: note: conversion of argument 2 would be ill-formed:
a.cc:8:31: error: invalid conversion from 'const char*' to 'std::vector<char>::value_type' {aka 'char'} [-fpermissive]
8 | vector<char> a((H+2)*(W+2), "#");
| ^~~
| |
| const char*
/usr/include/c++/14/bits/stl_vector.h:707:9: note: candidate: 'template<class _InputIterator, class> std::vector<_Tp, _Alloc>::vector(_InputIterator, _InputIterator, const allocator_type&) [with <template-parameter-2-2> = _InputIterator; _Tp = char; _Alloc = std::allocator<char>]'
707 | vector(_InputIterator __first, _InputIterator __last,
| ^~~~~~
/usr/include/c++/14/bits/stl_vector.h:707:9: note: template argument deduction/substitution failed:
a.cc:8:34: note: deduced conflicting types for parameter '_InputIterator' ('int' and 'const char*')
8 | vector<char> a((H+2)*(W+2), "#");
| ^
/usr/include/c++/14/bits/stl_vector.h:678:7: note: candidate: 'std::vector<_Tp, _Alloc>::vector(std::initializer_list<_Tp>, const allocator_type&) [with _Tp = char; _Alloc = std::allocator<char>; allocator_type = std::allocator<char>]'
678 | vector(initializer_list<value_type> __l,
| ^~~~~~
/usr/include/c++/14/bits/stl_vector.h:678:43: note: no known conversion for argument 1 from 'int' to 'std::initializer_list<char>'
678 | vector(initializer_list<value_type> __l,
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~
/usr/include/c++/14/bits/stl_vector.h:659:7: note: candidate: 'std::vector<_Tp, _Alloc>::vector(std::vector<_Tp, _Alloc>&&, std::__type_identity_t<_Alloc>&) [with _Tp = char; _Alloc = std::allocator<char>; std::__type_identity_t<_Alloc> = std::allocator<char>]'
659 | vector(vector&& __rv, const __type_identity_t<allocator_type>& __m)
| ^~~~~~
/usr/include/c++/14/bits/stl_vector.h:659:23: note: no known conversion for argument 1 from 'int' to 'std::vector<char>&&'
659 | vector(vector&& __rv, const __type_identity_t<allocator_type>& __m)
| ~~~~~~~~~^~~~
/usr/include/c++/14/bits/stl_vector.h:640:7: note: candidate: 'std::vector<_Tp, _Alloc>::vector(std::vector<_Tp, _Alloc>&&, const allocator_type&, std::false_type) [with _Tp = char; _Alloc = std::allocator<char>; allocator_type = std::allocator<char>; std::false_type = std::false_type]'
640 | vector(vector&& __rv, const allocator_type& __m, false_type)
| ^~~~~~
/usr/include/c++/14/bits/stl_vector.h:640:7: note: candidate expects 3 arguments, 2 provided
/usr/include/c++/14/bits/stl_vector.h:635:7: note: candidate: 'std::vector<_Tp, _Alloc>::vector(std::vector<_Tp, _Alloc>&&, const allocator_type&, std::true_type) [with _Tp = char; _Alloc = std::allocator<char>; allocator_type = std::allocator<char>; std::true_type = std::true_type]'
635 | vector(vector&& __rv, const allocator_type& __m, true_type) noexcept
| ^~~~~~
/usr/include/c++/14/bits/stl_vector.h:635:7: note: candidate expects 3 arguments, 2 provided
/usr/include/c++/14/bits/stl_vector.h:624:7: note: candidate: 'std::vector<_Tp, _Alloc>::vector(const std::vector<_Tp, _Alloc>&, std::__type_identity_t<_Alloc>&) [with _Tp = char; _Alloc = std::allocator<char>; std::__type_identity_t<_Alloc> = std::allocator<char>]'
624 | vector(const vector& __x, const __type_identity_t<allocator_type>& __a)
| ^~~~~~
/usr/include/c++/14/bits/stl_vector.h:624:28: note: no known conversion for argument 1 from 'int' to 'const std::vector<char>&'
624 | vector(const vector& __x, const __type_identity_t<allocator_type>& __a)
| ~~~~~~~~~~~~~~^~~
/usr/include/c++/14/bits/stl_vector.h:620:7: note: candidate: 'std::vector<_Tp, _Alloc>::vector(std::vector<_Tp, _Alloc>&&) [with _Tp = char; _Alloc = std::allocator<char>]'
620 | vector(vector&&) noexcept = default;
| ^~~~~~
/usr/include/c++/14/bits/stl_vector.h:620:7: note: candidate expects 1 argument, 2 provided
/usr/include/c++/14/bits/stl_vector.h:601:7: note: candidate: 'std::vector<_Tp, _Alloc>::vector(const std::vector<_Tp, _Alloc>&) [with _Tp = char; _Alloc = std::allocator<char>]'
601 | vector(const vector& __x)
| ^~~~~~
/usr/include/c++/14/bits/stl_vector.h:601:7: note: candidate expects 1 argument, 2 provided
/usr/include/c++/14/bits/stl_vector.h:556:7: note: candidate: 'std::vector<_Tp, _Alloc>::vector(size_type, const allocator_type&) [with _Tp = char; _Alloc = std::allocator<char>; size_type = long unsigned int; allocator_type = std::allocator<char>]'
556 | vector(size_type __n, const allocator_type& __a = allocator_type())
| ^~~~~~
/usr/include/c++/14/bits/stl_vector.h:556:51: note: no known conversion for argument 2 from 'const char [2]' to 'const std::vector<char>::allocator_type&' {aka 'const std::allocator<char>&'}
556 | vector(size_type __n, const allocator_type& __a = allocator_type())
| ~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~
/usr/include/c++/14/bits/stl_vector.h:542:7: note: candidate: 'std::vector<_Tp, _Alloc>::vector(const allocator_type&) [with _Tp = char; _Alloc = std::allocator<char>; allocator_type = std::allocator<char>]'
542 | vector(const allocator_type& __a) _GLIBCXX_NOEXCEPT
| ^~~~~~
/usr/include/c++/14/bits/stl_vector.h:542:7: note: candidate expects 1 argument, 2 provided
/usr/include/c++/14/bits/stl_vector.h:531:7: note: candidate: 'std::vector<_Tp, _Alloc>::vector() [with _Tp = char; _Alloc = std::allocator<char>]'
531 | vector() = default;
| ^~~~~~
/usr/include/c++/14/bits/stl_vector.h:531:7: note: candidate expects 0 arguments, 2 provided
a.cc:10:12: error: expected ')' before '!' token
10 | if ( (i !< W+2) || (i !> (H+2)*(W+2)-(W+2)-1 ) ) {
| ~ ^~
| )
a.cc:14:6: error: expected ')' before '}' token
14 | }
| ^
| )
15 | }
| ~
a.cc:10:8: note: to match this '('
10 | if ( (i !< W+2) || (i !> (H+2)*(W+2)-(W+2)-1 ) ) {
| ^
a.cc:15:3: error: expected primary-expression before '}' token
15 | }
| ^
|
s183652366 | p03712 | C++ | #include <bits/stdc++.h>
using namespace std;
int main () {
int H ,W;
cin >> H >> W;
vector<vector<char>> data(H + 2, vector<int> (W + 2, '#'));
for(int i = 0; i < H; i++) {
for(int j = 0; j < W; j++) {
cin >> data.at(i + 1).at(j + 1);
}
}
for(int i = 0; i < H + 2; i++) {
for(int j = 0; j < W + 2; j++) {
cout << data.at(i).at(j);
}
cout << endl;
}
return 0;
} | a.cc: In function 'int main()':
a.cc:6:60: error: no matching function for call to 'std::vector<std::vector<char> >::vector(int, std::vector<int>)'
6 | vector<vector<char>> data(H + 2, vector<int> (W + 2, '#'));
| ^
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:707:9: note: candidate: 'template<class _InputIterator, class> std::vector<_Tp, _Alloc>::vector(_InputIterator, _InputIterator, const allocator_type&) [with <template-parameter-2-2> = _InputIterator; _Tp = std::vector<char>; _Alloc = std::allocator<std::vector<char> >]'
707 | vector(_InputIterator __first, _InputIterator __last,
| ^~~~~~
/usr/include/c++/14/bits/stl_vector.h:707:9: note: template argument deduction/substitution failed:
a.cc:6:60: note: deduced conflicting types for parameter '_InputIterator' ('int' and 'std::vector<int>')
6 | vector<vector<char>> data(H + 2, vector<int> (W + 2, '#'));
| ^
/usr/include/c++/14/bits/stl_vector.h:678:7: note: candidate: 'std::vector<_Tp, _Alloc>::vector(std::initializer_list<_Tp>, const allocator_type&) [with _Tp = std::vector<char>; _Alloc = std::allocator<std::vector<char> >; allocator_type = std::allocator<std::vector<char> >]'
678 | vector(initializer_list<value_type> __l,
| ^~~~~~
/usr/include/c++/14/bits/stl_vector.h:678:43: note: no known conversion for argument 1 from 'int' to 'std::initializer_list<std::vector<char> >'
678 | vector(initializer_list<value_type> __l,
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~
/usr/include/c++/14/bits/stl_vector.h:659:7: note: candidate: 'std::vector<_Tp, _Alloc>::vector(std::vector<_Tp, _Alloc>&&, std::__type_identity_t<_Alloc>&) [with _Tp = std::vector<char>; _Alloc = std::allocator<std::vector<char> >; std::__type_identity_t<_Alloc> = std::allocator<std::vector<char> >]'
659 | vector(vector&& __rv, const __type_identity_t<allocator_type>& __m)
| ^~~~~~
/usr/include/c++/14/bits/stl_vector.h:659:23: note: no known conversion for argument 1 from 'int' to 'std::vector<std::vector<char> >&&'
659 | vector(vector&& __rv, const __type_identity_t<allocator_type>& __m)
| ~~~~~~~~~^~~~
/usr/include/c++/14/bits/stl_vector.h:640:7: note: candidate: 'std::vector<_Tp, _Alloc>::vector(std::vector<_Tp, _Alloc>&&, const allocator_type&, std::false_type) [with _Tp = std::vector<char>; _Alloc = std::allocator<std::vector<char> >; allocator_type = std::allocator<std::vector<char> >; std::false_type = std::false_type]'
640 | vector(vector&& __rv, const allocator_type& __m, false_type)
| ^~~~~~
/usr/include/c++/14/bits/stl_vector.h:640:7: note: candidate expects 3 arguments, 2 provided
/usr/include/c++/14/bits/stl_vector.h:635:7: note: candidate: 'std::vector<_Tp, _Alloc>::vector(std::vector<_Tp, _Alloc>&&, const allocator_type&, std::true_type) [with _Tp = std::vector<char>; _Alloc = std::allocator<std::vector<char> >; allocator_type = std::allocator<std::vector<char> >; std::true_type = std::true_type]'
635 | vector(vector&& __rv, const allocator_type& __m, true_type) noexcept
| ^~~~~~
/usr/include/c++/14/bits/stl_vector.h:635:7: note: candidate expects 3 arguments, 2 provided
/usr/include/c++/14/bits/stl_vector.h:624:7: note: candidate: 'std::vector<_Tp, _Alloc>::vector(const std::vector<_Tp, _Alloc>&, std::__type_identity_t<_Alloc>&) [with _Tp = std::vector<char>; _Alloc = std::allocator<std::vector<char> >; std::__type_identity_t<_Alloc> = std::allocator<std::vector<char> >]'
624 | vector(const vector& __x, const __type_identity_t<allocator_type>& __a)
| ^~~~~~
/usr/include/c++/14/bits/stl_vector.h:624:28: note: no known conversion for argument 1 from 'int' to 'const std::vector<std::vector<char> >&'
624 | vector(const vector& __x, const __type_identity_t<allocator_type>& __a)
| ~~~~~~~~~~~~~~^~~
/usr/include/c++/14/bits/stl_vector.h:620:7: note: candidate: 'std::vector<_Tp, _Alloc>::vector(std::vector<_Tp, _Alloc>&&) [with _Tp = std::vector<char>; _Alloc = std::allocator<std::vector<char> >]'
620 | vector(vector&&) noexcept = default;
| ^~~~~~
/usr/include/c++/14/bits/stl_vector.h:620:7: note: candidate expects 1 argument, 2 provided
/usr/include/c++/14/bits/stl_vector.h:601:7: note: candidate: 'std::vector<_Tp, _Alloc>::vector(const std::vector<_Tp, _Alloc>&) [with _Tp = std::vector<char>; _Alloc = std::allocator<std::vector<char> >]'
601 | vector(const vector& __x)
| ^~~~~~
/usr/include/c++/14/bits/stl_vector.h:601:7: note: candidate expects 1 argument, 2 provided
/usr/include/c++/14/bits/stl_vector.h:569:7: note: candidate: 'std::vector<_Tp, _Alloc>::vector(size_type, const value_type&, const allocator_type&) [with _Tp = std::vector<char>; _Alloc = std::allocator<std::vector<char> >; size_type = long unsigned int; value_type = std::vector<char>; allocator_type = std::allocator<std::vector<char> >]'
569 | vector(size_type __n, const value_type& __value,
| ^~~~~~
/usr/include/c++/14/bits/stl_vector.h:569:47: note: no known conversion for argument 2 from 'std::vector<int>' to 'const std::vector<std::vector<char> >::value_type&' {aka 'const std::vector<char>&'}
569 | vector(size_type __n, const value_type& __value,
| ~~~~~~~~~~~~~~~~~~^~~~~~~
/usr/include/c++/14/bits/stl_vector.h:556:7: note: candidate: 'std::vector<_Tp, _Alloc>::vector(size_type, const allocator_type&) [with _Tp = std::vector<char>; _Alloc = std::allocator<std::vector<char> >; size_type = long unsigned int; allocator_type = std::allocator<std::vector<char> >]'
556 | vector(size_type __n, const allocator_type& __a = allocator_type())
| ^~~~~~
/usr/include/c++/14/bits/stl_vector.h:556:51: note: no known conversion for argument 2 from 'std::vector<int>' to 'const std::vector<std::vector<char> >::allocator_type&' {aka 'const std::allocator<std::vector<char> >&'}
556 | vector(size_type __n, const allocator_type& __a = allocator_type())
| ~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~
/usr/include/c++/14/bits/stl_vector.h:542:7: note: candidate: 'std::vector<_Tp, _Alloc>::vector(const allocator_type&) [with _Tp = std::vector<char>; _Alloc = std::allocator<std::vector<char> >; allocator_type = std::allocator<std::vector<char> >]'
542 | vector(const allocator_type& __a) _GLIBCXX_NOEXCEPT
| ^~~~~~
/usr/include/c++/14/bits/stl_vector.h:542:7: note: candidate expects 1 argument, 2 provided
/usr/include/c++/14/bits/stl_vector.h:531:7: note: candidate: 'std::vector<_Tp, _Alloc>::vector() [with _Tp = std::vector<char>; _Alloc = std::allocator<std::vector<char> >]'
531 | vector() = default;
| ^~~~~~
/usr/include/c++/14/bits/stl_vector.h:531:7: note: candidate expects 0 arguments, 2 provided
|
s047693399 | p03712 | C++ | #include <bits/stdc++.h>
using namespace std;
char a[100][101], b[102][102];
int main() {
int H, W; cin >> H >> W;
for (int i = 0; i < H; i++)
scanf("%s", a[i]);
1
for (int i = 0; i < H + 2; i++)
for (int j = 0; j < W + 2; j++)
b[i][j] = ’#’;
for (int i = 0; i < H; i++)
for (int j = 0; j < W; j++)
b[i + 1][j + 1] = a[i][j];
for (int i = 0; i < H + 2; i++) {
for (int j = 0; j < W + 2; j++)
cout << b[i][j];
cout << endl;
}
}
| a.cc:11:11: error: extended character ’ is not valid in an identifier
11 | b[i][j] = ’#’;
| ^
a.cc:11:12: error: stray '#' in program
11 | b[i][j] = ’#’;
| ^
a.cc:11:13: error: extended character ’ is not valid in an identifier
11 | b[i][j] = ’#’;
| ^
a.cc: In function 'int main()':
a.cc:8:2: error: expected ';' before 'for'
8 | 1
| ^
| ;
9 | for (int i = 0; i < H + 2; i++)
| ~~~
a.cc:9:17: error: 'i' was not declared in this scope
9 | for (int i = 0; i < H + 2; i++)
| ^
a.cc:10:17: error: 'j' was not declared in this scope
10 | for (int j = 0; j < W + 2; j++)
| ^
|
s511829747 | p03712 | C++ | char a[100][101], b[102][102];
int main() {
int H, W; cin >> H >> W;
for (int i = 0; i < H; i++)
scanf("%s", a[i]);
1
for (int i = 0; i < H + 2; i++)
for (int j = 0; j < W + 2; j++)
b[i][j] = ’#’;
for (int i = 0; i < H; i++)
for (int j = 0; j < W; j++)
b[i + 1][j + 1] = a[i][j];
for (int i = 0; i < H + 2; i++) {
for (int j = 0; j < W + 2; j++)
cout << b[i][j];
cout << endl;
}
}
| a.cc:9:11: error: extended character ’ is not valid in an identifier
9 | b[i][j] = ’#’;
| ^
a.cc:9:12: error: stray '#' in program
9 | b[i][j] = ’#’;
| ^
a.cc:9:13: error: extended character ’ is not valid in an identifier
9 | b[i][j] = ’#’;
| ^
a.cc: In function 'int main()':
a.cc:3:11: error: 'cin' was not declared in this scope
3 | int H, W; cin >> H >> W;
| ^~~
a.cc:5:1: error: 'scanf' was not declared in this scope
5 | scanf("%s", a[i]);
| ^~~~~
a.cc:6:2: error: expected ';' before 'for'
6 | 1
| ^
| ;
7 | for (int i = 0; i < H + 2; i++)
| ~~~
a.cc:7:17: error: 'i' was not declared in this scope
7 | for (int i = 0; i < H + 2; i++)
| ^
a.cc:8:17: error: 'j' was not declared in this scope
8 | for (int j = 0; j < W + 2; j++)
| ^
a.cc:15:1: error: 'cout' was not declared in this scope
15 | cout << b[i][j];
| ^~~~
a.cc:16:1: error: 'cout' was not declared in this scope
16 | cout << endl;
| ^~~~
a.cc:16:9: error: 'endl' was not declared in this scope
16 | cout << endl;
| ^~~~
|
s114876221 | p03712 | C++ | #include <bits/stdc++.h>
using namespace std;
{
char a[101][101];
char b[102][102];
int H,W;
cin>>H,W;
for(int i=0;i<H;i++)
scanf("%s",a[i]);
for(int i=0;i<H+2;i++)
for(int j=0;j<W+2;j++)
b[i][j]='#';
for(int i=0;i<H;i++)
for(int j=0;j<W;j++)
b[i+1][j+1]=a[i][j];
for(int i=0;i<H;i++)
for(int j=0;j<W;j++)
cout<<b[i][j];
} | a.cc:3:1: error: expected unqualified-id before '{' token
3 | {
| ^
|
s056852290 | p03712 | C++ |
char a[100][101], b[102][102];
int main() {
int H, W; cin >> H >> W;
for (int i = 0; i < H; i++)
scanf("%s", a[i]);
1
for (int i = 0; i < H + 2; i++)
for (int j = 0; j < W + 2; j++)
b[i][j] = ’#’;
for (int i = 0; i < H; i++)
for (int j = 0; j < W; j++)
b[i + 1][j + 1] = a[i][j];
for (int i = 0; i < H + 2; i++) {
for (int j = 0; j < W + 2; j++)
cout << b[i][j];
} | a.cc:10:11: error: extended character ’ is not valid in an identifier
10 | b[i][j] = ’#’;
| ^
a.cc:10:12: error: stray '#' in program
10 | b[i][j] = ’#’;
| ^
a.cc:10:13: error: extended character ’ is not valid in an identifier
10 | b[i][j] = ’#’;
| ^
a.cc: In function 'int main()':
a.cc:4:11: error: 'cin' was not declared in this scope
4 | int H, W; cin >> H >> W;
| ^~~
a.cc:6:1: error: 'scanf' was not declared in this scope
6 | scanf("%s", a[i]);
| ^~~~~
a.cc:7:2: error: expected ';' before 'for'
7 | 1
| ^
| ;
8 | for (int i = 0; i < H + 2; i++)
| ~~~
a.cc:8:17: error: 'i' was not declared in this scope
8 | for (int i = 0; i < H + 2; i++)
| ^
a.cc:9:17: error: 'j' was not declared in this scope
9 | for (int j = 0; j < W + 2; j++)
| ^
a.cc:16:1: error: 'cout' was not declared in this scope
16 | cout << b[i][j];
| ^~~~
a.cc:17:2: error: expected '}' at end of input
17 | }
| ^
a.cc:3:12: note: to match this '{'
3 | int main() {
| ^
|
s910524615 | p03712 | C++ | #include <bits/stdc++.h>
using namespace std;
int main() {
int H,W;
cin>>H>>W;
vector<vector<string>>vec(H,vector<string>(W));
for(int i=0;i<H;++i){
for(int j=0;j<W;++j){
cin>>vec.at(i).at(j);
}
}
int k=0;
while(k<W+2){
cout<<'#';
k++;
}
cout<<endl;
for(int i=0;i<H;i++){
cout<<'#';
for(int j=0;j<W;j++){
cout<<vec.at(i).at(j);
}
cout<<'#'<<endl;
}
int k=0;
while(k<W+2){
cout<<'#';
k++;
}
return 0;
} | a.cc: In function 'int main()':
a.cc:26:7: error: redeclaration of 'int k'
26 | int k=0;
| ^
a.cc:13:7: note: 'int k' previously declared here
13 | int k=0;
| ^
|
s108559622 | p03712 | C++ | #include <bits/stdc++.h>
using namespace std;
int main(){
int H,W;
cin >> H >> W;
vector <vector<char>> pic(H+2, vector<char> (W+2));
for(int i=0; i<W+2; i++){
cout << '#';
}
cout << endl;
for (int i=1; i<H+1; i++){
pic.at(i).at(0) = '#';
pic.at(i).at(W+1) = '#';
for (int j=1; j<W+1; j++){
cin >> pic.at(i).at(j);
}
for(int j=0; j<W+2; j++){
cout << pic.at(i)(j);
}
cout << endl;
}
for(int i=0; i<W+2; i++){
cout << '#';
}
cout << endl;
}
| a.cc: In function 'int main()':
a.cc:21:24: error: no match for call to '(__gnu_cxx::__alloc_traits<std::allocator<std::vector<char> >, std::vector<char> >::value_type {aka std::vector<char>}) (int&)'
21 | cout << pic.at(i)(j);
| ~~~~~~~~~^~~
|
s963762184 | p03712 | C++ | #include <bits/stdc++.h>
using namespace std;
int main(){
int H,W;
cin >> H >> W;
vector <vector<char>> pic(H+2, vector<char> (W+2));
for(int i=0; i<W+2, i++){
cout << '#';
}
cout << endl;
for (int i=1; i<H+1; i++){
pic.at(i).at(0) = '#';
pic.at(i).at(W+1) = '#';
for (int j=1; j<W+1; j++){
cin >> pic.at(i).at(j);
}
for(int j=0; j<W+2, j++){
cout << pic.at(i)(j);
}
cout << endl;
}
for(int i=0; i<W+2, i++){
cout << '#';
}
cout << endl;
}
| a.cc: In function 'int main()':
a.cc:9:26: error: expected ';' before ')' token
9 | for(int i=0; i<W+2, i++){
| ^
| ;
a.cc:20:28: error: expected ';' before ')' token
20 | for(int j=0; j<W+2, j++){
| ^
| ;
a.cc:21:24: error: no match for call to '(__gnu_cxx::__alloc_traits<std::allocator<std::vector<char> >, std::vector<char> >::value_type {aka std::vector<char>}) (int&)'
21 | cout << pic.at(i)(j);
| ~~~~~~~~~^~~
a.cc:26:26: error: expected ';' before ')' token
26 | for(int i=0; i<W+2, i++){
| ^
| ;
|
s041958694 | p03712 | C++ | #include <bits/stdc++.h>
using namespace std;
int main(){
int H,W;
cin >> H >> W;
vector <vector<char>> pic(H+2, vector<char> (W+2));
for(int i=0; i<W+2, i++){
cout << '#';
}
cout << endl;
for (int i=1; i<H+1; i++){
pic.at(i).at(0) = '#';
pic.at(i).at(W+1) = '#';
for (int j=1; j<W+1; j++){
cin >> pic.at(i).at(j);
}
for(int j=0; j<W+2, i++){
cout << pic.at(i)(j);
}
cout << endl;
}
for(int i=0; i<W+2, i++){
cout << '#';
}
cout << endl;
}
| a.cc: In function 'int main()':
a.cc:9:26: error: expected ';' before ')' token
9 | for(int i=0; i<W+2, i++){
| ^
| ;
a.cc:20:28: error: expected ';' before ')' token
20 | for(int j=0; j<W+2, i++){
| ^
| ;
a.cc:21:24: error: no match for call to '(__gnu_cxx::__alloc_traits<std::allocator<std::vector<char> >, std::vector<char> >::value_type {aka std::vector<char>}) (int&)'
21 | cout << pic.at(i)(j);
| ~~~~~~~~~^~~
a.cc:26:26: error: expected ';' before ')' token
26 | for(int i=0; i<W+2, i++){
| ^
| ;
|
s778670892 | p03712 | C++ | #include <bits/stdc++.h>
using namespace std;
int main(){
int H,W;
cin >> H >> W;
vector <vector<char>> pic(H+2, vector<char> (W+2));
pic.at(0) = vector<char> (W+2,'#');
pic.at(H+1) = vector<char> (W+2,'#');
for (int i=0, i<H+2, i++){
pic.at(i).at(0) = '#';
pic.at(i).at(W+1) = '#';
for (int j=0, j<W, j++){
cin >> pic.at(i).at(j+1);
}
}
}
| a.cc: In function 'int main()':
a.cc:11:18: error: expected ';' before '<' token
11 | for (int i=0, i<H+2, i++){
| ^
| ;
a.cc:11:18: error: expected primary-expression before '<' token
a.cc:11:27: error: expected ';' before ')' token
11 | for (int i=0, i<H+2, i++){
| ^
| ;
a.cc:14:20: error: expected ';' before '<' token
14 | for (int j=0, j<W, j++){
| ^
| ;
a.cc:14:20: error: expected primary-expression before '<' token
a.cc:14:27: error: expected ';' before ')' token
14 | for (int j=0, j<W, j++){
| ^
| ;
|
s149989243 | p03712 | C++ | #include <bits/stdc++.h>
using manespace std;
int main(){
int H,W;
cin >> H >> W;
vector <vector<char>> pic(H+2, vector<char> (W+2));
pic.at(0) = vector<char> (W+2,'#');
pic.at(H+1) = vector<char> (W+2,'#');
for (int i=0, i<H+2, i++){
pic.at(i).at(0) = '#';
pic.at(i).at(W+1) = '#';
for (int j=0, j<W, j++){
cin >> pic.at(i).at(j+1);
}
}
}
| a.cc:2:7: error: expected nested-name-specifier before 'manespace'
2 | using manespace std;
| ^~~~~~~~~
a.cc: In function 'int main()':
a.cc:6:3: error: 'cin' was not declared in this scope; did you mean 'std::cin'?
6 | cin >> H >> W;
| ^~~
| std::cin
In file included from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:146,
from a.cc:1:
/usr/include/c++/14/iostream:62:18: note: 'std::cin' declared here
62 | extern istream cin; ///< Linked to standard input
| ^~~
a.cc:8:3: error: 'vector' was not declared in this scope
8 | vector <vector<char>> pic(H+2, vector<char> (W+2));
| ^~~~~~
a.cc:8:3: note: suggested alternatives:
In file included from /usr/include/c++/14/vector:66,
from /usr/include/c++/14/functional:64,
from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:53:
/usr/include/c++/14/bits/stl_vector.h:428:11: note: 'std::vector'
428 | class vector : protected _Vector_base<_Tp, _Alloc>
| ^~~~~~
/usr/include/c++/14/vector:93:13: note: 'std::pmr::vector'
93 | using vector = std::vector<_Tp, polymorphic_allocator<_Tp>>;
| ^~~~~~
a.cc:8:18: error: expected primary-expression before 'char'
8 | vector <vector<char>> pic(H+2, vector<char> (W+2));
| ^~~~
a.cc:9:3: error: 'pic' was not declared in this scope
9 | pic.at(0) = vector<char> (W+2,'#');
| ^~~
a.cc:9:22: error: expected primary-expression before 'char'
9 | pic.at(0) = vector<char> (W+2,'#');
| ^~~~
a.cc:10:24: error: expected primary-expression before 'char'
10 | pic.at(H+1) = vector<char> (W+2,'#');
| ^~~~
a.cc:11:18: error: expected ';' before '<' token
11 | for (int i=0, i<H+2, i++){
| ^
| ;
a.cc:11:18: error: expected primary-expression before '<' token
a.cc:11:27: error: expected ';' before ')' token
11 | for (int i=0, i<H+2, i++){
| ^
| ;
a.cc:14:20: error: expected ';' before '<' token
14 | for (int j=0, j<W, j++){
| ^
| ;
a.cc:14:20: error: expected primary-expression before '<' token
a.cc:14:27: error: expected ';' before ')' token
14 | for (int j=0, j<W, j++){
| ^
| ;
|
s642412856 | p03712 | C++ | #include <bits/stdc++.h>
using namespace std;
int main(){
int H,W,i,j;
char a;
cin >> H >> W;
for(i=0;i<W+2;++i){cout << "#";}
cout << endl;
for(j=0;j<H;++j){
cout << "#";
for(i=0;i<W;++i){
cin >> a;
cout << a;
}
cout << "#";
}
cout << endl;
}
for(i=0;i<W+2;++i){cout << "#";}
}
cout << endl;
}
| a.cc:21:3: error: expected unqualified-id before 'for'
21 | for(i=0;i<W+2;++i){cout << "#";}
| ^~~
a.cc:21:11: error: 'i' does not name a type
21 | for(i=0;i<W+2;++i){cout << "#";}
| ^
a.cc:21:17: error: expected unqualified-id before '++' token
21 | for(i=0;i<W+2;++i){cout << "#";}
| ^~
a.cc:22:1: error: expected declaration before '}' token
22 | }
| ^
a.cc:23:3: error: 'cout' does not name a type
23 | cout << endl;
| ^~~~
a.cc:24:1: error: expected declaration before '}' token
24 | }
| ^
|
s470448438 | p03712 | C++ | #include <bits/stdc++.h>
using namespace std;
int main(){
int H,W,i,j;
string a;
cin >> H >>W;
for(i=0;i<W+2;++i){cout << "#";}
cout << endl;
for(j=0;j<H;++j){
for(i=0;i<W;++i){
if(i=0){
cout << "#";
cin >> a;
cout << a;
}
else if(i>0&&i<W-1){
cout << a;
}
else {
cin >> a;
cout << a;
cout << "#";
}
cout << endl;
}
for(i=0;i<W+2;++i){cout << "#";}
}
| a.cc: In function 'int main()':
a.cc:29:2: error: expected '}' at end of input
29 | }
| ^
a.cc:4:11: note: to match this '{'
4 | int main(){
| ^
|
s821866074 | p03712 | C | #include <stdio.h>
int main(void) {
int h,w,i;
char a[111];
scanf("%d%d",&h,&w);
for(i=0;i<=w+1;i++) {
printf("#");
}
printf("\n");
for(i=0;i<h;i++) {
scanf("%s",a);
printf("#%s#\n",s);
}
for(i=0;i<=w+1;i++) {
printf("#");
}
} | main.c: In function 'main':
main.c:12:21: error: 's' undeclared (first use in this function)
12 | printf("#%s#\n",s);
| ^
main.c:12:21: note: each undeclared identifier is reported only once for each function it appears in
|
s409979665 | p03712 | C++ | #include <stdio.h>
int main(void) {
int h,w,i;
char a[111];
scanf("%d%d",&h,&w);
for(i=0;i<=w+1;i++) {
printf("#");
}
printf("\n");
for(i=0;i<h;i++) {
scanf("%s",a);
printf("#%s#\n",s);
}
for(i=0;i<=w+1;i++) {
printf("#");
}
} | a.cc: In function 'int main()':
a.cc:12:21: error: 's' was not declared in this scope
12 | printf("#%s#\n",s);
| ^
|
s252994826 | p03712 | C++ | #include <bits/stdc++.h>
using namespace std;
int main() {
int H, W;
cin >> H >> W;
for (int i = 0 ;i < W + 2 ;i++) {
cout << "#";
}
cout << endl;
string str (W);
for (int j = 0 ;j < H ;j++) {
cout << "#";
for (int k = 0 ;k < W ;k++) {
cin >> str.at (k);
cout << str.at (k);
}
cout << "#" << endl;
}
for (int i = 0 ;i < W + 2 ;i++) {
cout << "#";
}
cout << endl;
}
| a.cc: In function 'int main()':
a.cc:11:16: error: no matching function for call to 'std::__cxx11::basic_string<char>::basic_string(int&)'
11 | string str (W);
| ^
In file included from /usr/include/c++/14/string:54,
from /usr/include/c++/14/bitset:52,
from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:52,
from a.cc:1:
/usr/include/c++/14/bits/basic_string.h:800:9: note: candidate: 'template<class _Tp, class> std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::basic_string(const _Tp&, const _Alloc&) [with <template-parameter-2-2> = _Tp; _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>]'
800 | basic_string(const _Tp& __t, const _Alloc& __a = _Alloc())
| ^~~~~~~~~~~~
/usr/include/c++/14/bits/basic_string.h:800:9: note: template argument deduction/substitution failed:
In file included from /usr/include/c++/14/bits/stl_pair.h:60,
from /usr/include/c++/14/bits/stl_algobase.h:64,
from /usr/include/c++/14/algorithm:60,
from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:51:
/usr/include/c++/14/type_traits: In substitution of 'template<bool _Cond, class _Tp> using std::enable_if_t = typename std::enable_if::type [with bool _Cond = false; _Tp = void]':
/usr/include/c++/14/bits/basic_string.h:149:8: required by substitution of 'template<class _CharT, class _Traits, class _Alloc> template<class _Tp, class _Res> using std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::_If_sv = std::enable_if_t<((bool)std::__and_<std::is_convertible<const _Tp&, std::basic_string_view<_CharT, _Traits> >, std::__not_<std::is_convertible<const _Tp*, const std::__cxx11::basic_string<_CharT, _Traits, _Alloc>*> >, std::__not_<std::is_convertible<const _Tp&, const _CharT*> > >::value), _Res> [with _Tp = int; _Res = void; _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>]'
149 | using _If_sv = enable_if_t<
| ^~~~~~
/usr/include/c++/14/bits/basic_string.h:797:30: required from here
797 | template<typename _Tp, typename = _If_sv<_Tp, void>>
| ^~~~~~~~
/usr/include/c++/14/type_traits:2711:11: error: no type named 'type' in 'struct std::enable_if<false, void>'
2711 | using enable_if_t = typename enable_if<_Cond, _Tp>::type;
| ^~~~~~~~~~~
/usr/include/c++/14/bits/basic_string.h:788:9: note: candidate: 'template<class _Tp, class> std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::basic_string(const _Tp&, size_type, size_type, const _Alloc&) [with <template-parameter-2-2> = _Tp; _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>]'
788 | basic_string(const _Tp& __t, size_type __pos, size_type __n,
| ^~~~~~~~~~~~
/usr/include/c++/14/bits/basic_string.h:788:9: note: candidate expects 3 arguments, 1 provided
/usr/include/c++/14/bits/basic_string.h:765:9: note: candidate: 'template<class _InputIterator, class> std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::basic_string(_InputIterator, _InputIterator, const _Alloc&) [with <template-parameter-2-2> = _InputIterator; _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>]'
765 | basic_string(_InputIterator __beg, _InputIterator __end,
| ^~~~~~~~~~~~
/usr/include/c++/14/bits/basic_string.h:765:9: note: candidate expects 2 arguments, 1 provided
/usr/include/c++/14/bits/basic_string.h:669:7: note: candidate: 'template<class> std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::basic_string(size_type, _CharT, const _Alloc&) [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>]'
669 | basic_string(size_type __n, _CharT __c, const _Alloc& __a = _Alloc())
| ^~~~~~~~~~~~
/usr/include/c++/14/bits/basic_string.h:669:7: note: candidate expects 2 arguments, 1 provided
/usr/include/c++/14/bits/basic_string.h:646:7: note: candidate: 'template<class> std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::basic_string(const _CharT*, const _Alloc&) [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>]'
646 | basic_string(const _CharT* __s, const _Alloc& __a = _Alloc())
| ^~~~~~~~~~~~
/usr/include/c++/14/bits/basic_string.h:646:7: note: template argument deduction/substitution failed:
a.cc:11:15: note: cannot convert 'W' (type 'int') to type 'const char*'
11 | string str (W);
| ^
/usr/include/c++/14/bits/basic_string.h:721:7: note: candidate: 'std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::basic_string(std::__cxx11::basic_string<_CharT, _Traits, _Alloc>&&, const _Alloc&) [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>]'
721 | basic_string(basic_string&& __str, const _Alloc& __a)
| ^~~~~~~~~~~~
/usr/include/c++/14/bits/basic_string.h:721:7: note: candidate expects 2 arguments, 1 provided
/usr/include/c++/14/bits/basic_string.h:716:7: note: candidate: 'std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::basic_string(const std::__cxx11::basic_string<_CharT, _Traits, _Alloc>&, const _Alloc&) [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>]'
716 | basic_string(const basic_string& __str, const _Alloc& __a)
| ^~~~~~~~~~~~
/usr/include/c++/14/bits/basic_string.h:716:7: note: candidate expects 2 arguments, 1 provided
/usr/include/c++/14/bits/basic_string.h:711:7: note: candidate: 'std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::basic_string(std::initializer_list<_Tp>, const _Alloc&) [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>]'
711 | basic_string(initializer_list<_CharT> __l, const _Alloc& __a = _Alloc())
| ^~~~~~~~~~~~
/usr/include/c++/14/bits/basic_string.h:711:45: note: no known conversion for argument 1 from 'int' to 'std::initializer_list<char>'
711 | basic_string(initializer_list<_CharT> __l, const _Alloc& __a = _Alloc())
| ~~~~~~~~~~~~~~~~~~~~~~~~~^~~
/usr/include/c++/14/bits/basic_string.h:682:7: note: candidate: 'std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::basic_string(std::__cxx11::basic_string<_CharT, _Traits, _Alloc>&&) [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>]'
682 | basic_string(basic_string&& __str) noexcept
| ^~~~~~~~~~~~
/usr/include/c++/14/bits/basic_string.h:682:35: note: no known conversion for argument 1 from 'int' to 'std::__cxx11::basic_string<char>&&'
682 | basic_string(basic_string&& __str) noexcept
| ~~~~~~~~~~~~~~~^~~~~
/usr/include/c++/14/bits/basic_string.h:624:7: note: candidate: 'std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::basic_string(const _CharT*, size_type, const _Alloc&) [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>; size_type = long unsigned int]'
624 | basic_string(const _CharT* __s, size_type __n,
| ^~~~~~~~~~~~
/usr/include/c++/14/bits/basic_string.h:624:7: note: candidate expects 3 arguments, 1 provided
/usr/include/c++/14/bits/basic_string.h:604:7: note: candidate: 'std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::basic_string(const std::__cxx11::basic_string<_CharT, _Traits, _Alloc>&, size_type, size_type, const _Alloc&) [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>; size_type = long unsigned int]'
604 | basic_string(const basic_string& __str, size_type __pos,
| ^~~~~~~~~~~~
/usr/include/c++/14/bits/basic_string.h:604:7: note: candidate expects 4 arguments, 1 provided
/usr/include/c++/14/bits/basic_string.h:586:7: note: candidate: 'std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::basic_string(const std::__cxx11::basic_string<_CharT, _Traits, _Alloc>&, size_type, size_type) [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>; size_type = long unsigned int]'
586 | basic_string(const basic_string& __str, size_type __pos,
| ^~~~~~~~~~~~
/usr/include/c++/14/bits/basic_string.h:586:7: note: candidate expects 3 arguments, 1 provided
/usr/include/c++/14/bits/basic_string.h:569:7: note: candidate: 'std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::basic_string(const std::__cxx11::basic_string<_CharT, _Traits, _Alloc>&, size_type, const _Alloc&) [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>; size_type = long unsigned int]'
569 | basic_string(const basic_string& __str, size_type __pos,
| ^~~~~~~~~~~~
/usr/include/c++/14/bits/basic_string.h:569:7: note: candidate expects 3 arguments, 1 provided
/usr/include/c++/14/bits/basic_string.h:552:7: note: candidate: 'std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::basic_string(const std::__cxx11::basic_string<_CharT, _Traits, _Alloc>&) [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>]'
552 | basic_string(const basic_string& __str)
| ^~~~~~~~~~~~
/usr/include/c++/14/bits/basic_string.h:552:40: note: no known conversion for argument 1 from 'int' to 'const std::__cxx11::basic_string<char>&'
552 | basic_string(const basic_string& __str)
| ~~~~~~~~~~~~~~~~~~~~^~~~~
/usr/include/c++/14/bits/basic_string.h:540:7: note: candidate: 'std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::basic_string(const _Alloc&) [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>]'
540 | basic_string(const _Alloc& __a) _GLIBCXX_NOEXCEPT
| ^~~~~~~~~~~~
/usr/include/c++/14/bits/basic_string.h:540:34: note: no known conversion for argument 1 from 'int' to 'const std::allocator<char>&'
540 | basic_string(const _Alloc& __a) _GLIBCXX_NOEXCEPT
| ~~~~~~~~~~~~~~^~~
/usr/include/c++/14/bits/basic_string.h:527:7: note: candidate: 'std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::basic_string() [with _CharT = char; _Tr |
s792136384 | p03712 | C++ | #include <bits/stdc++.h>
using namespace std;
int main() {
int H, W;
cin >> H >> W;
for (i = 0 ;i < W + 2 ;i++) {
cout << "#";
}
cout << endl;
string str (W);
for (j = 0 ;j < H ;j++) {
cout << "#";
for (k = 0 ;k < W ;k++) {
cin >> str.at (k);
cout << str.at (k);
}
cout << "#" << endl;
}
for (i = 0 ;i < W + 2 ;i++) {
cout << "#";
}
cout << endl;
}
| a.cc: In function 'int main()':
a.cc:7:8: error: 'i' was not declared in this scope
7 | for (i = 0 ;i < W + 2 ;i++) {
| ^
a.cc:11:16: error: no matching function for call to 'std::__cxx11::basic_string<char>::basic_string(int&)'
11 | string str (W);
| ^
In file included from /usr/include/c++/14/string:54,
from /usr/include/c++/14/bitset:52,
from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:52,
from a.cc:1:
/usr/include/c++/14/bits/basic_string.h:800:9: note: candidate: 'template<class _Tp, class> std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::basic_string(const _Tp&, const _Alloc&) [with <template-parameter-2-2> = _Tp; _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>]'
800 | basic_string(const _Tp& __t, const _Alloc& __a = _Alloc())
| ^~~~~~~~~~~~
/usr/include/c++/14/bits/basic_string.h:800:9: note: template argument deduction/substitution failed:
In file included from /usr/include/c++/14/bits/stl_pair.h:60,
from /usr/include/c++/14/bits/stl_algobase.h:64,
from /usr/include/c++/14/algorithm:60,
from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:51:
/usr/include/c++/14/type_traits: In substitution of 'template<bool _Cond, class _Tp> using std::enable_if_t = typename std::enable_if::type [with bool _Cond = false; _Tp = void]':
/usr/include/c++/14/bits/basic_string.h:149:8: required by substitution of 'template<class _CharT, class _Traits, class _Alloc> template<class _Tp, class _Res> using std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::_If_sv = std::enable_if_t<((bool)std::__and_<std::is_convertible<const _Tp&, std::basic_string_view<_CharT, _Traits> >, std::__not_<std::is_convertible<const _Tp*, const std::__cxx11::basic_string<_CharT, _Traits, _Alloc>*> >, std::__not_<std::is_convertible<const _Tp&, const _CharT*> > >::value), _Res> [with _Tp = int; _Res = void; _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>]'
149 | using _If_sv = enable_if_t<
| ^~~~~~
/usr/include/c++/14/bits/basic_string.h:797:30: required from here
797 | template<typename _Tp, typename = _If_sv<_Tp, void>>
| ^~~~~~~~
/usr/include/c++/14/type_traits:2711:11: error: no type named 'type' in 'struct std::enable_if<false, void>'
2711 | using enable_if_t = typename enable_if<_Cond, _Tp>::type;
| ^~~~~~~~~~~
/usr/include/c++/14/bits/basic_string.h:788:9: note: candidate: 'template<class _Tp, class> std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::basic_string(const _Tp&, size_type, size_type, const _Alloc&) [with <template-parameter-2-2> = _Tp; _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>]'
788 | basic_string(const _Tp& __t, size_type __pos, size_type __n,
| ^~~~~~~~~~~~
/usr/include/c++/14/bits/basic_string.h:788:9: note: candidate expects 3 arguments, 1 provided
/usr/include/c++/14/bits/basic_string.h:765:9: note: candidate: 'template<class _InputIterator, class> std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::basic_string(_InputIterator, _InputIterator, const _Alloc&) [with <template-parameter-2-2> = _InputIterator; _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>]'
765 | basic_string(_InputIterator __beg, _InputIterator __end,
| ^~~~~~~~~~~~
/usr/include/c++/14/bits/basic_string.h:765:9: note: candidate expects 2 arguments, 1 provided
/usr/include/c++/14/bits/basic_string.h:669:7: note: candidate: 'template<class> std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::basic_string(size_type, _CharT, const _Alloc&) [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>]'
669 | basic_string(size_type __n, _CharT __c, const _Alloc& __a = _Alloc())
| ^~~~~~~~~~~~
/usr/include/c++/14/bits/basic_string.h:669:7: note: candidate expects 2 arguments, 1 provided
/usr/include/c++/14/bits/basic_string.h:646:7: note: candidate: 'template<class> std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::basic_string(const _CharT*, const _Alloc&) [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>]'
646 | basic_string(const _CharT* __s, const _Alloc& __a = _Alloc())
| ^~~~~~~~~~~~
/usr/include/c++/14/bits/basic_string.h:646:7: note: template argument deduction/substitution failed:
a.cc:11:15: note: cannot convert 'W' (type 'int') to type 'const char*'
11 | string str (W);
| ^
/usr/include/c++/14/bits/basic_string.h:721:7: note: candidate: 'std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::basic_string(std::__cxx11::basic_string<_CharT, _Traits, _Alloc>&&, const _Alloc&) [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>]'
721 | basic_string(basic_string&& __str, const _Alloc& __a)
| ^~~~~~~~~~~~
/usr/include/c++/14/bits/basic_string.h:721:7: note: candidate expects 2 arguments, 1 provided
/usr/include/c++/14/bits/basic_string.h:716:7: note: candidate: 'std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::basic_string(const std::__cxx11::basic_string<_CharT, _Traits, _Alloc>&, const _Alloc&) [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>]'
716 | basic_string(const basic_string& __str, const _Alloc& __a)
| ^~~~~~~~~~~~
/usr/include/c++/14/bits/basic_string.h:716:7: note: candidate expects 2 arguments, 1 provided
/usr/include/c++/14/bits/basic_string.h:711:7: note: candidate: 'std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::basic_string(std::initializer_list<_Tp>, const _Alloc&) [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>]'
711 | basic_string(initializer_list<_CharT> __l, const _Alloc& __a = _Alloc())
| ^~~~~~~~~~~~
/usr/include/c++/14/bits/basic_string.h:711:45: note: no known conversion for argument 1 from 'int' to 'std::initializer_list<char>'
711 | basic_string(initializer_list<_CharT> __l, const _Alloc& __a = _Alloc())
| ~~~~~~~~~~~~~~~~~~~~~~~~~^~~
/usr/include/c++/14/bits/basic_string.h:682:7: note: candidate: 'std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::basic_string(std::__cxx11::basic_string<_CharT, _Traits, _Alloc>&&) [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>]'
682 | basic_string(basic_string&& __str) noexcept
| ^~~~~~~~~~~~
/usr/include/c++/14/bits/basic_string.h:682:35: note: no known conversion for argument 1 from 'int' to 'std::__cxx11::basic_string<char>&&'
682 | basic_string(basic_string&& __str) noexcept
| ~~~~~~~~~~~~~~~^~~~~
/usr/include/c++/14/bits/basic_string.h:624:7: note: candidate: 'std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::basic_string(const _CharT*, size_type, const _Alloc&) [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>; size_type = long unsigned int]'
624 | basic_string(const _CharT* __s, size_type __n,
| ^~~~~~~~~~~~
/usr/include/c++/14/bits/basic_string.h:624:7: note: candidate expects 3 arguments, 1 provided
/usr/include/c++/14/bits/basic_string.h:604:7: note: candidate: 'std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::basic_string(const std::__cxx11::basic_string<_CharT, _Traits, _Alloc>&, size_type, size_type, const _Alloc&) [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>; size_type = long unsigned int]'
604 | basic_string(const basic_string& __str, size_type __pos,
| ^~~~~~~~~~~~
/usr/include/c++/14/bits/basic_string.h:604:7: note: candidate expects 4 arguments, 1 provided
/usr/include/c++/14/bits/basic_string.h:586:7: note: candidate: 'std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::basic_string(const std::__cxx11::basic_string<_CharT, _Traits, _Alloc>&, size_type, size_type) [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>; size_type = long unsigned int]'
586 | basic_string(const basic_string& __str, size_type __pos,
| ^~~~~~~~~~~~
/usr/include/c++/14/bits/basic_string.h:586:7: note: candidate expects 3 arguments, 1 provided
/usr/include/c++/14/bits/basic_string.h:569:7: note: candidate: 'std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::basic_string(const std::__cxx11::basic_string<_CharT, _Traits, _Alloc>&, size_type, const _Alloc&) [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>; size_type = long unsigned int]'
569 | basic_string(const basic_string& __str, size_type __pos,
| ^~~~~~~~~~~~
/usr/include/c++/14/bits/basic_string.h:569:7: note: candidate expects 3 arguments, 1 provided
/usr/include/c++/14/bits/basic_string.h:552:7: note: candidate: 'std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::basic_string(const std::__cxx11::basic_string<_CharT, _Traits, _Alloc>&) [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>]'
552 | basic_string(const basic_string& __str)
| ^~~~~~~~~~~~
/usr/include/c++/14/bits/basic_string.h:552:40: note: no known conversion for argument 1 from 'int' to 'const std::__cxx11::basic_string<char>&'
552 | basic_string(const basic_string& __str)
| ~~~~~~~~~~~~~~~~~~~~^~~~~
/usr/include/c++/14/bits/basic_string.h:540:7: note: candidate: 'std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::basic_string(const _Alloc&) [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>]'
540 | basic_string(const _Alloc& __a) _GLIBCXX_NOEXCEPT
| ^~~~~~~~~~~~
/usr/include/c++/14/bits/basic_string.h:540:34: note: no known conversion for argument 1 from 'int' to 'const std::allocator<char>&'
540 | basic_string(const _Alloc& __a) _GLIBCXX_NOEXCEPT
| ~~~~~~~~~~~~~~^~~
/usr/include/c++/14/bits/basic_string.h:527:7: n |
s101490274 | p03712 | C++ | #include <bits/stdc++.h>
using namespace std;
int main(){
int N,M;
int i,j;
cin >> N >> M;
vector<int>vec1(M);
for(i=0;i<M+2;++i){
cout << "#" ;
}
for(j=0;j<N;++j){
for(i=0;i<M;++i){
cin >> vec1.at(i);
if(i=0){
cout << "#"vec1.at(i);
}
else if(0<i<M){
cout << vec1.at(i);
}
else{
cout <<vec1.at(i)"#"<<endl;
}
}
}
for(i=0;i<M+2;++i){
cout << "#";
}
}
| a.cc: In function 'int main()':
a.cc:16:15: error: unable to find string literal operator 'operator""vec1' with 'const char [2]', 'long unsigned int' arguments
16 | cout << "#"vec1.at(i);
| ^~~~~~~
a.cc:22:24: error: expected ';' before string constant
22 | cout <<vec1.at(i)"#"<<endl;
| ^~~
| ;
|
s878406641 | p03712 | C++ | #include <bits/stdc++.h>
using namespace std;
int main(){
int N,M;
int i,j
cin >> N >> M;
vector<int>vec1(M);
for(i=0;i<M+2;++i){
cout << "#" ;
}
for(j=0;j<N;++j){
for(i=0;i<M;++i){
cin >> vec1.at(i);
if(i=0){
cout << "#"vec1.at(i);
}
else if(0<i<M){
cout << vec1.at(i);
}
else{
cout <<vec1.at(i)"#"<<endl;
}
}
}
for(i=0;i<M+2;++i){
cout << "#";
}
}
| a.cc: In function 'int main()':
a.cc:7:3: error: expected initializer before 'cin'
7 | cin >> N >> M;
| ^~~
a.cc:12:7: error: 'j' was not declared in this scope
12 | for(j=0;j<N;++j){
| ^
a.cc:16:15: error: unable to find string literal operator 'operator""vec1' with 'const char [2]', 'long unsigned int' arguments
16 | cout << "#"vec1.at(i);
| ^~~~~~~
a.cc:22:24: error: expected ';' before string constant
22 | cout <<vec1.at(i)"#"<<endl;
| ^~~
| ;
|
s692951069 | p03712 | C++ | #include <bits/stdc++.h>
using namespace std;
int main(){
int N,M;
int i,j
cin >> N >> M;
vector<int>vec1(M);
for(i=0;i<M+2;++i){
cout << "#" ;
}
for(j=0;J<N;++j){
for(i=0;i<M;++i){
cin >> vec1.at(i);
if(i=0){
cout << "#"vec1.at(i);
}
else if(0<i<M){
cout << vec1.at(i);
}
else{
cout <<vec1.at(i)"#"<<endl;
}
}
}
for(i=0;i<M+2;++i){
cout << "#";
}
}
| a.cc: In function 'int main()':
a.cc:7:3: error: expected initializer before 'cin'
7 | cin >> N >> M;
| ^~~
a.cc:12:7: error: 'j' was not declared in this scope
12 | for(j=0;J<N;++j){
| ^
a.cc:12:11: error: 'J' was not declared in this scope
12 | for(j=0;J<N;++j){
| ^
a.cc:16:15: error: unable to find string literal operator 'operator""vec1' with 'const char [2]', 'long unsigned int' arguments
16 | cout << "#"vec1.at(i);
| ^~~~~~~
a.cc:22:24: error: expected ';' before string constant
22 | cout <<vec1.at(i)"#"<<endl;
| ^~~
| ;
|
s644231939 | p03712 | C++ | #include <bits/stdc++.h>
using namespace std;
int main(){
int high,width;
cin >> high >> width;
vector<string> word(high);
for(int i = 0; i < high; i++){
cin >> word.at(i);
}
std::string str = std::string((width + 2), '#');
cout << str << endl;
for(int i = 0; i < high; i++){
cout << '#';
cout << word.at(i);
cout << '#' << endl;
}
cout << str << endl | a.cc: In function 'int main()':
a.cc:19:22: error: expected ';' at end of input
19 | cout << str << endl
| ^
| ;
a.cc:19:22: error: expected '}' at end of input
a.cc:4:11: note: to match this '{'
4 | int main(){
| ^
|
s603898520 | p03712 | C++ | #include <bits/stdc++.h>
using namespace std;
int main(){
int high,width;
cin >> high >> width;
vector<string> word(high);
for(int i = 0; i < high; i++){
cin >> word.at(i);
}
cout << "#" * (width + 2) << endl;
for(int i = 0; i < high; i++){
cout << "#";
cout << word.at(i);
cout << "#" << endl;
}
cout << "#" * (width + 2) << endl | a.cc: In function 'int main()':
a.cc:11:15: error: invalid operands of types 'const char [2]' and 'int' to binary 'operator*'
11 | cout << "#" * (width + 2) << endl;
| ~~~ ^ ~~~~~~~~~~~
| | |
| | int
| const char [2]
a.cc:18:15: error: invalid operands of types 'const char [2]' and 'int' to binary 'operator*'
18 | cout << "#" * (width + 2) << endl
| ~~~ ^ ~~~~~~~~~~~
| | |
| | int
| const char [2]
a.cc:18:36: error: expected '}' at end of input
18 | cout << "#" * (width + 2) << endl
| ^
a.cc:4:11: note: to match this '{'
4 | int main(){
| ^
|
s927719177 | p03712 | C++ | #####
#abc#
#arc#
##### | a.cc:1:1: error: stray '##' in program
1 | #####
| ^~
a.cc:1:3: error: stray '##' in program
1 | #####
| ^~
a.cc:1:5: error: stray '#' in program
1 | #####
| ^
a.cc:2:2: error: invalid preprocessing directive #abc
2 | #abc#
| ^~~
a.cc:3:2: error: invalid preprocessing directive #arc
3 | #arc#
| ^~~
a.cc:4:1: error: stray '##' in program
4 | #####
| ^~
a.cc:4:3: error: stray '##' in program
4 | #####
| ^~
a.cc:4:5: error: stray '#' in program
4 | #####
| ^
|
s139061995 | p03712 | C | #include <iostream>
using namespace std;
int main(){
int h , w, i, j;
cin >> h >> w;
char m[h + 2][w + 2];
for(i = 1; i < h + 1; i++){
for(j = 1; j < w + 1; j++){
cin >> m[i][j];
}
}
for(i = 0; i < h + 2; i++){
m[i][0] = '#';
m[i][w + 1] = '#';
}
for(i = 0; i < w + 2; i++){
m[0][i] = '#';
m[h + 1][i] = '#';
}
for(i = 0; i < h + 2; i++){
for(j = 0; j < w + 2; j++){
cout << m[i][j];
}
cout << endl;
}
return 0;
}
| main.c:1:10: fatal error: iostream: No such file or directory
1 | #include <iostream>
| ^~~~~~~~~~
compilation terminated.
|
s722184488 | p03712 | C++ | #include <bits/stdc++.h>
using namespace std;
char a [100][101] , b [102][102];
int main () {
int H , W ; cin >> H >> W ;
for ( int i = 0; i < H ; i ++)
scanf ("% s " , a [ i ]);
for ( int i = 0; i < H + 2; i ++)
for ( int j = 0; j < W + 2; j ++)
b [ i ][ j ] = ’# ’;
for ( int i = 0; i < H ; i ++)
for ( int j = 0; j < W ; j ++)
b [ i + 1][ j + 1] = a [ i ][ j ];
for ( int i = 0; i < H + 2; i ++) {
for ( int j = 0; j < W + 2; j ++)
cout << b [ i ][ j ];
cout << endl ;
} | a.cc:13:28: error: extended character ’ is not valid in an identifier
13 | b [ i ][ j ] = ’# ’;
| ^
a.cc:13:29: error: stray '#' in program
13 | b [ i ][ j ] = ’# ’;
| ^
a.cc:13:31: error: extended character ’ is not valid in an identifier
13 | b [ i ][ j ] = ’# ’;
| ^
a.cc: In function 'int main()':
a.cc:13:28: error: '\U00002019' was not declared in this scope
13 | b [ i ][ j ] = ’# ’;
| ^
a.cc:24:2: error: expected '}' at end of input
24 | }
| ^
a.cc:6:13: note: to match this '{'
6 | int main () {
| ^
|
s402138632 | p03712 | C++ | #include <bits/stdc++.h>
using namespace std;
char a[100][101], b[102][102];
int main() {
int H, W; cin >> H >> W;
for (int i = 0; i < H; i++) {
scanf("%s", a[i]);
}
for (int i = 0; i < H + 2; i++) {
for (int j = 0; j < W; j++) {
b[i][j] = '#';
}
}
for (int i = 0; i < H; i++) {
for (int j = 0; j < W; j++) {
b[i + 1][j + 1] = a[i][j]
}
}
for (int i = 0; i < H + 2; i++) {
for (int j = 0; j < W + 2; j++)
cout << b[i][j];
cout << endl;
}
} | a.cc: In function 'int main()':
a.cc:20:38: error: expected ';' before '}' token
20 | b[i + 1][j + 1] = a[i][j]
| ^
| ;
21 | }
| ~
|
s466093658 | p03712 | Java | import java.io.*;
import java.util.function.*;
import java.util.stream.*;
class Wandbox
{
/**
* ABC 062 B: Picture Frame
* (周囲1ピクセルを'#'で囲む)
*/
public static void main(String[] args) throws IOException
{
// 入力
BufferedReader br = new BufferedReader(
new InputStreamReader(System.in));
int[] HW = Stream.of(br.readLine().split(" ")).mapToInt(
item -> new Integer(item)).toArray();
Stream<String> as = br.lines().filter(item -> item.indexOf(" ") < 0);
// 枠線を入れる
// Streamは同じインスタンスで2度処理を実行できないため、Supplierを通す
Supplier<Stream<String>> frame = () ->
Stream.of(new String(new char[HW[1]]).replace("\0", "#"));
Stream<String> out = Stream.concat(frame.get(), Stream.concat(as, frame.get())).map(
item -> "#" + item + "#") ;
// 出力
System.out.println(out.collect(Collectors.joining("\n")));
}
} | Main.java:17: warning: [removal] Integer(String) in Integer has been deprecated and marked for removal
item -> new Integer(item)).toArray();
^
1 warning
|
s874883442 | p03712 | Java | import java.io.*;
import java.util.function.*;
import java.util.stream.*;
class Wandbox
{
/**
* ABC 062 B: Picture Frame
* (周囲1ピクセルを'#'で囲む)
*/
public static void main(String[] args) throws IOException
{
// 入力
BufferedReader br = new BufferedReader(
new InputStreamReader(System.in));
int[] HW = Stream.of(br.readLine().split(" ")).mapToInt(
item -> new Integer(item)).toArray();
Stream<String> lines = br.lines();
// データ部分を抽出
Stream<String> a = lines.filter(item -> item.indexOf(" ") < 0);
// 枠線を決める
// Streamは同じインスタンスで2度処理を実行できないため、Supplierを通す
Supplier<Stream<String>> frame = () ->
Stream.of(new String(new char[HW[1]]).replace("\0", "#"));
Stream<String> out = Stream.concat(frame.get(), Stream.concat(a, frame.get())).map(
item -> "#" + item + "#") ;
// 出力(末尾は改行を入れない)
System.out.print(out.collect(Collectors.joining("\n")).replaceFirst("\n$", ""));
}
}
| Main.java:17: warning: [removal] Integer(String) in Integer has been deprecated and marked for removal
item -> new Integer(item)).toArray();
^
1 warning
|
s430319874 | p03712 | C++ | #include<bits/stdc++.h>
using namespace std;
int main(){
int x,y;
cin >> x >> y;
vector<string> vec(x);
for (int i = 0; i < x; i++){
cin >> vec[i]
}
for (int i = 0; i < y; i++){
cout << "#";
}
cout << endl;
for (int i = 0; i < y; i++){
cout << "#" << vec[i] << "#" << endl;
}
for (int i = 0; i < y; i++){
cout << "#";
}
cout << endl;
} | a.cc: In function 'int main()':
a.cc:8:18: error: expected ';' before '}' token
8 | cin >> vec[i]
| ^
| ;
9 | }
| ~
|
s838356629 | p03712 | C++ | #include<bits/stdc++.h>
using namespace std;
int main(){
int x,y;
cin >> x >> y;
vector<string> vec(x);
for (int i = 0; i < x; i++){
string a;
cin >> a;
vec.push_back(a);
}
for (int i = 0; i < y; i++){
cout << "#";
}
cout << endl;
for (in i = 0; i < y; i++){
cout << "#" << vec[i] << "#" << endl;
}
for (int i = 0; i < y; i++){
cout << "#";
}
cout << endl;
} | a.cc: In function 'int main()':
a.cc:18:8: error: 'in' was not declared in this scope; did you mean 'yn'?
18 | for (in i = 0; i < y; i++){
| ^~
| yn
a.cc:18:18: error: 'i' was not declared in this scope
18 | for (in i = 0; i < y; i++){
| ^
|
s145288579 | p03712 | C++ | #include<iostream>
#incltde<algorithm>
using namespace std;
int main(){
int a,b;
cin>>a>>b;
int i;
string c;
for(i=0;i<=1+b;i++){
cout<<"#";
}
cout<<endl;
for(i=0;i<a;i++){
cin>>c;
cout<<"#"<<c<<"#"<<endl;
}
for(i=0;i<=1+b;i++){
cout<<"#";
}
cout<<endl;
} | a.cc:2:2: error: invalid preprocessing directive #incltde; did you mean #include?
2 | #incltde<algorithm>
| ^~~~~~~
| include
|
s886848879 | p03712 | C++ | #include <bits/stdc++.h>
using namespace std;
int main(){
int a,b;
cin>>a>>b;
vector<string>d;
for(int i=0;i<a;i++){
for(int j=0;j<b;j++){
cin>>d[i][j];
}
}
for(int k=0;k<a+2;k++){
for(int l=0;l<b+2;l++){
if(k==0||k==a+1||l==0||l==b+1){
cout<<"#";
}
else{
cout<<[k+1][l+1];
}
}
cout<<endl;
}
}
| a.cc: In function 'int main()':
a.cc:19:41: error: expected ',' before '+' token
19 | cout<<[k+1][l+1];
| ^
| ,
a.cc:19:41: error: expected identifier before '+' token
a.cc: In lambda function:
a.cc:19:44: error: expected '{' before '[' token
19 | cout<<[k+1][l+1];
| ^
a.cc: In function 'int main()':
a.cc:19:44: error: no match for 'operator[]' (operand types are 'main()::<lambda()>' and 'int')
|
s679001782 | p03712 | C++ | #include<bits/stdc++.h>
#define FOR(i, a, b) for (int i = (a); i < (b); ++i)
#define REP(i, n) for (int i = 0; i < (n); ++i)
#define int long long
#define vec(a,n) vector<int> (a)((n))
#define Vec(a,n) vector<string> (a)((n))
#define P pair<int,int>
#define PQ(n) priority_queue<P,vector<P>,greater<P>> (n)
#define pq(n) priority_queue<int> (n)
using namespace std;
signed main(){
int h,w;
cin >> h >> w;
REP(i,w+2){
cout << "#";
}
cout << endl;
REP(i,h){
cout << "#";
string s;
cin << s;
cout << s << "#" << endl;
}
REP(i,w+2){
cout << "#";
}
return 0;
}
| a.cc: In function 'int main()':
a.cc:22:13: error: no match for 'operator<<' (operand types are 'std::istream' {aka 'std::basic_istream<char>'} and 'std::string' {aka 'std::__cxx11::basic_string<char>'})
22 | cin << s;
| ~~~ ^~ ~
| | |
| | std::string {aka std::__cxx11::basic_string<char>}
| std::istream {aka std::basic_istream<char>}
In file included from /usr/include/c++/14/regex:68,
from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:181,
from a.cc:1:
/usr/include/c++/14/bits/regex.h:1715:5: note: candidate: 'template<class _Ch_type, class _Ch_traits, class _Bi_iter> std::basic_ostream<_CharT, _Traits>& std::__cxx11::operator<<(std::basic_ostream<_CharT, _Traits>&, const sub_match<_Bi_iter>&)'
1715 | operator<<(basic_ostream<_Ch_type, _Ch_traits>& __os,
| ^~~~~~~~
/usr/include/c++/14/bits/regex.h:1715:5: note: template argument deduction/substitution failed:
a.cc:22:16: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<_CharT, _Traits>'
22 | cin << s;
| ^
In file included from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:41:
/usr/include/c++/14/cstddef:125:5: note: candidate: 'template<class _IntegerType> constexpr std::__byte_op_t<_IntegerType> std::operator<<(byte, _IntegerType)'
125 | operator<<(byte __b, _IntegerType __shift) noexcept
| ^~~~~~~~
/usr/include/c++/14/cstddef:125:5: note: template argument deduction/substitution failed:
a.cc:22:9: note: cannot convert 'std::cin' (type 'std::istream' {aka 'std::basic_istream<char>'}) to type 'std::byte'
22 | cin << s;
| ^~~
In file included from /usr/include/c++/14/bits/basic_string.h:47,
from /usr/include/c++/14/string:54,
from /usr/include/c++/14/bitset:52,
from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:52:
/usr/include/c++/14/string_view:763:5: note: candidate: 'template<class _CharT, class _Traits> std::basic_ostream<_CharT, _Traits>& std::operator<<(basic_ostream<_CharT, _Traits>&, basic_string_view<_CharT, _Traits>)'
763 | operator<<(basic_ostream<_CharT, _Traits>& __os,
| ^~~~~~~~
/usr/include/c++/14/string_view:763:5: note: template argument deduction/substitution failed:
a.cc:22:16: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<_CharT, _Traits>'
22 | cin << s;
| ^
/usr/include/c++/14/bits/basic_string.h:4077:5: note: candidate: 'template<class _CharT, class _Traits, class _Alloc> std::basic_ostream<_CharT, _Traits>& std::operator<<(basic_ostream<_CharT, _Traits>&, const __cxx11::basic_string<_CharT, _Traits, _Allocator>&)'
4077 | operator<<(basic_ostream<_CharT, _Traits>& __os,
| ^~~~~~~~
/usr/include/c++/14/bits/basic_string.h:4077:5: note: template argument deduction/substitution failed:
a.cc:22:16: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<_CharT, _Traits>'
22 | cin << s;
| ^
/usr/include/c++/14/bitset:1687:5: note: candidate: 'template<class _CharT, class _Traits, long unsigned int _Nb> std::basic_ostream<_CharT, _Traits>& std::operator<<(basic_ostream<_CharT, _Traits>&, const bitset<_Nb>&)'
1687 | operator<<(std::basic_ostream<_CharT, _Traits>& __os,
| ^~~~~~~~
/usr/include/c++/14/bitset:1687:5: note: template argument deduction/substitution failed:
a.cc:22:16: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<_CharT, _Traits>'
22 | cin << s;
| ^
In file included from /usr/include/c++/14/bits/ios_base.h:46,
from /usr/include/c++/14/streambuf:43,
from /usr/include/c++/14/bits/streambuf_iterator.h:35,
from /usr/include/c++/14/iterator:66,
from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:54:
/usr/include/c++/14/system_error:339:5: note: candidate: 'template<class _CharT, class _Traits> std::basic_ostream<_CharT, _Traits>& std::operator<<(basic_ostream<_CharT, _Traits>&, const error_code&)'
339 | operator<<(basic_ostream<_CharT, _Traits>& __os, const error_code& __e)
| ^~~~~~~~
/usr/include/c++/14/system_error:339:5: note: template argument deduction/substitution failed:
a.cc:22:16: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<_CharT, _Traits>'
22 | cin << s;
| ^
In file included from /usr/include/c++/14/memory:80,
from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:56:
/usr/include/c++/14/bits/shared_ptr.h:70:5: note: candidate: 'template<class _Ch, class _Tr, class _Tp, __gnu_cxx::_Lock_policy _Lp> std::basic_ostream<_CharT, _Traits>& std::operator<<(basic_ostream<_CharT, _Traits>&, const __shared_ptr<_Tp, _Lp>&)'
70 | operator<<(std::basic_ostream<_Ch, _Tr>& __os,
| ^~~~~~~~
/usr/include/c++/14/bits/shared_ptr.h:70:5: note: template argument deduction/substitution failed:
a.cc:22:16: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<_CharT, _Traits>'
22 | cin << s;
| ^
In file included from /usr/include/c++/14/istream:41,
from /usr/include/c++/14/sstream:40,
from /usr/include/c++/14/complex:45,
from /usr/include/c++/14/ccomplex:39,
from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:127:
/usr/include/c++/14/ostream:563:5: note: candidate: 'template<class _CharT, class _Traits> std::basic_ostream<_CharT, _Traits>& std::operator<<(basic_ostream<_CharT, _Traits>&, _CharT)'
563 | operator<<(basic_ostream<_CharT, _Traits>& __out, _CharT __c)
| ^~~~~~~~
/usr/include/c++/14/ostream:563:5: note: template argument deduction/substitution failed:
a.cc:22:16: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<_CharT, _Traits>'
22 | cin << s;
| ^
/usr/include/c++/14/ostream:573:5: note: candidate: 'template<class _CharT, class _Traits> std::basic_ostream<_CharT, _Traits>& std::operator<<(basic_ostream<_CharT, _Traits>&, char)'
573 | operator<<(basic_ostream<_CharT, _Traits>& __out, char __c)
| ^~~~~~~~
/usr/include/c++/14/ostream:573:5: note: template argument deduction/substitution failed:
a.cc:22:16: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<_CharT, _Traits>'
22 | cin << s;
| ^
/usr/include/c++/14/ostream:579:5: note: candidate: 'template<class _Traits> std::basic_ostream<char, _Traits>& std::operator<<(basic_ostream<char, _Traits>&, char)'
579 | operator<<(basic_ostream<char, _Traits>& __out, char __c)
| ^~~~~~~~
/usr/include/c++/14/ostream:579:5: note: template argument deduction/substitution failed:
a.cc:22:16: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<char, _Traits>'
22 | cin << s;
| ^
/usr/include/c++/14/ostream:590:5: note: candidate: 'template<class _Traits> std::basic_ostream<char, _Traits>& std::operator<<(basic_ostream<char, _Traits>&, signed char)'
590 | operator<<(basic_ostream<char, _Traits>& __out, signed char __c)
| ^~~~~~~~
/usr/include/c++/14/ostream:590:5: note: template argument deduction/substitution failed:
a.cc:22:16: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<char, _Traits>'
22 | cin << s;
| ^
/usr/include/c++/14/ostream:595:5: note: candidate: 'template<class _Traits> std::basic_ostream<char, _Traits>& std::operator<<(basic_ostream<char, _Traits>&, unsigned char)'
595 | operator<<(basic_ostream<char, _Traits>& __out, unsigned char __c)
| ^~~~~~~~
/usr/include/c++/14/ostream:595:5: note: template argument deduction/substitution failed:
a.cc:22:16: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<char, _Traits>'
22 | cin << s;
| ^
/usr/include/c++/14/ostream:654:5: note: candidate: 'template<class _CharT, class _Traits> std::basic_ostream<_CharT, _Traits>& std::operator<<(basic_ostream<_CharT, _Traits>&, const _CharT*)'
654 | operator<<(basic_ostream<_CharT, _Traits>& __out, const _CharT* __s)
| ^~~~~~~~
/usr/include/c++/14/ostream:654:5: note: template argument deduction/substitution failed:
a.cc:22:16: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<_CharT, _Traits>'
22 | cin << s;
| ^
In file included from /usr/include/c++/14/ostream:1022:
/usr/include/c++/14/bits/ostream.tcc:307:5: note: candidate: 'template<class _CharT, class _Traits> std::basic_ostream<_CharT, _Traits>& std::operator<<(basic_ostream<_CharT, _Traits>&, const char*)'
307 | operator<<(basic_ostream<_CharT, _Traits>& __out, const char* __s)
| ^~~~~~~~
/usr/include/c++/14/bits/ostream.tcc:307:5: note: template argument deduction/substitution failed:
a.cc:22:16: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<_CharT, _Traits>'
22 | cin << s;
| ^
/usr/include/c++/14/ostream:671:5: note: candidate: 'template<class _Traits> std::basic_ostream<char, _Traits>& std::operator<<(basic_ostream<char, _Traits>&, const char*)'
671 | operator<<(basic_ostream<char, _Traits>& __out, const char* __s)
| ^~~~~~~~
/usr/include/c++/14/ostream:671:5: note: template argument deduction/substitution failed:
a.cc:22:16: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<char, _Traits>'
22 | cin << s;
| ^
/usr/include/c++/14/ostream:684:5: note: candidate: 'template<class _Traits> s |
s917176680 | p03712 | Java | #include<bits/stdc++.h>
#define FOR(i, a, b) for (int i = (a); i < (b); ++i)
#define REP(i, n) for (int i = 0; i < (n); ++i)
#define int long long
#define vec(a,n) vector<int> (a)((n))
#define Vec(a,n) vector<string> (a)((n))
#define P pair<int,int>
#define PQ(n) priority_queue<P,vector<P>,greater<P>> (n)
#define pq(n) priority_queue<int> (n)
using namespace std;
signed main(){
int h,w;
cin >> h >> w;
REP(i,w+2){
cout << "#";
}
cout << endl;
REP(i,h){
cout << "#";
string s;
cin << s;
cout << s << "#" << endl;
}
REP(i,w+2){
cout << "#";
}
return 0;
}
| Main.java:1: error: illegal character: '#'
#include<bits/stdc++.h>
^
Main.java:1: error: class, interface, enum, or record expected
#include<bits/stdc++.h>
^
Main.java:2: error: illegal character: '#'
#define FOR(i, a, b) for (int i = (a); i < (b); ++i)
^
Main.java:2: error: class, interface, enum, or record expected
#define FOR(i, a, b) for (int i = (a); i < (b); ++i)
^
Main.java:2: error: class, interface, enum, or record expected
#define FOR(i, a, b) for (int i = (a); i < (b); ++i)
^
Main.java:3: error: illegal character: '#'
#define REP(i, n) for (int i = 0; i < (n); ++i)
^
Main.java:3: error: class, interface, enum, or record expected
#define REP(i, n) for (int i = 0; i < (n); ++i)
^
Main.java:3: error: class, interface, enum, or record expected
#define REP(i, n) for (int i = 0; i < (n); ++i)
^
Main.java:4: error: illegal character: '#'
#define int long long
^
Main.java:5: error: illegal character: '#'
#define vec(a,n) vector<int> (a)((n))
^
Main.java:6: error: illegal character: '#'
#define Vec(a,n) vector<string> (a)((n))
^
Main.java:7: error: illegal character: '#'
#define P pair<int,int>
^
Main.java:8: error: illegal character: '#'
#define PQ(n) priority_queue<P,vector<P>,greater<P>> (n)
^
Main.java:9: error: illegal character: '#'
#define pq(n) priority_queue<int> (n)
^
Main.java:14: error: not a statement
cin >> h >> w;
^
Main.java:16: error: not a statement
cout << "#";
^
Main.java:18: error: not a statement
cout << endl;
^
Main.java:20: error: not a statement
cout << "#";
^
Main.java:22: error: not a statement
cin << s;
^
Main.java:23: error: not a statement
cout << s << "#" << endl;
^
Main.java:26: error: not a statement
cout << "#";
^
Main.java:12: error: unnamed classes are a preview feature and are disabled by default.
signed main(){
^
(use --enable-preview to enable unnamed classes)
Main.java:15: error: ';' expected
REP(i,w+2){
^
Main.java:19: error: ';' expected
REP(i,h){
^
Main.java:25: error: ';' expected
REP(i,w+2){
^
25 errors
|
s800555662 | p03712 | C++ | #include <bits/stdc++.h>
using namespace std;
int main(){
int H,W;
cin >>H >>W;
vector<int> vec(W);
for(int i = 1;i < H+1;i++){
for(int j = 1;j < W+1;j++){
cin >> vec.at(j);}
if(i == 0||i == H){
for(int j = 0;j < W+1;j++){
cout << "#" <<endl;}
}
else if(i > 0){
cout << "#" <<endl;
for(int j = 1;j < W+1;j++){
cout << vec.at(j) <<endl;
if(j == W){
cout << "#" <<endl;}
}
}
} | a.cc: In function 'int main()':
a.cc:24:2: error: expected '}' at end of input
24 | }
| ^
a.cc:4:11: note: to match this '{'
4 | int main(){
| ^
|
s371070855 | p03712 | C++ | #include <bits/stdc++.h>
using namespace std;
int main(){
int H,W;
cin >>H >>W;
vector<int> vec(W);
for(int i = 0;i < H;i++){
for(int j = 0;j < W;j++){
cin >> vec.at(j);
}
if(i == 0||i == H-1){
for(int j = 0;j < W;j++){
cout << "#" <<endl;
}
}
else if(i > 0){
cout << "#" <<endl;
for(int j = 0;j < W;j++){
cout << vec.at(j) <<endl;
if(j == W-1){
cout << "#" <<endl;
}
}
}
} | a.cc: In function 'int main()':
a.cc:26:2: error: expected '}' at end of input
26 | }
| ^
a.cc:4:11: note: to match this '{'
4 | int main(){
| ^
|
s131110879 | p03712 | C++ | #include <bits/stdc++.h>
using namespace std;
int main(){
int H,W;
cin >>H >>W;
vector<int> vec(W);
for(int i = 0;i < H;i++){
for(int j = 0;j < W;j++){
cin >> vec.at(j);
}
if(i == 0||i == H-1){
for(int j = 0;j < W;j++){
cout << "#" <<endl;
}
}
else if(i > 0){
cout << "#" <<endl;
for(int j = 0;j < W;j++){
cout << vec.at(j) <<endl;
}
}
else if(j == W-1){
cout << "#" <<endl;
}
}
} | a.cc: In function 'int main()':
a.cc:23:15: error: 'j' was not declared in this scope
23 | else if(j == W-1){
| ^
|
s494350430 | p03712 | C++ | #include <bits/stdc++.h>
using namespace std;
int main(){
int H,W;
cin >>H >>W;
vector<int> vec(W);
for(int i = 0;i < H;i++){
for(int j = 0;j < W;j++){
cin >> vec.at(j);
}
if(i == 0||i == H-1){
for(int j = 0;j < W;j++){
cout << "#" <<endl;
}
}
else if(i > 0){
cout << "#" <<endl;
for(int j = 0;j < W;j++){
cout << vec.at(j) <<endl;
}
else if(j == W-1){
cout << "#" <<endl;
}
}
} | a.cc: In function 'int main()':
a.cc:22:7: error: expected '}' before 'else'
22 | else if(j == W-1){
| ^~~~
a.cc:17:19: note: to match this '{'
17 | else if(i > 0){
| ^
a.cc:22:15: error: 'j' was not declared in this scope
22 | else if(j == W-1){
| ^
|
s951815107 | p03712 | C++ | #include <bits/stdc++.h>
using namespace std;
int main(){
int H,W;
cin >>H >>W;
vector<int> vec(W);
for(int i = 0;i < H;i++){
for(int j = 0;j < W;j++){
cin >> vec.at(j);
}
if(i == 0||i == H-1){
for(int j = 0;j < W;j++){
cout << "#" <<endl;
}
}
else if(i > 0){
cout << "#" <<endl;
if(W > j){
for(int j = 0;j < W;j++){
cout << vec.at(j) <<endl;
}
cout << "#" <<endl;
}
}
} | a.cc: In function 'int main()':
a.cc:19:14: error: 'j' was not declared in this scope
19 | if(W > j){
| ^
a.cc:26:2: error: expected '}' at end of input
26 | }
| ^
a.cc:4:11: note: to match this '{'
4 | int main(){
| ^
|
s715624610 | p03712 | C++ | #include <bits/stdc++.h>
using namespace std;
int main() {
int H, W;
cin >> H >> W;
for ( int i = 0; i < W + 2; i++ ) cout << "#";
cout << endl;
for ( int i = 0; i < H; i++ ) {
cout << "#";
for ( i nt j = 0; j < W; j++ ) {
char c;
cin >> c;
cout << c;
}
cout << "#" << endl;
}
for ( int i = 0; i < W + 2; i++ ) cout << "#";
cout << endl;
}
| a.cc: In function 'int main()':
a.cc:13:12: error: expected ';' before 'nt'
13 | for ( i nt j = 0; j < W; j++ ) {
| ^~~
| ;
a.cc:13:23: error: 'j' was not declared in this scope
13 | for ( i nt j = 0; j < W; j++ ) {
| ^
|
s542940523 | p03712 | Java | import java.util.*;
public class Main
{
public static void main(String args[])
{
Scanner in=new Scanner(System.in);
int H=in.nextInt();
int W=in.nextInt();
String dum=in.nextLine();
String s[]=new String[H];
for (int i=0; i<H; i++)
s[i]=in.nextLine();
for(int i=0; i<W+2; i++)
System.out.print("#");
System.out.println("");
for (int i=0; i<H; i++)
System.out.println("#"+a[i]+"#");
for(int i=0; i<W+2; i++)
System.out.print("#");
}
}
| Main.java:17: error: cannot find symbol
System.out.println("#"+a[i]+"#");
^
symbol: variable a
location: class Main
1 error
|
s809174085 | p03712 | Java | import java.io.*;
public class c
{
public static void main(String args[])throws IOException
{
BufferedReader b=new BufferedReader(new InputStreamReader(System.in));
String[] str=b.readLine().trim().split(" ");
int r=Integer.parseInt(str[0]);
int c=Integer.parseInt(str[1]);
String[] line=new String[r];
for(int i=0;i<r;i++)
{
line[i]=b.readLine();
}
String[][] s=new String[r+2][c+2];
for(int i=0;i<r+2;i++)
{
for(int j=0;j<c+2;j++)
{
if(i==0||i==r+1||j==0||j==c+1)
System.out.print("#");
else
{
System.out.print(line[i-1].charAt(j-1));
}
}
System.out.println();
}
}
} | Main.java:2: error: class c is public, should be declared in a file named c.java
public class c
^
1 error
|
s500185035 | p03712 | C++ | #include <bits/stdc++.h>
using namespace std;
int main() {
int H,W;
cin >> H >> W;
vector <string> a(100);
for(int i=0;i<H+2;i++){
for(int j=0;j<W+2;j++){
if(0<i<H+1&&0<j<W+1){
cin >> a[i][j];
}
else a[i][j]="#";
}
}
for(int i=0;i<H+2;i++){
cout << a[i] <<endl;
}
}
| a.cc: In function 'int main()':
a.cc:13:20: error: invalid conversion from 'const char*' to '__gnu_cxx::__alloc_traits<std::allocator<char>, char>::value_type' {aka 'char'} [-fpermissive]
13 | else a[i][j]="#";
| ^~~
| |
| const char*
|
s600368436 | p03712 | C++ | #include <bits/stdc++.h>
using namespace std;
int main() {
int H,W;
cin >> H >> W;
vector <string> a(100);
for(int i=0;i<H+2;i++){
for(int j=0;j<W+2;j++){
if(0<i<H+1&&0<j<W+1){
cin >> a[i][j];
}
else a[i][j]="#";
}
}
for(i=0;i<H+2;i++){
cout << a[i] <<endl;
}
}
| a.cc: In function 'int main()':
a.cc:13:20: error: invalid conversion from 'const char*' to '__gnu_cxx::__alloc_traits<std::allocator<char>, char>::value_type' {aka 'char'} [-fpermissive]
13 | else a[i][j]="#";
| ^~~
| |
| const char*
a.cc:16:7: error: 'i' was not declared in this scope
16 | for(i=0;i<H+2;i++){
| ^
|
s419360020 | p03712 | C++ | #include<bits/stdc++.h>
using namespace std;
int main() {
int H, W;
cin >> H >> W;
for (int i = 0; i < H; i++) {
for (int j = 0; j < W:j++) {
cin >> A[i][j];
}
}
for (int i = 0; i < W + 1; i++) {
cout << "#";
if (i == W) {
cout << endl;
}
}
for (int i = 0; i < H ; i++) {
cout << "#";
for (int j = 0; j < W; j++) {
cout << A[i][j];
}
cout << "#" << endl;
}
for (int i = 0; i < W + 1; i++) {
cout << "#";
if (i == W) {
cout << endl;
}
}
} | a.cc: In function 'int main()':
a.cc:7:33: warning: range-based 'for' loops with initializer only available with '-std=c++20' or '-std=gnu++20' [-Wc++20-extensions]
7 | for (int j = 0; j < W:j++) {
| ^
a.cc:7:38: error: found ':' in nested-name-specifier, expected '::'
7 | for (int j = 0; j < W:j++) {
| ^
| ::
a.cc:7:37: error: 'W' is not a class, namespace, or enumeration
7 | for (int j = 0; j < W:j++) {
| ^
a.cc:10:9: error: expected primary-expression before '}' token
10 | }
| ^
a.cc:9:18: error: expected ';' before '}' token
9 | }
| ^
| ;
10 | }
| ~
a.cc:10:9: error: expected primary-expression before '}' token
10 | }
| ^
a.cc:9:18: error: expected ')' before '}' token
9 | }
| ^
| )
10 | }
| ~
a.cc:7:21: note: to match this '('
7 | for (int j = 0; j < W:j++) {
| ^
a.cc:10:9: error: expected primary-expression before '}' token
10 | }
| ^
a.cc:20:33: error: 'A' was not declared in this scope
20 | cout << A[i][j];
| ^
|
s742519835 | p03712 | C | #include<stdio.h>
int main(){
int h,w;
char a[100][101];
scanf("%d%d",&h,&w);
for(i=0;i<h;i++)scanf("%s",a[i]);
for(i=-1;i<=h;i++){
if(i==-1||i==h){
for(j=0;j<n+2;j++)printf("#");
puts("");
}
else{
printf("#%s#",a[i]);
}
}
return 0;
} | main.c: In function 'main':
main.c:7:5: error: 'i' undeclared (first use in this function)
7 | for(i=0;i<h;i++)scanf("%s",a[i]);
| ^
main.c:7:5: note: each undeclared identifier is reported only once for each function it appears in
main.c:10:5: error: 'j' undeclared (first use in this function)
10 | for(j=0;j<n+2;j++)printf("#");
| ^
main.c:10:11: error: 'n' undeclared (first use in this function)
10 | for(j=0;j<n+2;j++)printf("#");
| ^
|
s695715586 | p03712 | C++ | #include <iostream>
#include <string>
#include <algorithm>
#include <vector>
#include <utility>
#include <cstring>
#include <cmath>
#include <queue>
#include <stack>
#include <map>
#define INF (long)1e9
const int MOD = 1e9 + 7;
const int dx[] = {1, -1, 0, 0};
const int dy[] = {0, 0, 1, -1};
using namespace std;
typedef long long ll;
int main()
{
cin.tie(0);
ios::sync_with_stdio(false);
int h, w;
cin >> h >> w;
char A[h + 1][w + 1];
for(int i = 0; i < h; i++)
{
for(int j = 0; j < w; j++)
{
cin >> A[i][j];
}
}
for(int i = 0; i < h; i++)
{
if(i == 0)
{
for(int j = 0; j < w + 2; j++)
{
cout << '#';
}
cout << endl;
}
for(int j = 0; j < w; j++)
{
if(j == 0)
{
cout << '#';
}
cout << A[i][j];
if(j == w - 1)
{
cout << '#';
}
}
cout << endl;
if(i == h - 1)
{
for(int j = 0; j < w + 2; j++)
{
cout << '#';
}
}
}
cout << endl;
return 0;
| a.cc: In function 'int main()':
a.cc:63:18: error: expected '}' at end of input
63 | return 0;
| ^
a.cc:18:1: note: to match this '{'
18 | {
| ^
|
s966081747 | p03712 | C | #include<stdio.h>
#include<string>
int main(){
int n, m, i, j, t, k;
char a[111][111];
while(~scanf("%d %d", &n, &m)){
getchar();
for(i = 0; i < n; i++) { gets(a[i]); a[i][m] = '#'; }
for(i = 0; i < m + 2; i++) printf("#");
printf("\n");
for(i = 0; i < n; i++) { printf("#"); puts(a[i]); }
for(i = 0; i < m + 2; i++) printf("#");
printf("\n");
}
return 0;
} | main.c:2:9: fatal error: string: No such file or directory
2 | #include<string>
| ^~~~~~~~
compilation terminated.
|
s996301904 | p03712 | C++ | #include<stdio.h>
#include<string>
int main(){
int n, m, i, j, t, k;
char a[111][111];
while(~scanf("%d %d", &n, &m)){
getchar();
for(i = 0; i < n; i++) { gets(a[i]); a[i][m] = '#'; }
for(i = 0; i < m + 2; i++) printf("#");
printf("\n");
for(i = 0; i < n; i++) { printf("#"); puts(a[i]); }
for(i = 0; i < m + 2; i++) printf("#");
printf("\n");
}
return 0;
} | a.cc: In function 'int main()':
a.cc:9:43: error: 'gets' was not declared in this scope; did you mean 'getw'?
9 | for(i = 0; i < n; i++) { gets(a[i]); a[i][m] = '#'; }
| ^~~~
| getw
|
s822092842 | p03712 | C++ | #include <bits/stdc++.h>
#define rep(i,a,n) for(int (i) = (a);(i) < (n);(i)++)
typedef long long ll;
using namespace std;
int main(){
int h,w;
cin >> h >> w;
char s;
rep(i,0,h+2){
rep(j,0,w+2){
if(i == 0 || j == 0 || i == h+1 || j == w+1){
cout << "#";
}
else{
cin << s;
cout << s;
}
}
cout << endl;
}
return 0;
} | a.cc: In function 'int main()':
a.cc:17:15: error: no match for 'operator<<' (operand types are 'std::istream' {aka 'std::basic_istream<char>'} and 'char')
17 | cin << s;
| ~~~ ^~ ~
| | |
| | char
| std::istream {aka std::basic_istream<char>}
a.cc:17:15: note: candidate: 'operator<<(int, int)' (built-in)
17 | cin << s;
| ~~~~^~~~
a.cc:17:15: note: no known conversion for argument 1 from 'std::istream' {aka 'std::basic_istream<char>'} to 'int'
In file included from /usr/include/c++/14/regex:68,
from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:181,
from a.cc:1:
/usr/include/c++/14/bits/regex.h:1715:5: note: candidate: 'template<class _Ch_type, class _Ch_traits, class _Bi_iter> std::basic_ostream<_CharT, _Traits>& std::__cxx11::operator<<(std::basic_ostream<_CharT, _Traits>&, const sub_match<_Bi_iter>&)'
1715 | operator<<(basic_ostream<_Ch_type, _Ch_traits>& __os,
| ^~~~~~~~
/usr/include/c++/14/bits/regex.h:1715:5: note: template argument deduction/substitution failed:
a.cc:17:18: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<_CharT, _Traits>'
17 | cin << s;
| ^
In file included from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:41:
/usr/include/c++/14/cstddef:125:5: note: candidate: 'template<class _IntegerType> constexpr std::__byte_op_t<_IntegerType> std::operator<<(byte, _IntegerType)'
125 | operator<<(byte __b, _IntegerType __shift) noexcept
| ^~~~~~~~
/usr/include/c++/14/cstddef:125:5: note: template argument deduction/substitution failed:
a.cc:17:11: note: cannot convert 'std::cin' (type 'std::istream' {aka 'std::basic_istream<char>'}) to type 'std::byte'
17 | cin << s;
| ^~~
In file included from /usr/include/c++/14/bits/basic_string.h:47,
from /usr/include/c++/14/string:54,
from /usr/include/c++/14/bitset:52,
from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:52:
/usr/include/c++/14/string_view:763:5: note: candidate: 'template<class _CharT, class _Traits> std::basic_ostream<_CharT, _Traits>& std::operator<<(basic_ostream<_CharT, _Traits>&, basic_string_view<_CharT, _Traits>)'
763 | operator<<(basic_ostream<_CharT, _Traits>& __os,
| ^~~~~~~~
/usr/include/c++/14/string_view:763:5: note: template argument deduction/substitution failed:
a.cc:17:18: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<_CharT, _Traits>'
17 | cin << s;
| ^
/usr/include/c++/14/bits/basic_string.h:4077:5: note: candidate: 'template<class _CharT, class _Traits, class _Alloc> std::basic_ostream<_CharT, _Traits>& std::operator<<(basic_ostream<_CharT, _Traits>&, const __cxx11::basic_string<_CharT, _Traits, _Allocator>&)'
4077 | operator<<(basic_ostream<_CharT, _Traits>& __os,
| ^~~~~~~~
/usr/include/c++/14/bits/basic_string.h:4077:5: note: template argument deduction/substitution failed:
a.cc:17:18: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<_CharT, _Traits>'
17 | cin << s;
| ^
/usr/include/c++/14/bitset:1687:5: note: candidate: 'template<class _CharT, class _Traits, long unsigned int _Nb> std::basic_ostream<_CharT, _Traits>& std::operator<<(basic_ostream<_CharT, _Traits>&, const bitset<_Nb>&)'
1687 | operator<<(std::basic_ostream<_CharT, _Traits>& __os,
| ^~~~~~~~
/usr/include/c++/14/bitset:1687:5: note: template argument deduction/substitution failed:
a.cc:17:18: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<_CharT, _Traits>'
17 | cin << s;
| ^
In file included from /usr/include/c++/14/bits/ios_base.h:46,
from /usr/include/c++/14/streambuf:43,
from /usr/include/c++/14/bits/streambuf_iterator.h:35,
from /usr/include/c++/14/iterator:66,
from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:54:
/usr/include/c++/14/system_error:339:5: note: candidate: 'template<class _CharT, class _Traits> std::basic_ostream<_CharT, _Traits>& std::operator<<(basic_ostream<_CharT, _Traits>&, const error_code&)'
339 | operator<<(basic_ostream<_CharT, _Traits>& __os, const error_code& __e)
| ^~~~~~~~
/usr/include/c++/14/system_error:339:5: note: template argument deduction/substitution failed:
a.cc:17:18: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<_CharT, _Traits>'
17 | cin << s;
| ^
In file included from /usr/include/c++/14/memory:80,
from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:56:
/usr/include/c++/14/bits/shared_ptr.h:70:5: note: candidate: 'template<class _Ch, class _Tr, class _Tp, __gnu_cxx::_Lock_policy _Lp> std::basic_ostream<_CharT, _Traits>& std::operator<<(basic_ostream<_CharT, _Traits>&, const __shared_ptr<_Tp, _Lp>&)'
70 | operator<<(std::basic_ostream<_Ch, _Tr>& __os,
| ^~~~~~~~
/usr/include/c++/14/bits/shared_ptr.h:70:5: note: template argument deduction/substitution failed:
a.cc:17:18: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<_CharT, _Traits>'
17 | cin << s;
| ^
In file included from /usr/include/c++/14/istream:41,
from /usr/include/c++/14/sstream:40,
from /usr/include/c++/14/complex:45,
from /usr/include/c++/14/ccomplex:39,
from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:127:
/usr/include/c++/14/ostream:563:5: note: candidate: 'template<class _CharT, class _Traits> std::basic_ostream<_CharT, _Traits>& std::operator<<(basic_ostream<_CharT, _Traits>&, _CharT)'
563 | operator<<(basic_ostream<_CharT, _Traits>& __out, _CharT __c)
| ^~~~~~~~
/usr/include/c++/14/ostream:563:5: note: template argument deduction/substitution failed:
a.cc:17:18: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<_CharT, _Traits>'
17 | cin << s;
| ^
/usr/include/c++/14/ostream:573:5: note: candidate: 'template<class _CharT, class _Traits> std::basic_ostream<_CharT, _Traits>& std::operator<<(basic_ostream<_CharT, _Traits>&, char)'
573 | operator<<(basic_ostream<_CharT, _Traits>& __out, char __c)
| ^~~~~~~~
/usr/include/c++/14/ostream:573:5: note: template argument deduction/substitution failed:
a.cc:17:18: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<_CharT, _Traits>'
17 | cin << s;
| ^
/usr/include/c++/14/ostream:579:5: note: candidate: 'template<class _Traits> std::basic_ostream<char, _Traits>& std::operator<<(basic_ostream<char, _Traits>&, char)'
579 | operator<<(basic_ostream<char, _Traits>& __out, char __c)
| ^~~~~~~~
/usr/include/c++/14/ostream:579:5: note: template argument deduction/substitution failed:
a.cc:17:18: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<char, _Traits>'
17 | cin << s;
| ^
/usr/include/c++/14/ostream:590:5: note: candidate: 'template<class _Traits> std::basic_ostream<char, _Traits>& std::operator<<(basic_ostream<char, _Traits>&, signed char)'
590 | operator<<(basic_ostream<char, _Traits>& __out, signed char __c)
| ^~~~~~~~
/usr/include/c++/14/ostream:590:5: note: template argument deduction/substitution failed:
a.cc:17:18: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<char, _Traits>'
17 | cin << s;
| ^
/usr/include/c++/14/ostream:595:5: note: candidate: 'template<class _Traits> std::basic_ostream<char, _Traits>& std::operator<<(basic_ostream<char, _Traits>&, unsigned char)'
595 | operator<<(basic_ostream<char, _Traits>& __out, unsigned char __c)
| ^~~~~~~~
/usr/include/c++/14/ostream:595:5: note: template argument deduction/substitution failed:
a.cc:17:18: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<char, _Traits>'
17 | cin << s;
| ^
/usr/include/c++/14/ostream:654:5: note: candidate: 'template<class _CharT, class _Traits> std::basic_ostream<_CharT, _Traits>& std::operator<<(basic_ostream<_CharT, _Traits>&, const _CharT*)'
654 | operator<<(basic_ostream<_CharT, _Traits>& __out, const _CharT* __s)
| ^~~~~~~~
/usr/include/c++/14/ostream:654:5: note: template argument deduction/substitution failed:
a.cc:17:18: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<_CharT, _Traits>'
17 | cin << s;
| ^
In file included from /usr/include/c++/14/ostream:1022:
/usr/include/c++/14/bits/ostream.tcc:307:5: note: candidate: 'template<class _CharT, class _Traits> std::basic_ostream<_CharT, _Traits>& std::operator<<(basic_ostream<_CharT, _Traits>&, const char*)'
307 | operator<<(basic_ostream<_CharT, _Traits>& __out, const char* __s)
| ^~~~~~~~
/usr/include/c++/14/bits/ostream.tcc:307:5: note: template argument deduction/substitution failed:
a.cc:17:18: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<_CharT, _Traits>'
17 | cin << s;
| ^
/usr/include/c++/14/ostream:671:5: note: candidate: 'template<class _Traits> std::basic_ostream<char, _Traits>& std::operator<<(basic_ostream<char, _Traits>&, const char*)'
671 | operator<<(basic_ostream<char, _Traits>& __out, const char* __s)
| ^~~~~~~~
/usr/include/c++/14/ostream:671:5: note: template argument deduction/substitution failed:
a.cc:17:18: note: 'std::istream' {aka 'std: |
s218364837 | p03712 | C++ |
#include<string>
#include<algorithm>
#include<vector>
#include<queue>
#include<map>
#include<math.h>
#include<iomanip>
#include<set>
#include<numeric>
#include<cstring>
#define REP(i, n) for(int i = 0;i < n;i++)
#define REPR(i, n) for(int i = n;i >= 0;i--)
#define FOR(i, m, n) for(int i = m;i < n;i++)
#define FORR(i, m, n) for(int i = m;i >= n;i--)
#define SORT(v, n) sort(v, v+n);
#define VSORT(v) sort(v.begin(), v.end());
#define REVERSE(v,n) reverse(v,v+n);
#define VREVERSE(v) reverse(v.begin(), v.end());
#define ll long long
#define pb(a) push_back(a)
#define INF 999999999
#define m0(x) memset(x,0,sizeof(x))
#define fill(x,y) memset(x,y,sizeof(x))
using namespace std;
int dy[4] = { 0,0,1,-1 };
int dx[4] = { 1,-1,0,0 };
int dxx[8] = { 0,0,1,1,1,-1,-1,-1 };
int dyy[8] = { 1,-1,0,1,-1,0,1,-1 };
ll m = 1000000007;
const int MOD = 1000000007;
ll gcd(ll x, ll y) {
ll m = max(x, y), n = min(x, y);
if (m%n == 0)return n;
else return gcd(m%n, n);
}
ll lcm(ll x, ll y) {
return x / gcd(x, y)*y;
}
ll myPow(ll x, ll n, ll m) {
if (n == 0)
return 1;
if (n % 2 == 0)
return myPow(x * x % m, n / 2, m);
else
return x * myPow(x, n - 1, m) % m;
}
long long nCr(int n, int r) {
if (r > n / 2) r = n - r; // because C(n, r) == C(n, n - r)
long long ans = 1;
int i;
for (i = 1; i <= r; i++) {
ans *= n - r + i;
ans /= i;
}
return ans;
}
char ans[110][110];
int main() {
int H,W;cin>>H>>W;
REP(i,H){
REP(j,W){
cin>>ans[i+1][j+1];
}
}
REP(i,H+2){
REP(j,W+2){
if(i==0||i==H+1||j==0||j==W+1){
ans[i][j]='#';
}
}
}
REP(i,H+2){
REP(j,W+2){
cout<<ans[i][j];
}
cout<<endl;
}
}
| a.cc: In function 'int main()':
a.cc:73:17: error: 'cin' was not declared in this scope
73 | int H,W;cin>>H>>W;
| ^~~
a.cc:12:1: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
11 | #include<cstring>
+++ |+#include <iostream>
12 | #define REP(i, n) for(int i = 0;i < n;i++)
a.cc:88:25: error: 'cout' was not declared in this scope
88 | cout<<ans[i][j];
| ^~~~
a.cc:88:25: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
a.cc:90:17: error: 'cout' was not declared in this scope
90 | cout<<endl;
| ^~~~
a.cc:90:17: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
|
s135884127 | p03712 | C++ | #include <bits/stdc++.h>
using namespace std;
int main(){
int H,W;
cin >>H>>W;
vector<string> pic[H];
for(int i=0;i<H;i++){
cin>>pic.at(i);
}
for(int k=0;k<W+2;k++){
cout<<"#"<<endl;
}
for(int i=0;i<H;i++){
cout << "#";
cout << pic.at(i);
cout << "#" << endl;
}
for(int k=0;k<W+2;k++){
cout<<"#"<<endl;
}
return 0;
}
| a.cc: In function 'int main()':
a.cc:8:14: error: request for member 'at' in 'pic', which is of non-class type 'std::vector<std::__cxx11::basic_string<char> > [H]'
8 | cin>>pic.at(i);
| ^~
a.cc:15:17: error: request for member 'at' in 'pic', which is of non-class type 'std::vector<std::__cxx11::basic_string<char> > [H]'
15 | cout << pic.at(i);
| ^~
|
s136181979 | p03712 | C++ | #include <iostream>
#include <vector>
using namespace std;
int main() {
int H, W;
cin >> H >> W;
vector<string> a(H);
for (int i=0; i<H; i++){
cin >> a.at(i);
}
cout << "#"*(W+2) << endl;
for (int i=0; i<H; i++){
cout << "#"+a.at(i)+"#";
}
cout << "#"*(W+2) << endl;
return 0;
}
| a.cc: In function 'int main()':
a.cc:13:16: error: invalid operands of types 'const char [2]' and 'int' to binary 'operator*'
13 | cout << "#"*(W+2) << endl;
| ~~~^~~~~~
| | |
| | int
| const char [2]
a.cc:17:16: error: invalid operands of types 'const char [2]' and 'int' to binary 'operator*'
17 | cout << "#"*(W+2) << endl;
| ~~~^~~~~~
| | |
| | int
| const char [2]
|
s906909356 | p03712 | C++ | #include <iostream>
#include <vector>
using namespace std;
int main() {
int H, W;
cin >> H >> W;
vector<string> a(H);
for (int i=0; i<H; i++){
cin >> a.at(i);
}
cout << "#"*(W+2) << endl;
for (int i=0; i<H; i++){
cout << "#"+a.at(i)+"#";
}
cout << "#"*(W+2) << endl;
return 0;
}
| a.cc: In function 'int main()':
a.cc:13:16: error: invalid operands of types 'const char [2]' and 'int' to binary 'operator*'
13 | cout << "#"*(W+2) << endl;
| ~~~^~~~~~
| | |
| | int
| const char [2]
a.cc:17:16: error: invalid operands of types 'const char [2]' and 'int' to binary 'operator*'
17 | cout << "#"*(W+2) << endl;
| ~~~^~~~~~
| | |
| | int
| const char [2]
|
s449041948 | p03712 | C++ | #include<cstdio>
using namespace std;
int main(){
int n, w, i, j;
char a[110][110];
scanf("%d%d", &n, &w);
for(i = 0; i < n+2; i++)
for(j = 0; j < m+2; j++)
a[i][j] = '#';
for(i = 1; i <= n; i++)
for(j = 1; j <= m; j++)
scanf("%c", &a[i][j]);
for(i = 0; i < n+2; i++){
for(j = 0; j < m+2; j++){
printf("%c", a[i][j]);
}
printf("\n");
}
}
| a.cc: In function 'int main()':
a.cc:9:20: error: 'm' was not declared in this scope
9 | for(j = 0; j < m+2; j++)
| ^
a.cc:12:21: error: 'm' was not declared in this scope
12 | for(j = 1; j <= m; j++)
| ^
a.cc:16:20: error: 'm' was not declared in this scope
16 | for(j = 0; j < m+2; j++){
| ^
|
s420444351 | p03712 | C++ | #include <bits/stdc++.h>
using namespace std;
int main()
{
int x,y;
char s[105][105];
cin>>x>>y;
for(int i=0;i<=x;i++)
gets(s[i]);
for(int i=0;i<y+2;i++)
cout<<"#";
cout<<endl;
for(int i=1;i<=x;i++)
{
cout<<"#";
for(int j=0;j<y;j++)
cout<<s[i][j];
cout<<"#"<<endl;
}
for(int i=0;i<y+2;i++)
cout<<"#";
return 0;
} | a.cc: In function 'int main()':
a.cc:9:9: error: 'gets' was not declared in this scope; did you mean 'getw'?
9 | gets(s[i]);
| ^~~~
| getw
|
s665691601 | p03712 | Java | import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.nio.charset.StandardCharsets;
import java.util.*;
public class Main {
int[] inputArray;
public static void main(String[] args) throws IOException {
new Main().run();
}
void run() {
Scanner sc = new Scanner(System.in);
int h = sc.nextInt();
int w = sc.nextInt();
char[][] array = new char[h][w];
for(int i=0; i<=h+1; i++;){
if(i == 0 || i = h+1) {
}
for(int j=0; j<=w+1; j++){
array[i][j]
}
array[
}
for(int i=0; i<array.length; i++){
set.add(String.valueOf(array[i]));
}
if(set.size() == array.length) System.out.println("yes");
else System.out.println("no");
}
}
| Main.java:21: error: ')' expected
for(int i=0; i<=h+1; i++;){
^
Main.java:21: error: illegal start of expression
for(int i=0; i<=h+1; i++;){
^
Main.java:26: error: not a statement
array[i][j]
^
Main.java:26: error: ';' expected
array[i][j]
^
Main.java:29: error: illegal start of expression
}
^
Main.java:28: error: not a statement
array[
^
6 errors
|
s093754193 | p03712 | Java | import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.nio.charset.StandardCharsets;
import java.util.*;
public class Main {
int[] inputArray;
public static void main(String[] args) throws IOException {
new Main().run();
}
void run() {
Scanner sc = new Scanner(System.in);
int h = sc.nextInt();
int w = sc.nextInt();
char[][] array = new char[h][w];
for(int i=0; i<=h+1; i++;){
if(i == 0 || i = h+1) {
}
for(int j=0; j<=w+1; j++){
array[i][j]
}
array[
}
for(int i=0; i<array.length; i++){
set.add(String.valueOf(array[i]));
}
if(set.size() == array.length) System.out.println("yes");
else System.out.println("no");
}
}
| Main.java:21: error: ')' expected
for(int i=0; i<=h+1; i++;){
^
Main.java:21: error: illegal start of expression
for(int i=0; i<=h+1; i++;){
^
Main.java:26: error: not a statement
array[i][j]
^
Main.java:26: error: ';' expected
array[i][j]
^
Main.java:29: error: illegal start of expression
}
^
Main.java:28: error: not a statement
array[
^
6 errors
|
s901593818 | p03712 | C++ | include <bits/stdc++.h>
using namespace std;
int main(){
int i,array[100001],n[100001]={},c=0,a,b;
string s[101];
cin>>a>>b;
for(i=0;i<a;i++){
cin>>s[i];
}
for(i=0;i<b+2;i++){
cout<<"#";
}
cout<<endl;
for(i=0;i<a;i++){
cout<<"#"<<s[i]<<"#"<<endl;
}
for(i=0;i<b+2;i++){
cout<<"#";
}
cout<<endl;
} | a.cc:1:1: error: 'include' does not name a type
1 | include <bits/stdc++.h>
| ^~~~~~~
a.cc: In function 'int main()':
a.cc:6:3: error: 'string' was not declared in this scope
6 | string s[101];
| ^~~~~~
a.cc:7:3: error: 'cin' was not declared in this scope
7 | cin>>a>>b;
| ^~~
a.cc:9:10: error: 's' was not declared in this scope
9 | cin>>s[i];
| ^
a.cc:12:5: error: 'cout' was not declared in this scope
12 | cout<<"#";
| ^~~~
a.cc:14:3: error: 'cout' was not declared in this scope
14 | cout<<endl;
| ^~~~
a.cc:14:9: error: 'endl' was not declared in this scope
14 | cout<<endl;
| ^~~~
a.cc:16:16: error: 's' was not declared in this scope
16 | cout<<"#"<<s[i]<<"#"<<endl;
| ^
|
s676931318 | p03712 | C++ | #include <bits/stdc++.h>
using namespace std;
int main() {
int H, W;
string a;
cin>> H >> W;
for (int i = 0; i < W; i++){
cout << "#" << endl; //上側の#出力
}
for (int i = 0; i < H; i++){ //縦の読み込み
for (int j = 0; j < W; j++){ //横の読み込み
cin >> a;
cout << a;
}
cout << "#" << a << "#" //両脇の#出力
}
for (int i = 0; i < W; i++){
cout << "#" << endl; //下側の#の出力
}
}
| a.cc: In function 'int main()':
a.cc:18:28: error: expected ';' before '}' token
18 | cout << "#" << a << "#" //両脇の#出力
| ^
| ;
19 | }
| ~
|
s454724772 | p03712 | C++ | #include <iostream>
#include <vector>
using namespace std;
int main(){
int H,W;
cin >> H >> W;
| a.cc: In function 'int main()':
a.cc:7:17: error: expected '}' at end of input
7 | cin >> H >> W;
| ^
a.cc:5:11: note: to match this '{'
5 | int main(){
| ^
|
s258467802 | p03712 | C++ | 2 3
abc
arc | a.cc:1:1: error: expected unqualified-id before numeric constant
1 | 2 3
| ^
|
s862682280 | p03712 | C | #include <iostream>
int main()
{
int h, w;
std::cin >> h >> w;
for( int i = 0; i < w + 2; i++ ) {
std::cout << '#';
}
std::cout << std::endl;
for( int i = 0; i < h; i++ ) {
for( int j = 0; j < w; j++ ) {
if( j == 0 ) {
std::cout << '#';
}
char a;
std::cin >> a;
std::cout << a;
if( j == w - 1 ) {
std::cout << '#' << std::endl;
}
}
}
for( int i = 0; i < w + 2; i++ ) {
std::cout << '#';
}
std::cout << std::endl;
return 0;
}
| main.c:1:10: fatal error: iostream: No such file or directory
1 | #include <iostream>
| ^~~~~~~~~~
compilation terminated.
|
s751312245 | p03712 | C++ | #include <iostream>
using namespace std;
int main(void){
int h,w;
char buf[128];
cin >> h >> w;
for (int i=0; i<w+2; i++) cout << '*';
cout << endl;
for (int i=0;i<h; i++){
cin >> buf;
cout << '*' buf << '*' << endl;
}
for (int i=0; i<w+2; i++) cout << '*';
cout << endl;
return 0;
}
| a.cc: In function 'int main()':
a.cc:13:16: error: expected ';' before 'buf'
13 | cout << '*' buf << '*' << endl;
| ^~~~
| ;
|
s649106033 | p03712 | C++ | #include <iostream>
using namespace std;
char board[102][102];
int main() {
ios::sync_with_stdio(false);
cin.tie(0);
int H, W;
cin >> H >> W;
memset(board, '#', sizeof(char) * 102 * 102);
for (int i = 1; i <= H; ++i)
for (int j = 1; j <= W; ++j) cin >> board[i][j];
for (int i = 0; i <= H + 1; ++i) {
for (int j = 0; j <= W + 1; ++j) {
cout << board[i][j];
}
cout << endl;
}
return 0;
} | a.cc: In function 'int main()':
a.cc:13:3: error: 'memset' was not declared in this scope
13 | memset(board, '#', sizeof(char) * 102 * 102);
| ^~~~~~
a.cc:2:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
1 | #include <iostream>
+++ |+#include <cstring>
2 |
|
s874867083 | p03712 | C++ | #include<bits/stdc++.h>
using namespace std;
int main(){
int n,w;
cin>>n>>w;
vector<string> s(n);
for (int i=0; n>i; i++){
cin>>s.at(i);
}
for (int j=0; w+2>j;j++){
cout<<"#";
}
cout<<endl;
for (int k=0; n>k; k++){
cout<<"#"<<s.at(k)<<"#"<<endl;
}
for (int j=0; w+2>j;j++){
cout<<"#"<<;
}
cout<<endl;
} | a.cc: In function 'int main()':
a.cc:18:28: error: expected primary-expression before ';' token
18 | cout<<"#"<<;
| ^
|
s537758691 | p03712 | C++ | #include <iostream>
#include <algorithm>
#include <cmath>
#include <limits>
#include <vector>
#include<cstdio>
#include<bits/stdc++.h>
using namespace std;
using ll =long long;
int main (void) {
int H,W;
cin >> H >> W;
char A[H+2][W+2];
char s,t;
for (int i=0; i<=H+1; i++) {
for (int j=0; j<=W+1; j++) {
if (i=0 || j=0 || i=H+1|| j=W+1){
A[i][j]="#";
continue
}
s=getchar();
t=s;
A[i][j]=t;
cout << A[i][j];
}
cout << endl;
}
} | a.cc: In function 'int main()':
a.cc:18:32: error: lvalue required as left operand of assignment
18 | if (i=0 || j=0 || i=H+1|| j=W+1){
| ~~~^~~~
a.cc:19:19: error: invalid conversion from 'const char*' to 'char' [-fpermissive]
19 | A[i][j]="#";
| ^~~
| |
| const char*
a.cc:20:19: error: expected ';' before '}' token
20 | continue
| ^
| ;
21 | }
| ~
|
s102594898 | p03712 | C++ | #include <bits/stdc++.h>
using namespace std;
int main() {
int h, w;
cin >> h >> w;
char a[100][100] = { # };
for (int i = 1;i < h + 1;i++) {
for (int j = 1;j < w + 1;j++) {
cin >> a[i][j];
}
}
for (int i = 0;i < h + 2;i++) {
for (int j = 0;j < w + 2;j++) {
cout << a[i][j];
}
cout << endl;
}
}
| a.cc:7:30: error: stray '#' in program
7 | char a[100][100] = { # };
| ^
|
s753016965 | p03712 | Java | import java.util.*;
public class B62 {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
int n = sc.nextInt();
int m = sc.nextInt();
String[] c = new String[m];
for(int i = 0;i < n;i++) {
c[i] = sc.next();
}
for(int i = 0;i < m+2;i++)System.out.print("#");
System.out.println();
for(int i = 0;i < n;i++) {
System.out.println("#"+c[i]+"#");
}
for(int i = 0;i < m+2;i++)System.out.print("#");
System.out.println();
}
}
| Main.java:2: error: class B62 is public, should be declared in a file named B62.java
public class B62 {
^
1 error
|
s403306847 | p03712 | C++ | #include <iostream>
using namespace std;
int main(){
int H, W, i, j;
char a[H][W];
string flame;
for(i=0; i<H; i++){
flame += '#';
for(j=0; j<W; j++){
cin >> a[i][j];
}
}
flame += "##";
cout << flame << endl;
for(i=0; i<H; i++){
cout << '#';
for(j=0; j<W; j++){
cout << a[i][j];
}
cout << "#\n" << ;
}
} | a.cc: In function 'int main()':
a.cc:22:34: error: expected primary-expression before ';' token
22 | cout << "#\n" << ;
| ^
|
s973074353 | p03712 | C++ | #include <iostream>
using namespace std;
int main(){
int H, W, i, j;
char a[H][W];
for(i=0; i<H; i++){
for(j=0; j<W; j++){
cin >> a[i][j];
if(i==0||i==H-1||j==0||j==W) a[i][j]='#';
}
}
for(i=0; i<H; i++){
for(j=0; j<W; j++){
cout << a[i][j];
}
cout << "\n" << ;
}
} | a.cc: In function 'int main()':
a.cc:18:33: error: expected primary-expression before ';' token
18 | cout << "\n" << ;
| ^
|
s479688179 | p03712 | C++ | // finish date: 2018/01/20
#include <iostream>
#include <cmath>
#include <vector>
#include <bitset>
#include <algorithm>
#include <stack>
#include <map>
#include <climits>
using namespace std;
#define FOR(i, a, b) for(int (i)=a;(i)<(b);(i)++)
#define rep(i, n) FOR(i,0,n)
#define ll long long
#define bigmod 1000000007
#define INF 500000000
int main() {
int H, W;
cin >> H >> W;
string s;
rep(i, W + 2) cout << "#";
cout << endl;
rep(i, H) {
cin >> s;
cout << "#";
cout << s;
cout << "#" << endl;
}
rep(i, W + 2) cout << "#"
cout << endl;
return 0;
}
| a.cc: In function 'int main()':
a.cc:32:30: error: expected ';' before 'cout'
32 | rep(i, W + 2) cout << "#"
| ^
| ;
33 | cout << endl;
| ~~~~
|
s827065146 | p03712 | C++ |
h,w=map(int,input().split())
print('#' * (w + 2))
for _ in range(h):
print("#" + input() + "#")
print('#' * (w + 2)) | a.cc:2:1: error: 'h' does not name a type
2 | h,w=map(int,input().split())
| ^
|
s957589175 | p03712 | C++ | #include <iostream>
#include <math.h>
#include <string>
#include <string.h>
#include <stdio.h>
#include <algorithm>
using namespace std;
#define REP(i, n) for(int i = 0;i < n;i++)
#define IN(n) scanf("%d",&n,);
int main(){
int h,w;
char a[100];
IN2(h,w);
REP(i,h+2){
if(i==0||i==h+1){
REP(j,w+2)printf("#");
printf("\n");
}
else {
scanf("%s",a);
printf("#%s#\n",a);
}
}
return 0;
}
| a.cc: In function 'int main()':
a.cc:13:5: error: 'IN2' was not declared in this scope; did you mean 'IN'?
13 | IN2(h,w);
| ^~~
| IN
|
s051780267 | p03712 | C++ | #include<bits/stdc++.h>
using namespace std;
int main(){
int h,w;
cin >> h >> w;
for(int i=0;i<w+2;i++){
cout << '#';
}
cout << endl;
cout << '#';
int input;
for(int i=0;i<h;i++){
cin >>input
cout << input;
}
cout << '#' << endl;
for(int i=0;i<w+2;i++){
cout << '#';
}
cout << endl;
return 0;
} | a.cc: In function 'int main()':
a.cc:16:20: error: expected ';' before 'cout'
16 | cin >>input
| ^
| ;
17 | cout << input;
| ~~~~
|
s944547699 | p03712 | C++ | list(map(print, (lambda a:['#'*len(a[0])]+a+['#'*len(a[0])])(['#'+input()+'#' for _ in range(list(map(int, input().split()))[0])]))) | a.cc:1:5: error: expected constructor, destructor, or type conversion before '(' token
1 | list(map(print, (lambda a:['#'*len(a[0])]+a+['#'*len(a[0])])(['#'+input()+'#' for _ in range(list(map(int, input().split()))[0])])))
| ^
|
s594916415 | p03712 | C++ | #include<bits/stdc++.h>
#define r(i,n) for(int i=0;i<n;i++)
using namespace std;
int main(){
int a,b,c,f=0,t=0;
string s[102];
cin>>a>>b;
r(i,a){
cin>>s[i+1];
s[i+1]="#"+s[i+1]+"#";
}
r(i,w+2)s[0]+="#",s[a+1]+="#";
r(i,a+2)cout<<s[i]<<endl;
} | a.cc: In function 'int main()':
a.cc:12:13: error: 'w' was not declared in this scope
12 | r(i,w+2)s[0]+="#",s[a+1]+="#";
| ^
a.cc:2:30: note: in definition of macro 'r'
2 | #define r(i,n) for(int i=0;i<n;i++)
| ^
|
s158289613 | p03712 | C++ | #include<stdio.h>
#include<iostream>
using namespace std;
#include<string.h>
int main(void)
{ int w,h,i;
char a[100];
scanf("%d%d",&h,&w);
for(i=0;i<h;i++)
gets(a);
for(i=0;i<w+2;i++)
printf("#");
printf("\n");
for(i=0;i<h;i++)
{
printf("#");
cout<<a;
printf("#\n") ;
}
for(i=0;i<w+2;i++)
printf("#");
return 0;
} | a.cc: In function 'int main()':
a.cc:10:5: error: 'gets' was not declared in this scope; did you mean 'getw'?
10 | gets(a);
| ^~~~
| getw
|
s746951434 | p03712 | C | You are given a image with a height of H pixels and a width of W pixels. Each pixel is represented by a lowercase English letter. The pixel at the i-th row from the top and j-th column from the left is aij.
Put a box around this image and output the result. The box should consist of # and have a thickness of 1.
Constraints
1≤H,W≤100
aij is a lowercase English letter.
Input
Input is given from Standard Input in the following format:
H W
a11 … a1W
:
aH1 … aHW
Output
Print the image surrounded by a box that consists of # and has a thickness of 1.
Sample Input 1
2 3
abc
arc
Sample Output 1
#####
#abc#
#arc#
#####
Sample Input 2
1 1
z
Sample Output 2
###
#z#
### | main.c:1:1: error: unknown type name 'You'
1 | You are given a image with a height of H pixels and a width of W pixels. Each pixel is represented by a lowercase English letter. The pixel at the i-th row from the top and j-th column from the left is aij.
| ^~~
main.c:1:9: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'given'
1 | You are given a image with a height of H pixels and a width of W pixels. Each pixel is represented by a lowercase English letter. The pixel at the i-th row from the top and j-th column from the left is aij.
| ^~~~~
main.c:1:9: error: unknown type name 'given'
main.c:3:78: error: stray '#' in program
3 | Put a box around this image and output the result. The box should consist of # and have a thickness of 1.
| ^
main.c:6:2: error: stray '\342' in program
6 | 1<U+2264>H,W<U+2264>100
| ^~~~~~~~
main.c:6:6: error: stray '\342' in program
6 | 1<U+2264>H,W<U+2264>100
| ^~~~~~~~
main.c:12:5: error: stray '\342' in program
12 | a11 <U+2026> a1W
| ^~~~~~~~
main.c:14:5: error: stray '\342' in program
14 | aH1 <U+2026> aHW
| ^~~~~~~~
main.c:16:54: error: stray '#' in program
16 | Print the image surrounded by a box that consists of # and has a thickness of 1.
| ^
main.c:23:1: error: stray '##' in program
23 | #####
| ^~
main.c:23:3: error: stray '##' in program
23 | #####
| ^~
main.c:23:5: error: stray '#' in program
23 | #####
| ^
main.c:24:2: error: invalid preprocessing directive #abc
24 | #abc#
| ^~~
main.c:25:2: error: invalid preprocessing directive #arc
25 | #arc#
| ^~~
main.c:26:1: error: stray '##' in program
26 | #####
| ^~
main.c:26:3: error: stray '##' in program
26 | #####
| ^~
main.c:26:5: error: stray '#' in program
26 | #####
| ^
main.c:31:1: error: stray '##' in program
31 | ###
| ^~
main.c:31:3: error: stray '#' in program
31 | ###
| ^
main.c:32:2: error: invalid preprocessing directive #z
32 | #z#
| ^
main.c:33:1: error: stray '##' in program
33 | ###
| ^~
main.c:33:3: error: stray '#' in program
33 | ###
| ^
|
s528223471 | p03712 | C | #include<stdio.h>
#include<String.h>
int main()
{
int r,a,b,c,h,i,k,t;
char ch[20][100];
while(scanf("%d%d",&a,&b)!=EOF)
{
getchar();
for(i=1;i<=a;i++)
scanf("%s",&ch[i]);
printf("#");
for(i=1;i<=b;i++)
printf("#");
printf("#\n");
for(i=1;i<=a;i++)
{
printf("#");
printf("%s",ch[i]);
printf("#\n");
}
for(i=0;i<=b;i++)
printf("#");
printf("#\n");
}
return 0;
} | main.c:2:9: fatal error: String.h: No such file or directory
2 | #include<String.h>
| ^~~~~~~~~~
compilation terminated.
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.