submission_id stringlengths 10 10 | problem_id stringlengths 6 6 | language stringclasses 3
values | code stringlengths 1 522k | compiler_output stringlengths 43 10.2k |
|---|---|---|---|---|
s494659920 | p03712 | C++ | #include <bits/stdc++.h>
using namespace std;
int main(){
int H, W;
cin >> H >> W;
vector<vector<string>> a(H, vector<string>(W));
vector<vector<string>> b(H+2, vector<string>(W+2));
for(int i=0;i < H;i++){
for(int j=0; j<W; j++){
cin >> a.at(i).at(j);
}
}
for(int i=0; i<H+2; i++){
for(int j=0; j<W+2; j++){
b.at(i).at(j) = "#"
}
}
for(int i=0; i<H; i++){
for(int j=0; j<W; j++){
b.at(i+1).at(j+1) = a.at(i).at(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:18:26: error: expected ';' before '}' token
18 | b.at(i).at(j) = "#"
| ^
| ;
19 | }
| ~
a.cc:23:41: error: expected ';' before '}' token
23 | b.at(i+1).at(j+1) = a.at(i).at(j)
| ^
| ;
24 | }
| ~
|
s712829939 | p03712 | C++ | #include <bits/stdc++.h>
using namespace std;
int main(){
int H, W;
cin >> H >> W;
vector<vector<string>> a(H, vector<string>(W));
vector<vector<string>> b(H+2, vector<string>(W+2));
for(int i=0;i < H;i++){
for(int j=0; j<W; j++){
cin >> a.at(i).at(j);
}
}
for(int i=0; i<H+2; i++){
for(int j=0; j<W+2; j++){
b.at(i).at(j) = "#"
}
}
for(int i=0; i<H; i++){
for(int j=0; j<W; j++){
b.at(i+1).at(j+1) = a.at(i).at(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:18:26: error: expected ';' before '}' token
18 | b.at(i).at(j) = "#"
| ^
| ;
19 | }
| ~
a.cc:23:41: error: expected ';' before '}' token
23 | b.at(i+1).at(j+1) = a.at(i).at(j)
| ^
| ;
24 | }
| ~
|
s056027581 | p03712 | C++ | #include<iostream>
#include<vector>
#include<string>
using namespace std;
int main(void){
int H,W;
cin >> H >> W;
vector<string> vec(H);
for(int i = 0;i < H;i++){
cin >> vec.at(i);
}
for(int i = 1;i <= H + 2;i++){
if(i == 1 || i == H + 2){
for(int j = 1;j <= W + 2;j++) cout << "#";
cout << endl;
}else{
cout << "#" << vec.at(i) << "#" << endl;
}
}
}
#include<iostream>
#include<vector>
int main(void){
int H,W;
cin >> H >> W;
vector<char> vec(H);
for(int i = 0;i < H;i++){
cin >> vec.at(i);
}
for(int i = 1;i <= H + 2;i++){
if(i == 1 || i == H + 2){
for(int j = 1;j <= W + 2;j++) cout << "#";
cout << endl;
}else{
cout << "#" << vec.at(i) << "#" << endl;
}
}
}
#include<iostream>
#include<vector>
#include<string>
using namespace std;
int main(void){
int H,W;
cin >> H >> W;
vector<string> vec(H);
for(int i = 0;i < H;i++){
cin >> vec.at(i);
}
for(int i = 1;i <= H + 2;i++){
if(i == 1 || i == H + 2){
for(int j = 1;j <= W + 2;j++) cout << "#";
cout << endl;
}else{
cout << "#" << vec.at(i) << "#" << endl;
}
}
}
#include<iostream>
#include<vector>
int main(void){
int H,W;
cin >> H >> W;
vector<char> vec(H);
for(int i = 0;i < H;i++){
cin >> vec.at(i);
}
for(int i = 1;i <= H + 2;i++){
if(i == 1 || i == H + 2){
for(int j = 1;j <= W + 2;j++) cout << "#";
cout << endl;
}else{
cout << "#" << vec.at(i) << "#" << endl;
}
}
return 0;
} | a.cc:29:5: error: redefinition of 'int main()'
29 | int main(void){
| ^~~~
a.cc:7:5: note: 'int main()' previously defined here
7 | int main(void){
| ^~~~
a.cc:54:5: error: redefinition of 'int main()'
54 | int main(void){
| ^~~~
a.cc:7:5: note: 'int main()' previously defined here
7 | int main(void){
| ^~~~
a.cc:76:5: error: redefinition of 'int main()'
76 | int main(void){
| ^~~~
a.cc:7:5: note: 'int main()' previously defined here
7 | int main(void){
| ^~~~
|
s878676137 | p03712 | C++ | #include<iostream>
#include<vector>
#include<string>
using namespace std;
int main(void){
int H,W;
cin >> H >> W;
vector<string> vec(H);
for(int i = 0;i < H;i++){
cin >> vec.at(i);
}
for(int i = 1;i <= H + 2;i++){
if(i == 1 || i == H + 2){
for(int j = 1;j <= W + 2;j++) cout << "#";
cout << endl;
}else{
cout << "#" << vec.at(i) << "#" << endl;
}
}
}
#include<iostream>
#include<vector>
int main(void){
int H,W;
cin >> H >> W;
vector<char> vec(H);
for(int i = 0;i < H;i++){
cin >> vec.at(i);
}
for(int i = 1;i <= H + 2;i++){
if(i == 1 || i == H + 2){
for(int j = 1;j <= W + 2;j++) cout << "#";
cout << endl;
}else{
cout << "#" << vec.at(i) << "#" << endl;
}
}
}
#include<iostream>
#include<vector>
#include<string>
using namespace std;
int main(void){
int H,W;
cin >> H >> W;
vector<string> vec(H);
for(int i = 0;i < H;i++){
cin >> vec.at(i);
}
for(int i = 1;i <= H + 2;i++){
if(i == 1 || i == H + 2){
for(int j = 1;j <= W + 2;j++) cout << "#";
cout << endl;
}else{
cout << "#" << vec.at(i) << "#" << endl;
}
}
}
#include<iostream>
#include<vector>
int main(void){
int H,W;
cin >> H >> W;
vector<char> vec(H);
for(int i = 0;i < H;i++){
cin >> vec.at(i);
}
for(int i = 1;i <= H + 2;i++){
if(i == 1 || i == H + 2){
for(int j = 1;j <= W + 2;j++) cout << "#";
cout << endl;
}else{
cout << "#" << vec.at(i) << "#" << endl;
}
}
return 0;
} | a.cc:29:5: error: redefinition of 'int main()'
29 | int main(void){
| ^~~~
a.cc:7:5: note: 'int main()' previously defined here
7 | int main(void){
| ^~~~
a.cc:54:5: error: redefinition of 'int main()'
54 | int main(void){
| ^~~~
a.cc:7:5: note: 'int main()' previously defined here
7 | int main(void){
| ^~~~
a.cc:76:5: error: redefinition of 'int main()'
76 | int main(void){
| ^~~~
a.cc:7:5: note: 'int main()' previously defined here
7 | int main(void){
| ^~~~
|
s089010636 | p03712 | C++ | #include<iostream>
#include<vector>
#include<string>
using namespace std;
int main(void){
int H,W;
cin >> H >> W;
vector<string> vec(H);
for(int i = 0;i < H;i++){
cin >> vec.at(i);
}
for(int i = 1;i <= H + 2;i++){
if(i == 1 || i == H + 2){
for(int j = 1;j <= W + 2;j++) cout << "#";
cout << endl;
}else{
cout << "#" << vec.at(i) << "#" << endl;
}
}
}
#include<iostream>
#include<vector>
int main(void){
int H,W;
cin >> H >> W;
vector<char> vec(H);
for(int i = 0;i < H;i++){
cin >> vec.at(i);
}
for(int i = 1;i <= H + 2;i++){
if(i == 1 || i == H + 2){
for(int j = 1;j <= W + 2;j++) cout << "#";
cout << endl;
}else{
cout << "#" << vec.at(i) << "#" << endl;
}
}
}
#include<iostream>
#include<vector>
#include<string>
using namespace std;
int main(void){
int H,W;
cin >> H >> W;
vector<string> vec(H);
for(int i = 0;i < H;i++){
cin >> vec.at(i);
}
for(int i = 1;i <= H + 2;i++){
if(i == 1 || i == H + 2){
for(int j = 1;j <= W + 2;j++) cout << "#";
cout << endl;
}else{
cout << "#" << vec.at(i) << "#" << endl;
}
}
}
#include<iostream>
#include<vector>
int main(void){
int H,W;
cin >> H >> W;
vector<char> vec(H);
for(int i = 0;i < H;i++){
cin >> vec.at(i);
}
for(int i = 1;i <= H + 2;i++){
if(i == 1 || i == H + 2){
for(int j = 1;j <= W + 2;j++) cout << "#";
cout << endl;
}else{
cout << "#" << vec.at(i) << "#" << endl;
}
}
return 0;
} | a.cc:29:5: error: redefinition of 'int main()'
29 | int main(void){
| ^~~~
a.cc:7:5: note: 'int main()' previously defined here
7 | int main(void){
| ^~~~
a.cc:54:5: error: redefinition of 'int main()'
54 | int main(void){
| ^~~~
a.cc:7:5: note: 'int main()' previously defined here
7 | int main(void){
| ^~~~
a.cc:76:5: error: redefinition of 'int main()'
76 | int main(void){
| ^~~~
a.cc:7:5: note: 'int main()' previously defined here
7 | int main(void){
| ^~~~
|
s051846722 | p03712 | C++ | #include<iostream>
#include<vector>
#include<string>
using namespace std;
int main(void){
int H,W;
cin >> H >> W;
vector<string> vec(H);
for(int i = 0;i < H;i++){
cin >> vec.at(i);
}
for(int i = 1;i <= H + 2;i++){
if(i == 1 || i == H + 2){
for(int j = 1;j <= W + 2;j++) cout << "#";
cout << endl;
}else{
cout << "#" << vec.at(i) << "#" << endl;
}
}
}
#include<iostream>
#include<vector>
int main(void){
int H,W;
cin >> H >> W;
vector<char> vec(H);
for(int i = 0;i < H;i++){
cin >> vec.at(i);
}
for(int i = 1;i <= H + 2;i++){
if(i == 1 || i == H + 2){
for(int j = 1;j <= W + 2;j++) cout << "#";
cout << endl;
}else{
cout << "#" << vec.at(i) << "#" << endl;
}
}
} | a.cc:29:5: error: redefinition of 'int main()'
29 | int main(void){
| ^~~~
a.cc:7:5: note: 'int main()' previously defined here
7 | int main(void){
| ^~~~
|
s644685926 | p03712 | C++ | #include<iostream>
#include<vector>
#include<string>
int main(void){
int H,W;
cin >> H >> W;
vector<string> vec(H);
for(int i = 0;i < H;i++){
cin >> vec.at(i);
}
for(int i = 1;i <= H + 2;i++){
if(i == 1 || i == H + 2){
for(int j = 1;j <= W + 2;j++) cout << "#";
cout << endl;
}else{
cout << "#" << vec.at(i) << "#" << endl;
}
}
}
#include<iostream>
#include<vector>
int main(void){
int H,W;
cin >> H >> W;
vector<char> vec(H);
for(int i = 0;i < H;i++){
cin >> vec.at(i);
}
for(int i = 1;i <= H + 2;i++){
if(i == 1 || i == H + 2){
for(int j = 1;j <= W + 2;j++) cout << "#";
cout << endl;
}else{
cout << "#" << vec.at(i) << "#" << endl;
}
}
} | a.cc: In function 'int main()':
a.cc:7:3: error: 'cin' was not declared in this scope; did you mean 'std::cin'?
7 | cin >> H >> W;
| ^~~
| std::cin
In file included from a.cc:1:
/usr/include/c++/14/iostream:62:18: note: 'std::cin' declared here
62 | extern istream cin; ///< Linked to standard input
| ^~~
a.cc:9:3: error: 'vector' was not declared in this scope
9 | vector<string> vec(H);
| ^~~~~~
a.cc:9:3: note: suggested alternatives:
In file included from /usr/include/c++/14/vector:66,
from a.cc:2:
/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:9:10: error: 'string' was not declared in this scope
9 | vector<string> vec(H);
| ^~~~~~
a.cc:9:10: note: suggested alternatives:
In file included from /usr/include/c++/14/iosfwd:41,
from /usr/include/c++/14/ios:40,
from /usr/include/c++/14/ostream:40,
from /usr/include/c++/14/iostream:41:
/usr/include/c++/14/bits/stringfwd.h:77:33: note: 'std::string'
77 | typedef basic_string<char> string;
| ^~~~~~
In file included from /usr/include/c++/14/bits/locale_classes.h:40,
from /usr/include/c++/14/bits/ios_base.h:41,
from /usr/include/c++/14/ios:44:
/usr/include/c++/14/string:76:11: note: 'std::pmr::string'
76 | using string = basic_string<char>;
| ^~~~~~
a.cc:9:18: error: 'vec' was not declared in this scope
9 | vector<string> vec(H);
| ^~~
a.cc:17:37: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
17 | for(int j = 1;j <= W + 2;j++) cout << "#";
| ^~~~
| std::cout
/usr/include/c++/14/iostream:63:18: note: 'std::cout' declared here
63 | extern ostream cout; ///< Linked to standard output
| ^~~~
a.cc:18:7: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
18 | cout << endl;
| ^~~~
| std::cout
/usr/include/c++/14/iostream:63:18: note: 'std::cout' declared here
63 | extern ostream cout; ///< Linked to standard output
| ^~~~
a.cc:18:15: error: 'endl' was not declared in this scope; did you mean 'std::endl'?
18 | cout << endl;
| ^~~~
| std::endl
/usr/include/c++/14/ostream:744:5: note: 'std::endl' declared here
744 | endl(basic_ostream<_CharT, _Traits>& __os)
| ^~~~
a.cc:20:7: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
20 | cout << "#" << vec.at(i) << "#" << endl;
| ^~~~
| std::cout
/usr/include/c++/14/iostream:63:18: note: 'std::cout' declared here
63 | extern ostream cout; ///< Linked to standard output
| ^~~~
a.cc:20:42: error: 'endl' was not declared in this scope; did you mean 'std::endl'?
20 | cout << "#" << vec.at(i) << "#" << endl;
| ^~~~
| std::endl
/usr/include/c++/14/ostream:744:5: note: 'std::endl' declared here
744 | endl(basic_ostream<_CharT, _Traits>& __os)
| ^~~~
a.cc: At global scope:
a.cc:27:5: error: redefinition of 'int main()'
27 | int main(void){
| ^~~~
a.cc:5:5: note: 'int main()' previously defined here
5 | int main(void){
| ^~~~
a.cc: In function 'int main()':
a.cc:29:3: error: 'cin' was not declared in this scope; did you mean 'std::cin'?
29 | cin >> H >> W;
| ^~~
| std::cin
/usr/include/c++/14/iostream:62:18: note: 'std::cin' declared here
62 | extern istream cin; ///< Linked to standard input
| ^~~
a.cc:31:3: error: 'vector' was not declared in this scope
31 | vector<char> vec(H);
| ^~~~~~
a.cc:31:3: note: suggested alternatives:
/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:31:10: error: expected primary-expression before 'char'
31 | vector<char> vec(H);
| ^~~~
a.cc:34:12: error: 'vec' was not declared in this scope
34 | cin >> vec.at(i);
| ^~~
a.cc:39:37: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
39 | for(int j = 1;j <= W + 2;j++) cout << "#";
| ^~~~
| std::cout
/usr/include/c++/14/iostream:63:18: note: 'std::cout' declared here
63 | extern ostream cout; ///< Linked to standard output
| ^~~~
a.cc:40:7: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
40 | cout << endl;
| ^~~~
| std::cout
/usr/include/c++/14/iostream:63:18: note: 'std::cout' declared here
63 | extern ostream cout; ///< Linked to standard output
| ^~~~
a.cc:40:15: error: 'endl' was not declared in this scope; did you mean 'std::endl'?
40 | cout << endl;
| ^~~~
| std::endl
/usr/include/c++/14/ostream:744:5: note: 'std::endl' declared here
744 | endl(basic_ostream<_CharT, _Traits>& __os)
| ^~~~
a.cc:42:7: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
42 | cout << "#" << vec.at(i) << "#" << endl;
| ^~~~
| std::cout
/usr/include/c++/14/iostream:63:18: note: 'std::cout' declared here
63 | extern ostream cout; ///< Linked to standard output
| ^~~~
a.cc:42:22: error: 'vec' was not declared in this scope
42 | cout << "#" << vec.at(i) << "#" << endl;
| ^~~
a.cc:42:42: error: 'endl' was not declared in this scope; did you mean 'std::endl'?
42 | cout << "#" << vec.at(i) << "#" << endl;
| ^~~~
| std::endl
/usr/include/c++/14/ostream:744:5: note: 'std::endl' declared here
744 | endl(basic_ostream<_CharT, _Traits>& __os)
| ^~~~
|
s309333309 | p03712 | C++ | #include<iostream>
#include<vector>
int main(void){
int H,W;
cin >> H >> W;
vector<char> vec(H);
for(int i = 0;i < H;i++){
cin >> vec.at(i);
}
for(int i = 1;i <= H + 2;i++){
if(i == 1 || i == H + 2){
for(int j = 1;j <= W + 2;j++) cout << "#";
cout << endl;
}else{
cout << "#" << vec.at(i) << "#" << endl;
}
}
} | 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 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<char> vec(H);
| ^~~~~~
a.cc:8:3: note: suggested alternatives:
In file included from /usr/include/c++/14/vector:66,
from a.cc:2:
/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:10: error: expected primary-expression before 'char'
8 | vector<char> vec(H);
| ^~~~
a.cc:11:12: error: 'vec' was not declared in this scope
11 | cin >> vec.at(i);
| ^~~
a.cc:16:37: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
16 | for(int j = 1;j <= W + 2;j++) cout << "#";
| ^~~~
| std::cout
/usr/include/c++/14/iostream:63:18: note: 'std::cout' declared here
63 | extern ostream cout; ///< Linked to standard output
| ^~~~
a.cc:17:7: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
17 | cout << endl;
| ^~~~
| std::cout
/usr/include/c++/14/iostream:63:18: note: 'std::cout' declared here
63 | extern ostream cout; ///< Linked to standard output
| ^~~~
a.cc:17:15: error: 'endl' was not declared in this scope; did you mean 'std::endl'?
17 | cout << endl;
| ^~~~
| std::endl
In file included from /usr/include/c++/14/iostream:41:
/usr/include/c++/14/ostream:744:5: note: 'std::endl' declared here
744 | endl(basic_ostream<_CharT, _Traits>& __os)
| ^~~~
a.cc:19:7: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
19 | cout << "#" << vec.at(i) << "#" << endl;
| ^~~~
| std::cout
/usr/include/c++/14/iostream:63:18: note: 'std::cout' declared here
63 | extern ostream cout; ///< Linked to standard output
| ^~~~
a.cc:19:22: error: 'vec' was not declared in this scope
19 | cout << "#" << vec.at(i) << "#" << endl;
| ^~~
a.cc:19:42: error: 'endl' was not declared in this scope; did you mean 'std::endl'?
19 | cout << "#" << vec.at(i) << "#" << endl;
| ^~~~
| std::endl
/usr/include/c++/14/ostream:744:5: note: 'std::endl' declared here
744 | endl(basic_ostream<_CharT, _Traits>& __os)
| ^~~~
|
s470874243 | 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 + 2); i++) {
cout << "#";
}
cout << endl;
for (i = 0; i < H; i++) {
cout << "#";
cin >> a;
cout << a;
cout << "#" << endl;
}
for (i = 0; i < (W + 2); i++) {
cout << "#";
}
}
| a.cc: In function 'int main()':
a.cc:15:14: error: 'i' was not declared in this scope
15 | for (i = 0; i < H; i++) {
| ^
a.cc:22:14: error: 'i' was not declared in this scope
22 | for (i = 0; i < (W + 2); i++) {
| ^
|
s973430561 | p03712 | C++ | #include <iostream>
using namespace std;
int main() {
int H, W;
cin >> H >> W;
string a;
for (int i = 0; i < (W + 2); i++) {
cout << "#";
}
cout << endl;
for (i = 0; i < H; i++) {
cout << "#";
cin >> a;
cout << a;
cout << "#" << endl;
}
for (i = 0; i < (W + 2); i++) {
cout << "#";
}
}
| a.cc: In function 'int main()':
a.cc:15:14: error: 'i' was not declared in this scope
15 | for (i = 0; i < H; i++) {
| ^
a.cc:22:14: error: 'i' was not declared in this scope
22 | for (i = 0; i < (W + 2); i++) {
| ^
|
s464833796 | p03712 | C++ | #include <iostream>
using namespace std;
int main() {
int H, W;
cin >> H >> W;
string a;
for (int i = 0; i < (W + 2); i++)
cout << "#";
cout << endl;
for (i = 0; i < H; i++) {
cout << "#";
cin >> a;
cout << a;
cout << "#";
cout << endl;
}
for (i = 0; i < (W + 2); i++)
cout << "#";
cout << endl;
}
| a.cc: In function 'int main()':
a.cc:14:14: error: 'i' was not declared in this scope
14 | for (i = 0; i < H; i++) {
| ^
a.cc:22:14: error: 'i' was not declared in this scope
22 | for (i = 0; i < (W + 2); i++)
| ^
|
s851935009 | p03712 | C++ | #include <iostream>
using namespace std;
int main() {
int H, W;
cin >> H >> W;
string a;
for (int i = 0; i < (W + 2); i++)
cout << "#";
cout << endl;
for (i = 0; i < H; i++) {
cout << "#";
cin >> a;
cout << a;
cout << "#";
}
for (i = 0; i < (W + 2); i++)
cout << "#";
cout << endl;
}
| a.cc: In function 'int main()':
a.cc:14:14: error: 'i' was not declared in this scope
14 | for (i = 0; i < H; i++) {
| ^
a.cc:21:14: error: 'i' was not declared in this scope
21 | for (i = 0; i < (W + 2); i++)
| ^
|
s100854265 | p03712 | C++ | #include <iostream>
using namespace std;
int main() {
int H, W;
cin >> H >> W;
string a;
for (int i = 0; i < W + 2; i++)
cout << "#";
cout << endl;
for (i = 0; i < H; i++) {
cout "#";
cin >> a;
cout << a;
cout "#";
}
for (i = 0; i < W + 2; i++)
cout << "#";
cout << endl;
}
| a.cc: In function 'int main()':
a.cc:14:14: error: 'i' was not declared in this scope
14 | for (i = 0; i < H; i++) {
| ^
a.cc:15:21: error: expected ';' before string constant
15 | cout "#";
| ^~~~
| ;
a.cc:18:21: error: expected ';' before string constant
18 | cout "#";
| ^~~~
| ;
a.cc:21:14: error: 'i' was not declared in this scope
21 | for (i = 0; i < W + 2; i++)
| ^
|
s427197811 | p03712 | C++ | #include <bits/stdc++.h>
using namespace std;
int main() {
int H, W;
cin >> H >> W;
string a;
for(int i=0;i<H;i++) {
string a;
cin >> a;
}
for (int i=0;i<H+2;i++) {
vector<string> b(N);
if (i==0 || i==H+1){
for (int j=0;j<W+2;j++) {
b.at(j)='#';
cout << b.at(j) << endl;
}
else {
cout << '#'+a+'#' << endl;
}
}
} | a.cc: In function 'int main()':
a.cc:13:22: error: 'N' was not declared in this scope
13 | vector<string> b(N);
| ^
a.cc:19:7: error: expected '}' before 'else'
19 | else {
| ^~~~
a.cc:14:24: note: to match this '{'
14 | if (i==0 || i==H+1){
| ^
|
s215935447 | p03712 | C++ | #include <bits/stdc++.h>
using namespace std;
int main() {
int H, W;
cin >> H >> W;
string a;
for(int i=0;i<H;1++) {
string a;
cin >> a;
}
for (int i=0;i<H+2;i++) {
vector<string> b(W+2);
if (i==0 || i==H+1){
for (int j=0;j<W+2;j++) {
b.at(j)='#';
cout << b << endl;
}
else {
cout << '#'+a+'#' << endl;
}
}
} | a.cc: In function 'int main()':
a.cc:8:19: error: lvalue required as increment operand
8 | for(int i=0;i<H;1++) {
| ^
a.cc:17:12: error: no match for 'operator<<' (operand types are 'std::ostream' {aka 'std::basic_ostream<char>'} and 'std::vector<std::__cxx11::basic_string<char> >')
17 | cout << b << endl;
| ~~~~ ^~ ~
| | |
| | std::vector<std::__cxx11::basic_string<char> >
| std::ostream {aka std::basic_ostream<char>}
In file included from /usr/include/c++/14/istream:41,
from /usr/include/c++/14/sstream:40,
from /usr/include/c++/14/complex:45,
from /usr/include/c++/14/ccomplex:39,
from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:127,
from a.cc:1:
/usr/include/c++/14/ostream:116:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(__ostream_type& (*)(__ostream_type&)) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>]'
116 | operator<<(__ostream_type& (*__pf)(__ostream_type&))
| ^~~~~~~~
/usr/include/c++/14/ostream:116:36: note: no known conversion for argument 1 from 'std::vector<std::__cxx11::basic_string<char> >' to 'std::basic_ostream<char>::__ostream_type& (*)(std::basic_ostream<char>::__ostream_type&)' {aka 'std::basic_ostream<char>& (*)(std::basic_ostream<char>&)'}
116 | operator<<(__ostream_type& (*__pf)(__ostream_type&))
| ~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~
/usr/include/c++/14/ostream:125:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(__ios_type& (*)(__ios_type&)) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>; __ios_type = std::basic_ios<char>]'
125 | operator<<(__ios_type& (*__pf)(__ios_type&))
| ^~~~~~~~
/usr/include/c++/14/ostream:125:32: note: no known conversion for argument 1 from 'std::vector<std::__cxx11::basic_string<char> >' to 'std::basic_ostream<char>::__ios_type& (*)(std::basic_ostream<char>::__ios_type&)' {aka 'std::basic_ios<char>& (*)(std::basic_ios<char>&)'}
125 | operator<<(__ios_type& (*__pf)(__ios_type&))
| ~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~
/usr/include/c++/14/ostream:135:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(std::ios_base& (*)(std::ios_base&)) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>]'
135 | operator<<(ios_base& (*__pf) (ios_base&))
| ^~~~~~~~
/usr/include/c++/14/ostream:135:30: note: no known conversion for argument 1 from 'std::vector<std::__cxx11::basic_string<char> >' to 'std::ios_base& (*)(std::ios_base&)'
135 | operator<<(ios_base& (*__pf) (ios_base&))
| ~~~~~~~~~~~~^~~~~~~~~~~~~~~~~
/usr/include/c++/14/ostream:174:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(long int) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>]'
174 | operator<<(long __n)
| ^~~~~~~~
/usr/include/c++/14/ostream:174:23: note: no known conversion for argument 1 from 'std::vector<std::__cxx11::basic_string<char> >' to 'long int'
174 | operator<<(long __n)
| ~~~~~^~~
/usr/include/c++/14/ostream:178:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(long unsigned int) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>]'
178 | operator<<(unsigned long __n)
| ^~~~~~~~
/usr/include/c++/14/ostream:178:32: note: no known conversion for argument 1 from 'std::vector<std::__cxx11::basic_string<char> >' to 'long unsigned int'
178 | operator<<(unsigned long __n)
| ~~~~~~~~~~~~~~^~~
/usr/include/c++/14/ostream:182:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(bool) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>]'
182 | operator<<(bool __n)
| ^~~~~~~~
/usr/include/c++/14/ostream:182:23: note: no known conversion for argument 1 from 'std::vector<std::__cxx11::basic_string<char> >' to 'bool'
182 | operator<<(bool __n)
| ~~~~~^~~
In file included from /usr/include/c++/14/ostream:1022:
/usr/include/c++/14/bits/ostream.tcc:96:5: note: candidate: 'std::basic_ostream<_CharT, _Traits>& std::basic_ostream<_CharT, _Traits>::operator<<(short int) [with _CharT = char; _Traits = std::char_traits<char>]'
96 | basic_ostream<_CharT, _Traits>::
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/c++/14/bits/ostream.tcc:97:22: note: no known conversion for argument 1 from 'std::vector<std::__cxx11::basic_string<char> >' to 'short int'
97 | operator<<(short __n)
| ~~~~~~^~~
/usr/include/c++/14/ostream:189:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(short unsigned int) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>]'
189 | operator<<(unsigned short __n)
| ^~~~~~~~
/usr/include/c++/14/ostream:189:33: note: no known conversion for argument 1 from 'std::vector<std::__cxx11::basic_string<char> >' to 'short unsigned int'
189 | operator<<(unsigned short __n)
| ~~~~~~~~~~~~~~~^~~
/usr/include/c++/14/bits/ostream.tcc:110:5: note: candidate: 'std::basic_ostream<_CharT, _Traits>& std::basic_ostream<_CharT, _Traits>::operator<<(int) [with _CharT = char; _Traits = std::char_traits<char>]'
110 | basic_ostream<_CharT, _Traits>::
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/c++/14/bits/ostream.tcc:111:20: note: no known conversion for argument 1 from 'std::vector<std::__cxx11::basic_string<char> >' to 'int'
111 | operator<<(int __n)
| ~~~~^~~
/usr/include/c++/14/ostream:200:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(unsigned int) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>]'
200 | operator<<(unsigned int __n)
| ^~~~~~~~
/usr/include/c++/14/ostream:200:31: note: no known conversion for argument 1 from 'std::vector<std::__cxx11::basic_string<char> >' to 'unsigned int'
200 | operator<<(unsigned int __n)
| ~~~~~~~~~~~~~^~~
/usr/include/c++/14/ostream:211:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(long long int) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>]'
211 | operator<<(long long __n)
| ^~~~~~~~
/usr/include/c++/14/ostream:211:28: note: no known conversion for argument 1 from 'std::vector<std::__cxx11::basic_string<char> >' to 'long long int'
211 | operator<<(long long __n)
| ~~~~~~~~~~^~~
/usr/include/c++/14/ostream:215:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(long long unsigned int) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>]'
215 | operator<<(unsigned long long __n)
| ^~~~~~~~
/usr/include/c++/14/ostream:215:37: note: no known conversion for argument 1 from 'std::vector<std::__cxx11::basic_string<char> >' to 'long long unsigned int'
215 | operator<<(unsigned long long __n)
| ~~~~~~~~~~~~~~~~~~~^~~
/usr/include/c++/14/ostream:231:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(double) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>]'
231 | operator<<(double __f)
| ^~~~~~~~
/usr/include/c++/14/ostream:231:25: note: no known conversion for argument 1 from 'std::vector<std::__cxx11::basic_string<char> >' to 'double'
231 | operator<<(double __f)
| ~~~~~~~^~~
/usr/include/c++/14/ostream:235:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(float) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>]'
235 | operator<<(float __f)
| ^~~~~~~~
/usr/include/c++/14/ostream:235:24: note: no known conversion for argument 1 from 'std::vector<std::__cxx11::basic_string<char> >' to 'float'
235 | operator<<(float __f)
| ~~~~~~^~~
/usr/include/c++/14/ostream:243:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(long double) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>]'
243 | operator<<(long double __f)
| ^~~~~~~~
/usr/include/c++/14/ostream:243:30: note: no known conversion for argument 1 from 'std::vector<std::__cxx11::basic_string<char> >' to 'long double'
243 | operator<<(long double __f)
| ~~~~~~~~~~~~^~~
/usr/include/c++/14/ostream:301:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(const void*) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>]'
301 | operator<<(const void* __p)
| ^~~~~~~~
/usr/include/c++/14/ostream:301:30: note: no known conversion for argument 1 from 'std::vector<std::__cxx11::b |
s171526582 | p03712 | C++ | #include <bits/stdc++.h>
using namespace std;
int main() {
int H, W;
cin >> H >> W;
string a;
for(int i=0;i<H;1++) {
string a;
cin >> a;
}
for (int i=0;i<H+2;i++) {
vector<string> b(N);
if (i==0 || i==H+1){
for (int j=0;j<W+2;j++) {
b.at(j)='#';
cout << b << endl;
}
else {
cout << '#'+a+'#' << endl;
}
}
} | a.cc: In function 'int main()':
a.cc:8:19: error: lvalue required as increment operand
8 | for(int i=0;i<H;1++) {
| ^
a.cc:13:22: error: 'N' was not declared in this scope
13 | vector<string> b(N);
| ^
a.cc:17:12: error: no match for 'operator<<' (operand types are 'std::ostream' {aka 'std::basic_ostream<char>'} and 'std::vector<std::__cxx11::basic_string<char> >')
17 | cout << b << endl;
| ~~~~ ^~ ~
| | |
| | std::vector<std::__cxx11::basic_string<char> >
| std::ostream {aka std::basic_ostream<char>}
In file included from /usr/include/c++/14/istream:41,
from /usr/include/c++/14/sstream:40,
from /usr/include/c++/14/complex:45,
from /usr/include/c++/14/ccomplex:39,
from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:127,
from a.cc:1:
/usr/include/c++/14/ostream:116:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(__ostream_type& (*)(__ostream_type&)) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>]'
116 | operator<<(__ostream_type& (*__pf)(__ostream_type&))
| ^~~~~~~~
/usr/include/c++/14/ostream:116:36: note: no known conversion for argument 1 from 'std::vector<std::__cxx11::basic_string<char> >' to 'std::basic_ostream<char>::__ostream_type& (*)(std::basic_ostream<char>::__ostream_type&)' {aka 'std::basic_ostream<char>& (*)(std::basic_ostream<char>&)'}
116 | operator<<(__ostream_type& (*__pf)(__ostream_type&))
| ~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~
/usr/include/c++/14/ostream:125:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(__ios_type& (*)(__ios_type&)) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>; __ios_type = std::basic_ios<char>]'
125 | operator<<(__ios_type& (*__pf)(__ios_type&))
| ^~~~~~~~
/usr/include/c++/14/ostream:125:32: note: no known conversion for argument 1 from 'std::vector<std::__cxx11::basic_string<char> >' to 'std::basic_ostream<char>::__ios_type& (*)(std::basic_ostream<char>::__ios_type&)' {aka 'std::basic_ios<char>& (*)(std::basic_ios<char>&)'}
125 | operator<<(__ios_type& (*__pf)(__ios_type&))
| ~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~
/usr/include/c++/14/ostream:135:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(std::ios_base& (*)(std::ios_base&)) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>]'
135 | operator<<(ios_base& (*__pf) (ios_base&))
| ^~~~~~~~
/usr/include/c++/14/ostream:135:30: note: no known conversion for argument 1 from 'std::vector<std::__cxx11::basic_string<char> >' to 'std::ios_base& (*)(std::ios_base&)'
135 | operator<<(ios_base& (*__pf) (ios_base&))
| ~~~~~~~~~~~~^~~~~~~~~~~~~~~~~
/usr/include/c++/14/ostream:174:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(long int) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>]'
174 | operator<<(long __n)
| ^~~~~~~~
/usr/include/c++/14/ostream:174:23: note: no known conversion for argument 1 from 'std::vector<std::__cxx11::basic_string<char> >' to 'long int'
174 | operator<<(long __n)
| ~~~~~^~~
/usr/include/c++/14/ostream:178:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(long unsigned int) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>]'
178 | operator<<(unsigned long __n)
| ^~~~~~~~
/usr/include/c++/14/ostream:178:32: note: no known conversion for argument 1 from 'std::vector<std::__cxx11::basic_string<char> >' to 'long unsigned int'
178 | operator<<(unsigned long __n)
| ~~~~~~~~~~~~~~^~~
/usr/include/c++/14/ostream:182:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(bool) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>]'
182 | operator<<(bool __n)
| ^~~~~~~~
/usr/include/c++/14/ostream:182:23: note: no known conversion for argument 1 from 'std::vector<std::__cxx11::basic_string<char> >' to 'bool'
182 | operator<<(bool __n)
| ~~~~~^~~
In file included from /usr/include/c++/14/ostream:1022:
/usr/include/c++/14/bits/ostream.tcc:96:5: note: candidate: 'std::basic_ostream<_CharT, _Traits>& std::basic_ostream<_CharT, _Traits>::operator<<(short int) [with _CharT = char; _Traits = std::char_traits<char>]'
96 | basic_ostream<_CharT, _Traits>::
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/c++/14/bits/ostream.tcc:97:22: note: no known conversion for argument 1 from 'std::vector<std::__cxx11::basic_string<char> >' to 'short int'
97 | operator<<(short __n)
| ~~~~~~^~~
/usr/include/c++/14/ostream:189:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(short unsigned int) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>]'
189 | operator<<(unsigned short __n)
| ^~~~~~~~
/usr/include/c++/14/ostream:189:33: note: no known conversion for argument 1 from 'std::vector<std::__cxx11::basic_string<char> >' to 'short unsigned int'
189 | operator<<(unsigned short __n)
| ~~~~~~~~~~~~~~~^~~
/usr/include/c++/14/bits/ostream.tcc:110:5: note: candidate: 'std::basic_ostream<_CharT, _Traits>& std::basic_ostream<_CharT, _Traits>::operator<<(int) [with _CharT = char; _Traits = std::char_traits<char>]'
110 | basic_ostream<_CharT, _Traits>::
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/c++/14/bits/ostream.tcc:111:20: note: no known conversion for argument 1 from 'std::vector<std::__cxx11::basic_string<char> >' to 'int'
111 | operator<<(int __n)
| ~~~~^~~
/usr/include/c++/14/ostream:200:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(unsigned int) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>]'
200 | operator<<(unsigned int __n)
| ^~~~~~~~
/usr/include/c++/14/ostream:200:31: note: no known conversion for argument 1 from 'std::vector<std::__cxx11::basic_string<char> >' to 'unsigned int'
200 | operator<<(unsigned int __n)
| ~~~~~~~~~~~~~^~~
/usr/include/c++/14/ostream:211:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(long long int) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>]'
211 | operator<<(long long __n)
| ^~~~~~~~
/usr/include/c++/14/ostream:211:28: note: no known conversion for argument 1 from 'std::vector<std::__cxx11::basic_string<char> >' to 'long long int'
211 | operator<<(long long __n)
| ~~~~~~~~~~^~~
/usr/include/c++/14/ostream:215:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(long long unsigned int) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>]'
215 | operator<<(unsigned long long __n)
| ^~~~~~~~
/usr/include/c++/14/ostream:215:37: note: no known conversion for argument 1 from 'std::vector<std::__cxx11::basic_string<char> >' to 'long long unsigned int'
215 | operator<<(unsigned long long __n)
| ~~~~~~~~~~~~~~~~~~~^~~
/usr/include/c++/14/ostream:231:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(double) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>]'
231 | operator<<(double __f)
| ^~~~~~~~
/usr/include/c++/14/ostream:231:25: note: no known conversion for argument 1 from 'std::vector<std::__cxx11::basic_string<char> >' to 'double'
231 | operator<<(double __f)
| ~~~~~~~^~~
/usr/include/c++/14/ostream:235:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(float) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>]'
235 | operator<<(float __f)
| ^~~~~~~~
/usr/include/c++/14/ostream:235:24: note: no known conversion for argument 1 from 'std::vector<std::__cxx11::basic_string<char> >' to 'float'
235 | operator<<(float __f)
| ~~~~~~^~~
/usr/include/c++/14/ostream:243:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(long double) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>]'
243 | operator<<(long double __f)
| ^~~~~~~~
/usr/include/c++/14/ostream:243:30: note: no known conversion for argument 1 from 'std::vector<std::__cxx11::basic_string<char> >' to 'long double'
243 | operator<<(long double __f)
| ~~~~~~~~~~~~^~~
/usr/include/c++/14/ostream:301:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(const void*) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>]'
301 | operator<<(const void* __p)
| ^~~ |
s032471695 | p03712 | C++ | #include <bits/stdc++.h>
using namespace std;
int main() {
int H, W;
cin >> H >> W;
string a;
for(int i=0;i<H;1++) {
string a;
cin >> a;
}
for (int i=0;i<H+2;i++) {
vector<string> b(N);
if (i=0 || i=H+1){
for (int j=0;j<W+2;j++) {
b.at(j)=='#';
cout << b << endl;
}
else {
cout << '#'+a+'#' << endl;
}
}
} | a.cc: In function 'int main()':
a.cc:8:19: error: lvalue required as increment operand
8 | for(int i=0;i<H;1++) {
| ^
a.cc:13:22: error: 'N' was not declared in this scope
13 | vector<string> b(N);
| ^
a.cc:14:13: error: lvalue required as left operand of assignment
14 | if (i=0 || i=H+1){
| ~~^~~~
a.cc:16:14: error: no match for 'operator==' (operand types are '__gnu_cxx::__alloc_traits<std::allocator<std::__cxx11::basic_string<char> >, std::__cxx11::basic_string<char> >::value_type' {aka 'std::__cxx11::basic_string<char>'} and 'char')
16 | b.at(j)=='#';
| ~~~~~~~^~~~~
| | |
| | char
| __gnu_cxx::__alloc_traits<std::allocator<std::__cxx11::basic_string<char> >, std::__cxx11::basic_string<char> >::value_type {aka std::__cxx11::basic_string<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:1103:5: note: candidate: 'template<class _BiIter> bool std::__cxx11::operator==(const sub_match<_BiIter>&, const sub_match<_BiIter>&)'
1103 | operator==(const sub_match<_BiIter>& __lhs, const sub_match<_BiIter>& __rhs)
| ^~~~~~~~
/usr/include/c++/14/bits/regex.h:1103:5: note: template argument deduction/substitution failed:
a.cc:16:16: note: '__gnu_cxx::__alloc_traits<std::allocator<std::__cxx11::basic_string<char> >, std::__cxx11::basic_string<char> >::value_type' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::__cxx11::sub_match<_BiIter>'
16 | b.at(j)=='#';
| ^~~
/usr/include/c++/14/bits/regex.h:1199:5: note: candidate: 'template<class _Bi_iter, class _Ch_traits, class _Ch_alloc> bool std::__cxx11::operator==(__sub_match_string<_Bi_iter, _Ch_traits, _Ch_alloc>&, const sub_match<_BiIter>&)'
1199 | operator==(const __sub_match_string<_Bi_iter, _Ch_traits, _Ch_alloc>& __lhs,
| ^~~~~~~~
/usr/include/c++/14/bits/regex.h:1199:5: note: template argument deduction/substitution failed:
a.cc:16:16: note: mismatched types 'const std::__cxx11::sub_match<_BiIter>' and 'char'
16 | b.at(j)=='#';
| ^~~
/usr/include/c++/14/bits/regex.h:1274:5: note: candidate: 'template<class _Bi_iter, class _Ch_traits, class _Ch_alloc> bool std::__cxx11::operator==(const sub_match<_BiIter>&, __sub_match_string<_Bi_iter, _Ch_traits, _Ch_alloc>&)'
1274 | operator==(const sub_match<_Bi_iter>& __lhs,
| ^~~~~~~~
/usr/include/c++/14/bits/regex.h:1274:5: note: template argument deduction/substitution failed:
a.cc:16:16: note: '__gnu_cxx::__alloc_traits<std::allocator<std::__cxx11::basic_string<char> >, std::__cxx11::basic_string<char> >::value_type' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::__cxx11::sub_match<_BiIter>'
16 | b.at(j)=='#';
| ^~~
/usr/include/c++/14/bits/regex.h:1366:5: note: candidate: 'template<class _Bi_iter> bool std::__cxx11::operator==(const typename std::iterator_traits<_Iter>::value_type*, const sub_match<_BiIter>&)'
1366 | operator==(typename iterator_traits<_Bi_iter>::value_type const* __lhs,
| ^~~~~~~~
/usr/include/c++/14/bits/regex.h:1366:5: note: template argument deduction/substitution failed:
a.cc:16:16: note: mismatched types 'const std::__cxx11::sub_match<_BiIter>' and 'char'
16 | b.at(j)=='#';
| ^~~
/usr/include/c++/14/bits/regex.h:1441:5: note: candidate: 'template<class _Bi_iter> bool std::__cxx11::operator==(const sub_match<_BiIter>&, const typename std::iterator_traits<_Iter>::value_type*)'
1441 | operator==(const sub_match<_Bi_iter>& __lhs,
| ^~~~~~~~
/usr/include/c++/14/bits/regex.h:1441:5: note: template argument deduction/substitution failed:
a.cc:16:16: note: '__gnu_cxx::__alloc_traits<std::allocator<std::__cxx11::basic_string<char> >, std::__cxx11::basic_string<char> >::value_type' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::__cxx11::sub_match<_BiIter>'
16 | b.at(j)=='#';
| ^~~
/usr/include/c++/14/bits/regex.h:1534:5: note: candidate: 'template<class _Bi_iter> bool std::__cxx11::operator==(const typename std::iterator_traits<_Iter>::value_type&, const sub_match<_BiIter>&)'
1534 | operator==(typename iterator_traits<_Bi_iter>::value_type const& __lhs,
| ^~~~~~~~
/usr/include/c++/14/bits/regex.h:1534:5: note: template argument deduction/substitution failed:
a.cc:16:16: note: mismatched types 'const std::__cxx11::sub_match<_BiIter>' and 'char'
16 | b.at(j)=='#';
| ^~~
/usr/include/c++/14/bits/regex.h:1613:5: note: candidate: 'template<class _Bi_iter> bool std::__cxx11::operator==(const sub_match<_BiIter>&, const typename std::iterator_traits<_Iter>::value_type&)'
1613 | operator==(const sub_match<_Bi_iter>& __lhs,
| ^~~~~~~~
/usr/include/c++/14/bits/regex.h:1613:5: note: template argument deduction/substitution failed:
a.cc:16:16: note: '__gnu_cxx::__alloc_traits<std::allocator<std::__cxx11::basic_string<char> >, std::__cxx11::basic_string<char> >::value_type' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::__cxx11::sub_match<_BiIter>'
16 | b.at(j)=='#';
| ^~~
/usr/include/c++/14/bits/regex.h:2186:5: note: candidate: 'template<class _Bi_iter, class _Alloc> bool std::__cxx11::operator==(const match_results<_BiIter, _Alloc>&, const match_results<_BiIter, _Alloc>&)'
2186 | operator==(const match_results<_Bi_iter, _Alloc>& __m1,
| ^~~~~~~~
/usr/include/c++/14/bits/regex.h:2186:5: note: template argument deduction/substitution failed:
a.cc:16:16: note: '__gnu_cxx::__alloc_traits<std::allocator<std::__cxx11::basic_string<char> >, std::__cxx11::basic_string<char> >::value_type' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::__cxx11::match_results<_BiIter, _Alloc>'
16 | b.at(j)=='#';
| ^~~
In file included from /usr/include/c++/14/bits/stl_algobase.h:64,
from /usr/include/c++/14/algorithm:60,
from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:51:
/usr/include/c++/14/bits/stl_pair.h:1033:5: note: candidate: 'template<class _T1, class _T2> constexpr bool std::operator==(const pair<_T1, _T2>&, const pair<_T1, _T2>&)'
1033 | operator==(const pair<_T1, _T2>& __x, const pair<_T1, _T2>& __y)
| ^~~~~~~~
/usr/include/c++/14/bits/stl_pair.h:1033:5: note: template argument deduction/substitution failed:
a.cc:16:16: note: '__gnu_cxx::__alloc_traits<std::allocator<std::__cxx11::basic_string<char> >, std::__cxx11::basic_string<char> >::value_type' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::pair<_T1, _T2>'
16 | b.at(j)=='#';
| ^~~
In file included from /usr/include/c++/14/bits/stl_algobase.h:67:
/usr/include/c++/14/bits/stl_iterator.h:441:5: note: candidate: 'template<class _Iterator> constexpr bool std::operator==(const reverse_iterator<_Iterator>&, const reverse_iterator<_Iterator>&)'
441 | operator==(const reverse_iterator<_Iterator>& __x,
| ^~~~~~~~
/usr/include/c++/14/bits/stl_iterator.h:441:5: note: template argument deduction/substitution failed:
a.cc:16:16: note: '__gnu_cxx::__alloc_traits<std::allocator<std::__cxx11::basic_string<char> >, std::__cxx11::basic_string<char> >::value_type' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::reverse_iterator<_Iterator>'
16 | b.at(j)=='#';
| ^~~
/usr/include/c++/14/bits/stl_iterator.h:486:5: note: candidate: 'template<class _IteratorL, class _IteratorR> constexpr bool std::operator==(const reverse_iterator<_Iterator>&, const reverse_iterator<_IteratorR>&)'
486 | operator==(const reverse_iterator<_IteratorL>& __x,
| ^~~~~~~~
/usr/include/c++/14/bits/stl_iterator.h:486:5: note: template argument deduction/substitution failed:
a.cc:16:16: note: '__gnu_cxx::__alloc_traits<std::allocator<std::__cxx11::basic_string<char> >, std::__cxx11::basic_string<char> >::value_type' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::reverse_iterator<_Iterator>'
16 | b.at(j)=='#';
| ^~~
/usr/include/c++/14/bits/stl_iterator.h:1667:5: note: candidate: 'template<class _IteratorL, class _IteratorR> constexpr bool std::operator==(const move_iterator<_IteratorL>&, const move_iterator<_IteratorR>&)'
1667 | operator==(const move_iterator<_IteratorL>& __x,
| ^~~~~~~~
/usr/include/c++/14/bits/stl_iterator.h:1667:5: note: template argument deduction/substitution failed:
a.cc:16:16: note: '__gnu_cxx::__alloc_traits<std::allocator<std::__cxx11::basic_string<char> >, std::__cxx11::basic_string<char> >::value_type' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::move_iterator<_IteratorL>'
16 | b.at(j)=='#';
| ^~~
/usr/include/c++/14/bits/stl_iterator.h:1737:5: note: candidate: 'template<class _Iterator> constexpr bool std::operator==(const move_iterator<_IteratorL>&, const move_iterator<_IteratorL>&)'
1737 | operator==(const move_iterator<_Iterator>& __x,
| ^~~~~~~~
/usr/include/c++/14/bits/stl_iterator.h:1737:5: note: template argument deduction/substitution failed:
a.cc:16:16: note: '__gnu_cxx::__alloc_traits<std::allocator<std::__cxx11::basic_string<char> >, std::__cxx11::basic_string<char> >::value_type' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::move_iterator<_IteratorL>'
16 | b.at(j)=='#';
| ^~~
In file included from /usr/include/c++/14/bits/char_traits.h:42,
from /usr/include/c++/14/string:42,
from /usr/include/c++/14/bitset:52,
from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:52:
/usr/include/c++/14/bits/postypes.h:192:5: note: candidate: 'template<class _StateT> bool |
s630958791 | 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 j = 0; j < H; j++) {
vector<string> a(W);
for (int k = 0; k < W; k++) {
cin >> a.at(k);
}
cout << "#" << a << "#" << endl;
}
for ( int l = 0; l < W + 2; l++) {
cout << "#";
}
cout << endl;
}
| a.cc: In function 'int main()':
a.cc:18:17: error: no match for 'operator<<' (operand types are 'std::basic_ostream<char>' and 'std::vector<std::__cxx11::basic_string<char> >')
18 | cout << "#" << a << "#" << endl;
| ~~~~~~~~~~~ ^~ ~
| | |
| | std::vector<std::__cxx11::basic_string<char> >
| std::basic_ostream<char>
In file included from /usr/include/c++/14/istream:41,
from /usr/include/c++/14/sstream:40,
from /usr/include/c++/14/complex:45,
from /usr/include/c++/14/ccomplex:39,
from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:127,
from a.cc:1:
/usr/include/c++/14/ostream:116:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(__ostream_type& (*)(__ostream_type&)) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>]'
116 | operator<<(__ostream_type& (*__pf)(__ostream_type&))
| ^~~~~~~~
/usr/include/c++/14/ostream:116:36: note: no known conversion for argument 1 from 'std::vector<std::__cxx11::basic_string<char> >' to 'std::basic_ostream<char>::__ostream_type& (*)(std::basic_ostream<char>::__ostream_type&)' {aka 'std::basic_ostream<char>& (*)(std::basic_ostream<char>&)'}
116 | operator<<(__ostream_type& (*__pf)(__ostream_type&))
| ~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~
/usr/include/c++/14/ostream:125:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(__ios_type& (*)(__ios_type&)) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>; __ios_type = std::basic_ios<char>]'
125 | operator<<(__ios_type& (*__pf)(__ios_type&))
| ^~~~~~~~
/usr/include/c++/14/ostream:125:32: note: no known conversion for argument 1 from 'std::vector<std::__cxx11::basic_string<char> >' to 'std::basic_ostream<char>::__ios_type& (*)(std::basic_ostream<char>::__ios_type&)' {aka 'std::basic_ios<char>& (*)(std::basic_ios<char>&)'}
125 | operator<<(__ios_type& (*__pf)(__ios_type&))
| ~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~
/usr/include/c++/14/ostream:135:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(std::ios_base& (*)(std::ios_base&)) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>]'
135 | operator<<(ios_base& (*__pf) (ios_base&))
| ^~~~~~~~
/usr/include/c++/14/ostream:135:30: note: no known conversion for argument 1 from 'std::vector<std::__cxx11::basic_string<char> >' to 'std::ios_base& (*)(std::ios_base&)'
135 | operator<<(ios_base& (*__pf) (ios_base&))
| ~~~~~~~~~~~~^~~~~~~~~~~~~~~~~
/usr/include/c++/14/ostream:174:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(long int) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>]'
174 | operator<<(long __n)
| ^~~~~~~~
/usr/include/c++/14/ostream:174:23: note: no known conversion for argument 1 from 'std::vector<std::__cxx11::basic_string<char> >' to 'long int'
174 | operator<<(long __n)
| ~~~~~^~~
/usr/include/c++/14/ostream:178:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(long unsigned int) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>]'
178 | operator<<(unsigned long __n)
| ^~~~~~~~
/usr/include/c++/14/ostream:178:32: note: no known conversion for argument 1 from 'std::vector<std::__cxx11::basic_string<char> >' to 'long unsigned int'
178 | operator<<(unsigned long __n)
| ~~~~~~~~~~~~~~^~~
/usr/include/c++/14/ostream:182:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(bool) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>]'
182 | operator<<(bool __n)
| ^~~~~~~~
/usr/include/c++/14/ostream:182:23: note: no known conversion for argument 1 from 'std::vector<std::__cxx11::basic_string<char> >' to 'bool'
182 | operator<<(bool __n)
| ~~~~~^~~
In file included from /usr/include/c++/14/ostream:1022:
/usr/include/c++/14/bits/ostream.tcc:96:5: note: candidate: 'std::basic_ostream<_CharT, _Traits>& std::basic_ostream<_CharT, _Traits>::operator<<(short int) [with _CharT = char; _Traits = std::char_traits<char>]'
96 | basic_ostream<_CharT, _Traits>::
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/c++/14/bits/ostream.tcc:97:22: note: no known conversion for argument 1 from 'std::vector<std::__cxx11::basic_string<char> >' to 'short int'
97 | operator<<(short __n)
| ~~~~~~^~~
/usr/include/c++/14/ostream:189:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(short unsigned int) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>]'
189 | operator<<(unsigned short __n)
| ^~~~~~~~
/usr/include/c++/14/ostream:189:33: note: no known conversion for argument 1 from 'std::vector<std::__cxx11::basic_string<char> >' to 'short unsigned int'
189 | operator<<(unsigned short __n)
| ~~~~~~~~~~~~~~~^~~
/usr/include/c++/14/bits/ostream.tcc:110:5: note: candidate: 'std::basic_ostream<_CharT, _Traits>& std::basic_ostream<_CharT, _Traits>::operator<<(int) [with _CharT = char; _Traits = std::char_traits<char>]'
110 | basic_ostream<_CharT, _Traits>::
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/c++/14/bits/ostream.tcc:111:20: note: no known conversion for argument 1 from 'std::vector<std::__cxx11::basic_string<char> >' to 'int'
111 | operator<<(int __n)
| ~~~~^~~
/usr/include/c++/14/ostream:200:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(unsigned int) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>]'
200 | operator<<(unsigned int __n)
| ^~~~~~~~
/usr/include/c++/14/ostream:200:31: note: no known conversion for argument 1 from 'std::vector<std::__cxx11::basic_string<char> >' to 'unsigned int'
200 | operator<<(unsigned int __n)
| ~~~~~~~~~~~~~^~~
/usr/include/c++/14/ostream:211:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(long long int) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>]'
211 | operator<<(long long __n)
| ^~~~~~~~
/usr/include/c++/14/ostream:211:28: note: no known conversion for argument 1 from 'std::vector<std::__cxx11::basic_string<char> >' to 'long long int'
211 | operator<<(long long __n)
| ~~~~~~~~~~^~~
/usr/include/c++/14/ostream:215:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(long long unsigned int) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>]'
215 | operator<<(unsigned long long __n)
| ^~~~~~~~
/usr/include/c++/14/ostream:215:37: note: no known conversion for argument 1 from 'std::vector<std::__cxx11::basic_string<char> >' to 'long long unsigned int'
215 | operator<<(unsigned long long __n)
| ~~~~~~~~~~~~~~~~~~~^~~
/usr/include/c++/14/ostream:231:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(double) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>]'
231 | operator<<(double __f)
| ^~~~~~~~
/usr/include/c++/14/ostream:231:25: note: no known conversion for argument 1 from 'std::vector<std::__cxx11::basic_string<char> >' to 'double'
231 | operator<<(double __f)
| ~~~~~~~^~~
/usr/include/c++/14/ostream:235:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(float) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>]'
235 | operator<<(float __f)
| ^~~~~~~~
/usr/include/c++/14/ostream:235:24: note: no known conversion for argument 1 from 'std::vector<std::__cxx11::basic_string<char> >' to 'float'
235 | operator<<(float __f)
| ~~~~~~^~~
/usr/include/c++/14/ostream:243:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(long double) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>]'
243 | operator<<(long double __f)
| ^~~~~~~~
/usr/include/c++/14/ostream:243:30: note: no known conversion for argument 1 from 'std::vector<std::__cxx11::basic_string<char> >' to 'long double'
243 | operator<<(long double __f)
| ~~~~~~~~~~~~^~~
/usr/include/c++/14/ostream:301:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(const void*) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>]'
301 | operator<<(const void* __p)
| ^~~~~~~~
/usr/include/c++/14/ostream:301:30: note: no known conversion for argument 1 from 'std::vector<std::__cxx11::basic_string<char> >' to 'const void*'
301 | operator<<(const void* __p)
| ~~~~~~~~~~~~^~~
/usr/ |
s981145815 | p03712 | C++ | #include <bits/stdc++.h>
using namespace std;
int main() {
int H, W;
cin >> H >> W;
for (int i = 0; i < W; i++) {
cout << "#";
}
cout << endl;
for (int j = 0; j < H; j++) {
vector<string> pic(W);
for (int k = 0; k < W; k++) {
cin >> pic.at(k);
}
cout << "#" << pic(W) << "#" << endl;
}
for ( int l = 0; l < W; l++) {
cout << "#";
}
cout << endl;
}
| a.cc: In function 'int main()':
a.cc:18:23: error: no match for call to '(std::vector<std::__cxx11::basic_string<char> >) (int&)'
18 | cout << "#" << pic(W) << "#" << endl;
| ~~~^~~
|
s057791985 | p03712 | C++ | #include <bits/stdc++.h>
using namespace std;
int main() {
int H, W;
cin >> H >> W;
for (int i = 0; i < W; i++) {
cout << "#";
}
cout << endl;
for (int j = 0; j < H; j++) {
vector<string> pic(W);
for (int k = 0; k < W; k++) {
cin >> pic.at(k);
}
cout << "#" << pic << "#" << endl;
}
for ( int l = 0; l < W; l++) {
cout << "#";
}
cout << endl;
}
| a.cc: In function 'int main()':
a.cc:18:17: error: no match for 'operator<<' (operand types are 'std::basic_ostream<char>' and 'std::vector<std::__cxx11::basic_string<char> >')
18 | cout << "#" << pic << "#" << endl;
| ~~~~~~~~~~~ ^~ ~~~
| | |
| | std::vector<std::__cxx11::basic_string<char> >
| std::basic_ostream<char>
In file included from /usr/include/c++/14/istream:41,
from /usr/include/c++/14/sstream:40,
from /usr/include/c++/14/complex:45,
from /usr/include/c++/14/ccomplex:39,
from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:127,
from a.cc:1:
/usr/include/c++/14/ostream:116:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(__ostream_type& (*)(__ostream_type&)) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>]'
116 | operator<<(__ostream_type& (*__pf)(__ostream_type&))
| ^~~~~~~~
/usr/include/c++/14/ostream:116:36: note: no known conversion for argument 1 from 'std::vector<std::__cxx11::basic_string<char> >' to 'std::basic_ostream<char>::__ostream_type& (*)(std::basic_ostream<char>::__ostream_type&)' {aka 'std::basic_ostream<char>& (*)(std::basic_ostream<char>&)'}
116 | operator<<(__ostream_type& (*__pf)(__ostream_type&))
| ~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~
/usr/include/c++/14/ostream:125:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(__ios_type& (*)(__ios_type&)) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>; __ios_type = std::basic_ios<char>]'
125 | operator<<(__ios_type& (*__pf)(__ios_type&))
| ^~~~~~~~
/usr/include/c++/14/ostream:125:32: note: no known conversion for argument 1 from 'std::vector<std::__cxx11::basic_string<char> >' to 'std::basic_ostream<char>::__ios_type& (*)(std::basic_ostream<char>::__ios_type&)' {aka 'std::basic_ios<char>& (*)(std::basic_ios<char>&)'}
125 | operator<<(__ios_type& (*__pf)(__ios_type&))
| ~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~
/usr/include/c++/14/ostream:135:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(std::ios_base& (*)(std::ios_base&)) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>]'
135 | operator<<(ios_base& (*__pf) (ios_base&))
| ^~~~~~~~
/usr/include/c++/14/ostream:135:30: note: no known conversion for argument 1 from 'std::vector<std::__cxx11::basic_string<char> >' to 'std::ios_base& (*)(std::ios_base&)'
135 | operator<<(ios_base& (*__pf) (ios_base&))
| ~~~~~~~~~~~~^~~~~~~~~~~~~~~~~
/usr/include/c++/14/ostream:174:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(long int) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>]'
174 | operator<<(long __n)
| ^~~~~~~~
/usr/include/c++/14/ostream:174:23: note: no known conversion for argument 1 from 'std::vector<std::__cxx11::basic_string<char> >' to 'long int'
174 | operator<<(long __n)
| ~~~~~^~~
/usr/include/c++/14/ostream:178:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(long unsigned int) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>]'
178 | operator<<(unsigned long __n)
| ^~~~~~~~
/usr/include/c++/14/ostream:178:32: note: no known conversion for argument 1 from 'std::vector<std::__cxx11::basic_string<char> >' to 'long unsigned int'
178 | operator<<(unsigned long __n)
| ~~~~~~~~~~~~~~^~~
/usr/include/c++/14/ostream:182:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(bool) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>]'
182 | operator<<(bool __n)
| ^~~~~~~~
/usr/include/c++/14/ostream:182:23: note: no known conversion for argument 1 from 'std::vector<std::__cxx11::basic_string<char> >' to 'bool'
182 | operator<<(bool __n)
| ~~~~~^~~
In file included from /usr/include/c++/14/ostream:1022:
/usr/include/c++/14/bits/ostream.tcc:96:5: note: candidate: 'std::basic_ostream<_CharT, _Traits>& std::basic_ostream<_CharT, _Traits>::operator<<(short int) [with _CharT = char; _Traits = std::char_traits<char>]'
96 | basic_ostream<_CharT, _Traits>::
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/c++/14/bits/ostream.tcc:97:22: note: no known conversion for argument 1 from 'std::vector<std::__cxx11::basic_string<char> >' to 'short int'
97 | operator<<(short __n)
| ~~~~~~^~~
/usr/include/c++/14/ostream:189:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(short unsigned int) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>]'
189 | operator<<(unsigned short __n)
| ^~~~~~~~
/usr/include/c++/14/ostream:189:33: note: no known conversion for argument 1 from 'std::vector<std::__cxx11::basic_string<char> >' to 'short unsigned int'
189 | operator<<(unsigned short __n)
| ~~~~~~~~~~~~~~~^~~
/usr/include/c++/14/bits/ostream.tcc:110:5: note: candidate: 'std::basic_ostream<_CharT, _Traits>& std::basic_ostream<_CharT, _Traits>::operator<<(int) [with _CharT = char; _Traits = std::char_traits<char>]'
110 | basic_ostream<_CharT, _Traits>::
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/c++/14/bits/ostream.tcc:111:20: note: no known conversion for argument 1 from 'std::vector<std::__cxx11::basic_string<char> >' to 'int'
111 | operator<<(int __n)
| ~~~~^~~
/usr/include/c++/14/ostream:200:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(unsigned int) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>]'
200 | operator<<(unsigned int __n)
| ^~~~~~~~
/usr/include/c++/14/ostream:200:31: note: no known conversion for argument 1 from 'std::vector<std::__cxx11::basic_string<char> >' to 'unsigned int'
200 | operator<<(unsigned int __n)
| ~~~~~~~~~~~~~^~~
/usr/include/c++/14/ostream:211:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(long long int) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>]'
211 | operator<<(long long __n)
| ^~~~~~~~
/usr/include/c++/14/ostream:211:28: note: no known conversion for argument 1 from 'std::vector<std::__cxx11::basic_string<char> >' to 'long long int'
211 | operator<<(long long __n)
| ~~~~~~~~~~^~~
/usr/include/c++/14/ostream:215:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(long long unsigned int) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>]'
215 | operator<<(unsigned long long __n)
| ^~~~~~~~
/usr/include/c++/14/ostream:215:37: note: no known conversion for argument 1 from 'std::vector<std::__cxx11::basic_string<char> >' to 'long long unsigned int'
215 | operator<<(unsigned long long __n)
| ~~~~~~~~~~~~~~~~~~~^~~
/usr/include/c++/14/ostream:231:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(double) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>]'
231 | operator<<(double __f)
| ^~~~~~~~
/usr/include/c++/14/ostream:231:25: note: no known conversion for argument 1 from 'std::vector<std::__cxx11::basic_string<char> >' to 'double'
231 | operator<<(double __f)
| ~~~~~~~^~~
/usr/include/c++/14/ostream:235:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(float) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>]'
235 | operator<<(float __f)
| ^~~~~~~~
/usr/include/c++/14/ostream:235:24: note: no known conversion for argument 1 from 'std::vector<std::__cxx11::basic_string<char> >' to 'float'
235 | operator<<(float __f)
| ~~~~~~^~~
/usr/include/c++/14/ostream:243:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(long double) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>]'
243 | operator<<(long double __f)
| ^~~~~~~~
/usr/include/c++/14/ostream:243:30: note: no known conversion for argument 1 from 'std::vector<std::__cxx11::basic_string<char> >' to 'long double'
243 | operator<<(long double __f)
| ~~~~~~~~~~~~^~~
/usr/include/c++/14/ostream:301:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(const void*) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>]'
301 | operator<<(const void* __p)
| ^~~~~~~~
/usr/include/c++/14/ostream:301:30: note: no known conversion for argument 1 from 'std::vector<std::__cxx11::basic_string<char> >' to 'const void*'
301 | operator<<(const void* __p)
| ~~~~~~~~~~~~^~~
/ |
s085254523 | p03712 | C++ | #include <bits/stdc++.h>
using namespace std;
int main() {
int H, W;
cin >> H >> W;
for (int i = 0; i < W; i++) {
cout << "#";
}
cout << endl;
for (int j = 0; j < H; j++) {
vector<string> pic(W);
cin >> pic(W);
cout << "#" << pic(W) << "#" << endl;
}
for ( int k = 0; k < W; k++) {
cout << "#";
}
cout << endl;
}
| a.cc: In function 'int main()':
a.cc:15:15: error: no match for call to '(std::vector<std::__cxx11::basic_string<char> >) (int&)'
15 | cin >> pic(W);
| ~~~^~~
a.cc:17:23: error: no match for call to '(std::vector<std::__cxx11::basic_string<char> >) (int&)'
17 | cout << "#" << pic(W) << "#" << endl;
| ~~~^~~
|
s583404928 | p03712 | C++ | #include<bits/stdc++.h>
using namespace std;
int main(){
int H,W,i,j;
vector<vector<char>> a(100,vector<char>(100));
vector<vector<char>> b(102,vector<char>(102));
cin >> H >> W;
for(i=0;i<H;i++){
for(j=0;j<W;j++){
cin >> a.at(i).at(j);
}
}
for(i=0;i<H+2;i++){
for(j=0;j<W+2;j++){
b.at(i).at(j)='#';
}
}
for(i=0;i<H;i++){
for(j=0;j<W;j++){
b.at(i+1).at(j+1)=a.at(i).at(j);
}
}
for(i=0;i<H+2;i++){
for(j=0;j<W+2;j++){
cout << b.at(i).at(j);
}
cout << endl;
}
| a.cc: In function 'int main()':
a.cc:34:6: error: expected '}' at end of input
34 | }
| ^
a.cc:4:11: note: to match this '{'
4 | int main(){
| ^
|
s000352021 | p03712 | C++ | #include <bits/stdc++.h>
using namespace std;
int main() {
int H, W;
cin >> H >> W;
vector<string> a();
for (int i = 0; i < W; i++) {
cin >> a(i);
}
cout << '#' * (W + 2) << endl;
for (int i = 0; i < H; i++) {
cout << '#' << a(i) << '#' << endl;
}
cout << '#' * (W + 2) << endl;
}
| a.cc: In function 'int main()':
a.cc:8:19: warning: empty parentheses were disambiguated as a function declaration [-Wvexing-parse]
8 | vector<string> a();
| ^~
a.cc:10:13: error: too many arguments to function 'std::vector<std::__cxx11::basic_string<char> > a()'
10 | cin >> a(i);
| ~^~~
a.cc:8:18: note: declared here
8 | vector<string> a();
| ^
a.cc:10:9: error: no match for 'operator>>' (operand types are 'std::istream' {aka 'std::basic_istream<char>'} and 'std::vector<std::__cxx11::basic_string<char> >')
10 | cin >> a(i);
| ~~~ ^~ ~~~~
| | |
| | std::vector<std::__cxx11::basic_string<char> >
| std::istream {aka std::basic_istream<char>}
In file included from /usr/include/c++/14/sstream:40,
from /usr/include/c++/14/complex:45,
from /usr/include/c++/14/ccomplex:39,
from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:127,
from a.cc:1:
/usr/include/c++/14/istream:170:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(bool&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]'
170 | operator>>(bool& __n)
| ^~~~~~~~
/usr/include/c++/14/istream:170:24: note: no known conversion for argument 1 from 'std::vector<std::__cxx11::basic_string<char> >' to 'bool&'
170 | operator>>(bool& __n)
| ~~~~~~^~~
/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>]'
174 | operator>>(short& __n);
| ^~~~~~~~
/usr/include/c++/14/istream:174:25: note: no known conversion for argument 1 from 'std::vector<std::__cxx11::basic_string<char> >' to 'short int&'
174 | operator>>(short& __n);
| ~~~~~~~^~~
/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>]'
177 | operator>>(unsigned short& __n)
| ^~~~~~~~
/usr/include/c++/14/istream:177:34: note: no known conversion for argument 1 from 'std::vector<std::__cxx11::basic_string<char> >' to 'short unsigned int&'
177 | operator>>(unsigned short& __n)
| ~~~~~~~~~~~~~~~~^~~
/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>]'
181 | operator>>(int& __n);
| ^~~~~~~~
/usr/include/c++/14/istream:181:23: note: no known conversion for argument 1 from 'std::vector<std::__cxx11::basic_string<char> >' to 'int&'
181 | operator>>(int& __n);
| ~~~~~^~~
/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>]'
184 | operator>>(unsigned int& __n)
| ^~~~~~~~
/usr/include/c++/14/istream:184:32: note: no known conversion for argument 1 from 'std::vector<std::__cxx11::basic_string<char> >' to 'unsigned int&'
184 | operator>>(unsigned int& __n)
| ~~~~~~~~~~~~~~^~~
/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>]'
188 | operator>>(long& __n)
| ^~~~~~~~
/usr/include/c++/14/istream:188:24: note: no known conversion for argument 1 from 'std::vector<std::__cxx11::basic_string<char> >' to 'long int&'
188 | operator>>(long& __n)
| ~~~~~~^~~
/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>]'
192 | operator>>(unsigned long& __n)
| ^~~~~~~~
/usr/include/c++/14/istream:192:33: note: no known conversion for argument 1 from 'std::vector<std::__cxx11::basic_string<char> >' to 'long unsigned int&'
192 | operator>>(unsigned long& __n)
| ~~~~~~~~~~~~~~~^~~
/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>]'
199 | operator>>(long long& __n)
| ^~~~~~~~
/usr/include/c++/14/istream:199:29: note: no known conversion for argument 1 from 'std::vector<std::__cxx11::basic_string<char> >' to 'long long int&'
199 | operator>>(long long& __n)
| ~~~~~~~~~~~^~~
/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>]'
203 | operator>>(unsigned long long& __n)
| ^~~~~~~~
/usr/include/c++/14/istream:203:38: note: no known conversion for argument 1 from 'std::vector<std::__cxx11::basic_string<char> >' to 'long long unsigned int&'
203 | operator>>(unsigned long long& __n)
| ~~~~~~~~~~~~~~~~~~~~^~~
/usr/include/c++/14/istream:219:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(float&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]'
219 | operator>>(float& __f)
| ^~~~~~~~
/usr/include/c++/14/istream:219:25: note: no known conversion for argument 1 from 'std::vector<std::__cxx11::basic_string<char> >' to 'float&'
219 | operator>>(float& __f)
| ~~~~~~~^~~
/usr/include/c++/14/istream:223:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(double&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]'
223 | operator>>(double& __f)
| ^~~~~~~~
/usr/include/c++/14/istream:223:26: note: no known conversion for argument 1 from 'std::vector<std::__cxx11::basic_string<char> >' to 'double&'
223 | operator>>(double& __f)
| ~~~~~~~~^~~
/usr/include/c++/14/istream:227:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(long double&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]'
227 | operator>>(long double& __f)
| ^~~~~~~~
/usr/include/c++/14/istream:227:31: note: no known conversion for argument 1 from 'std::vector<std::__cxx11::basic_string<char> >' to 'long double&'
227 | operator>>(long double& __f)
| ~~~~~~~~~~~~~^~~
/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>]'
328 | operator>>(void*& __p)
| ^~~~~~~~
/usr/include/c++/14/istream:328:25: note: no known conversion for argument 1 from 'std::vector<std::__cxx11::basic_string<char> >' to 'void*&'
328 | operator>>(void*& __p)
| ~~~~~~~^~~
/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 'std::vector<std::__cxx11::basic_string<char> >' 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 'std::vector<std::__cxx11::basic_string<char> >' to 'std::basic_istream<char>::__ios_type& (*)(std::basic_istream<char>::__ios_type&)' {aka 'std::basic_ios<char>& (*)(std::basic_ios<char>&)'}
126 | operator>>(__ios_type& (*__pf)(__ios_type&))
| ~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~
/usr/include/c++/14/istream:133:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(std::ios_base& (*)(std::ios_base&)) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]'
133 | operator>>(ios_base& (*__pf)(ios_base&))
| ^~~~~~~~
/usr/include/c++/14/istream:133:30: note: no known |
s534032542 | 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<W ; i++){
cout << '#';
for(int j=0; j<H ; j++){
char a;
cin >> a ;
cout << a
}
cout << '#' << endl;
}
}
}
| a.cc: In function 'int main()':
a.cc:16:16: error: expected ';' before '}' token
16 | cout << a
| ^
| ;
17 | }
| ~
a.cc: At global scope:
a.cc:21:1: error: expected declaration before '}' token
21 | }
| ^
|
s656744273 | p03712 | C++ | #include<iostream>
#include<cstdio>
using namespace std;
int main(){
int h,w;
cin>>h>>w;
char a[h][w];
for(int i=0;i<h;i++){
scanf("%s",a[i]);
}
for(int i=0;i<w+2;i++){
print("#");
}
printf("\n");
for(int i=0;i<h;i++){
printf("#");
for(int j=0;j<w;j++){
printf("%s",a[i]);
}
printf("#\n");
}
for(int i=0;i<w+2;i++){
printf("#");
}
printf("\n");
return 0;
}
| a.cc: In function 'int main()':
a.cc:12:5: error: 'print' was not declared in this scope; did you mean 'printf'?
12 | print("#");
| ^~~~~
| printf
|
s091154832 | p03712 | C++ | #include<iosream>
#include<cstdio>
using namespace std;
int main(){
int h,w;
cin>>h>>w;
char a[h][w];
for(int i=0;i<h;i++){
scanf("%s",a[i]);
}
for(int i=0;i<w+2;i++){
print("#");
}
printf("\n");
for(int i=0;i<h;i++){
printf("#");
for(int j=0;j<w;j++){
printf("%s",a[i]);
}
printf("#\n");
}
for(int i=0;i<w+2;i++){
printf("#");
}
printf("\n");
return 0;
} | a.cc:1:9: fatal error: iosream: No such file or directory
1 | #include<iosream>
| ^~~~~~~~~
compilation terminated.
|
s374628672 | p03712 | C++ | #include<bits/stdc++.h>
using namespace std;
int main(){
int h,w;
vector<vector<char>> picture(h,vector<char>(w));
for(int i=0;i<h;i++){
for(int j=0;j<w;j++)
cin >> picture.at(i).at(j);
}
for(int i=0;i<w;i++)
cout << "#";
<< endl;
for(int i=0;i<h;i++){
cout << "#";
for(int j=0;j<w;j++)
cout << picture.at(i).at(j);
cout << "#" << endl;
}
for(int i=0;i<w;i++)
cout <<"#";
<< endl;
} | a.cc: In function 'int main()':
a.cc:14:3: error: expected primary-expression before '<<' token
14 | << endl;
| ^~
a.cc:25:3: error: expected primary-expression before '<<' token
25 | << endl;
| ^~
|
s767441435 | p03712 | C++ | #include <bits/stdc++.h>
using namespace std;
int main() {
int H,W; cin >> H >> W;
vector<char> cha((H+2)*(W+2));
for ( int i=0; i<(H+2); i++){
for ( int j=0; j<(W+2); j++){
cha[i][j]='#';
}
}
for ( int i=1; i<H+1; i++){
for ( int j=1; j<W+1; j++){
cin >> cha[i][j];
}
}
for ( int i=0; i<(H+2); i++){
for ( int j=0; j<(W+2); j++){
cout << cha[i][j];
}
cout << endl;
}
}
| a.cc: In function 'int main()':
a.cc:9:13: error: invalid types '__gnu_cxx::__alloc_traits<std::allocator<char>, char>::value_type {aka char}[int]' for array subscript
9 | cha[i][j]='#';
| ^
a.cc:14:20: error: invalid types '__gnu_cxx::__alloc_traits<std::allocator<char>, char>::value_type {aka char}[int]' for array subscript
14 | cin >> cha[i][j];
| ^
a.cc:19:21: error: invalid types '__gnu_cxx::__alloc_traits<std::allocator<char>, char>::value_type {aka char}[int]' for array subscript
19 | cout << cha[i][j];
| ^
|
s904451571 | p03712 | C++ | #include <bits/stdc++.h>
using namespace std;
int main() {
int h,w;
cin >> h >> w;
vector<string> disp(h);
for ( int i=0; i < h; i++){
cin >> disp[i];
}
for ( int i=0; i<(w+2); i++){
cout << '#';
}cout >> endl;
for ( int i=0; i < h; i++){
cout << '#'<< disp[i] << '#'<<endl;
}
for ( int i=0; i<(w+2); i++){
cout << '#';
}
}
| a.cc: In function 'int main()':
a.cc:14:9: error: no match for 'operator>>' (operand types are 'std::ostream' {aka 'std::basic_ostream<char>'} and '<unresolved overloaded function type>')
14 | }cout >> endl;
| ~~~~~^~~~~~~
In file included from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:41,
from a.cc:1:
/usr/include/c++/14/cstddef:131:5: note: candidate: 'template<class _IntegerType> constexpr std::__byte_op_t<_IntegerType> std::operator>>(byte, _IntegerType)'
131 | operator>>(byte __b, _IntegerType __shift) noexcept
| ^~~~~~~~
/usr/include/c++/14/cstddef:131:5: note: template argument deduction/substitution failed:
a.cc:14:12: note: couldn't deduce template parameter '_IntegerType'
14 | }cout >> endl;
| ^~~~
In file included from /usr/include/c++/14/string:55,
from /usr/include/c++/14/bitset:52,
from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:52:
/usr/include/c++/14/bits/basic_string.tcc:835:5: note: candidate: 'template<class _CharT, class _Traits, class _Alloc> std::basic_istream<_CharT, _Traits>& std::operator>>(basic_istream<_CharT, _Traits>&, __cxx11::basic_string<_CharT, _Traits, _Allocator>&)'
835 | operator>>(basic_istream<_CharT, _Traits>& __in,
| ^~~~~~~~
/usr/include/c++/14/bits/basic_string.tcc:835:5: note: template argument deduction/substitution failed:
a.cc:14:12: note: 'std::ostream' {aka 'std::basic_ostream<char>'} is not derived from 'std::basic_istream<_CharT, _Traits>'
14 | }cout >> endl;
| ^~~~
/usr/include/c++/14/bitset:1597:5: note: candidate: 'template<class _CharT, class _Traits, long unsigned int _Nb> std::basic_istream<_CharT, _Traits>& std::operator>>(basic_istream<_CharT, _Traits>&, bitset<_Nb>&)'
1597 | operator>>(std::basic_istream<_CharT, _Traits>& __is, bitset<_Nb>& __x)
| ^~~~~~~~
/usr/include/c++/14/bitset:1597:5: note: template argument deduction/substitution failed:
a.cc:14:12: note: 'std::ostream' {aka 'std::basic_ostream<char>'} is not derived from 'std::basic_istream<_CharT, _Traits>'
14 | }cout >> endl;
| ^~~~
In file included from /usr/include/c++/14/istream:1109,
from /usr/include/c++/14/sstream:40,
from /usr/include/c++/14/complex:45,
from /usr/include/c++/14/ccomplex:39,
from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:127:
/usr/include/c++/14/bits/istream.tcc:978:5: note: candidate: 'template<class _CharT, class _Traits> std::basic_istream<_CharT, _Traits>& std::operator>>(basic_istream<_CharT, _Traits>&, _CharT&)'
978 | operator>>(basic_istream<_CharT, _Traits>& __in, _CharT& __c)
| ^~~~~~~~
/usr/include/c++/14/bits/istream.tcc:978:5: note: template argument deduction/substitution failed:
a.cc:14:12: note: 'std::ostream' {aka 'std::basic_ostream<char>'} is not derived from 'std::basic_istream<_CharT, _Traits>'
14 | }cout >> endl;
| ^~~~
/usr/include/c++/14/istream:849:5: note: candidate: 'template<class _Traits> std::basic_istream<char, _Traits>& std::operator>>(basic_istream<char, _Traits>&, unsigned char&)'
849 | operator>>(basic_istream<char, _Traits>& __in, unsigned char& __c)
| ^~~~~~~~
/usr/include/c++/14/istream:849:5: note: template argument deduction/substitution failed:
a.cc:14:12: note: 'std::ostream' {aka 'std::basic_ostream<char>'} is not derived from 'std::basic_istream<char, _Traits>'
14 | }cout >> endl;
| ^~~~
/usr/include/c++/14/istream:854:5: note: candidate: 'template<class _Traits> std::basic_istream<char, _Traits>& std::operator>>(basic_istream<char, _Traits>&, signed char&)'
854 | operator>>(basic_istream<char, _Traits>& __in, signed char& __c)
| ^~~~~~~~
/usr/include/c++/14/istream:854:5: note: template argument deduction/substitution failed:
a.cc:14:12: note: 'std::ostream' {aka 'std::basic_ostream<char>'} is not derived from 'std::basic_istream<char, _Traits>'
14 | }cout >> endl;
| ^~~~
/usr/include/c++/14/istream:896:5: note: candidate: 'template<class _CharT, class _Traits> std::basic_istream<_CharT, _Traits>& std::operator>>(basic_istream<_CharT, _Traits>&, _CharT*)'
896 | operator>>(basic_istream<_CharT, _Traits>& __in, _CharT* __s)
| ^~~~~~~~
/usr/include/c++/14/istream:896:5: note: template argument deduction/substitution failed:
a.cc:14:12: note: 'std::ostream' {aka 'std::basic_ostream<char>'} is not derived from 'std::basic_istream<_CharT, _Traits>'
14 | }cout >> endl;
| ^~~~
/usr/include/c++/14/istream:939:5: note: candidate: 'template<class _Traits> std::basic_istream<char, _Traits>& std::operator>>(basic_istream<char, _Traits>&, unsigned char*)'
939 | operator>>(basic_istream<char, _Traits>& __in, unsigned char* __s)
| ^~~~~~~~
/usr/include/c++/14/istream:939:5: note: template argument deduction/substitution failed:
a.cc:14:12: note: 'std::ostream' {aka 'std::basic_ostream<char>'} is not derived from 'std::basic_istream<char, _Traits>'
14 | }cout >> endl;
| ^~~~
/usr/include/c++/14/istream:945:5: note: candidate: 'template<class _Traits> std::basic_istream<char, _Traits>& std::operator>>(basic_istream<char, _Traits>&, signed char*)'
945 | operator>>(basic_istream<char, _Traits>& __in, signed char* __s)
| ^~~~~~~~
/usr/include/c++/14/istream:945:5: note: template argument deduction/substitution failed:
a.cc:14:12: note: 'std::ostream' {aka 'std::basic_ostream<char>'} is not derived from 'std::basic_istream<char, _Traits>'
14 | }cout >> endl;
| ^~~~
/usr/include/c++/14/istream:1099:5: note: candidate: 'template<class _Istream, class _Tp> _Istream&& std::operator>>(_Istream&&, _Tp&&)'
1099 | operator>>(_Istream&& __is, _Tp&& __x)
| ^~~~~~~~
/usr/include/c++/14/istream:1099:5: note: template argument deduction/substitution failed:
a.cc:14:12: note: couldn't deduce template parameter '_Tp'
14 | }cout >> endl;
| ^~~~
/usr/include/c++/14/complex:509:5: note: candidate: 'template<class _Tp, class _CharT, class _Traits> std::basic_istream<_CharT, _Traits>& std::operator>>(basic_istream<_CharT, _Traits>&, complex<_Tp>&)'
509 | operator>>(basic_istream<_CharT, _Traits>& __is, complex<_Tp>& __x)
| ^~~~~~~~
/usr/include/c++/14/complex:509:5: note: template argument deduction/substitution failed:
a.cc:14:12: note: 'std::ostream' {aka 'std::basic_ostream<char>'} is not derived from 'std::basic_istream<_CharT, _Traits>'
14 | }cout >> endl;
| ^~~~
In file included from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:143:
/usr/include/c++/14/iomanip:76:5: note: candidate: 'template<class _CharT, class _Traits> std::basic_istream<_CharT, _Traits>& std::operator>>(basic_istream<_CharT, _Traits>&, _Resetiosflags)'
76 | operator>>(basic_istream<_CharT, _Traits>& __is, _Resetiosflags __f)
| ^~~~~~~~
/usr/include/c++/14/iomanip:76:5: note: template argument deduction/substitution failed:
a.cc:14:12: note: 'std::ostream' {aka 'std::basic_ostream<char>'} is not derived from 'std::basic_istream<_CharT, _Traits>'
14 | }cout >> endl;
| ^~~~
/usr/include/c++/14/iomanip:106:5: note: candidate: 'template<class _CharT, class _Traits> std::basic_istream<_CharT, _Traits>& std::operator>>(basic_istream<_CharT, _Traits>&, _Setiosflags)'
106 | operator>>(basic_istream<_CharT, _Traits>& __is, _Setiosflags __f)
| ^~~~~~~~
/usr/include/c++/14/iomanip:106:5: note: template argument deduction/substitution failed:
a.cc:14:12: note: 'std::ostream' {aka 'std::basic_ostream<char>'} is not derived from 'std::basic_istream<_CharT, _Traits>'
14 | }cout >> endl;
| ^~~~
/usr/include/c++/14/iomanip:137:5: note: candidate: 'template<class _CharT, class _Traits> std::basic_istream<_CharT, _Traits>& std::operator>>(basic_istream<_CharT, _Traits>&, _Setbase)'
137 | operator>>(basic_istream<_CharT, _Traits>& __is, _Setbase __f)
| ^~~~~~~~
/usr/include/c++/14/iomanip:137:5: note: template argument deduction/substitution failed:
a.cc:14:12: note: 'std::ostream' {aka 'std::basic_ostream<char>'} is not derived from 'std::basic_istream<_CharT, _Traits>'
14 | }cout >> endl;
| ^~~~
/usr/include/c++/14/iomanip:177:5: note: candidate: 'template<class _CharT, class _Traits> std::basic_istream<_CharT, _Traits>& std::operator>>(basic_istream<_CharT, _Traits>&, _Setfill<_CharT>)'
177 | operator>>(basic_istream<_CharT, _Traits>& __is, _Setfill<_CharT> __f)
| ^~~~~~~~
/usr/include/c++/14/iomanip:177:5: note: template argument deduction/substitution failed:
a.cc:14:12: note: 'std::ostream' {aka 'std::basic_ostream<char>'} is not derived from 'std::basic_istream<_CharT, _Traits>'
14 | }cout >> endl;
| ^~~~
/usr/include/c++/14/iomanip:207:5: note: candidate: 'template<class _CharT, class _Traits> std::basic_istream<_CharT, _Traits>& std::operator>>(basic_istream<_CharT, _Traits>&, _Setprecision)'
207 | operator>>(basic_istream<_CharT, _Traits>& __is, _Setprecision __f)
| ^~~~~~~~
/usr/include/c++/14/iomanip:207:5: note: template argument deduction/substitution failed:
a.cc:14:12: note: 'std::ostream' {aka 'std::basic_ostream<char>'} is not derived from 'std::basic_istream<_CharT, _Traits>'
14 | }cout >> endl;
| ^~~~
/usr/include/c++/14/iomanip:237:5: note: candidate: 'template<class _CharT, class _Traits> std::basic_istream<_CharT, _Traits>& std::operator>>(basic_istream<_CharT, _Traits>&, _Setw)'
237 | operator>>(basic_istream<_CharT, _Traits>& __is, _Setw __f)
| ^~~~~~~~
/usr/include/c++/14/iomanip:237:5: note: template argument deduction/substitution failed:
a.cc:14:12: note: 'std::ostream' {aka 'std::basic_ostream<char>'} is not derived from 'std::basic_istream<_CharT, _Traits>'
14 | }cout >> endl;
| ^~~~
/usr/include/c++/14/iomanip:271:5: note: candidate: 'template<class _CharT |
s777825858 | p03712 | C++ | #include <bits/stdc++.h>
using namespace std;
int main() {
cin >> h >> w;
vector<string> disp(h);
for ( int i=0; i < h; i++){
cin >> disp[i];
}
for ( int i=0; i<(w+2); i++){
cout >> '#';
}cout >> endl;
for ( int i=0; i < h; i++){
cout << '#'<< disp[i] << '#'<<endl;
}
for ( int i=0; i<(w+2); i++){
cout >> '#';
}
}
| a.cc: In function 'int main()':
a.cc:6:10: error: 'h' was not declared in this scope
6 | cin >> h >> w;
| ^
a.cc:6:15: error: 'w' was not declared in this scope
6 | cin >> h >> w;
| ^
a.cc:13:10: error: no match for 'operator>>' (operand types are 'std::ostream' {aka 'std::basic_ostream<char>'} and 'char')
13 | cout >> '#';
| ~~~~ ^~ ~~~
| | |
| | char
| std::ostream {aka std::basic_ostream<char>}
a.cc:13:10: note: candidate: 'operator>>(int, int)' (built-in)
13 | cout >> '#';
| ~~~~~^~~~~~
a.cc:13:10: note: no known conversion for argument 1 from 'std::ostream' {aka 'std::basic_ostream<char>'} to 'int'
In file included from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:41,
from a.cc:1:
/usr/include/c++/14/cstddef:131:5: note: candidate: 'template<class _IntegerType> constexpr std::__byte_op_t<_IntegerType> std::operator>>(byte, _IntegerType)'
131 | operator>>(byte __b, _IntegerType __shift) noexcept
| ^~~~~~~~
/usr/include/c++/14/cstddef:131:5: note: template argument deduction/substitution failed:
a.cc:13:5: note: cannot convert 'std::cout' (type 'std::ostream' {aka 'std::basic_ostream<char>'}) to type 'std::byte'
13 | cout >> '#';
| ^~~~
In file included from /usr/include/c++/14/string:55,
from /usr/include/c++/14/bitset:52,
from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:52:
/usr/include/c++/14/bits/basic_string.tcc:835:5: note: candidate: 'template<class _CharT, class _Traits, class _Alloc> std::basic_istream<_CharT, _Traits>& std::operator>>(basic_istream<_CharT, _Traits>&, __cxx11::basic_string<_CharT, _Traits, _Allocator>&)'
835 | operator>>(basic_istream<_CharT, _Traits>& __in,
| ^~~~~~~~
/usr/include/c++/14/bits/basic_string.tcc:835:5: note: template argument deduction/substitution failed:
a.cc:13:13: note: 'std::ostream' {aka 'std::basic_ostream<char>'} is not derived from 'std::basic_istream<_CharT, _Traits>'
13 | cout >> '#';
| ^~~
/usr/include/c++/14/bitset:1597:5: note: candidate: 'template<class _CharT, class _Traits, long unsigned int _Nb> std::basic_istream<_CharT, _Traits>& std::operator>>(basic_istream<_CharT, _Traits>&, bitset<_Nb>&)'
1597 | operator>>(std::basic_istream<_CharT, _Traits>& __is, bitset<_Nb>& __x)
| ^~~~~~~~
/usr/include/c++/14/bitset:1597:5: note: template argument deduction/substitution failed:
a.cc:13:13: note: 'std::ostream' {aka 'std::basic_ostream<char>'} is not derived from 'std::basic_istream<_CharT, _Traits>'
13 | cout >> '#';
| ^~~
In file included from /usr/include/c++/14/istream:1109,
from /usr/include/c++/14/sstream:40,
from /usr/include/c++/14/complex:45,
from /usr/include/c++/14/ccomplex:39,
from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:127:
/usr/include/c++/14/bits/istream.tcc:978:5: note: candidate: 'template<class _CharT, class _Traits> std::basic_istream<_CharT, _Traits>& std::operator>>(basic_istream<_CharT, _Traits>&, _CharT&)'
978 | operator>>(basic_istream<_CharT, _Traits>& __in, _CharT& __c)
| ^~~~~~~~
/usr/include/c++/14/bits/istream.tcc:978:5: note: template argument deduction/substitution failed:
a.cc:13:13: note: 'std::ostream' {aka 'std::basic_ostream<char>'} is not derived from 'std::basic_istream<_CharT, _Traits>'
13 | cout >> '#';
| ^~~
/usr/include/c++/14/istream:849:5: note: candidate: 'template<class _Traits> std::basic_istream<char, _Traits>& std::operator>>(basic_istream<char, _Traits>&, unsigned char&)'
849 | operator>>(basic_istream<char, _Traits>& __in, unsigned char& __c)
| ^~~~~~~~
/usr/include/c++/14/istream:849:5: note: template argument deduction/substitution failed:
a.cc:13:13: note: 'std::ostream' {aka 'std::basic_ostream<char>'} is not derived from 'std::basic_istream<char, _Traits>'
13 | cout >> '#';
| ^~~
/usr/include/c++/14/istream:854:5: note: candidate: 'template<class _Traits> std::basic_istream<char, _Traits>& std::operator>>(basic_istream<char, _Traits>&, signed char&)'
854 | operator>>(basic_istream<char, _Traits>& __in, signed char& __c)
| ^~~~~~~~
/usr/include/c++/14/istream:854:5: note: template argument deduction/substitution failed:
a.cc:13:13: note: 'std::ostream' {aka 'std::basic_ostream<char>'} is not derived from 'std::basic_istream<char, _Traits>'
13 | cout >> '#';
| ^~~
/usr/include/c++/14/istream:896:5: note: candidate: 'template<class _CharT, class _Traits> std::basic_istream<_CharT, _Traits>& std::operator>>(basic_istream<_CharT, _Traits>&, _CharT*)'
896 | operator>>(basic_istream<_CharT, _Traits>& __in, _CharT* __s)
| ^~~~~~~~
/usr/include/c++/14/istream:896:5: note: template argument deduction/substitution failed:
a.cc:13:13: note: 'std::ostream' {aka 'std::basic_ostream<char>'} is not derived from 'std::basic_istream<_CharT, _Traits>'
13 | cout >> '#';
| ^~~
/usr/include/c++/14/istream:939:5: note: candidate: 'template<class _Traits> std::basic_istream<char, _Traits>& std::operator>>(basic_istream<char, _Traits>&, unsigned char*)'
939 | operator>>(basic_istream<char, _Traits>& __in, unsigned char* __s)
| ^~~~~~~~
/usr/include/c++/14/istream:939:5: note: template argument deduction/substitution failed:
a.cc:13:13: note: 'std::ostream' {aka 'std::basic_ostream<char>'} is not derived from 'std::basic_istream<char, _Traits>'
13 | cout >> '#';
| ^~~
/usr/include/c++/14/istream:945:5: note: candidate: 'template<class _Traits> std::basic_istream<char, _Traits>& std::operator>>(basic_istream<char, _Traits>&, signed char*)'
945 | operator>>(basic_istream<char, _Traits>& __in, signed char* __s)
| ^~~~~~~~
/usr/include/c++/14/istream:945:5: note: template argument deduction/substitution failed:
a.cc:13:13: note: 'std::ostream' {aka 'std::basic_ostream<char>'} is not derived from 'std::basic_istream<char, _Traits>'
13 | cout >> '#';
| ^~~
/usr/include/c++/14/istream:1099:5: note: candidate: 'template<class _Istream, class _Tp> _Istream&& std::operator>>(_Istream&&, _Tp&&)'
1099 | operator>>(_Istream&& __is, _Tp&& __x)
| ^~~~~~~~
/usr/include/c++/14/istream:1099:5: note: template argument deduction/substitution failed:
/usr/include/c++/14/istream: In substitution of 'template<class _Istream, class _Tp> _Istream&& std::operator>>(_Istream&&, _Tp&&) [with _Istream = std::basic_ostream<char>&; _Tp = char]':
a.cc:13:13: required from here
13 | cout >> '#';
| ^~~
/usr/include/c++/14/istream:1099:5: error: no type named 'type' in 'struct std::enable_if<false, void>'
1099 | operator>>(_Istream&& __is, _Tp&& __x)
| ^~~~~~~~
/usr/include/c++/14/complex:509:5: note: candidate: 'template<class _Tp, class _CharT, class _Traits> std::basic_istream<_CharT, _Traits>& std::operator>>(basic_istream<_CharT, _Traits>&, complex<_Tp>&)'
509 | operator>>(basic_istream<_CharT, _Traits>& __is, complex<_Tp>& __x)
| ^~~~~~~~
/usr/include/c++/14/complex:509:5: note: template argument deduction/substitution failed:
a.cc:13:13: note: 'std::ostream' {aka 'std::basic_ostream<char>'} is not derived from 'std::basic_istream<_CharT, _Traits>'
13 | cout >> '#';
| ^~~
In file included from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:143:
/usr/include/c++/14/iomanip:76:5: note: candidate: 'template<class _CharT, class _Traits> std::basic_istream<_CharT, _Traits>& std::operator>>(basic_istream<_CharT, _Traits>&, _Resetiosflags)'
76 | operator>>(basic_istream<_CharT, _Traits>& __is, _Resetiosflags __f)
| ^~~~~~~~
/usr/include/c++/14/iomanip:76:5: note: template argument deduction/substitution failed:
a.cc:13:13: note: 'std::ostream' {aka 'std::basic_ostream<char>'} is not derived from 'std::basic_istream<_CharT, _Traits>'
13 | cout >> '#';
| ^~~
/usr/include/c++/14/iomanip:106:5: note: candidate: 'template<class _CharT, class _Traits> std::basic_istream<_CharT, _Traits>& std::operator>>(basic_istream<_CharT, _Traits>&, _Setiosflags)'
106 | operator>>(basic_istream<_CharT, _Traits>& __is, _Setiosflags __f)
| ^~~~~~~~
/usr/include/c++/14/iomanip:106:5: note: template argument deduction/substitution failed:
a.cc:13:13: note: 'std::ostream' {aka 'std::basic_ostream<char>'} is not derived from 'std::basic_istream<_CharT, _Traits>'
13 | cout >> '#';
| ^~~
/usr/include/c++/14/iomanip:137:5: note: candidate: 'template<class _CharT, class _Traits> std::basic_istream<_CharT, _Traits>& std::operator>>(basic_istream<_CharT, _Traits>&, _Setbase)'
137 | operator>>(basic_istream<_CharT, _Traits>& __is, _Setbase __f)
| ^~~~~~~~
/usr/include/c++/14/iomanip:137:5: note: template argument deduction/substitution failed:
a.cc:13:13: note: 'std::ostream' {aka 'std::basic_ostream<char>'} is not derived from 'std::basic_istream<_CharT, _Traits>'
13 | cout >> '#';
| ^~~
/usr/include/c++/14/iomanip:177:5: note: candidate: 'template<class _CharT, class _Traits> std::basic_istream<_CharT, _Traits>& std::operator>>(basic_istream<_CharT, _Traits>&, _Setfill<_CharT>)'
177 | operator>>(basic_istream<_CharT, _Traits>& __is, _Setfill<_CharT> __f)
| ^~~~~~~~
/usr/include/c++/14/iomanip:177:5: note: template argument deduction/substitution failed:
a.cc:13:13: note: 'std::ostream' {aka 'std::basic_ostream<char>'} is not derived from 'std::basic_istream<_CharT, _Traits>'
13 | cout >> '#';
| ^~~
/usr/include/c++/14/iomanip:207:5: note: candidate: 'template<class _CharT, class _Traits> std::basic_istream<_CharT, _Traits>& std::operator>>(basic_istream<_CharT, _Traits>&, _Setprecision)'
207 | operator>>(basic_istream<_CharT, _Traits>& __is, _Setprecision __f)
| ^~~~~~~~
/usr/i |
s569890363 | p03712 | C++ | #include <bits/stdc++.h>
using namespace std;
int main() {
int H, W;
cin >> H >> W;
for (int i; i < W; i++){
cout << "#";
}
endl;
for (int i; i < H; i++){
for (int j; j < W; j++){
cout << "#";
vector<int> vec;
cin >> vec.at(j);
cout << vec.at(j);
}
cout << "#" << endl;
}
for (int i; i < W; i++){
cout << "#";
}
endl;
}
| a.cc: In function 'int main()':
a.cc:10:7: error: statement cannot resolve address of overloaded function
10 | endl;
| ^
a.cc:23:7: error: statement cannot resolve address of overloaded function
23 | endl;
| ^
|
s885618039 | p03712 | C++ | #include <bits/stdc++.h>
using namespace std;
int main() {
int H, W;
cin >> H >> W;
for (int i; i < W; i++){
cout << "#";
}
endl;
for (int i; i < H; i++){
for (int j; j < W; j++){
cout << "#";
vector<int> vec;
cin >> vec(j);
cout << vec(j);
}
cout << "#" << endl;
}
for (int i; i < W; i++){
cout << "#";
}
endl;
}
| a.cc: In function 'int main()':
a.cc:10:7: error: statement cannot resolve address of overloaded function
10 | endl;
| ^
a.cc:15:17: error: no match for call to '(std::vector<int>) (int&)'
15 | cin >> vec(j);
| ~~~^~~
a.cc:16:18: error: no match for call to '(std::vector<int>) (int&)'
16 | cout << vec(j);
| ~~~^~~
a.cc:23:7: error: statement cannot resolve address of overloaded function
23 | endl;
| ^
|
s210659714 | p03712 | C++ | #include <bits/stdc++.h>
using namespace std;
int main() {
int H,W;
cin >> H >> W;
for(int i = 0 ; i < W ; i++){
cout << '#';
}
cout << endl;
for(int i = 0 ; i < H ; i++){
cout << '#' << cin << '#' << endl;
}
for(int i = 0 ; i < W ; i++){
cout << '#';
}
cout << endl;
}
| a.cc: In function 'int main()':
a.cc:14:17: error: no match for 'operator<<' (operand types are 'std::basic_ostream<char>' and 'std::istream' {aka 'std::basic_istream<char>'})
14 | cout << '#' << cin << '#' << endl;
| ~~~~~~~~~~~ ^~ ~~~
| | |
| | std::istream {aka std::basic_istream<char>}
| std::basic_ostream<char>
a.cc:14:17: note: candidate: 'operator<<(int, int)' (built-in)
14 | cout << '#' << cin << '#' << endl;
| ~~~~~~~~~~~~^~~~~~
a.cc:14:17: note: no known conversion for argument 2 from 'std::istream' {aka 'std::basic_istream<char>'} to 'int'
In file included from /usr/include/c++/14/istream:41,
from /usr/include/c++/14/sstream:40,
from /usr/include/c++/14/complex:45,
from /usr/include/c++/14/ccomplex:39,
from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:127,
from a.cc:1:
/usr/include/c++/14/ostream:116:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(__ostream_type& (*)(__ostream_type&)) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>]'
116 | operator<<(__ostream_type& (*__pf)(__ostream_type&))
| ^~~~~~~~
/usr/include/c++/14/ostream:116:36: note: no known conversion for argument 1 from 'std::istream' {aka 'std::basic_istream<char>'} to 'std::basic_ostream<char>::__ostream_type& (*)(std::basic_ostream<char>::__ostream_type&)' {aka 'std::basic_ostream<char>& (*)(std::basic_ostream<char>&)'}
116 | operator<<(__ostream_type& (*__pf)(__ostream_type&))
| ~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~
/usr/include/c++/14/ostream:125:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(__ios_type& (*)(__ios_type&)) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>; __ios_type = std::basic_ios<char>]'
125 | operator<<(__ios_type& (*__pf)(__ios_type&))
| ^~~~~~~~
/usr/include/c++/14/ostream:125:32: note: no known conversion for argument 1 from 'std::istream' {aka 'std::basic_istream<char>'} to 'std::basic_ostream<char>::__ios_type& (*)(std::basic_ostream<char>::__ios_type&)' {aka 'std::basic_ios<char>& (*)(std::basic_ios<char>&)'}
125 | operator<<(__ios_type& (*__pf)(__ios_type&))
| ~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~
/usr/include/c++/14/ostream:135:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(std::ios_base& (*)(std::ios_base&)) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>]'
135 | operator<<(ios_base& (*__pf) (ios_base&))
| ^~~~~~~~
/usr/include/c++/14/ostream:135:30: note: no known conversion for argument 1 from 'std::istream' {aka 'std::basic_istream<char>'} to 'std::ios_base& (*)(std::ios_base&)'
135 | operator<<(ios_base& (*__pf) (ios_base&))
| ~~~~~~~~~~~~^~~~~~~~~~~~~~~~~
/usr/include/c++/14/ostream:174:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(long int) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>]'
174 | operator<<(long __n)
| ^~~~~~~~
/usr/include/c++/14/ostream:174:23: note: no known conversion for argument 1 from 'std::istream' {aka 'std::basic_istream<char>'} to 'long int'
174 | operator<<(long __n)
| ~~~~~^~~
/usr/include/c++/14/ostream:178:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(long unsigned int) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>]'
178 | operator<<(unsigned long __n)
| ^~~~~~~~
/usr/include/c++/14/ostream:178:32: note: no known conversion for argument 1 from 'std::istream' {aka 'std::basic_istream<char>'} to 'long unsigned int'
178 | operator<<(unsigned long __n)
| ~~~~~~~~~~~~~~^~~
/usr/include/c++/14/ostream:182:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(bool) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>]'
182 | operator<<(bool __n)
| ^~~~~~~~
/usr/include/c++/14/ostream:182:23: note: no known conversion for argument 1 from 'std::istream' {aka 'std::basic_istream<char>'} to 'bool'
182 | operator<<(bool __n)
| ~~~~~^~~
In file included from /usr/include/c++/14/ostream:1022:
/usr/include/c++/14/bits/ostream.tcc:96:5: note: candidate: 'std::basic_ostream<_CharT, _Traits>& std::basic_ostream<_CharT, _Traits>::operator<<(short int) [with _CharT = char; _Traits = std::char_traits<char>]'
96 | basic_ostream<_CharT, _Traits>::
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/c++/14/bits/ostream.tcc:97:22: note: no known conversion for argument 1 from 'std::istream' {aka 'std::basic_istream<char>'} to 'short int'
97 | operator<<(short __n)
| ~~~~~~^~~
/usr/include/c++/14/ostream:189:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(short unsigned int) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>]'
189 | operator<<(unsigned short __n)
| ^~~~~~~~
/usr/include/c++/14/ostream:189:33: note: no known conversion for argument 1 from 'std::istream' {aka 'std::basic_istream<char>'} to 'short unsigned int'
189 | operator<<(unsigned short __n)
| ~~~~~~~~~~~~~~~^~~
/usr/include/c++/14/bits/ostream.tcc:110:5: note: candidate: 'std::basic_ostream<_CharT, _Traits>& std::basic_ostream<_CharT, _Traits>::operator<<(int) [with _CharT = char; _Traits = std::char_traits<char>]'
110 | basic_ostream<_CharT, _Traits>::
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/c++/14/bits/ostream.tcc:111:20: note: no known conversion for argument 1 from 'std::istream' {aka 'std::basic_istream<char>'} to 'int'
111 | operator<<(int __n)
| ~~~~^~~
/usr/include/c++/14/ostream:200:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(unsigned int) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>]'
200 | operator<<(unsigned int __n)
| ^~~~~~~~
/usr/include/c++/14/ostream:200:31: note: no known conversion for argument 1 from 'std::istream' {aka 'std::basic_istream<char>'} to 'unsigned int'
200 | operator<<(unsigned int __n)
| ~~~~~~~~~~~~~^~~
/usr/include/c++/14/ostream:211:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(long long int) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>]'
211 | operator<<(long long __n)
| ^~~~~~~~
/usr/include/c++/14/ostream:211:28: note: no known conversion for argument 1 from 'std::istream' {aka 'std::basic_istream<char>'} to 'long long int'
211 | operator<<(long long __n)
| ~~~~~~~~~~^~~
/usr/include/c++/14/ostream:215:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(long long unsigned int) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>]'
215 | operator<<(unsigned long long __n)
| ^~~~~~~~
/usr/include/c++/14/ostream:215:37: note: no known conversion for argument 1 from 'std::istream' {aka 'std::basic_istream<char>'} to 'long long unsigned int'
215 | operator<<(unsigned long long __n)
| ~~~~~~~~~~~~~~~~~~~^~~
/usr/include/c++/14/ostream:231:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(double) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>]'
231 | operator<<(double __f)
| ^~~~~~~~
/usr/include/c++/14/ostream:231:25: note: no known conversion for argument 1 from 'std::istream' {aka 'std::basic_istream<char>'} to 'double'
231 | operator<<(double __f)
| ~~~~~~~^~~
/usr/include/c++/14/ostream:235:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(float) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>]'
235 | operator<<(float __f)
| ^~~~~~~~
/usr/include/c++/14/ostream:235:24: note: no known conversion for argument 1 from 'std::istream' {aka 'std::basic_istream<char>'} to 'float'
235 | operator<<(float __f)
| ~~~~~~^~~
/usr/include/c++/14/ostream:243:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(long double) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>]'
243 | operator<<(long double __f)
| ^~~~~~~~
/usr/include/c++/14/ostream:243:30: note: no known conversion for argument 1 from 'std::istream' {aka 'std::basic_istream<char>'} to 'long double'
243 | operator<<(long double __f)
| ~~~~~~~~~~~~^~~
/usr/include/c++/14/ostream:301:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(const void*) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>]'
301 | operator<<(const void* __p)
| ^~~~ |
s608800881 | p03712 | C++ | #include <bits/stdc++.h>
using namespace std;
int main() {
int H,W;
cin >> H >> W;
string a;
for(int i = 0; i < W + 2; i++){
cout << '#';
}
cout << endl;
for(int = 0; i < H; i++){
cout << '#';
cin >> a;
cout << '#' << endl;
}
for(int i = 0; i < W + 2; i++){
cout << '#';
}
cout << endl;
} | a.cc: In function 'int main()':
a.cc:12:11: error: expected unqualified-id before '=' token
12 | for(int = 0; i < H; i++){
| ^
a.cc:12:10: error: expected ';' before '=' token
12 | for(int = 0; i < H; i++){
| ^~
| ;
a.cc:12:11: error: expected primary-expression before '=' token
12 | for(int = 0; i < H; i++){
| ^
a.cc:12:16: error: 'i' was not declared in this scope
12 | for(int = 0; i < H; i++){
| ^
a.cc:12:21: error: expected ')' before ';' token
12 | for(int = 0; i < H; i++){
| ~ ^
| )
a.cc:12:23: error: 'i' was not declared in this scope
12 | for(int = 0; i < H; i++){
| ^
|
s854585557 | p03712 | C++ | #include <bits/stdc++.h>
using namespace std;
int main() {
int H,W;
cin >> H >> W;
for(int i = 0; i < W; i++){
string l = "##";
l += "#";
}
cout << l << endl;
vector<string> line(H);
for(int i = 0; i < H; i++){
cin >> line.at(i);
cout << "#" << line.at(i) << "#" << endl;
}
cout << l << endl;
}
| a.cc: In function 'int main()':
a.cc:13:11: error: 'l' was not declared in this scope
13 | cout << l << endl;
| ^
|
s364730810 | p03712 | C++ | #include <bits/stdc++.h>
using namespace std;
int main() {
int H,W;
cin >> H >> W;
for(int i = 0; i < W; i++){
string l = "##";
l += "#";
}
cout << l << endl;
vector<string> line(W);
for(int i = 0; i < W; i++){
cin >> line.at(i);
cout << "#" << line.at(i) << "#" << endl;
}
cout << l << endl;
}
| a.cc: In function 'int main()':
a.cc:13:11: error: 'l' was not declared in this scope
13 | cout << l << endl;
| ^
|
s696108957 | p03712 | C++ | #include <bits/stdc++.h>
using namespace std;
int main(){
int h, w;
scan("%d%d", &h, &w);
for(int i = 0; i < w + 2; i++)
printf("#");
printf("\n");
for(int i = 0; i < h; i++) {
for(int i = 0; i < w + 2; i++) {
int x;
if(i == 0 || i == w + 1) printf("#");
else {
scanf("%d", &x);
printf("%d", x);
}
}
printf("\n");
}
for(int i = 0; i < w + 2; i++)
printf("#");
printf("\n");
}
| a.cc: In function 'int main()':
a.cc:6:9: error: 'scan' was not declared in this scope; did you mean 'scanf'?
6 | scan("%d%d", &h, &w);
| ^~~~
| scanf
|
s835591457 | p03712 | C++ | #include <bits/stdc++.h>
using namespace std;
int main() {
int h, w;
cin >> h >> w;
char a[h][w], b[h+2][j+2];
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++) {
cin >> a[i][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:7:24: error: 'j' was not declared in this scope
7 | char a[h][w], b[h+2][j+2];
| ^
a.cc:11:7: error: 'b' was not declared in this scope
11 | b[i][j] = '#';
| ^
a.cc:17:7: error: 'b' was not declared in this scope
17 | b[i+1][j+1] = a[i][j];
| ^
a.cc:22:15: error: 'b' was not declared in this scope
22 | cout << b[i][j];
| ^
|
s136629785 | p03712 | C++ | #include <bits/stdc++.h>
using namespace std;
int main() {
int h, w;
cin >> h >> w;
char a[i][j], b[i+2][j+2];
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++) {
cin >> a[i][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:7:10: error: 'i' was not declared in this scope
7 | char a[i][j], b[i+2][j+2];
| ^
a.cc:7:13: error: 'j' was not declared in this scope
7 | char a[i][j], b[i+2][j+2];
| ^
a.cc:11:7: error: 'b' was not declared in this scope
11 | b[i][j] = '#';
| ^
a.cc:16:14: error: 'a' was not declared in this scope
16 | cin >> a[i][j];
| ^
a.cc:17:7: error: 'b' was not declared in this scope
17 | b[i+1][j+1] = a[i][j];
| ^
a.cc:22:15: error: 'b' was not declared in this scope
22 | cout << b[i][j];
| ^
|
s993327070 | p03712 | C++ | #include <bits\stdc++.h>
using namespace std;
int main(){
int H,W;
cin >> H >> W ;
vector<string> vec(H);
for(int i=0;i<H;i++){
cin >> vec.at(i);
}
for(int i=0;i<W+2;i++){
cout << '#';
}
cout << endl;
for(int i=0;i<H;i++){
cout << '#' << vec.at(i) << '#' << endl;
}
for(int i=0;i<W+2;i++){
cout << '#';
}
cout << endl;
} | a.cc:1:10: fatal error: bits\stdc++.h: No such file or directory
1 | #include <bits\stdc++.h>
| ^~~~~~~~~~~~~~~
compilation terminated.
|
s258061734 | p03712 | C++ | #include <bits/stdc++.h>
using namespace std;
int main() {
int H ,W;
cin >> H >> W ;
for(int i = 0; i < W ; i++){
cout << "#" ;
}
for(int i = 1 ; i <= H; i++){
vector<int> vec;
cout << "#" << for(int r = 0; r < W; r++)
{cout << vec.at(i);
}
<< "#"<< endl;
}
for(int i = 0; i < W ; i++){
cout << "#" ;
}
} | a.cc: In function 'int main()':
a.cc:12:20: error: expected primary-expression before 'for'
12 | cout << "#" << for(int r = 0; r < W; r++)
| ^~~
a.cc:12:35: error: 'r' was not declared in this scope
12 | cout << "#" << for(int r = 0; r < W; r++)
| ^
a.cc:15:5: error: expected primary-expression before '<<' token
15 | << "#"<< endl;
| ^~
|
s989599979 | p03712 | C++ | include <bits/stdc++.h>
using namespace std;
int main(){
int H,W; cin >> H >> W;
string tmp;
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 {
cin >> tmp;
cout << "#" << tmp << "#" << endl;
}
}
return 0;
} | a.cc:1:1: error: 'include' does not name a type
1 | include <bits/stdc++.h>
| ^~~~~~~
a.cc: In function 'int main()':
a.cc:5:14: error: 'cin' was not declared in this scope
5 | int H,W; cin >> H >> W;
| ^~~
a.cc:6:5: error: 'string' was not declared in this scope
6 | string tmp;
| ^~~~~~
a.cc:9:45: error: 'cout' was not declared in this scope
9 | for (int j = 0; j < W + 2; ++j) cout << "#";
| ^~~~
a.cc:10:13: error: 'cout' was not declared in this scope
10 | cout << endl;
| ^~~~
a.cc:10:21: error: 'endl' was not declared in this scope
10 | cout << endl;
| ^~~~
a.cc:12:20: error: 'tmp' was not declared in this scope
12 | cin >> tmp;
| ^~~
a.cc:13:13: error: 'cout' was not declared in this scope
13 | cout << "#" << tmp << "#" << endl;
| ^~~~
a.cc:13:42: error: 'endl' was not declared in this scope
13 | cout << "#" << tmp << "#" << endl;
| ^~~~
|
s961884184 | 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) >> endl;
}
W += 2;
for(int i=0; i<W; i++) {
cout << "#";
}
cout << endl;
for(int i=0; i<H; i++) {
cout << "#" << pic.at(i) << "#" << endl;
}
for(int i=0; i<W; i++) {
cout << "#";
}
cout << endl;
}
| a.cc: In function 'int main()':
a.cc:10:22: error: no match for 'operator>>' (operand types are 'std::basic_istream<char>' and '<unresolved overloaded function type>')
10 | cin >> pic.at(i) >> endl;
| ~~~~~~~~~~~~~~~~~^~~~~~~
In file included from /usr/include/c++/14/sstream:40,
from /usr/include/c++/14/complex:45,
from /usr/include/c++/14/ccomplex:39,
from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:127,
from a.cc:1:
/usr/include/c++/14/istream:170:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(bool&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]'
170 | operator>>(bool& __n)
| ^~~~~~~~
/usr/include/c++/14/istream:170:24: note: no known conversion for argument 1 from '<unresolved overloaded function type>' to 'bool&'
170 | operator>>(bool& __n)
| ~~~~~~^~~
/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>]'
174 | operator>>(short& __n);
| ^~~~~~~~
/usr/include/c++/14/istream:174:25: note: no known conversion for argument 1 from '<unresolved overloaded function type>' to 'short int&'
174 | operator>>(short& __n);
| ~~~~~~~^~~
/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>]'
177 | operator>>(unsigned short& __n)
| ^~~~~~~~
/usr/include/c++/14/istream:177:34: note: no known conversion for argument 1 from '<unresolved overloaded function type>' to 'short unsigned int&'
177 | operator>>(unsigned short& __n)
| ~~~~~~~~~~~~~~~~^~~
/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>]'
181 | operator>>(int& __n);
| ^~~~~~~~
/usr/include/c++/14/istream:181:23: note: no known conversion for argument 1 from '<unresolved overloaded function type>' to 'int&'
181 | operator>>(int& __n);
| ~~~~~^~~
/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>]'
184 | operator>>(unsigned int& __n)
| ^~~~~~~~
/usr/include/c++/14/istream:184:32: note: no known conversion for argument 1 from '<unresolved overloaded function type>' to 'unsigned int&'
184 | operator>>(unsigned int& __n)
| ~~~~~~~~~~~~~~^~~
/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>]'
188 | operator>>(long& __n)
| ^~~~~~~~
/usr/include/c++/14/istream:188:24: note: no known conversion for argument 1 from '<unresolved overloaded function type>' to 'long int&'
188 | operator>>(long& __n)
| ~~~~~~^~~
/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>]'
192 | operator>>(unsigned long& __n)
| ^~~~~~~~
/usr/include/c++/14/istream:192:33: note: no known conversion for argument 1 from '<unresolved overloaded function type>' to 'long unsigned int&'
192 | operator>>(unsigned long& __n)
| ~~~~~~~~~~~~~~~^~~
/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>]'
199 | operator>>(long long& __n)
| ^~~~~~~~
/usr/include/c++/14/istream:199:29: note: no known conversion for argument 1 from '<unresolved overloaded function type>' to 'long long int&'
199 | operator>>(long long& __n)
| ~~~~~~~~~~~^~~
/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>]'
203 | operator>>(unsigned long long& __n)
| ^~~~~~~~
/usr/include/c++/14/istream:203:38: note: no known conversion for argument 1 from '<unresolved overloaded function type>' to 'long long unsigned int&'
203 | operator>>(unsigned long long& __n)
| ~~~~~~~~~~~~~~~~~~~~^~~
/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 '<unresolved overloaded function type>' 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 '<unresolved overloaded function type>' 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 '<unresolved overloaded function type>' to 'long double&'
227 | operator>>(long double& __f)
| ~~~~~~~~~~~~~^~~
/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>]'
328 | operator>>(void*& __p)
| ^~~~~~~~
/usr/include/c++/14/istream:328:25: note: no known conversion for argument 1 from '<unresolved overloaded function type>' to 'void*&'
328 | operator>>(void*& __p)
| ~~~~~~~^~~
/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 '<unresolved overloaded function type>' 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 '<unresolved overloaded function type>' to 'std::basic_istream<char>::__ios_type& (*)(std::basic_istream<char>::__ios_type&)' {aka 'std::basic_ios<char>& (*)(std::basic_ios<char>&)'}
126 | operator>>(__ios_type& (*__pf)(__ios_type&))
| ~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~
/usr/include/c++/14/istream:133:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(std::ios_base& (*)(std::ios_base&)) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]'
133 | operator>>(ios_base& (*__pf)(ios_base&))
| ^~~~~~~~
/usr/include/c++/14/istream:133:30: note: no known conversion for argument 1 from '<unresolved overloaded function type>' to 'std::ios_base& (*)(std::ios_base&)'
133 | operator>>(ios_base& (*__pf)(ios_base&))
| ~~~~~~~~~~~~^~~~~~~~~~~~~~~~
/usr/include/c++/14/istream:352:7: note: candidate: 'std::basic_istream<_CharT, _Traits>& std::basic_istream<_CharT, _Traits>::operator>>(__streambuf_type*) [with _CharT = char; _Traits = std::char_traits<char>; __streambuf_type = std::basic_streambuf<char>]'
352 | operator>>(__streambuf_type* __sb);
| ^~~~~~~~
/usr/include/c++/14/istream:352:36: note: no known conversion for argument 1 from '<unresolved overloaded function type>' to 's |
s751862940 | p03712 | C++ | #include <bits/stdc++.h>
using namespace std;
int main() {
int H, W;
cin >> H >> W;
vector<string> pic(H);
for (i=0; i<H; i++){
cin >> pic.at(i) >> endl;
}
W += 2;
for(i=0; i<W; i++) {
cout << "#";
}
cout << endl;
for(i=0; i<H; i++) {
cout << "#" << pic.at(i) << "#" << endl;
}
for(i=0; i<W; i++) {
cout << "#";
}
cout << endl;
}
| a.cc: In function 'int main()':
a.cc:9:8: error: 'i' was not declared in this scope
9 | for (i=0; i<H; i++){
| ^
a.cc:15:7: error: 'i' was not declared in this scope
15 | for(i=0; i<W; i++) {
| ^
a.cc:20:7: error: 'i' was not declared in this scope
20 | for(i=0; i<H; i++) {
| ^
a.cc:24:7: error: 'i' was not declared in this scope
24 | for(i=0; i<W; i++) {
| ^
|
s506677434 | p03712 | C++ | #include <bits/stdc++.h>
using namespace std;
#define rep(i,n) for(int i=0;(int)(n);i++)
int main() {
int H,W;
cin >> H >> W;
vector<char> vec((W+2)*(H+2));
int i=0;
rep(i,H+2){
rep(j,W+2){
if(i==0||(i==H+1){
vec.at(i*(W+2)+j) = '#';
}
else{
if(j==0||j==W+1)
vec.at(i*(W+2)+j) = '#';
else
cin >> vec.at(i*(W+2)+j);
}
}
}
rep(i,H+2){
rep(j,W+2){
cout << vec.at(i*(W+2)+j);
}
cout << endl;
}
}
| a.cc: In function 'int main()':
a.cc:13:24: error: expected ')' before '{' token
13 | if(i==0||(i==H+1){
| ~ ^
| )
a.cc:22:5: error: expected primary-expression before '}' token
22 | }
| ^
|
s531675405 | p03712 | C++ | #include <bits/stdc++.h>
using namespace std;
#define rep(i,n) for(int i=0;(int)(n);i++)
int main() {
int H,W;
cin >> H >> W;
vector<char> vec((W+2)*(H+2));
int i=0;
rep(i,H+2){
rep(j,W+2){
if(i=0||i=H+1){
vec.at(i*(W+2)+j) = '#';
}
else{
if(j=0||j=W+1)
vec.at(i*(W+2)+j) = '#';
else
cin >> vec.at(i*(W+2)+j);
}
}
}
rep(i,H+2){
rep(j,W+2){
cout << vec.at(i*(W+2)+j);
}
cout << endl;
}
}
| a.cc: In function 'int main()':
a.cc:13:13: error: lvalue required as left operand of assignment
13 | if(i=0||i=H+1){
| ~^~~
a.cc:17:15: error: lvalue required as left operand of assignment
17 | if(j=0||j=W+1)
| ~^~~
|
s568227509 | p03712 | C++ | #include <bits/stdc++.h>
using namespace std;
int main() {
int H,W;
cin >> H>>W;
vector<string> vec(H);
for(int i=0;i<H;i++){
cin >> vec(i);
}
for(int i=0;i<W+2;i++){
cout << '#';
if(i==W-1){cout <<endl;}
}
for(int i=0;i<H;i++){
cout << '#'<<vec(i) << '#'<<endl;
}
for(int i=0;i<W+2;i++){
cout << '#';
if(i==W-1){cout <<endl;}
}
}
| a.cc: In function 'int main()':
a.cc:9:15: error: no match for call to '(std::vector<std::__cxx11::basic_string<char> >) (int&)'
9 | cin >> vec(i);
| ~~~^~~
a.cc:16:21: error: no match for call to '(std::vector<std::__cxx11::basic_string<char> >) (int&)'
16 | cout << '#'<<vec(i) << '#'<<endl;
| ~~~^~~
|
s405548089 | p03712 | C++ | #include <bits/stdc++.h>
using namespace std;
int main() {
int H,W;
cin >> H>>W;
vector<string> vec(H);
for(int i=0;i<H;i++){
cin >> vec(i);
}
for(int i=0;i<W;i++){
cout << '#';
if(i==W-1){cout <<endl;}
}
for(int i=0;i<H;i++){
cout << '#'<<vec(i) << '#'<<endl;
}
for(int i=0;i<W;i++){
cout << '#';
if(i==W-1){cout <<endl;}
}
}
| a.cc: In function 'int main()':
a.cc:9:15: error: no match for call to '(std::vector<std::__cxx11::basic_string<char> >) (int&)'
9 | cin >> vec(i);
| ~~~^~~
a.cc:16:21: error: no match for call to '(std::vector<std::__cxx11::basic_string<char> >) (int&)'
16 | cout << '#'<<vec(i) << '#'<<endl;
| ~~~^~~
|
s117759543 | p03712 | C++ | #pragma GCC target("avx2")
#pragma GCC optimize("O3")
#pragma GCC optimize("unroll-loops")
#include <bits/stdc++.h>
using namespace std;
#define int long long // 禁忌
using ll = long long;
using lld = long double;
#define P pair<ll,ll>
#define Vi vector<ll>
#define VVi vector<vector<ll>>
#define Vd vector<double>
#define Vb vector<bool>
#define Vs vector<string>
#define Vc vector<char>
#define M map<ll,ll>
#define S set<ll>
#define PQ priority_queue<ll>
#define PQG priority_queue<ll,V,greater<ll>
// 重み付き辺
template<typename T>
struct edge {
int src, to;
T cost;
edge(int to, T cost) : src(-1), to(to), cost(cost) {}
edge(int src, int to, T cost) : src(src), to(to), cost(cost) {}
edge &operator=(const int &x) {
to = x;
return *this;
}
operator int() const { return to; }
};
// 重み付き辺集合
template<typename T>
using Edges = vector<edge<T>>;
// 重み付きグラフ
template<typename T>
using WeightedGraph = vector<Edges<T>>;
using UnWeightedGraph = VVi; // 重みなしグラフ
// 距離行列
template<typename T>
using Matrix = vector<vector<T>>;
const int MOD = 1000000007;
const int INF = 1061109567;
const double EPS = 1e-10;
const double PI = acos(-1.0);
const int dx[4] = {1, 0, -1, 0};
const int dy[4] = {0, 1, 0, -1};
#define FOR(i, a, b) for (int i = (a); i < (b); ++i)
#define REP(i, n) for (int i = 0; i < (n); ++i)
#define PER(i, n) for (int i = (n-1); i >= 0; --i)
#define ALL(V) (V).begin(),(V).end()
#define SORT(V) sort(ALL(V)) //小さい方からソート
#define REV(V) reverse(ALL(V)) //リバース
#define RSORT(V) SORT(V);REV(V) //大きい方からソート
#define NEXP(V) next_permutation(ALL(V)) //順列
#define pb(n) emplace_back(n)
#define popb pop_back()
#define endl '\n'
#define Endl '\n'
#define DUMP(x) cout << #x << " = " << (x) << endl
// UnionFind
class UnionFind {
public:
vector <int> par;
vector <int> siz;
UnionFind(int sz_): par(sz_), siz(sz_, 1LL) {
for (int i = 0; i < sz_; ++i) par[i] = i;
}
void init(ll sz_) {
par.resize(sz_);
siz.assign(sz_, 1LL);
for (int i = 0; i < sz_; ++i) par[i] = i;
}
int root(int x) {
while (par[x] != x) {
x = par[x] = par[par[x]];
}
return x;
}
bool merge(int x, int y) {
x = root(x);
y = root(y);
if (x == y) return false;
if (siz[x] < siz[y]) swap(x, y);
siz[x] += siz[y];
par[y] = x;
return true;
}
bool issame(int x, int y) {
return root(x) == root(y);
}
int size(int x) {
return siz[root(x)];
}
};
// modint
template< int mod >
struct ModInt {
int x;
ModInt() : x(0) {}
ModInt(int64_t y) : x(y >= 0 ? y % mod : (mod - (-y) % mod) % mod) {}
ModInt &operator+=(const ModInt &p) {
if((x += p.x) >= mod) x -= mod;
return *this;
}
ModInt &operator-=(const ModInt &p) {
if((x += mod - p.x) >= mod) x -= mod;
return *this;
}
ModInt &operator*=(const ModInt &p) {
x = (int) (1LL * x * p.x % mod);
return *this;
}
ModInt &operator/=(const ModInt &p) {
*this *= p.inverse();
return *this;
}
ModInt operator-() const { return ModInt(-x); }
ModInt operator+(const ModInt &p) const { return ModInt(*this) += p; }
ModInt operator-(const ModInt &p) const { return ModInt(*this) -= p; }
ModInt operator*(const ModInt &p) const { return ModInt(*this) *= p; }
ModInt operator/(const ModInt &p) const { return ModInt(*this) /= p; }
bool operator==(const ModInt &p) const { return x == p.x; }
bool operator!=(const ModInt &p) const { return x != p.x; }
ModInt inverse() const {
int a = x, b = mod, u = 1, v = 0, t;
while(b > 0) {
t = a / b;
swap(a -= t * b, b);
swap(u -= t * v, v);
}
return ModInt(u);
}
ModInt pow(int64_t n) const {
ModInt ret(1), mul(x);
while(n > 0) {
if(n & 1) ret *= mul;
mul *= mul;
n >>= 1;
}
return ret;
}
friend ostream &operator<<(ostream &os, const ModInt &p) {
return os << p.x;
}
friend istream &operator>>(istream &is, ModInt &a) {
int64_t t;
is >> t;
a = ModInt< mod >(t);
return (is);
}
static int get_mod() { return mod; }
};
using modint = ModInt< MOD >;
// dijkstra O(E logV)
template<typename T>
vector<T> dijkstra(WeightedGraph<T> &g, int s) {
const auto INF2 = numeric_limits<T>::max();
vector<T> dist(g.size(), INF2);
using Pi = pair<T, int>;
priority_queue<Pi, vector<Pi>, greater<Pi>> que;
dist[s] = 0;
que.emplace(dist[s], s);
while(!que.empty()) {
T cost;
int idx;
tie(cost, idx) = que.top();
que.pop();
if(dist[idx] < cost) continue;
for(auto &e : g[idx]) {
auto next_cost = cost + e.cost;
if(dist[e.to] <= next_cost) continue;
dist[e.to] = next_cost;
que.emplace(dist[e.to], e.to);
}
}
return dist;
}
// 負の辺を持つ単一始点最短路 O(VE)
template<typename T>
vector<T> bellman_ford(Edges<T> &edges, int V, int s) {
const auto INF2 = numeric_limits<T>::max();
vector<T> dist(V, INF2);
dist[s] = 0;
REP(i,(V-1)) {
for(auto &e : edges) {
if(dist[e.src] == INF2) continue;
dist[e.to] = min(dist[e.to], dist[e.src] + e.cost);
}
}
for(auto &e : edges) {
if(dist[e.src] == INF2) continue;
if(dist[e.src] + e.cost < dist[e.to]) return vector<T>();
}
return dist;
}
// 全点対間最短路 O(V^3)
template<typename T>
void warshall_floyd(Matrix<T> &g, T lINF) {
ll n = g.size();
REP(k,n){
REP(i,n){
REP(j,n){
if(g[i][k] == lINF || g[k][j] == lINF) continue;
g[i][j] = min(g[i][j], g[i][k] + g[k][j]);
}
}
}
return;
}
// 入出力高速化
void fast(void) {
cin.tie(0);
ios::sync_with_stdio(false);
cout << fixed << setprecision(15);
return;
}
// vectorの合計値を返します
ll vsum(Vi V) {
ll res = 0LL;
ll size = V.size();
REP(i,size) {
res += V.at(i);
}
return res;
}
// vectorの平均値を返します
lld vave(Vi V) {
lld size = V.size();
return (lld)vsum(V) / size;
}
// vectorの最大値を返します
ll vmax(Vi V) {
RSORT(V);
return V.at(0);
}
// vectorの最小値を返します
ll vmin(Vi V) {
SORT(V);
return V.at(0);
}
// 数値 b が a より大きく、 c より小さいことを判定します
template<typename T>
bool mid1(T a, T b, T c) {
return (a < b) && (b < c);
}
// 数値 b が a以上 で、c以下 であることを判定します
template<typename T>
bool mid2(T a, T b, T c) {
return (a <= b) && (b <= c);
}
// YES or NO
template<typename T>
void YES(T n) {
cout << ((n) ? "YES" : "NO" ) << endl;
}
// Yes or No
template<typename T>
void Yes(T n) {
cout << ((n) ? "Yes" : "No" ) << endl;
}
// yes or no
template<typename T>
void yes(T n) {
cout << ((n) ? "yes" : "no" ) << endl;
}
// Yay! or :(
template<typename T>
void Yay(T n) {
cout << ((n) ? "Yay!": ":(") << endl;
}
// 標準入力します
inline void in(void){
return;
}
template<typename First, typename... Rest>
void in(First& first, Rest&... rest) {
cin >> first;
in(rest...);
return;
}
// vectorを標準入力
template<typename T>
void vin(T& V) {
ll size = V.size();
REP(i,size) {
cin >> V[i];
}
return;
}
// 標準出力します
inline void out(void){
cout << endl;
return;
}
template<typename T>
void out(T only) {
cout << only << endl;
return;
}
template<typename First, typename... Rest>
void out(First first, Rest... rest) {
cout << first << " ";
out(rest...);
return;
}
// vectorを標準出力
template<typename T>
void vout(T& V) {
ll size = V.size();
REP(i,size) {
cout << V.at(i) << endl;
}
}
// vectorを1行に標準出力
template<typename T>
void vout2(T& V) {
ll size = V.size();
REP(i,size) {
cout << V[i] << " \n"[i==(size-1)];
}
}
// 最大公約数を求めます
int gcd(int a, int b) {
return b != 0 ? gcd(b, a % b) : a;
}
// 最小公倍数を求めます
int lcm(int a, int b) {
return a * b / gcd(a, b);
}
// 文字を全て大文字にします
string toStrUp(string str) {
char diff = 'A'-'a';
REP(i,str.size()) str[i] += diff;
return str;
}
// 素因数分解します (O(sqrt(n)))
map<int,int> prime_factor(int n) {
map<int,int> ret;
for(int i = 2; i * i <= n; i++) {
while(n % i == 0) {
ret[i]++;
n /= i;
}
}
if(n != 1) ret[n] = 1;
return ret;
}
// 素数判定 (O(sqrt(n)))
bool is_prime(int x) {
for(int i = 2; i * i <= x; i++) {
if(x % i == 0) return false;
}
return true;
}
// 進数変換 (O(log n))
template<typename T>
vector<T> convert_base(T x, T b) {
vector< T > ret;
T t = 1, k = abs(b);
while(x) {
ret.emplace_back((x * t) % k);
if(ret.back() < 0) ret.back() += k;
x -= ret.back() * t;
x /= k;
t *= b / k;
}
if(ret.empty()) ret.emplace_back(0);
reverse(begin(ret), end(ret));
return ret;
}
template<class T>
inline bool chmin(T& a, T b) {
if(a > b) {
a = b;
return true;
}
return false;
}
template<class T>
inline bool chmax(T& a, T b) {
if(a < b){
a = b;
return true;
}
return false;
}
signed main() {
fast();
// 使えない変数名
// P, M, S, PQ, PQG
// ここから
int n,m,k; string s;
int h,w;
in(h,w);
Vs A(h);
vin(A);
string around = "";
REP(i,w+2) around.pb('#');
out(around);
// REP(i,h) {
// cout<<"#"<<A.at(i)<<"#"<<endl;
// }
out(around);
} | a.cc: In function 'int main()':
a.cc:69:15: error: 'std::string' {aka 'class std::__cxx11::basic_string<char>'} has no member named 'emplace_back'
69 | #define pb(n) emplace_back(n)
| ^~~~~~~~~~~~
a.cc:465:21: note: in expansion of macro 'pb'
465 | REP(i,w+2) around.pb('#');
| ^~
|
s766003327 | p03712 | C++ | #include <bits/stdc++.h>
using namespace std;
int main() {
int H,W;
cin >> H >> W;
string line="";
for(int j=0;j<W+2;j++){
line += '#'
}
for(int i=0;i<H+2;i++){
if(i==0||i==H+1){
cout << line << endl;
}
else{
string tmp;
cin >> tmp;
cout << '#' << tmp << '#' << endl;
}
}
} | a.cc: In function 'int main()':
a.cc:11:16: error: expected ';' before '}' token
11 | line += '#'
| ^
| ;
12 | }
| ~
|
s354673325 | p03712 | C++ | #%% for atcoder uniittest use
import sys
input= lambda: sys.stdin.readline().rstrip()
#cythonを使うために実行
#%load_ext Cython
#%%code
def resolve():
H,W=map(int, input().split())
l="#"*(W+2)
print(l)
for i in range(H):
s=input()
print("#"+s+"#")
print(l)
#%%submit!
resolve()
| a.cc:1:2: error: invalid preprocessing directive #%
1 | #%% for atcoder uniittest use
| ^
a.cc:4:2: error: invalid preprocessing directive #cython\U00003092\U00004f7f\U00003046\U0000305f\U00003081\U0000306b\U00005b9f\U0000884c
4 | #cythonを使うために実行
| ^~~~~~~~~~~~~~~~~~~~~~
a.cc:5:2: error: invalid preprocessing directive #%
5 | #%load_ext Cython
| ^
a.cc:6:2: error: invalid preprocessing directive #%
6 | #%%code
| ^
a.cc:15:2: error: invalid preprocessing directive #%
15 | #%%submit!
| ^
a.cc:2:1: error: 'import' does not name a type
2 | import sys
| ^~~~~~
a.cc:2:1: note: C++20 'import' only available with '-fmodules-ts'
|
s259389107 | p03712 | C++ | #include <bits/stdc++.h>
using namespace std;
int main() {
int H=0;
int W=0;
vector<vector<char>> a(H, vector<char>(W));
vector<vector<char>> b(H, vector<char>(W));
for (int i = 0; i < H; i++){
for (int j = 0; j < W; j++){
cin >> a.at(i).at(j);
}
}
for (int i = 0; i < H+2; i++){
for (int j = 0; j < W+2; j++){
b.at(i).at(j) = "#";
}
}
for (int i = 0; i < H; i++){
for (int j = 0; j < W; j++){
b.at(i+1).at(j+1) = a.at(i).at(j);
}
}
for (int i = 0; i < H+2; i++){
for (int j = 0; j < W+2; j++){
cout << b.at(i).at(j);
cout << endl;
}
}
}
| a.cc: In function 'int main()':
a.cc:16:25: error: invalid conversion from 'const char*' to '__gnu_cxx::__alloc_traits<std::allocator<char>, char>::value_type' {aka 'char'} [-fpermissive]
16 | b.at(i).at(j) = "#";
| ^~~
| |
| const char*
|
s492813475 | p03712 | C++ | #include <bits/stdc++.h>
using namespace std;
int main() {
int H=0;
int W=0;
vector<vector<char>> a(H, vector<char>(W));
vector<vector<char>> b(H, vector<char>(W));
for (int i = 0; i < H; i++){
for (int j = 0; j < W; j++){
cin >> a.at(i).at(j);
}
}
for (int i = 0; i < H+2; i++){
for (int j = 0; j < W+2; j++){
b.at(i).at(j)="#";
}
}
for (int i = 0; i < H; i++){
for (int j = 0; j < W; j++){
b.at(i+1).at(j+1) = a.at(i).at(j);
}
}
for (int i = 0; i < H+2; i++){
for (int j = 0; j < W+2; j++){
cout << b.at(i).at(j);
cout << endl;
}
}
}
| a.cc: In function 'int main()':
a.cc:16:23: error: invalid conversion from 'const char*' to '__gnu_cxx::__alloc_traits<std::allocator<char>, char>::value_type' {aka 'char'} [-fpermissive]
16 | b.at(i).at(j)="#";
| ^~~
| |
| const char*
|
s825161442 | 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<W+2; i++){
cout << "#";
if(i==W+1) cout << endl;
}
for(int i=0; i<H i++){
cout << "#" + a.at(i) + "#" << endl;
}
for(int i=0; i<W+2; i++){
cout << "#";
if(i==W+1) cout << endl;
}
} | a.cc: In function 'int main()':
a.cc:15:19: error: expected ';' before 'i'
15 | for(int i=0; i<H i++){
| ^~
| ;
|
s611741506 | p03712 | C++ | #include <bits/stdc++.h>
using namespace std;
int main() {
int H, W;
cin >> H >> W;
vector<vector<string>> a(100, vector<string>(101));
vector<vector<string>> b(102, vector<string>(102));
for(int i=0; i<H; i++){
cin >> 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; i<W+2; j++){
cout << b[i][j];
}
cout << endl;
}
} | a.cc: In function 'int main()':
a.cc:12:21: error: no match for 'operator>>' (operand types are 'std::istream' {aka 'std::basic_istream<char>'} and '__gnu_cxx::__alloc_traits<std::allocator<std::vector<std::__cxx11::basic_string<char> > >, std::vector<std::__cxx11::basic_string<char> > >::value_type' {aka 'std::vector<std::__cxx11::basic_string<char> >'})
12 | cin >> a[i];
In file included from /usr/include/c++/14/sstream:40,
from /usr/include/c++/14/complex:45,
from /usr/include/c++/14/ccomplex:39,
from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:127,
from a.cc:1:
/usr/include/c++/14/istream:170:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(bool&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]'
170 | operator>>(bool& __n)
| ^~~~~~~~
/usr/include/c++/14/istream:170:24: note: no known conversion for argument 1 from '__gnu_cxx::__alloc_traits<std::allocator<std::vector<std::__cxx11::basic_string<char> > >, std::vector<std::__cxx11::basic_string<char> > >::value_type' {aka 'std::vector<std::__cxx11::basic_string<char> >'} to 'bool&'
170 | operator>>(bool& __n)
| ~~~~~~^~~
/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>]'
174 | operator>>(short& __n);
| ^~~~~~~~
/usr/include/c++/14/istream:174:25: note: no known conversion for argument 1 from '__gnu_cxx::__alloc_traits<std::allocator<std::vector<std::__cxx11::basic_string<char> > >, std::vector<std::__cxx11::basic_string<char> > >::value_type' {aka 'std::vector<std::__cxx11::basic_string<char> >'} to 'short int&'
174 | operator>>(short& __n);
| ~~~~~~~^~~
/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>]'
177 | operator>>(unsigned short& __n)
| ^~~~~~~~
/usr/include/c++/14/istream:177:34: note: no known conversion for argument 1 from '__gnu_cxx::__alloc_traits<std::allocator<std::vector<std::__cxx11::basic_string<char> > >, std::vector<std::__cxx11::basic_string<char> > >::value_type' {aka 'std::vector<std::__cxx11::basic_string<char> >'} to 'short unsigned int&'
177 | operator>>(unsigned short& __n)
| ~~~~~~~~~~~~~~~~^~~
/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>]'
181 | operator>>(int& __n);
| ^~~~~~~~
/usr/include/c++/14/istream:181:23: note: no known conversion for argument 1 from '__gnu_cxx::__alloc_traits<std::allocator<std::vector<std::__cxx11::basic_string<char> > >, std::vector<std::__cxx11::basic_string<char> > >::value_type' {aka 'std::vector<std::__cxx11::basic_string<char> >'} to 'int&'
181 | operator>>(int& __n);
| ~~~~~^~~
/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>]'
184 | operator>>(unsigned int& __n)
| ^~~~~~~~
/usr/include/c++/14/istream:184:32: note: no known conversion for argument 1 from '__gnu_cxx::__alloc_traits<std::allocator<std::vector<std::__cxx11::basic_string<char> > >, std::vector<std::__cxx11::basic_string<char> > >::value_type' {aka 'std::vector<std::__cxx11::basic_string<char> >'} to 'unsigned int&'
184 | operator>>(unsigned int& __n)
| ~~~~~~~~~~~~~~^~~
/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>]'
188 | operator>>(long& __n)
| ^~~~~~~~
/usr/include/c++/14/istream:188:24: note: no known conversion for argument 1 from '__gnu_cxx::__alloc_traits<std::allocator<std::vector<std::__cxx11::basic_string<char> > >, std::vector<std::__cxx11::basic_string<char> > >::value_type' {aka 'std::vector<std::__cxx11::basic_string<char> >'} to 'long int&'
188 | operator>>(long& __n)
| ~~~~~~^~~
/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>]'
192 | operator>>(unsigned long& __n)
| ^~~~~~~~
/usr/include/c++/14/istream:192:33: note: no known conversion for argument 1 from '__gnu_cxx::__alloc_traits<std::allocator<std::vector<std::__cxx11::basic_string<char> > >, std::vector<std::__cxx11::basic_string<char> > >::value_type' {aka 'std::vector<std::__cxx11::basic_string<char> >'} to 'long unsigned int&'
192 | operator>>(unsigned long& __n)
| ~~~~~~~~~~~~~~~^~~
/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>]'
199 | operator>>(long long& __n)
| ^~~~~~~~
/usr/include/c++/14/istream:199:29: note: no known conversion for argument 1 from '__gnu_cxx::__alloc_traits<std::allocator<std::vector<std::__cxx11::basic_string<char> > >, std::vector<std::__cxx11::basic_string<char> > >::value_type' {aka 'std::vector<std::__cxx11::basic_string<char> >'} to 'long long int&'
199 | operator>>(long long& __n)
| ~~~~~~~~~~~^~~
/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>]'
203 | operator>>(unsigned long long& __n)
| ^~~~~~~~
/usr/include/c++/14/istream:203:38: note: no known conversion for argument 1 from '__gnu_cxx::__alloc_traits<std::allocator<std::vector<std::__cxx11::basic_string<char> > >, std::vector<std::__cxx11::basic_string<char> > >::value_type' {aka 'std::vector<std::__cxx11::basic_string<char> >'} to 'long long unsigned int&'
203 | operator>>(unsigned long long& __n)
| ~~~~~~~~~~~~~~~~~~~~^~~
/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 '__gnu_cxx::__alloc_traits<std::allocator<std::vector<std::__cxx11::basic_string<char> > >, std::vector<std::__cxx11::basic_string<char> > >::value_type' {aka 'std::vector<std::__cxx11::basic_string<char> >'} 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 '__gnu_cxx::__alloc_traits<std::allocator<std::vector<std::__cxx11::basic_string<char> > >, std::vector<std::__cxx11::basic_string<char> > >::value_type' {aka 'std::vector<std::__cxx11::basic_string<char> >'} 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 '__gnu_cxx::__alloc_traits<std::allocator<std::vector<std::__cxx11::basic_string<char> > >, std::vector<std::__cxx11::basic_string<char> > >::value_type' {aka 'std::vector<std::__cxx11::basic_string<char> >'} to 'long double&'
227 | operator>>(long double& __f)
| ~~~~~~~~~~~~~^~~
/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>]'
328 | operator>>(void*& __p)
| ^~~~~~~~
/usr/include/c++/14/istream:328:25: note: no known conversion for argument 1 from '__gnu_cxx::__alloc_traits<std::allocator<std::vector<std::__cxx11::basic_string<char> > >, std::vector<std::__cxx11::basic_string<char> > >::value_type' {aka 'std::vector<std::__cxx11::basic_string<char> >'} to 'void*&'
328 | operator>>(void*& __p)
| ~~~~~~~^~~
/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& (* |
s924800944 | p03712 | C++ | include <bits/stdc++.h>
using namespace std;
int main() {
int h, w;
cin >> h >> w;
string a[h];
for(int i; i<h; i++){
cin >> a[i];
}
string b[h+2][w+2];
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++)
cout<<b[i]<<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: 'cin' was not declared in this scope
6 | cin >> h >> w;
| ^~~
a.cc:7:3: error: 'string' was not declared in this scope
7 | string a[h];
| ^~~~~~
a.cc:9:12: error: 'a' was not declared in this scope
9 | cin >> a[i];
| ^
a.cc:12:9: error: expected ';' before 'b'
12 | string b[h+2][w+2];
| ^~
| ;
a.cc:15:9: error: 'b' was not declared in this scope
15 | b[i][j]="#";
| ^
a.cc:23:7: error: 'b' was not declared in this scope
23 | b[i+1][j+1]=a[i][j];
| ^
a.cc:23:19: error: 'a' was not declared in this scope
23 | b[i+1][j+1]=a[i][j];
| ^
a.cc:28:5: error: 'cout' was not declared in this scope
28 | cout<<b[i]<<endl;
| ^~~~
a.cc:28:11: error: 'b' was not declared in this scope
28 | cout<<b[i]<<endl;
| ^
a.cc:28:17: error: 'endl' was not declared in this scope
28 | cout<<b[i]<<endl;
| ^~~~
|
s132296183 | p03712 | C++ | #include <bits/stdc++.h>
using namespace std;
int main() {
int h, w;
cin >> h >> w;
vector <string> a(h);
for(int i; i<h; i++){
cin >> a.at(i);
}
for(int i=0; i<h+2; i++){
for(int j=0; j<w+2; j++){
if(i==0||i==h+1||j==0||j==w+1){
cout << "#";
}
else if(j==1){
cout << a.at(i-1);
}
}
cout << endl;
} | a.cc: In function 'int main()':
a.cc:22:2: error: expected '}' at end of input
22 | }
| ^
a.cc:4:12: note: to match this '{'
4 | int main() {
| ^
|
s787734689 | p03712 | C++ | #include <bits/stdc++.h>
using namespace std;
string a[101][101];
string b[102][102];
int main() {
int h,w;
cin>>h>>w;
for(int i=1;i<h+1;i++)
cin>>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++)
{
cout<<b[i]<<endl;
}
} | a.cc: In function 'int main()':
a.cc:14:11: error: no match for 'operator>>' (operand types are 'std::istream' {aka 'std::basic_istream<char>'} and 'std::string [101]' {aka 'std::__cxx11::basic_string<char> [101]'})
14 | cin>>a[i];
| ~~~^~~~~~
| | |
| | std::string [101] {aka std::__cxx11::basic_string<char> [101]}
| std::istream {aka std::basic_istream<char>}
In file included from /usr/include/c++/14/sstream:40,
from /usr/include/c++/14/complex:45,
from /usr/include/c++/14/ccomplex:39,
from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:127,
from a.cc:1:
/usr/include/c++/14/istream:170:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(bool&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' (near match)
170 | operator>>(bool& __n)
| ^~~~~~~~
/usr/include/c++/14/istream:170:7: note: conversion of argument 1 would be ill-formed:
a.cc:14:16: error: cannot bind non-const lvalue reference of type 'bool&' to a value of type 'std::string*' {aka 'std::__cxx11::basic_string<char>*'}
14 | cin>>a[i];
| ~~~^
/usr/include/c++/14/istream:174:7: note: candidate: 'std::basic_istream<_CharT, _Traits>& std::basic_istream<_CharT, _Traits>::operator>>(short int&) [with _CharT = char; _Traits = std::char_traits<char>]' (near match)
174 | operator>>(short& __n);
| ^~~~~~~~
/usr/include/c++/14/istream:174:7: note: conversion of argument 1 would be ill-formed:
a.cc:14:16: error: invalid conversion from 'std::string*' {aka 'std::__cxx11::basic_string<char>*'} to 'short int' [-fpermissive]
14 | cin>>a[i];
| ~~~^
| |
| std::string* {aka std::__cxx11::basic_string<char>*}
a.cc:14:16: error: cannot bind rvalue '(short int)((std::string*)(& a[i]))' to 'short int&'
/usr/include/c++/14/istream:177:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(short unsigned int&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' (near match)
177 | operator>>(unsigned short& __n)
| ^~~~~~~~
/usr/include/c++/14/istream:177:7: note: conversion of argument 1 would be ill-formed:
a.cc:14:16: error: invalid conversion from 'std::string*' {aka 'std::__cxx11::basic_string<char>*'} to 'short unsigned int' [-fpermissive]
14 | cin>>a[i];
| ~~~^
| |
| std::string* {aka std::__cxx11::basic_string<char>*}
a.cc:14:16: error: cannot bind rvalue '(short unsigned int)((std::string*)(& a[i]))' to 'short unsigned int&'
/usr/include/c++/14/istream:181:7: note: candidate: 'std::basic_istream<_CharT, _Traits>& std::basic_istream<_CharT, _Traits>::operator>>(int&) [with _CharT = char; _Traits = std::char_traits<char>]' (near match)
181 | operator>>(int& __n);
| ^~~~~~~~
/usr/include/c++/14/istream:181:7: note: conversion of argument 1 would be ill-formed:
a.cc:14:16: error: invalid conversion from 'std::string*' {aka 'std::__cxx11::basic_string<char>*'} to 'int' [-fpermissive]
14 | cin>>a[i];
| ~~~^
| |
| std::string* {aka std::__cxx11::basic_string<char>*}
a.cc:14:16: error: cannot bind rvalue '(int)((std::string*)(& a[i]))' to 'int&'
/usr/include/c++/14/istream:184:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(unsigned int&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' (near match)
184 | operator>>(unsigned int& __n)
| ^~~~~~~~
/usr/include/c++/14/istream:184:7: note: conversion of argument 1 would be ill-formed:
a.cc:14:16: error: invalid conversion from 'std::string*' {aka 'std::__cxx11::basic_string<char>*'} to 'unsigned int' [-fpermissive]
14 | cin>>a[i];
| ~~~^
| |
| std::string* {aka std::__cxx11::basic_string<char>*}
a.cc:14:16: error: cannot bind rvalue '(unsigned int)((std::string*)(& a[i]))' to 'unsigned int&'
/usr/include/c++/14/istream:188:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(long int&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' (near match)
188 | operator>>(long& __n)
| ^~~~~~~~
/usr/include/c++/14/istream:188:7: note: conversion of argument 1 would be ill-formed:
a.cc:14:16: error: invalid conversion from 'std::string*' {aka 'std::__cxx11::basic_string<char>*'} to 'long int' [-fpermissive]
14 | cin>>a[i];
| ~~~^
| |
| std::string* {aka std::__cxx11::basic_string<char>*}
a.cc:14:16: error: cannot bind rvalue '(long int)((std::string*)(& a[i]))' to 'long int&'
/usr/include/c++/14/istream:192:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(long unsigned int&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' (near match)
192 | operator>>(unsigned long& __n)
| ^~~~~~~~
/usr/include/c++/14/istream:192:7: note: conversion of argument 1 would be ill-formed:
a.cc:14:16: error: invalid conversion from 'std::string*' {aka 'std::__cxx11::basic_string<char>*'} to 'long unsigned int' [-fpermissive]
14 | cin>>a[i];
| ~~~^
| |
| std::string* {aka std::__cxx11::basic_string<char>*}
a.cc:14:16: error: cannot bind rvalue '(long unsigned int)((std::string*)(& a[i]))' to 'long unsigned int&'
/usr/include/c++/14/istream:199:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(long long int&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' (near match)
199 | operator>>(long long& __n)
| ^~~~~~~~
/usr/include/c++/14/istream:199:7: note: conversion of argument 1 would be ill-formed:
a.cc:14:16: error: invalid conversion from 'std::string*' {aka 'std::__cxx11::basic_string<char>*'} to 'long long int' [-fpermissive]
14 | cin>>a[i];
| ~~~^
| |
| std::string* {aka std::__cxx11::basic_string<char>*}
a.cc:14:16: error: cannot bind rvalue '(long long int)((std::string*)(& a[i]))' to 'long long int&'
/usr/include/c++/14/istream:203:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(long long unsigned int&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' (near match)
203 | operator>>(unsigned long long& __n)
| ^~~~~~~~
/usr/include/c++/14/istream:203:7: note: conversion of argument 1 would be ill-formed:
a.cc:14:16: error: invalid conversion from 'std::string*' {aka 'std::__cxx11::basic_string<char>*'} to 'long long unsigned int' [-fpermissive]
14 | cin>>a[i];
| ~~~^
| |
| std::string* {aka std::__cxx11::basic_string<char>*}
a.cc:14:16: error: cannot bind rvalue '(long long unsigned int)((std::string*)(& a[i]))' to 'long long unsigned int&'
/usr/include/c++/14/istream:328:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(void*&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' (near match)
328 | operator>>(void*& __p)
| ^~~~~~~~
/usr/include/c++/14/istream:328:7: note: conversion of argument 1 would be ill-formed:
a.cc:14:16: error: cannot bind non-const lvalue reference of type 'void*&' to an rvalue of type 'void*'
14 | cin>>a[i];
| ~~~^
/usr/include/c++/14/istream:219:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(float&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]'
219 | operator>>(float& __f)
| ^~~~~~~~
/usr/include/c++/14/istream:219:25: note: no known conversion for argument 1 from 'std::string [101]' {aka 'std::__cxx11::basic_string<char> [101]'} to 'float&'
219 | operator>>(float& __f)
| ~~~~~~~^~~
/usr/include/c++/14/istream:223:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(double&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]'
223 | operator>>(double& __f)
| ^~~~~~~~
/usr/include/c++/14/istream:223:26: note: no known conversion for argument 1 from 'std::string [101]' {aka 'std::__cxx11::basic_string<char> [101]'} to 'double&'
223 | operator>>(double& __f)
| ~~~~~~~~^~~
/usr/include/c++/14/istream:227:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(long double&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]'
227 | operator>>(long double& __f)
| ^~~~~~~~
/usr/include/c++/14/istream:227:31: note: no known conversion for argument 1 from 'std::string [101]' {aka 'std::__cxx11::basic_string<char> [101]'} 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& (*)(__i |
s292575522 | p03712 | C++ | #include <bits/stdc++.h>
using namespace std;
int main() {
int h,w;
cin>>h>>w;
string a[100][101];
for(int i=1;i<h+1;i++)
cin>>a[i];
string b[102][102];
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++)
{
cout<<b[i]<<endl;
}
} | a.cc: In function 'int main()':
a.cc:12:11: error: no match for 'operator>>' (operand types are 'std::istream' {aka 'std::basic_istream<char>'} and 'std::string [101]' {aka 'std::__cxx11::basic_string<char> [101]'})
12 | cin>>a[i];
| ~~~^~~~~~
| | |
| | std::string [101] {aka std::__cxx11::basic_string<char> [101]}
| std::istream {aka std::basic_istream<char>}
In file included from /usr/include/c++/14/sstream:40,
from /usr/include/c++/14/complex:45,
from /usr/include/c++/14/ccomplex:39,
from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:127,
from a.cc:1:
/usr/include/c++/14/istream:170:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(bool&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' (near match)
170 | operator>>(bool& __n)
| ^~~~~~~~
/usr/include/c++/14/istream:170:7: note: conversion of argument 1 would be ill-formed:
a.cc:12:16: error: cannot bind non-const lvalue reference of type 'bool&' to a value of type 'std::string*' {aka 'std::__cxx11::basic_string<char>*'}
12 | cin>>a[i];
| ~~~^
/usr/include/c++/14/istream:174:7: note: candidate: 'std::basic_istream<_CharT, _Traits>& std::basic_istream<_CharT, _Traits>::operator>>(short int&) [with _CharT = char; _Traits = std::char_traits<char>]' (near match)
174 | operator>>(short& __n);
| ^~~~~~~~
/usr/include/c++/14/istream:174:7: note: conversion of argument 1 would be ill-formed:
a.cc:12:16: error: invalid conversion from 'std::string*' {aka 'std::__cxx11::basic_string<char>*'} to 'short int' [-fpermissive]
12 | cin>>a[i];
| ~~~^
| |
| std::string* {aka std::__cxx11::basic_string<char>*}
a.cc:12:16: error: cannot bind rvalue '(short int)((std::string*)(& a[i]))' to 'short int&'
/usr/include/c++/14/istream:177:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(short unsigned int&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' (near match)
177 | operator>>(unsigned short& __n)
| ^~~~~~~~
/usr/include/c++/14/istream:177:7: note: conversion of argument 1 would be ill-formed:
a.cc:12:16: error: invalid conversion from 'std::string*' {aka 'std::__cxx11::basic_string<char>*'} to 'short unsigned int' [-fpermissive]
12 | cin>>a[i];
| ~~~^
| |
| std::string* {aka std::__cxx11::basic_string<char>*}
a.cc:12:16: error: cannot bind rvalue '(short unsigned int)((std::string*)(& a[i]))' to 'short unsigned int&'
/usr/include/c++/14/istream:181:7: note: candidate: 'std::basic_istream<_CharT, _Traits>& std::basic_istream<_CharT, _Traits>::operator>>(int&) [with _CharT = char; _Traits = std::char_traits<char>]' (near match)
181 | operator>>(int& __n);
| ^~~~~~~~
/usr/include/c++/14/istream:181:7: note: conversion of argument 1 would be ill-formed:
a.cc:12:16: error: invalid conversion from 'std::string*' {aka 'std::__cxx11::basic_string<char>*'} to 'int' [-fpermissive]
12 | cin>>a[i];
| ~~~^
| |
| std::string* {aka std::__cxx11::basic_string<char>*}
a.cc:12:16: error: cannot bind rvalue '(int)((std::string*)(& a[i]))' to 'int&'
/usr/include/c++/14/istream:184:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(unsigned int&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' (near match)
184 | operator>>(unsigned int& __n)
| ^~~~~~~~
/usr/include/c++/14/istream:184:7: note: conversion of argument 1 would be ill-formed:
a.cc:12:16: error: invalid conversion from 'std::string*' {aka 'std::__cxx11::basic_string<char>*'} to 'unsigned int' [-fpermissive]
12 | cin>>a[i];
| ~~~^
| |
| std::string* {aka std::__cxx11::basic_string<char>*}
a.cc:12:16: error: cannot bind rvalue '(unsigned int)((std::string*)(& a[i]))' to 'unsigned int&'
/usr/include/c++/14/istream:188:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(long int&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' (near match)
188 | operator>>(long& __n)
| ^~~~~~~~
/usr/include/c++/14/istream:188:7: note: conversion of argument 1 would be ill-formed:
a.cc:12:16: error: invalid conversion from 'std::string*' {aka 'std::__cxx11::basic_string<char>*'} to 'long int' [-fpermissive]
12 | cin>>a[i];
| ~~~^
| |
| std::string* {aka std::__cxx11::basic_string<char>*}
a.cc:12:16: error: cannot bind rvalue '(long int)((std::string*)(& a[i]))' to 'long int&'
/usr/include/c++/14/istream:192:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(long unsigned int&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' (near match)
192 | operator>>(unsigned long& __n)
| ^~~~~~~~
/usr/include/c++/14/istream:192:7: note: conversion of argument 1 would be ill-formed:
a.cc:12:16: error: invalid conversion from 'std::string*' {aka 'std::__cxx11::basic_string<char>*'} to 'long unsigned int' [-fpermissive]
12 | cin>>a[i];
| ~~~^
| |
| std::string* {aka std::__cxx11::basic_string<char>*}
a.cc:12:16: error: cannot bind rvalue '(long unsigned int)((std::string*)(& a[i]))' to 'long unsigned int&'
/usr/include/c++/14/istream:199:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(long long int&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' (near match)
199 | operator>>(long long& __n)
| ^~~~~~~~
/usr/include/c++/14/istream:199:7: note: conversion of argument 1 would be ill-formed:
a.cc:12:16: error: invalid conversion from 'std::string*' {aka 'std::__cxx11::basic_string<char>*'} to 'long long int' [-fpermissive]
12 | cin>>a[i];
| ~~~^
| |
| std::string* {aka std::__cxx11::basic_string<char>*}
a.cc:12:16: error: cannot bind rvalue '(long long int)((std::string*)(& a[i]))' to 'long long int&'
/usr/include/c++/14/istream:203:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(long long unsigned int&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' (near match)
203 | operator>>(unsigned long long& __n)
| ^~~~~~~~
/usr/include/c++/14/istream:203:7: note: conversion of argument 1 would be ill-formed:
a.cc:12:16: error: invalid conversion from 'std::string*' {aka 'std::__cxx11::basic_string<char>*'} to 'long long unsigned int' [-fpermissive]
12 | cin>>a[i];
| ~~~^
| |
| std::string* {aka std::__cxx11::basic_string<char>*}
a.cc:12:16: error: cannot bind rvalue '(long long unsigned int)((std::string*)(& a[i]))' to 'long long unsigned int&'
/usr/include/c++/14/istream:328:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(void*&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' (near match)
328 | operator>>(void*& __p)
| ^~~~~~~~
/usr/include/c++/14/istream:328:7: note: conversion of argument 1 would be ill-formed:
a.cc:12:16: error: cannot bind non-const lvalue reference of type 'void*&' to an rvalue of type 'void*'
12 | cin>>a[i];
| ~~~^
/usr/include/c++/14/istream:219:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(float&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]'
219 | operator>>(float& __f)
| ^~~~~~~~
/usr/include/c++/14/istream:219:25: note: no known conversion for argument 1 from 'std::string [101]' {aka 'std::__cxx11::basic_string<char> [101]'} to 'float&'
219 | operator>>(float& __f)
| ~~~~~~~^~~
/usr/include/c++/14/istream:223:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(double&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]'
223 | operator>>(double& __f)
| ^~~~~~~~
/usr/include/c++/14/istream:223:26: note: no known conversion for argument 1 from 'std::string [101]' {aka 'std::__cxx11::basic_string<char> [101]'} to 'double&'
223 | operator>>(double& __f)
| ~~~~~~~~^~~
/usr/include/c++/14/istream:227:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(long double&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]'
227 | operator>>(long double& __f)
| ^~~~~~~~
/usr/include/c++/14/istream:227:31: note: no known conversion for argument 1 from 'std::string [101]' {aka 'std::__cxx11::basic_string<char> [101]'} 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& (*)(__i |
s234401837 | p03712 | C++ | #include <bits/stdc++.h>
using namespace std;
int main() {
int h,w;
cin>>h>>w;
string a[h];
for(int i=1;i<h+1)
cin>>a[i];
string b[h+2];
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++)
{
cout<<b[i]<<endl;
}
} | a.cc: In function 'int main()':
a.cc:11:20: error: expected ';' before ')' token
11 | for(int i=1;i<h+1)
| ^
| ;
|
s106311677 | p03712 | C++ | #include<iostream>
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++){
vector<string> vec;
cin >> vec.at(i);
cout << "#" << vec[i] << "#" << endl;
}
for(int i=0;i<W+2;i++) cout<<"#";
} | a.cc: In function 'int main()':
a.cc:10:13: error: 'vector' was not declared in this scope
10 | vector<string> vec;
| ^~~~~~
a.cc:2:1: note: 'std::vector' is defined in header '<vector>'; this is probably fixable by adding '#include <vector>'
1 | #include<iostream>
+++ |+#include <vector>
2 | using namespace std;
a.cc:10:26: error: expected primary-expression before '>' token
10 | vector<string> vec;
| ^
a.cc:10:28: error: 'vec' was not declared in this scope
10 | vector<string> vec;
| ^~~
|
s672445033 | p03712 | C++ | #include <bits/stdc++.h>
using namespace std;
int main() {
int h,w;
cin>>h>>w;
string a[];
for(int i=0;i<h;i++)
{
cin>>a[i];
}
string b[];
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++)
cout<<b[i]<<endl;
} | a.cc: In function 'int main()':
a.cc:8:10: error: array size missing in 'a'
8 | string a[];
| ^
a.cc:15:11: error: array size missing in 'b'
15 | string b[];
| ^
|
s230200957 | p03712 | C++ | #include <bits/stdc++.h>
using namespace std;
int main() {
int h,w;
cin>>h>>w;
string a[h];
for(int i=1;i<=h;i++)
cin>>a[i]
for(int i=0;i<=h+1;i++)
{
for(int j=0;j<=h+1;j++)
{
if(i==0||j==0||i==h+1||j==w+1)
a[i][j]='#'
}
}
for(int i=0;i<=h+1;i++)
cout<<a[i]<<endl;
return 0;
} | a.cc: In function 'int main()':
a.cc:13:14: error: expected ';' before 'for'
13 | cin>>a[i]
| ^
| ;
14 |
15 | for(int i=0;i<=h+1;i++)
| ~~~
a.cc:15:17: error: 'i' was not declared in this scope
15 | for(int i=0;i<=h+1;i++)
| ^
|
s477355565 | p03712 | C++ | #include <bits/stdc++.h>
using namespace std;
int main() {
int h;
int w;
cin >> h >> w;
vector<string> vec(h);
for (int i = 0; i < h; i++) {
cin >> vec.at(i);
}
for(int i = 0; i < w + 2){
cout << '#';
}
cout << endl;
for (int i = 0; i < h; i++) {
cout << '#' << vec.at(i) << '#' << endl;
}
for(int i = 0; i < w + 2){
cout << '#';
}
cout << endl;
} | a.cc: In function 'int main()':
a.cc:13:27: error: expected ';' before ')' token
13 | for(int i = 0; i < w + 2){
| ^
| ;
a.cc:22:27: error: expected ';' before ')' token
22 | for(int i = 0; i < w + 2){
| ^
| ;
|
s887443676 | p03712 | C++ | #include <bits/stdc++.h>
using namespace std;
/*最初に,縦H+ 2行,横W+ 2列の文字配列bを用意し,#で埋めておきます.
次に,各1iH,1jWごとにai;jをbi+1;j+1へコピーします.
最後に,配列bの内容を出力すればよいです.*/
int main() {
int H, W; cin >> H >> W;
cout << char(W+2, '#') << endl;
for (int i=0; i<H+2; i++) {
string s;
cin >> s;
cout << '#'+s+'#' << endl;
}
cout << char(W+2, '#') << endl;
} | a.cc: In function 'int main()':
a.cc:10:24: error: expression list treated as compound expression in functional cast [-fpermissive]
10 | cout << char(W+2, '#') << endl;
| ^
a.cc:16:24: error: expression list treated as compound expression in functional cast [-fpermissive]
16 | cout << char(W+2, '#') << endl;
| ^
|
s351630633 | p03712 | C++ | #include <bits/stdc++.h>
using namespace std;
int main() {
int H, W;
cin >> H >> W;
victor<string>A( W - 2 ) ;
for ( int i = 0; i < H - 2; i++ ) {
cin >> A.at(i) ;
}
for ( int i = 0; i < W; i++ ) {
cout << "#";
}
cout << endl;
for ( int i = 0; i < H - 2; i++ ) {
cout << "#" << "A.at(i)" << "#" << endl;
}
for ( int i = 0; i < W; i++ ) {
cout << "#";
}
cout << endl;
}
| a.cc: In function 'int main()':
a.cc:7:3: error: 'victor' was not declared in this scope
7 | victor<string>A( W - 2 ) ;
| ^~~~~~
a.cc:7:16: error: expected primary-expression before '>' token
7 | victor<string>A( W - 2 ) ;
| ^
a.cc:7:17: error: 'A' was not declared in this scope
7 | victor<string>A( W - 2 ) ;
| ^
|
s000166197 | p03712 | C++ | #include <bits/stdc++.h>
using namespace std;
int main() {
int H,W;
string S;
cin >>H >> W >> S;
vector<char> vec (H+1,#);
for (i=0; i<H+1; i++){
cout<<vec.,at(i)
}
} | a.cc:8:25: error: stray '#' in program
8 | vector<char> vec (H+1,#);
| ^
a.cc: In function 'int main()':
a.cc:8:26: error: expected primary-expression before ')' token
8 | vector<char> vec (H+1,#);
| ^
a.cc:9:8: error: 'i' was not declared in this scope
9 | for (i=0; i<H+1; i++){
| ^
a.cc:10:15: error: expected unqualified-id before ',' token
10 | cout<<vec.,at(i)
| ^
a.cc:10:16: error: 'at' was not declared in this scope
10 | cout<<vec.,at(i)
| ^~
|
s277278006 | p03712 | C++ | #include <bits/stdc++.h>
using namespace std;
int main() {
int A,B;
cis >>A >>B;
cout << A*2 + B*2 + 4 << endl;
}
| a.cc: In function 'int main()':
a.cc:6:3: error: 'cis' was not declared in this scope; did you mean 'cos'?
6 | cis >>A >>B;
| ^~~
| cos
|
s985078259 | p03712 | C++ | #include<stdio.h>
char a[100][101],b[102][102];
int main(void){
int h,w;
scanf("%d %d",&h,&w);
for(int loop1=0;loop1<h;loop1++){
scanf("%s",a[loop1]);
}
for(int loop1=0;loop1<h+2;loop1++){
for(int loop2=0;loop2<w+2;loop2++){
b[loop1][loop2]="#";
}
}
for(int loop1=0;loop1<h;loop1++){
for(int loop2=0;loop2<w;loop2++){
b[loop1+1][loop2+1]=a[loop1][loop2];
}
}
for(int loop1=0;loop1<h+2;loop1++){
for(int loop2=0;loop2<w+2;loop2++){
printf("%c\n",b[loop1][loop2]);
}
}
return 0;
} | a.cc: In function 'int main()':
a.cc:11:23: error: invalid conversion from 'const char*' to 'char' [-fpermissive]
11 | b[loop1][loop2]="#";
| ^~~
| |
| const char*
|
s496029261 | p03712 | C++ | #include<stdio.h>
char a[100][101],b[102][102];
int main(void){
int h,w;
scanf("%d %d",&h,&w);
for(int loop1=0;loop1<h;loop1++){
scanf("%s",a[loop1]);
}
for(int loop1=0;loop1<h+2;loop1++){
for(int loop2=0;loop2<w+2;loop2++){
b[loop1][loop2]='#';
}
}
for(int loop1=0;loop1<h;loop1++){
for(int loop2=0;loop2<w;loop2++){
b[loop1+1][loop2+1]=a[loop1][loop2];
}
}
for(int loop1=0;loop1<h+2;loop1++){
for(int loop2=0;loop<w+2;loop2++){
printf("%c\n",b[loop1][loop2]);
}
}
return 0;
} | a.cc: In function 'int main()':
a.cc:20:21: error: 'loop' was not declared in this scope; did you mean 'loop2'?
20 | for(int loop2=0;loop<w+2;loop2++){
| ^~~~
| loop2
|
s399783896 | p03712 | C++ | #include<stdio.h>
char a[100][101],b[102][102];
int main(void){
int h,w;
scanf("%d %d",&h,&w);
for(int loop1=0;loop1<h;loop1++){
scanf("%s",a[i]);
}
for(int loop1=0;loop1<h+2;loop1++){
for(int loop2=0;loop2<w+2;loop2++){
b[loop1][loop2]='#';
}
}
for(int loop1=0;loop1<h;loop1++){
for(int loop2=0;loop2<w;loop2++){
b[loop1+1][loop2+1]=a[loop1][loop2];]
}
}
for(int loop1=0;loop<h+2;loop1++){
for(int loop2=0;loop<w+2;loop2++){
printf("%s\n",b[loop1][loop2]);
}
}
return 0;
} | a.cc: In function 'int main()':
a.cc:7:18: error: 'i' was not declared in this scope
7 | scanf("%s",a[i]);
| ^
a.cc:16:43: error: expected primary-expression before ']' token
16 | b[loop1+1][loop2+1]=a[loop1][loop2];]
| ^
a.cc:19:19: error: 'loop' was not declared in this scope; did you mean 'loop1'?
19 | for(int loop1=0;loop<h+2;loop1++){
| ^~~~
| loop1
|
s092410663 | p03712 | C++ | h,w=map(int, input().split())
li=['#'*(w+2)]
for i in range(h):
li.append('#'+input()+'#')
li.append('#'*(w+2))
for n in li:
print(n) | a.cc:1:1: error: 'h' does not name a type
1 | h,w=map(int, input().split())
| ^
|
s674367348 | p03712 | C++ | h,w=map(int, input().split())
li=['#'*(w+2)]
for i in range(h):
li.append('#'+input()+'#')
li.append('#'*(w+2))
for n in li:
print(n) | a.cc:1:1: error: 'h' does not name a type
1 | h,w=map(int, input().split())
| ^
|
s235587177 | p03712 | C++ | #include <iostream>
using namespace std;
#define repd(i,a,b) for (int i=(a);i<(b);++i)
#define rep(i,n) repd(i,0,n)
typedef long long ll;
int main(){
int h, w;
cin >> h >> w;
string s;
rep(i, h+2){
printf('#');
if(i == 0 || i == h+1){
rep(i, w){
printf('#');
}
}else{
cin >> s;
printf("%s", s);
// cout << s;
}
printf("#\n")
// cout << '#' << endl;
}
return 0;
}
| a.cc: In function 'int main()':
a.cc:15:12: error: invalid conversion from 'char' to 'const char*' [-fpermissive]
15 | printf('#');
| ^~~
| |
| char
In file included from /usr/include/c++/14/cstdio:42,
from /usr/include/c++/14/ext/string_conversions.h:45,
from /usr/include/c++/14/bits/basic_string.h:4154,
from /usr/include/c++/14/string:54,
from /usr/include/c++/14/bits/locale_classes.h:40,
from /usr/include/c++/14/bits/ios_base.h:41,
from /usr/include/c++/14/ios:44,
from /usr/include/c++/14/ostream:40,
from /usr/include/c++/14/iostream:41,
from a.cc:1:
/usr/include/stdio.h:363:43: note: initializing argument 1 of 'int printf(const char*, ...)'
363 | extern int printf (const char *__restrict __format, ...);
| ~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~
a.cc:18:16: error: invalid conversion from 'char' to 'const char*' [-fpermissive]
18 | printf('#');
| ^~~
| |
| char
/usr/include/stdio.h:363:43: note: initializing argument 1 of 'int printf(const char*, ...)'
363 | extern int printf (const char *__restrict __format, ...);
| ~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~
a.cc:25:18: error: expected ';' before '}' token
25 | printf("#\n")
| ^
| ;
26 | // cout << '#' << endl;
27 | }
| ~
|
s409075799 | p03712 | C++ | #include<bits/stdc++.h>
using namespace std;
int main(){
int n,m;
cin >> n >> m;
char a[n+2][m+2];
for(int i=0;i<=n+1;i++){
if(i==0||i==n+1){
for(int j=0;j<m+2;i++){
cout << "#";
}
cout << endl;
}
cout << "#";
for(int jj=1;jj<=m;jj++)
cin >> a[i][jj];
cout << a[i][jj];
}
cout << "#" << endl;
}
}
| a.cc: In function 'int main()':
a.cc:17:20: error: 'jj' was not declared in this scope; did you mean 'jn'?
17 | cout << a[i][jj];
| ^~
| jn
a.cc: At global scope:
a.cc:21:1: error: expected declaration before '}' token
21 | }
| ^
|
s526322991 | p03712 | C++ | #include<bits/stdc++.h>
using namespace std;
int main(){
int n,m;
cin >> n >> m;
char a[n+2][m+2];
for(int i=0;i<=n+1;i++){
if(i==0||i==n+1){
for(int j=0;j<m+2;i++){
cout << "#";
}
cout << endl;
}
cout << "#";
for(int j=1;j<=m;j++)
cin >> a[i][j];
cout << a[i][j];
}
cout << "#" << endl;
}
}
| a.cc: In function 'int main()':
a.cc:17:20: error: 'j' was not declared in this scope
17 | cout << a[i][j];
| ^
a.cc: At global scope:
a.cc:21:1: error: expected declaration before '}' token
21 | }
| ^
|
s923022885 | p03712 | C++ | #include<bits/stdc++.h>
using namespace std;
int main(){
int H,W;
cin>>H>>W;
vector<string>vec(H);
for(int i=0;i<H;i++){
cin>>vec.at(i);
vec.at(i)='#'+vec.at(i)+'#';
}
for(int i=0;i<W;i++){
cout<<'#';
}
endl;
for(int i=0;i<H;i++){
cout<<vec.at(i)<<endl;
}
for(int i=0;i<W;i++){
cout<<'#';
}
endl;
}
| a.cc: In function 'int main()':
a.cc:14:7: error: statement cannot resolve address of overloaded function
14 | endl;
| ^
a.cc:21:7: error: statement cannot resolve address of overloaded function
21 | endl;
| ^
|
s277303962 | p03712 | C++ | #include <bits/stdc++.h>
using namespace std;
int main() {
int i,j;
cin >> i >> j;
vector<string> str(i);
for(int l=0;l<i;l++) {
cin >> str.at(l);
}
for(int l=0;l<j+2;l++) {
cout << "#";
}
cout << endl;
for(int l=0;l<i;l++) {
cout << "#" << A.at(l) << "#" << endl;
}
for(int l=0;l<j+2;l++) {
cout << "#";
}
cout << endl;
}
| a.cc: In function 'int main()':
a.cc:18:20: error: 'A' was not declared in this scope
18 | cout << "#" << A.at(l) << "#" << endl;
| ^
|
s253157327 | p03712 | C++ | a | a.cc:1:1: error: 'a' does not name a type
1 | a
| ^
|
s129144456 | p03712 | C++ | #include <bits/stdc++.h>
using namespace std;
int main() {
int H, W;
cin >> H >> W;
vector <char> S(W+2);
for (int i = 0; i<W+2; i++){
S.at(i) = '#';
}
cout << S << endl;
for ( int j = 1; j<H-1;j++){
for (int i=0; i<W+2; i++){
if(i == 0|i == W+1){
S.at(i) = '#';
}
else{
cin >> S.at(i);
}
}
cout << S << endl;
}
for (int i = 0; i<W+2; i++){
S.at(i) = '#';
}
cout << S << endl;
} | a.cc: In function 'int main()':
a.cc:11:8: error: no match for 'operator<<' (operand types are 'std::ostream' {aka 'std::basic_ostream<char>'} and 'std::vector<char>')
11 | cout << S << endl;
| ~~~~ ^~ ~
| | |
| | std::vector<char>
| std::ostream {aka std::basic_ostream<char>}
In file included from /usr/include/c++/14/istream:41,
from /usr/include/c++/14/sstream:40,
from /usr/include/c++/14/complex:45,
from /usr/include/c++/14/ccomplex:39,
from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:127,
from a.cc:1:
/usr/include/c++/14/ostream:116:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(__ostream_type& (*)(__ostream_type&)) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>]'
116 | operator<<(__ostream_type& (*__pf)(__ostream_type&))
| ^~~~~~~~
/usr/include/c++/14/ostream:116:36: note: no known conversion for argument 1 from 'std::vector<char>' to 'std::basic_ostream<char>::__ostream_type& (*)(std::basic_ostream<char>::__ostream_type&)' {aka 'std::basic_ostream<char>& (*)(std::basic_ostream<char>&)'}
116 | operator<<(__ostream_type& (*__pf)(__ostream_type&))
| ~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~
/usr/include/c++/14/ostream:125:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(__ios_type& (*)(__ios_type&)) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>; __ios_type = std::basic_ios<char>]'
125 | operator<<(__ios_type& (*__pf)(__ios_type&))
| ^~~~~~~~
/usr/include/c++/14/ostream:125:32: note: no known conversion for argument 1 from 'std::vector<char>' to 'std::basic_ostream<char>::__ios_type& (*)(std::basic_ostream<char>::__ios_type&)' {aka 'std::basic_ios<char>& (*)(std::basic_ios<char>&)'}
125 | operator<<(__ios_type& (*__pf)(__ios_type&))
| ~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~
/usr/include/c++/14/ostream:135:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(std::ios_base& (*)(std::ios_base&)) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>]'
135 | operator<<(ios_base& (*__pf) (ios_base&))
| ^~~~~~~~
/usr/include/c++/14/ostream:135:30: note: no known conversion for argument 1 from 'std::vector<char>' to 'std::ios_base& (*)(std::ios_base&)'
135 | operator<<(ios_base& (*__pf) (ios_base&))
| ~~~~~~~~~~~~^~~~~~~~~~~~~~~~~
/usr/include/c++/14/ostream:174:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(long int) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>]'
174 | operator<<(long __n)
| ^~~~~~~~
/usr/include/c++/14/ostream:174:23: note: no known conversion for argument 1 from 'std::vector<char>' to 'long int'
174 | operator<<(long __n)
| ~~~~~^~~
/usr/include/c++/14/ostream:178:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(long unsigned int) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>]'
178 | operator<<(unsigned long __n)
| ^~~~~~~~
/usr/include/c++/14/ostream:178:32: note: no known conversion for argument 1 from 'std::vector<char>' to 'long unsigned int'
178 | operator<<(unsigned long __n)
| ~~~~~~~~~~~~~~^~~
/usr/include/c++/14/ostream:182:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(bool) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>]'
182 | operator<<(bool __n)
| ^~~~~~~~
/usr/include/c++/14/ostream:182:23: note: no known conversion for argument 1 from 'std::vector<char>' to 'bool'
182 | operator<<(bool __n)
| ~~~~~^~~
In file included from /usr/include/c++/14/ostream:1022:
/usr/include/c++/14/bits/ostream.tcc:96:5: note: candidate: 'std::basic_ostream<_CharT, _Traits>& std::basic_ostream<_CharT, _Traits>::operator<<(short int) [with _CharT = char; _Traits = std::char_traits<char>]'
96 | basic_ostream<_CharT, _Traits>::
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/c++/14/bits/ostream.tcc:97:22: note: no known conversion for argument 1 from 'std::vector<char>' to 'short int'
97 | operator<<(short __n)
| ~~~~~~^~~
/usr/include/c++/14/ostream:189:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(short unsigned int) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>]'
189 | operator<<(unsigned short __n)
| ^~~~~~~~
/usr/include/c++/14/ostream:189:33: note: no known conversion for argument 1 from 'std::vector<char>' to 'short unsigned int'
189 | operator<<(unsigned short __n)
| ~~~~~~~~~~~~~~~^~~
/usr/include/c++/14/bits/ostream.tcc:110:5: note: candidate: 'std::basic_ostream<_CharT, _Traits>& std::basic_ostream<_CharT, _Traits>::operator<<(int) [with _CharT = char; _Traits = std::char_traits<char>]'
110 | basic_ostream<_CharT, _Traits>::
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/c++/14/bits/ostream.tcc:111:20: note: no known conversion for argument 1 from 'std::vector<char>' to 'int'
111 | operator<<(int __n)
| ~~~~^~~
/usr/include/c++/14/ostream:200:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(unsigned int) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>]'
200 | operator<<(unsigned int __n)
| ^~~~~~~~
/usr/include/c++/14/ostream:200:31: note: no known conversion for argument 1 from 'std::vector<char>' to 'unsigned int'
200 | operator<<(unsigned int __n)
| ~~~~~~~~~~~~~^~~
/usr/include/c++/14/ostream:211:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(long long int) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>]'
211 | operator<<(long long __n)
| ^~~~~~~~
/usr/include/c++/14/ostream:211:28: note: no known conversion for argument 1 from 'std::vector<char>' to 'long long int'
211 | operator<<(long long __n)
| ~~~~~~~~~~^~~
/usr/include/c++/14/ostream:215:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(long long unsigned int) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>]'
215 | operator<<(unsigned long long __n)
| ^~~~~~~~
/usr/include/c++/14/ostream:215:37: note: no known conversion for argument 1 from 'std::vector<char>' to 'long long unsigned int'
215 | operator<<(unsigned long long __n)
| ~~~~~~~~~~~~~~~~~~~^~~
/usr/include/c++/14/ostream:231:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(double) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>]'
231 | operator<<(double __f)
| ^~~~~~~~
/usr/include/c++/14/ostream:231:25: note: no known conversion for argument 1 from 'std::vector<char>' to 'double'
231 | operator<<(double __f)
| ~~~~~~~^~~
/usr/include/c++/14/ostream:235:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(float) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>]'
235 | operator<<(float __f)
| ^~~~~~~~
/usr/include/c++/14/ostream:235:24: note: no known conversion for argument 1 from 'std::vector<char>' to 'float'
235 | operator<<(float __f)
| ~~~~~~^~~
/usr/include/c++/14/ostream:243:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(long double) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>]'
243 | operator<<(long double __f)
| ^~~~~~~~
/usr/include/c++/14/ostream:243:30: note: no known conversion for argument 1 from 'std::vector<char>' to 'long double'
243 | operator<<(long double __f)
| ~~~~~~~~~~~~^~~
/usr/include/c++/14/ostream:301:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(const void*) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>]'
301 | operator<<(const void* __p)
| ^~~~~~~~
/usr/include/c++/14/ostream:301:30: note: no known conversion for argument 1 from 'std::vector<char>' to 'const void*'
301 | operator<<(const void* __p)
| ~~~~~~~~~~~~^~~
/usr/include/c++/14/ostream:306:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(std::nullptr_t) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>; std::nullptr_t = std::nullptr_t]'
306 | operator<<(nullptr_t)
| ^~~~~~~~
/usr/include/c++/14/ostream:306:18: note: no known conversion for argument 1 from 'std::vector<char>' to 'std::nullptr_t'
306 | operator<<(nullptr_t)
| |
s496086670 | 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:16: error: extended character ’ is not valid in an identifier
9 | b [ i ][ j ] = ’# ’;
| ^
a.cc:9:17: error: stray '#' in program
9 | b [ i ][ j ] = ’# ’;
| ^
a.cc:9:19: error: extended character ’ is not valid in an identifier
9 | b [ i ][ j ] = ’# ’;
| ^
a.cc: In function 'int main()':
a.cc:3:13: 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:18: error: 'i' was not declared in this scope
7 | for ( int i = 0; i < H + 2; i ++)
| ^
a.cc:8:18: 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 ;
| ^~~~
|
s741887791 | p03712 | C++ | #include<bits/stdc++.h>
using namespace std;
int main() {
int h, w;
int a[h+2][w+2];
for(int i(0);i<h+2;i++)
for(int j(0);j<w+2;j++)
a[i][j]='#';
for ( int i = 0; i < H ; i ++)
scanf ("% s " , a [ i ]);
/*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: In function 'int main()':
a.cc:10:24: error: 'H' was not declared in this scope
10 | for ( int i = 0; i < H ; i ++)
| ^
|
s923520334 | p03712 | C++ | #include <bits/stdc++.h>
using namespace std;
int main() {
int h,w;
cin >> h >> w;
vector<char>pic(w);
for(int i=0;i<w+2;i++){
cout << "#" ; //フレーム上辺
}
cout << endl;
for(int i=0;i<h;i++){
cout << "#" ;
for(int j=0;j<w;i++){
cin >> pic.at(j) ;
}
cout << pic ;
cout<<"#"<< endl;
}
for(int i=0;i<w+2;i++)
cout <<"#"<<endl;
} | a.cc: In function 'int main()':
a.cc:20:10: error: no match for 'operator<<' (operand types are 'std::ostream' {aka 'std::basic_ostream<char>'} and 'std::vector<char>')
20 | cout << pic ;
| ~~~~ ^~ ~~~
| | |
| | std::vector<char>
| std::ostream {aka std::basic_ostream<char>}
In file included from /usr/include/c++/14/istream:41,
from /usr/include/c++/14/sstream:40,
from /usr/include/c++/14/complex:45,
from /usr/include/c++/14/ccomplex:39,
from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:127,
from a.cc:1:
/usr/include/c++/14/ostream:116:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(__ostream_type& (*)(__ostream_type&)) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>]'
116 | operator<<(__ostream_type& (*__pf)(__ostream_type&))
| ^~~~~~~~
/usr/include/c++/14/ostream:116:36: note: no known conversion for argument 1 from 'std::vector<char>' to 'std::basic_ostream<char>::__ostream_type& (*)(std::basic_ostream<char>::__ostream_type&)' {aka 'std::basic_ostream<char>& (*)(std::basic_ostream<char>&)'}
116 | operator<<(__ostream_type& (*__pf)(__ostream_type&))
| ~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~
/usr/include/c++/14/ostream:125:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(__ios_type& (*)(__ios_type&)) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>; __ios_type = std::basic_ios<char>]'
125 | operator<<(__ios_type& (*__pf)(__ios_type&))
| ^~~~~~~~
/usr/include/c++/14/ostream:125:32: note: no known conversion for argument 1 from 'std::vector<char>' to 'std::basic_ostream<char>::__ios_type& (*)(std::basic_ostream<char>::__ios_type&)' {aka 'std::basic_ios<char>& (*)(std::basic_ios<char>&)'}
125 | operator<<(__ios_type& (*__pf)(__ios_type&))
| ~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~
/usr/include/c++/14/ostream:135:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(std::ios_base& (*)(std::ios_base&)) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>]'
135 | operator<<(ios_base& (*__pf) (ios_base&))
| ^~~~~~~~
/usr/include/c++/14/ostream:135:30: note: no known conversion for argument 1 from 'std::vector<char>' to 'std::ios_base& (*)(std::ios_base&)'
135 | operator<<(ios_base& (*__pf) (ios_base&))
| ~~~~~~~~~~~~^~~~~~~~~~~~~~~~~
/usr/include/c++/14/ostream:174:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(long int) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>]'
174 | operator<<(long __n)
| ^~~~~~~~
/usr/include/c++/14/ostream:174:23: note: no known conversion for argument 1 from 'std::vector<char>' to 'long int'
174 | operator<<(long __n)
| ~~~~~^~~
/usr/include/c++/14/ostream:178:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(long unsigned int) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>]'
178 | operator<<(unsigned long __n)
| ^~~~~~~~
/usr/include/c++/14/ostream:178:32: note: no known conversion for argument 1 from 'std::vector<char>' to 'long unsigned int'
178 | operator<<(unsigned long __n)
| ~~~~~~~~~~~~~~^~~
/usr/include/c++/14/ostream:182:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(bool) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>]'
182 | operator<<(bool __n)
| ^~~~~~~~
/usr/include/c++/14/ostream:182:23: note: no known conversion for argument 1 from 'std::vector<char>' to 'bool'
182 | operator<<(bool __n)
| ~~~~~^~~
In file included from /usr/include/c++/14/ostream:1022:
/usr/include/c++/14/bits/ostream.tcc:96:5: note: candidate: 'std::basic_ostream<_CharT, _Traits>& std::basic_ostream<_CharT, _Traits>::operator<<(short int) [with _CharT = char; _Traits = std::char_traits<char>]'
96 | basic_ostream<_CharT, _Traits>::
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/c++/14/bits/ostream.tcc:97:22: note: no known conversion for argument 1 from 'std::vector<char>' to 'short int'
97 | operator<<(short __n)
| ~~~~~~^~~
/usr/include/c++/14/ostream:189:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(short unsigned int) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>]'
189 | operator<<(unsigned short __n)
| ^~~~~~~~
/usr/include/c++/14/ostream:189:33: note: no known conversion for argument 1 from 'std::vector<char>' to 'short unsigned int'
189 | operator<<(unsigned short __n)
| ~~~~~~~~~~~~~~~^~~
/usr/include/c++/14/bits/ostream.tcc:110:5: note: candidate: 'std::basic_ostream<_CharT, _Traits>& std::basic_ostream<_CharT, _Traits>::operator<<(int) [with _CharT = char; _Traits = std::char_traits<char>]'
110 | basic_ostream<_CharT, _Traits>::
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/c++/14/bits/ostream.tcc:111:20: note: no known conversion for argument 1 from 'std::vector<char>' to 'int'
111 | operator<<(int __n)
| ~~~~^~~
/usr/include/c++/14/ostream:200:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(unsigned int) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>]'
200 | operator<<(unsigned int __n)
| ^~~~~~~~
/usr/include/c++/14/ostream:200:31: note: no known conversion for argument 1 from 'std::vector<char>' to 'unsigned int'
200 | operator<<(unsigned int __n)
| ~~~~~~~~~~~~~^~~
/usr/include/c++/14/ostream:211:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(long long int) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>]'
211 | operator<<(long long __n)
| ^~~~~~~~
/usr/include/c++/14/ostream:211:28: note: no known conversion for argument 1 from 'std::vector<char>' to 'long long int'
211 | operator<<(long long __n)
| ~~~~~~~~~~^~~
/usr/include/c++/14/ostream:215:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(long long unsigned int) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>]'
215 | operator<<(unsigned long long __n)
| ^~~~~~~~
/usr/include/c++/14/ostream:215:37: note: no known conversion for argument 1 from 'std::vector<char>' to 'long long unsigned int'
215 | operator<<(unsigned long long __n)
| ~~~~~~~~~~~~~~~~~~~^~~
/usr/include/c++/14/ostream:231:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(double) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>]'
231 | operator<<(double __f)
| ^~~~~~~~
/usr/include/c++/14/ostream:231:25: note: no known conversion for argument 1 from 'std::vector<char>' to 'double'
231 | operator<<(double __f)
| ~~~~~~~^~~
/usr/include/c++/14/ostream:235:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(float) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>]'
235 | operator<<(float __f)
| ^~~~~~~~
/usr/include/c++/14/ostream:235:24: note: no known conversion for argument 1 from 'std::vector<char>' to 'float'
235 | operator<<(float __f)
| ~~~~~~^~~
/usr/include/c++/14/ostream:243:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(long double) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>]'
243 | operator<<(long double __f)
| ^~~~~~~~
/usr/include/c++/14/ostream:243:30: note: no known conversion for argument 1 from 'std::vector<char>' to 'long double'
243 | operator<<(long double __f)
| ~~~~~~~~~~~~^~~
/usr/include/c++/14/ostream:301:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(const void*) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>]'
301 | operator<<(const void* __p)
| ^~~~~~~~
/usr/include/c++/14/ostream:301:30: note: no known conversion for argument 1 from 'std::vector<char>' to 'const void*'
301 | operator<<(const void* __p)
| ~~~~~~~~~~~~^~~
/usr/include/c++/14/ostream:306:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(std::nullptr_t) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>; std::nullptr_t = std::nullptr_t]'
306 | operator<<(nullptr_t)
| ^~~~~~~~
/usr/include/c++/14/ostream:306:18: note: no known conversion for argument 1 from 'std::vector<char>' to 'std::nullptr_t'
306 | operator<<(nullptr_t)
| |
s334770386 | p03712 | C++ | #include <iostream>
using namespace std;
int main() {
int h, w;
cin >> h >> w;
for(int j = 0 ; j < w + 2 ; j++) cout << "#" ;
cout << endl;
for(int i = 0 ; i < h ; i++){
string s;
cin >> s;
cout << "#" << s << "#" << endl;
}
for(int j = 0 ; j < w + 2 ; j++) cout << "#" <<;
cout << endl;
}
| a.cc: In function 'int main()':
a.cc:16:52: error: expected primary-expression before ';' token
16 | for(int j = 0 ; j < w + 2 ; j++) cout << "#" <<;
| ^
|
s223717295 | p03712 | C++ | #include <bits/stdc++.h>
using namespace std;
int main() {
int H,W;
cin >> H >> W;
vector<char> vec(W+2,'#');
vec2 = vec;
for (int A=0; A<W+2; A++) cout << vec.at(A) <<endl;
for (int i=0; i<H+2; i++) {
for (int j=1; j<W+1; j++) cin >> vec.at(j);
for (int k=0; k<W+2; k++) cout << vec.at(k) <<endl;
}
vector<char> vec2(W+2,'#');
for (int k=0; k<W+2; k++) cout << vec2.at(k) <<endl;
}
| a.cc: In function 'int main()':
a.cc:8:3: error: 'vec2' was not declared in this scope; did you mean 'vec'?
8 | vec2 = vec;
| ^~~~
| vec
|
s265204397 | p03712 | C++ | #include <bits/stdc++.h>
using namespace std;
int main() {
int H,W;
cin >> H >> W;
vector<char> vec(W+2,'#');
vec2 = vec;
for (int A=0; A<W+2; A++) cout << vec.at(A) <<endl;
for (int i=0; i<H+2; i++) {
for (int j=1; j<W+1; j++) cin >> vec.at(j);
for (int k=0; k<W+2; k++) cout << vec.at(k) <<endl;
}
vector<char> vec2(W+2,'#');
for (int k=0; k<W+2; k++) cout << vec2.at(k) <<endl;
}
| a.cc: In function 'int main()':
a.cc:8:3: error: 'vec2' was not declared in this scope; did you mean 'vec'?
8 | vec2 = vec;
| ^~~~
| vec
|
s191338062 | p03712 | C++ | #include <bits/stdc++.h>
using namespace std;
int main() {
int H,W;
cin >> H >> W;
vector<char> vec(W+2,'#');
vec2 = vec;
for (int A=0; A<W+2; A++) cout << vec.at(A) <<endl;
for (int i=0; i<H+2; i++) {
for (int j=1; j<W+1; j++) cin >> vec.at(j);
for (int k=0; k<W+2; k++) cout << vec.at(k) <<endl;
}
vector<char> vec2(W+2,'#')
for (int k=0; k<W+2; k++) cout << vec2.at(k) <<endl;
}
| a.cc: In function 'int main()':
a.cc:8:3: error: 'vec2' was not declared in this scope; did you mean 'vec'?
8 | vec2 = vec;
| ^~~~
| vec
a.cc:15:17: error: 'k' was not declared in this scope
15 | for (int k=0; k<W+2; k++) cout << vec2.at(k) <<endl;
| ^
|
s271406913 | p03712 | C++ | #include <bits/stdc++.h>
using namespace std;
int main() {
int H,W;
cin >> H >> W;
vector<char> vec(W+2,'#');
vec2 = vec;
for (int A=0; A<W+2; A++) cout << vec.at(A) <<endl;
for (int i=0; i<H+2; i++) {
for (int j=1; j<W+1; j++) cin >> vec.at(j);
for (int k=0; k<W+2; k++) cout << vec.at(k) <<endl;
}
vector<char> vec(W+2,'#')
for (int k=0; k<W+2; k++) cout << vec2.at(k) <<endl;
}
| a.cc: In function 'int main()':
a.cc:8:3: error: 'vec2' was not declared in this scope; did you mean 'vec'?
8 | vec2 = vec;
| ^~~~
| vec
a.cc:14:16: error: redeclaration of 'std::vector<char> vec'
14 | vector<char> vec(W+2,'#')
| ^~~
a.cc:7:16: note: 'std::vector<char> vec' previously declared here
7 | vector<char> vec(W+2,'#');
| ^~~
a.cc:15:17: error: 'k' was not declared in this scope
15 | for (int k=0; k<W+2; k++) cout << vec2.at(k) <<endl;
| ^
|
s913919574 | p03712 | C++ | #include <bits/stdc++.h>
using namespace std;
int main() {
int H,W;
cin >> H >> W;
vector<char> vec(W+2,'#');
vec2 = vec;
for (int A=0; A<W+2; A++) cout << vec.at(A) <<endl;
for (int i=0; i<H+2; i++) {
for (int j=1; j<W+1; j++) cin >> vec.at(j);
for (int k=0; k<W+2; k++) cout << vec.at(k) <<endl;
}
for (int k=0; k<W+2; k++) cout << vec2.at(k) <<endl;
}
| a.cc: In function 'int main()':
a.cc:8:3: error: 'vec2' was not declared in this scope; did you mean 'vec'?
8 | vec2 = vec;
| ^~~~
| vec
|
s488997384 | p03712 | C++ | #include <bits/stdc++.h>
using namespace std;
int main() {
int H,W;
cin >>H>>W;
vector<string> vec(i)
for (int i = 0;i < H;i++) {
cin >> vec(i)
}
for (int i = 0;i < W+1;i++) cout <<"#";
cout<<endl;
for (int i = 0;i < H;i++) cout <<"#"<<vec(i)<<"#"<<endl;
for(int i = 0;i < H;i++) {
cin >> vec(i)
}
}
| a.cc: In function 'int main()':
a.cc:7:22: error: 'i' was not declared in this scope
7 | vector<string> vec(i)
| ^
a.cc:8:3: error: expected ',' or ';' before 'for'
8 | for (int i = 0;i < H;i++) {
| ^~~
a.cc:13:44: error: no match for call to '(std::vector<std::__cxx11::basic_string<char> >) (int&)'
13 | for (int i = 0;i < H;i++) cout <<"#"<<vec(i)<<"#"<<endl;
| ~~~^~~
a.cc:15:15: error: no match for call to '(std::vector<std::__cxx11::basic_string<char> >) (int&)'
15 | cin >> vec(i)
| ~~~^~~
|
s998794785 | p03712 | C++ | #include <bits/stdc++.h>
using namespace std;
int main() {
int H,W;
cin >>H>>W;
vector<string> vec(i)
for (int i = 0;i < H;i++) {
cin >> vec(i)
}
for (int i = 0;i < W+1;i++) cout <<"#";
cout<<endl;
for (int i = 0,i < H;i++) cout <<"#"<<vec(i)<<"#"<<endl;
for(int i = 0,i < H;i++) {
cin >> vec(i)
}
} | a.cc: In function 'int main()':
a.cc:7:22: error: 'i' was not declared in this scope
7 | vector<string> vec(i)
| ^
a.cc:8:3: error: expected ',' or ';' before 'for'
8 | for (int i = 0;i < H;i++) {
| ^~~
a.cc:13:19: error: expected ';' before '<' token
13 | for (int i = 0,i < H;i++) cout <<"#"<<vec(i)<<"#"<<endl;
| ^~
| ;
a.cc:13:20: error: expected primary-expression before '<' token
13 | for (int i = 0,i < H;i++) cout <<"#"<<vec(i)<<"#"<<endl;
| ^
a.cc:13:44: error: no match for call to '(std::vector<std::__cxx11::basic_string<char> >) (int&)'
13 | for (int i = 0,i < H;i++) cout <<"#"<<vec(i)<<"#"<<endl;
| ~~~^~~
a.cc:14:18: error: expected ';' before '<' token
14 | for(int i = 0,i < H;i++) {
| ^~
| ;
a.cc:14:19: error: expected primary-expression before '<' token
14 | for(int i = 0,i < H;i++) {
| ^
a.cc:15:15: error: no match for call to '(std::vector<std::__cxx11::basic_string<char> >) (int&)'
15 | cin >> vec(i)
| ~~~^~~
|
s525740849 | p03712 | C++ | #include <bits/stdc++.h>
using namespace std;
int main() {
int H,W;
cin >> H >> W;
vector<char> vec(W,'#');
for (int A=0; A<W; A++) cout << vec.at(A) <<endl;
for (int i=0; i<H; i++) {
for (int j=1; j<W-1; j++) cin >> vec.at(j);
for (int k=0; k<W; k++) cout << vec.at(k) <<endl;
}
vector<char> vec2(W,'#')
for (int B=0; B<W; B++) cout << vec2.at(B) <<endl;
}
| a.cc: In function 'int main()':
a.cc:14:3: error: expected ',' or ';' before 'for'
14 | for (int B=0; B<W; B++) cout << vec2.at(B) <<endl;
| ^~~
a.cc:14:17: error: 'B' was not declared in this scope
14 | for (int B=0; B<W; B++) cout << vec2.at(B) <<endl;
| ^
|
s403645864 | p03712 | C++ | #include <bits/stdc++.h>
using namespace std;
int main() {
int H,W;
cin >> H >> W;
vector<char> vec(W,'#');
vec2 = vec;
for (int A=0; A<W; A++) cout << vec.at(A) <<endl;
for (int i=0; i<H; i++) {
for (int j=1; j<W-1; j++) cin >> vec.at(j);
for (int k=0; k<W; k++) cout << vec.at(k) <<endl;
}
for (int k=0; k<W; k++) cout << vec2.at(k) <<endl;
}
| a.cc: In function 'int main()':
a.cc:8:3: error: 'vec2' was not declared in this scope; did you mean 'vec'?
8 | vec2 = vec;
| ^~~~
| vec
|
s654828081 | p03712 | C++ | #include <bits/stdc++.h>
using namespace std;
int main() {
int H,W;
cin >> H >> W;
vector<char> vec(W,'#');
int i,j;
for (int i=0; i<H; i++) {
for (int j=1; j<=vec.size(); j++) {
cin >> vec.at(j);
}
cout << vec <<endl;
}
}
| a.cc: In function 'int main()':
a.cc:13:10: error: no match for 'operator<<' (operand types are 'std::ostream' {aka 'std::basic_ostream<char>'} and 'std::vector<char>')
13 | cout << vec <<endl;
| ~~~~ ^~ ~~~
| | |
| | std::vector<char>
| std::ostream {aka std::basic_ostream<char>}
In file included from /usr/include/c++/14/istream:41,
from /usr/include/c++/14/sstream:40,
from /usr/include/c++/14/complex:45,
from /usr/include/c++/14/ccomplex:39,
from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:127,
from a.cc:1:
/usr/include/c++/14/ostream:116:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(__ostream_type& (*)(__ostream_type&)) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>]'
116 | operator<<(__ostream_type& (*__pf)(__ostream_type&))
| ^~~~~~~~
/usr/include/c++/14/ostream:116:36: note: no known conversion for argument 1 from 'std::vector<char>' to 'std::basic_ostream<char>::__ostream_type& (*)(std::basic_ostream<char>::__ostream_type&)' {aka 'std::basic_ostream<char>& (*)(std::basic_ostream<char>&)'}
116 | operator<<(__ostream_type& (*__pf)(__ostream_type&))
| ~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~
/usr/include/c++/14/ostream:125:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(__ios_type& (*)(__ios_type&)) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>; __ios_type = std::basic_ios<char>]'
125 | operator<<(__ios_type& (*__pf)(__ios_type&))
| ^~~~~~~~
/usr/include/c++/14/ostream:125:32: note: no known conversion for argument 1 from 'std::vector<char>' to 'std::basic_ostream<char>::__ios_type& (*)(std::basic_ostream<char>::__ios_type&)' {aka 'std::basic_ios<char>& (*)(std::basic_ios<char>&)'}
125 | operator<<(__ios_type& (*__pf)(__ios_type&))
| ~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~
/usr/include/c++/14/ostream:135:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(std::ios_base& (*)(std::ios_base&)) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>]'
135 | operator<<(ios_base& (*__pf) (ios_base&))
| ^~~~~~~~
/usr/include/c++/14/ostream:135:30: note: no known conversion for argument 1 from 'std::vector<char>' to 'std::ios_base& (*)(std::ios_base&)'
135 | operator<<(ios_base& (*__pf) (ios_base&))
| ~~~~~~~~~~~~^~~~~~~~~~~~~~~~~
/usr/include/c++/14/ostream:174:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(long int) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>]'
174 | operator<<(long __n)
| ^~~~~~~~
/usr/include/c++/14/ostream:174:23: note: no known conversion for argument 1 from 'std::vector<char>' to 'long int'
174 | operator<<(long __n)
| ~~~~~^~~
/usr/include/c++/14/ostream:178:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(long unsigned int) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>]'
178 | operator<<(unsigned long __n)
| ^~~~~~~~
/usr/include/c++/14/ostream:178:32: note: no known conversion for argument 1 from 'std::vector<char>' to 'long unsigned int'
178 | operator<<(unsigned long __n)
| ~~~~~~~~~~~~~~^~~
/usr/include/c++/14/ostream:182:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(bool) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>]'
182 | operator<<(bool __n)
| ^~~~~~~~
/usr/include/c++/14/ostream:182:23: note: no known conversion for argument 1 from 'std::vector<char>' to 'bool'
182 | operator<<(bool __n)
| ~~~~~^~~
In file included from /usr/include/c++/14/ostream:1022:
/usr/include/c++/14/bits/ostream.tcc:96:5: note: candidate: 'std::basic_ostream<_CharT, _Traits>& std::basic_ostream<_CharT, _Traits>::operator<<(short int) [with _CharT = char; _Traits = std::char_traits<char>]'
96 | basic_ostream<_CharT, _Traits>::
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/c++/14/bits/ostream.tcc:97:22: note: no known conversion for argument 1 from 'std::vector<char>' to 'short int'
97 | operator<<(short __n)
| ~~~~~~^~~
/usr/include/c++/14/ostream:189:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(short unsigned int) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>]'
189 | operator<<(unsigned short __n)
| ^~~~~~~~
/usr/include/c++/14/ostream:189:33: note: no known conversion for argument 1 from 'std::vector<char>' to 'short unsigned int'
189 | operator<<(unsigned short __n)
| ~~~~~~~~~~~~~~~^~~
/usr/include/c++/14/bits/ostream.tcc:110:5: note: candidate: 'std::basic_ostream<_CharT, _Traits>& std::basic_ostream<_CharT, _Traits>::operator<<(int) [with _CharT = char; _Traits = std::char_traits<char>]'
110 | basic_ostream<_CharT, _Traits>::
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/c++/14/bits/ostream.tcc:111:20: note: no known conversion for argument 1 from 'std::vector<char>' to 'int'
111 | operator<<(int __n)
| ~~~~^~~
/usr/include/c++/14/ostream:200:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(unsigned int) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>]'
200 | operator<<(unsigned int __n)
| ^~~~~~~~
/usr/include/c++/14/ostream:200:31: note: no known conversion for argument 1 from 'std::vector<char>' to 'unsigned int'
200 | operator<<(unsigned int __n)
| ~~~~~~~~~~~~~^~~
/usr/include/c++/14/ostream:211:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(long long int) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>]'
211 | operator<<(long long __n)
| ^~~~~~~~
/usr/include/c++/14/ostream:211:28: note: no known conversion for argument 1 from 'std::vector<char>' to 'long long int'
211 | operator<<(long long __n)
| ~~~~~~~~~~^~~
/usr/include/c++/14/ostream:215:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(long long unsigned int) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>]'
215 | operator<<(unsigned long long __n)
| ^~~~~~~~
/usr/include/c++/14/ostream:215:37: note: no known conversion for argument 1 from 'std::vector<char>' to 'long long unsigned int'
215 | operator<<(unsigned long long __n)
| ~~~~~~~~~~~~~~~~~~~^~~
/usr/include/c++/14/ostream:231:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(double) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>]'
231 | operator<<(double __f)
| ^~~~~~~~
/usr/include/c++/14/ostream:231:25: note: no known conversion for argument 1 from 'std::vector<char>' to 'double'
231 | operator<<(double __f)
| ~~~~~~~^~~
/usr/include/c++/14/ostream:235:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(float) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>]'
235 | operator<<(float __f)
| ^~~~~~~~
/usr/include/c++/14/ostream:235:24: note: no known conversion for argument 1 from 'std::vector<char>' to 'float'
235 | operator<<(float __f)
| ~~~~~~^~~
/usr/include/c++/14/ostream:243:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(long double) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>]'
243 | operator<<(long double __f)
| ^~~~~~~~
/usr/include/c++/14/ostream:243:30: note: no known conversion for argument 1 from 'std::vector<char>' to 'long double'
243 | operator<<(long double __f)
| ~~~~~~~~~~~~^~~
/usr/include/c++/14/ostream:301:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(const void*) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>]'
301 | operator<<(const void* __p)
| ^~~~~~~~
/usr/include/c++/14/ostream:301:30: note: no known conversion for argument 1 from 'std::vector<char>' to 'const void*'
301 | operator<<(const void* __p)
| ~~~~~~~~~~~~^~~
/usr/include/c++/14/ostream:306:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(std::nullptr_t) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>; std::nullptr_t = std::nullptr_t]'
306 | operator<<(nullptr_t)
| ^~~~~~~~
/usr/include/c++/14/ostream:306:18: note: no known conversion for argument 1 from 'std::vector<char>' to 'std::nullptr_t'
306 | operator<<(nullptr_t)
|
s855620680 | p03712 | C++ | #include <bits/stdc++.h>
using namespace std;
int main() {
int H,W;
cin >> H >> W;
vector<char> vec(W,#);
int i,j;
for (int i=0; i<H; i++) {
for (int j=1; j<=vec.size(); j++) {
cin >> vec.at(j);
}
cout << vec <<endl;
}
}
| a.cc:7:22: error: stray '#' in program
7 | vector<char> vec(W,#);
| ^
a.cc: In function 'int main()':
a.cc:7:23: error: expected primary-expression before ')' token
7 | vector<char> vec(W,#);
| ^
a.cc:13:10: error: no match for 'operator<<' (operand types are 'std::ostream' {aka 'std::basic_ostream<char>'} and 'std::vector<char>')
13 | cout << vec <<endl;
| ~~~~ ^~ ~~~
| | |
| | std::vector<char>
| std::ostream {aka std::basic_ostream<char>}
In file included from /usr/include/c++/14/istream:41,
from /usr/include/c++/14/sstream:40,
from /usr/include/c++/14/complex:45,
from /usr/include/c++/14/ccomplex:39,
from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:127,
from a.cc:1:
/usr/include/c++/14/ostream:116:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(__ostream_type& (*)(__ostream_type&)) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>]'
116 | operator<<(__ostream_type& (*__pf)(__ostream_type&))
| ^~~~~~~~
/usr/include/c++/14/ostream:116:36: note: no known conversion for argument 1 from 'std::vector<char>' to 'std::basic_ostream<char>::__ostream_type& (*)(std::basic_ostream<char>::__ostream_type&)' {aka 'std::basic_ostream<char>& (*)(std::basic_ostream<char>&)'}
116 | operator<<(__ostream_type& (*__pf)(__ostream_type&))
| ~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~
/usr/include/c++/14/ostream:125:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(__ios_type& (*)(__ios_type&)) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>; __ios_type = std::basic_ios<char>]'
125 | operator<<(__ios_type& (*__pf)(__ios_type&))
| ^~~~~~~~
/usr/include/c++/14/ostream:125:32: note: no known conversion for argument 1 from 'std::vector<char>' to 'std::basic_ostream<char>::__ios_type& (*)(std::basic_ostream<char>::__ios_type&)' {aka 'std::basic_ios<char>& (*)(std::basic_ios<char>&)'}
125 | operator<<(__ios_type& (*__pf)(__ios_type&))
| ~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~
/usr/include/c++/14/ostream:135:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(std::ios_base& (*)(std::ios_base&)) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>]'
135 | operator<<(ios_base& (*__pf) (ios_base&))
| ^~~~~~~~
/usr/include/c++/14/ostream:135:30: note: no known conversion for argument 1 from 'std::vector<char>' to 'std::ios_base& (*)(std::ios_base&)'
135 | operator<<(ios_base& (*__pf) (ios_base&))
| ~~~~~~~~~~~~^~~~~~~~~~~~~~~~~
/usr/include/c++/14/ostream:174:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(long int) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>]'
174 | operator<<(long __n)
| ^~~~~~~~
/usr/include/c++/14/ostream:174:23: note: no known conversion for argument 1 from 'std::vector<char>' to 'long int'
174 | operator<<(long __n)
| ~~~~~^~~
/usr/include/c++/14/ostream:178:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(long unsigned int) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>]'
178 | operator<<(unsigned long __n)
| ^~~~~~~~
/usr/include/c++/14/ostream:178:32: note: no known conversion for argument 1 from 'std::vector<char>' to 'long unsigned int'
178 | operator<<(unsigned long __n)
| ~~~~~~~~~~~~~~^~~
/usr/include/c++/14/ostream:182:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(bool) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>]'
182 | operator<<(bool __n)
| ^~~~~~~~
/usr/include/c++/14/ostream:182:23: note: no known conversion for argument 1 from 'std::vector<char>' to 'bool'
182 | operator<<(bool __n)
| ~~~~~^~~
In file included from /usr/include/c++/14/ostream:1022:
/usr/include/c++/14/bits/ostream.tcc:96:5: note: candidate: 'std::basic_ostream<_CharT, _Traits>& std::basic_ostream<_CharT, _Traits>::operator<<(short int) [with _CharT = char; _Traits = std::char_traits<char>]'
96 | basic_ostream<_CharT, _Traits>::
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/c++/14/bits/ostream.tcc:97:22: note: no known conversion for argument 1 from 'std::vector<char>' to 'short int'
97 | operator<<(short __n)
| ~~~~~~^~~
/usr/include/c++/14/ostream:189:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(short unsigned int) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>]'
189 | operator<<(unsigned short __n)
| ^~~~~~~~
/usr/include/c++/14/ostream:189:33: note: no known conversion for argument 1 from 'std::vector<char>' to 'short unsigned int'
189 | operator<<(unsigned short __n)
| ~~~~~~~~~~~~~~~^~~
/usr/include/c++/14/bits/ostream.tcc:110:5: note: candidate: 'std::basic_ostream<_CharT, _Traits>& std::basic_ostream<_CharT, _Traits>::operator<<(int) [with _CharT = char; _Traits = std::char_traits<char>]'
110 | basic_ostream<_CharT, _Traits>::
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/c++/14/bits/ostream.tcc:111:20: note: no known conversion for argument 1 from 'std::vector<char>' to 'int'
111 | operator<<(int __n)
| ~~~~^~~
/usr/include/c++/14/ostream:200:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(unsigned int) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>]'
200 | operator<<(unsigned int __n)
| ^~~~~~~~
/usr/include/c++/14/ostream:200:31: note: no known conversion for argument 1 from 'std::vector<char>' to 'unsigned int'
200 | operator<<(unsigned int __n)
| ~~~~~~~~~~~~~^~~
/usr/include/c++/14/ostream:211:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(long long int) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>]'
211 | operator<<(long long __n)
| ^~~~~~~~
/usr/include/c++/14/ostream:211:28: note: no known conversion for argument 1 from 'std::vector<char>' to 'long long int'
211 | operator<<(long long __n)
| ~~~~~~~~~~^~~
/usr/include/c++/14/ostream:215:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(long long unsigned int) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>]'
215 | operator<<(unsigned long long __n)
| ^~~~~~~~
/usr/include/c++/14/ostream:215:37: note: no known conversion for argument 1 from 'std::vector<char>' to 'long long unsigned int'
215 | operator<<(unsigned long long __n)
| ~~~~~~~~~~~~~~~~~~~^~~
/usr/include/c++/14/ostream:231:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(double) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>]'
231 | operator<<(double __f)
| ^~~~~~~~
/usr/include/c++/14/ostream:231:25: note: no known conversion for argument 1 from 'std::vector<char>' to 'double'
231 | operator<<(double __f)
| ~~~~~~~^~~
/usr/include/c++/14/ostream:235:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(float) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>]'
235 | operator<<(float __f)
| ^~~~~~~~
/usr/include/c++/14/ostream:235:24: note: no known conversion for argument 1 from 'std::vector<char>' to 'float'
235 | operator<<(float __f)
| ~~~~~~^~~
/usr/include/c++/14/ostream:243:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(long double) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>]'
243 | operator<<(long double __f)
| ^~~~~~~~
/usr/include/c++/14/ostream:243:30: note: no known conversion for argument 1 from 'std::vector<char>' to 'long double'
243 | operator<<(long double __f)
| ~~~~~~~~~~~~^~~
/usr/include/c++/14/ostream:301:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(const void*) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>]'
301 | operator<<(const void* __p)
| ^~~~~~~~
/usr/include/c++/14/ostream:301:30: note: no known conversion for argument 1 from 'std::vector<char>' to 'const void*'
301 | operator<<(const void* __p)
| ~~~~~~~~~~~~^~~
/usr/include/c++/14/ostream:306:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(std::nullptr_t) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>; std::nullptr_t = std::nul |
s048432602 | p03712 | C++ | #include <bits/stdc++.h>
using namespace std;
int main() {
int H,W;
cin >> H >> W;
vector<char> vec(W,#)
int i,j;
for (int i=0; i<H; i++) {
for (int j=1; j<=vec.size(); j++) {
cin >> vec.at(j);
}
cout << vec <<endl;
}
}
| a.cc:7:22: error: stray '#' in program
7 | vector<char> vec(W,#)
| ^
a.cc: In function 'int main()':
a.cc:7:23: error: expected primary-expression before ')' token
7 | vector<char> vec(W,#)
| ^
a.cc:8:3: error: expected ',' or ';' before 'int'
8 | int i,j;
| ^~~
a.cc:13:10: error: no match for 'operator<<' (operand types are 'std::ostream' {aka 'std::basic_ostream<char>'} and 'std::vector<char>')
13 | cout << vec <<endl;
| ~~~~ ^~ ~~~
| | |
| | std::vector<char>
| std::ostream {aka std::basic_ostream<char>}
In file included from /usr/include/c++/14/istream:41,
from /usr/include/c++/14/sstream:40,
from /usr/include/c++/14/complex:45,
from /usr/include/c++/14/ccomplex:39,
from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:127,
from a.cc:1:
/usr/include/c++/14/ostream:116:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(__ostream_type& (*)(__ostream_type&)) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>]'
116 | operator<<(__ostream_type& (*__pf)(__ostream_type&))
| ^~~~~~~~
/usr/include/c++/14/ostream:116:36: note: no known conversion for argument 1 from 'std::vector<char>' to 'std::basic_ostream<char>::__ostream_type& (*)(std::basic_ostream<char>::__ostream_type&)' {aka 'std::basic_ostream<char>& (*)(std::basic_ostream<char>&)'}
116 | operator<<(__ostream_type& (*__pf)(__ostream_type&))
| ~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~
/usr/include/c++/14/ostream:125:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(__ios_type& (*)(__ios_type&)) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>; __ios_type = std::basic_ios<char>]'
125 | operator<<(__ios_type& (*__pf)(__ios_type&))
| ^~~~~~~~
/usr/include/c++/14/ostream:125:32: note: no known conversion for argument 1 from 'std::vector<char>' to 'std::basic_ostream<char>::__ios_type& (*)(std::basic_ostream<char>::__ios_type&)' {aka 'std::basic_ios<char>& (*)(std::basic_ios<char>&)'}
125 | operator<<(__ios_type& (*__pf)(__ios_type&))
| ~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~
/usr/include/c++/14/ostream:135:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(std::ios_base& (*)(std::ios_base&)) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>]'
135 | operator<<(ios_base& (*__pf) (ios_base&))
| ^~~~~~~~
/usr/include/c++/14/ostream:135:30: note: no known conversion for argument 1 from 'std::vector<char>' to 'std::ios_base& (*)(std::ios_base&)'
135 | operator<<(ios_base& (*__pf) (ios_base&))
| ~~~~~~~~~~~~^~~~~~~~~~~~~~~~~
/usr/include/c++/14/ostream:174:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(long int) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>]'
174 | operator<<(long __n)
| ^~~~~~~~
/usr/include/c++/14/ostream:174:23: note: no known conversion for argument 1 from 'std::vector<char>' to 'long int'
174 | operator<<(long __n)
| ~~~~~^~~
/usr/include/c++/14/ostream:178:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(long unsigned int) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>]'
178 | operator<<(unsigned long __n)
| ^~~~~~~~
/usr/include/c++/14/ostream:178:32: note: no known conversion for argument 1 from 'std::vector<char>' to 'long unsigned int'
178 | operator<<(unsigned long __n)
| ~~~~~~~~~~~~~~^~~
/usr/include/c++/14/ostream:182:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(bool) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>]'
182 | operator<<(bool __n)
| ^~~~~~~~
/usr/include/c++/14/ostream:182:23: note: no known conversion for argument 1 from 'std::vector<char>' to 'bool'
182 | operator<<(bool __n)
| ~~~~~^~~
In file included from /usr/include/c++/14/ostream:1022:
/usr/include/c++/14/bits/ostream.tcc:96:5: note: candidate: 'std::basic_ostream<_CharT, _Traits>& std::basic_ostream<_CharT, _Traits>::operator<<(short int) [with _CharT = char; _Traits = std::char_traits<char>]'
96 | basic_ostream<_CharT, _Traits>::
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/c++/14/bits/ostream.tcc:97:22: note: no known conversion for argument 1 from 'std::vector<char>' to 'short int'
97 | operator<<(short __n)
| ~~~~~~^~~
/usr/include/c++/14/ostream:189:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(short unsigned int) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>]'
189 | operator<<(unsigned short __n)
| ^~~~~~~~
/usr/include/c++/14/ostream:189:33: note: no known conversion for argument 1 from 'std::vector<char>' to 'short unsigned int'
189 | operator<<(unsigned short __n)
| ~~~~~~~~~~~~~~~^~~
/usr/include/c++/14/bits/ostream.tcc:110:5: note: candidate: 'std::basic_ostream<_CharT, _Traits>& std::basic_ostream<_CharT, _Traits>::operator<<(int) [with _CharT = char; _Traits = std::char_traits<char>]'
110 | basic_ostream<_CharT, _Traits>::
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/c++/14/bits/ostream.tcc:111:20: note: no known conversion for argument 1 from 'std::vector<char>' to 'int'
111 | operator<<(int __n)
| ~~~~^~~
/usr/include/c++/14/ostream:200:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(unsigned int) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>]'
200 | operator<<(unsigned int __n)
| ^~~~~~~~
/usr/include/c++/14/ostream:200:31: note: no known conversion for argument 1 from 'std::vector<char>' to 'unsigned int'
200 | operator<<(unsigned int __n)
| ~~~~~~~~~~~~~^~~
/usr/include/c++/14/ostream:211:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(long long int) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>]'
211 | operator<<(long long __n)
| ^~~~~~~~
/usr/include/c++/14/ostream:211:28: note: no known conversion for argument 1 from 'std::vector<char>' to 'long long int'
211 | operator<<(long long __n)
| ~~~~~~~~~~^~~
/usr/include/c++/14/ostream:215:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(long long unsigned int) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>]'
215 | operator<<(unsigned long long __n)
| ^~~~~~~~
/usr/include/c++/14/ostream:215:37: note: no known conversion for argument 1 from 'std::vector<char>' to 'long long unsigned int'
215 | operator<<(unsigned long long __n)
| ~~~~~~~~~~~~~~~~~~~^~~
/usr/include/c++/14/ostream:231:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(double) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>]'
231 | operator<<(double __f)
| ^~~~~~~~
/usr/include/c++/14/ostream:231:25: note: no known conversion for argument 1 from 'std::vector<char>' to 'double'
231 | operator<<(double __f)
| ~~~~~~~^~~
/usr/include/c++/14/ostream:235:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(float) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>]'
235 | operator<<(float __f)
| ^~~~~~~~
/usr/include/c++/14/ostream:235:24: note: no known conversion for argument 1 from 'std::vector<char>' to 'float'
235 | operator<<(float __f)
| ~~~~~~^~~
/usr/include/c++/14/ostream:243:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(long double) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>]'
243 | operator<<(long double __f)
| ^~~~~~~~
/usr/include/c++/14/ostream:243:30: note: no known conversion for argument 1 from 'std::vector<char>' to 'long double'
243 | operator<<(long double __f)
| ~~~~~~~~~~~~^~~
/usr/include/c++/14/ostream:301:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(const void*) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>]'
301 | operator<<(const void* __p)
| ^~~~~~~~
/usr/include/c++/14/ostream:301:30: note: no known conversion for argument 1 from 'std::vector<char>' to 'const void*'
301 | operator<<(const void* __p)
| ~~~~~~~~~~~~^~~
/usr/include/c++/14/ostream:306:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(std::nullptr_t) [with _CharT = char; _Traits = std::char_t |
s433788497 | p03712 | C++ | #include <bits/stdc++.h>
using namespace std;
int main() {
int H,W;
cin >> H >> W;
vector<char> vec(W,#)
for (int i=0; i<H; i++) {
for (int j=1; j<=vec.size(); j++) {
cin >> vec.at(j);
}
cout << vec <<endl;
}
}
| a.cc:7:22: error: stray '#' in program
7 | vector<char> vec(W,#)
| ^
a.cc: In function 'int main()':
a.cc:7:23: error: expected primary-expression before ')' token
7 | vector<char> vec(W,#)
| ^
a.cc:8:3: error: expected ',' or ';' before 'for'
8 | for (int i=0; i<H; i++) {
| ^~~
a.cc:8:17: error: 'i' was not declared in this scope
8 | for (int i=0; i<H; i++) {
| ^
|
s604848557 | p03712 | C++ | #include <bits/stdc++.h>
using namespace std;
int main() {
int H,W;
cin >> H >> W;
vector<char> vec(W,#)
for (int i=1; i<H; i++) {
for (int j=1; j<=vec.size(); j++) {
cin >> vec.at(j);
}
cout << vec <<endl;
}
}
| a.cc:7:22: error: stray '#' in program
7 | vector<char> vec(W,#)
| ^
a.cc: In function 'int main()':
a.cc:7:23: error: expected primary-expression before ')' token
7 | vector<char> vec(W,#)
| ^
a.cc:8:3: error: expected ',' or ';' before 'for'
8 | for (int i=1; i<H; i++) {
| ^~~
a.cc:8:17: error: 'i' was not declared in this scope
8 | for (int i=1; i<H; i++) {
| ^
|
s969911040 | p03712 | C++ | #include <bits/stdc++.h>
using namespace std;
int main() {
int H,W;
cin >> H >> W;
vector<char> vec(W,"#")
for (int i=1; i<H; i++) {
for (int j=1; j<=vec.size(); j++) {
cin >> vec.at(j);
}
cout << vec <<endl;
}
}
| a.cc: In function 'int main()':
a.cc:7:25: error: no matching function for call to 'std::vector<char>::vector(int&, const char [2])'
7 | vector<char> vec(W,"#")
| ^
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:7:22: error: invalid conversion from 'const char*' to 'std::vector<char>::value_type' {aka 'char'} [-fpermissive]
7 | vector<char> vec(W,"#")
| ^~~
| |
| 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:7:25: note: deduced conflicting types for parameter '_InputIterator' ('int' and 'const char*')
7 | vector<char> vec(W,"#")
| ^
/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:8:3: error: expected ',' or ';' before 'for'
8 | for (int i=1; i<H; i++) {
| ^~~
a.cc:8:17: error: 'i' was not declared in this scope
8 | for (int i=1; i<H; i++) {
| ^
|
s226767989 | p03712 | C++ | #include <bits/stdc++.h>
using namespace std;
int mai(){
int H, W, Q;
cin >> H >> W;
Q = H * W;
vector<char> Ass(Q);
for(int i = 0;i<Q;i++){
cin >> Ass.at(i);
}
for(int j = 0;j<W+2;j++){
cout << "#";
}
cout << endl;
for(int k = 0;k<H;k++){
cout << "#";
for(int l = 0;l<W;l++){
int co = k*W + l;
cout << Ass.at(co);
}
cout << "#" << endl;
}
for(int m =0;m<W+2;m++){
cout << "#";
}
cout << endl;
} | a.cc: In function 'int mai()':
a.cc:32:1: warning: no return statement in function returning non-void [-Wreturn-type]
32 | }
| ^
/usr/bin/ld: /usr/lib/gcc/x86_64-linux-gnu/14/../../../x86_64-linux-gnu/Scrt1.o: in function `_start':
(.text+0x17): undefined reference to `main'
collect2: error: ld returned 1 exit status
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.