submission_id stringlengths 10 10 | problem_id stringlengths 6 6 | language stringclasses 3 values | code stringlengths 1 522k | compiler_output stringlengths 43 10.2k |
|---|---|---|---|---|
s858532012 | p03836 | C++ | import java.util.*;
public class Main{
public static void main(String[]args){
Scanner sc = new Scanner(System.in);
String[] S = sc.nextLine().split(" ");
int sx = Integer.parseInt(S[0]);
int sy = Integer.parseInt(S[1]);
int tx = Integer.parseInt(S[2]);
int ty = Integer.parseInt(S[3]);
int a = tx-sx;
int b = ty-sy;
String ans = "", ans1 = "", ans2 = "", ans3 = "", ans4 = "";
for(int i = 0; i < a; i++){
ans1 += "R";
ans3 += "L";
}
for(int i = 0; i < b; i++){
ans2 += "U";
ans4 += "D";
}
ans += ans1 + ans2 + ans3 + ans4;
ans1 = "";
ans2 = "";
ans3 = "";
ans4 = "";
for(int i = 0; i < a+1; i++){
ans1 += "R";
ans3 += "L";
}
for(int i = 0; i < b+1; i++){
ans2 += "U";
ans4 += "D";
}
ans += "D" + ans1 + ans2 + "L" + "U" + ans3 + ans4 + "R";
System.out.println(ans);
}
} | a.cc:1:1: error: 'import' does not name a type
1 | import java.util.*;
| ^~~~~~
a.cc:1:1: note: C++20 'import' only available with '-fmodules-ts'
a.cc:3:1: error: expected unqualified-id before 'public'
3 | public class Main{
| ^~~~~~
|
s277379183 | p03836 | C++ | #include <unordered_set>
#include <iostream>
#include <algorithm>
#include <vector>
bool is_in_indices(int a, int b, std::unordered_set<std::string>* indices) {
char key[6];
sprintf(key, "%d_%d", a, b);
return indices->count(std::string(key)) > 0;
}
void walk(int cx, int tx, int cy, int ty, std::unordered_set<std::string>* indices, std::vector<std::string>* result) {
if (cx == tx && cy == ty) {
return;
}
if (cx < tx) {
if (is_in_indices(cx + 1, cy, indices)) {
result->push_back("R");
return walk(cx + 1, tx, cy, ty, indices, result);
}
}
if (cy < ty) {
if (is_in_indices(cx, cy + 1, indices)) {
result->push_back("D");
return walk(cx, tx, cy + 1, ty, indices, result);
}
}
if (cx > tx) {
if (is_in_indices(cx - 1, cy, indices)) {
result->push_back("L");
return walk(cx - 1, tx, cy, ty, indices, result);
}
}
if (cy > ty) {
if (is_in_indices(cx, cy - 1, indices)) {
result->push_back("U");
return walk(cx, tx, cy - 1, ty, indices, result);
}
}
if (is_in_indices(cx + 1, cy, indices)) {
result->push_back("R");
return walk(cx, tx, cy - 1, ty, indices, result);
}
if (is_in_indices(cx - 1, cy, indices)) {
result->push_back("L");
return walk(cx, tx, cy - 1, ty, indices, result);
}
if (is_in_indices(cx, cy + 1, indices)) {
result->push_back("D");
return walk(cx, tx, cy - 1, ty, indices, result);
}
if (is_in_indices(cx, cy - 1, indices)) {
result->push_back("U");
return walk(cx, tx, cy - 1, ty, indices, result);
}
}
int main() {
int sx = 0;
int sy = 0;
int tx = 0;
int ty = 0;
std::cin >> sx;
std::cin >> sy;
std::cin >> tx;
std::cin >> ty;
std::unordered_set<std::string> indices;
std::vector<std::string> result;
walk(sx, sy, tx, ty, &indices, &result);
walk(tx, ty, sx, sy, &indices, &result);
walk(sx, sy, tx, ty, &indices, &result);
walk(tx, ty, sx, sy, &indices, &result);
for (auto p&: result) {
printf("%s", p.c_str());
}
printf("\n");
} | a.cc: In function 'int main()':
a.cc:77:14: error: expected ';' before '&' token
77 | for (auto p&: result) {
| ^
| ;
a.cc:77:15: error: expected primary-expression before ':' token
77 | for (auto p&: result) {
| ^
a.cc:77:15: error: expected ';' before ':' token
77 | for (auto p&: result) {
| ^
| ;
a.cc:77:15: error: expected primary-expression before ':' token
a.cc:77:15: error: expected ')' before ':' token
77 | for (auto p&: result) {
| ~ ^
| )
a.cc:77:15: error: expected primary-expression before ':' token
|
s546945434 | p03836 | C++ | #include <unordered_set>
#include <iostream>
#include <algorithm>
#include <vector>
bool is_in_indices(int a, int b, std::unordered_set<std::string>* indices) {
char key[6];
sprintf(key, "%d_%d", a, b);
return indices->count(std::string(key)) > 0;
}
void walk(int cx, int tx, int cy, int ty, std::unordered_set<std::string>* indices, std::vector<std::string>* result) {
if (cx == tx && cy == ty) {
return;
}
if (cx < tx) {
if (is_in_indices(cx + 1, cy, indices)) {
result->push_back("R");
return walk(cx + 1, tx, cy, ty, indices, result);
}
}
if (cy < ty) {
if (is_in_indices(cx, cy + 1, indices)) {
result->push_back("D");
return walk(cx, tx, cy + 1, ty, indices, result);
}
}
if (cx > tx) {
if (is_in_indices(cx - 1, cy, indices)) {
result->push_back("L");
return walk(cx - 1, tx, cy, ty, indices, result);
}
}
if (cy > ty) {
if (is_in_indices(cx cy - 1, indices)) {
result->push_back("U");
return walk(cx, tx, cy - 1, ty, indices, result);
}
}
if (is_in_indices(cx + 1, cy, indices)) {
result->push_back("R");
return walk(cx, tx, cy - 1, ty, indices, result);
}
if (is_in_indices(cx - 1, cy, indices)) {
result->push_back("L");
return walk(cx, tx, cy - 1, ty, indices, result);
}
if (is_in_indices(cx, cy + 1, indices)) {
result->push_back("D");
return walk(cx, tx, cy - 1, ty, indices, result);
}
if (is_in_indices(cx, cy - 1, indices)) {
result->push_back("U");
return walk(cx, tx, cy - 1, ty, indices, result);
}
}
int main() {
int sx = 0;
int sy = 0;
int tx = 0;
int ty = 0;
std::cin >> sx;
std::cin >> sy;
std::cin >> tx;
std::cin >> ty;
std::unordered_set<std::string> indices;
std::vector<std::string> result;
walk(sx, sy, tx, ty, &indices, &result);
walk(tx, ty, sx, sy, &indices, &result);
walk(sx, sy, tx, ty, &indices, &result);
walk(tx, ty, sx, sy, &indices, &result);
for (auto p&: result) {
printf("%s", p.c_str());
}
printf("\n");
} | a.cc: In function 'void walk(int, int, int, int, std::unordered_set<std::__cxx11::basic_string<char> >*, std::vector<std::__cxx11::basic_string<char> >*)':
a.cc:35:25: error: expected ')' before 'cy'
35 | if (is_in_indices(cx cy - 1, indices)) {
| ~ ^~~
| )
a.cc:35:34: error: invalid conversion from 'std::unordered_set<std::__cxx11::basic_string<char> >*' to 'int' [-fpermissive]
35 | if (is_in_indices(cx cy - 1, indices)) {
| ^~~~~~~
| |
| std::unordered_set<std::__cxx11::basic_string<char> >*
a.cc:35:22: error: too few arguments to function 'bool is_in_indices(int, int, std::unordered_set<std::__cxx11::basic_string<char> >*)'
35 | if (is_in_indices(cx cy - 1, indices)) {
| ~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~
a.cc:6:6: note: declared here
6 | bool is_in_indices(int a, int b, std::unordered_set<std::string>* indices) {
| ^~~~~~~~~~~~~
a.cc: In function 'int main()':
a.cc:77:14: error: expected ';' before '&' token
77 | for (auto p&: result) {
| ^
| ;
a.cc:77:15: error: expected primary-expression before ':' token
77 | for (auto p&: result) {
| ^
a.cc:77:15: error: expected ';' before ':' token
77 | for (auto p&: result) {
| ^
| ;
a.cc:77:15: error: expected primary-expression before ':' token
a.cc:77:15: error: expected ')' before ':' token
77 | for (auto p&: result) {
| ~ ^
| )
a.cc:77:15: error: expected primary-expression before ':' token
|
s631275398 | p03836 | C++ | #include <unordered_set>
#include <iostream>
#include <algorithm>
#include <vector>
bool is_in_indices(int a, int b, std::unordered_set<std::string>* indices) {
char key[6];
sprintf(key, "%d_%d", a, b);
return indices->count(std::string(key)) > 0;
}
void walk(int cx, int tx, int cy, int ty, std::unordered_set<std::string>* indices, std::vector<std::string>* result) {
if (cx == tx && cy == ty) {
return;
}
if (cx < tx) {
if (is_in_indices(cx + 1, cy, indices)) {
result->push_back("R");
return walk(cx + 1, tx, cy, ty, indices, result);
}
}
if (cy < ty) {
if (is_in_indices(cx, cy + 1, indices)) {
result->push_back("D");
return walk(cx, tx, cy + 1, ty, indices, result);
}
}
if (cx > tx) {
if (is_in_indices(cx - 1, cy, indices)) {
result->push_back("L");
return walk(cx - 1, tx, cy, ty, indices, result);
}
}
if (cy > ty) {
if (is_in_indices(cx cy - 1, indices)) {
result->push_back("U");
return walk(cx tx, cy - 1, ty, indices, result);
}
}
if (is_in_indices(cx + 1, cy, indices)) {
result->push_back("R");
return walk(cx tx, cy - 1, ty, indices, result);
}
if (is_in_indices(cx - 1, cy, indices)) {
result->push_back("L");
return walk(cx tx, cy - 1, ty, indices, result);
}
if (is_in_indices(cx, cy + 1, indices)) {
result->push_back("D");
return walk(cx tx, cy - 1, ty, indices, result);
}
if (is_in_indices(cx, cy - 1, indices)) {
result->push_back("U");
return walk(cx tx, cy - 1, ty, indices, result);
}
}
int main() {
int sx = 0;
int sy = 0;
int tx = 0;
int ty = 0;
std::cin >> sx;
std::cin >> sy;
std::cin >> tx;
std::cin >> ty;
std::unordered_set<std::string> indices;
std::vector<std::string> result;
walk(sx, sy, tx, ty, &indices, &result);
walk(tx, ty, sx, sy, &indices, &result);
walk(sx, sy, tx, ty, &indices, &result);
walk(tx, ty, sx, sy, &indices, &result);
for (auto p&: result) {
printf("%s", p.c_str());
}
printf("\n");
} | a.cc: In function 'void walk(int, int, int, int, std::unordered_set<std::__cxx11::basic_string<char> >*, std::vector<std::__cxx11::basic_string<char> >*)':
a.cc:35:25: error: expected ')' before 'cy'
35 | if (is_in_indices(cx cy - 1, indices)) {
| ~ ^~~
| )
a.cc:35:34: error: invalid conversion from 'std::unordered_set<std::__cxx11::basic_string<char> >*' to 'int' [-fpermissive]
35 | if (is_in_indices(cx cy - 1, indices)) {
| ^~~~~~~
| |
| std::unordered_set<std::__cxx11::basic_string<char> >*
a.cc:35:22: error: too few arguments to function 'bool is_in_indices(int, int, std::unordered_set<std::__cxx11::basic_string<char> >*)'
35 | if (is_in_indices(cx cy - 1, indices)) {
| ~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~
a.cc:6:6: note: declared here
6 | bool is_in_indices(int a, int b, std::unordered_set<std::string>* indices) {
| ^~~~~~~~~~~~~
a.cc:37:21: error: expected ')' before 'tx'
37 | return walk(cx tx, cy - 1, ty, indices, result);
| ~ ^~~
| )
a.cc:37:38: error: invalid conversion from 'std::unordered_set<std::__cxx11::basic_string<char> >*' to 'int' [-fpermissive]
37 | return walk(cx tx, cy - 1, ty, indices, result);
| ^~~~~~~
| |
| std::unordered_set<std::__cxx11::basic_string<char> >*
a.cc:37:47: error: cannot convert 'std::vector<std::__cxx11::basic_string<char> >*' to 'std::unordered_set<std::__cxx11::basic_string<char> >*'
37 | return walk(cx tx, cy - 1, ty, indices, result);
| ^~~~~~
| |
| std::vector<std::__cxx11::basic_string<char> >*
a.cc:12:76: note: initializing argument 5 of 'void walk(int, int, int, int, std::unordered_set<std::__cxx11::basic_string<char> >*, std::vector<std::__cxx11::basic_string<char> >*)'
12 | void walk(int cx, int tx, int cy, int ty, std::unordered_set<std::string>* indices, std::vector<std::string>* result) {
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~
a.cc:43:19: error: expected ')' before 'tx'
43 | return walk(cx tx, cy - 1, ty, indices, result);
| ~ ^~~
| )
a.cc:43:36: error: invalid conversion from 'std::unordered_set<std::__cxx11::basic_string<char> >*' to 'int' [-fpermissive]
43 | return walk(cx tx, cy - 1, ty, indices, result);
| ^~~~~~~
| |
| std::unordered_set<std::__cxx11::basic_string<char> >*
a.cc:43:45: error: cannot convert 'std::vector<std::__cxx11::basic_string<char> >*' to 'std::unordered_set<std::__cxx11::basic_string<char> >*'
43 | return walk(cx tx, cy - 1, ty, indices, result);
| ^~~~~~
| |
| std::vector<std::__cxx11::basic_string<char> >*
a.cc:12:76: note: initializing argument 5 of 'void walk(int, int, int, int, std::unordered_set<std::__cxx11::basic_string<char> >*, std::vector<std::__cxx11::basic_string<char> >*)'
12 | void walk(int cx, int tx, int cy, int ty, std::unordered_set<std::string>* indices, std::vector<std::string>* result) {
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~
a.cc:47:19: error: expected ')' before 'tx'
47 | return walk(cx tx, cy - 1, ty, indices, result);
| ~ ^~~
| )
a.cc:47:36: error: invalid conversion from 'std::unordered_set<std::__cxx11::basic_string<char> >*' to 'int' [-fpermissive]
47 | return walk(cx tx, cy - 1, ty, indices, result);
| ^~~~~~~
| |
| std::unordered_set<std::__cxx11::basic_string<char> >*
a.cc:47:45: error: cannot convert 'std::vector<std::__cxx11::basic_string<char> >*' to 'std::unordered_set<std::__cxx11::basic_string<char> >*'
47 | return walk(cx tx, cy - 1, ty, indices, result);
| ^~~~~~
| |
| std::vector<std::__cxx11::basic_string<char> >*
a.cc:12:76: note: initializing argument 5 of 'void walk(int, int, int, int, std::unordered_set<std::__cxx11::basic_string<char> >*, std::vector<std::__cxx11::basic_string<char> >*)'
12 | void walk(int cx, int tx, int cy, int ty, std::unordered_set<std::string>* indices, std::vector<std::string>* result) {
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~
a.cc:51:19: error: expected ')' before 'tx'
51 | return walk(cx tx, cy - 1, ty, indices, result);
| ~ ^~~
| )
a.cc:51:36: error: invalid conversion from 'std::unordered_set<std::__cxx11::basic_string<char> >*' to 'int' [-fpermissive]
51 | return walk(cx tx, cy - 1, ty, indices, result);
| ^~~~~~~
| |
| std::unordered_set<std::__cxx11::basic_string<char> >*
a.cc:51:45: error: cannot convert 'std::vector<std::__cxx11::basic_string<char> >*' to 'std::unordered_set<std::__cxx11::basic_string<char> >*'
51 | return walk(cx tx, cy - 1, ty, indices, result);
| ^~~~~~
| |
| std::vector<std::__cxx11::basic_string<char> >*
a.cc:12:76: note: initializing argument 5 of 'void walk(int, int, int, int, std::unordered_set<std::__cxx11::basic_string<char> >*, std::vector<std::__cxx11::basic_string<char> >*)'
12 | void walk(int cx, int tx, int cy, int ty, std::unordered_set<std::string>* indices, std::vector<std::string>* result) {
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~
a.cc:55:19: error: expected ')' before 'tx'
55 | return walk(cx tx, cy - 1, ty, indices, result);
| ~ ^~~
| )
a.cc:55:36: error: invalid conversion from 'std::unordered_set<std::__cxx11::basic_string<char> >*' to 'int' [-fpermissive]
55 | return walk(cx tx, cy - 1, ty, indices, result);
| ^~~~~~~
| |
| std::unordered_set<std::__cxx11::basic_string<char> >*
a.cc:55:45: error: cannot convert 'std::vector<std::__cxx11::basic_string<char> >*' to 'std::unordered_set<std::__cxx11::basic_string<char> >*'
55 | return walk(cx tx, cy - 1, ty, indices, result);
| ^~~~~~
| |
| std::vector<std::__cxx11::basic_string<char> >*
a.cc:12:76: note: initializing argument 5 of 'void walk(int, int, int, int, std::unordered_set<std::__cxx11::basic_string<char> >*, std::vector<std::__cxx11::basic_string<char> >*)'
12 | void walk(int cx, int tx, int cy, int ty, std::unordered_set<std::string>* indices, std::vector<std::string>* result) {
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~
a.cc: In function 'int main()':
a.cc:77:14: error: expected ';' before '&' token
77 | for (auto p&: result) {
| ^
| ;
a.cc:77:15: error: expected primary-expression before ':' token
77 | for (auto p&: result) {
| ^
a.cc:77:15: error: expected ';' before ':' token
77 | for (auto p&: result) {
| ^
| ;
a.cc:77:15: error: expected primary-expression before ':' token
a.cc:77:15: error: expected ')' before ':' token
77 | for (auto p&: result) {
| ~ ^
| )
a.cc:77:15: error: expected primary-expression before ':' token
|
s063304977 | p03836 | C++ | #include <unordered_set>
#include <iostream>
#include <algorithm>
bool is_in_indices(int a, int b, std::unordered_set<std::string>* indices) {
char key[6];
sprintf(key, "%d_%d", a, b);
return indices->count(std::string(key)) > 0;
}
void walk(int cx, int tx, int cy, int ty, std::unordered_set<std::string>* indices, std::vector<std::string>* result) {
if (cx == tx && cy == ty) {
return;
}
if (cx < tx) {
if (is_in_indices(cx + 1, cy, indices)) {
result->push_back("R");
return walk(cx + 1, tx, cy, ty, indices, result);
}
}
if (cy < ty) {
if (is_in_indices(cx, cy + 1, indices)) {
result->push_back("D");
return walk(cx, tx, cy + 1, ty, indices, result);
}
}
if (cx > tx) {
if (is_in_indices(cx - 1, cy, indices)) {
result->push_back("L");
return walk(cx - 1, tx, cy, ty, indices, result);
}
}
if (cy > ty) {
if (is_in_indices(cx cy - 1, indices)) {
result->push_back("U");
return walk(cx tx, cy - 1, ty, indices, result);
}
}
if (is_in_indices(cx + 1, cy, indices)) {
result->push_back("R");
return walk(cx tx, cy - 1, ty, indices, result);
}
if (is_in_indices(cx - 1, cy, indices)) {
result->push_back("L");
return walk(cx tx, cy - 1, ty, indices, result);
}
if (is_in_indices(cx, cy + 1, indices)) {
result->push_back("D");
return walk(cx tx, cy - 1, ty, indices, result);
}
if (is_in_indices(cx, cy - 1, indices)) {
result->push_back("U");
return walk(cx tx, cy - 1, ty, indices, result);
}
}
int main() {
int sx = 0;
int sy = 0;
int tx = 0;
int ty = 0;
std::cin >> sx;
std::cin >> sy;
std::cin >> tx;
std::cin >> ty;
std::unordered_set<std::string> indices;
std::vector<std::string> result;
walk(sx, sy, tx, ty, &indices, &result);
walk(tx, ty, sx, sy, &indices, &result);
walk(sx, sy, tx, ty, &indices, &result);
walk(tx, ty, sx, sy, &indices, &result);
for (auto p&: result) {
printf("%s", p.c_str());
}
printf("\n");
} | a.cc:11:85: error: 'std::vector' has not been declared
11 | void walk(int cx, int tx, int cy, int ty, std::unordered_set<std::string>* indices, std::vector<std::string>* result) {
| ^~~
a.cc:11:96: error: expected ',' or '...' before '<' token
11 | void walk(int cx, int tx, int cy, int ty, std::unordered_set<std::string>* indices, std::vector<std::string>* result) {
| ^
a.cc: In function 'void walk(int, int, int, int, std::unordered_set<std::__cxx11::basic_string<char> >*, int)':
a.cc:17:7: error: 'result' was not declared in this scope
17 | result->push_back("R");
| ^~~~~~
a.cc:23:7: error: 'result' was not declared in this scope
23 | result->push_back("D");
| ^~~~~~
a.cc:29:7: error: 'result' was not declared in this scope
29 | result->push_back("L");
| ^~~~~~
a.cc:34:25: error: expected ')' before 'cy'
34 | if (is_in_indices(cx cy - 1, indices)) {
| ~ ^~~
| )
a.cc:34:34: error: invalid conversion from 'std::unordered_set<std::__cxx11::basic_string<char> >*' to 'int' [-fpermissive]
34 | if (is_in_indices(cx cy - 1, indices)) {
| ^~~~~~~
| |
| std::unordered_set<std::__cxx11::basic_string<char> >*
a.cc:34:22: error: too few arguments to function 'bool is_in_indices(int, int, std::unordered_set<std::__cxx11::basic_string<char> >*)'
34 | if (is_in_indices(cx cy - 1, indices)) {
| ~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~
a.cc:5:6: note: declared here
5 | bool is_in_indices(int a, int b, std::unordered_set<std::string>* indices) {
| ^~~~~~~~~~~~~
a.cc:35:7: error: 'result' was not declared in this scope
35 | result->push_back("U");
| ^~~~~~
a.cc:36:21: error: expected ')' before 'tx'
36 | return walk(cx tx, cy - 1, ty, indices, result);
| ~ ^~~
| )
a.cc:41:5: error: 'result' was not declared in this scope
41 | result->push_back("R");
| ^~~~~~
a.cc:42:19: error: expected ')' before 'tx'
42 | return walk(cx tx, cy - 1, ty, indices, result);
| ~ ^~~
| )
a.cc:45:5: error: 'result' was not declared in this scope
45 | result->push_back("L");
| ^~~~~~
a.cc:46:19: error: expected ')' before 'tx'
46 | return walk(cx tx, cy - 1, ty, indices, result);
| ~ ^~~
| )
a.cc:49:5: error: 'result' was not declared in this scope
49 | result->push_back("D");
| ^~~~~~
a.cc:50:19: error: expected ')' before 'tx'
50 | return walk(cx tx, cy - 1, ty, indices, result);
| ~ ^~~
| )
a.cc:53:5: error: 'result' was not declared in this scope
53 | result->push_back("U");
| ^~~~~~
a.cc:54:19: error: expected ')' before 'tx'
54 | return walk(cx tx, cy - 1, ty, indices, result);
| ~ ^~~
| )
a.cc: In function 'int main()':
a.cc:69:8: error: 'vector' is not a member of 'std'
69 | std::vector<std::string> result;
| ^~~~~~
a.cc:4:1: note: 'std::vector' is defined in header '<vector>'; this is probably fixable by adding '#include <vector>'
3 | #include <algorithm>
+++ |+#include <vector>
4 |
a.cc:69:26: error: expected primary-expression before '>' token
69 | std::vector<std::string> result;
| ^
a.cc:69:28: error: 'result' was not declared in this scope
69 | std::vector<std::string> result;
| ^~~~~~
a.cc:76:14: error: expected ';' before '&' token
76 | for (auto p&: result) {
| ^
| ;
a.cc:76:15: error: expected primary-expression before ':' token
76 | for (auto p&: result) {
| ^
a.cc:76:15: error: expected ';' before ':' token
76 | for (auto p&: result) {
| ^
| ;
a.cc:76:15: error: expected primary-expression before ':' token
a.cc:76:15: error: expected ')' before ':' token
76 | for (auto p&: result) {
| ~ ^
| )
a.cc:76:15: error: expected primary-expression before ':' token
|
s782734479 | p03836 | C++ | #include <unordered_set>
#include <iostream>
#include <algorithm>
bool is_in_indices(int a, int b, std::unordered_set<int>* indices) {
char key[6];
sprintf(key, "%d_%d", a, b);
return indices->count(std::string(key)) > 0;
}
void walk(int cx, int tx, int cy, int ty, std::unordered_set<std::string>* indices, std::vector<std::string>* result) {
if (cx == tx && cy == ty) {
return;
}
if (cx < tx) {
if (is_in_indices(cx + 1, cy, indices)) {
result->push_back("R");
return walk(cx + 1, tx, cy, ty, indices, result);
}
}
if (cy < ty) {
if (is_in_indices(cx, cy + 1, indices)) {
result->push_back("D");
return walk(cx, tx, cy + 1, ty, indices, result);
}
}
if (cx > tx) {
if (is_in_indices(cx - 1, cy, indices)) {
result->push_back("L");
return walk(cx - 1, tx, cy, ty, indices, result);
}
}
if (cy > ty) {
if (is_in_indices(cx cy - 1, indices)) {
result->push_back("U");
return walk(cx tx, cy - 1, ty, indices, result);
}
}
if (is_in_indices(cx + 1, cy, indices)) {
result->push_back("R");
return walk(cx tx, cy - 1, ty, indices, result);
}
if (is_in_indices(cx - 1, cy, indices)) {
result->push_back("L");
return walk(cx tx, cy - 1, ty, indices, result);
}
if (is_in_indices(cx, cy + 1, indices)) {
result->push_back("D");
return walk(cx tx, cy - 1, ty, indices, result);
}
if (is_in_indices(cx, cy - 1, indices)) {
result->push_back("U");
return walk(cx tx, cy - 1, ty, indices, result);
}
}
int main() {
int sx = 0;
int sy = 0;
int tx = 0;
int ty = 0;
std::cin >> sx;
std::cin >> sy;
std::cin >> tx;
std::cin >> ty;
std::unordered_set<int> indices;
std::vector<std::string> result;
walk(sx, sy, tx, ty, &indices, &result);
walk(tx, ty, sx, sy, &indices, &result);
walk(sx, sy, tx, ty, &indices, &result);
walk(tx, ty, sx, sy, &indices, &result);
for (auto p&: result) {
printf("%s", p.c_str());
}
printf("\n");
} | a.cc: In function 'bool is_in_indices(int, int, std::unordered_set<int>*)':
a.cc:8:30: error: cannot convert 'std::string' {aka 'std::__cxx11::basic_string<char>'} to 'const std::unordered_set<int>::key_type&' {aka 'const int&'}
8 | return indices->count(std::string(key)) > 0;
| ^~~~~~~~~~~
| |
| std::string {aka std::__cxx11::basic_string<char>}
In file included from /usr/include/c++/14/unordered_set:41,
from a.cc:1:
/usr/include/c++/14/bits/unordered_set.h:692:29: note: initializing argument 1 of 'std::unordered_set<_Value, _Hash, _Pred, _Alloc>::size_type std::unordered_set<_Value, _Hash, _Pred, _Alloc>::count(const key_type&) const [with _Value = int; _Hash = std::hash<int>; _Pred = std::equal_to<int>; _Alloc = std::allocator<int>; size_type = long unsigned int; key_type = int]'
692 | count(const key_type& __x) const
| ~~~~~~~~~~~~~~~~^~~
a.cc: At global scope:
a.cc:11:85: error: 'std::vector' has not been declared
11 | void walk(int cx, int tx, int cy, int ty, std::unordered_set<std::string>* indices, std::vector<std::string>* result) {
| ^~~
a.cc:11:96: error: expected ',' or '...' before '<' token
11 | void walk(int cx, int tx, int cy, int ty, std::unordered_set<std::string>* indices, std::vector<std::string>* result) {
| ^
a.cc: In function 'void walk(int, int, int, int, std::unordered_set<std::__cxx11::basic_string<char> >*, int)':
a.cc:16:35: error: cannot convert 'std::unordered_set<std::__cxx11::basic_string<char> >*' to 'std::unordered_set<int>*'
16 | if (is_in_indices(cx + 1, cy, indices)) {
| ^~~~~~~
| |
| std::unordered_set<std::__cxx11::basic_string<char> >*
a.cc:5:59: note: initializing argument 3 of 'bool is_in_indices(int, int, std::unordered_set<int>*)'
5 | bool is_in_indices(int a, int b, std::unordered_set<int>* indices) {
| ~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~
a.cc:17:7: error: 'result' was not declared in this scope
17 | result->push_back("R");
| ^~~~~~
a.cc:22:35: error: cannot convert 'std::unordered_set<std::__cxx11::basic_string<char> >*' to 'std::unordered_set<int>*'
22 | if (is_in_indices(cx, cy + 1, indices)) {
| ^~~~~~~
| |
| std::unordered_set<std::__cxx11::basic_string<char> >*
a.cc:5:59: note: initializing argument 3 of 'bool is_in_indices(int, int, std::unordered_set<int>*)'
5 | bool is_in_indices(int a, int b, std::unordered_set<int>* indices) {
| ~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~
a.cc:23:7: error: 'result' was not declared in this scope
23 | result->push_back("D");
| ^~~~~~
a.cc:28:35: error: cannot convert 'std::unordered_set<std::__cxx11::basic_string<char> >*' to 'std::unordered_set<int>*'
28 | if (is_in_indices(cx - 1, cy, indices)) {
| ^~~~~~~
| |
| std::unordered_set<std::__cxx11::basic_string<char> >*
a.cc:5:59: note: initializing argument 3 of 'bool is_in_indices(int, int, std::unordered_set<int>*)'
5 | bool is_in_indices(int a, int b, std::unordered_set<int>* indices) {
| ~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~
a.cc:29:7: error: 'result' was not declared in this scope
29 | result->push_back("L");
| ^~~~~~
a.cc:34:25: error: expected ')' before 'cy'
34 | if (is_in_indices(cx cy - 1, indices)) {
| ~ ^~~
| )
a.cc:34:34: error: invalid conversion from 'std::unordered_set<std::__cxx11::basic_string<char> >*' to 'int' [-fpermissive]
34 | if (is_in_indices(cx cy - 1, indices)) {
| ^~~~~~~
| |
| std::unordered_set<std::__cxx11::basic_string<char> >*
a.cc:34:22: error: too few arguments to function 'bool is_in_indices(int, int, std::unordered_set<int>*)'
34 | if (is_in_indices(cx cy - 1, indices)) {
| ~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~
a.cc:5:6: note: declared here
5 | bool is_in_indices(int a, int b, std::unordered_set<int>* indices) {
| ^~~~~~~~~~~~~
a.cc:35:7: error: 'result' was not declared in this scope
35 | result->push_back("U");
| ^~~~~~
a.cc:36:21: error: expected ')' before 'tx'
36 | return walk(cx tx, cy - 1, ty, indices, result);
| ~ ^~~
| )
a.cc:40:33: error: cannot convert 'std::unordered_set<std::__cxx11::basic_string<char> >*' to 'std::unordered_set<int>*'
40 | if (is_in_indices(cx + 1, cy, indices)) {
| ^~~~~~~
| |
| std::unordered_set<std::__cxx11::basic_string<char> >*
a.cc:5:59: note: initializing argument 3 of 'bool is_in_indices(int, int, std::unordered_set<int>*)'
5 | bool is_in_indices(int a, int b, std::unordered_set<int>* indices) {
| ~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~
a.cc:41:5: error: 'result' was not declared in this scope
41 | result->push_back("R");
| ^~~~~~
a.cc:42:19: error: expected ')' before 'tx'
42 | return walk(cx tx, cy - 1, ty, indices, result);
| ~ ^~~
| )
a.cc:44:33: error: cannot convert 'std::unordered_set<std::__cxx11::basic_string<char> >*' to 'std::unordered_set<int>*'
44 | if (is_in_indices(cx - 1, cy, indices)) {
| ^~~~~~~
| |
| std::unordered_set<std::__cxx11::basic_string<char> >*
a.cc:5:59: note: initializing argument 3 of 'bool is_in_indices(int, int, std::unordered_set<int>*)'
5 | bool is_in_indices(int a, int b, std::unordered_set<int>* indices) {
| ~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~
a.cc:45:5: error: 'result' was not declared in this scope
45 | result->push_back("L");
| ^~~~~~
a.cc:46:19: error: expected ')' before 'tx'
46 | return walk(cx tx, cy - 1, ty, indices, result);
| ~ ^~~
| )
a.cc:48:33: error: cannot convert 'std::unordered_set<std::__cxx11::basic_string<char> >*' to 'std::unordered_set<int>*'
48 | if (is_in_indices(cx, cy + 1, indices)) {
| ^~~~~~~
| |
| std::unordered_set<std::__cxx11::basic_string<char> >*
a.cc:5:59: note: initializing argument 3 of 'bool is_in_indices(int, int, std::unordered_set<int>*)'
5 | bool is_in_indices(int a, int b, std::unordered_set<int>* indices) {
| ~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~
a.cc:49:5: error: 'result' was not declared in this scope
49 | result->push_back("D");
| ^~~~~~
a.cc:50:19: error: expected ')' before 'tx'
50 | return walk(cx tx, cy - 1, ty, indices, result);
| ~ ^~~
| )
a.cc:52:33: error: cannot convert 'std::unordered_set<std::__cxx11::basic_string<char> >*' to 'std::unordered_set<int>*'
52 | if (is_in_indices(cx, cy - 1, indices)) {
| ^~~~~~~
| |
| std::unordered_set<std::__cxx11::basic_string<char> >*
a.cc:5:59: note: initializing argument 3 of 'bool is_in_indices(int, int, std::unordered_set<int>*)'
5 | bool is_in_indices(int a, int b, std::unordered_set<int>* indices) {
| ~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~
a.cc:53:5: error: 'result' was not declared in this scope
53 | result->push_back("U");
| ^~~~~~
a.cc:54:19: error: expected ')' before 'tx'
54 | return walk(cx tx, cy - 1, ty, indices, result);
| ~ ^~~
| )
a.cc: In function 'int main()':
a.cc:69:8: error: 'vector' is not a member of 'std'
69 | std::vector<std::string> result;
| ^~~~~~
a.cc:4:1: note: 'std::vector' is defined in header '<vector>'; this is probably fixable by adding '#include <vector>'
3 | #include <algorithm>
+++ |+#include <vector>
4 |
a.cc:69:26: error: expected primary-expression before '>' token
69 | std::vector<std::string> result;
| ^
a.cc:69:28: error: 'result' was not declared in this scope
69 | std::vector<std::string> result;
| ^~~~~~
a.cc:76:14: error: expected ';' before '&' token
76 | for (auto p&: result) {
| ^
| ;
a.cc:76:15: error: expected primary-expression before ':' token
76 | for (auto p&: result) {
| ^
a.cc:76:15: error: expected ';' before ':' token
76 | for (auto p&: result) {
| ^
| ;
a.cc:76:15: error: expected primary-expression before ':' token
a.cc:76:15: error: expected ')' before ':' token
76 | for (auto p&: result) {
| ~ ^
| )
a.cc:76:15: error: expected primary-expression before ':' token
|
s750298668 | p03836 | C++ | #include <unordered_set>
#include <iostream>
#include <algorithm>
bool is_in_indices(int a, int b, std::unordered_set<int>* indices) {
char key[6];
sprintf(key, "%d_%d", a, b);
return indices->count(std::string(key) > 0;
}
void walk(int cx, int tx, int cy, int ty, std::unordered_set<std::string>* indices, std::vector<std::string>* result) {
if (cx == tx && cy == ty) {
return;
}
if (cx < tx) {
if (is_in_indices(cx + 1, cy, indices)) {
result->push_back("R");
return walk(cx + 1, tx, cy, ty, indices, result);
}
}
if (cy < ty) {
if (is_in_indices(cx, cy + 1, indices)) {
result->push_back("D");
return walk(cx, tx, cy + 1, ty, indices, result);
}
}
if (cx > tx) {
if (is_in_indices(cx - 1, cy, indices)) {
result->push_back("L");
return walk(cx - 1, tx, cy, ty, indices, result);
}
}
if (cy > ty) {
if (is_in_indices(cx cy - 1, indices)) {
result->push_back("U");
return walk(cx tx, cy - 1, ty, indices, result);
}
}
if (is_in_indices(cx + 1, cy, indices)) {
result->push_back("R");
return walk(cx tx, cy - 1, ty, indices, result);
}
if (is_in_indices(cx - 1, cy, indices)) {
result->push_back("L");
return walk(cx tx, cy - 1, ty, indices, result);
}
if (is_in_indices(cx, cy + 1, indices)) {
result->push_back("D");
return walk(cx tx, cy - 1, ty, indices, result);
}
if (is_in_indices(cx, cy - 1, indices)) {
result->push_back("U");
return walk(cx tx, cy - 1, ty, indices, result);
}
}
int main() {
int sx = 0;
int sy = 0;
int tx = 0;
int ty = 0;
std::cin >> sx;
std::cin >> sy;
std::cin >> tx;
std::cin >> ty;
std::unordered_set<int> indices;
std::vector<std::string> result;
walk(sx, sy, tx, ty, &indices, &result);
walk(tx, ty, sx, sy, &indices, &result);
walk(sx, sy, tx, ty, &indices, &result);
walk(tx, ty, sx, sy, &indices, &result);
for (auto p&: result) {
printf("%s", p.c_str());
}
printf("\n");
} | a.cc: In function 'bool is_in_indices(int, int, std::unordered_set<int>*)':
a.cc:8:42: error: no match for 'operator>' (operand types are 'std::string' {aka 'std::__cxx11::basic_string<char>'} and 'int')
8 | return indices->count(std::string(key) > 0;
| ~~~~~~~~~~~ ^ ~
| | |
| | int
| std::string {aka std::__cxx11::basic_string<char>}
In file included from /usr/include/c++/14/tuple:38,
from /usr/include/c++/14/bits/hashtable_policy.h:34,
from /usr/include/c++/14/bits/hashtable.h:35,
from /usr/include/c++/14/bits/unordered_set.h:33,
from /usr/include/c++/14/unordered_set:41,
from a.cc:1:
/usr/include/c++/14/bits/stl_pair.h:1058:5: note: candidate: 'template<class _T1, class _T2> constexpr bool std::operator>(const pair<_T1, _T2>&, const pair<_T1, _T2>&)'
1058 | operator>(const pair<_T1, _T2>& __x, const pair<_T1, _T2>& __y)
| ^~~~~~~~
/usr/include/c++/14/bits/stl_pair.h:1058:5: note: template argument deduction/substitution failed:
a.cc:8:44: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::pair<_T1, _T2>'
8 | return indices->count(std::string(key) > 0;
| ^
/usr/include/c++/14/tuple:2619:5: note: candidate: 'template<class ... _TElements, class ... _UElements> constexpr bool std::operator>(const tuple<_UTypes ...>&, const tuple<_Elements ...>&)'
2619 | operator>(const tuple<_TElements...>& __t,
| ^~~~~~~~
/usr/include/c++/14/tuple:2619:5: note: template argument deduction/substitution failed:
a.cc:8:44: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::tuple<_UTypes ...>'
8 | return indices->count(std::string(key) > 0;
| ^
In file included from /usr/include/c++/14/bits/stl_algobase.h:67,
from /usr/include/c++/14/bits/hashtable_policy.h:36:
/usr/include/c++/14/bits/stl_iterator.h:462:5: note: candidate: 'template<class _Iterator> constexpr bool std::operator>(const reverse_iterator<_Iterator>&, const reverse_iterator<_Iterator>&)'
462 | operator>(const reverse_iterator<_Iterator>& __x,
| ^~~~~~~~
/usr/include/c++/14/bits/stl_iterator.h:462:5: note: template argument deduction/substitution failed:
a.cc:8:44: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::reverse_iterator<_Iterator>'
8 | return indices->count(std::string(key) > 0;
| ^
/usr/include/c++/14/bits/stl_iterator.h:507:5: note: candidate: 'template<class _IteratorL, class _IteratorR> constexpr bool std::operator>(const reverse_iterator<_Iterator>&, const reverse_iterator<_IteratorR>&)'
507 | operator>(const reverse_iterator<_IteratorL>& __x,
| ^~~~~~~~
/usr/include/c++/14/bits/stl_iterator.h:507:5: note: template argument deduction/substitution failed:
a.cc:8:44: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::reverse_iterator<_Iterator>'
8 | return indices->count(std::string(key) > 0;
| ^
/usr/include/c++/14/bits/stl_iterator.h:1714:5: note: candidate: 'template<class _IteratorL, class _IteratorR> constexpr bool std::operator>(const move_iterator<_IteratorL>&, const move_iterator<_IteratorR>&)'
1714 | operator>(const move_iterator<_IteratorL>& __x,
| ^~~~~~~~
/usr/include/c++/14/bits/stl_iterator.h:1714:5: note: template argument deduction/substitution failed:
a.cc:8:44: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::move_iterator<_IteratorL>'
8 | return indices->count(std::string(key) > 0;
| ^
/usr/include/c++/14/bits/stl_iterator.h:1774:5: note: candidate: 'template<class _Iterator> constexpr bool std::operator>(const move_iterator<_IteratorL>&, const move_iterator<_IteratorL>&)'
1774 | operator>(const move_iterator<_Iterator>& __x,
| ^~~~~~~~
/usr/include/c++/14/bits/stl_iterator.h:1774:5: note: template argument deduction/substitution failed:
a.cc:8:44: note: 'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::move_iterator<_IteratorL>'
8 | return indices->count(std::string(key) > 0;
| ^
In file included from /usr/include/c++/14/bits/basic_string.h:47,
from /usr/include/c++/14/string:54,
from /usr/include/c++/14/bits/locale_classes.h:40,
from /usr/include/c++/14/bits/ios_base.h:41,
from /usr/include/c++/14/ios:44,
from /usr/include/c++/14/ostream:40,
from /usr/include/c++/14/iostream:41,
from a.cc:2:
/usr/include/c++/14/string_view:695:5: note: candidate: 'template<class _CharT, class _Traits> constexpr bool std::operator>(basic_string_view<_CharT, _Traits>, basic_string_view<_CharT, _Traits>)'
695 | operator> (basic_string_view<_CharT, _Traits> __x,
| ^~~~~~~~
/usr/include/c++/14/string_view:695:5: note: template argument deduction/substitution failed:
a.cc:8:44: note: 'std::__cxx11::basic_string<char>' is not derived from 'std::basic_string_view<_CharT, _Traits>'
8 | return indices->count(std::string(key) > 0;
| ^
/usr/include/c++/14/string_view:702:5: note: candidate: 'template<class _CharT, class _Traits> constexpr bool std::operator>(basic_string_view<_CharT, _Traits>, __type_identity_t<basic_string_view<_CharT, _Traits> >)'
702 | operator> (basic_string_view<_CharT, _Traits> __x,
| ^~~~~~~~
/usr/include/c++/14/string_view:702:5: note: template argument deduction/substitution failed:
a.cc:8:44: note: 'std::__cxx11::basic_string<char>' is not derived from 'std::basic_string_view<_CharT, _Traits>'
8 | return indices->count(std::string(key) > 0;
| ^
/usr/include/c++/14/string_view:710:5: note: candidate: 'template<class _CharT, class _Traits> constexpr bool std::operator>(__type_identity_t<basic_string_view<_CharT, _Traits> >, basic_string_view<_CharT, _Traits>)'
710 | operator> (__type_identity_t<basic_string_view<_CharT, _Traits>> __x,
| ^~~~~~~~
/usr/include/c++/14/string_view:710:5: note: template argument deduction/substitution failed:
a.cc:8:44: note: mismatched types 'std::basic_string_view<_CharT, _Traits>' and 'int'
8 | return indices->count(std::string(key) > 0;
| ^
/usr/include/c++/14/bits/basic_string.h:3915:5: note: candidate: 'template<class _CharT, class _Traits, class _Alloc> bool std::operator>(const __cxx11::basic_string<_CharT, _Traits, _Allocator>&, const __cxx11::basic_string<_CharT, _Traits, _Allocator>&)'
3915 | operator>(const basic_string<_CharT, _Traits, _Alloc>& __lhs,
| ^~~~~~~~
/usr/include/c++/14/bits/basic_string.h:3915:5: note: template argument deduction/substitution failed:
a.cc:8:44: note: mismatched types 'const std::__cxx11::basic_string<_CharT, _Traits, _Allocator>' and 'int'
8 | return indices->count(std::string(key) > 0;
| ^
/usr/include/c++/14/bits/basic_string.h:3929:5: note: candidate: 'template<class _CharT, class _Traits, class _Alloc> bool std::operator>(const __cxx11::basic_string<_CharT, _Traits, _Allocator>&, const _CharT*)'
3929 | operator>(const basic_string<_CharT, _Traits, _Alloc>& __lhs,
| ^~~~~~~~
/usr/include/c++/14/bits/basic_string.h:3929:5: note: template argument deduction/substitution failed:
a.cc:8:44: note: mismatched types 'const _CharT*' and 'int'
8 | return indices->count(std::string(key) > 0;
| ^
/usr/include/c++/14/bits/basic_string.h:3942:5: note: candidate: 'template<class _CharT, class _Traits, class _Alloc> bool std::operator>(const _CharT*, const __cxx11::basic_string<_CharT, _Traits, _Allocator>&)'
3942 | operator>(const _CharT* __lhs,
| ^~~~~~~~
/usr/include/c++/14/bits/basic_string.h:3942:5: note: template argument deduction/substitution failed:
a.cc:8:44: note: mismatched types 'const _CharT*' and 'std::__cxx11::basic_string<char>'
8 | return indices->count(std::string(key) > 0;
| ^
a.cc: At global scope:
a.cc:11:85: error: 'std::vector' has not been declared
11 | void walk(int cx, int tx, int cy, int ty, std::unordered_set<std::string>* indices, std::vector<std::string>* result) {
| ^~~
a.cc:11:96: error: expected ',' or '...' before '<' token
11 | void walk(int cx, int tx, int cy, int ty, std::unordered_set<std::string>* indices, std::vector<std::string>* result) {
| ^
a.cc: In function 'void walk(int, int, int, int, std::unordered_set<std::__cxx11::basic_string<char> >*, int)':
a.cc:16:35: error: cannot convert 'std::unordered_set<std::__cxx11::basic_string<char> >*' to 'std::unordered_set<int>*'
16 | if (is_in_indices(cx + 1, cy, indices)) {
| ^~~~~~~
| |
| std::unordered_set<std::__cxx11::basic_string<char> >*
a.cc:5:59: note: initializing argument 3 of 'bool is_in_indices(int, int, std::unordered_set<int>*)'
5 | bool is_in_indices(int a, int b, std::unordered_set<int>* indices) {
| ~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~
a.cc:17:7: error: 'result' was not declared in this scope
17 | result->push_back("R");
| ^~~~~ |
s555932551 | p03836 | C++ | #include <unordered_set>
#include <iostream>
#include <algorithm>
bool check_indices(int a, int b, std::unordered_set<int>* indices) {
char key[6];
sprintf(key, "%d_%d", a, b);
return !indices->contains(std::string(key)));
}
void walk(int cx, int tx, int cy, int ty, std::unordered_set<std::string>* indices, std::vector<std::string>* result) {
if (cx == tx && cy == ty) {
return;
}
if (cx < tx) {
if (check_indices(cx + 1, cy, indices)) {
result->push_back("R");
return walk(cx + 1, tx, cy, ty, indices, result);
}
}
if (cy < ty) {
if (check_indices(cx, cy + 1, indices)) {
result->push_back("D");
return walk(cx, tx, cy + 1, ty, indices, result);
}
}
if (cx > tx) {
if (check_indices(cx - 1, cy, indices)) {
result->push_back("L");
return walk(cx - 1, tx, cy, ty, indices, result);
}
}
if (cy > ty) {
if (check_indices(cx cy - 1, indices)) {
result->push_back("U");
return walk(cx tx, cy - 1, ty, indices, result);
}
}
if (check_indices(cx + 1, cy, indices)) {
result->push_back("R");
return walk(cx tx, cy - 1, ty, indices, result);
}
if (check_indices(cx - 1, cy, indices)) {
result->push_back("L");
return walk(cx tx, cy - 1, ty, indices, result);
}
if (check_indices(cx, cy + 1, indices)) {
result->push_back("D");
return walk(cx tx, cy - 1, ty, indices, result);
}
if (check_indices(cx, cy - 1, indices)) {
result->push_back("U");
return walk(cx tx, cy - 1, ty, indices, result);
}
}
int main() {
int sx = 0;
int sy = 0;
int tx = 0;
int ty = 0;
std::cin >> sx;
std::cin >> sy;
std::cin >> tx;
std::cin >> ty;
std::unordered_set<int> indices;
std::vector<std::string> result;
walk(sx, sy, tx, ty, &indices, &result);
walk(tx, ty, sx, sy, &indices, &result);
walk(sx, sy, tx, ty, &indices, &result);
walk(tx, ty, sx, sy, &indices, &result);
for (auto p&: result) {
printf("%s", p.c_str());
}
printf("\n");
} | a.cc: In function 'bool check_indices(int, int, std::unordered_set<int>*)':
a.cc:8:20: error: 'class std::unordered_set<int>' has no member named 'contains'
8 | return !indices->contains(std::string(key)));
| ^~~~~~~~
a.cc:8:46: error: expected ';' before ')' token
8 | return !indices->contains(std::string(key)));
| ^
| ;
a.cc:8:46: error: expected primary-expression before ')' token
a.cc: At global scope:
a.cc:11:85: error: 'std::vector' has not been declared
11 | void walk(int cx, int tx, int cy, int ty, std::unordered_set<std::string>* indices, std::vector<std::string>* result) {
| ^~~
a.cc:11:96: error: expected ',' or '...' before '<' token
11 | void walk(int cx, int tx, int cy, int ty, std::unordered_set<std::string>* indices, std::vector<std::string>* result) {
| ^
a.cc: In function 'void walk(int, int, int, int, std::unordered_set<std::__cxx11::basic_string<char> >*, int)':
a.cc:16:35: error: cannot convert 'std::unordered_set<std::__cxx11::basic_string<char> >*' to 'std::unordered_set<int>*'
16 | if (check_indices(cx + 1, cy, indices)) {
| ^~~~~~~
| |
| std::unordered_set<std::__cxx11::basic_string<char> >*
a.cc:5:59: note: initializing argument 3 of 'bool check_indices(int, int, std::unordered_set<int>*)'
5 | bool check_indices(int a, int b, std::unordered_set<int>* indices) {
| ~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~
a.cc:17:7: error: 'result' was not declared in this scope
17 | result->push_back("R");
| ^~~~~~
a.cc:22:35: error: cannot convert 'std::unordered_set<std::__cxx11::basic_string<char> >*' to 'std::unordered_set<int>*'
22 | if (check_indices(cx, cy + 1, indices)) {
| ^~~~~~~
| |
| std::unordered_set<std::__cxx11::basic_string<char> >*
a.cc:5:59: note: initializing argument 3 of 'bool check_indices(int, int, std::unordered_set<int>*)'
5 | bool check_indices(int a, int b, std::unordered_set<int>* indices) {
| ~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~
a.cc:23:7: error: 'result' was not declared in this scope
23 | result->push_back("D");
| ^~~~~~
a.cc:28:35: error: cannot convert 'std::unordered_set<std::__cxx11::basic_string<char> >*' to 'std::unordered_set<int>*'
28 | if (check_indices(cx - 1, cy, indices)) {
| ^~~~~~~
| |
| std::unordered_set<std::__cxx11::basic_string<char> >*
a.cc:5:59: note: initializing argument 3 of 'bool check_indices(int, int, std::unordered_set<int>*)'
5 | bool check_indices(int a, int b, std::unordered_set<int>* indices) {
| ~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~
a.cc:29:7: error: 'result' was not declared in this scope
29 | result->push_back("L");
| ^~~~~~
a.cc:34:25: error: expected ')' before 'cy'
34 | if (check_indices(cx cy - 1, indices)) {
| ~ ^~~
| )
a.cc:34:34: error: invalid conversion from 'std::unordered_set<std::__cxx11::basic_string<char> >*' to 'int' [-fpermissive]
34 | if (check_indices(cx cy - 1, indices)) {
| ^~~~~~~
| |
| std::unordered_set<std::__cxx11::basic_string<char> >*
a.cc:34:22: error: too few arguments to function 'bool check_indices(int, int, std::unordered_set<int>*)'
34 | if (check_indices(cx cy - 1, indices)) {
| ~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~
a.cc:5:6: note: declared here
5 | bool check_indices(int a, int b, std::unordered_set<int>* indices) {
| ^~~~~~~~~~~~~
a.cc:35:7: error: 'result' was not declared in this scope
35 | result->push_back("U");
| ^~~~~~
a.cc:36:21: error: expected ')' before 'tx'
36 | return walk(cx tx, cy - 1, ty, indices, result);
| ~ ^~~
| )
a.cc:40:33: error: cannot convert 'std::unordered_set<std::__cxx11::basic_string<char> >*' to 'std::unordered_set<int>*'
40 | if (check_indices(cx + 1, cy, indices)) {
| ^~~~~~~
| |
| std::unordered_set<std::__cxx11::basic_string<char> >*
a.cc:5:59: note: initializing argument 3 of 'bool check_indices(int, int, std::unordered_set<int>*)'
5 | bool check_indices(int a, int b, std::unordered_set<int>* indices) {
| ~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~
a.cc:41:5: error: 'result' was not declared in this scope
41 | result->push_back("R");
| ^~~~~~
a.cc:42:19: error: expected ')' before 'tx'
42 | return walk(cx tx, cy - 1, ty, indices, result);
| ~ ^~~
| )
a.cc:44:33: error: cannot convert 'std::unordered_set<std::__cxx11::basic_string<char> >*' to 'std::unordered_set<int>*'
44 | if (check_indices(cx - 1, cy, indices)) {
| ^~~~~~~
| |
| std::unordered_set<std::__cxx11::basic_string<char> >*
a.cc:5:59: note: initializing argument 3 of 'bool check_indices(int, int, std::unordered_set<int>*)'
5 | bool check_indices(int a, int b, std::unordered_set<int>* indices) {
| ~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~
a.cc:45:5: error: 'result' was not declared in this scope
45 | result->push_back("L");
| ^~~~~~
a.cc:46:19: error: expected ')' before 'tx'
46 | return walk(cx tx, cy - 1, ty, indices, result);
| ~ ^~~
| )
a.cc:48:33: error: cannot convert 'std::unordered_set<std::__cxx11::basic_string<char> >*' to 'std::unordered_set<int>*'
48 | if (check_indices(cx, cy + 1, indices)) {
| ^~~~~~~
| |
| std::unordered_set<std::__cxx11::basic_string<char> >*
a.cc:5:59: note: initializing argument 3 of 'bool check_indices(int, int, std::unordered_set<int>*)'
5 | bool check_indices(int a, int b, std::unordered_set<int>* indices) {
| ~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~
a.cc:49:5: error: 'result' was not declared in this scope
49 | result->push_back("D");
| ^~~~~~
a.cc:50:19: error: expected ')' before 'tx'
50 | return walk(cx tx, cy - 1, ty, indices, result);
| ~ ^~~
| )
a.cc:52:33: error: cannot convert 'std::unordered_set<std::__cxx11::basic_string<char> >*' to 'std::unordered_set<int>*'
52 | if (check_indices(cx, cy - 1, indices)) {
| ^~~~~~~
| |
| std::unordered_set<std::__cxx11::basic_string<char> >*
a.cc:5:59: note: initializing argument 3 of 'bool check_indices(int, int, std::unordered_set<int>*)'
5 | bool check_indices(int a, int b, std::unordered_set<int>* indices) {
| ~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~
a.cc:53:5: error: 'result' was not declared in this scope
53 | result->push_back("U");
| ^~~~~~
a.cc:54:19: error: expected ')' before 'tx'
54 | return walk(cx tx, cy - 1, ty, indices, result);
| ~ ^~~
| )
a.cc: In function 'int main()':
a.cc:69:8: error: 'vector' is not a member of 'std'
69 | std::vector<std::string> result;
| ^~~~~~
a.cc:4:1: note: 'std::vector' is defined in header '<vector>'; this is probably fixable by adding '#include <vector>'
3 | #include <algorithm>
+++ |+#include <vector>
4 |
a.cc:69:26: error: expected primary-expression before '>' token
69 | std::vector<std::string> result;
| ^
a.cc:69:28: error: 'result' was not declared in this scope
69 | std::vector<std::string> result;
| ^~~~~~
a.cc:76:14: error: expected ';' before '&' token
76 | for (auto p&: result) {
| ^
| ;
a.cc:76:15: error: expected primary-expression before ':' token
76 | for (auto p&: result) {
| ^
a.cc:76:15: error: expected ';' before ':' token
76 | for (auto p&: result) {
| ^
| ;
a.cc:76:15: error: expected primary-expression before ':' token
a.cc:76:15: error: expected ')' before ':' token
76 | for (auto p&: result) {
| ~ ^
| )
a.cc:76:15: error: expected primary-expression before ':' token
|
s221918870 | p03836 | C++ | #include <unordered_set>
#include <iostream>
#include <algorithm>
bool check_indices(int a, int b, std::unordered_set<int>* indices) {
const char key[6];
sprintf(key, "%d_%d", a, b);
return !indices->contains(std::string(key)));
}
void walk(int cx, int tx, int cy, int ty, std::unordered_set<std::string>* indices, std::vector<std::string>* result) {
if (cx == tx && cy == ty) {
return;
}
if (cx < tx) {
if (check_indices(cx + 1, cy, indices)) {
result->push_back("R");
return walk(cx + 1, tx, cy, ty, indices, result);
}
}
if (cy < ty) {
if (check_indices(cx, cy + 1, indices)) {
result->push_back("D");
return walk(cx, tx, cy + 1, ty, indices, result);
}
}
if (cx > tx) {
if (check_indices(cx - 1, cy, indices)) {
result->push_back("L");
return walk(cx - 1, tx, cy, ty, indices, result);
}
}
if (cy > ty) {
if (check_indices(cx cy - 1, indices)) {
result->push_back("U");
return walk(cx tx, cy - 1, ty, indices, result);
}
}
if (check_indices(cx + 1, cy, indices)) {
result->push_back("R");
return walk(cx tx, cy - 1, ty, indices, result);
}
if (check_indices(cx - 1, cy, indices)) {
result->push_back("L");
return walk(cx tx, cy - 1, ty, indices, result);
}
if (check_indices(cx, cy + 1, indices)) {
result->push_back("D");
return walk(cx tx, cy - 1, ty, indices, result);
}
if (check_indices(cx, cy - 1, indices)) {
result->push_back("U");
return walk(cx tx, cy - 1, ty, indices, result);
}
}
int main() {
int sx = 0;
int sy = 0;
int tx = 0;
int ty = 0;
std::cin >> sx;
std::cin >> sy;
std::cin >> tx;
std::cin >> ty;
std::unordered_set<int> indices;
std::vector<std::string> result;
walk(sx, sy, tx, ty, &indices, &result);
walk(tx, ty, sx, sy, &indices, &result);
walk(sx, sy, tx, ty, &indices, &result);
walk(tx, ty, sx, sy, &indices, &result);
for (auto p&: result) {
printf("%s", p.c_str());
}
printf("\n");
} | a.cc: In function 'bool check_indices(int, int, std::unordered_set<int>*)':
a.cc:6:14: error: uninitialized 'const key' [-fpermissive]
6 | const char key[6];
| ^~~
a.cc:7:11: error: invalid conversion from 'const char*' to 'char*' [-fpermissive]
7 | sprintf(key, "%d_%d", a, b);
| ^~~
| |
| const 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:2:
/usr/include/stdio.h:365:38: note: initializing argument 1 of 'int sprintf(char*, const char*, ...)'
365 | extern int sprintf (char *__restrict __s,
| ~~~~~~~~~~~~~~~~~^~~
a.cc:8:20: error: 'class std::unordered_set<int>' has no member named 'contains'
8 | return !indices->contains(std::string(key)));
| ^~~~~~~~
a.cc:8:46: error: expected ';' before ')' token
8 | return !indices->contains(std::string(key)));
| ^
| ;
a.cc:8:46: error: expected primary-expression before ')' token
a.cc: At global scope:
a.cc:11:85: error: 'std::vector' has not been declared
11 | void walk(int cx, int tx, int cy, int ty, std::unordered_set<std::string>* indices, std::vector<std::string>* result) {
| ^~~
a.cc:11:96: error: expected ',' or '...' before '<' token
11 | void walk(int cx, int tx, int cy, int ty, std::unordered_set<std::string>* indices, std::vector<std::string>* result) {
| ^
a.cc: In function 'void walk(int, int, int, int, std::unordered_set<std::__cxx11::basic_string<char> >*, int)':
a.cc:16:35: error: cannot convert 'std::unordered_set<std::__cxx11::basic_string<char> >*' to 'std::unordered_set<int>*'
16 | if (check_indices(cx + 1, cy, indices)) {
| ^~~~~~~
| |
| std::unordered_set<std::__cxx11::basic_string<char> >*
a.cc:5:59: note: initializing argument 3 of 'bool check_indices(int, int, std::unordered_set<int>*)'
5 | bool check_indices(int a, int b, std::unordered_set<int>* indices) {
| ~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~
a.cc:17:7: error: 'result' was not declared in this scope
17 | result->push_back("R");
| ^~~~~~
a.cc:22:35: error: cannot convert 'std::unordered_set<std::__cxx11::basic_string<char> >*' to 'std::unordered_set<int>*'
22 | if (check_indices(cx, cy + 1, indices)) {
| ^~~~~~~
| |
| std::unordered_set<std::__cxx11::basic_string<char> >*
a.cc:5:59: note: initializing argument 3 of 'bool check_indices(int, int, std::unordered_set<int>*)'
5 | bool check_indices(int a, int b, std::unordered_set<int>* indices) {
| ~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~
a.cc:23:7: error: 'result' was not declared in this scope
23 | result->push_back("D");
| ^~~~~~
a.cc:28:35: error: cannot convert 'std::unordered_set<std::__cxx11::basic_string<char> >*' to 'std::unordered_set<int>*'
28 | if (check_indices(cx - 1, cy, indices)) {
| ^~~~~~~
| |
| std::unordered_set<std::__cxx11::basic_string<char> >*
a.cc:5:59: note: initializing argument 3 of 'bool check_indices(int, int, std::unordered_set<int>*)'
5 | bool check_indices(int a, int b, std::unordered_set<int>* indices) {
| ~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~
a.cc:29:7: error: 'result' was not declared in this scope
29 | result->push_back("L");
| ^~~~~~
a.cc:34:25: error: expected ')' before 'cy'
34 | if (check_indices(cx cy - 1, indices)) {
| ~ ^~~
| )
a.cc:34:34: error: invalid conversion from 'std::unordered_set<std::__cxx11::basic_string<char> >*' to 'int' [-fpermissive]
34 | if (check_indices(cx cy - 1, indices)) {
| ^~~~~~~
| |
| std::unordered_set<std::__cxx11::basic_string<char> >*
a.cc:34:22: error: too few arguments to function 'bool check_indices(int, int, std::unordered_set<int>*)'
34 | if (check_indices(cx cy - 1, indices)) {
| ~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~
a.cc:5:6: note: declared here
5 | bool check_indices(int a, int b, std::unordered_set<int>* indices) {
| ^~~~~~~~~~~~~
a.cc:35:7: error: 'result' was not declared in this scope
35 | result->push_back("U");
| ^~~~~~
a.cc:36:21: error: expected ')' before 'tx'
36 | return walk(cx tx, cy - 1, ty, indices, result);
| ~ ^~~
| )
a.cc:40:33: error: cannot convert 'std::unordered_set<std::__cxx11::basic_string<char> >*' to 'std::unordered_set<int>*'
40 | if (check_indices(cx + 1, cy, indices)) {
| ^~~~~~~
| |
| std::unordered_set<std::__cxx11::basic_string<char> >*
a.cc:5:59: note: initializing argument 3 of 'bool check_indices(int, int, std::unordered_set<int>*)'
5 | bool check_indices(int a, int b, std::unordered_set<int>* indices) {
| ~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~
a.cc:41:5: error: 'result' was not declared in this scope
41 | result->push_back("R");
| ^~~~~~
a.cc:42:19: error: expected ')' before 'tx'
42 | return walk(cx tx, cy - 1, ty, indices, result);
| ~ ^~~
| )
a.cc:44:33: error: cannot convert 'std::unordered_set<std::__cxx11::basic_string<char> >*' to 'std::unordered_set<int>*'
44 | if (check_indices(cx - 1, cy, indices)) {
| ^~~~~~~
| |
| std::unordered_set<std::__cxx11::basic_string<char> >*
a.cc:5:59: note: initializing argument 3 of 'bool check_indices(int, int, std::unordered_set<int>*)'
5 | bool check_indices(int a, int b, std::unordered_set<int>* indices) {
| ~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~
a.cc:45:5: error: 'result' was not declared in this scope
45 | result->push_back("L");
| ^~~~~~
a.cc:46:19: error: expected ')' before 'tx'
46 | return walk(cx tx, cy - 1, ty, indices, result);
| ~ ^~~
| )
a.cc:48:33: error: cannot convert 'std::unordered_set<std::__cxx11::basic_string<char> >*' to 'std::unordered_set<int>*'
48 | if (check_indices(cx, cy + 1, indices)) {
| ^~~~~~~
| |
| std::unordered_set<std::__cxx11::basic_string<char> >*
a.cc:5:59: note: initializing argument 3 of 'bool check_indices(int, int, std::unordered_set<int>*)'
5 | bool check_indices(int a, int b, std::unordered_set<int>* indices) {
| ~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~
a.cc:49:5: error: 'result' was not declared in this scope
49 | result->push_back("D");
| ^~~~~~
a.cc:50:19: error: expected ')' before 'tx'
50 | return walk(cx tx, cy - 1, ty, indices, result);
| ~ ^~~
| )
a.cc:52:33: error: cannot convert 'std::unordered_set<std::__cxx11::basic_string<char> >*' to 'std::unordered_set<int>*'
52 | if (check_indices(cx, cy - 1, indices)) {
| ^~~~~~~
| |
| std::unordered_set<std::__cxx11::basic_string<char> >*
a.cc:5:59: note: initializing argument 3 of 'bool check_indices(int, int, std::unordered_set<int>*)'
5 | bool check_indices(int a, int b, std::unordered_set<int>* indices) {
| ~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~
a.cc:53:5: error: 'result' was not declared in this scope
53 | result->push_back("U");
| ^~~~~~
a.cc:54:19: error: expected ')' before 'tx'
54 | return walk(cx tx, cy - 1, ty, indices, result);
| ~ ^~~
| )
a.cc: In function 'int main()':
a.cc:69:8: error: 'vector' is not a member of 'std'
69 | std::vector<std::string> result;
| ^~~~~~
a.cc:4:1: note: 'std::vector' is defined in header '<vector>'; this is probably fixable by adding '#include <vector>'
3 | #include <algorithm>
+++ |+#include <vector>
4 |
a.cc:69:26: error: expected primary-expression before '>' token
69 | std::vector<std::string> result;
| ^
a.cc:69:28: error: 'result' was not declared in this scope
69 | std::vector<std::string> result;
| ^~~~~~
a.cc:76:14: error: expected ';' before '&' token
76 | for (auto p&: result) {
| ^
| ;
a.cc:76:15: error: expected primary-expression before ':' token
76 | for (auto p&: result) {
| ^
a.cc:76:15: error: expected ';' before ':' token
76 | for (auto p&: result) {
| ^
| ;
a.cc:76:15: err |
s063984086 | p03836 | C++ | #include <unordered_set>
#include <iostream>
#include <algorithm>
bool check_indices(int a, int b, std::unordered_set<int> indices) {
const char[6] key;
sprintf(key, "%d_%d", a, b);
return !indices->contains(std::string(key)));
}
void walk(int cx, int tx, int cy, int ty, std::unordered_set<std::string>* indices, std::vector<std::string>* result) {
if (cx == tx && cy == ty) {
return;
}
if (cx < tx) {
if (check_indices(cx + 1, cy, indices)) {
result->push_back("R");
return walk(cx + 1, tx, cy, ty, indices, result);
}
}
if (cy < ty) {
if (check_indices(cx, cy + 1, indices)) {
result->push_back("D");
return walk(cx, tx, cy + 1, ty, indices, result);
}
}
if (cx > tx) {
if (check_indices(cx - 1, cy, indices)) {
result->push_back("L");
return walk(cx - 1, tx, cy, ty, indices, result);
}
}
if (cy > ty) {
if (check_indices(cx cy - 1, indices)) {
result->push_back("U");
return walk(cx tx, cy - 1, ty, indices, result);
}
}
if (check_indices(cx + 1, cy, indices)) {
result->push_back("R");
return walk(cx tx, cy - 1, ty, indices, result);
}
if (check_indices(cx - 1, cy, indices)) {
result->push_back("L");
return walk(cx tx, cy - 1, ty, indices, result);
}
if (check_indices(cx, cy + 1, indices)) {
result->push_back("D");
return walk(cx tx, cy - 1, ty, indices, result);
}
if (check_indices(cx, cy - 1, indices)) {
result->push_back("U");
return walk(cx tx, cy - 1, ty, indices, result);
}
}
int main() {
int sx = 0;
int sy = 0;
int tx = 0;
int ty = 0;
std::cin >> sx;
std::cin >> sy;
std::cin >> tx;
std::cin >> ty;
std::unordered_set<int> indices;
std::vector<std::string> result;
walk(sx, sy, tx, ty, &indices, &result);
walk(tx, ty, sx, sy, &indices, &result);
walk(sx, sy, tx, ty, &indices, &result);
walk(tx, ty, sx, sy, &indices, &result);
} | a.cc: In function 'bool check_indices(int, int, std::unordered_set<int>)':
a.cc:6:14: error: expected identifier before numeric constant
6 | const char[6] key;
| ^
a.cc:6:14: error: expected ']' before numeric constant
6 | const char[6] key;
| ^
| ]
a.cc:6:13: error: structured binding declaration cannot have type 'const char'
6 | const char[6] key;
| ^
a.cc:6:13: note: type must be cv-qualified 'auto' or reference to cv-qualified 'auto'
a.cc:6:13: error: empty structured binding declaration
a.cc:6:17: error: expected initializer before 'key'
6 | const char[6] key;
| ^~~
a.cc:7:11: error: 'key' was not declared in this scope; did you mean 'key_t'?
7 | sprintf(key, "%d_%d", a, b);
| ^~~
| key_t
a.cc:8:18: error: base operand of '->' has non-pointer type 'std::unordered_set<int>'
8 | return !indices->contains(std::string(key)));
| ^~
a.cc:8:46: error: expected ';' before ')' token
8 | return !indices->contains(std::string(key)));
| ^
| ;
a.cc:8:46: error: expected primary-expression before ')' token
a.cc: At global scope:
a.cc:11:85: error: 'std::vector' has not been declared
11 | void walk(int cx, int tx, int cy, int ty, std::unordered_set<std::string>* indices, std::vector<std::string>* result) {
| ^~~
a.cc:11:96: error: expected ',' or '...' before '<' token
11 | void walk(int cx, int tx, int cy, int ty, std::unordered_set<std::string>* indices, std::vector<std::string>* result) {
| ^
a.cc: In function 'void walk(int, int, int, int, std::unordered_set<std::__cxx11::basic_string<char> >*, int)':
a.cc:16:35: error: could not convert 'indices' from 'std::unordered_set<std::__cxx11::basic_string<char> >*' to 'std::unordered_set<int>'
16 | if (check_indices(cx + 1, cy, indices)) {
| ^~~~~~~
| |
| std::unordered_set<std::__cxx11::basic_string<char> >*
a.cc:17:7: error: 'result' was not declared in this scope
17 | result->push_back("R");
| ^~~~~~
a.cc:22:35: error: could not convert 'indices' from 'std::unordered_set<std::__cxx11::basic_string<char> >*' to 'std::unordered_set<int>'
22 | if (check_indices(cx, cy + 1, indices)) {
| ^~~~~~~
| |
| std::unordered_set<std::__cxx11::basic_string<char> >*
a.cc:23:7: error: 'result' was not declared in this scope
23 | result->push_back("D");
| ^~~~~~
a.cc:28:35: error: could not convert 'indices' from 'std::unordered_set<std::__cxx11::basic_string<char> >*' to 'std::unordered_set<int>'
28 | if (check_indices(cx - 1, cy, indices)) {
| ^~~~~~~
| |
| std::unordered_set<std::__cxx11::basic_string<char> >*
a.cc:29:7: error: 'result' was not declared in this scope
29 | result->push_back("L");
| ^~~~~~
a.cc:34:25: error: expected ')' before 'cy'
34 | if (check_indices(cx cy - 1, indices)) {
| ~ ^~~
| )
a.cc:34:34: error: invalid conversion from 'std::unordered_set<std::__cxx11::basic_string<char> >*' to 'int' [-fpermissive]
34 | if (check_indices(cx cy - 1, indices)) {
| ^~~~~~~
| |
| std::unordered_set<std::__cxx11::basic_string<char> >*
a.cc:34:22: error: too few arguments to function 'bool check_indices(int, int, std::unordered_set<int>)'
34 | if (check_indices(cx cy - 1, indices)) {
| ~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~
a.cc:5:6: note: declared here
5 | bool check_indices(int a, int b, std::unordered_set<int> indices) {
| ^~~~~~~~~~~~~
a.cc:35:7: error: 'result' was not declared in this scope
35 | result->push_back("U");
| ^~~~~~
a.cc:36:21: error: expected ')' before 'tx'
36 | return walk(cx tx, cy - 1, ty, indices, result);
| ~ ^~~
| )
a.cc:40:33: error: could not convert 'indices' from 'std::unordered_set<std::__cxx11::basic_string<char> >*' to 'std::unordered_set<int>'
40 | if (check_indices(cx + 1, cy, indices)) {
| ^~~~~~~
| |
| std::unordered_set<std::__cxx11::basic_string<char> >*
a.cc:41:5: error: 'result' was not declared in this scope
41 | result->push_back("R");
| ^~~~~~
a.cc:42:19: error: expected ')' before 'tx'
42 | return walk(cx tx, cy - 1, ty, indices, result);
| ~ ^~~
| )
a.cc:44:33: error: could not convert 'indices' from 'std::unordered_set<std::__cxx11::basic_string<char> >*' to 'std::unordered_set<int>'
44 | if (check_indices(cx - 1, cy, indices)) {
| ^~~~~~~
| |
| std::unordered_set<std::__cxx11::basic_string<char> >*
a.cc:45:5: error: 'result' was not declared in this scope
45 | result->push_back("L");
| ^~~~~~
a.cc:46:19: error: expected ')' before 'tx'
46 | return walk(cx tx, cy - 1, ty, indices, result);
| ~ ^~~
| )
a.cc:48:33: error: could not convert 'indices' from 'std::unordered_set<std::__cxx11::basic_string<char> >*' to 'std::unordered_set<int>'
48 | if (check_indices(cx, cy + 1, indices)) {
| ^~~~~~~
| |
| std::unordered_set<std::__cxx11::basic_string<char> >*
a.cc:49:5: error: 'result' was not declared in this scope
49 | result->push_back("D");
| ^~~~~~
a.cc:50:19: error: expected ')' before 'tx'
50 | return walk(cx tx, cy - 1, ty, indices, result);
| ~ ^~~
| )
a.cc:52:33: error: could not convert 'indices' from 'std::unordered_set<std::__cxx11::basic_string<char> >*' to 'std::unordered_set<int>'
52 | if (check_indices(cx, cy - 1, indices)) {
| ^~~~~~~
| |
| std::unordered_set<std::__cxx11::basic_string<char> >*
a.cc:53:5: error: 'result' was not declared in this scope
53 | result->push_back("U");
| ^~~~~~
a.cc:54:19: error: expected ')' before 'tx'
54 | return walk(cx tx, cy - 1, ty, indices, result);
| ~ ^~~
| )
a.cc: In function 'int main()':
a.cc:69:8: error: 'vector' is not a member of 'std'
69 | std::vector<std::string> result;
| ^~~~~~
a.cc:4:1: note: 'std::vector' is defined in header '<vector>'; this is probably fixable by adding '#include <vector>'
3 | #include <algorithm>
+++ |+#include <vector>
4 |
a.cc:69:26: error: expected primary-expression before '>' token
69 | std::vector<std::string> result;
| ^
a.cc:69:28: error: 'result' was not declared in this scope
69 | std::vector<std::string> result;
| ^~~~~~
|
s101702856 | p03836 | C++ | #include<iostream>
#include<vector>
#include<map>
#include<string>
#include<cstring>
#include<bitset>
#include<stack>
#include<queue>
#include<cmath>
#include<algorithm>
#include<cstdio>
#include<numeric>
#include<set>
#include<math.h>
#include<unordered_map>
using namespace std;
#define rep(i,x) for(int i=0;i<x;i++)
#define re(i,x,y) for(int i=x;i<y;i++)
long long INF=1e9;
const int mod=10007;
#define ll long long
int main(){
int sx,sy,tx,ty;
cin>>sx>>sy>>tx>>ty;
const int dx=tx-sx,dy=ty-sy;
cout<<string(dy,'U')<<string(dx,'R');
cout<<string(dy,'D')<<string(dx,'L');
cout<<'L'<<string(dy+1<'U')<<string(dx+1,'R')<<endl;
cout<<'R'<<string(dy+1,'D')<<string(dx+1,'L')<<endl;
cout<<endl;
return 0;
}
| a.cc: In function 'int main()':
a.cc:31:31: error: no matching function for call to 'std::__cxx11::basic_string<char>::basic_string(bool)'
31 | cout<<'L'<<string(dy+1<'U')<<string(dx+1,'R')<<endl;
| ^
In file included 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/c++/14/bits/basic_string.h:800:9: note: candidate: 'template<class _Tp, class> std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::basic_string(const _Tp&, const _Alloc&) [with <template-parameter-2-2> = _Tp; _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>]'
800 | basic_string(const _Tp& __t, const _Alloc& __a = _Alloc())
| ^~~~~~~~~~~~
/usr/include/c++/14/bits/basic_string.h:800:9: note: template argument deduction/substitution failed:
In file included from /usr/include/c++/14/bits/move.h:37,
from /usr/include/c++/14/bits/exception_ptr.h:41,
from /usr/include/c++/14/exception:166,
from /usr/include/c++/14/ios:41:
/usr/include/c++/14/type_traits: In substitution of 'template<bool _Cond, class _Tp> using std::enable_if_t = typename std::enable_if::type [with bool _Cond = false; _Tp = void]':
/usr/include/c++/14/bits/basic_string.h:149:8: required by substitution of 'template<class _CharT, class _Traits, class _Alloc> template<class _Tp, class _Res> using std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::_If_sv = std::enable_if_t<((bool)std::__and_<std::is_convertible<const _Tp&, std::basic_string_view<_CharT, _Traits> >, std::__not_<std::is_convertible<const _Tp*, const std::__cxx11::basic_string<_CharT, _Traits, _Alloc>*> >, std::__not_<std::is_convertible<const _Tp&, const _CharT*> > >::value), _Res> [with _Tp = bool; _Res = void; _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>]'
149 | using _If_sv = enable_if_t<
| ^~~~~~
/usr/include/c++/14/bits/basic_string.h:797:30: required from here
797 | template<typename _Tp, typename = _If_sv<_Tp, void>>
| ^~~~~~~~
/usr/include/c++/14/type_traits:2711:11: error: no type named 'type' in 'struct std::enable_if<false, void>'
2711 | using enable_if_t = typename enable_if<_Cond, _Tp>::type;
| ^~~~~~~~~~~
/usr/include/c++/14/bits/basic_string.h:788:9: note: candidate: 'template<class _Tp, class> std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::basic_string(const _Tp&, size_type, size_type, const _Alloc&) [with <template-parameter-2-2> = _Tp; _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>]'
788 | basic_string(const _Tp& __t, size_type __pos, size_type __n,
| ^~~~~~~~~~~~
/usr/include/c++/14/bits/basic_string.h:788:9: note: candidate expects 3 arguments, 1 provided
/usr/include/c++/14/bits/basic_string.h:765:9: note: candidate: 'template<class _InputIterator, class> std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::basic_string(_InputIterator, _InputIterator, const _Alloc&) [with <template-parameter-2-2> = _InputIterator; _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>]'
765 | basic_string(_InputIterator __beg, _InputIterator __end,
| ^~~~~~~~~~~~
/usr/include/c++/14/bits/basic_string.h:765:9: note: candidate expects 2 arguments, 1 provided
/usr/include/c++/14/bits/basic_string.h:669:7: note: candidate: 'template<class> std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::basic_string(size_type, _CharT, const _Alloc&) [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>]'
669 | basic_string(size_type __n, _CharT __c, const _Alloc& __a = _Alloc())
| ^~~~~~~~~~~~
/usr/include/c++/14/bits/basic_string.h:669:7: note: candidate expects 2 arguments, 1 provided
/usr/include/c++/14/bits/basic_string.h:646:7: note: candidate: 'template<class> std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::basic_string(const _CharT*, const _Alloc&) [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>]'
646 | basic_string(const _CharT* __s, const _Alloc& __a = _Alloc())
| ^~~~~~~~~~~~
/usr/include/c++/14/bits/basic_string.h:646:7: note: template argument deduction/substitution failed:
a.cc:31:27: note: cannot convert '((((int)dy) + 1) < 85)' (type 'bool') to type 'const char*'
31 | cout<<'L'<<string(dy+1<'U')<<string(dx+1,'R')<<endl;
| ~~~~^~~~
/usr/include/c++/14/bits/basic_string.h:721:7: note: candidate: 'std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::basic_string(std::__cxx11::basic_string<_CharT, _Traits, _Alloc>&&, const _Alloc&) [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>]'
721 | basic_string(basic_string&& __str, const _Alloc& __a)
| ^~~~~~~~~~~~
/usr/include/c++/14/bits/basic_string.h:721:7: note: candidate expects 2 arguments, 1 provided
/usr/include/c++/14/bits/basic_string.h:716:7: note: candidate: 'std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::basic_string(const std::__cxx11::basic_string<_CharT, _Traits, _Alloc>&, const _Alloc&) [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>]'
716 | basic_string(const basic_string& __str, const _Alloc& __a)
| ^~~~~~~~~~~~
/usr/include/c++/14/bits/basic_string.h:716:7: note: candidate expects 2 arguments, 1 provided
/usr/include/c++/14/bits/basic_string.h:711:7: note: candidate: 'std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::basic_string(std::initializer_list<_Tp>, const _Alloc&) [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>]'
711 | basic_string(initializer_list<_CharT> __l, const _Alloc& __a = _Alloc())
| ^~~~~~~~~~~~
/usr/include/c++/14/bits/basic_string.h:711:45: note: no known conversion for argument 1 from 'bool' to 'std::initializer_list<char>'
711 | basic_string(initializer_list<_CharT> __l, const _Alloc& __a = _Alloc())
| ~~~~~~~~~~~~~~~~~~~~~~~~~^~~
/usr/include/c++/14/bits/basic_string.h:682:7: note: candidate: 'std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::basic_string(std::__cxx11::basic_string<_CharT, _Traits, _Alloc>&&) [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>]'
682 | basic_string(basic_string&& __str) noexcept
| ^~~~~~~~~~~~
/usr/include/c++/14/bits/basic_string.h:682:35: note: no known conversion for argument 1 from 'bool' to 'std::__cxx11::basic_string<char>&&'
682 | basic_string(basic_string&& __str) noexcept
| ~~~~~~~~~~~~~~~^~~~~
/usr/include/c++/14/bits/basic_string.h:624:7: note: candidate: 'std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::basic_string(const _CharT*, size_type, const _Alloc&) [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>; size_type = long unsigned int]'
624 | basic_string(const _CharT* __s, size_type __n,
| ^~~~~~~~~~~~
/usr/include/c++/14/bits/basic_string.h:624:7: note: candidate expects 3 arguments, 1 provided
/usr/include/c++/14/bits/basic_string.h:604:7: note: candidate: 'std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::basic_string(const std::__cxx11::basic_string<_CharT, _Traits, _Alloc>&, size_type, size_type, const _Alloc&) [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>; size_type = long unsigned int]'
604 | basic_string(const basic_string& __str, size_type __pos,
| ^~~~~~~~~~~~
/usr/include/c++/14/bits/basic_string.h:604:7: note: candidate expects 4 arguments, 1 provided
/usr/include/c++/14/bits/basic_string.h:586:7: note: candidate: 'std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::basic_string(const std::__cxx11::basic_string<_CharT, _Traits, _Alloc>&, size_type, size_type) [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>; size_type = long unsigned int]'
586 | basic_string(const basic_string& __str, size_type __pos,
| ^~~~~~~~~~~~
/usr/include/c++/14/bits/basic_string.h:586:7: note: candidate expects 3 arguments, 1 provided
/usr/include/c++/14/bits/basic_string.h:569:7: note: candidate: 'std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::basic_string(const std::__cxx11::basic_string<_CharT, _Traits, _Alloc>&, size_type, const _Alloc&) [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>; size_type = long unsigned int]'
569 | basic_string(const basic_string& __str, size_type __pos,
| ^~~~~~~~~~~~
/usr/include/c++/14/bits/basic_string.h:569:7: note: candidate expects 3 arguments, 1 provided
/usr/include/c++/14/bits/basic_string.h:552:7: note: candidate: 'std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::basic_string(const std::__cxx11::basic_string<_CharT, _Traits, _Alloc>&) [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>]'
552 | basic_string(const basic_string& __str)
| ^~~~~~~~~~~~
/usr/include/c++/14/bits/basic_string.h:552:40: note: no known conversion for argument 1 from 'bool' to 'const std::__cxx11::basic_string<char>&'
552 | basic_string(const basic_string& __str)
| ~~~~~~~~~~~~~~~~~~~~^~~~~
/usr/include/c++/14/bits/basic_string.h:540:7: note: candidate: 'std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::basic_string(const _Alloc&) [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>]'
540 | basic_string(const _Alloc& __a) _GLIBCXX_NOEXCEPT
| ^~~~~~~~~~~~
/usr/include/c++/14/bits/basic_string.h:540:34: note: no known conversion for argument 1 from 'bool' to 'const std::allocator<char>&'
|
s327366657 | p03836 | C++ | #include<iostream>
#include<vector>
#include<map>
#include<string>
#include<cstring>
#include<bitset>
#include<stack>
#include<queue>
#include<cmath>
#include<algorithm>
#include<cstdio>
#include<numeric>
#include<set>
#include<math.h>
#include<unordered_map>
using namespace std;
const int dx[4]={1,0,-1,0};
const int dy[4]={0,1,0,-1};
#define rep(i,x) for(int i=0;i<x;i++)
#define re(i,x,y) for(int i=x;i<y;i++)
long long INF=1e9;
const int mod=10007;
#define ll long long
int main(){
int sx,sy,tx,ty;
cin>>sx>>sy>>tx>>ty;
const int ddx=tx-sx,dy=ty-sy;
cout<<string(dy,'U')<<string(dx,'R');
cout<<string(dy,'D')<<string(dx,'L');
cout<<'L'<<string(dy+1<'U')<<string(dx+1,'R')<<endl;
cout<<'R'<<string(dy+1,'D')<<string(dx+1,'L')<<endl;
cout<<endl;
return 0;
}
| a.cc: In function 'int main()':
a.cc:32:40: error: no matching function for call to 'std::__cxx11::basic_string<char>::basic_string(const int [4], char)'
32 | cout<<string(dy,'U')<<string(dx,'R');
| ^
In file included 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/c++/14/bits/basic_string.h:800:9: note: candidate: 'template<class _Tp, class> std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::basic_string(const _Tp&, const _Alloc&) [with <template-parameter-2-2> = _Tp; _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>]'
800 | basic_string(const _Tp& __t, const _Alloc& __a = _Alloc())
| ^~~~~~~~~~~~
/usr/include/c++/14/bits/basic_string.h:800:9: note: template argument deduction/substitution failed:
In file included from /usr/include/c++/14/bits/move.h:37,
from /usr/include/c++/14/bits/exception_ptr.h:41,
from /usr/include/c++/14/exception:166,
from /usr/include/c++/14/ios:41:
/usr/include/c++/14/type_traits: In substitution of 'template<bool _Cond, class _Tp> using std::enable_if_t = typename std::enable_if::type [with bool _Cond = false; _Tp = void]':
/usr/include/c++/14/bits/basic_string.h:149:8: required by substitution of 'template<class _CharT, class _Traits, class _Alloc> template<class _Tp, class _Res> using std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::_If_sv = std::enable_if_t<((bool)std::__and_<std::is_convertible<const _Tp&, std::basic_string_view<_CharT, _Traits> >, std::__not_<std::is_convertible<const _Tp*, const std::__cxx11::basic_string<_CharT, _Traits, _Alloc>*> >, std::__not_<std::is_convertible<const _Tp&, const _CharT*> > >::value), _Res> [with _Tp = int [4]; _Res = void; _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>]'
149 | using _If_sv = enable_if_t<
| ^~~~~~
/usr/include/c++/14/bits/basic_string.h:797:30: required from here
797 | template<typename _Tp, typename = _If_sv<_Tp, void>>
| ^~~~~~~~
/usr/include/c++/14/type_traits:2711:11: error: no type named 'type' in 'struct std::enable_if<false, void>'
2711 | using enable_if_t = typename enable_if<_Cond, _Tp>::type;
| ^~~~~~~~~~~
/usr/include/c++/14/bits/basic_string.h:788:9: note: candidate: 'template<class _Tp, class> std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::basic_string(const _Tp&, size_type, size_type, const _Alloc&) [with <template-parameter-2-2> = _Tp; _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>]'
788 | basic_string(const _Tp& __t, size_type __pos, size_type __n,
| ^~~~~~~~~~~~
/usr/include/c++/14/bits/basic_string.h:788:9: note: candidate expects 3 arguments, 2 provided
/usr/include/c++/14/bits/basic_string.h:765:9: note: candidate: 'template<class _InputIterator, class> std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::basic_string(_InputIterator, _InputIterator, const _Alloc&) [with <template-parameter-2-2> = _InputIterator; _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>]'
765 | basic_string(_InputIterator __beg, _InputIterator __end,
| ^~~~~~~~~~~~
/usr/include/c++/14/bits/basic_string.h:765:9: note: template argument deduction/substitution failed:
a.cc:32:40: note: deduced conflicting types for parameter '_InputIterator' ('const int*' and 'char')
32 | cout<<string(dy,'U')<<string(dx,'R');
| ^
/usr/include/c++/14/bits/basic_string.h:669:7: note: candidate: 'template<class> std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::basic_string(size_type, _CharT, const _Alloc&) [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>]'
669 | basic_string(size_type __n, _CharT __c, const _Alloc& __a = _Alloc())
| ^~~~~~~~~~~~
/usr/include/c++/14/bits/basic_string.h:669:7: note: template argument deduction/substitution failed:
a.cc:32:34: note: cannot convert 'dx' (type 'const int [4]') to type 'std::__cxx11::basic_string<char>::size_type' {aka 'long unsigned int'}
32 | cout<<string(dy,'U')<<string(dx,'R');
| ^~
/usr/include/c++/14/bits/basic_string.h:646:7: note: candidate: 'template<class> std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::basic_string(const _CharT*, const _Alloc&) [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>]'
646 | basic_string(const _CharT* __s, const _Alloc& __a = _Alloc())
| ^~~~~~~~~~~~
/usr/include/c++/14/bits/basic_string.h:646:7: note: template argument deduction/substitution failed:
a.cc:32:34: note: cannot convert 'dx' (type 'const int [4]') to type 'const char*'
32 | cout<<string(dy,'U')<<string(dx,'R');
| ^~
/usr/include/c++/14/bits/basic_string.h:721:7: note: candidate: 'std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::basic_string(std::__cxx11::basic_string<_CharT, _Traits, _Alloc>&&, const _Alloc&) [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>]'
721 | basic_string(basic_string&& __str, const _Alloc& __a)
| ^~~~~~~~~~~~
/usr/include/c++/14/bits/basic_string.h:721:35: note: no known conversion for argument 1 from 'const int [4]' to 'std::__cxx11::basic_string<char>&&'
721 | basic_string(basic_string&& __str, const _Alloc& __a)
| ~~~~~~~~~~~~~~~^~~~~
/usr/include/c++/14/bits/basic_string.h:716:7: note: candidate: 'std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::basic_string(const std::__cxx11::basic_string<_CharT, _Traits, _Alloc>&, const _Alloc&) [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>]'
716 | basic_string(const basic_string& __str, const _Alloc& __a)
| ^~~~~~~~~~~~
/usr/include/c++/14/bits/basic_string.h:716:40: note: no known conversion for argument 1 from 'const int [4]' to 'const std::__cxx11::basic_string<char>&'
716 | basic_string(const basic_string& __str, const _Alloc& __a)
| ~~~~~~~~~~~~~~~~~~~~^~~~~
/usr/include/c++/14/bits/basic_string.h:711:7: note: candidate: 'std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::basic_string(std::initializer_list<_Tp>, const _Alloc&) [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>]'
711 | basic_string(initializer_list<_CharT> __l, const _Alloc& __a = _Alloc())
| ^~~~~~~~~~~~
/usr/include/c++/14/bits/basic_string.h:711:45: note: no known conversion for argument 1 from 'const int [4]' to 'std::initializer_list<char>'
711 | basic_string(initializer_list<_CharT> __l, const _Alloc& __a = _Alloc())
| ~~~~~~~~~~~~~~~~~~~~~~~~~^~~
/usr/include/c++/14/bits/basic_string.h:682:7: note: candidate: 'std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::basic_string(std::__cxx11::basic_string<_CharT, _Traits, _Alloc>&&) [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>]'
682 | basic_string(basic_string&& __str) noexcept
| ^~~~~~~~~~~~
/usr/include/c++/14/bits/basic_string.h:682:7: note: candidate expects 1 argument, 2 provided
/usr/include/c++/14/bits/basic_string.h:624:7: note: candidate: 'std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::basic_string(const _CharT*, size_type, const _Alloc&) [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>; size_type = long unsigned int]'
624 | basic_string(const _CharT* __s, size_type __n,
| ^~~~~~~~~~~~
/usr/include/c++/14/bits/basic_string.h:624:34: note: no known conversion for argument 1 from 'const int [4]' to 'const char*'
624 | basic_string(const _CharT* __s, size_type __n,
| ~~~~~~~~~~~~~~^~~
/usr/include/c++/14/bits/basic_string.h:604:7: note: candidate: 'std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::basic_string(const std::__cxx11::basic_string<_CharT, _Traits, _Alloc>&, size_type, size_type, const _Alloc&) [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>; size_type = long unsigned int]'
604 | basic_string(const basic_string& __str, size_type __pos,
| ^~~~~~~~~~~~
/usr/include/c++/14/bits/basic_string.h:604:7: note: candidate expects 4 arguments, 2 provided
/usr/include/c++/14/bits/basic_string.h:586:7: note: candidate: 'std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::basic_string(const std::__cxx11::basic_string<_CharT, _Traits, _Alloc>&, size_type, size_type) [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>; size_type = long unsigned int]'
586 | basic_string(const basic_string& __str, size_type __pos,
| ^~~~~~~~~~~~
/usr/include/c++/14/bits/basic_string.h:586:7: note: candidate expects 3 arguments, 2 provided
/usr/include/c++/14/bits/basic_string.h:569:7: note: candidate: 'std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::basic_string(const std::__cxx11::basic_string<_CharT, _Traits, _Alloc>&, size_type, const _Alloc&) [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>; size_type = long unsigned int]'
569 | basic_string(const basic_string& __str, size_type __pos,
| ^~~~~~~~~~~~
/usr/include/c++/14/bits/basic_string.h:569:40: note: no known conversion for argument 1 from 'const int [4]' to 'const std::__cxx11::basic_string<char>&'
569 | basic_string(const basic_string& __str, size_type __pos,
| ~~~~~~~~~~~~~~~~~~~~^~~~~
/usr/include/c++/14/bits/basic_string.h:552:7: note: candidate: 'std::__cxx11::basic_string<_Cha |
s126122649 | p03836 | C++ | #include <iostream>
# include <string>
# include <cstdio>
using namespace std;
int main(void) {
int sx, sy, tx, ty;
int a[10];
for (int i = 0; i< 4; i++){
scanf("%d", &a[i]);
}
sx = a[0];
sy = a[1];
tx = a[2];
ty = a[3];
int x_diff = tx- sx;
int y_diff = ty - sy;
string box1 = string(y_diff, "U");
box1 += string(x_diff+1, "R");
box1 += string(y_diff+1, "D");
box1 += string(x_diff+1, "L");
box1 += string(1, "U");
string box2 = string(x_diff, "R");
box2 += string(y_diff+1, "U");
box2 += string(x_diff+1, "L");
box2 += string(y_diff+1, "D");
box2 += string(1, "R");
cout << box1 << box2 << endl;
} | a.cc: In function 'int main()':
a.cc:20:37: error: no matching function for call to 'std::__cxx11::basic_string<char>::basic_string(int&, const char [2])'
20 | string box1 = string(y_diff, "U");
| ^
In file included 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/c++/14/bits/basic_string.h:624:7: note: candidate: 'std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::basic_string(const _CharT*, size_type, const _Alloc&) [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>; size_type = long unsigned int]' (near match)
624 | basic_string(const _CharT* __s, size_type __n,
| ^~~~~~~~~~~~
/usr/include/c++/14/bits/basic_string.h:624:7: note: conversion of argument 2 would be ill-formed:
a.cc:20:34: error: invalid conversion from 'const char*' to 'std::__cxx11::basic_string<char>::size_type' {aka 'long unsigned int'} [-fpermissive]
20 | string box1 = string(y_diff, "U");
| ^~~
| |
| const char*
/usr/include/c++/14/bits/basic_string.h:800:9: note: candidate: 'template<class _Tp, class> std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::basic_string(const _Tp&, const _Alloc&) [with <template-parameter-2-2> = _Tp; _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>]'
800 | basic_string(const _Tp& __t, const _Alloc& __a = _Alloc())
| ^~~~~~~~~~~~
/usr/include/c++/14/bits/basic_string.h:800:9: note: template argument deduction/substitution failed:
In file included from /usr/include/c++/14/bits/move.h:37,
from /usr/include/c++/14/bits/exception_ptr.h:41,
from /usr/include/c++/14/exception:166,
from /usr/include/c++/14/ios:41:
/usr/include/c++/14/type_traits: In substitution of 'template<bool _Cond, class _Tp> using std::enable_if_t = typename std::enable_if::type [with bool _Cond = false; _Tp = void]':
/usr/include/c++/14/bits/basic_string.h:149:8: required by substitution of 'template<class _CharT, class _Traits, class _Alloc> template<class _Tp, class _Res> using std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::_If_sv = std::enable_if_t<((bool)std::__and_<std::is_convertible<const _Tp&, std::basic_string_view<_CharT, _Traits> >, std::__not_<std::is_convertible<const _Tp*, const std::__cxx11::basic_string<_CharT, _Traits, _Alloc>*> >, std::__not_<std::is_convertible<const _Tp&, const _CharT*> > >::value), _Res> [with _Tp = int; _Res = void; _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>]'
149 | using _If_sv = enable_if_t<
| ^~~~~~
/usr/include/c++/14/bits/basic_string.h:797:30: required from here
797 | template<typename _Tp, typename = _If_sv<_Tp, void>>
| ^~~~~~~~
/usr/include/c++/14/type_traits:2711:11: error: no type named 'type' in 'struct std::enable_if<false, void>'
2711 | using enable_if_t = typename enable_if<_Cond, _Tp>::type;
| ^~~~~~~~~~~
/usr/include/c++/14/bits/basic_string.h:788:9: note: candidate: 'template<class _Tp, class> std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::basic_string(const _Tp&, size_type, size_type, const _Alloc&) [with <template-parameter-2-2> = _Tp; _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>]'
788 | basic_string(const _Tp& __t, size_type __pos, size_type __n,
| ^~~~~~~~~~~~
/usr/include/c++/14/bits/basic_string.h:788:9: note: candidate expects 3 arguments, 2 provided
/usr/include/c++/14/bits/basic_string.h:765:9: note: candidate: 'template<class _InputIterator, class> std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::basic_string(_InputIterator, _InputIterator, const _Alloc&) [with <template-parameter-2-2> = _InputIterator; _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>]'
765 | basic_string(_InputIterator __beg, _InputIterator __end,
| ^~~~~~~~~~~~
/usr/include/c++/14/bits/basic_string.h:765:9: note: template argument deduction/substitution failed:
a.cc:20:37: note: deduced conflicting types for parameter '_InputIterator' ('int' and 'const char*')
20 | string box1 = string(y_diff, "U");
| ^
/usr/include/c++/14/bits/basic_string.h:669:7: note: candidate: 'template<class> std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::basic_string(size_type, _CharT, const _Alloc&) [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>]'
669 | basic_string(size_type __n, _CharT __c, const _Alloc& __a = _Alloc())
| ^~~~~~~~~~~~
/usr/include/c++/14/bits/basic_string.h:669:7: note: template argument deduction/substitution failed:
a.cc:20:34: note: cannot convert '"U"' (type 'const char [2]') to type 'char'
20 | string box1 = string(y_diff, "U");
| ^~~
/usr/include/c++/14/bits/basic_string.h:646:7: note: candidate: 'template<class> std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::basic_string(const _CharT*, const _Alloc&) [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>]'
646 | basic_string(const _CharT* __s, const _Alloc& __a = _Alloc())
| ^~~~~~~~~~~~
/usr/include/c++/14/bits/basic_string.h:646:7: note: template argument deduction/substitution failed:
a.cc:20:26: note: cannot convert 'y_diff' (type 'int') to type 'const char*'
20 | string box1 = string(y_diff, "U");
| ^~~~~~
/usr/include/c++/14/bits/basic_string.h:721:7: note: candidate: 'std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::basic_string(std::__cxx11::basic_string<_CharT, _Traits, _Alloc>&&, const _Alloc&) [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>]'
721 | basic_string(basic_string&& __str, const _Alloc& __a)
| ^~~~~~~~~~~~
/usr/include/c++/14/bits/basic_string.h:721:35: note: no known conversion for argument 1 from 'int' to 'std::__cxx11::basic_string<char>&&'
721 | basic_string(basic_string&& __str, const _Alloc& __a)
| ~~~~~~~~~~~~~~~^~~~~
/usr/include/c++/14/bits/basic_string.h:716:7: note: candidate: 'std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::basic_string(const std::__cxx11::basic_string<_CharT, _Traits, _Alloc>&, const _Alloc&) [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>]'
716 | basic_string(const basic_string& __str, const _Alloc& __a)
| ^~~~~~~~~~~~
/usr/include/c++/14/bits/basic_string.h:716:40: note: no known conversion for argument 1 from 'int' to 'const std::__cxx11::basic_string<char>&'
716 | basic_string(const basic_string& __str, const _Alloc& __a)
| ~~~~~~~~~~~~~~~~~~~~^~~~~
/usr/include/c++/14/bits/basic_string.h:711:7: note: candidate: 'std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::basic_string(std::initializer_list<_Tp>, const _Alloc&) [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>]'
711 | basic_string(initializer_list<_CharT> __l, const _Alloc& __a = _Alloc())
| ^~~~~~~~~~~~
/usr/include/c++/14/bits/basic_string.h:711:45: note: no known conversion for argument 1 from 'int' to 'std::initializer_list<char>'
711 | basic_string(initializer_list<_CharT> __l, const _Alloc& __a = _Alloc())
| ~~~~~~~~~~~~~~~~~~~~~~~~~^~~
/usr/include/c++/14/bits/basic_string.h:682:7: note: candidate: 'std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::basic_string(std::__cxx11::basic_string<_CharT, _Traits, _Alloc>&&) [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>]'
682 | basic_string(basic_string&& __str) noexcept
| ^~~~~~~~~~~~
/usr/include/c++/14/bits/basic_string.h:682:7: note: candidate expects 1 argument, 2 provided
/usr/include/c++/14/bits/basic_string.h:604:7: note: candidate: 'std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::basic_string(const std::__cxx11::basic_string<_CharT, _Traits, _Alloc>&, size_type, size_type, const _Alloc&) [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>; size_type = long unsigned int]'
604 | basic_string(const basic_string& __str, size_type __pos,
| ^~~~~~~~~~~~
/usr/include/c++/14/bits/basic_string.h:604:7: note: candidate expects 4 arguments, 2 provided
/usr/include/c++/14/bits/basic_string.h:586:7: note: candidate: 'std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::basic_string(const std::__cxx11::basic_string<_CharT, _Traits, _Alloc>&, size_type, size_type) [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>; size_type = long unsigned int]'
586 | basic_string(const basic_string& __str, size_type __pos,
| ^~~~~~~~~~~~
/usr/include/c++/14/bits/basic_string.h:586:7: note: candidate expects 3 arguments, 2 provided
/usr/include/c++/14/bits/basic_string.h:569:7: note: candidate: 'std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::basic_string(const std::__cxx11::basic_string<_CharT, _Traits, _Alloc>&, size_type, const _Alloc&) [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>; size_type = long unsigned int]'
569 | basic_string(const basic_string& __str, size_type __pos,
| ^~~~~~~~~~~~
/usr/include/c++/14/bits/basic_string.h:569:40: note: no known conversion for argument 1 from 'int' to 'const std::__cxx11::basic_string<char>&'
569 | basic_string(const basic_string& __str, size_type __pos,
| ~~~~~~~~~~~~~~~~~~~~^~~~~
/usr/include/c+ |
s009979604 | p03836 | C++ | #include <iostream>
# include <string>
# include <cstdio>
using namespace std;
int main(void) {
int sx, sy, tx, ty;
int a[10];
for (int i = 0; i< 4; i++){
scanf("%d", &a[i]);
}
sx = a[0];
sy = a[1];
tx = a[2];
ty = a[3];
string box1, box2;
int x_diff = tx- sx;
int y_diff = ty - sy;
box1 = string(y_diff, "U");
box1 += string(x_diff+1, "R");
box1 += string(y_diff+1, "D");
box1 += string(x_diff+1, "L");
box1 += string(1, "U");
box2 = string(x_diff, "R");
box2 += string(y_diff+1, "U");
box2 += string(x_diff+1, "L");
box2 += string(y_diff+1, "D");
box2 += string(1, "R");
cout << box1 << box2 << endl;
} | a.cc: In function 'int main()':
a.cc:20:30: error: no matching function for call to 'std::__cxx11::basic_string<char>::basic_string(int&, const char [2])'
20 | box1 = string(y_diff, "U");
| ^
In file included 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/c++/14/bits/basic_string.h:624:7: note: candidate: 'std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::basic_string(const _CharT*, size_type, const _Alloc&) [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>; size_type = long unsigned int]' (near match)
624 | basic_string(const _CharT* __s, size_type __n,
| ^~~~~~~~~~~~
/usr/include/c++/14/bits/basic_string.h:624:7: note: conversion of argument 2 would be ill-formed:
a.cc:20:27: error: invalid conversion from 'const char*' to 'std::__cxx11::basic_string<char>::size_type' {aka 'long unsigned int'} [-fpermissive]
20 | box1 = string(y_diff, "U");
| ^~~
| |
| const char*
/usr/include/c++/14/bits/basic_string.h:800:9: note: candidate: 'template<class _Tp, class> std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::basic_string(const _Tp&, const _Alloc&) [with <template-parameter-2-2> = _Tp; _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>]'
800 | basic_string(const _Tp& __t, const _Alloc& __a = _Alloc())
| ^~~~~~~~~~~~
/usr/include/c++/14/bits/basic_string.h:800:9: note: template argument deduction/substitution failed:
In file included from /usr/include/c++/14/bits/move.h:37,
from /usr/include/c++/14/bits/exception_ptr.h:41,
from /usr/include/c++/14/exception:166,
from /usr/include/c++/14/ios:41:
/usr/include/c++/14/type_traits: In substitution of 'template<bool _Cond, class _Tp> using std::enable_if_t = typename std::enable_if::type [with bool _Cond = false; _Tp = void]':
/usr/include/c++/14/bits/basic_string.h:149:8: required by substitution of 'template<class _CharT, class _Traits, class _Alloc> template<class _Tp, class _Res> using std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::_If_sv = std::enable_if_t<((bool)std::__and_<std::is_convertible<const _Tp&, std::basic_string_view<_CharT, _Traits> >, std::__not_<std::is_convertible<const _Tp*, const std::__cxx11::basic_string<_CharT, _Traits, _Alloc>*> >, std::__not_<std::is_convertible<const _Tp&, const _CharT*> > >::value), _Res> [with _Tp = int; _Res = void; _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>]'
149 | using _If_sv = enable_if_t<
| ^~~~~~
/usr/include/c++/14/bits/basic_string.h:797:30: required from here
797 | template<typename _Tp, typename = _If_sv<_Tp, void>>
| ^~~~~~~~
/usr/include/c++/14/type_traits:2711:11: error: no type named 'type' in 'struct std::enable_if<false, void>'
2711 | using enable_if_t = typename enable_if<_Cond, _Tp>::type;
| ^~~~~~~~~~~
/usr/include/c++/14/bits/basic_string.h:788:9: note: candidate: 'template<class _Tp, class> std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::basic_string(const _Tp&, size_type, size_type, const _Alloc&) [with <template-parameter-2-2> = _Tp; _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>]'
788 | basic_string(const _Tp& __t, size_type __pos, size_type __n,
| ^~~~~~~~~~~~
/usr/include/c++/14/bits/basic_string.h:788:9: note: candidate expects 3 arguments, 2 provided
/usr/include/c++/14/bits/basic_string.h:765:9: note: candidate: 'template<class _InputIterator, class> std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::basic_string(_InputIterator, _InputIterator, const _Alloc&) [with <template-parameter-2-2> = _InputIterator; _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>]'
765 | basic_string(_InputIterator __beg, _InputIterator __end,
| ^~~~~~~~~~~~
/usr/include/c++/14/bits/basic_string.h:765:9: note: template argument deduction/substitution failed:
a.cc:20:30: note: deduced conflicting types for parameter '_InputIterator' ('int' and 'const char*')
20 | box1 = string(y_diff, "U");
| ^
/usr/include/c++/14/bits/basic_string.h:669:7: note: candidate: 'template<class> std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::basic_string(size_type, _CharT, const _Alloc&) [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>]'
669 | basic_string(size_type __n, _CharT __c, const _Alloc& __a = _Alloc())
| ^~~~~~~~~~~~
/usr/include/c++/14/bits/basic_string.h:669:7: note: template argument deduction/substitution failed:
a.cc:20:27: note: cannot convert '"U"' (type 'const char [2]') to type 'char'
20 | box1 = string(y_diff, "U");
| ^~~
/usr/include/c++/14/bits/basic_string.h:646:7: note: candidate: 'template<class> std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::basic_string(const _CharT*, const _Alloc&) [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>]'
646 | basic_string(const _CharT* __s, const _Alloc& __a = _Alloc())
| ^~~~~~~~~~~~
/usr/include/c++/14/bits/basic_string.h:646:7: note: template argument deduction/substitution failed:
a.cc:20:19: note: cannot convert 'y_diff' (type 'int') to type 'const char*'
20 | box1 = string(y_diff, "U");
| ^~~~~~
/usr/include/c++/14/bits/basic_string.h:721:7: note: candidate: 'std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::basic_string(std::__cxx11::basic_string<_CharT, _Traits, _Alloc>&&, const _Alloc&) [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>]'
721 | basic_string(basic_string&& __str, const _Alloc& __a)
| ^~~~~~~~~~~~
/usr/include/c++/14/bits/basic_string.h:721:35: note: no known conversion for argument 1 from 'int' to 'std::__cxx11::basic_string<char>&&'
721 | basic_string(basic_string&& __str, const _Alloc& __a)
| ~~~~~~~~~~~~~~~^~~~~
/usr/include/c++/14/bits/basic_string.h:716:7: note: candidate: 'std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::basic_string(const std::__cxx11::basic_string<_CharT, _Traits, _Alloc>&, const _Alloc&) [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>]'
716 | basic_string(const basic_string& __str, const _Alloc& __a)
| ^~~~~~~~~~~~
/usr/include/c++/14/bits/basic_string.h:716:40: note: no known conversion for argument 1 from 'int' to 'const std::__cxx11::basic_string<char>&'
716 | basic_string(const basic_string& __str, const _Alloc& __a)
| ~~~~~~~~~~~~~~~~~~~~^~~~~
/usr/include/c++/14/bits/basic_string.h:711:7: note: candidate: 'std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::basic_string(std::initializer_list<_Tp>, const _Alloc&) [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>]'
711 | basic_string(initializer_list<_CharT> __l, const _Alloc& __a = _Alloc())
| ^~~~~~~~~~~~
/usr/include/c++/14/bits/basic_string.h:711:45: note: no known conversion for argument 1 from 'int' to 'std::initializer_list<char>'
711 | basic_string(initializer_list<_CharT> __l, const _Alloc& __a = _Alloc())
| ~~~~~~~~~~~~~~~~~~~~~~~~~^~~
/usr/include/c++/14/bits/basic_string.h:682:7: note: candidate: 'std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::basic_string(std::__cxx11::basic_string<_CharT, _Traits, _Alloc>&&) [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>]'
682 | basic_string(basic_string&& __str) noexcept
| ^~~~~~~~~~~~
/usr/include/c++/14/bits/basic_string.h:682:7: note: candidate expects 1 argument, 2 provided
/usr/include/c++/14/bits/basic_string.h:604:7: note: candidate: 'std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::basic_string(const std::__cxx11::basic_string<_CharT, _Traits, _Alloc>&, size_type, size_type, const _Alloc&) [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>; size_type = long unsigned int]'
604 | basic_string(const basic_string& __str, size_type __pos,
| ^~~~~~~~~~~~
/usr/include/c++/14/bits/basic_string.h:604:7: note: candidate expects 4 arguments, 2 provided
/usr/include/c++/14/bits/basic_string.h:586:7: note: candidate: 'std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::basic_string(const std::__cxx11::basic_string<_CharT, _Traits, _Alloc>&, size_type, size_type) [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>; size_type = long unsigned int]'
586 | basic_string(const basic_string& __str, size_type __pos,
| ^~~~~~~~~~~~
/usr/include/c++/14/bits/basic_string.h:586:7: note: candidate expects 3 arguments, 2 provided
/usr/include/c++/14/bits/basic_string.h:569:7: note: candidate: 'std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::basic_string(const std::__cxx11::basic_string<_CharT, _Traits, _Alloc>&, size_type, const _Alloc&) [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>; size_type = long unsigned int]'
569 | basic_string(const basic_string& __str, size_type __pos,
| ^~~~~~~~~~~~
/usr/include/c++/14/bits/basic_string.h:569:40: note: no known conversion for argument 1 from 'int' to 'const std::__cxx11::basic_string<char>&'
569 | basic_string(const basic_string& __str, size_type __pos,
| ~~~~~~~~~~~~~~~~~~~~^~~~~
/usr/include/c++/14/bits/basic_string.h:552:7: note: candidate: 'std::__cxx11::basic_string<_CharT, |
s101917934 | p03836 | C++ | #include <iostream>
# include <string>
int main(void) {
int sx, sy, tx, ty;
cin >> sx >> endl;
cin >> sy >> endl;
cin >> tx >> endl;
cin >> ty >> endl;
string box1, box2;
int x_diff = tx- sx;
int y_diff = ty - sy;
box1 = string(y_diff, "U");
box1 += string(x_diff+1, "R");
box1 += string(y_diff+1, "D");
box1 += string(x_diff+1, "L");
box1 += string(1, "U");
box2 = string(x_diff, "R");
box2 += string(y_diff+1, "U");
box2 += string(x_diff+1, "L");
box2 += string(y_diff+1, "D");
box2 += string(1, "R");
cout << box1 << box2 << endl;
} | a.cc: In function 'int main()':
a.cc:5:3: error: 'cin' was not declared in this scope; did you mean 'std::cin'?
5 | cin >> sx >> endl;
| ^~~
| 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:5:16: error: 'endl' was not declared in this scope; did you mean 'std::endl'?
5 | cin >> sx >> 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:9:3: error: 'string' was not declared in this scope
9 | string box1, box2;
| ^~~~~~
a.cc:9:3: note: suggested alternatives:
In file included from /usr/include/c++/14/iosfwd:41,
from /usr/include/c++/14/ios:40,
from /usr/include/c++/14/ostream:40:
/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:12:5: error: 'box1' was not declared in this scope
12 | box1 = string(y_diff, "U");
| ^~~~
a.cc:18:5: error: 'box2' was not declared in this scope
18 | box2 = string(x_diff, "R");
| ^~~~
a.cc:24:5: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
24 | cout << box1 << box2 << endl;
| ^~~~
| std::cout
/usr/include/c++/14/iostream:63:18: note: 'std::cout' declared here
63 | extern ostream cout; ///< Linked to standard output
| ^~~~
|
s630474886 | p03836 | C++ | #include <iostream>
# include <string>
int main(void) {
int sx, sy, tx, ty;
cin >> sx<< endl;
cin >> sy<< endl;
cin >> tx<< endl;
cin >> ty<< endl;
string box1, box2;
int x_diff = tx- sx;
int y_diff = ty - sy;
box1 = string(y_diff, "U");
box1 += string(x_diff+1, "R");
box1 += string(y_diff+1, "D");
box1 += string(x_diff+1, "L");
box1 += string(1, "U");
box2 = string(x_diff, "R");
box2 += string(y_diff+1, "U");
box2 += string(x_diff+1, "L");
box2 += string(y_diff+1, "D");
box2 += string(1, "R");
cout << box1 << box2 << endl;
} | a.cc: In function 'int main()':
a.cc:5:3: error: 'cin' was not declared in this scope; did you mean 'std::cin'?
5 | cin >> sx<< endl;
| ^~~
| 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:5:15: error: 'endl' was not declared in this scope; did you mean 'std::endl'?
5 | cin >> sx<< 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:9:3: error: 'string' was not declared in this scope
9 | string box1, box2;
| ^~~~~~
a.cc:9:3: note: suggested alternatives:
In file included from /usr/include/c++/14/iosfwd:41,
from /usr/include/c++/14/ios:40,
from /usr/include/c++/14/ostream:40:
/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:12:5: error: 'box1' was not declared in this scope
12 | box1 = string(y_diff, "U");
| ^~~~
a.cc:18:5: error: 'box2' was not declared in this scope
18 | box2 = string(x_diff, "R");
| ^~~~
a.cc:24:5: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
24 | cout << box1 << box2 << endl;
| ^~~~
| std::cout
/usr/include/c++/14/iostream:63:18: note: 'std::cout' declared here
63 | extern ostream cout; ///< Linked to standard output
| ^~~~
|
s529002428 | p03836 | C++ | #include <iostream>
# include <string>
int main(void) {
int sx, sy, tx, ty;
cin >> sx, sy, tx, ty << endl;
string box1, box2;
int x_diff = tx- sx;
int y_diff = ty - sy;
box1 = string(y_diff, "U");
box1 += string(x_diff+1, "R");
box1 += string(y_diff+1, "D");
box1 += string(x_diff+1, "L");
box1 += string(1, "U");
box2 = string(x_diff, "R");
box2 += string(y_diff+1, "U");
box2 += string(x_diff+1, "L");
box2 += string(y_diff+1, "D");
box2 += string(1, "R");
cout << box1 << box2 << endl;
} | a.cc: In function 'int main()':
a.cc:5:3: error: 'cin' was not declared in this scope; did you mean 'std::cin'?
5 | cin >> sx, sy, tx, ty << endl;
| ^~~
| 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:5:28: error: 'endl' was not declared in this scope; did you mean 'std::endl'?
5 | cin >> sx, sy, tx, ty << 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:6:3: error: 'string' was not declared in this scope
6 | string box1, box2;
| ^~~~~~
a.cc:6:3: note: suggested alternatives:
In file included from /usr/include/c++/14/iosfwd:41,
from /usr/include/c++/14/ios:40,
from /usr/include/c++/14/ostream:40:
/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:5: error: 'box1' was not declared in this scope
9 | box1 = string(y_diff, "U");
| ^~~~
a.cc:15:5: error: 'box2' was not declared in this scope
15 | box2 = string(x_diff, "R");
| ^~~~
a.cc:21:5: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
21 | cout << box1 << box2 << endl;
| ^~~~
| std::cout
/usr/include/c++/14/iostream:63:18: note: 'std::cout' declared here
63 | extern ostream cout; ///< Linked to standard output
| ^~~~
|
s970707520 | p03836 | C++ | #include <iostream>
# include <string>
int main(void) {
int sx; sy; tx; ty;
cin >> sx, sy, tx, ty << endl;
string box1, box2;
int x_diff = tx- sx;
int y_diff = ty - sy;
box1 = string(y_diff, "U");
box1 += string(x_diff+1, "R");
box1 += string(y_diff+1, "D");
box1 += string(x_diff+1, "L");
box1 += string(1, "U");
box2 = string(x_diff, "R");
box2 += string(y_diff+1, "U");
box2 += string(x_diff+1, "L");
box2 += string(y_diff+1, "D");
box2 += string(1, "R");
cout << box1 << box2 << endl;
} | a.cc: In function 'int main()':
a.cc:4:11: error: 'sy' was not declared in this scope; did you mean 'sx'?
4 | int sx; sy; tx; ty;
| ^~
| sx
a.cc:4:15: error: 'tx' was not declared in this scope; did you mean 'sx'?
4 | int sx; sy; tx; ty;
| ^~
| sx
a.cc:4:19: error: 'ty' was not declared in this scope; did you mean 'tm'?
4 | int sx; sy; tx; ty;
| ^~
| tm
a.cc:5:3: error: 'cin' was not declared in this scope; did you mean 'std::cin'?
5 | cin >> sx, sy, tx, ty << endl;
| ^~~
| 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:5:28: error: 'endl' was not declared in this scope; did you mean 'std::endl'?
5 | cin >> sx, sy, tx, ty << 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:6:3: error: 'string' was not declared in this scope
6 | string box1, box2;
| ^~~~~~
a.cc:6:3: note: suggested alternatives:
In file included from /usr/include/c++/14/iosfwd:41,
from /usr/include/c++/14/ios:40,
from /usr/include/c++/14/ostream:40:
/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:5: error: 'box1' was not declared in this scope
9 | box1 = string(y_diff, "U");
| ^~~~
a.cc:15:5: error: 'box2' was not declared in this scope
15 | box2 = string(x_diff, "R");
| ^~~~
a.cc:21:5: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
21 | cout << box1 << box2 << endl;
| ^~~~
| std::cout
/usr/include/c++/14/iostream:63:18: note: 'std::cout' declared here
63 | extern ostream cout; ///< Linked to standard output
| ^~~~
|
s519756885 | p03836 | Java | public class Main {
public static void main(String[] args){
Scanner sc = new Scanner(System.in);
int sx = sc.nextInt();
int sy = sc.nextInt();
int tx = sc.nextInt();
int ty = sc.nextInt();
StringBuilder res = new StringBuilder("");
for(int i = 0; i < ty - sy; i++)
res.append('U');
for(int i = 0; i < tx - sx; i++)
res.append('R');
for(int i = 0; i < ty - sy; i++)
res.append('D');
for(int i = 0; i < tx - sx; i++)
res.append('L');
res.append('D');
for(int i = 0; i < tx - sx + 1; i++)
res.append('R');
for(int i = 0; i < ty - sy + 1; i++)
res.append('U');
res.append('L');
res.append('U');
for(int i = 0; i < tx - sx + 1; i++)
res.append('L');
for(int i = 0; i < ty - sy + 1; i++)
res.append('D');
res.append('R');
System.out.println(res.toString());
}
}
| Main.java:3: error: cannot find symbol
Scanner sc = new Scanner(System.in);
^
symbol: class Scanner
location: class Main
Main.java:3: error: cannot find symbol
Scanner sc = new Scanner(System.in);
^
symbol: class Scanner
location: class Main
2 errors
|
s355726663 | p03836 | C++ | #include <bits/stdc++.h>
#include <algorithm>
using namespace std;
int main() {
long long int a,b,c,d,e,f,g[110],h[110];
cin >>a >>b>>c>>d;
{
if( d-b>0){
for(int i=0;i<d-b;i++){
cout << "U" ;
}
}
else if(d-b<0){
for(int i=0;i<b-d;i++){
cout <<"D";
}
}
}
{
if( c-a>0){
for(int i=0;i<c-a;i++){
cout << "R" ;
}
}
else if(c-a<0){
for(int i=0;i<a-c;i++){
cout <<"L";
}
}
}
{
if( d-b<0){
for(int i=0;i<b-d;i++){
cout << "U" ;
}
}
else if(d-b>0){
for(int i=0;i<d-b;i++){
cout <<"D";
}
}
}
{
if( c-a>0){
for(int i=0;i<c-a+1;i++){
cout << "L" ;
}
}
else if(c-a<0){
for(int i=0;i<a-c+1;i++){
cout <<"R";
}
}
}
{
if( d-b>0){
for(int i=0;i<d-b+1;i++){
cout << "U" ;
}
}
else if(d-b<0){
for(int i=0;i<b-d+1;i++){
cout <<"D";
}
}
}
{
if( c-a>0){
for(int i=0;i<c-a+1;i++){
cout << "R" ;
}
}
else if(c-a<0){
for(int i=0;i<a-c+1;i++){
cout <<"L";
}
}
}
{
if( d-b>0){
for(int i=0;i<1;i++){
cout << "D" ;
}
}
else if(d-b<0){
for(int i=0;i<1;i++){
cout <<"U";
}
}
}
{
if( c-a>0){
for(int i=0;i<1;i++){
cout << "R" ;
}
}
else if(c-a<0){
for(int i=0;i<1;i++){
cout <<"L";
}
}
}
if( d-b>0){
for(int i=0;i<d-b+1;i++){
cout << "D" ;
}
}
else if(d-b<0){
for(int i=0;i<b-d+1;i++){
cout <<"U";
}
}
}
{
if( c-a>0){
for(int i=0;i<c-a+1;i++){
cout << "L" ;
}
}
else if(c-a<0){
for(int i=0;i<a-c+1;i++){
cout <<"R";
}
}
}
{
if( d-b>0){
for(int i=0;i<1;i++){
cout << "U" ;
}
}
else if(d-b<0){
for(int i=0;i<1;i++){
cout <<"D";
}
}
}
cout << endl;
}
| a.cc:134:3: error: expected unqualified-id before '{' token
134 | {
| ^
a.cc:148:5: error: expected unqualified-id before '{' token
148 | {
| ^
a.cc:163:1: error: 'cout' does not name a type
163 | cout << endl;
| ^~~~
a.cc:164:1: error: expected declaration before '}' token
164 | }
| ^
|
s326601977 | p03836 | C++ | #include <iostream>
#include <vector>
#include <cmath>
#include <map>
char dd[4] = {'U','R','D','L'};
pair<int, int> di = {make_pair(0,1), make_pair(1,0), make_pair(0,-1), make_pair(0,-1)};
using namespace std;
vector<char> ans;
visit(int sx, int sy, int tx, int ty, vector<vector<bool>> &visited, vector<char> &s){
if(sx = tx && sy == ty){
for(int i = 0; i < s.size(); i++) ans.push_back(s[i]);
return;
}else{
bool all_visited = true;
for(int i = 0; i < 4; i++){
if(!visited[sx+di[i].first][sy+di[i].second]) all_visited = false;
}
if(all_visited) return;
int dist = 10000, nx, t;
bool f = true;
for(int i = 0; i < 4; i++){
int dx, dy;
dx = sx+di[i].first, dy = sy+di[i].second;
if(visited[dx][dy]) continue;
int d = abs(tx - dx) + abs(ty - dy);
if(dist >= d){
t = i;
dist = d
nx = dx, ny = dy;
f = false;
}
}
if(f)return;
visit(nx, ny, tx, ty, visited, s);
}
}
int main(){
int sx, sy, tx, ty;
vector<vector<bool>> visited(100,vector<bool>(100,false));
vector<char> s;
visit(sx, sy, tx, ty, visited, s);
cout << ans;
} | a.cc:7:1: error: 'pair' does not name a type
7 | pair<int, int> di = {make_pair(0,1), make_pair(1,0), make_pair(0,-1), make_pair(0,-1)};
| ^~~~
a.cc:13:1: error: ISO C++ forbids declaration of 'visit' with no type [-fpermissive]
13 | visit(int sx, int sy, int tx, int ty, vector<vector<bool>> &visited, vector<char> &s){
| ^~~~~
a.cc: In function 'int visit(int, int, int, int, std::vector<std::vector<bool> >&, std::vector<char>&)':
a.cc:16:5: error: return-statement with no value, in function returning 'int' [-fpermissive]
16 | return;
| ^~~~~~
a.cc:20:22: error: 'di' was not declared in this scope; did you mean 'i'?
20 | if(!visited[sx+di[i].first][sy+di[i].second]) all_visited = false;
| ^~
| i
a.cc:22:21: error: return-statement with no value, in function returning 'int' [-fpermissive]
22 | if(all_visited) return;
| ^~~~~~
a.cc:27:15: error: 'di' was not declared in this scope; did you mean 'dy'?
27 | dx = sx+di[i].first, dy = sy+di[i].second;
| ^~
| dy
a.cc:32:17: error: expected ';' before 'nx'
32 | dist = d
| ^
| ;
33 | nx = dx, ny = dy;
| ~~
a.cc:37:10: error: return-statement with no value, in function returning 'int' [-fpermissive]
37 | if(f)return;
| ^~~~~~
a.cc:38:15: error: 'ny' was not declared in this scope; did you mean 'nx'?
38 | visit(nx, ny, tx, ty, visited, s);
| ^~
| nx
a.cc: In function 'int main()':
a.cc:48:8: error: no match for 'operator<<' (operand types are 'std::ostream' {aka 'std::basic_ostream<char>'} and 'std::vector<char>')
48 | cout << ans;
| ~~~~ ^~ ~~~
| | |
| | std::vector<char>
| std::ostream {aka std::basic_ostream<char>}
In file included from /usr/include/c++/14/iostream:41,
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::cha |
s314140663 | p03836 | C++ | #include <bits/stdc++.h>
using namespace std;
int main(){
int X, Y, x, y;
cin >> X >> Y >> x >> y;
x -= X;
y -= Y;
while(int i; i < y; i++)
cout << 'U';
while(int i; i < x; i++)
cout << 'R';
while(int i; i < y; i++)
cout << 'D';
while(int i; i < x; i++)
cout << 'L';
cout << "LU";
while(int i; i < y; i++)
cout << 'U';
while(int i; i < x; i++)
cout << 'R';
cout << "RDRD";
while(int i; i < y; i++)
cout << 'D';
while(int i; i < x; i++)
cout << 'L';
endl;
}
| a.cc: In function 'int main()':
a.cc:11:14: error: expected initializer before ';' token
11 | while(int i; i < y; i++)
| ^
a.cc:11:14: error: expected ')' before ';' token
11 | while(int i; i < y; i++)
| ~ ^
| )
a.cc:11:16: error: 'i' was not declared in this scope
11 | while(int i; i < y; i++)
| ^
a.cc:13:14: error: expected initializer before ';' token
13 | while(int i; i < x; i++)
| ^
a.cc:13:14: error: expected ')' before ';' token
13 | while(int i; i < x; i++)
| ~ ^
| )
a.cc:15:14: error: expected initializer before ';' token
15 | while(int i; i < y; i++)
| ^
a.cc:15:14: error: expected ')' before ';' token
15 | while(int i; i < y; i++)
| ~ ^
| )
a.cc:17:14: error: expected initializer before ';' token
17 | while(int i; i < x; i++)
| ^
a.cc:17:14: error: expected ')' before ';' token
17 | while(int i; i < x; i++)
| ~ ^
| )
a.cc:20:14: error: expected initializer before ';' token
20 | while(int i; i < y; i++)
| ^
a.cc:20:14: error: expected ')' before ';' token
20 | while(int i; i < y; i++)
| ~ ^
| )
a.cc:22:14: error: expected initializer before ';' token
22 | while(int i; i < x; i++)
| ^
a.cc:22:14: error: expected ')' before ';' token
22 | while(int i; i < x; i++)
| ~ ^
| )
a.cc:25:14: error: expected initializer before ';' token
25 | while(int i; i < y; i++)
| ^
a.cc:25:14: error: expected ')' before ';' token
25 | while(int i; i < y; i++)
| ~ ^
| )
a.cc:27:14: error: expected initializer before ';' token
27 | while(int i; i < x; i++)
| ^
a.cc:27:14: error: expected ')' before ';' token
27 | while(int i; i < x; i++)
| ~ ^
| )
a.cc:29:7: error: statement cannot resolve address of overloaded function
29 | endl;
| ^
|
s954937815 | p03836 | Java | import java.util.Scanner;
import java.util.Set;
public class Main{
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
int sx = Integer.parseInt(sc.next());
int sy = Integer.parseInt(sc.next());
int tx = Integer.parseInt(sc.next());
int ty = Integer.parseInt(sc.next());
StringBuilder builder = new StringBuilder();
int dx = tx-sx;
int dy = ty-sy;
char xdir = (dx>0)? 'U' : 'D';
char ydir = (dy>0)? 'R' : 'L';
char[] xway = new char[Math.abs(dx)];
char[] yway = new char[Math.abs(dy)];
Arrays.fill(xway, xdir);
Arrays.fill(yway, ydir);
builder.append(xway);
builder.append(yway);
Arrays.fill(xway, rev(xdir));
Arrays.fill(yway, rev(ydir));
builder.append(xway);
builder.append(yway);
xway = new char[Math.abs(dx)+1];
yway = new char[Math.abs(dy)+1];
Arrays.fill(xway, xdir);
Arrays.fill(yway, ydir);
builder.append(rev(ydir));
builder.append(xway);
builder.append(yway);
builder.append(rev(xdir));
Arrays.fill(xway, rev(xdir));
Arrays.fill(yway, rev(ydir));
builder.append(ydir);
builder.append(xway);
builder.append(yway);
builder.append(xdir);
System.out.println(builder.toString());
}
public static char rev(char dir){
char result;
if(dir=='U'){result= 'D';}
else if(dir=='D'){result='U';}
else if(dir=='R'){result='L';}
else{result='R';}
return result;
}
} | Main.java:18: error: cannot find symbol
Arrays.fill(xway, xdir);
^
symbol: variable Arrays
location: class Main
Main.java:19: error: cannot find symbol
Arrays.fill(yway, ydir);
^
symbol: variable Arrays
location: class Main
Main.java:22: error: cannot find symbol
Arrays.fill(xway, rev(xdir));
^
symbol: variable Arrays
location: class Main
Main.java:23: error: cannot find symbol
Arrays.fill(yway, rev(ydir));
^
symbol: variable Arrays
location: class Main
Main.java:29: error: cannot find symbol
Arrays.fill(xway, xdir);
^
symbol: variable Arrays
location: class Main
Main.java:30: error: cannot find symbol
Arrays.fill(yway, ydir);
^
symbol: variable Arrays
location: class Main
Main.java:36: error: cannot find symbol
Arrays.fill(xway, rev(xdir));
^
symbol: variable Arrays
location: class Main
Main.java:37: error: cannot find symbol
Arrays.fill(yway, rev(ydir));
^
symbol: variable Arrays
location: class Main
8 errors
|
s053723638 | p03836 | C++ | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
int sx, sy, tx, ty;
int main() {
cin >> sx >> sy >> tx >> ty;
for (int i = sx; i < tx; i++) {
cout << "R";
}
for (int i = sy; i < tx; i++) {
cout << "U";
}
for (int i = tx; i > sx; i--) {
cout << "L";
}
for (int i = ty; i > sy; i--) {
cout << "D";
}
cout << "D";
for (int i = sx; i <= tx; i++) {
cout << "R";
}
for (int i = sy; i <= ty; i++) {
cout << "U";
}
cout << "L" << "U";
for (int i = tx; i >= sx; i--) {
cout << "L";
}
for (int = ty; i >= sy; i--) {
cout << "D";
}
cout << "R";
return 0;
}
| a.cc: In function 'int main()':
a.cc:36:14: error: expected unqualified-id before '=' token
36 | for (int = ty; i >= sy; i--) {
| ^
a.cc:36:13: error: expected ';' before '=' token
36 | for (int = ty; i >= sy; i--) {
| ^~
| ;
a.cc:36:14: error: expected primary-expression before '=' token
36 | for (int = ty; i >= sy; i--) {
| ^
a.cc:36:20: error: 'i' was not declared in this scope
36 | for (int = ty; i >= sy; i--) {
| ^
a.cc:36:27: error: expected ')' before ';' token
36 | for (int = ty; i >= sy; i--) {
| ~ ^
| )
a.cc:36:29: error: 'i' was not declared in this scope
36 | for (int = ty; i >= sy; i--) {
| ^
|
s509629275 | p03836 | Java | import javafx.beans.binding.When;
import java.io.InputStream;
import java.io.OutputStream;
import java.io.PrintWriter;
import java.util.*;
import java.lang.Math.*;
public class Main {
public static void main(String[] args) {
InputStream inputStream = System.in;
OutputStream outputStream = System.out;
Scanner in = new Scanner(inputStream);
PrintWriter out = new PrintWriter(outputStream);
HashMap<Integer,Integer> mem = new HashMap<>();
int sx = in.nextInt();
int sy = in.nextInt();
int tx = in.nextInt();
int ty = in.nextInt();
int u = ty-sy;
int r = tx-sx;
String t = "";
for(int i=0;i<u;i++){
t+="U";
}
for(int i=0;i<r;i++){
t+="R";
}
for(int i=0;i<u;i++){
t+="D";
}for(int i=0;i<r+1;i++){
t+="L";
}
for(int i=0;i<u+1;i++){
t+="U";
}
for(int i=0;i<r+1;i++){
t+="R";
}
t+="DR";
for(int i=0;i<u+1;i++) {
t += "D";
}
for(int i=0;i<r+1;i++){
t+="L";
}
System.out.print(t+"U");
}
}
| Main.java:1: error: package javafx.beans.binding does not exist
import javafx.beans.binding.When;
^
1 error
|
s046364349 | p03836 | C++ | // C - Back and Forth
#include <bits/stdc++.h>
using namespace std;
int main(){
int sx,sy,tx,ty;
cin>>sx>>sy>>tx>>ty;
int dx = tx-sx;
int dy = ty-sy;
string s = "";
for(int i=1; i<=dy; i++) s += "U";
for(int i=1; i<=dx; i++) s += "R";
for(int i=1; i<=dy; i++) s += "D";
for(int i=1; i<=dx; i++) s += "L";
dx++; dy++;
s += "L";
for(int i=1; i<=dy; i++) s += "U";
for(int i=1; i<=dx; i++) s += "R";
s += "DR";
for(int i=1; i<=dy; i++) s += "D";
for(int i=1; i<=dx; i++) s += "L";
s += "U";
ote(s);
} | a.cc: In function 'int main()':
a.cc:25:9: error: 'ote' was not declared in this scope
25 | ote(s);
| ^~~
|
s036474921 | p03836 | C++ | #include "bits/stdc++.h"
using namespace std;
//using Matrix = vector< vector<int> >;
typedef long long ll;
typedef pair<int, int> P;
const int INF = 1e9 + 10;
//const ll INF = 1e18 + 10LL;
int dx[5] = {0, 0, 1, -1, 0}, dy[5] = {1, -1, 0, 0, 0};
const double EPS = 1e-10;
bool cmp(P a, P b) { return a.second < b.second; } //End sort (Interval scheduling problem)
int sx, sy, tx, ty;
int main(void){
cin>>sx>>sy>>tx>>ty;
const int dx = tx - sx, dy = ty - sy;
cout<< string(dy, 'U') << string(dx, 'R');
cout<< string(dy, 'D') << string(dx, 'L');
cout<< 'L' << string(dy + 1. 'U') << string(dx + 1, 'R') << 'D';
cout<< 'R' << string(dy + 1, 'D') << string(dx + 1, 'L') << 'U';
cout<<endl;
return 0;
} | a.cc: In function 'int main()':
a.cc:25:41: error: no matching function for call to 'std::__cxx11::basic_string<char>::basic_string(double)'
25 | cout<< 'L' << string(dy + 1. 'U') << string(dx + 1, 'R') << 'D';
| ^
In file included from /usr/include/c++/14/string:54,
from /usr/include/c++/14/bitset:52,
from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:52,
from a.cc:1:
/usr/include/c++/14/bits/basic_string.h:800:9: note: candidate: 'template<class _Tp, class> std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::basic_string(const _Tp&, const _Alloc&) [with <template-parameter-2-2> = _Tp; _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>]'
800 | basic_string(const _Tp& __t, const _Alloc& __a = _Alloc())
| ^~~~~~~~~~~~
/usr/include/c++/14/bits/basic_string.h:800:9: note: template argument deduction/substitution failed:
In file included from /usr/include/c++/14/bits/stl_pair.h:60,
from /usr/include/c++/14/bits/stl_algobase.h:64,
from /usr/include/c++/14/algorithm:60,
from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:51:
/usr/include/c++/14/type_traits: In substitution of 'template<bool _Cond, class _Tp> using std::enable_if_t = typename std::enable_if::type [with bool _Cond = false; _Tp = void]':
/usr/include/c++/14/bits/basic_string.h:149:8: required by substitution of 'template<class _CharT, class _Traits, class _Alloc> template<class _Tp, class _Res> using std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::_If_sv = std::enable_if_t<((bool)std::__and_<std::is_convertible<const _Tp&, std::basic_string_view<_CharT, _Traits> >, std::__not_<std::is_convertible<const _Tp*, const std::__cxx11::basic_string<_CharT, _Traits, _Alloc>*> >, std::__not_<std::is_convertible<const _Tp&, const _CharT*> > >::value), _Res> [with _Tp = double; _Res = void; _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>]'
149 | using _If_sv = enable_if_t<
| ^~~~~~
/usr/include/c++/14/bits/basic_string.h:797:30: required from here
797 | template<typename _Tp, typename = _If_sv<_Tp, void>>
| ^~~~~~~~
/usr/include/c++/14/type_traits:2711:11: error: no type named 'type' in 'struct std::enable_if<false, void>'
2711 | using enable_if_t = typename enable_if<_Cond, _Tp>::type;
| ^~~~~~~~~~~
/usr/include/c++/14/bits/basic_string.h:788:9: note: candidate: 'template<class _Tp, class> std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::basic_string(const _Tp&, size_type, size_type, const _Alloc&) [with <template-parameter-2-2> = _Tp; _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>]'
788 | basic_string(const _Tp& __t, size_type __pos, size_type __n,
| ^~~~~~~~~~~~
/usr/include/c++/14/bits/basic_string.h:788:9: note: candidate expects 3 arguments, 1 provided
/usr/include/c++/14/bits/basic_string.h:765:9: note: candidate: 'template<class _InputIterator, class> std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::basic_string(_InputIterator, _InputIterator, const _Alloc&) [with <template-parameter-2-2> = _InputIterator; _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>]'
765 | basic_string(_InputIterator __beg, _InputIterator __end,
| ^~~~~~~~~~~~
/usr/include/c++/14/bits/basic_string.h:765:9: note: candidate expects 2 arguments, 1 provided
/usr/include/c++/14/bits/basic_string.h:669:7: note: candidate: 'template<class> std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::basic_string(size_type, _CharT, const _Alloc&) [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>]'
669 | basic_string(size_type __n, _CharT __c, const _Alloc& __a = _Alloc())
| ^~~~~~~~~~~~
/usr/include/c++/14/bits/basic_string.h:669:7: note: candidate expects 2 arguments, 1 provided
/usr/include/c++/14/bits/basic_string.h:646:7: note: candidate: 'template<class> std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::basic_string(const _CharT*, const _Alloc&) [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>]'
646 | basic_string(const _CharT* __s, const _Alloc& __a = _Alloc())
| ^~~~~~~~~~~~
/usr/include/c++/14/bits/basic_string.h:646:7: note: template argument deduction/substitution failed:
a.cc:25:33: note: cannot convert '((double)(int)dy + 1.0e+0)' (type 'double') to type 'const char*'
25 | cout<< 'L' << string(dy + 1. 'U') << string(dx + 1, 'R') << 'D';
| ~~~^~~~
/usr/include/c++/14/bits/basic_string.h:721:7: note: candidate: 'std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::basic_string(std::__cxx11::basic_string<_CharT, _Traits, _Alloc>&&, const _Alloc&) [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>]'
721 | basic_string(basic_string&& __str, const _Alloc& __a)
| ^~~~~~~~~~~~
/usr/include/c++/14/bits/basic_string.h:721:7: note: candidate expects 2 arguments, 1 provided
/usr/include/c++/14/bits/basic_string.h:716:7: note: candidate: 'std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::basic_string(const std::__cxx11::basic_string<_CharT, _Traits, _Alloc>&, const _Alloc&) [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>]'
716 | basic_string(const basic_string& __str, const _Alloc& __a)
| ^~~~~~~~~~~~
/usr/include/c++/14/bits/basic_string.h:716:7: note: candidate expects 2 arguments, 1 provided
/usr/include/c++/14/bits/basic_string.h:711:7: note: candidate: 'std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::basic_string(std::initializer_list<_Tp>, const _Alloc&) [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>]'
711 | basic_string(initializer_list<_CharT> __l, const _Alloc& __a = _Alloc())
| ^~~~~~~~~~~~
/usr/include/c++/14/bits/basic_string.h:711:45: note: no known conversion for argument 1 from 'double' to 'std::initializer_list<char>'
711 | basic_string(initializer_list<_CharT> __l, const _Alloc& __a = _Alloc())
| ~~~~~~~~~~~~~~~~~~~~~~~~~^~~
/usr/include/c++/14/bits/basic_string.h:682:7: note: candidate: 'std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::basic_string(std::__cxx11::basic_string<_CharT, _Traits, _Alloc>&&) [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>]'
682 | basic_string(basic_string&& __str) noexcept
| ^~~~~~~~~~~~
/usr/include/c++/14/bits/basic_string.h:682:35: note: no known conversion for argument 1 from 'double' to 'std::__cxx11::basic_string<char>&&'
682 | basic_string(basic_string&& __str) noexcept
| ~~~~~~~~~~~~~~~^~~~~
/usr/include/c++/14/bits/basic_string.h:624:7: note: candidate: 'std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::basic_string(const _CharT*, size_type, const _Alloc&) [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>; size_type = long unsigned int]'
624 | basic_string(const _CharT* __s, size_type __n,
| ^~~~~~~~~~~~
/usr/include/c++/14/bits/basic_string.h:624:7: note: candidate expects 3 arguments, 1 provided
/usr/include/c++/14/bits/basic_string.h:604:7: note: candidate: 'std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::basic_string(const std::__cxx11::basic_string<_CharT, _Traits, _Alloc>&, size_type, size_type, const _Alloc&) [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>; size_type = long unsigned int]'
604 | basic_string(const basic_string& __str, size_type __pos,
| ^~~~~~~~~~~~
/usr/include/c++/14/bits/basic_string.h:604:7: note: candidate expects 4 arguments, 1 provided
/usr/include/c++/14/bits/basic_string.h:586:7: note: candidate: 'std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::basic_string(const std::__cxx11::basic_string<_CharT, _Traits, _Alloc>&, size_type, size_type) [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>; size_type = long unsigned int]'
586 | basic_string(const basic_string& __str, size_type __pos,
| ^~~~~~~~~~~~
/usr/include/c++/14/bits/basic_string.h:586:7: note: candidate expects 3 arguments, 1 provided
/usr/include/c++/14/bits/basic_string.h:569:7: note: candidate: 'std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::basic_string(const std::__cxx11::basic_string<_CharT, _Traits, _Alloc>&, size_type, const _Alloc&) [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>; size_type = long unsigned int]'
569 | basic_string(const basic_string& __str, size_type __pos,
| ^~~~~~~~~~~~
/usr/include/c++/14/bits/basic_string.h:569:7: note: candidate expects 3 arguments, 1 provided
/usr/include/c++/14/bits/basic_string.h:552:7: note: candidate: 'std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::basic_string(const std::__cxx11::basic_string<_CharT, _Traits, _Alloc>&) [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>]'
552 | basic_string(const basic_string& __str)
| ^~~~~~~~~~~~
/usr/include/c++/14/bits/basic_string.h:552:40: note: no known conversion for argument 1 from 'double' to 'const std::__cxx11::basic_string<char>&'
552 | basic_string(const basic_string& __str)
| ~~~~~~~~~~~~~~~~~~~~^~~~~
/usr/include/c++/14/bits/basic_string.h:540:7: note: candidate: 'std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::basic_string(const _Alloc&) [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>]'
540 | basic_string(const _Alloc& __a) _GLIBCXX_NOEXCEPT
| ^~~~~~~~~~~~
/usr/include/c++/14/bits/basic_string.h:540:34: note: no known conversion for argument 1 from 'double' to 'const std::allocator<char>&'
540 | basic_string(const _Alloc& __a) _GLIBCXX_NOEXCEPT
|
s548387118 | p03836 | C++ | #include <iostream>
#include <string>
using namespace std;
int main(){
int sx, sy, tx, ty;
int dx, dy;
cin >> sx >> sy >> tx >> ty;
dx = tx - sx;
dy = ty - sy;
cout << string(dy, 'U') << string(dx, 'R') << string(dy, 'D') << string(dx, 'L');
cout << 'L';
cout << string(dy + 1, 'U') << string(dx + 1, 'R')
cout << 'D';
cout << 'R';
cout << string(dy + 1, 'D') << string(dx + 1, 'L')
cout << 'U';
return 0;
}
| a.cc: In function 'int main()':
a.cc:13:59: error: expected ';' before 'cout'
13 | cout << string(dy + 1, 'U') << string(dx + 1, 'R')
| ^
| ;
14 | cout << 'D';
| ~~~~
a.cc:16:59: error: expected ';' before 'cout'
16 | cout << string(dy + 1, 'D') << string(dx + 1, 'L')
| ^
| ;
17 | cout << 'U';
| ~~~~
|
s841450935 | p03836 | C++ | #include <iostream>
#include <string>
using namespace std;
int main(){
int sx, sy, tx, ty;
int dx, dy;
cin >> sx >> sy >> tx >> ty;
dx = tx - sx;
dy = ty - sy;
cout << string(dy, 'U') << sring(dx, 'R') << string(dy, 'D') << sring(dx, 'L');
cout << 'L';
cout << string(dy + 1, 'U') << sring(dx + 1, 'R')
cout << 'D';
cout << 'R';
cout << string(dy + 1, 'D') << sring(dx + 1, 'L')
cout << 'U';
return 0;
}
| a.cc: In function 'int main()':
a.cc:11:36: error: 'sring' was not declared in this scope
11 | cout << string(dy, 'U') << sring(dx, 'R') << string(dy, 'D') << sring(dx, 'L');
| ^~~~~
|
s895855764 | p03836 | C++ | #include <iostream>
#include <sting>
using namespace std;
int main(){
int sx, sy, tx, ty;
int dx, dy;
cin >> sx >> sy >> tx >> ty;
dx = tx - sx;
dy = ty - sy;
cout << string(dy, 'U') << sring(dx, 'R') << string(dy, 'D') << sring(dx, 'L');
cout << 'L';
cout << string(dy + 1, 'U') << sring(dx + 1, 'R')
cout << 'D';
cout << 'R';
cout << string(dy + 1, 'D') << sring(dx + 1, 'L')
cout << 'U';
return 0;
} | a.cc:2:10: fatal error: sting: No such file or directory
2 | #include <sting>
| ^~~~~~~
compilation terminated.
|
s406444218 | p03836 | C++ | #include <bits/stdc++.h>
using namespace std;
int main() {
int sx,sy,tx,ty;
cin >> sx >> sy >> tx >> ty;
for(int i = 0; i < tx - sx; i++){
cout << "R";
}
for(int i = 0; i < ty - sy; i++){
cout << "U";
}
for(int i = 0; i < tx - sx; i++){
cout << "L";
}
for(int i = 0; i < ty - sy; i++){
cout << "D";
}
cout << "D";
for(int i = 0; i <= tx - sx; i++){
cout << "R";
}
for(int i = 0; i <= ty - sy; i++){
cout << "U";
}
cout << "LU"
for(int i = 0; i <= tx - sx; i++){
cout << "L";
}
for(int i = 0; i <= ty - sy; i++){
cout << "D";
}
cout << "R" << endl;
}
| a.cc: In function 'int main()':
a.cc:27:15: error: expected ';' before 'for'
27 | cout << "LU"
| ^
| ;
28 | for(int i = 0; i <= tx - sx; i++){
| ~~~
a.cc:28:18: error: 'i' was not declared in this scope
28 | for(int i = 0; i <= tx - sx; i++){
| ^
|
s105056609 | p03836 | C++ | // Created by liszt on 2019/08/04.
#include<bits/stdc++.h>
using namespace std;
int main(){
int sx,sy,tx,ty;
cin >>sx >>sy >>tx >>ty;
const int dx=tx-sx, dy=ty-sy;
cout<<string(dy,"U")<<string(dx,"R");
cout<<string(dy,"D")<<string(dx,"L");
cout<<"L"<<string(dy+1,"U")<<string(dx+1,"R")<<"D";
cout<<"R"<<string(dy+1,"D")<<string(dx+1,"L")<<"U";
cout<<endl;
return 0;
} | a.cc: In function 'int main()':
a.cc:10:24: error: no matching function for call to 'std::__cxx11::basic_string<char>::basic_string(const int&, const char [2])'
10 | cout<<string(dy,"U")<<string(dx,"R");
| ^
In file included from /usr/include/c++/14/string:54,
from /usr/include/c++/14/bitset:52,
from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:52,
from a.cc:2:
/usr/include/c++/14/bits/basic_string.h:624:7: note: candidate: 'std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::basic_string(const _CharT*, size_type, const _Alloc&) [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>; size_type = long unsigned int]' (near match)
624 | basic_string(const _CharT* __s, size_type __n,
| ^~~~~~~~~~~~
/usr/include/c++/14/bits/basic_string.h:624:7: note: conversion of argument 2 would be ill-formed:
a.cc:10:21: error: invalid conversion from 'const char*' to 'std::__cxx11::basic_string<char>::size_type' {aka 'long unsigned int'} [-fpermissive]
10 | cout<<string(dy,"U")<<string(dx,"R");
| ^~~
| |
| const char*
/usr/include/c++/14/bits/basic_string.h:800:9: note: candidate: 'template<class _Tp, class> std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::basic_string(const _Tp&, const _Alloc&) [with <template-parameter-2-2> = _Tp; _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>]'
800 | basic_string(const _Tp& __t, const _Alloc& __a = _Alloc())
| ^~~~~~~~~~~~
/usr/include/c++/14/bits/basic_string.h:800:9: note: template argument deduction/substitution failed:
In file included from /usr/include/c++/14/bits/stl_pair.h:60,
from /usr/include/c++/14/bits/stl_algobase.h:64,
from /usr/include/c++/14/algorithm:60,
from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:51:
/usr/include/c++/14/type_traits: In substitution of 'template<bool _Cond, class _Tp> using std::enable_if_t = typename std::enable_if::type [with bool _Cond = false; _Tp = void]':
/usr/include/c++/14/bits/basic_string.h:149:8: required by substitution of 'template<class _CharT, class _Traits, class _Alloc> template<class _Tp, class _Res> using std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::_If_sv = std::enable_if_t<((bool)std::__and_<std::is_convertible<const _Tp&, std::basic_string_view<_CharT, _Traits> >, std::__not_<std::is_convertible<const _Tp*, const std::__cxx11::basic_string<_CharT, _Traits, _Alloc>*> >, std::__not_<std::is_convertible<const _Tp&, const _CharT*> > >::value), _Res> [with _Tp = int; _Res = void; _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>]'
149 | using _If_sv = enable_if_t<
| ^~~~~~
/usr/include/c++/14/bits/basic_string.h:797:30: required from here
797 | template<typename _Tp, typename = _If_sv<_Tp, void>>
| ^~~~~~~~
/usr/include/c++/14/type_traits:2711:11: error: no type named 'type' in 'struct std::enable_if<false, void>'
2711 | using enable_if_t = typename enable_if<_Cond, _Tp>::type;
| ^~~~~~~~~~~
/usr/include/c++/14/bits/basic_string.h:788:9: note: candidate: 'template<class _Tp, class> std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::basic_string(const _Tp&, size_type, size_type, const _Alloc&) [with <template-parameter-2-2> = _Tp; _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>]'
788 | basic_string(const _Tp& __t, size_type __pos, size_type __n,
| ^~~~~~~~~~~~
/usr/include/c++/14/bits/basic_string.h:788:9: note: candidate expects 3 arguments, 2 provided
/usr/include/c++/14/bits/basic_string.h:765:9: note: candidate: 'template<class _InputIterator, class> std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::basic_string(_InputIterator, _InputIterator, const _Alloc&) [with <template-parameter-2-2> = _InputIterator; _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>]'
765 | basic_string(_InputIterator __beg, _InputIterator __end,
| ^~~~~~~~~~~~
/usr/include/c++/14/bits/basic_string.h:765:9: note: template argument deduction/substitution failed:
a.cc:10:24: note: deduced conflicting types for parameter '_InputIterator' ('int' and 'const char*')
10 | cout<<string(dy,"U")<<string(dx,"R");
| ^
/usr/include/c++/14/bits/basic_string.h:669:7: note: candidate: 'template<class> std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::basic_string(size_type, _CharT, const _Alloc&) [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>]'
669 | basic_string(size_type __n, _CharT __c, const _Alloc& __a = _Alloc())
| ^~~~~~~~~~~~
/usr/include/c++/14/bits/basic_string.h:669:7: note: template argument deduction/substitution failed:
a.cc:10:21: note: cannot convert '"U"' (type 'const char [2]') to type 'char'
10 | cout<<string(dy,"U")<<string(dx,"R");
| ^~~
/usr/include/c++/14/bits/basic_string.h:646:7: note: candidate: 'template<class> std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::basic_string(const _CharT*, const _Alloc&) [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>]'
646 | basic_string(const _CharT* __s, const _Alloc& __a = _Alloc())
| ^~~~~~~~~~~~
/usr/include/c++/14/bits/basic_string.h:646:7: note: template argument deduction/substitution failed:
a.cc:10:18: note: cannot convert 'dy' (type 'const int') to type 'const char*'
10 | cout<<string(dy,"U")<<string(dx,"R");
| ^~
/usr/include/c++/14/bits/basic_string.h:721:7: note: candidate: 'std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::basic_string(std::__cxx11::basic_string<_CharT, _Traits, _Alloc>&&, const _Alloc&) [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>]'
721 | basic_string(basic_string&& __str, const _Alloc& __a)
| ^~~~~~~~~~~~
/usr/include/c++/14/bits/basic_string.h:721:35: note: no known conversion for argument 1 from 'const int' to 'std::__cxx11::basic_string<char>&&'
721 | basic_string(basic_string&& __str, const _Alloc& __a)
| ~~~~~~~~~~~~~~~^~~~~
/usr/include/c++/14/bits/basic_string.h:716:7: note: candidate: 'std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::basic_string(const std::__cxx11::basic_string<_CharT, _Traits, _Alloc>&, const _Alloc&) [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>]'
716 | basic_string(const basic_string& __str, const _Alloc& __a)
| ^~~~~~~~~~~~
/usr/include/c++/14/bits/basic_string.h:716:40: note: no known conversion for argument 1 from 'const int' to 'const std::__cxx11::basic_string<char>&'
716 | basic_string(const basic_string& __str, const _Alloc& __a)
| ~~~~~~~~~~~~~~~~~~~~^~~~~
/usr/include/c++/14/bits/basic_string.h:711:7: note: candidate: 'std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::basic_string(std::initializer_list<_Tp>, const _Alloc&) [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>]'
711 | basic_string(initializer_list<_CharT> __l, const _Alloc& __a = _Alloc())
| ^~~~~~~~~~~~
/usr/include/c++/14/bits/basic_string.h:711:45: note: no known conversion for argument 1 from 'const int' to 'std::initializer_list<char>'
711 | basic_string(initializer_list<_CharT> __l, const _Alloc& __a = _Alloc())
| ~~~~~~~~~~~~~~~~~~~~~~~~~^~~
/usr/include/c++/14/bits/basic_string.h:682:7: note: candidate: 'std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::basic_string(std::__cxx11::basic_string<_CharT, _Traits, _Alloc>&&) [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>]'
682 | basic_string(basic_string&& __str) noexcept
| ^~~~~~~~~~~~
/usr/include/c++/14/bits/basic_string.h:682:7: note: candidate expects 1 argument, 2 provided
/usr/include/c++/14/bits/basic_string.h:604:7: note: candidate: 'std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::basic_string(const std::__cxx11::basic_string<_CharT, _Traits, _Alloc>&, size_type, size_type, const _Alloc&) [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>; size_type = long unsigned int]'
604 | basic_string(const basic_string& __str, size_type __pos,
| ^~~~~~~~~~~~
/usr/include/c++/14/bits/basic_string.h:604:7: note: candidate expects 4 arguments, 2 provided
/usr/include/c++/14/bits/basic_string.h:586:7: note: candidate: 'std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::basic_string(const std::__cxx11::basic_string<_CharT, _Traits, _Alloc>&, size_type, size_type) [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>; size_type = long unsigned int]'
586 | basic_string(const basic_string& __str, size_type __pos,
| ^~~~~~~~~~~~
/usr/include/c++/14/bits/basic_string.h:586:7: note: candidate expects 3 arguments, 2 provided
/usr/include/c++/14/bits/basic_string.h:569:7: note: candidate: 'std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::basic_string(const std::__cxx11::basic_string<_CharT, _Traits, _Alloc>&, size_type, const _Alloc&) [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>; size_type = long unsigned int]'
569 | basic_string(const basic_string& __str, size_type __pos,
| ^~~~~~~~~~~~
/usr/include/c++/14/bits/basic_string.h:569:40: note: no known conversion for argument 1 from 'const int' to 'const std::__cxx11::basic_string<char>&'
569 | basic_string(const basic_string& __str, size_type __pos,
| ~~~~~~~~~~~~~~~~~~~~^~~~~
/usr/include/c++/14/bits/basic_string.h:552:7: note: candidate: 'std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::basic_string(const std::__cxx11::basic_string<_CharT, _Traits, _Alloc> |
s460590505 | p03836 | C++ | #include <iostream>
#include <string>
#include <algorithm>
#include <cstdio>
#include <vector>
#include <queue>
#include <stack>
#include <set>
#include <map>
#include <numeric>
#include <cmath>
#include <cassert>
using namespace std;
typedef long long int ll;
typedef pair<int,int> P;
#define all(x) x.begin(),x.end()
const ll mod = 1e9+7;
const ll INF = 1e9;
ll gcd(ll a,ll b){return b?gcd(b,a%b):a;}
int dx[4]={1,0,-1,0};
int dy[4]={0,1,0,-1};
int main()
{
int x,y,a,b;
cin>>x>>y>>a>>b;
// vector<string> ans;
// for (int i = x; i < a; i++){
// ans.push_back("R");
// }
// for (int i = y; i < b; i++){
// ans.push_back("U");
// }
// for (int i = x; i < a; i++){
// ans.push_back("L");
// }
// for (int i = y; i < b; i++){
// ans.push_back("D");
// }
// ans.push_back("D");
// for (int i = x; i < a+1; i++){
// ans.push_back("R");
// }
// for (int i = y-1; i < b; i++){
// ans.push_back("U");
// }
// ans.push_back("L");
// ans.push_back("U");
// for (int i = a; i > x-1; i--){
// ans.push_back("L");
// }
// for (int i = b+1; i > y; i--){
// ans.push_back("D");
// }
// ans.push_back("R");
// for(auto c:ans)
// cout<<c;
// cout<<endl;
int dx = a-x, dy=b-y;
cout<<string(dx,"R") << string(dy,"U");
cout<<string(dx,"L") << string(dy,"D");
cout<<"D"<< string(dx+1,"R")<<string(dy+1,"U")<<"L";
cout<<"U"<<string(dx+1,"L")<<string(dy+1,"D")<<"R"<<endl;
return 0;
} | a.cc: In function 'int main()':
a.cc:67:28: error: no matching function for call to 'std::__cxx11::basic_string<char>::basic_string(int&, const char [2])'
67 | cout<<string(dx,"R") << string(dy,"U");
| ^
In file included 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/c++/14/bits/basic_string.h:624:7: note: candidate: 'std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::basic_string(const _CharT*, size_type, const _Alloc&) [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>; size_type = long unsigned int]' (near match)
624 | basic_string(const _CharT* __s, size_type __n,
| ^~~~~~~~~~~~
/usr/include/c++/14/bits/basic_string.h:624:7: note: conversion of argument 2 would be ill-formed:
a.cc:67:25: error: invalid conversion from 'const char*' to 'std::__cxx11::basic_string<char>::size_type' {aka 'long unsigned int'} [-fpermissive]
67 | cout<<string(dx,"R") << string(dy,"U");
| ^~~
| |
| const char*
/usr/include/c++/14/bits/basic_string.h:800:9: note: candidate: 'template<class _Tp, class> std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::basic_string(const _Tp&, const _Alloc&) [with <template-parameter-2-2> = _Tp; _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>]'
800 | basic_string(const _Tp& __t, const _Alloc& __a = _Alloc())
| ^~~~~~~~~~~~
/usr/include/c++/14/bits/basic_string.h:800:9: note: template argument deduction/substitution failed:
In file included from /usr/include/c++/14/bits/move.h:37,
from /usr/include/c++/14/bits/exception_ptr.h:41,
from /usr/include/c++/14/exception:166,
from /usr/include/c++/14/ios:41:
/usr/include/c++/14/type_traits: In substitution of 'template<bool _Cond, class _Tp> using std::enable_if_t = typename std::enable_if::type [with bool _Cond = false; _Tp = void]':
/usr/include/c++/14/bits/basic_string.h:149:8: required by substitution of 'template<class _CharT, class _Traits, class _Alloc> template<class _Tp, class _Res> using std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::_If_sv = std::enable_if_t<((bool)std::__and_<std::is_convertible<const _Tp&, std::basic_string_view<_CharT, _Traits> >, std::__not_<std::is_convertible<const _Tp*, const std::__cxx11::basic_string<_CharT, _Traits, _Alloc>*> >, std::__not_<std::is_convertible<const _Tp&, const _CharT*> > >::value), _Res> [with _Tp = int; _Res = void; _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>]'
149 | using _If_sv = enable_if_t<
| ^~~~~~
/usr/include/c++/14/bits/basic_string.h:797:30: required from here
797 | template<typename _Tp, typename = _If_sv<_Tp, void>>
| ^~~~~~~~
/usr/include/c++/14/type_traits:2711:11: error: no type named 'type' in 'struct std::enable_if<false, void>'
2711 | using enable_if_t = typename enable_if<_Cond, _Tp>::type;
| ^~~~~~~~~~~
/usr/include/c++/14/bits/basic_string.h:788:9: note: candidate: 'template<class _Tp, class> std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::basic_string(const _Tp&, size_type, size_type, const _Alloc&) [with <template-parameter-2-2> = _Tp; _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>]'
788 | basic_string(const _Tp& __t, size_type __pos, size_type __n,
| ^~~~~~~~~~~~
/usr/include/c++/14/bits/basic_string.h:788:9: note: candidate expects 3 arguments, 2 provided
/usr/include/c++/14/bits/basic_string.h:765:9: note: candidate: 'template<class _InputIterator, class> std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::basic_string(_InputIterator, _InputIterator, const _Alloc&) [with <template-parameter-2-2> = _InputIterator; _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>]'
765 | basic_string(_InputIterator __beg, _InputIterator __end,
| ^~~~~~~~~~~~
/usr/include/c++/14/bits/basic_string.h:765:9: note: template argument deduction/substitution failed:
a.cc:67:28: note: deduced conflicting types for parameter '_InputIterator' ('int' and 'const char*')
67 | cout<<string(dx,"R") << string(dy,"U");
| ^
/usr/include/c++/14/bits/basic_string.h:669:7: note: candidate: 'template<class> std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::basic_string(size_type, _CharT, const _Alloc&) [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>]'
669 | basic_string(size_type __n, _CharT __c, const _Alloc& __a = _Alloc())
| ^~~~~~~~~~~~
/usr/include/c++/14/bits/basic_string.h:669:7: note: template argument deduction/substitution failed:
a.cc:67:25: note: cannot convert '"R"' (type 'const char [2]') to type 'char'
67 | cout<<string(dx,"R") << string(dy,"U");
| ^~~
/usr/include/c++/14/bits/basic_string.h:646:7: note: candidate: 'template<class> std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::basic_string(const _CharT*, const _Alloc&) [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>]'
646 | basic_string(const _CharT* __s, const _Alloc& __a = _Alloc())
| ^~~~~~~~~~~~
/usr/include/c++/14/bits/basic_string.h:646:7: note: template argument deduction/substitution failed:
a.cc:67:22: note: cannot convert 'dx' (type 'int') to type 'const char*'
67 | cout<<string(dx,"R") << string(dy,"U");
| ^~
/usr/include/c++/14/bits/basic_string.h:721:7: note: candidate: 'std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::basic_string(std::__cxx11::basic_string<_CharT, _Traits, _Alloc>&&, const _Alloc&) [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>]'
721 | basic_string(basic_string&& __str, const _Alloc& __a)
| ^~~~~~~~~~~~
/usr/include/c++/14/bits/basic_string.h:721:35: note: no known conversion for argument 1 from 'int' to 'std::__cxx11::basic_string<char>&&'
721 | basic_string(basic_string&& __str, const _Alloc& __a)
| ~~~~~~~~~~~~~~~^~~~~
/usr/include/c++/14/bits/basic_string.h:716:7: note: candidate: 'std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::basic_string(const std::__cxx11::basic_string<_CharT, _Traits, _Alloc>&, const _Alloc&) [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>]'
716 | basic_string(const basic_string& __str, const _Alloc& __a)
| ^~~~~~~~~~~~
/usr/include/c++/14/bits/basic_string.h:716:40: note: no known conversion for argument 1 from 'int' to 'const std::__cxx11::basic_string<char>&'
716 | basic_string(const basic_string& __str, const _Alloc& __a)
| ~~~~~~~~~~~~~~~~~~~~^~~~~
/usr/include/c++/14/bits/basic_string.h:711:7: note: candidate: 'std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::basic_string(std::initializer_list<_Tp>, const _Alloc&) [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>]'
711 | basic_string(initializer_list<_CharT> __l, const _Alloc& __a = _Alloc())
| ^~~~~~~~~~~~
/usr/include/c++/14/bits/basic_string.h:711:45: note: no known conversion for argument 1 from 'int' to 'std::initializer_list<char>'
711 | basic_string(initializer_list<_CharT> __l, const _Alloc& __a = _Alloc())
| ~~~~~~~~~~~~~~~~~~~~~~~~~^~~
/usr/include/c++/14/bits/basic_string.h:682:7: note: candidate: 'std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::basic_string(std::__cxx11::basic_string<_CharT, _Traits, _Alloc>&&) [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>]'
682 | basic_string(basic_string&& __str) noexcept
| ^~~~~~~~~~~~
/usr/include/c++/14/bits/basic_string.h:682:7: note: candidate expects 1 argument, 2 provided
/usr/include/c++/14/bits/basic_string.h:604:7: note: candidate: 'std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::basic_string(const std::__cxx11::basic_string<_CharT, _Traits, _Alloc>&, size_type, size_type, const _Alloc&) [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>; size_type = long unsigned int]'
604 | basic_string(const basic_string& __str, size_type __pos,
| ^~~~~~~~~~~~
/usr/include/c++/14/bits/basic_string.h:604:7: note: candidate expects 4 arguments, 2 provided
/usr/include/c++/14/bits/basic_string.h:586:7: note: candidate: 'std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::basic_string(const std::__cxx11::basic_string<_CharT, _Traits, _Alloc>&, size_type, size_type) [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>; size_type = long unsigned int]'
586 | basic_string(const basic_string& __str, size_type __pos,
| ^~~~~~~~~~~~
/usr/include/c++/14/bits/basic_string.h:586:7: note: candidate expects 3 arguments, 2 provided
/usr/include/c++/14/bits/basic_string.h:569:7: note: candidate: 'std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::basic_string(const std::__cxx11::basic_string<_CharT, _Traits, _Alloc>&, size_type, const _Alloc&) [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>; size_type = long unsigned int]'
569 | basic_string(const basic_string& __str, size_type __pos,
| ^~~~~~~~~~~~
/usr/include/c++/14/bits/basic_string.h:569:40: note: no known conversion for argument 1 from 'int' to 'const std::__cxx11::basic_string<char>&'
569 | basic_string(const basic_string& __str, size_type __pos,
| ~~~~~~~~~~~~~~~~~~~~^~~~~
/usr/include/c++/14/bits/basic_strin |
s639333779 | p03836 | C++ | #include <iostream>
#include <string>
#include <algorithm>
#include <cstdio>
#include <vector>
#include <queue>
#include <stack>
#include <set>
#include <map>
#include <numeric>
#include <cmath>
#include <cassert>
using namespace std;
typedef long long int ll;
typedef pair<int,int> P;
#define all(x) x.begin(),x.end()
const ll mod = 1e9+7;
const ll INF = 1e9;
ll gcd(ll a,ll b){return b?gcd(b,a%b):a;}
int dx[4]={1,0,-1,0};
int dy[4]={0,1,0,-1};
int main()
{
int x,y,a,b;
cin>>x>>y>>a>>b;
// vector<string> ans;
// for (int i = x; i < a; i++){
// ans.push_back("R");
// }
// for (int i = y; i < b; i++){
// ans.push_back("U");
// }
// for (int i = x; i < a; i++){
// ans.push_back("L");
// }
// for (int i = y; i < b; i++){
// ans.push_back("D");
// }
// ans.push_back("D");
// for (int i = x; i < a+1; i++){
// ans.push_back("R");
// }
// for (int i = y-1; i < b; i++){
// ans.push_back("U");
// }
// ans.push_back("L");
// ans.push_back("U");
// for (int i = a; i > x-1; i--){
// ans.push_back("L");
// }
// for (int i = b+1; i > y; i--){
// ans.push_back("D");
// }
// ans.push_back("R");
// for(auto c:ans)
// cout<<c;
// cout<<endl;
dx = a-x, dy=b-y
cout<<string(dx,"R") << string(dy,"U")
cout<<string(dx,"L") << string(dy,"D")
cout<<"D"<< string(dx+1,"R")<<string(dy+1,"U")<<"L"
cout<<"U"<<string(dx+1,"L")<<string(dy+1,"D")<<"R"<<endl;
return 0;
} | a.cc: In function 'int main()':
a.cc:66:12: error: incompatible types in assignment of 'int' to 'int [4]'
66 | dx = a-x, dy=b-y
| ~~~^~~~~
a.cc:66:21: error: incompatible types in assignment of 'int' to 'int [4]'
66 | dx = a-x, dy=b-y
| ~~^~~~
|
s459552566 | p03836 | C++ | #include <bits/stdc++.h>
int main(){
int route[4];
for (int i=0;i<4;i++) cin >> route[i];
const int dx = route[2] - route[0];
const int dy = route[3] - route[1];
cout << string(dx, 'R') << string(dy, 'U');
cout << string(dx, 'L') << string(dy, 'D');
cout << 'D' << string(dx+1, 'R') << string(dy+1, 'U') << 'L';
cout << 'U' << string(dx+1, 'L') << string(dy+1, 'D') << 'R';
}
| a.cc: In function 'int main()':
a.cc:5:25: error: 'cin' was not declared in this scope; did you mean 'std::cin'?
5 | for (int i=0;i<4;i++) cin >> route[i];
| ^~~
| std::cin
In file included from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:146,
from a.cc:1:
/usr/include/c++/14/iostream:62:18: note: 'std::cin' declared here
62 | extern istream cin; ///< Linked to standard input
| ^~~
a.cc:8:3: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
8 | cout << string(dx, 'R') << string(dy, 'U');
| ^~~~
| std::cout
/usr/include/c++/14/iostream:63:18: note: 'std::cout' declared here
63 | extern ostream cout; ///< Linked to standard output
| ^~~~
a.cc:8:11: error: 'string' was not declared in this scope
8 | cout << string(dx, 'R') << string(dy, 'U');
| ^~~~~~
a.cc:8:11: note: suggested alternatives:
In file included from /usr/include/c++/14/string:41,
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/stringfwd.h:77:33: note: 'std::string'
77 | typedef basic_string<char> string;
| ^~~~~~
/usr/include/c++/14/string:76:11: note: 'std::pmr::string'
76 | using string = basic_string<char>;
| ^~~~~~
|
s691242896 | p03836 | C++ | #incliude <bits/stdc++.h>
int main(){
int route[4];
for (int i=0;i<4;i++) cin >> route[i];
const int dx = route[2] - route[0];
const int dy = route[3] - route[1];
cout << string(dx, 'R') << string(dy, 'U');
cout << string(dx, 'L') << string(dy, 'D');
cout << 'D' << string(dx+1, 'R') << string(dy+1, 'U') << 'L';
cout << 'U' << string(dx+1, 'L') << string(dy+1, 'D') << 'R';
} | a.cc:1:2: error: invalid preprocessing directive #incliude; did you mean #include?
1 | #incliude <bits/stdc++.h>
| ^~~~~~~~
| include
a.cc: In function 'int main()':
a.cc:5:25: error: 'cin' was not declared in this scope
5 | for (int i=0;i<4;i++) cin >> route[i];
| ^~~
a.cc:8:3: error: 'cout' was not declared in this scope
8 | cout << string(dx, 'R') << string(dy, 'U');
| ^~~~
a.cc:8:11: error: 'string' was not declared in this scope
8 | cout << string(dx, 'R') << string(dy, 'U');
| ^~~~~~
|
s356150410 | p03836 | C++ | #include <bits/stdc++.h>
using namespace std;
string s;
int main(){
cin>>s;
for(int i=0;i<s.length();i++){
if(i==4||i==13)cout<<' ';
else cout<<s[i];
}
cout<<endl;
}
using namespace std;
int sx,sy,gx,gy,ans;
int main(){
cin>>sx>>sy>>gx>>gy;
for (int i=0; i<(gy-sy); i++) {
cout<<'U';
}
for (int i=0; i<(gx-sx); i++) {
cout<<'R';
}
for (int i=0; i<(gy-sy); i++) {
cout<<'D';
}
for (int i=0; i<(gx-sx); i++) {
cout<<'L';
}
cout<<'L';
for (int i=0; i<(gy-sy)+1; i++) {
cout<<'U';
}
for (int i=0; i<(gx-sx)+1; i++) {
cout<<'R';
}
cout<<'D';
cout<<'R';
for (int i=0; i<(gy-sy)+1; i++) {
cout<<'D';
}
for (int i=0; i<(gx-sx)+1; i++) {
cout<<'L';
}
cout<<'U'<<endl;
} | a.cc:15:5: error: redefinition of 'int main()'
15 | int main(){
| ^~~~
a.cc:4:5: note: 'int main()' previously defined here
4 | int main(){
| ^~~~
|
s638900051 | p03836 | C++ | #include <cstdio>
#define N 100006
#define fast ios_base::sync_with_stdio(false);cin.tie(NULL);
using namespace std;
int main()
{
fast;
int x,y,x1,y1,x2,y2;
scanf("%d%d%d%d",&x1,&y1,&x2,&y2);
x=x1,y=y1;
while(x1<x2)x1++,printf("R");
while(y1<y2)y1++,printf("U");
while(x1>x)x1--,printf("L");
while(y1>y)y1--,printf("D");
printf("D");
while(x1<x2)x1++,printf("R");
printf("R");printf("U");
while(y1<y2)y1++,printf("U");
printf("L");
printf("U");
while(x1>x)x1--,printf("L");
printf("L");printf("D");
while(y1>y)y1--,printf("D");
printf("R");
} | a.cc: In function 'int main()':
a.cc:3:14: error: 'ios_base' has not been declared
3 | #define fast ios_base::sync_with_stdio(false);cin.tie(NULL);
| ^~~~~~~~
a.cc:8:9: note: in expansion of macro 'fast'
8 | fast;
| ^~~~
a.cc:3:47: error: 'cin' was not declared in this scope
3 | #define fast ios_base::sync_with_stdio(false);cin.tie(NULL);
| ^~~
a.cc:8:9: note: in expansion of macro 'fast'
8 | fast;
| ^~~~
a.cc:2:1: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
1 | #include <cstdio>
+++ |+#include <iostream>
2 | #define N 100006
|
s059125995 | p03836 | Java | import java.io.*;
public class Game{
public static void main(String[]args){
BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));
System.out.println("select level");
System.out.println("strong weak");
char[][] field;
field = new char[3][3];
int max = 0;
int min = 0;
int i,k,m;
int[] num;
num = new int[8];
for(i=0;i<=2;i++)
for(k=0;k<=2;k++)
field[i][k] = 'O';
System.out.println("your turn");
for(i=0;i<=2;i++)
for(k=0;k<=2;k++)
System.out.println(field[i][k]);
int move = reader.readLine();
switch case(move){
case 11: num[0]++; num[3]++; num[6]++; field[0][0] = 'O'; field[1][1] = 'X';num[1]--; num[4]--; num[6]--;num[7]--;
case 12: num[3]++; num[1]++; field[0][1] = 'O'; field[1][1] = 'X';num[1]--; num[4]--; num[6]--;num[7]--;
case 13: num[2]++; num[3]++; num[7]++; field[0][2] = 'O'; field[1][1] = 'X';num[1]--; num[4]--; num[6]--;num[7]--;
case 21: num[0]++; num[4]++; field[1][0] = 'O'; field[1][1] = 'X';num[1]--; num[4]--; num[6]--;num[7]--;
case 22: num[1]++; num[4]++; num[6]++;num[7]++;field[1][1] = 'O'; field[0][0] = 'X'; num[0]--; num[3]--; num[6]--;
case 23: num[2]++; num[4]++; field[1][2] = 'O'; field[1][1] = 'X';num[1]--; num[4]--; num[6]--;num[7]--;
case 31: num[0]++; num[5]++; num[7]++;field[2][0] = 'O'; field[1][1] = 'X';num[1]--; num[4]--; num[6]--;num[7]--;
case 32: num[1]++; num[5]++; field[2][1] = 'O'; field[1][1] = 'X';num[1]--; num[4]--; num[6]--;num[7]--;
case 33: num[2]++; num[5]++; num[6]++;field[2][2] = 'O'; field[1][1] = 'X';num[1]--; num[4]--; num[6]--;num[7]--;
}
for(m=2;m<=9;m++){
System.out.println("your turn");
for(i=0;i<=2;i++)
for(k=0;k<=2;k++)
System.out.println(field[i][k]);
case 11: if(field[0][0] == '.'){num[0]++; num[3]++; num[6]++;field[0][0] = 'O';} break;
case 12: if(field[0][1] == '.'){num[3]++; num[1]++;field[0][1] = 'O';} break;
case 13: if(field[0][2] == '.'){num[2]++; num[3]++; num[7]++; field[0][2] = 'O';}break;
case 21: if(field[1][0] == '.'){num[0]++; num[4]++; field[1][0] = 'O';} break;
case 22: if(field[1][1] == '.'){num[1]++; num[4]++; num[6]++;num[7]++;field[1][1] = 'O';} break;
case 23: if(field[1][2] == '.'){num[2]++; num[4]++; field[1][2] = 'O';} break;
case 31: if(field[2][0] == '.'){num[0]++; num[5]++; num[7]++;field[2][0] = 'O';} break;
case 32: if(field[2][1] == '.'){num[1]++; num[5]++; field[2][1] = 'O';} break;
case 33: if(field[2][2] == '.'){num[2]++; num[5]++; num[6]++;field[2][2] = 'O';} break;
default: break;
for(i=0;i<=2;i++){
if(num[i] > max) max = num[i];
if(num[i] < min) min = num[i];
}
if(min == -2){
for(i=0;i<=7;i++)
if(num[i] == -2)
break;
switch case(i){
case 0:
if(field[0][0] == '.') field[0][0] = 'X'; num[0]--; num[3]--; num[6]--;
if(field[1][0] == '.') field[1][0] = 'X';num[0]--; num[4]--;
if(field[2][0] == '.') field[2][0] = 'X';num[0]--; num[5]--; num[7]--;
break;
case 1:
if(field[0][1] == '.') field[0][1] = 'X';num[3]--; num[1]--;
if(field[1][1] == '.') field[1][1] = 'X';num[1]--; num[4]--; num[6]--;
if(field[2][1] == '.') field[2][1] = 'X';num[1]--; num[5]--;
break;
case 2:
if(field[0][2] == '.') field[0][2] = 'X';num[2]--; num[3]--; num[7]--;
if(field[1][2] == '.') field[1][2] = 'X';num[2]--; num[4]--;
if(field[2][2] == '.') field[2][2] = 'X';num[2]--; num[5]--; num[6]--;
break;
case 3:
if(field[0][0] == '.') field[0][0] = 'X';num[0]--; num[3]--; num[6]--;
if(field[0][1] == '.') field[0][1] = 'X';num[3]--; num[1]--;
if(field[0][2] == '.') field[0][2] = 'X';num[2]--; num[3]--; num[7]--;
break;
case 4:
if(field[1][0] == '.') field[1][0] = 'X';num[0]--; num[4]--;
if(field[1][1] == '.') field[1][1] = 'X';num[1]--; num[4]--; num[6]--;
if(field[1][2] == '.') field[1][2] = 'X';num[2]--; num[4]--;
break;
case 5:
if(field[2][0] == '.') field[2][0] = 'X';num[0]--; num[5]--; num[7]--;
if(field[2][1] == '.') field[2][1] = 'X';num[1]--; num[5]--;
if(field[2][2] == '.') field[2][2] = 'X';num[2]--; num[5]--; num[6]--;
break;
case 6:
if(field[0][0] == '.') field[0][0] = 'X';num[0]--; num[3]--; num[6]--;
if(field[1][1] == '.') field[1][1] = 'X';num[1]--; num[4]--; num[6]--;num[7]--;
if(field[2][2] == '.') field[2][2] = 'X';num[2]--; num[5]--; num[6]--;
break;
case 7:
if(field[0][2] == '.') field[0][2] = 'X';num[2]--; num[3]--; num[7]--;
if(field[1][1] == '.') field[1][1] = 'X';num[1]--; num[4]--; num[6]--;num[7]--;
if(field[2][0] == '.') field[2][0] = 'X';num[0]--; num[5]--; num[7]--;
break;
}
}
else if(max == 2){
or(i=0;i<=7;i++)
if(num[i] == 2){
break;
switch case(i){
case 0:
if(field[0][0] == '.') field[0][0] = 'X'; num[0]--; num[3]--; num[6]--;
if(field[1][0] == '.') field[1][0] = 'X';num[0]--; num[4]--;
if(field[2][0] == '.') field[2][0] = 'X';num[0]--; num[5]--; num[7]--;
break;
case 1:
if(field[0][1] == '.') field[0][1] = 'X';num[3]--; num[1]--;
if(field[1][1] == '.') field[1][1] = 'X';num[1]--; num[4]--; num[6]--;
if(field[2][1] == '.') field[2][1] = 'X';num[1]--; num[5]--;
break;
case 2:
if(field[0][2] == '.') field[0][2] = 'X';num[2]--; num[3]--; num[7]--;
if(field[1][2] == '.') field[1][2] = 'X';num[2]--; num[4]--;
if(field[2][2] == '.') field[2][2] = 'X';num[2]--; num[5]--; num[6]--;
break;
case 3:
if(field[0][0] == '.') field[0][0] = 'X';num[0]--; num[3]--; num[6]--;
if(field[0][1] == '.') field[0][1] = 'X';num[3]--; num[1]--;
if(field[0][2] == '.') field[0][2] = 'X';num[2]--; num[3]--; num[7]--;
break;
case 4:
if(field[1][0] == '.') field[1][0] = 'X';num[0]--; num[4]--;
if(field[1][1] == '.') field[1][1] = 'X';num[1]--; num[4]--; num[6]--;
if(field[1][2] == '.') field[1][2] = 'X';num[2]--; num[4]--;
break;
case 5:
if(field[2][0] == '.') field[2][0] = 'X';num[0]--; num[5]--; num[7]--;
if(field[2][1] == '.') field[2][1] = 'X';num[1]--; num[5]--;
if(field[2][2] == '.') field[2][2] = 'X';num[2]--; num[5]--; num[6]--;
break;
case 6:
if(field[0][0] == '.') field[0][0] = 'X';num[0]--; num[3]--; num[6]--;
if(field[1][1] == '.') field[1][1] = 'X';num[1]--; num[4]--; num[6]--;num[7]--;
if(field[2][2] == '.') field[2][2] = 'X';num[2]--; num[5]--; num[6]--;
break;
case 7:
if(field[0][2] == '.') field[0][2] = 'X';num[2]--; num[3]--; num[7]--;
if(field[1][1] == '.') field[1][1] = 'X';num[1]--; num[4]--; num[6]--;num[7]--;
if(field[2][0] == '.') field[2][0] = 'X';num[0]--; num[5]--; num[7]--;
break;
}
}
}
}
| Main.java:25: error: '(' expected
switch case(move){
^
Main.java:25: error: illegal start of expression
switch case(move){
^
Main.java:25: error: : or -> expected
switch case(move){
^
Main.java:26: error: orphaned case
case 11: num[0]++; num[3]++; num[6]++; field[0][0] = 'O'; field[1][1] = 'X';num[1]--; num[4]--; num[6]--;num[7]--;
^
Main.java:43: error: orphaned case
case 11: if(field[0][0] == '.'){num[0]++; num[3]++; num[6]++;field[0][0] = 'O';} break;
^
Main.java:62: error: '(' expected
switch case(i){
^
Main.java:62: error: illegal start of expression
switch case(i){
^
Main.java:62: error: : or -> expected
switch case(i){
^
Main.java:63: error: orphaned case
case 0:
^
Main.java:107: error: ')' or ',' expected
or(i=0;i<=7;i++)
^
Main.java:107: error: not a statement
or(i=0;i<=7;i++)
^
Main.java:107: error: ';' expected
or(i=0;i<=7;i++)
^
Main.java:110: error: '(' expected
switch case(i){
^
Main.java:110: error: illegal start of expression
switch case(i){
^
Main.java:110: error: : or -> expected
switch case(i){
^
Main.java:111: error: orphaned case
case 0:
^
Main.java:106: error: reached end of file while parsing
else if(max == 2){
^
Main.java:160: error: reached end of file while parsing
}
^
18 errors
|
s958884021 | p03836 | C++ | int main(void){
int sx,sy,tx,ty;
cin >> sx >> sy >> tx >> ty;
const int dx=tx-sx,dy=ty-sy; // Path 1
cout << string(dy,’U’) << string(dx,’R’); // Path 2
cout << string(dy,’D’) << string(dx,’L’); // Path 3
cout << ’L’ << string(dy+1,’U’) << string(dx+1,’R’) << ’D’; // Path 4
cout << ’R’ << string(dy+1,’D’) << string(dx+1,’L’) << ’U’;
// EndLine
cout << endl;
return 0;
} | a.cc:5:27: error: extended character ’ is not valid in an identifier
5 | cout << string(dy,’U’) << string(dx,’R’); // Path 2
| ^
a.cc:5:27: error: extended character ’ is not valid in an identifier
a.cc:5:45: error: extended character ’ is not valid in an identifier
5 | cout << string(dy,’U’) << string(dx,’R’); // Path 2
| ^
a.cc:5:45: error: extended character ’ is not valid in an identifier
a.cc:6:27: error: extended character ’ is not valid in an identifier
6 | cout << string(dy,’D’) << string(dx,’L’); // Path 3
| ^
a.cc:6:27: error: extended character ’ is not valid in an identifier
a.cc:6:45: error: extended character ’ is not valid in an identifier
6 | cout << string(dy,’D’) << string(dx,’L’); // Path 3
| ^
a.cc:6:45: error: extended character ’ is not valid in an identifier
a.cc:7:17: error: extended character ’ is not valid in an identifier
7 | cout << ’L’ << string(dy+1,’U’) << string(dx+1,’R’) << ’D’; // Path 4
| ^
a.cc:7:17: error: extended character ’ is not valid in an identifier
a.cc:7:36: error: extended character ’ is not valid in an identifier
7 | cout << ’L’ << string(dy+1,’U’) << string(dx+1,’R’) << ’D’; // Path 4
| ^
a.cc:7:36: error: extended character ’ is not valid in an identifier
a.cc:7:56: error: extended character ’ is not valid in an identifier
7 | cout << ’L’ << string(dy+1,’U’) << string(dx+1,’R’) << ’D’; // Path 4
| ^
a.cc:7:56: error: extended character ’ is not valid in an identifier
a.cc:7:64: error: extended character ’ is not valid in an identifier
7 | cout << ’L’ << string(dy+1,’U’) << string(dx+1,’R’) << ’D’; // Path 4
| ^
a.cc:7:64: error: extended character ’ is not valid in an identifier
a.cc:8:17: error: extended character ’ is not valid in an identifier
8 | cout << ’R’ << string(dy+1,’D’) << string(dx+1,’L’) << ’U’;
| ^
a.cc:8:17: error: extended character ’ is not valid in an identifier
a.cc:8:36: error: extended character ’ is not valid in an identifier
8 | cout << ’R’ << string(dy+1,’D’) << string(dx+1,’L’) << ’U’;
| ^
a.cc:8:36: error: extended character ’ is not valid in an identifier
a.cc:8:56: error: extended character ’ is not valid in an identifier
8 | cout << ’R’ << string(dy+1,’D’) << string(dx+1,’L’) << ’U’;
| ^
a.cc:8:56: error: extended character ’ is not valid in an identifier
a.cc:8:64: error: extended character ’ is not valid in an identifier
8 | cout << ’R’ << string(dy+1,’D’) << string(dx+1,’L’) << ’U’;
| ^
a.cc:8:64: error: extended character ’ is not valid in an identifier
a.cc: In function 'int main()':
a.cc:3:5: error: 'cin' was not declared in this scope
3 | cin >> sx >> sy >> tx >> ty;
| ^~~
a.cc:5:9: error: 'cout' was not declared in this scope
5 | cout << string(dy,’U’) << string(dx,’R’); // Path 2
| ^~~~
a.cc:5:27: error: '\U00002019U\U00002019' was not declared in this scope
5 | cout << string(dy,’U’) << string(dx,’R’); // Path 2
| ^~~
a.cc:5:17: error: 'string' was not declared in this scope
5 | cout << string(dy,’U’) << string(dx,’R’); // Path 2
| ^~~~~~
a.cc:5:45: error: '\U00002019R\U00002019' was not declared in this scope
5 | cout << string(dy,’U’) << string(dx,’R’); // Path 2
| ^~~
a.cc:6:27: error: '\U00002019D\U00002019' was not declared in this scope
6 | cout << string(dy,’D’) << string(dx,’L’); // Path 3
| ^~~
a.cc:6:45: error: '\U00002019L\U00002019' was not declared in this scope
6 | cout << string(dy,’D’) << string(dx,’L’); // Path 3
| ^~~
a.cc:10:17: error: 'endl' was not declared in this scope
10 | cout << endl;
| ^~~~
|
s605090263 | p03836 | C++ | #include<bits/stdc++.h>
using namespace std;
int main(){
int A,B,C,D;
string S;
cin>>A>>B>>C>>D;
int E=C-A;
int F=D-B;
for(int i=0;i<E)
cout<<'R';
for(int i=0;i<F)
cout<<'U';
for(int i=0;i<E)
cout<<'L';
for(int i=0;i<F)
cout<<'D';
cout<<'D';
for(int i=0;i<E+1)
cout<<'R';
for(int i=0;i<F+1)
cout<<'U';
cout<<'L';
cout<<'U';
for(int i=0;i<E+1)
cout<<'L';
for(int i=0;i<F+1)
cout<<'D';
cout<<'R'<<endl;
} | a.cc: In function 'int main()':
a.cc:10:18: error: expected ';' before ')' token
10 | for(int i=0;i<E)
| ^
| ;
a.cc:12:18: error: expected ';' before ')' token
12 | for(int i=0;i<F)
| ^
| ;
a.cc:14:18: error: expected ';' before ')' token
14 | for(int i=0;i<E)
| ^
| ;
a.cc:16:18: error: expected ';' before ')' token
16 | for(int i=0;i<F)
| ^
| ;
a.cc:19:20: error: expected ';' before ')' token
19 | for(int i=0;i<E+1)
| ^
| ;
a.cc:21:20: error: expected ';' before ')' token
21 | for(int i=0;i<F+1)
| ^
| ;
a.cc:25:20: error: expected ';' before ')' token
25 | for(int i=0;i<E+1)
| ^
| ;
a.cc:27:20: error: expected ';' before ')' token
27 | for(int i=0;i<F+1)
| ^
| ;
|
s642456277 | p03836 | Java | public class Main {
public static void main(String[] args) {
StringBuilder sb = new StringBuilder();
Scanner in = new Scanner(System.in);
int x = in.nextInt();
int y = in.nextInt();
int tx = in.nextInt();
int ty = in.nextInt();
in.close();
int dx = tx - x;
int dy = ty - y;
for (int i = 0; i < dx; i++) {
sb.append("R");
}
for (int i = 0; i < dy; i++) {
sb.append("U");
}
for (int i = 0; i < dx; i++) {
sb.append("L");
}
for (int i = 0; i <= dy; i++) {
sb.append("D");
}
for (int i = 0; i <= dx; i++) {
sb.append("R");
}
for (int i = 0; i <= dy; i++) {
sb.append("U");
}
sb.append("L");
sb.append("U");
for (int i = 0; i <= dx; i++) {
sb.append("L");
}
for (int i = 0; i <= dy; i++) {
sb.append("U");
}
sb.append("L");
System.out.println(sb.toString());
}
}
| Main.java:5: error: cannot find symbol
Scanner in = new Scanner(System.in);
^
symbol: class Scanner
location: class Main
Main.java:5: error: cannot find symbol
Scanner in = new Scanner(System.in);
^
symbol: class Scanner
location: class Main
2 errors
|
s860324739 | p03836 | Java | StringBuilder sb = new StringBuilder();
Scanner in = new Scanner(System.in);
int x = in.nextInt();
int y = in.nextInt();
int tx = in.nextInt();
int ty = in.nextInt();
in.close();
int dx = tx - x;
int dy = ty - y;
for (int i = 0; i < dx; i++) {
sb.append("R");
}
for (int i = 0; i < dy; i++) {
sb.append("U");
}
for (int i = 0; i < dx; i++) {
sb.append("L");
}
for (int i = 0; i <= dy; i++) {
sb.append("D");
}
for (int i = 0; i <= dx; i++) {
sb.append("R");
}
for (int i = 0; i <= dy; i++) {
sb.append("U");
}
sb.append("L");
sb.append("U");
for (int i = 0; i <= dx; i++) {
sb.append("L");
}
for (int i = 0; i <= dy; i++) {
sb.append("U");
}
sb.append("L");
System.out.println(sb.toString());
}
}
| Main.java:1: error: unnamed classes are a preview feature and are disabled by default.
StringBuilder sb = new StringBuilder();
^
(use --enable-preview to enable unnamed classes)
Main.java:7: error: class, interface, enum, or record expected
in.close();
^
Main.java:12: error: class, interface, enum, or record expected
for (int i = 0; i < dx; i++) {
^
Main.java:12: error: class, interface, enum, or record expected
for (int i = 0; i < dx; i++) {
^
Main.java:12: error: class, interface, enum, or record expected
for (int i = 0; i < dx; i++) {
^
Main.java:14: error: class, interface, enum, or record expected
}
^
Main.java:15: error: class, interface, enum, or record expected
for (int i = 0; i < dy; i++) {
^
Main.java:15: error: class, interface, enum, or record expected
for (int i = 0; i < dy; i++) {
^
Main.java:17: error: class, interface, enum, or record expected
}
^
Main.java:18: error: class, interface, enum, or record expected
for (int i = 0; i < dx; i++) {
^
Main.java:18: error: class, interface, enum, or record expected
for (int i = 0; i < dx; i++) {
^
Main.java:20: error: class, interface, enum, or record expected
}
^
Main.java:21: error: class, interface, enum, or record expected
for (int i = 0; i <= dy; i++) {
^
Main.java:21: error: class, interface, enum, or record expected
for (int i = 0; i <= dy; i++) {
^
Main.java:23: error: class, interface, enum, or record expected
}
^
Main.java:24: error: class, interface, enum, or record expected
for (int i = 0; i <= dx; i++) {
^
Main.java:24: error: class, interface, enum, or record expected
for (int i = 0; i <= dx; i++) {
^
Main.java:26: error: class, interface, enum, or record expected
}
^
Main.java:27: error: class, interface, enum, or record expected
for (int i = 0; i <= dy; i++) {
^
Main.java:27: error: class, interface, enum, or record expected
for (int i = 0; i <= dy; i++) {
^
Main.java:29: error: class, interface, enum, or record expected
}
^
Main.java:31: error: class, interface, enum, or record expected
sb.append("U");
^
Main.java:32: error: class, interface, enum, or record expected
for (int i = 0; i <= dx; i++) {
^
Main.java:32: error: class, interface, enum, or record expected
for (int i = 0; i <= dx; i++) {
^
Main.java:32: error: class, interface, enum, or record expected
for (int i = 0; i <= dx; i++) {
^
Main.java:34: error: class, interface, enum, or record expected
}
^
Main.java:35: error: class, interface, enum, or record expected
for (int i = 0; i <= dy; i++) {
^
Main.java:35: error: class, interface, enum, or record expected
for (int i = 0; i <= dy; i++) {
^
Main.java:37: error: class, interface, enum, or record expected
}
^
Main.java:39: error: class, interface, enum, or record expected
System.out.println(sb.toString());
^
Main.java:40: error: class, interface, enum, or record expected
}
^
31 errors
|
s981448641 | p03836 | C++ | #include <bits/stdc++.h>
using namespace std;
int main() {
int sx, sy, tx, ty;
cin>>sx>>sy>>tx>>ty;
int x=tx-sx, y=ty-sy;
for(int i=0, i<x, i++) {
cout<<"U";
}
for(int i=0, i<y, i++) {
cout<<"R";
}
for(int i=0, i<x, i++) {
cout<<"D";
}
for(int i=0, i<=y, i++) {
cout<<"L";
}
for(int i=0, i<=x, i++) {
cout<<"U";
}
for(int i=0, i<=y, i++) {
cout<<"R";
}
cout<<"D";
cout<<"R";
for(int i=0, i<=x, i++) {
cout<<"D";
}
for(int i=0, i<=y, i++) {
cout<<"L";
}
cout<<"U";
return 0;
} | a.cc: In function 'int main()':
a.cc:8:17: error: expected ';' before '<' token
8 | for(int i=0, i<x, i++) {
| ^
| ;
a.cc:8:17: error: expected primary-expression before '<' token
a.cc:8:24: error: expected ';' before ')' token
8 | for(int i=0, i<x, i++) {
| ^
| ;
a.cc:11:17: error: expected ';' before '<' token
11 | for(int i=0, i<y, i++) {
| ^
| ;
a.cc:11:17: error: expected primary-expression before '<' token
a.cc:11:24: error: expected ';' before ')' token
11 | for(int i=0, i<y, i++) {
| ^
| ;
a.cc:14:17: error: expected ';' before '<' token
14 | for(int i=0, i<x, i++) {
| ^
| ;
a.cc:14:17: error: expected primary-expression before '<' token
a.cc:14:24: error: expected ';' before ')' token
14 | for(int i=0, i<x, i++) {
| ^
| ;
a.cc:17:17: error: expected ';' before '<=' token
17 | for(int i=0, i<=y, i++) {
| ^~
| ;
a.cc:17:17: error: expected primary-expression before '<=' token
17 | for(int i=0, i<=y, i++) {
| ^~
a.cc:17:25: error: expected ';' before ')' token
17 | for(int i=0, i<=y, i++) {
| ^
| ;
a.cc:20:17: error: expected ';' before '<=' token
20 | for(int i=0, i<=x, i++) {
| ^~
| ;
a.cc:20:17: error: expected primary-expression before '<=' token
20 | for(int i=0, i<=x, i++) {
| ^~
a.cc:20:25: error: expected ';' before ')' token
20 | for(int i=0, i<=x, i++) {
| ^
| ;
a.cc:23:17: error: expected ';' before '<=' token
23 | for(int i=0, i<=y, i++) {
| ^~
| ;
a.cc:23:17: error: expected primary-expression before '<=' token
23 | for(int i=0, i<=y, i++) {
| ^~
a.cc:23:25: error: expected ';' before ')' token
23 | for(int i=0, i<=y, i++) {
| ^
| ;
a.cc:28:17: error: expected ';' before '<=' token
28 | for(int i=0, i<=x, i++) {
| ^~
| ;
a.cc:28:17: error: expected primary-expression before '<=' token
28 | for(int i=0, i<=x, i++) {
| ^~
a.cc:28:25: error: expected ';' before ')' token
28 | for(int i=0, i<=x, i++) {
| ^
| ;
a.cc:31:17: error: expected ';' before '<=' token
31 | for(int i=0, i<=y, i++) {
| ^~
| ;
a.cc:31:17: error: expected primary-expression before '<=' token
31 | for(int i=0, i<=y, i++) {
| ^~
a.cc:31:25: error: expected ';' before ')' token
31 | for(int i=0, i<=y, i++) {
| ^
| ;
|
s745444441 | p03836 | C++ | #include <bits/stdc++.h>
using namespace std;
int main() {
int sx,sy,tx,ty;
cin >> sx >> sy >> tx >>ty;
int dx,dy;
dx=tx-sx;
dy=ty-sy;
for(int i=0;i<dx;i++){
cout << "R";
}
for(int i=0;i<dy;i++){
cout << "U";
}
for(int i=0;i<dx;i++){
cout << "L";
}
for(int i=0;i<dy;i++){
cout << "D";
}
cout << "D";
for(int i=0;i<dx+1;i++){
cout << "R";
}
for(int i=0;i<dy+1;i++){
cout << "U";
}
cout << "L";
cout << "U";
for(int i=0;i<dx+1;i++){
cout << "L";
}
for(int i=0;i<dy+1;i++){
cout << "D";
}
; | a.cc: In function 'int main()':
a.cc:37:4: error: expected '}' at end of input
37 | ;
| ^
a.cc:4:12: note: to match this '{'
4 | int main() {
| ^
|
s812836273 | p03836 | C++ | #include <bits/stdc++.h>
using namespace std;
int main() {
int sx,sy,tx,ty;
cin >> sx >> sy >> tx >>ty;
int dx,dy;
dx=tx-sx;
dy=ty-sy;
for(int i=0;i<dx;i++){
cout << "R";
}
for(i=0;i<dy;i++){
cout << "U";
}
for(i=0;i<dx;i++){
cout << "L";
}
for(i=0;i<dy;i++){
cout << "D";
}
cout << "D";
for(i=0;i<dx+1;i++){
cout << "R";
}
for(i=0;i<dy+1;i++){
cout << "U";
}
cout << "L";
cout << "U";
for(i=0;i<dx+1;i++){
cout << "L";
}
for(i=0;i<dy+1;i++){
cout << "D";
}
; | a.cc: In function 'int main()':
a.cc:13:7: error: 'i' was not declared in this scope
13 | for(i=0;i<dy;i++){
| ^
a.cc:16:7: error: 'i' was not declared in this scope
16 | for(i=0;i<dx;i++){
| ^
a.cc:19:7: error: 'i' was not declared in this scope
19 | for(i=0;i<dy;i++){
| ^
a.cc:23:7: error: 'i' was not declared in this scope
23 | for(i=0;i<dx+1;i++){
| ^
a.cc:26:7: error: 'i' was not declared in this scope
26 | for(i=0;i<dy+1;i++){
| ^
a.cc:31:7: error: 'i' was not declared in this scope
31 | for(i=0;i<dx+1;i++){
| ^
a.cc:34:7: error: 'i' was not declared in this scope
34 | for(i=0;i<dy+1;i++){
| ^
a.cc:37:4: error: expected '}' at end of input
37 | ;
| ^
a.cc:4:12: note: to match this '{'
4 | int main() {
| ^
|
s336853211 | p03836 | C++ | #include <bits/stdc++.h>
using namespace std;
int main() {
int sx,sy,tx,ty;
cin >> sx >> sy >> tx >>ty;
int dx,dy;
dx=tx-sx;
dy=ty-sy;
for(i=0;i<dx;i++){
cout << R;
}
for(i=0;i<dy;i++){
cout << U;
}
for(i=0;i<dx;i++){
cout << L;
}
for(i=0;i<dy;i++){
cout << D;
}
cout << D;
for(i=0;i<dx+1;i++){
cout << R;
}
for(i=0;i<dy+1;i++){
cout << U;
}
cout << L;
cout << U;
for(i=0;i<dx+1;i++){
cout << L;
}
for(i=0;i<dy+1;i++){
cout << D;
}
; | a.cc: In function 'int main()':
a.cc:10:7: error: 'i' was not declared in this scope
10 | for(i=0;i<dx;i++){
| ^
a.cc:11:13: error: 'R' was not declared in this scope
11 | cout << R;
| ^
a.cc:13:7: error: 'i' was not declared in this scope
13 | for(i=0;i<dy;i++){
| ^
a.cc:14:13: error: 'U' was not declared in this scope
14 | cout << U;
| ^
a.cc:16:7: error: 'i' was not declared in this scope
16 | for(i=0;i<dx;i++){
| ^
a.cc:17:13: error: 'L' was not declared in this scope
17 | cout << L;
| ^
a.cc:19:7: error: 'i' was not declared in this scope
19 | for(i=0;i<dy;i++){
| ^
a.cc:20:13: error: 'D' was not declared in this scope
20 | cout << D;
| ^
a.cc:22:11: error: 'D' was not declared in this scope
22 | cout << D;
| ^
a.cc:23:7: error: 'i' was not declared in this scope
23 | for(i=0;i<dx+1;i++){
| ^
a.cc:24:13: error: 'R' was not declared in this scope
24 | cout << R;
| ^
a.cc:26:7: error: 'i' was not declared in this scope
26 | for(i=0;i<dy+1;i++){
| ^
a.cc:27:13: error: 'U' was not declared in this scope
27 | cout << U;
| ^
a.cc:29:11: error: 'L' was not declared in this scope
29 | cout << L;
| ^
a.cc:30:11: error: 'U' was not declared in this scope
30 | cout << U;
| ^
a.cc:31:7: error: 'i' was not declared in this scope
31 | for(i=0;i<dx+1;i++){
| ^
a.cc:34:7: error: 'i' was not declared in this scope
34 | for(i=0;i<dy+1;i++){
| ^
a.cc:37:4: error: expected '}' at end of input
37 | ;
| ^
a.cc:4:12: note: to match this '{'
4 | int main() {
| ^
|
s163535547 | p03836 | C++ | #include "bits/stdc++.h"
using namespace std;
#include "pch.h"
using namespace std;
#include <string>
#include <iostream>
int main() {
int sx, sy, tx, ty;
cin >> sx >> sy >> tx >> ty;
int dx = tx - sx;
int dy = ty - sy;
for (int i = 0; i < dy; i++) putchar('U');
for (int i = 0; i < dx; i++) putchar('R');
for (int i = 0; i < dy; i++) putchar('D');
for (int i = 0; i < dx; i++) putchar('L');
putchar('L');
for (int i = 0; i < dy; i++) putchar('U');
putchar('U');
for (int i = 0; i < dx; i++) putchar('R');
putchar('R');
putchar('D');
putchar('R');
for (int i = 0; i < dy; i++) putchar('D');
putchar('D');
for (int i = 0; i < dx; i++) putchar('L');
putchar('L');
putchar('U');
}
| a.cc:3:10: fatal error: pch.h: No such file or directory
3 | #include "pch.h"
| ^~~~~~~
compilation terminated.
|
s027047861 | p03836 | C++ | #include <iostream>
using namespace std;
int main(){
int sx, sy, tx, ty;
cin >> sx >> sy >> tx >> ty;
int dx = tx - sx;
int dy = ty - sy;
cout << strig(dx,'R') << strig(dy,'U') << endl;
cout << strig(dx,'L') << strig(dy,'D') << endl;
cout << 'L' <<strig(dy,'U') << strig(dx,'R') << 'R' << endl;
cout << 'R' <<strig(dy,'D') << strig(dx,'L') << 'L' << endl;
} | a.cc: In function 'int main()':
a.cc:10:13: error: 'strig' was not declared in this scope
10 | cout << strig(dx,'R') << strig(dy,'U') << endl;
| ^~~~~
|
s209725708 | p03836 | C++ | #include <bits/stdc++.h>
using namespace std;
int main(void){
int sx,sy,tx,ty;
cin >> sx >> sy >> tx >> ty;
const int dx=tx-sx,dy=ty-sy;
// Path 1
cout << string(dy,’U’) << string(dx,’R’);
// Path 2
cout << string(dy,’D’) << string(dx,’L’);
// Path 3
cout << ’L’ << string(dy+1,’U’) << string(dx+1,’R’) << ’D’;
// Path 4
cout << ’R’ << string(dy+1,’D’) << string(dx+1,’L’) << ’U’;
// EndLine
cout << endl;
return 0;
}
| a.cc:10:20: error: extended character ’ is not valid in an identifier
10 | cout << string(dy,’U’) << string(dx,’R’);
| ^
a.cc:10:20: error: extended character ’ is not valid in an identifier
a.cc:10:38: error: extended character ’ is not valid in an identifier
10 | cout << string(dy,’U’) << string(dx,’R’);
| ^
a.cc:10:38: error: extended character ’ is not valid in an identifier
a.cc:13:20: error: extended character ’ is not valid in an identifier
13 | cout << string(dy,’D’) << string(dx,’L’);
| ^
a.cc:13:20: error: extended character ’ is not valid in an identifier
a.cc:13:38: error: extended character ’ is not valid in an identifier
13 | cout << string(dy,’D’) << string(dx,’L’);
| ^
a.cc:13:38: error: extended character ’ is not valid in an identifier
a.cc:16:10: error: extended character ’ is not valid in an identifier
16 | cout << ’L’ << string(dy+1,’U’) << string(dx+1,’R’) << ’D’;
| ^
a.cc:16:10: error: extended character ’ is not valid in an identifier
a.cc:16:29: error: extended character ’ is not valid in an identifier
16 | cout << ’L’ << string(dy+1,’U’) << string(dx+1,’R’) << ’D’;
| ^
a.cc:16:29: error: extended character ’ is not valid in an identifier
a.cc:16:49: error: extended character ’ is not valid in an identifier
16 | cout << ’L’ << string(dy+1,’U’) << string(dx+1,’R’) << ’D’;
| ^
a.cc:16:49: error: extended character ’ is not valid in an identifier
a.cc:16:57: error: extended character ’ is not valid in an identifier
16 | cout << ’L’ << string(dy+1,’U’) << string(dx+1,’R’) << ’D’;
| ^
a.cc:16:57: error: extended character ’ is not valid in an identifier
a.cc:19:10: error: extended character ’ is not valid in an identifier
19 | cout << ’R’ << string(dy+1,’D’) << string(dx+1,’L’) << ’U’;
| ^
a.cc:19:10: error: extended character ’ is not valid in an identifier
a.cc:19:29: error: extended character ’ is not valid in an identifier
19 | cout << ’R’ << string(dy+1,’D’) << string(dx+1,’L’) << ’U’;
| ^
a.cc:19:29: error: extended character ’ is not valid in an identifier
a.cc:19:49: error: extended character ’ is not valid in an identifier
19 | cout << ’R’ << string(dy+1,’D’) << string(dx+1,’L’) << ’U’;
| ^
a.cc:19:49: error: extended character ’ is not valid in an identifier
a.cc:19:57: error: extended character ’ is not valid in an identifier
19 | cout << ’R’ << string(dy+1,’D’) << string(dx+1,’L’) << ’U’;
| ^
a.cc:19:57: error: extended character ’ is not valid in an identifier
a.cc: In function 'int main()':
a.cc:10:20: error: '\U00002019U\U00002019' was not declared in this scope
10 | cout << string(dy,’U’) << string(dx,’R’);
| ^~~
a.cc:10:38: error: '\U00002019R\U00002019' was not declared in this scope
10 | cout << string(dy,’U’) << string(dx,’R’);
| ^~~
a.cc:13:20: error: '\U00002019D\U00002019' was not declared in this scope
13 | cout << string(dy,’D’) << string(dx,’L’);
| ^~~
a.cc:13:38: error: '\U00002019L\U00002019' was not declared in this scope
13 | cout << string(dy,’D’) << string(dx,’L’);
| ^~~
|
s252812216 | p03836 | C | #include <bits/stdc++.h>
using namespace std;
int main(void){
int sx,sy,tx,ty;
cin >> sx >> sy >> tx >> ty;
const int dx=tx-sx,dy=ty-sy;
// Path 1
cout << string(dy,’U’) << string(dx,’R’);
// Path 2
cout << string(dy,’D’) << string(dx,’L’);
// Path 3
cout << ’L’ << string(dy+1,’U’) << string(dx+1,’R’) << ’D’;
// Path 4
cout << ’R’ << string(dy+1,’D’) << string(dx+1,’L’) << ’U’;
// EndLine
cout << endl;
return 0;
}
| main.c:1:10: fatal error: bits/stdc++.h: No such file or directory
1 | #include <bits/stdc++.h>
| ^~~~~~~~~~~~~~~
compilation terminated.
|
s205501580 | p03836 | C | int main(void){
int sx,sy,tx,ty;
cin >> sx >> sy >> tx >> ty;
const int dx=tx-sx,dy=ty-sy;
// Path 1
cout << string(dy,’U’) << string(dx,’R’);
// Path 2
cout << string(dy,’D’) << string(dx,’L’);
// Path 3
cout << ’L’ << string(dy+1,’U’) << string(dx+1,’R’) << ’D’;
// Path 4
cout << ’R’ << string(dy+1,’D’) << string(dx+1,’L’) << ’U’;
// EndLine
cout << endl;
return 0;
}
| main.c: In function 'main':
main.c:3:2: error: 'cin' undeclared (first use in this function)
3 | cin >> sx >> sy >> tx >> ty;
| ^~~
main.c:3:2: note: each undeclared identifier is reported only once for each function it appears in
main.c:8:2: error: 'cout' undeclared (first use in this function)
8 | cout << string(dy,’U’) << string(dx,’R’);
| ^~~~
main.c:8:10: error: implicit declaration of function 'string' [-Wimplicit-function-declaration]
8 | cout << string(dy,’U’) << string(dx,’R’);
| ^~~~~~
main.c:8:20: error: stray '\342' in program
8 | cout << string(dy,<U+2019>U<U+2019>) << string(dx,<U+2019>R<U+2019>);
| ^~~~~~~~
main.c:8:22: error: stray '\342' in program
8 | cout << string(dy,<U+2019>U<U+2019>) << string(dx,<U+2019>R<U+2019>);
| ^~~~~~~~
main.c:8:21: error: 'U' undeclared (first use in this function)
8 | cout << string(dy,’U’) << string(dx,’R’);
| ^
main.c:8:38: error: stray '\342' in program
8 | cout << string(dy,<U+2019>U<U+2019>) << string(dx,<U+2019>R<U+2019>);
| ^~~~~~~~
main.c:8:40: error: stray '\342' in program
8 | cout << string(dy,<U+2019>U<U+2019>) << string(dx,<U+2019>R<U+2019>);
| ^~~~~~~~
main.c:8:39: error: 'R' undeclared (first use in this function)
8 | cout << string(dy,’U’) << string(dx,’R’);
| ^
main.c:11:20: error: stray '\342' in program
11 | cout << string(dy,<U+2019>D<U+2019>) << string(dx,<U+2019>L<U+2019>);
| ^~~~~~~~
main.c:11:22: error: stray '\342' in program
11 | cout << string(dy,<U+2019>D<U+2019>) << string(dx,<U+2019>L<U+2019>);
| ^~~~~~~~
main.c:11:21: error: 'D' undeclared (first use in this function)
11 | cout << string(dy,’D’) << string(dx,’L’);
| ^
main.c:11:38: error: stray '\342' in program
11 | cout << string(dy,<U+2019>D<U+2019>) << string(dx,<U+2019>L<U+2019>);
| ^~~~~~~~
main.c:11:40: error: stray '\342' in program
11 | cout << string(dy,<U+2019>D<U+2019>) << string(dx,<U+2019>L<U+2019>);
| ^~~~~~~~
main.c:11:39: error: 'L' undeclared (first use in this function)
11 | cout << string(dy,’D’) << string(dx,’L’);
| ^
main.c:14:10: error: stray '\342' in program
14 | cout << <U+2019>L<U+2019> << string(dy+1,<U+2019>U<U+2019>) << string(dx+1,<U+2019>R<U+2019>) << <U+2019>D<U+2019>;
| ^~~~~~~~
main.c:14:12: error: stray '\342' in program
14 | cout << <U+2019>L<U+2019> << string(dy+1,<U+2019>U<U+2019>) << string(dx+1,<U+2019>R<U+2019>) << <U+2019>D<U+2019>;
| ^~~~~~~~
main.c:14:29: error: stray '\342' in program
14 | cout << <U+2019>L<U+2019> << string(dy+1,<U+2019>U<U+2019>) << string(dx+1,<U+2019>R<U+2019>) << <U+2019>D<U+2019>;
| ^~~~~~~~
main.c:14:31: error: stray '\342' in program
14 | cout << <U+2019>L<U+2019> << string(dy+1,<U+2019>U<U+2019>) << string(dx+1,<U+2019>R<U+2019>) << <U+2019>D<U+2019>;
| ^~~~~~~~
main.c:14:49: error: stray '\342' in program
14 | cout << <U+2019>L<U+2019> << string(dy+1,<U+2019>U<U+2019>) << string(dx+1,<U+2019>R<U+2019>) << <U+2019>D<U+2019>;
| ^~~~~~~~
main.c:14:51: error: stray '\342' in program
14 | cout << <U+2019>L<U+2019> << string(dy+1,<U+2019>U<U+2019>) << string(dx+1,<U+2019>R<U+2019>) << <U+2019>D<U+2019>;
| ^~~~~~~~
main.c:14:57: error: stray '\342' in program
14 | cout << <U+2019>L<U+2019> << string(dy+1,<U+2019>U<U+2019>) << string(dx+1,<U+2019>R<U+2019>) << <U+2019>D<U+2019>;
| ^~~~~~~~
main.c:14:59: error: stray '\342' in program
14 | cout << <U+2019>L<U+2019> << string(dy+1,<U+2019>U<U+2019>) << string(dx+1,<U+2019>R<U+2019>) << <U+2019>D<U+2019>;
| ^~~~~~~~
main.c:17:10: error: stray '\342' in program
17 | cout << <U+2019>R<U+2019> << string(dy+1,<U+2019>D<U+2019>) << string(dx+1,<U+2019>L<U+2019>) << <U+2019>U<U+2019>;
| ^~~~~~~~
main.c:17:12: error: stray '\342' in program
17 | cout << <U+2019>R<U+2019> << string(dy+1,<U+2019>D<U+2019>) << string(dx+1,<U+2019>L<U+2019>) << <U+2019>U<U+2019>;
| ^~~~~~~~
main.c:17:29: error: stray '\342' in program
17 | cout << <U+2019>R<U+2019> << string(dy+1,<U+2019>D<U+2019>) << string(dx+1,<U+2019>L<U+2019>) << <U+2019>U<U+2019>;
| ^~~~~~~~
main.c:17:31: error: stray '\342' in program
17 | cout << <U+2019>R<U+2019> << string(dy+1,<U+2019>D<U+2019>) << string(dx+1,<U+2019>L<U+2019>) << <U+2019>U<U+2019>;
| ^~~~~~~~
main.c:17:49: error: stray '\342' in program
17 | cout << <U+2019>R<U+2019> << string(dy+1,<U+2019>D<U+2019>) << string(dx+1,<U+2019>L<U+2019>) << <U+2019>U<U+2019>;
| ^~~~~~~~
main.c:17:51: error: stray '\342' in program
17 | cout << <U+2019>R<U+2019> << string(dy+1,<U+2019>D<U+2019>) << string(dx+1,<U+2019>L<U+2019>) << <U+2019>U<U+2019>;
| ^~~~~~~~
main.c:17:57: error: stray '\342' in program
17 | cout << <U+2019>R<U+2019> << string(dy+1,<U+2019>D<U+2019>) << string(dx+1,<U+2019>L<U+2019>) << <U+2019>U<U+2019>;
| ^~~~~~~~
main.c:17:59: error: stray '\342' in program
17 | cout << <U+2019>R<U+2019> << string(dy+1,<U+2019>D<U+2019>) << string(dx+1,<U+2019>L<U+2019>) << <U+2019>U<U+2019>;
| ^~~~~~~~
main.c:20:10: error: 'endl' undeclared (first use in this function)
20 | cout << endl;
| ^~~~
|
s353566851 | p03836 | C++ | int main(void){
int sx,sy,tx,ty;
cin >> sx >> sy >> tx >> ty;
const int dx=tx-sx,dy=ty-sy;
// Path 1
cout << string(dy,’U’) << string(dx,’R’);
// Path 2
cout << string(dy,’D’) << string(dx,’L’);
// Path 3
cout << ’L’ << string(dy+1,’U’) << string(dx+1,’R’) << ’D’;
// Path 4
cout << ’R’ << string(dy+1,’D’) << string(dx+1,’L’) << ’U’;
// EndLine
cout << endl;
return 0;
} | a.cc:8:20: error: extended character ’ is not valid in an identifier
8 | cout << string(dy,’U’) << string(dx,’R’);
| ^
a.cc:8:20: error: extended character ’ is not valid in an identifier
a.cc:8:38: error: extended character ’ is not valid in an identifier
8 | cout << string(dy,’U’) << string(dx,’R’);
| ^
a.cc:8:38: error: extended character ’ is not valid in an identifier
a.cc:11:20: error: extended character ’ is not valid in an identifier
11 | cout << string(dy,’D’) << string(dx,’L’);
| ^
a.cc:11:20: error: extended character ’ is not valid in an identifier
a.cc:11:38: error: extended character ’ is not valid in an identifier
11 | cout << string(dy,’D’) << string(dx,’L’);
| ^
a.cc:11:38: error: extended character ’ is not valid in an identifier
a.cc:14:10: error: extended character ’ is not valid in an identifier
14 | cout << ’L’ << string(dy+1,’U’) << string(dx+1,’R’) << ’D’;
| ^
a.cc:14:10: error: extended character ’ is not valid in an identifier
a.cc:14:29: error: extended character ’ is not valid in an identifier
14 | cout << ’L’ << string(dy+1,’U’) << string(dx+1,’R’) << ’D’;
| ^
a.cc:14:29: error: extended character ’ is not valid in an identifier
a.cc:14:49: error: extended character ’ is not valid in an identifier
14 | cout << ’L’ << string(dy+1,’U’) << string(dx+1,’R’) << ’D’;
| ^
a.cc:14:49: error: extended character ’ is not valid in an identifier
a.cc:14:57: error: extended character ’ is not valid in an identifier
14 | cout << ’L’ << string(dy+1,’U’) << string(dx+1,’R’) << ’D’;
| ^
a.cc:14:57: error: extended character ’ is not valid in an identifier
a.cc:17:10: error: extended character ’ is not valid in an identifier
17 | cout << ’R’ << string(dy+1,’D’) << string(dx+1,’L’) << ’U’;
| ^
a.cc:17:10: error: extended character ’ is not valid in an identifier
a.cc:17:29: error: extended character ’ is not valid in an identifier
17 | cout << ’R’ << string(dy+1,’D’) << string(dx+1,’L’) << ’U’;
| ^
a.cc:17:29: error: extended character ’ is not valid in an identifier
a.cc:17:49: error: extended character ’ is not valid in an identifier
17 | cout << ’R’ << string(dy+1,’D’) << string(dx+1,’L’) << ’U’;
| ^
a.cc:17:49: error: extended character ’ is not valid in an identifier
a.cc:17:57: error: extended character ’ is not valid in an identifier
17 | cout << ’R’ << string(dy+1,’D’) << string(dx+1,’L’) << ’U’;
| ^
a.cc:17:57: error: extended character ’ is not valid in an identifier
a.cc: In function 'int main()':
a.cc:3:2: error: 'cin' was not declared in this scope
3 | cin >> sx >> sy >> tx >> ty;
| ^~~
a.cc:8:2: error: 'cout' was not declared in this scope
8 | cout << string(dy,’U’) << string(dx,’R’);
| ^~~~
a.cc:8:20: error: '\U00002019U\U00002019' was not declared in this scope
8 | cout << string(dy,’U’) << string(dx,’R’);
| ^~~
a.cc:8:10: error: 'string' was not declared in this scope
8 | cout << string(dy,’U’) << string(dx,’R’);
| ^~~~~~
a.cc:8:38: error: '\U00002019R\U00002019' was not declared in this scope
8 | cout << string(dy,’U’) << string(dx,’R’);
| ^~~
a.cc:11:20: error: '\U00002019D\U00002019' was not declared in this scope
11 | cout << string(dy,’D’) << string(dx,’L’);
| ^~~
a.cc:11:38: error: '\U00002019L\U00002019' was not declared in this scope
11 | cout << string(dy,’D’) << string(dx,’L’);
| ^~~
a.cc:20:10: error: 'endl' was not declared in this scope
20 | cout << endl;
| ^~~~
|
s610126946 | p03836 | C++ | #include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp> // Common file
#include <ext/pb_ds/tree_policy.hpp> // Including tree_order_statistics_node_update
using namespace std;
using namespace __gnu_pbds;
//find_by_order gives kth-largest element
//order_of_key gives the number of items in the set that are strictly smaller!!
// OT.find_by_order(k-1)
//
typedef tree<int, null_type, less<int>, rb_tree_tag, tree_order_statistics_node_update> ordered_set;
#define db(x) cerr << #x << "=" << x << endl
#define db2(x, y) cerr << #x << "=" << x << "," << #y << "=" << y << endl
#define db3(x, y, z) cerr << #x << "=" << x << "," << #y << "=" << y << "," << #z << "=" << z << endl
#define db4(x, y, z, w) cerr << #x << "=" << x << "," << #y << "=" << y << "," << #z << "=" << z << "," << #w << "=" << w << endl
#define ll long long
#define pb push_back
#define eb emplace_back
#define all(x) (x).begin(), (x).end()
#define mp make_pair
#define X first
#define Y second
#define sz(x) (int)((x).size())
#define pii pair<int,int>
#define MOD (ll)(1e9 + 7)
#define rep(i, n) for(int i = 0; i < (n); ++i)
#define repA(i, a, n) for(int i = a; i <= (n); ++i)
#define repD(i, a, n) for(int i = a; i >= (n); --i)
#define trav(a, x) for(auto& a : x)
typedef vector<int> vi;
#define inf (ll)(1e18)
#define double long double
#define int long long
//////////////////////
const int N = 1005;
void p0() {
cout << "0\n";
exit(0);
}
int power(int base, int exp) {
int ans = 1;
while(exp) {
if(exp&1)
ans = (ans * base) % MOD;
base = (base * base) % MOD;
exp /= 2;
}
return ans;
}
int32_t main() {
ios::sync_with_stdio(false);
cin.tie(0);
cout.tie(0);
int x,y,tx,ty;
cin >> x >> y >> tx >> ty;
int up = ty-y, right = tx-x;
string one(up,'U'), down(up,'D');
string sec(right,'R'), third(left,'L');
cout << (one+sec) << (down+third);
one += 'U';
sec += 'R';
down += 'D';
third = 'L'
cout << 'L' << (one + sec) << 'D';
cout << 'R' << (down + third) << 'U';
// db2(sz(a),sz(b));
} | a.cc: In function 'int32_t main()':
a.cc:69:42: error: no matching function for call to 'std::__cxx11::basic_string<char>::basic_string(std::ios_base& (&)(std::ios_base&), char)'
69 | string sec(right,'R'), third(left,'L');
| ^
In file included from /usr/include/c++/14/string:54,
from /usr/include/c++/14/bitset:52,
from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:52,
from a.cc:1:
/usr/include/c++/14/bits/basic_string.h:800:9: note: candidate: 'template<class _Tp, class> std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::basic_string(const _Tp&, const _Alloc&) [with <template-parameter-2-2> = _Tp; _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>]'
800 | basic_string(const _Tp& __t, const _Alloc& __a = _Alloc())
| ^~~~~~~~~~~~
/usr/include/c++/14/bits/basic_string.h:800:9: note: template argument deduction/substitution failed:
In file included from /usr/include/c++/14/bits/stl_pair.h:60,
from /usr/include/c++/14/bits/stl_algobase.h:64,
from /usr/include/c++/14/algorithm:60,
from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:51:
/usr/include/c++/14/type_traits: In substitution of 'template<bool _Cond, class _Tp> using std::enable_if_t = typename std::enable_if::type [with bool _Cond = false; _Tp = void]':
/usr/include/c++/14/bits/basic_string.h:149:8: required by substitution of 'template<class _CharT, class _Traits, class _Alloc> template<class _Tp, class _Res> using std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::_If_sv = std::enable_if_t<((bool)std::__and_<std::is_convertible<const _Tp&, std::basic_string_view<_CharT, _Traits> >, std::__not_<std::is_convertible<const _Tp*, const std::__cxx11::basic_string<_CharT, _Traits, _Alloc>*> >, std::__not_<std::is_convertible<const _Tp&, const _CharT*> > >::value), _Res> [with _Tp = std::ios_base&(std::ios_base&); _Res = void; _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>]'
149 | using _If_sv = enable_if_t<
| ^~~~~~
/usr/include/c++/14/bits/basic_string.h:797:30: required from here
797 | template<typename _Tp, typename = _If_sv<_Tp, void>>
| ^~~~~~~~
/usr/include/c++/14/type_traits:2711:11: error: no type named 'type' in 'struct std::enable_if<false, void>'
2711 | using enable_if_t = typename enable_if<_Cond, _Tp>::type;
| ^~~~~~~~~~~
/usr/include/c++/14/bits/basic_string.h:788:9: note: candidate: 'template<class _Tp, class> std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::basic_string(const _Tp&, size_type, size_type, const _Alloc&) [with <template-parameter-2-2> = _Tp; _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>]'
788 | basic_string(const _Tp& __t, size_type __pos, size_type __n,
| ^~~~~~~~~~~~
/usr/include/c++/14/bits/basic_string.h:788:9: note: candidate expects 3 arguments, 2 provided
/usr/include/c++/14/bits/basic_string.h:765:9: note: candidate: 'template<class _InputIterator, class> std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::basic_string(_InputIterator, _InputIterator, const _Alloc&) [with <template-parameter-2-2> = _InputIterator; _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>]'
765 | basic_string(_InputIterator __beg, _InputIterator __end,
| ^~~~~~~~~~~~
/usr/include/c++/14/bits/basic_string.h:765:9: note: template argument deduction/substitution failed:
a.cc:69:42: note: deduced conflicting types for parameter '_InputIterator' ('std::ios_base& (*)(std::ios_base&)' and 'char')
69 | string sec(right,'R'), third(left,'L');
| ^
/usr/include/c++/14/bits/basic_string.h:669:7: note: candidate: 'template<class> std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::basic_string(size_type, _CharT, const _Alloc&) [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>]'
669 | basic_string(size_type __n, _CharT __c, const _Alloc& __a = _Alloc())
| ^~~~~~~~~~~~
/usr/include/c++/14/bits/basic_string.h:669:7: note: template argument deduction/substitution failed:
a.cc:69:34: note: cannot convert 'std::left' (type 'std::ios_base&(std::ios_base&)') to type 'std::__cxx11::basic_string<char>::size_type' {aka 'long unsigned int'}
69 | string sec(right,'R'), third(left,'L');
| ^~~~
/usr/include/c++/14/bits/basic_string.h:646:7: note: candidate: 'template<class> std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::basic_string(const _CharT*, const _Alloc&) [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>]'
646 | basic_string(const _CharT* __s, const _Alloc& __a = _Alloc())
| ^~~~~~~~~~~~
/usr/include/c++/14/bits/basic_string.h:646:7: note: template argument deduction/substitution failed:
a.cc:69:34: note: cannot convert 'std::left' (type 'std::ios_base&(std::ios_base&)') to type 'const char*'
69 | string sec(right,'R'), third(left,'L');
| ^~~~
/usr/include/c++/14/bits/basic_string.h:721:7: note: candidate: 'std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::basic_string(std::__cxx11::basic_string<_CharT, _Traits, _Alloc>&&, const _Alloc&) [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>]'
721 | basic_string(basic_string&& __str, const _Alloc& __a)
| ^~~~~~~~~~~~
/usr/include/c++/14/bits/basic_string.h:721:35: note: no known conversion for argument 1 from 'std::ios_base&(std::ios_base&)' to 'std::__cxx11::basic_string<char>&&'
721 | basic_string(basic_string&& __str, const _Alloc& __a)
| ~~~~~~~~~~~~~~~^~~~~
/usr/include/c++/14/bits/basic_string.h:716:7: note: candidate: 'std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::basic_string(const std::__cxx11::basic_string<_CharT, _Traits, _Alloc>&, const _Alloc&) [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>]'
716 | basic_string(const basic_string& __str, const _Alloc& __a)
| ^~~~~~~~~~~~
/usr/include/c++/14/bits/basic_string.h:716:40: note: no known conversion for argument 1 from 'std::ios_base&(std::ios_base&)' to 'const std::__cxx11::basic_string<char>&'
716 | basic_string(const basic_string& __str, const _Alloc& __a)
| ~~~~~~~~~~~~~~~~~~~~^~~~~
/usr/include/c++/14/bits/basic_string.h:711:7: note: candidate: 'std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::basic_string(std::initializer_list<_Tp>, const _Alloc&) [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>]'
711 | basic_string(initializer_list<_CharT> __l, const _Alloc& __a = _Alloc())
| ^~~~~~~~~~~~
/usr/include/c++/14/bits/basic_string.h:711:45: note: no known conversion for argument 1 from 'std::ios_base&(std::ios_base&)' to 'std::initializer_list<char>'
711 | basic_string(initializer_list<_CharT> __l, const _Alloc& __a = _Alloc())
| ~~~~~~~~~~~~~~~~~~~~~~~~~^~~
/usr/include/c++/14/bits/basic_string.h:682:7: note: candidate: 'std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::basic_string(std::__cxx11::basic_string<_CharT, _Traits, _Alloc>&&) [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>]'
682 | basic_string(basic_string&& __str) noexcept
| ^~~~~~~~~~~~
/usr/include/c++/14/bits/basic_string.h:682:7: note: candidate expects 1 argument, 2 provided
/usr/include/c++/14/bits/basic_string.h:624:7: note: candidate: 'std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::basic_string(const _CharT*, size_type, const _Alloc&) [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>; size_type = long unsigned int]'
624 | basic_string(const _CharT* __s, size_type __n,
| ^~~~~~~~~~~~
/usr/include/c++/14/bits/basic_string.h:624:34: note: no known conversion for argument 1 from 'std::ios_base&(std::ios_base&)' to 'const char*'
624 | basic_string(const _CharT* __s, size_type __n,
| ~~~~~~~~~~~~~~^~~
/usr/include/c++/14/bits/basic_string.h:604:7: note: candidate: 'std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::basic_string(const std::__cxx11::basic_string<_CharT, _Traits, _Alloc>&, size_type, size_type, const _Alloc&) [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>; size_type = long unsigned int]'
604 | basic_string(const basic_string& __str, size_type __pos,
| ^~~~~~~~~~~~
/usr/include/c++/14/bits/basic_string.h:604:7: note: candidate expects 4 arguments, 2 provided
/usr/include/c++/14/bits/basic_string.h:586:7: note: candidate: 'std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::basic_string(const std::__cxx11::basic_string<_CharT, _Traits, _Alloc>&, size_type, size_type) [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>; size_type = long unsigned int]'
586 | basic_string(const basic_string& __str, size_type __pos,
| ^~~~~~~~~~~~
/usr/include/c++/14/bits/basic_string.h:586:7: note: candidate expects 3 arguments, 2 provided
/usr/include/c++/14/bits/basic_string.h:569:7: note: candidate: 'std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::basic_string(const std::__cxx11::basic_string<_CharT, _Traits, _Alloc>&, size_type, const _Alloc&) [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>; size_type = long unsigned int]'
569 | basic_string(const basic_string& __str, size_type __pos,
| ^~~~~~~~~~~~
/usr/include/c++/14/bits/basic_string.h:569:40: note: no known conversion for argument 1 from 'std::ios_base&(std::ios_base&)' to 'const std::__cxx11::basic_string<char>&'
569 | basic_string(const basic_string& __str, size_type __pos,
| ~~~~~~~~~~~~~~~~~~~~^~~~~
/usr/ |
s573885752 | p03836 | C++ | #include <bits/stdc++.h>
using namespace std;
#define rep(i,n) for(int i=0;i<n;i++)
int main(){
int sx,sy,ts,ty;
cin>>sx>>sy>>tx>>ty;
rep(i,ty-sy){
cout<<'U';
}
rep(i,tx-sx){
cout<<'R';
}
rep(i,ty-sy){
cout<<'D';
}
rep(i,tx-sx+1){
cout<<'L';
}
rep(i,ty-sy+1){
cout<<'U';
}
rep(i,tx-sx+1){
cout<<'R';
}
cout<<'D'<<'R';
rep(i,ty-sy+1){
cout<<'D';
}
rep(i,tx-sx+1){
cout<<'L';
}
cout<<'U'<<endl;
} | a.cc: In function 'int main()':
a.cc:6:16: error: 'tx' was not declared in this scope; did you mean 'ty'?
6 | cin>>sx>>sy>>tx>>ty;
| ^~
| ty
|
s606886284 | p03836 | Java | import java.util.*;
public class Main {
public static void main(String[] args) {
Scanner kbd = new Scanner(System.in);
int sx = kbd.nextInt();
int sy = kbd.nextInt();
int tx = kbd.nextInt();
int ty = kbd.nextInt();
int[] s = { sx, sy };
int[] t = { tx, ty };
// いちどめ
move(s, t);
move(t, s);
// にどめ
int[] s1 = { sx - 1, sy };
int[] t1 = { tx, ty + 1 };
move(s, s1);
move(s1, t1);
move(t1, t);
int[] s2 = { sx, sy - 1 };
int[] t2 = { tx + 1, ty };
move(t, t2);
move(t2, x2);
move(x2, x);
System.out.println();
}
static void move(int[] s, int[] t) {
moveX(s[0], t[0]);
moveY(s[1], t[1]);
}
static void moveX(int s, int t) {
if (s < t) {
for (int i = 0; i < t - s; i++) {
System.out.print("R");
}
} else if (s == t) {
return;
} else {
for (int j = s; j > t; j--) {
System.out.print("L");
}
}
return;
}
static void moveY(int s, int t) {
if (s < t) {
for (int i = 0; i < t - s; i++) {
System.out.print("U");
}
} else if (s == t) {
return;
} else {
for (int j = s; j > t; j--) {
System.out.print("D");
}
}
return;
}
} | Main.java:26: error: cannot find symbol
move(t2, x2);
^
symbol: variable x2
location: class Main
Main.java:27: error: cannot find symbol
move(x2, x);
^
symbol: variable x2
location: class Main
Main.java:27: error: cannot find symbol
move(x2, x);
^
symbol: variable x
location: class Main
3 errors
|
s794820503 | p03836 | Java | import java.util.*;
public class BackAndForth {
public static void main(String[] args) {
Scanner kbd = new Scanner(System.in);
int sx = kbd.nextInt();
int sy = kbd.nextInt();
int tx = kbd.nextInt();
int ty = kbd.nextInt();
int[] s = { sx, sy };
int[] t = { tx, ty };
// いちどめ
move(s, t);
move(t, s);
// にどめ
int[] s1 = { sx, sy - 1 };
int[] t1 = { tx + 1, ty };
System.out.print("D");
move(s1, t1);
System.out.print("L");
int[] t2 = { tx, ty + 1 };
int[] s2 = { sx - 1, sx };
System.out.print("U");
move(t2, s2);
System.out.println("R");
}
static void move(int[] s, int[] t) {
moveX(s[0], t[0]);
moveY(s[1], t[1]);
}
static void moveX(int s, int t) {
if (s < t) {
for (int i = 0; i < t - s; i++) {
System.out.print("R");
}
return;
} else {
for (int j = s; j > t; j--) {
System.out.print("L");
}
}
}
static void moveY(int s, int t) {
if (s < t) {
for (int i = 0; i < t - s; i++) {
System.out.print("U");
}
return;
} else {
for (int j = s; j > t; j--) {
System.out.print("D");
}
}
}
} | Main.java:3: error: class BackAndForth is public, should be declared in a file named BackAndForth.java
public class BackAndForth {
^
1 error
|
s459618073 | p03836 | C++ | #include<iostream>
#include<algorithm>
#include<cmath>
#include<vector>
#include<string>
#include<queue>
#include<set>
#include<map>
using namespace std;
typedef long long int ll;
typedef vector<pair<ll,ll> > Q;
typedef pair<int,int> P;
#define rep(i,n) for(int i=0;i<(int)(n);i++)
int main()
{
int sx,sy,tx,ty;
cin>>sx>>sy>>tx>>ty;
rep(i,tx-sx) cout<<'R';
rep(i,ty-sy) cout<<'U';
rep(i,tx-sx) cout<<'L';
rep(i,ty-sy) cout<<'D';
cout<<'D';
rep(i,tx-sx+1) cout<<'R';
rep(i,ty-sy+1) cout<<'U';
cout<<'L';
cout<<'U';
rep(i,tx-sx+1) cout<<'L';
rep(i,ty-sy+1) cout<<'D';
cout<<'R';
cout<<endl; | a.cc: In function 'int main()':
a.cc:36:14: error: expected '}' at end of input
36 | cout<<endl;
| ^
a.cc:16:1: note: to match this '{'
16 | {
| ^
|
s459280912 | p03836 | C++ | #include <iostream>
using namespace std;
int main(void) {
int sx, sy, gx, gy, i;
scanf_s("%d%d%d%d", &sx, &sy, &gx, &gy);
for (i = sy; i < gy; i++)
printf("U");
for (i = sx; i < gx; i++)
printf("R");
for (i = sy; i < gy; i++)
printf("D");
for (i = sx; i <= gx; i++)
printf("L");
for (i = sy; i <= gy; i++)
printf("U");
for (i = sx; i <= gx; i++)
printf("R");
printf("DR");
for (i = sy; i <= gy; i++)
printf("D");
for (i = sx; i <= gx; i++)
printf("L");
printf("U\n");
return 0;
} | a.cc: In function 'int main()':
a.cc:7:9: error: 'scanf_s' was not declared in this scope; did you mean 'scanf'?
7 | scanf_s("%d%d%d%d", &sx, &sy, &gx, &gy);
| ^~~~~~~
| scanf
|
s364203846 | p03836 | C++ | #include <bits/stdc++.h>
using namespace std;
using ll = long long;
int main(){
int sx,sy,tx,ty,x,y;
cin >> sx >> sy >> tx >> ty;
x=sx;y=sy;
while(y < ty){
cout << 'U';
y++;
}
while(x<tx){
cout << 'R';
x++;
}
while(sy<y){
cout << 'D';
y--;
}
while(sx-1<x){
cout << 'L';
x--;
}
while(y<ty+1){
cout << 'U';
y++;
}
while(x<tx){
cout << 'R';
x++;
}
y--;cout<<'D';
x++;cout<<'R';
while(sy-1<y){
cout << 'D';
y--;
}
cout << string(x-sx,L);
y++;cout << 'U'<<endl;
}
//string(文字数、中身)でstringを宣言できることを利用すると簡潔に書ける | a.cc: In function 'int main()':
a.cc:41:25: error: 'L' was not declared in this scope
41 | cout << string(x-sx,L);
| ^
|
s379847952 | p03836 | C++ | #include <bits/stdc++.h>
using namespace std;
using ll = long long;
int main(){
int sx,sy,tx,ty,x,y;
cin >> sx >> sy >> tx >> ty;
x=sx;y=sy;
while(y < ty){
cout << 'U';
y++;
}
while(x<tx){
cout << 'R';
x++;
}
while(sy<y){
cout << 'D';
y--;
}
while(sx-1<x){
cout << 'L';
x--;
}
while(y<ty+1){
cout << 'U';
y++;
}
while(x<tx){
cout << 'R';
x++;
}
y--;cout<<'D';
x++;cout<<'R';
while(sy-1<y){
cout << 'D';
y--;
}
cout << string(x-sx,L);
}
y++;cout << 'U'<<endl;
}
//string(文字数、中身)でstringを宣言できることを利用すると簡潔に書ける | a.cc: In function 'int main()':
a.cc:41:25: error: 'L' was not declared in this scope
41 | cout << string(x-sx,L);
| ^
a.cc: At global scope:
a.cc:43:5: error: 'y' does not name a type
43 | y++;cout << 'U'<<endl;
| ^
a.cc:43:9: error: 'cout' does not name a type
43 | y++;cout << 'U'<<endl;
| ^~~~
a.cc:44:1: error: expected declaration before '}' token
44 | }
| ^
|
s111442060 | p03836 | C++ | #include<iostream>
using namespace std;
int main(){
int sx,sy,tx,ty;
cin>>sx>>sy>>tx>>ty;
const int dx=tx-sx,dy=ty-sy;
// Path 1
cout << string(dy,"U") << string(dx,"R");
// Path 2
cout << string(dy,"D") << string(dx,"L");
// Path 3
cout << "L" << string(dy+1,"U") << string(dx+1,"R") << "D";
// Path 4
cout << "R" << string(dy+1,"D") << string(dx+1,"L") << "U";
cout<<endl;
}
| a.cc: In function 'int main()':
a.cc:10:22: error: no matching function for call to 'std::__cxx11::basic_string<char>::basic_string(const int&, const char [2])'
10 | cout << string(dy,"U") << string(dx,"R");
| ^
In file included 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/c++/14/bits/basic_string.h:624:7: note: candidate: 'std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::basic_string(const _CharT*, size_type, const _Alloc&) [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>; size_type = long unsigned int]' (near match)
624 | basic_string(const _CharT* __s, size_type __n,
| ^~~~~~~~~~~~
/usr/include/c++/14/bits/basic_string.h:624:7: note: conversion of argument 2 would be ill-formed:
a.cc:10:19: error: invalid conversion from 'const char*' to 'std::__cxx11::basic_string<char>::size_type' {aka 'long unsigned int'} [-fpermissive]
10 | cout << string(dy,"U") << string(dx,"R");
| ^~~
| |
| const char*
/usr/include/c++/14/bits/basic_string.h:800:9: note: candidate: 'template<class _Tp, class> std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::basic_string(const _Tp&, const _Alloc&) [with <template-parameter-2-2> = _Tp; _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>]'
800 | basic_string(const _Tp& __t, const _Alloc& __a = _Alloc())
| ^~~~~~~~~~~~
/usr/include/c++/14/bits/basic_string.h:800:9: note: template argument deduction/substitution failed:
In file included from /usr/include/c++/14/bits/move.h:37,
from /usr/include/c++/14/bits/exception_ptr.h:41,
from /usr/include/c++/14/exception:166,
from /usr/include/c++/14/ios:41:
/usr/include/c++/14/type_traits: In substitution of 'template<bool _Cond, class _Tp> using std::enable_if_t = typename std::enable_if::type [with bool _Cond = false; _Tp = void]':
/usr/include/c++/14/bits/basic_string.h:149:8: required by substitution of 'template<class _CharT, class _Traits, class _Alloc> template<class _Tp, class _Res> using std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::_If_sv = std::enable_if_t<((bool)std::__and_<std::is_convertible<const _Tp&, std::basic_string_view<_CharT, _Traits> >, std::__not_<std::is_convertible<const _Tp*, const std::__cxx11::basic_string<_CharT, _Traits, _Alloc>*> >, std::__not_<std::is_convertible<const _Tp&, const _CharT*> > >::value), _Res> [with _Tp = int; _Res = void; _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>]'
149 | using _If_sv = enable_if_t<
| ^~~~~~
/usr/include/c++/14/bits/basic_string.h:797:30: required from here
797 | template<typename _Tp, typename = _If_sv<_Tp, void>>
| ^~~~~~~~
/usr/include/c++/14/type_traits:2711:11: error: no type named 'type' in 'struct std::enable_if<false, void>'
2711 | using enable_if_t = typename enable_if<_Cond, _Tp>::type;
| ^~~~~~~~~~~
/usr/include/c++/14/bits/basic_string.h:788:9: note: candidate: 'template<class _Tp, class> std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::basic_string(const _Tp&, size_type, size_type, const _Alloc&) [with <template-parameter-2-2> = _Tp; _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>]'
788 | basic_string(const _Tp& __t, size_type __pos, size_type __n,
| ^~~~~~~~~~~~
/usr/include/c++/14/bits/basic_string.h:788:9: note: candidate expects 3 arguments, 2 provided
/usr/include/c++/14/bits/basic_string.h:765:9: note: candidate: 'template<class _InputIterator, class> std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::basic_string(_InputIterator, _InputIterator, const _Alloc&) [with <template-parameter-2-2> = _InputIterator; _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>]'
765 | basic_string(_InputIterator __beg, _InputIterator __end,
| ^~~~~~~~~~~~
/usr/include/c++/14/bits/basic_string.h:765:9: note: template argument deduction/substitution failed:
a.cc:10:22: note: deduced conflicting types for parameter '_InputIterator' ('int' and 'const char*')
10 | cout << string(dy,"U") << string(dx,"R");
| ^
/usr/include/c++/14/bits/basic_string.h:669:7: note: candidate: 'template<class> std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::basic_string(size_type, _CharT, const _Alloc&) [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>]'
669 | basic_string(size_type __n, _CharT __c, const _Alloc& __a = _Alloc())
| ^~~~~~~~~~~~
/usr/include/c++/14/bits/basic_string.h:669:7: note: template argument deduction/substitution failed:
a.cc:10:19: note: cannot convert '"U"' (type 'const char [2]') to type 'char'
10 | cout << string(dy,"U") << string(dx,"R");
| ^~~
/usr/include/c++/14/bits/basic_string.h:646:7: note: candidate: 'template<class> std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::basic_string(const _CharT*, const _Alloc&) [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>]'
646 | basic_string(const _CharT* __s, const _Alloc& __a = _Alloc())
| ^~~~~~~~~~~~
/usr/include/c++/14/bits/basic_string.h:646:7: note: template argument deduction/substitution failed:
a.cc:10:16: note: cannot convert 'dy' (type 'const int') to type 'const char*'
10 | cout << string(dy,"U") << string(dx,"R");
| ^~
/usr/include/c++/14/bits/basic_string.h:721:7: note: candidate: 'std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::basic_string(std::__cxx11::basic_string<_CharT, _Traits, _Alloc>&&, const _Alloc&) [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>]'
721 | basic_string(basic_string&& __str, const _Alloc& __a)
| ^~~~~~~~~~~~
/usr/include/c++/14/bits/basic_string.h:721:35: note: no known conversion for argument 1 from 'const int' to 'std::__cxx11::basic_string<char>&&'
721 | basic_string(basic_string&& __str, const _Alloc& __a)
| ~~~~~~~~~~~~~~~^~~~~
/usr/include/c++/14/bits/basic_string.h:716:7: note: candidate: 'std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::basic_string(const std::__cxx11::basic_string<_CharT, _Traits, _Alloc>&, const _Alloc&) [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>]'
716 | basic_string(const basic_string& __str, const _Alloc& __a)
| ^~~~~~~~~~~~
/usr/include/c++/14/bits/basic_string.h:716:40: note: no known conversion for argument 1 from 'const int' to 'const std::__cxx11::basic_string<char>&'
716 | basic_string(const basic_string& __str, const _Alloc& __a)
| ~~~~~~~~~~~~~~~~~~~~^~~~~
/usr/include/c++/14/bits/basic_string.h:711:7: note: candidate: 'std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::basic_string(std::initializer_list<_Tp>, const _Alloc&) [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>]'
711 | basic_string(initializer_list<_CharT> __l, const _Alloc& __a = _Alloc())
| ^~~~~~~~~~~~
/usr/include/c++/14/bits/basic_string.h:711:45: note: no known conversion for argument 1 from 'const int' to 'std::initializer_list<char>'
711 | basic_string(initializer_list<_CharT> __l, const _Alloc& __a = _Alloc())
| ~~~~~~~~~~~~~~~~~~~~~~~~~^~~
/usr/include/c++/14/bits/basic_string.h:682:7: note: candidate: 'std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::basic_string(std::__cxx11::basic_string<_CharT, _Traits, _Alloc>&&) [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>]'
682 | basic_string(basic_string&& __str) noexcept
| ^~~~~~~~~~~~
/usr/include/c++/14/bits/basic_string.h:682:7: note: candidate expects 1 argument, 2 provided
/usr/include/c++/14/bits/basic_string.h:604:7: note: candidate: 'std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::basic_string(const std::__cxx11::basic_string<_CharT, _Traits, _Alloc>&, size_type, size_type, const _Alloc&) [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>; size_type = long unsigned int]'
604 | basic_string(const basic_string& __str, size_type __pos,
| ^~~~~~~~~~~~
/usr/include/c++/14/bits/basic_string.h:604:7: note: candidate expects 4 arguments, 2 provided
/usr/include/c++/14/bits/basic_string.h:586:7: note: candidate: 'std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::basic_string(const std::__cxx11::basic_string<_CharT, _Traits, _Alloc>&, size_type, size_type) [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>; size_type = long unsigned int]'
586 | basic_string(const basic_string& __str, size_type __pos,
| ^~~~~~~~~~~~
/usr/include/c++/14/bits/basic_string.h:586:7: note: candidate expects 3 arguments, 2 provided
/usr/include/c++/14/bits/basic_string.h:569:7: note: candidate: 'std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::basic_string(const std::__cxx11::basic_string<_CharT, _Traits, _Alloc>&, size_type, const _Alloc&) [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>; size_type = long unsigned int]'
569 | basic_string(const basic_string& __str, size_type __pos,
| ^~~~~~~~~~~~
/usr/include/c++/14/bits/basic_string.h:569:40: note: no known conversion for argument 1 from 'const int' to 'const std::__cxx11::basic_string<char>&'
569 | basic_string(const basic_string& __str, size_type __pos,
| ~~~~~~~~~~~~~~~~~~~~^~~~~
/usr/include/c++/14/bits/basic_string.h:552:7: note: candidate: 'std::__ |
s981482132 | p03836 | C++ | #include<iostream>
using namespace std;
int main(){
int sx,sy,tx,ty;
cin>>sx>>sy>>tx>>ty;
const int dx=tx-sx,dy=ty-sy;
// Path 1
cout << string(dy,"U") << string(dx,"R");
// Path 2
cout << string(dy,"D") << string(dx,"L");
// Path 3
cout << "L" << string(dy+1,"U") << string(dx+1,"R") << "D";
// Path 4
cout << "R" << string(dy+1,"D") << string(dx+1,"L") << "U";
}
| a.cc: In function 'int main()':
a.cc:10:22: error: no matching function for call to 'std::__cxx11::basic_string<char>::basic_string(const int&, const char [2])'
10 | cout << string(dy,"U") << string(dx,"R");
| ^
In file included 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/c++/14/bits/basic_string.h:624:7: note: candidate: 'std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::basic_string(const _CharT*, size_type, const _Alloc&) [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>; size_type = long unsigned int]' (near match)
624 | basic_string(const _CharT* __s, size_type __n,
| ^~~~~~~~~~~~
/usr/include/c++/14/bits/basic_string.h:624:7: note: conversion of argument 2 would be ill-formed:
a.cc:10:19: error: invalid conversion from 'const char*' to 'std::__cxx11::basic_string<char>::size_type' {aka 'long unsigned int'} [-fpermissive]
10 | cout << string(dy,"U") << string(dx,"R");
| ^~~
| |
| const char*
/usr/include/c++/14/bits/basic_string.h:800:9: note: candidate: 'template<class _Tp, class> std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::basic_string(const _Tp&, const _Alloc&) [with <template-parameter-2-2> = _Tp; _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>]'
800 | basic_string(const _Tp& __t, const _Alloc& __a = _Alloc())
| ^~~~~~~~~~~~
/usr/include/c++/14/bits/basic_string.h:800:9: note: template argument deduction/substitution failed:
In file included from /usr/include/c++/14/bits/move.h:37,
from /usr/include/c++/14/bits/exception_ptr.h:41,
from /usr/include/c++/14/exception:166,
from /usr/include/c++/14/ios:41:
/usr/include/c++/14/type_traits: In substitution of 'template<bool _Cond, class _Tp> using std::enable_if_t = typename std::enable_if::type [with bool _Cond = false; _Tp = void]':
/usr/include/c++/14/bits/basic_string.h:149:8: required by substitution of 'template<class _CharT, class _Traits, class _Alloc> template<class _Tp, class _Res> using std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::_If_sv = std::enable_if_t<((bool)std::__and_<std::is_convertible<const _Tp&, std::basic_string_view<_CharT, _Traits> >, std::__not_<std::is_convertible<const _Tp*, const std::__cxx11::basic_string<_CharT, _Traits, _Alloc>*> >, std::__not_<std::is_convertible<const _Tp&, const _CharT*> > >::value), _Res> [with _Tp = int; _Res = void; _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>]'
149 | using _If_sv = enable_if_t<
| ^~~~~~
/usr/include/c++/14/bits/basic_string.h:797:30: required from here
797 | template<typename _Tp, typename = _If_sv<_Tp, void>>
| ^~~~~~~~
/usr/include/c++/14/type_traits:2711:11: error: no type named 'type' in 'struct std::enable_if<false, void>'
2711 | using enable_if_t = typename enable_if<_Cond, _Tp>::type;
| ^~~~~~~~~~~
/usr/include/c++/14/bits/basic_string.h:788:9: note: candidate: 'template<class _Tp, class> std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::basic_string(const _Tp&, size_type, size_type, const _Alloc&) [with <template-parameter-2-2> = _Tp; _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>]'
788 | basic_string(const _Tp& __t, size_type __pos, size_type __n,
| ^~~~~~~~~~~~
/usr/include/c++/14/bits/basic_string.h:788:9: note: candidate expects 3 arguments, 2 provided
/usr/include/c++/14/bits/basic_string.h:765:9: note: candidate: 'template<class _InputIterator, class> std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::basic_string(_InputIterator, _InputIterator, const _Alloc&) [with <template-parameter-2-2> = _InputIterator; _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>]'
765 | basic_string(_InputIterator __beg, _InputIterator __end,
| ^~~~~~~~~~~~
/usr/include/c++/14/bits/basic_string.h:765:9: note: template argument deduction/substitution failed:
a.cc:10:22: note: deduced conflicting types for parameter '_InputIterator' ('int' and 'const char*')
10 | cout << string(dy,"U") << string(dx,"R");
| ^
/usr/include/c++/14/bits/basic_string.h:669:7: note: candidate: 'template<class> std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::basic_string(size_type, _CharT, const _Alloc&) [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>]'
669 | basic_string(size_type __n, _CharT __c, const _Alloc& __a = _Alloc())
| ^~~~~~~~~~~~
/usr/include/c++/14/bits/basic_string.h:669:7: note: template argument deduction/substitution failed:
a.cc:10:19: note: cannot convert '"U"' (type 'const char [2]') to type 'char'
10 | cout << string(dy,"U") << string(dx,"R");
| ^~~
/usr/include/c++/14/bits/basic_string.h:646:7: note: candidate: 'template<class> std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::basic_string(const _CharT*, const _Alloc&) [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>]'
646 | basic_string(const _CharT* __s, const _Alloc& __a = _Alloc())
| ^~~~~~~~~~~~
/usr/include/c++/14/bits/basic_string.h:646:7: note: template argument deduction/substitution failed:
a.cc:10:16: note: cannot convert 'dy' (type 'const int') to type 'const char*'
10 | cout << string(dy,"U") << string(dx,"R");
| ^~
/usr/include/c++/14/bits/basic_string.h:721:7: note: candidate: 'std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::basic_string(std::__cxx11::basic_string<_CharT, _Traits, _Alloc>&&, const _Alloc&) [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>]'
721 | basic_string(basic_string&& __str, const _Alloc& __a)
| ^~~~~~~~~~~~
/usr/include/c++/14/bits/basic_string.h:721:35: note: no known conversion for argument 1 from 'const int' to 'std::__cxx11::basic_string<char>&&'
721 | basic_string(basic_string&& __str, const _Alloc& __a)
| ~~~~~~~~~~~~~~~^~~~~
/usr/include/c++/14/bits/basic_string.h:716:7: note: candidate: 'std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::basic_string(const std::__cxx11::basic_string<_CharT, _Traits, _Alloc>&, const _Alloc&) [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>]'
716 | basic_string(const basic_string& __str, const _Alloc& __a)
| ^~~~~~~~~~~~
/usr/include/c++/14/bits/basic_string.h:716:40: note: no known conversion for argument 1 from 'const int' to 'const std::__cxx11::basic_string<char>&'
716 | basic_string(const basic_string& __str, const _Alloc& __a)
| ~~~~~~~~~~~~~~~~~~~~^~~~~
/usr/include/c++/14/bits/basic_string.h:711:7: note: candidate: 'std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::basic_string(std::initializer_list<_Tp>, const _Alloc&) [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>]'
711 | basic_string(initializer_list<_CharT> __l, const _Alloc& __a = _Alloc())
| ^~~~~~~~~~~~
/usr/include/c++/14/bits/basic_string.h:711:45: note: no known conversion for argument 1 from 'const int' to 'std::initializer_list<char>'
711 | basic_string(initializer_list<_CharT> __l, const _Alloc& __a = _Alloc())
| ~~~~~~~~~~~~~~~~~~~~~~~~~^~~
/usr/include/c++/14/bits/basic_string.h:682:7: note: candidate: 'std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::basic_string(std::__cxx11::basic_string<_CharT, _Traits, _Alloc>&&) [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>]'
682 | basic_string(basic_string&& __str) noexcept
| ^~~~~~~~~~~~
/usr/include/c++/14/bits/basic_string.h:682:7: note: candidate expects 1 argument, 2 provided
/usr/include/c++/14/bits/basic_string.h:604:7: note: candidate: 'std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::basic_string(const std::__cxx11::basic_string<_CharT, _Traits, _Alloc>&, size_type, size_type, const _Alloc&) [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>; size_type = long unsigned int]'
604 | basic_string(const basic_string& __str, size_type __pos,
| ^~~~~~~~~~~~
/usr/include/c++/14/bits/basic_string.h:604:7: note: candidate expects 4 arguments, 2 provided
/usr/include/c++/14/bits/basic_string.h:586:7: note: candidate: 'std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::basic_string(const std::__cxx11::basic_string<_CharT, _Traits, _Alloc>&, size_type, size_type) [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>; size_type = long unsigned int]'
586 | basic_string(const basic_string& __str, size_type __pos,
| ^~~~~~~~~~~~
/usr/include/c++/14/bits/basic_string.h:586:7: note: candidate expects 3 arguments, 2 provided
/usr/include/c++/14/bits/basic_string.h:569:7: note: candidate: 'std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::basic_string(const std::__cxx11::basic_string<_CharT, _Traits, _Alloc>&, size_type, const _Alloc&) [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>; size_type = long unsigned int]'
569 | basic_string(const basic_string& __str, size_type __pos,
| ^~~~~~~~~~~~
/usr/include/c++/14/bits/basic_string.h:569:40: note: no known conversion for argument 1 from 'const int' to 'const std::__cxx11::basic_string<char>&'
569 | basic_string(const basic_string& __str, size_type __pos,
| ~~~~~~~~~~~~~~~~~~~~^~~~~
/usr/include/c++/14/bits/basic_string.h:552:7: note: candidate: 'std::__ |
s690869711 | p03836 | C++ | #include<iostream>
using namespace std;
int main(){
int sx,sy,tx,ty;
cin>>sx>>sy>>tx>>ty;
for(int i=0;i<tx-sx;i++){
cout<<"R"<<endl;
}
for(int i=0;<i<ty-sy;i++){
cout<<"U"<<endl;
}
for(int i=0;i<tx-sx;i++){
cout<<"L"<<endl;
}
for(int i=0;i<ty-sy;i++){
cout<<"D"<<endl;
}
cout<<"L"<<endl;
for(int i=0;i<ty-sy+1;i++){
cout<<"U"<<endl;
}
for(int i=0;i<tx-sx+1;i++){
cout<<"R"<<endl;
}
cout<<"D"<<endl;
cout<<"R"<<endl;
for(int i=0;i<ty-sy+1;i++){
cout<<"D"<<endl;
}
for(int i=0;i<tx-sx+1;i++){
cout<<"L"<<endl;
}
cout<<"U"<<endl;
} | a.cc: In function 'int main()':
a.cc:9:15: error: expected primary-expression before '<' token
9 | for(int i=0;<i<ty-sy;i++){
| ^
|
s295809196 | p03836 | C++ | #include<cstdio>
int main(){
int sx, sy, tx, tv;
scanf("%d %d %d %d", &sx, &sy, &tx, &tv);
tx -= sx, ty -= sy;
for (int i = 0; i < tx; ++i) printf("R");
for (int i = 0; i < ty + 1; ++i) printf("U");
for (int i = 0; i < tx + 1; ++i) printf("L");
for (int i = 0; i < ty + 1; ++i) printf("D");
printf("R");
for (int i = 0; i < ty; ++i) printf("U");
for (int i = 0; i < tx + 1; ++i) printf("R");
for (int i = 0; i < ty + 1; ++i) printf("D");
for (int i = 0; i < tx + 1; ++i) printf("L");
printf("U\n");
return 0;
} | a.cc: In function 'int main()':
a.cc:6:19: error: 'ty' was not declared in this scope; did you mean 'tv'?
6 | tx -= sx, ty -= sy;
| ^~
| tv
|
s231068272 | p03836 | C++ | #include <bits/stdc++.h>
using namespace std;
int main() {
cin >> sx >> sy >> tx >> ty ;
for (int i=0, i<tx-sx ; i++){
cout << R ;
}
for (int i=0, i<ty-sy ; i++){
cout << U ;
}
for (int i=0, i<tx-sx ; i++){
cout << L ;
}
for (int i=0, i<ty-sy+1 ; i++){
cout << D ;
}
for (int i=0, i<tx-sx+1 ; i++){
cout << R ;
}
for (int i=0, i<ty-sy+1 ; i++){
cout << U ;
}
cout << L << U;
for (int i=0, i<tx-sx+1 ; i++){
cout << L ;
}
for (int i=0, i<ty-sy+1 ; i++){
cout << D ;
}
cout << R << enddl;
}
| a.cc: In function 'int main()':
a.cc:5:10: error: 'sx' was not declared in this scope
5 | cin >> sx >> sy >> tx >> ty ;
| ^~
a.cc:5:16: error: 'sy' was not declared in this scope
5 | cin >> sx >> sy >> tx >> ty ;
| ^~
a.cc:5:22: error: 'tx' was not declared in this scope; did you mean 'tm'?
5 | cin >> sx >> sy >> tx >> ty ;
| ^~
| tm
a.cc:5:28: error: 'ty' was not declared in this scope; did you mean 'tm'?
5 | cin >> sx >> sy >> tx >> ty ;
| ^~
| tm
a.cc:6:18: error: expected ';' before '<' token
6 | for (int i=0, i<tx-sx ; i++){
| ^
| ;
a.cc:6:18: error: expected primary-expression before '<' token
a.cc:7:13: error: 'R' was not declared in this scope
7 | cout << R ;
| ^
a.cc:9:18: error: expected ';' before '<' token
9 | for (int i=0, i<ty-sy ; i++){
| ^
| ;
a.cc:9:18: error: expected primary-expression before '<' token
a.cc:10:13: error: 'U' was not declared in this scope
10 | cout << U ;
| ^
a.cc:12:18: error: expected ';' before '<' token
12 | for (int i=0, i<tx-sx ; i++){
| ^
| ;
a.cc:12:18: error: expected primary-expression before '<' token
a.cc:13:13: error: 'L' was not declared in this scope
13 | cout << L ;
| ^
a.cc:15:18: error: expected ';' before '<' token
15 | for (int i=0, i<ty-sy+1 ; i++){
| ^
| ;
a.cc:15:18: error: expected primary-expression before '<' token
a.cc:16:13: error: 'D' was not declared in this scope
16 | cout << D ;
| ^
a.cc:19:18: error: expected ';' before '<' token
19 | for (int i=0, i<tx-sx+1 ; i++){
| ^
| ;
a.cc:19:18: error: expected primary-expression before '<' token
a.cc:20:13: error: 'R' was not declared in this scope
20 | cout << R ;
| ^
a.cc:22:18: error: expected ';' before '<' token
22 | for (int i=0, i<ty-sy+1 ; i++){
| ^
| ;
a.cc:22:18: error: expected primary-expression before '<' token
a.cc:23:13: error: 'U' was not declared in this scope
23 | cout << U ;
| ^
a.cc:25:11: error: 'L' was not declared in this scope
25 | cout << L << U;
| ^
a.cc:25:16: error: 'U' was not declared in this scope
25 | cout << L << U;
| ^
a.cc:26:18: error: expected ';' before '<' token
26 | for (int i=0, i<tx-sx+1 ; i++){
| ^
| ;
a.cc:26:18: error: expected primary-expression before '<' token
a.cc:29:18: error: expected ';' before '<' token
29 | for (int i=0, i<ty-sy+1 ; i++){
| ^
| ;
a.cc:29:18: error: expected primary-expression before '<' token
a.cc:30:13: error: 'D' was not declared in this scope
30 | cout << D ;
| ^
a.cc:32:11: error: 'R' was not declared in this scope
32 | cout << R << enddl;
| ^
a.cc:32:16: error: 'enddl' was not declared in this scope
32 | cout << R << enddl;
| ^~~~~
|
s650483028 | p03836 | C++ | #include <bits/stdc++.h>
using namespace std;
int main(){
int sx, sy, tx, ty, i;
cin >> sx >> sy >> tx >> ty;
for(i=0; i<tx-sx; i++){
cout << 'R';
}
for(i=0; i<ty-tx; i++){
cout << 'U';
}
for(i=0; i<tx-sx; i++){
cout << 'L';
}
for(i=0; i<ty-tx; i++){
cout << 'D';
}
cout << 'D';
for(i=0; i<=tx-sx; i++){
cout << 'R';
}
for(i=0; i<=ty-tx; i++){
cout << 'U';
}
cout << 'L' << 'U'
for(i=0; i<tx-sx; i++){
cout << 'L';
}
for(i=0; i<ty-tx; i++){
cout << 'D';
}
cout << 'R';
return 0;
} | a.cc: In function 'int main()':
a.cc:26:23: error: expected ';' before 'for'
26 | cout << 'L' << 'U'
| ^
| ;
27 | for(i=0; i<tx-sx; i++){
| ~~~
a.cc:27:26: error: expected ';' before ')' token
27 | for(i=0; i<tx-sx; i++){
| ^
| ;
|
s173739202 | p03836 | C++ | dx[] = {0, 1, 0, -1};
int dy[] = {-1, 0, 1, 0};
/* テンプレここまで */
int sx, sy, tx, ty;
vector<vector<int>> visited(2010, vector<int>(2010, -1));
vector<pair<int, int>> goals;
int goal_idx = 1;
queue<pair<int, int>> pos_queue;
string ans(){
string ans_str = "";
int x = goals[goal_idx].first, y = goals[goal_idx].second;
while(x != goals[goal_idx-1].first || y != goals[goal_idx-1].second){
int min_val = 9999999, min_val_dir = -1;
for(int i = 0; i < 4; ++ i){
int mx = x + dx[i], my = y + dy[i];
if(0 <= mx && mx <= 2002 && 0 <= my && my <= 2002 && 0 <= visited[my][mx] && visited[my][mx] < min_val){
min_val = visited[my][mx];
min_val_dir = i;
}
}
x += dx[min_val_dir];
y += dy[min_val_dir];
visited[y][x] = 9999999;
ans_str += ("ULDR"[min_val_dir]);
}
rep(i, 2010){
rep(j, 2010){
if(visited[i][j] != 9999999) visited[i][j] = -1;
}
}
return ans_str;
}
int main(){
cin.tie(0);
ios::sync_with_stdio(false);
cin >> sx >> sy >> tx >> ty;
sx += 1001;
sy += 1001;
tx += 1001;
ty += 1001;
goals.emplace_back(sx, sy);
goals.emplace_back(tx, ty);
goals.emplace_back(sx, sy);
goals.emplace_back(tx, ty);
goals.emplace_back(sx, sy);
visited[sy][sx] = 0;
pos_queue.emplace(sx, sy);
while(goal_idx < 5){
int x = pos_queue.front().first, y = pos_queue.front().second;
pos_queue.pop();
if(x == goals[goal_idx].first && y == goals[goal_idx].second){
cout << ans();
visited[goals[goal_idx].second][goals[goal_idx].first] = 0;
visited[goals[min(4, goal_idx + 1)].second][goals[min(4, goal_idx + 1)].first] = -1;
queue<pair<int, int>> emp;
pos_queue = emp;
pos_queue.emplace(goals[goal_idx].first, goals[goal_idx].second);
++ goal_idx;
continue;
}
for(int i = 0; i < 4; ++ i){
int mx = x + dx[i], my = y + dy[i];
if(0 <= mx && mx <= 2002 && 0 <= my && my <= 2002 && visited[my][mx] == -1){
visited[my][mx] = visited[y][x] + 1;
pos_queue.push(make_pair(mx, my));
}
}
}
cout << endl;
} | a.cc:1:1: error: 'dx' does not name a type
1 | dx[] = {0, 1, 0, -1};
| ^~
a.cc:6:1: error: 'vector' does not name a type
6 | vector<vector<int>> visited(2010, vector<int>(2010, -1));
| ^~~~~~
a.cc:7:1: error: 'vector' does not name a type
7 | vector<pair<int, int>> goals;
| ^~~~~~
a.cc:9:1: error: 'queue' does not name a type
9 | queue<pair<int, int>> pos_queue;
| ^~~~~
a.cc:11:1: error: 'string' does not name a type
11 | string ans(){
| ^~~~~~
a.cc: In function 'int main()':
a.cc:39:5: error: 'cin' was not declared in this scope
39 | cin.tie(0);
| ^~~
a.cc:40:5: error: 'ios' has not been declared
40 | ios::sync_with_stdio(false);
| ^~~
a.cc:47:5: error: 'goals' was not declared in this scope
47 | goals.emplace_back(sx, sy);
| ^~~~~
a.cc:52:5: error: 'visited' was not declared in this scope
52 | visited[sy][sx] = 0;
| ^~~~~~~
a.cc:53:5: error: 'pos_queue' was not declared in this scope
53 | pos_queue.emplace(sx, sy);
| ^~~~~~~~~
a.cc:59:42: error: 'y' was not declared in this scope
59 | if(x == goals[goal_idx].first && y == goals[goal_idx].second){
| ^
a.cc:60:13: error: 'cout' was not declared in this scope
60 | cout << ans();
| ^~~~
a.cc:60:21: error: 'ans' was not declared in this scope
60 | cout << ans();
| ^~~
a.cc:62:27: error: 'min' was not declared in this scope; did you mean 'main'?
62 | visited[goals[min(4, goal_idx + 1)].second][goals[min(4, goal_idx + 1)].first] = -1;
| ^~~
| main
a.cc:63:13: error: 'queue' was not declared in this scope
63 | queue<pair<int, int>> emp;
| ^~~~~
a.cc:63:19: error: 'pair' was not declared in this scope
63 | queue<pair<int, int>> emp;
| ^~~~
a.cc:63:24: error: expected primary-expression before 'int'
63 | queue<pair<int, int>> emp;
| ^~~
a.cc:64:25: error: 'emp' was not declared in this scope
64 | pos_queue = emp;
| ^~~
a.cc:71:26: error: 'dx' was not declared in this scope; did you mean 'mx'?
71 | int mx = x + dx[i], my = y + dy[i];
| ^~
| mx
a.cc:72:46: error: 'my' was not declared in this scope; did you mean 'mx'?
72 | if(0 <= mx && mx <= 2002 && 0 <= my && my <= 2002 && visited[my][mx] == -1){
| ^~
| mx
a.cc:73:43: error: 'y' was not declared in this scope
73 | visited[my][mx] = visited[y][x] + 1;
| ^
a.cc:74:32: error: 'make_pair' was not declared in this scope
74 | pos_queue.push(make_pair(mx, my));
| ^~~~~~~~~
a.cc:79:5: error: 'cout' was not declared in this scope
79 | cout << endl;
| ^~~~
a.cc:79:13: error: 'endl' was not declared in this scope
79 | cout << endl;
| ^~~~
|
s368197846 | p03836 | C++ | #include <bits/stdc++.h>
using namespace std;
int main() {
int sx, sy, tx, ty;
cin >> sx >> sy >> tx >> ty;
int nx, ny;
nx = tx - sx;
ny = ty - sy;
for(int i = 0; i < nx; i++){
cout << "R";
}
for(int i = 0; i < ny; i++){
cout << "U";
}
for(int i = 0; i < nx; i++){
cout << "L";
}
for(int i = 0; i < ny; i++){
cout << "D";
}
cout << "D";
for(int i = 0; i <= nx; i++){
cout << "R";
}
for(int i = 0; i <= ny; i++){
cout << "U";
}
cout "LU";
for(int i = 0; i <= nx; i++){
cout << "L";
}
for(int i = 0; i <= ny; i++){
cout << "D";
}
cout << "R" << endl;
}
| a.cc: In function 'int main()':
a.cc:29:7: error: expected ';' before string constant
29 | cout "LU";
| ^~~~~
| ;
|
s789755228 | p03836 | C++ | #include <iostream>
#include <array>
#include <vector>
#include <iomanip>
#include <string>
#include <cmath>
#include <algorithm>
#include <queue>
#include <map>
#include <set>
using namespace std;
typedef pair<int,int> P;
typedef long long LL;
const LL INF=1<<31;
const LL MOD=1000000007;
int main(){
int sx,sy,tx,ty;
cin>>sx>>sy>>tx>>ty;
string ans;
string u,d,l,r;
for(int i=0;i<(tx-sx);++i){
u.push_back('U');
d.push_back('D');
}
for(int i=0;i<(ty-sy);++i){
l.push_back('L');
r.push_back('R');
}
ans+=u+r+d+l+'D'+r+'R'+u+'U'+'L'+'U'+l+'L'+d+'D'+r+'R'<<endl;
} | a.cc: In function 'int main()':
a.cc:34:60: error: no match for 'operator<<' (operand types are 'std::__cxx11::basic_string<char>' and '<unresolved overloaded function type>')
34 | ans+=u+r+d+l+'D'+r+'R'+u+'U'+'L'+'U'+l+'L'+d+'D'+r+'R'<<endl;
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~
In file included from /usr/include/c++/14/bits/basic_string.h:47,
from /usr/include/c++/14/string:54,
from /usr/include/c++/14/bits/locale_classes.h:40,
from /usr/include/c++/14/bits/ios_base.h:41,
from /usr/include/c++/14/ios:44,
from /usr/include/c++/14/ostream:40,
from /usr/include/c++/14/iostream:41,
from a.cc:1:
/usr/include/c++/14/string_view:763:5: note: candidate: 'template<class _CharT, class _Traits> std::basic_ostream<_CharT, _Traits>& std::operator<<(basic_ostream<_CharT, _Traits>&, basic_string_view<_CharT, _Traits>)'
763 | operator<<(basic_ostream<_CharT, _Traits>& __os,
| ^~~~~~~~
/usr/include/c++/14/string_view:763:5: note: template argument deduction/substitution failed:
a.cc:34:62: note: 'std::__cxx11::basic_string<char>' is not derived from 'std::basic_ostream<_CharT, _Traits>'
34 | ans+=u+r+d+l+'D'+r+'R'+u+'U'+'L'+'U'+l+'L'+d+'D'+r+'R'<<endl;
| ^~~~
/usr/include/c++/14/bits/basic_string.h:4077:5: note: candidate: 'template<class _CharT, class _Traits, class _Alloc> std::basic_ostream<_CharT, _Traits>& std::operator<<(basic_ostream<_CharT, _Traits>&, const __cxx11::basic_string<_CharT, _Traits, _Allocator>&)'
4077 | operator<<(basic_ostream<_CharT, _Traits>& __os,
| ^~~~~~~~
/usr/include/c++/14/bits/basic_string.h:4077:5: note: template argument deduction/substitution failed:
a.cc:34:62: note: 'std::__cxx11::basic_string<char>' is not derived from 'std::basic_ostream<_CharT, _Traits>'
34 | ans+=u+r+d+l+'D'+r+'R'+u+'U'+'L'+'U'+l+'L'+d+'D'+r+'R'<<endl;
| ^~~~
In file included from /usr/include/c++/14/bits/memory_resource.h:38,
from /usr/include/c++/14/string:68:
/usr/include/c++/14/cstddef:125:5: note: candidate: 'template<class _IntegerType> constexpr std::__byte_op_t<_IntegerType> std::operator<<(byte, _IntegerType)'
125 | operator<<(byte __b, _IntegerType __shift) noexcept
| ^~~~~~~~
/usr/include/c++/14/cstddef:125:5: note: template argument deduction/substitution failed:
a.cc:34:62: note: couldn't deduce template parameter '_IntegerType'
34 | ans+=u+r+d+l+'D'+r+'R'+u+'U'+'L'+'U'+l+'L'+d+'D'+r+'R'<<endl;
| ^~~~
In file included from /usr/include/c++/14/bits/ios_base.h:46:
/usr/include/c++/14/system_error:339:5: note: candidate: 'template<class _CharT, class _Traits> std::basic_ostream<_CharT, _Traits>& std::operator<<(basic_ostream<_CharT, _Traits>&, const error_code&)'
339 | operator<<(basic_ostream<_CharT, _Traits>& __os, const error_code& __e)
| ^~~~~~~~
/usr/include/c++/14/system_error:339:5: note: template argument deduction/substitution failed:
a.cc:34:62: note: 'std::__cxx11::basic_string<char>' is not derived from 'std::basic_ostream<_CharT, _Traits>'
34 | ans+=u+r+d+l+'D'+r+'R'+u+'U'+'L'+'U'+l+'L'+d+'D'+r+'R'<<endl;
| ^~~~
/usr/include/c++/14/ostream:563:5: note: candidate: 'template<class _CharT, class _Traits> std::basic_ostream<_CharT, _Traits>& std::operator<<(basic_ostream<_CharT, _Traits>&, _CharT)'
563 | operator<<(basic_ostream<_CharT, _Traits>& __out, _CharT __c)
| ^~~~~~~~
/usr/include/c++/14/ostream:563:5: note: template argument deduction/substitution failed:
a.cc:34:62: note: 'std::__cxx11::basic_string<char>' is not derived from 'std::basic_ostream<_CharT, _Traits>'
34 | ans+=u+r+d+l+'D'+r+'R'+u+'U'+'L'+'U'+l+'L'+d+'D'+r+'R'<<endl;
| ^~~~
/usr/include/c++/14/ostream:573:5: note: candidate: 'template<class _CharT, class _Traits> std::basic_ostream<_CharT, _Traits>& std::operator<<(basic_ostream<_CharT, _Traits>&, char)'
573 | operator<<(basic_ostream<_CharT, _Traits>& __out, char __c)
| ^~~~~~~~
/usr/include/c++/14/ostream:573:5: note: template argument deduction/substitution failed:
a.cc:34:62: note: 'std::__cxx11::basic_string<char>' is not derived from 'std::basic_ostream<_CharT, _Traits>'
34 | ans+=u+r+d+l+'D'+r+'R'+u+'U'+'L'+'U'+l+'L'+d+'D'+r+'R'<<endl;
| ^~~~
/usr/include/c++/14/ostream:579:5: note: candidate: 'template<class _Traits> std::basic_ostream<char, _Traits>& std::operator<<(basic_ostream<char, _Traits>&, char)'
579 | operator<<(basic_ostream<char, _Traits>& __out, char __c)
| ^~~~~~~~
/usr/include/c++/14/ostream:579:5: note: template argument deduction/substitution failed:
a.cc:34:62: note: 'std::__cxx11::basic_string<char>' is not derived from 'std::basic_ostream<char, _Traits>'
34 | ans+=u+r+d+l+'D'+r+'R'+u+'U'+'L'+'U'+l+'L'+d+'D'+r+'R'<<endl;
| ^~~~
/usr/include/c++/14/ostream:590:5: note: candidate: 'template<class _Traits> std::basic_ostream<char, _Traits>& std::operator<<(basic_ostream<char, _Traits>&, signed char)'
590 | operator<<(basic_ostream<char, _Traits>& __out, signed char __c)
| ^~~~~~~~
/usr/include/c++/14/ostream:590:5: note: template argument deduction/substitution failed:
a.cc:34:62: note: 'std::__cxx11::basic_string<char>' is not derived from 'std::basic_ostream<char, _Traits>'
34 | ans+=u+r+d+l+'D'+r+'R'+u+'U'+'L'+'U'+l+'L'+d+'D'+r+'R'<<endl;
| ^~~~
/usr/include/c++/14/ostream:595:5: note: candidate: 'template<class _Traits> std::basic_ostream<char, _Traits>& std::operator<<(basic_ostream<char, _Traits>&, unsigned char)'
595 | operator<<(basic_ostream<char, _Traits>& __out, unsigned char __c)
| ^~~~~~~~
/usr/include/c++/14/ostream:595:5: note: template argument deduction/substitution failed:
a.cc:34:62: note: 'std::__cxx11::basic_string<char>' is not derived from 'std::basic_ostream<char, _Traits>'
34 | ans+=u+r+d+l+'D'+r+'R'+u+'U'+'L'+'U'+l+'L'+d+'D'+r+'R'<<endl;
| ^~~~
/usr/include/c++/14/ostream:654:5: note: candidate: 'template<class _CharT, class _Traits> std::basic_ostream<_CharT, _Traits>& std::operator<<(basic_ostream<_CharT, _Traits>&, const _CharT*)'
654 | operator<<(basic_ostream<_CharT, _Traits>& __out, const _CharT* __s)
| ^~~~~~~~
/usr/include/c++/14/ostream:654:5: note: template argument deduction/substitution failed:
a.cc:34:62: note: 'std::__cxx11::basic_string<char>' is not derived from 'std::basic_ostream<_CharT, _Traits>'
34 | ans+=u+r+d+l+'D'+r+'R'+u+'U'+'L'+'U'+l+'L'+d+'D'+r+'R'<<endl;
| ^~~~
In file included from /usr/include/c++/14/ostream:1022:
/usr/include/c++/14/bits/ostream.tcc:307:5: note: candidate: 'template<class _CharT, class _Traits> std::basic_ostream<_CharT, _Traits>& std::operator<<(basic_ostream<_CharT, _Traits>&, const char*)'
307 | operator<<(basic_ostream<_CharT, _Traits>& __out, const char* __s)
| ^~~~~~~~
/usr/include/c++/14/bits/ostream.tcc:307:5: note: template argument deduction/substitution failed:
a.cc:34:62: note: 'std::__cxx11::basic_string<char>' is not derived from 'std::basic_ostream<_CharT, _Traits>'
34 | ans+=u+r+d+l+'D'+r+'R'+u+'U'+'L'+'U'+l+'L'+d+'D'+r+'R'<<endl;
| ^~~~
/usr/include/c++/14/ostream:671:5: note: candidate: 'template<class _Traits> std::basic_ostream<char, _Traits>& std::operator<<(basic_ostream<char, _Traits>&, const char*)'
671 | operator<<(basic_ostream<char, _Traits>& __out, const char* __s)
| ^~~~~~~~
/usr/include/c++/14/ostream:671:5: note: template argument deduction/substitution failed:
a.cc:34:62: note: 'std::__cxx11::basic_string<char>' is not derived from 'std::basic_ostream<char, _Traits>'
34 | ans+=u+r+d+l+'D'+r+'R'+u+'U'+'L'+'U'+l+'L'+d+'D'+r+'R'<<endl;
| ^~~~
/usr/include/c++/14/ostream:684:5: note: candidate: 'template<class _Traits> std::basic_ostream<char, _Traits>& std::operator<<(basic_ostream<char, _Traits>&, const signed char*)'
684 | operator<<(basic_ostream<char, _Traits>& __out, const signed char* __s)
| ^~~~~~~~
/usr/include/c++/14/ostream:684:5: note: template argument deduction/substitution failed:
a.cc:34:62: note: 'std::__cxx11::basic_string<char>' is not derived from 'std::basic_ostream<char, _Traits>'
34 | ans+=u+r+d+l+'D'+r+'R'+u+'U'+'L'+'U'+l+'L'+d+'D'+r+'R'<<endl;
| ^~~~
/usr/include/c++/14/ostream:689:5: note: candidate: 'template<class _Traits> std::basic_ostream<char, _Traits>& std::operator<<(basic_ostream<char, _Traits>&, const unsigned char*)'
689 | operator<<(basic_ostream<char, _Traits>& __out, const unsigned char* __s)
| ^~~~~~~~
/usr/include/c++/14/ostream:689:5: note: template argument deduction/substitution failed:
a.cc:34:62: note: 'std::__cxx11::basic_string<char>' is not derived from 'std::basic_ostream<char, _Traits>'
34 | ans+=u+r+d+l+'D'+r+'R'+u+'U'+'L'+'U'+l+'L'+d+'D'+r+'R'<<endl;
| ^~~~
/usr/include/c++/14/ostream:810:5: note: candidate: 'template<class _Ostream, class _Tp> _Ostream&& std::operator<<(_Ostream&&, const _Tp&)'
810 | operator<<(_Ostream&& __os, const _Tp& __x)
| ^~~~~~~~
/usr/include/c++/14/ostream:810:5: note: template argument deduction/substitution faile |
s622985688 | p03836 | C++ | #include <stdio.h>
#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define ld long double
#define P pair<ll,ll>
#define FOR(i,n,m) for(ll i=n; i<(ll)m;i++)
#define FORr(i,n,m) for(ll i=n; i>=(ll)m; i--)
#define FORm(i,m) for(auto i=m.begin();i!=m.end();i++)
#define VEC2(x,a,b) vector<vector<ll>> x = vector<vector<ll>>(a,vector<ll>(b,0))
#define sortAl(v) sort(v.begin(),v.end())
#define sortAlr(v) sort(v.begin(),v.end()); reverse(v.begin(),v.end())
#define cinv(v,n,m) FOR(i,n,m) cin>>v.at(i)
#define coutv(v,n,m) FOR(i,n,m) cout<<v.at(i) <<" "; cout<<endl
#define cout(n) cout<<fixed<<setprecision(n)
int main(){
cin.tie(0);
ios::sync_with_stdio(false);
ll sx,sy,tx,ty;
cin>>sx>>sy>>tx>>ty;
ll x = tx-sx;
ll y = ty-sy;
FOR(i,0,y){
cout<<"U";
}
FOR(i,0,x){
cout<<"R";
}
FOR(i,0,y){
cout<<"D";
}
FOR(i,0,x){
cout<<"L";
}
cout<<"L";
FOR(i,0,y+1){
cout<<"U";
}
FOR(i,0,x+1){
cout<<"R";
}
cout<<"DR";
FOR(i,0,y+1){
cout<<"D";
}
FOR(i,0,x+1){
cout<<"L";
}
cout<<"U"endl;
}
| a.cc: In function 'int main()':
a.cc:52:11: error: unable to find string literal operator 'operator""endl' with 'const char [2]', 'long unsigned int' arguments
52 | cout<<"U"endl;
| ^~~~~~~
|
s664669587 | p03836 | C | #include <stdio.h>
int main(void){
int x,y,sx,sy,tx,ty,i;
x=tx-sx:
y=ty-sy;
for(i=0;i<y;i++);
printf("U");
for(i=0;i<x;i++);
printf("R");
for(i=0;i<y;i++);
printf("D");
for(i=0;i<=x;i++);
printf("L");
for(i=0;i<=y;i++);
printf("U");
for(i=0;i<=x;i++);
printf("R");
printf("DR");
for(i=0;i<=y;i++);
printf("D");
for(i=0;i<=x;i++);
printf("L");
printf("U");
return 0;
} | main.c: In function 'main':
main.c:4:10: error: expected ';' before ':' token
4 | x=tx-sx:
| ^
| ;
|
s711767720 | p03836 | C++ | #include<bits/stdc++.h>
int main(void){
int sx, sy, tx, ty;
cin >> sx >> sy >> tx >> ty;
for(int i=0;i<tx-sx;++i){
cout << "U";
}
for(int i=0;i<ty-sy;++i){
cout << "R";
}
for(int i=0;i<tx-sx;++i){
cout << "D";
}
for(int i=0;i<=ty-sy;++i){
cout << "L";
}
for(int i=0;i<=tx-sx;++i){
cout << "U";
}
for(int i=0;i<=ty-sy;++i){
cout << "R";
}
cout << "DR";
for(int i=0;i<=tx-sx;++i){
cout << "D";
}
for(int i=0;i<=ty-sy;++i){
cout << "L";
}
cout << "U" << endl;
}
| a.cc: In function 'int main()':
a.cc:5:3: error: 'cin' was not declared in this scope; did you mean 'std::cin'?
5 | cin >> sx >> sy >> tx >> ty;
| ^~~
| std::cin
In file included from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:146,
from a.cc:1:
/usr/include/c++/14/iostream:62:18: note: 'std::cin' declared here
62 | extern istream cin; ///< Linked to standard input
| ^~~
a.cc:7:5: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
7 | cout << "U";
| ^~~~
| std::cout
/usr/include/c++/14/iostream:63:18: note: 'std::cout' declared here
63 | extern ostream cout; ///< Linked to standard output
| ^~~~
a.cc:10:5: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
10 | cout << "R";
| ^~~~
| std::cout
/usr/include/c++/14/iostream:63:18: note: 'std::cout' declared here
63 | extern ostream cout; ///< Linked to standard output
| ^~~~
a.cc:13:5: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
13 | cout << "D";
| ^~~~
| std::cout
/usr/include/c++/14/iostream:63:18: note: 'std::cout' declared here
63 | extern ostream cout; ///< Linked to standard output
| ^~~~
a.cc:16:5: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
16 | cout << "L";
| ^~~~
| 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:5: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
19 | cout << "U";
| ^~~~
| std::cout
/usr/include/c++/14/iostream:63:18: note: 'std::cout' declared here
63 | extern ostream cout; ///< Linked to standard output
| ^~~~
a.cc:22:5: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
22 | cout << "R";
| ^~~~
| std::cout
/usr/include/c++/14/iostream:63:18: note: 'std::cout' declared here
63 | extern ostream cout; ///< Linked to standard output
| ^~~~
a.cc:24:3: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
24 | cout << "DR";
| ^~~~
| std::cout
/usr/include/c++/14/iostream:63:18: note: 'std::cout' declared here
63 | extern ostream cout; ///< Linked to standard output
| ^~~~
a.cc:31:18: error: 'endl' was not declared in this scope; did you mean 'std::endl'?
31 | cout << "U" << endl;
| ^~~~
| std::endl
In file included from /usr/include/c++/14/istream:41,
from /usr/include/c++/14/sstream:40,
from /usr/include/c++/14/complex:45,
from /usr/include/c++/14/ccomplex:39,
from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:127:
/usr/include/c++/14/ostream:744:5: note: 'std::endl' declared here
744 | endl(basic_ostream<_CharT, _Traits>& __os)
| ^~~~
|
s348786868 | p03836 | C++ | #include<bits/stdc++.h>
using namespace std;
int main()
{
int sx,sy,tx,ty;
cin>>sx>>sy>>tx>>ty;
int y=ty-sy;
int x=tx-sx;
for(int i=0;i<y;i++)
cout<<'U';
for(int i=0;i<x;i++)
cout<<'R';
for(int i=0;i<y;i++)
cout<<'D';
for(int i=0;i<x;i++)
cout<<'L';
cout<<'L';
for(int i=0;i<y+1;i++)
cout<<'U';
for(int i=0;i<x+1;i++)
cout<<'R';
cout<<'D';
cout<<'R';
for(int i=0;i<y+1;i++)
cout<<'D';
for(int i=0;i<x+10 0 1 2;i++)
cout<<'L';
cout<<'U';
} | a.cc: In function 'int main()':
a.cc:26:27: error: expected ';' before numeric constant
26 | for(int i=0;i<x+10 0 1 2;i++)
| ^~
| ;
a.cc:26:29: error: expected ')' before numeric constant
26 | for(int i=0;i<x+10 0 1 2;i++)
| ~ ^~
| )
a.cc:26:31: error: expected ';' before numeric constant
26 | for(int i=0;i<x+10 0 1 2;i++)
| ^~
| ;
a.cc:26:34: error: 'i' was not declared in this scope
26 | for(int i=0;i<x+10 0 1 2;i++)
| ^
|
s102795870 | p03836 | C++ | #include<bits/stdc++.h>
using namespace std;
int main(){
int sx,sy,tx,ty;
cin>>sx>>sy>>tx>>ty;
int dx=ts-sx;
int dy=ty-sy;
cout<<string(dy,'U')<<string(dx,'R');
cout<<string(dy,'D')<<string(dx,'L');
cout<<"L"<<string(dy+1,'U')<<string(dx+1,'R')<<'D';
cout<<'R'<<string(dy+1,'D')<<string(dx+1,'L')<<'U';
return 0;
}
| a.cc: In function 'int main()':
a.cc:6:16: error: 'ts' was not declared in this scope; did you mean 'ty'?
6 | int dx=ts-sx;
| ^~
| ty
|
s270312780 | p03836 | C++ | using namespace std;
typedef long long ll;
typedef unsigned long long ull;
int main(){
int i,s1,s2,t1,t2;
cin>>s1>>s2>>t1>>t2;
for(i=1;i<=t2-s2;i++) cout<<"U";
for(i=1;i<=t1-s1;i++) cout<<"R";
for(i=1;i<=t2-s2;i++) cout<<"D";
for(i=1;i<=t1-s1;i++) cout<<"L";
cout<<"L";
for(i=1;i<=t2-s2+1;i++) cout<<"U";
for(i=1;i<=t1-s1+1;i++) cout<<"R";
cout<<"D";
cout<<"U";
for(i=1;i<=t2-s2+1;i++) cout<<"D";
for(i=1;i<=t1-s1+1;i++) cout<<"L";
cout<<"R";
return 0;
}
| a.cc: In function 'int main()':
a.cc:6:9: error: 'cin' was not declared in this scope
6 | cin>>s1>>s2>>t1>>t2;
| ^~~
a.cc:1:1: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
+++ |+#include <iostream>
1 | using namespace std;
a.cc:7:32: error: 'cout' was not declared in this scope
7 | for(i=1;i<=t2-s2;i++) cout<<"U";
| ^~~~
a.cc:7:32: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
a.cc:8:31: error: 'cout' was not declared in this scope
8 | for(i=1;i<=t1-s1;i++) cout<<"R";
| ^~~~
a.cc:8:31: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
a.cc:9:32: error: 'cout' was not declared in this scope
9 | for(i=1;i<=t2-s2;i++) cout<<"D";
| ^~~~
a.cc:9:32: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
a.cc:10:31: error: 'cout' was not declared in this scope
10 | for(i=1;i<=t1-s1;i++) cout<<"L";
| ^~~~
a.cc:10:31: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
a.cc:11:9: error: 'cout' was not declared in this scope
11 | cout<<"L";
| ^~~~
a.cc:11:9: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
|
s925970151 | p03836 | C++ | sx, sy, tx, ty = map(int, input().split())
ans = ""
for i in range(ty-sy):
ans += "U"
for i in range(tx-sx):
ans += "R"
for i in range(ty-sy):
ans += "D"
for i in range(tx-sx):
ans += "L"
ans += "L"
for i in range(ty-sy+1):
ans += "U"
for i in range(tx-sx+1):
ans += "R"
ans += "D"
for i in range(ty-sy+1):
ans += "D"
for i in range(tx-sx+1):
ans += "L"
ans += "U"
print(ans) | a.cc:1:1: error: 'sx' does not name a type
1 | sx, sy, tx, ty = map(int, input().split())
| ^~
|
s372024303 | p03836 | C++ | int main(){
int sx,sy,tx,ty;
cin >> sx >> sy >> tx >> ty;
for(int i = sx;i < tx;i++) cout << 'R';
for(int i = sy;i < ty;i++) cout << 'U';
for(int i = sx;i < tx;i++) cout << 'L';
for(int i = sy;i < ty;i++) cout << 'D';
cout << 'D';
for(int i = sx;i < tx+1;i++) cout << 'R';
for(int i = sy;i < ty+1;i++) cout << 'U';
cout << 'L';
cout << 'U';
for(int i = sx;i < tx+1;i++) cout << 'L';
for(int i = sy;i < ty+1;i++) cout << 'D';
cout << 'R';
cout << endl;
return 0;
} | a.cc: In function 'int main()':
a.cc:3:3: error: 'cin' was not declared in this scope
3 | cin >> sx >> sy >> tx >> ty;
| ^~~
a.cc:6:30: error: 'cout' was not declared in this scope
6 | for(int i = sx;i < tx;i++) cout << 'R';
| ^~~~
a.cc:7:30: error: 'cout' was not declared in this scope
7 | for(int i = sy;i < ty;i++) cout << 'U';
| ^~~~
a.cc:8:30: error: 'cout' was not declared in this scope
8 | for(int i = sx;i < tx;i++) cout << 'L';
| ^~~~
a.cc:9:30: error: 'cout' was not declared in this scope
9 | for(int i = sy;i < ty;i++) cout << 'D';
| ^~~~
a.cc:10:3: error: 'cout' was not declared in this scope
10 | cout << 'D';
| ^~~~
a.cc:18:11: error: 'endl' was not declared in this scope
18 | cout << endl;
| ^~~~
|
s016949480 | p03836 | C | #include<stdio.h>
int main(void){
int i; //for loop
int sx,sy,tx,ty; //for input
int dx,dy; //different
err=scanf("%d",&sx);
if(err==EOF){return 0;}
err=scanf("%d",&sy);
if(err==EOF){return 0;}
err=scanf("%d",&tx);
if(err==EOF){return 0;}
err=scanf("%d",&ty);
if(err==EOF){return 0;}
dx=tx-sx;
dy=ty-sy;
for(i=0;i<dy;i++){printf("U");}
for(i=0;i<dx;i++){printf("R");}
for(i=0;i<dy;i++){printf("D");}
for(i=0;i<dx;i++){printf("L");}
printf("L");
for(i=0;i<dy+1;i++){printf("U");}
for(i=0;i<dx+1;i++){printf("R");}
printf("D");
printf("R");
for(i=0;i<dy+1;i++){printf("D");}
for(i=0;i<dx+1;i++){printf("L");}
printf("U\n");
return 0;
}
| main.c: In function 'main':
main.c:8:3: error: 'err' undeclared (first use in this function)
8 | err=scanf("%d",&sx);
| ^~~
main.c:8:3: note: each undeclared identifier is reported only once for each function it appears in
|
s969902017 | p03836 | C | #include<itdio.h>
int main(void){
int i; //for loop
int sx,sy,tx,ty; //for input
int dx,dy; //different
err=scanf("%d",&sx);
if(err==EOF){return 0;}
err=scanf("%d",&sy);
if(err==EOF){return 0;}
err=scanf("%d",&tx);
if(err==EOF){return 0;}
err=scanf("%d",&ty);
if(err==EOF){return 0;}
dx=tx-sx;
dy=ty-sy;
for(i=0;i<dy;i++){printf("U");}
for(i=0;i<dx;i++){printf("R");}
for(i=0;i<dy;i++){printf("D");}
for(i=0;i<dx;i++){printf("L");}
printf("L");
for(i=0;i<dy+1;i++){printf("U");}
for(i=0;i<dx+1;i++){printf("R");}
printf("D");
printf("R");
for(i=0;i<dy+1;i++){printf("D");}
for(i=0;i<dx+1;i++){printf("L");}
printf("U\n");
return 0;
} | main.c:1:9: fatal error: itdio.h: No such file or directory
1 | #include<itdio.h>
| ^~~~~~~~~
compilation terminated.
|
s190986589 | p03836 | C | #include<stdio.h>
int main(void){
int i; //for loop
int sx,sy,tx,ty; //for input
int dx,dy; //different
err=scanf("%d",&sx);
err=scanf("%d",&sy);
err=scanf("%d",&tx);
err=scanf("%d",&ty);
if(err==EOF){return 1;}
dx=tx-sx;
dy=ty-sy;
for(i=0;i<dy;i++){printf("U");}
for(i=0;i<dx;i++){printf("R");}
for(i=0;i<dy;i++){printf("D");}
for(i=0;i<dx;i++){printf("L");}
printf("L");
for(i=0;i<dy+1;i++){printf("U");}
for(i=0;i<dx+1;i++){printf("R");}
printf("D");
printf("R");
for(i=0;i<dy+1;i++){printf("D");}
for(i=0;i<dx+1;i++){printf("L");}
printf("U\n");
return 0;
} | main.c: In function 'main':
main.c:8:3: error: 'err' undeclared (first use in this function)
8 | err=scanf("%d",&sx);
| ^~~
main.c:8:3: note: each undeclared identifier is reported only once for each function it appears in
|
s762216905 | p03836 | C | #include<stdio.h>
int main(void){
int i; //for loop
int sx,sy,tx,ty; //for input
int dx,dy; //different
err=scanf("%d",&sx);
err=scanf("%d",&sy);
err=scanf("%d",&tx);
err=scanf("%d",&ty);
dx=tx-sx;
dy=ty-sy;
for(i=0;i<dy;i++){printf("U");}
for(i=0;i<dx;i++){printf("R");}
for(i=0;i<dy;i++){printf("D");}
for(i=0;i<dx;i++){printf("L");}
printf("L");
for(i=0;i<dy+1;i++){printf("U");}
for(i=0;i<dx+1;i++){printf("R");}
printf("D");
printf("R");
for(i=0;i<dy+1;i++){printf("D");}
for(i=0;i<dx+1;i++){printf("L");}
printf("U\n");
return 0;
} | main.c: In function 'main':
main.c:8:3: error: 'err' undeclared (first use in this function)
8 | err=scanf("%d",&sx);
| ^~~
main.c:8:3: note: each undeclared identifier is reported only once for each function it appears in
|
s615794221 | p03836 | C++ | #include <iostream>
#include <cstring>
using namespace std;
int main(void){
int sx, sy, tx, ty;
cin >> sx >> sy >> tx >> ty;
for (int i = sy, i < ty, i++) cout << "U";
for (int i = sx, i < tx, i++) cout << "R";
for (int i = ty, i > sy, i++) cout << "D";
for (int i = tx, i > sx, i++) cout << "L";
cout << "L";
for (int i = sy, i <= ty, i++) cout << "U";
for (int i = sx, i <= tx, i++) cout << "R";
cout << "DR";
for (int i = ty, i >= sy, i++) cout << "D";
for (int i = tx, i >= sx, i++) cout << "L";
cout << "U";
return 0;
}
| a.cc: In function 'int main()':
a.cc:8:23: error: expected ';' before '<' token
8 | for (int i = sy, i < ty, i++) cout << "U";
| ^~
| ;
a.cc:8:24: error: expected primary-expression before '<' token
8 | for (int i = sy, i < ty, i++) cout << "U";
| ^
a.cc:8:33: error: expected ';' before ')' token
8 | for (int i = sy, i < ty, i++) cout << "U";
| ^
| ;
a.cc:9:23: error: expected ';' before '<' token
9 | for (int i = sx, i < tx, i++) cout << "R";
| ^~
| ;
a.cc:9:24: error: expected primary-expression before '<' token
9 | for (int i = sx, i < tx, i++) cout << "R";
| ^
a.cc:9:33: error: expected ';' before ')' token
9 | for (int i = sx, i < tx, i++) cout << "R";
| ^
| ;
a.cc:10:23: error: expected ';' before '>' token
10 | for (int i = ty, i > sy, i++) cout << "D";
| ^~
| ;
a.cc:10:24: error: expected primary-expression before '>' token
10 | for (int i = ty, i > sy, i++) cout << "D";
| ^
a.cc:10:33: error: expected ';' before ')' token
10 | for (int i = ty, i > sy, i++) cout << "D";
| ^
| ;
a.cc:11:23: error: expected ';' before '>' token
11 | for (int i = tx, i > sx, i++) cout << "L";
| ^~
| ;
a.cc:11:24: error: expected primary-expression before '>' token
11 | for (int i = tx, i > sx, i++) cout << "L";
| ^
a.cc:11:33: error: expected ';' before ')' token
11 | for (int i = tx, i > sx, i++) cout << "L";
| ^
| ;
a.cc:13:23: error: expected ';' before '<=' token
13 | for (int i = sy, i <= ty, i++) cout << "U";
| ^~~
| ;
a.cc:13:24: error: expected primary-expression before '<=' token
13 | for (int i = sy, i <= ty, i++) cout << "U";
| ^~
a.cc:13:34: error: expected ';' before ')' token
13 | for (int i = sy, i <= ty, i++) cout << "U";
| ^
| ;
a.cc:14:23: error: expected ';' before '<=' token
14 | for (int i = sx, i <= tx, i++) cout << "R";
| ^~~
| ;
a.cc:14:24: error: expected primary-expression before '<=' token
14 | for (int i = sx, i <= tx, i++) cout << "R";
| ^~
a.cc:14:34: error: expected ';' before ')' token
14 | for (int i = sx, i <= tx, i++) cout << "R";
| ^
| ;
a.cc:16:23: error: expected ';' before '>=' token
16 | for (int i = ty, i >= sy, i++) cout << "D";
| ^~~
| ;
a.cc:16:24: error: expected primary-expression before '>=' token
16 | for (int i = ty, i >= sy, i++) cout << "D";
| ^~
a.cc:16:34: error: expected ';' before ')' token
16 | for (int i = ty, i >= sy, i++) cout << "D";
| ^
| ;
a.cc:17:23: error: expected ';' before '>=' token
17 | for (int i = tx, i >= sx, i++) cout << "L";
| ^~~
| ;
a.cc:17:24: error: expected primary-expression before '>=' token
17 | for (int i = tx, i >= sx, i++) cout << "L";
| ^~
a.cc:17:34: error: expected ';' before ')' token
17 | for (int i = tx, i >= sx, i++) cout << "L";
| ^
| ;
|
s817374292 | p03836 | C++ | sx, sy, tx, ty = map(int, input().split())
dx = abs(tx - sx)
dy = abs(ty - sy)
ans = ''
ans += 'R' * dx
ans += 'U' * dy
ans += 'L' * dx
ans += 'D' * dy
ans += 'D'
ans += 'R' * (dx + 1)
ans += 'U' * (dy + 1)
ans += 'L'
ans += 'U'
ans += 'L' * (dx + 1)
ans += 'D' * (dy + 1)
ans += 'R'
print(ans)
| a.cc:6:7: error: empty character constant
6 | ans = ''
| ^~
a.cc:1:1: error: 'sx' does not name a type
1 | sx, sy, tx, ty = map(int, input().split())
| ^~
|
s545757489 | p03836 | C++ | #include <iostream>
#include <math.h>
#include <algorithm>
#include <vector>
#include <numeric>
#include <string>
#include <iomanip>
using namespace std;
const double PI = acos(-1.0);
const string alp = "abcdefghijklmnopqrstuvwxyz";
const string ALP = "ABCDEFGHIJKLMNOPQRSTUVWXYZ";
const int INTMAX = 2147483647;
const int INTMIN = -2147483648;
const unsigned int UINTMAX = 4294967295;
const long LONGMAX = 9223372036854775807;
const long LONGMIN = -9223372036854775808;
const unsigned long ULONGMAX = 18446744073709551615;
#define EXIST(s,e) ((s).find(e)!=(s).end())
#define SORT(c) sort((c).begin(),(c).end())
#define FOR(i,a,b) for(int i=(a);i<(b);++i)
#define REP(i,n) FOR(i,0,n)
#define REP1(i,n) FOR(i,1,n+1)
#define SUM(c) accumulate((c).begin(),(c).end(),0)
#define UNIQ(c) (c).erase(unique((c).begin(), (c).end()), (c).end());
#define Yn(b) puts(b?"Yes":"No")
#define YN(b) puts(b?"YES":"NO")
#define fsp(c) fixed << setprecision(c)
bool isprime(int p) {
if (p==1) return false;
FOR(i,2,p) {
if (p%i==0) return false;
}
return true;
}
int dig(int n, int a) {return n/(int)pow(10,a)%10;}
int digl(long n, int a) {return n/(long)pow(10,a)%10;}
int digsum(int n) {int r=0;REP(i,10){r+=dig(n,i);}return r;}
int digsuml(long n) {int r=0;REP(i,19){r+=digl(n,i);}return r;}
int dignum(int n) {return n?to_string(n).length():0;}
int dignuml(long n) {return n?to_string(n).length():0;}
double cutl(int i,double n,double r) {
if (i<=0||n<=i) return 0;
return r*sqrt(1-((double)i-n/2)*((double)i-n/2)*4/n/n);
}
int main(){
int sx,sy,tx,ty;
cin >> sx >> sy >> tx >> ty;
REP(i,ty-sy){
cout << 'U';
}
REP(i,tx-sx){
cout << 'R';
}
REP(i,ty-sy){
cout << 'D';
}
REP(i,tx-sx){
cout << 'L';
}
cout << 'L';
REP(i,ty-sy+1){
cout << 'U';
}
REP(i,tx-sx+1){
cout << 'R';
}
cout << 'DR'
REP(i,ty-sy+1){
cout << 'D';
}
REP(i,tx-sx+1){
cout << 'L';
}
cout << 'U';
return 0;
} | a.cc:16:23: warning: integer constant is so large that it is unsigned
16 | const long LONGMIN = -9223372036854775808;
| ^~~~~~~~~~~~~~~~~~~
a.cc:17:32: warning: integer constant is so large that it is unsigned
17 | const unsigned long ULONGMAX = 18446744073709551615;
| ^~~~~~~~~~~~~~~~~~~~
a.cc:71:11: warning: multi-character character constant [-Wmultichar]
71 | cout << 'DR'
| ^~~~
a.cc: In function 'int main()':
a.cc:71:15: error: expected ';' before 'for'
71 | cout << 'DR'
| ^
| ;
a.cc:72:7: error: 'i' was not declared in this scope
72 | REP(i,ty-sy+1){
| ^
a.cc:20:34: note: in definition of macro 'FOR'
20 | #define FOR(i,a,b) for(int i=(a);i<(b);++i)
| ^
a.cc:72:3: note: in expansion of macro 'REP'
72 | REP(i,ty-sy+1){
| ^~~
|
s179750440 | p03836 | C++ | #include<iostream>
using namespace std;
int sx, sy, tx, ty;
int X, Y;
int main(){
cin >> sx >> sy >> tx >> ty;
X = tx - sx;
Y = ty - sy;
for(int i = 0; i < X; i++){
cout << R;
}
for(int i = 0; i < Y; i++){
cout << U;
}
for(int i = 0; i < X; i++){
cout << L;
}
for(int i = 0; i < Y; i++){
cout << D;
}
cout << D;
for(int i = 0; i < X; i++){
cout << R;
}
for(int i = 0; i < Y; i++){
cout << U;
}
cout << L;
cout << U;
for(int i = 0; i < X; i++){
cout << R;
}
for(int i = 0; i < Y; i++){
cout << U;
}
cout << R;
return 0;
}
| a.cc: In function 'int main()':
a.cc:14:25: error: 'R' was not declared in this scope
14 | cout << R;
| ^
a.cc:17:25: error: 'U' was not declared in this scope
17 | cout << U;
| ^
a.cc:20:25: error: 'L' was not declared in this scope
20 | cout << L;
| ^
a.cc:23:25: error: 'D' was not declared in this scope
23 | cout << D;
| ^
a.cc:25:17: error: 'D' was not declared in this scope
25 | cout << D;
| ^
a.cc:27:25: error: 'R' was not declared in this scope
27 | cout << R;
| ^
a.cc:30:25: error: 'U' was not declared in this scope
30 | cout << U;
| ^
a.cc:32:17: error: 'L' was not declared in this scope
32 | cout << L;
| ^
a.cc:33:17: error: 'U' was not declared in this scope
33 | cout << U;
| ^
a.cc:35:25: error: 'R' was not declared in this scope
35 | cout << R;
| ^
a.cc:40:17: error: 'R' was not declared in this scope
40 | cout << R;
| ^
|
s097719171 | p03836 | C++ | #include <iostream>
#include <algorithm>
#include <cmath>
#include <iomanip>
#include <vector>
#include <utility>
#include <numeric>
#include <string>
#include <set>
#include <map>
#include <tuple>
#include <queue>
#include <stack>
#include <deque>
#define rep(i, a, n) for(int (i) = (int)(a);(i) < (int)(n);++(i))
#define repe(i, a, n) for(int (i) = (int)(a);(i) <= (int)(n);++(i))
#define repif(i, a, x) for(int (i) = (int)(a);(x);++(i))
#define repr(i, a, n) for(int (i) = (int)(a);(i) > (int)(n);--(i))
#define reper(i, a, n) for(int (i) = (int)(a);(i) >= (int)(n);--(i))
#define SIZE(x) ((int)(x).size())
#define ALL(x) (x).begin(), (x).end()
#define RNG(x, n) &((x)[0]), &((x)[n])
#define BRK(x) { (x); break; }
#define ADD(a, b) ((((a)%MOD)+((b)%MOD))%MOD)
#define MUL(a, b) ((((a)%MOD)*((b)%MOD))%MOD)
#define YES cout << "YES" << endl
#define NO cout << "NO" << endl
#define Yes cout << "Yes" << endl
#define No cout << "No" << endl
#define yes cout << "yes" << endl;
#define no cout << "no" << endl;
#define fcout cout << fixed << setprecision(10)
#define pb push_back
#define pf push_front
#define mt make_tuple
#define fi first
#define se second
#define EPS (1e-20)
#define INF 2147483647
#define MOD 1000000007
using llint = long long;
using VI = std::vector<int>;
using PII = std::pair<int, int>;
using SI = std::set<int>;
using MII = std::map<int, int>;
using TIII = std::tuple<int, int, int>;
using VLL = std::vector<llint>;
using MCI = std::map<char, int>;
using namespace std;
int sx, sy, tx, ty;
string solve(){
string ans;
rep(i, sy, ty) ans.pb('U');
rep(i, sx, tx) ans.pb('R');
repr(i, ty, sy) ans.pb('D');
repr(i, tx, sx) ans.pb('L');
ans.pb('L');
rep(i, sy, ty+1) ans.pb('U');
rep(i, sx-1, tx) ans.pb('R');
ans.pb('D');
ans.pb('R');
repr(i, ty, sy-1) ans.pb('D');
repr(i, tx+1, sx) ans.pb('L');"
ans.pb('U');
return ans;
}
signed main(){
cin >> sx >> sy >> tx >> ty;
cout << solve() << endl;
return 0;
} | a.cc:67:39: warning: missing terminating " character
67 | repr(i, tx+1, sx) ans.pb('L');"
| ^
a.cc:67:39: error: missing terminating " character
|
s452841232 | p03836 | C++ | #include<iostream>
#define abs(x) ((x)<0?-1*(x):(x))
using namespace std;
int main() {
int sx, sy;
int tx, ty;
cin>>sx>>sy;
cin>>tx>>ty;
if(sx == tx){
printf("R");
}
if(sy==ty)
printf("D");
for(int i = 0; i < abs(sx-tx))
printf("%c",(sx<tx?'R':'L'));
if(sy==ty)
printf("U");
for(int i = 0; i < abs(sy-ty))
printf("%c",(sy <ty?'U':'D'));
if(sx == tx){
printf("L");
}
for(int i = 0; i < abs(sx-tx))
printf("%c",(sx>tx?'R':'L'));
for(int i = 0; i < abs(sy-ty))
printf("%c",(sy>ty?'U':'D'));
return 0;
}
#include<iostream>
#define abs(x) ((x)<0?-1*(x):(x))
using namespace std;
int main() {
int sx, sy;
int tx, ty;
cin>>sx>>sy;
cin>>tx>>ty;
if(sx == tx){
printf("R");
}
if(sy==ty)
printf("D");
for(int i = 0; i < abs(sx-tx);i++)
printf("%c",(sx<tx?'R':'L'));
if(sy==ty)
printf("U");
for(int i = 0; i < abs(sy-ty);i++)
printf("%c",(sy <ty?'U':'D'));
if(sx == tx){
printf("L");
}
for(int i = 0; i < abs(sx-tx);i++)
printf("%c",(sx>tx?'R':'L'));
for(int i = 0; i < abs(sy-ty);i++)
printf("%c",(sy>ty?'U':'D'));
return 0;
} | a.cc: In function 'int main()':
a.cc:17:32: error: expected ';' before ')' token
17 | for(int i = 0; i < abs(sx-tx))
| ^
a.cc:21:32: error: expected ';' before ')' token
21 | for(int i = 0; i < abs(sy-ty))
| ^
a.cc:28:32: error: expected ';' before ')' token
28 | for(int i = 0; i < abs(sx-tx))
| ^
a.cc:30:32: error: expected ';' before ')' token
30 | for(int i = 0; i < abs(sy-ty))
| ^
a.cc: At global scope:
a.cc:39:5: error: redefinition of 'int main()'
39 | int main() {
| ^~~~
a.cc:5:5: note: 'int main()' previously defined here
5 | int main() {
| ^~~~
|
s517348690 | p03836 | C++ | #include<iostream>
#define abs(x) ((x)<0?-1*(x):(x))
using namespace std;
int main() {
int sx, sy;
int tx, ty;
cin>>sx>>sy;
cin>>tx>>ty;
if(sx == tx){
printf("R");
}
if(sy==ty)
printf("D");
for(int i = 0; i < abs(sx-tx))
printf("%c",(sx<tx?'R':'L'));
if(sy==ty)
printf("U");
for(int i = 0; i < abs(sy-ty))
printf("%c",(sy <ty?'U':'D'));
if(sx == tx){
printf("L");
}
for(int i = 0; i < abs(sx-tx))
printf("%c",(sx>tx?'R':'L'));
for(int i = 0; i < abs(sy-ty))
printf("%c",(sy>ty?'U':'D'));
return 0;
} | a.cc: In function 'int main()':
a.cc:17:32: error: expected ';' before ')' token
17 | for(int i = 0; i < abs(sx-tx))
| ^
a.cc:21:32: error: expected ';' before ')' token
21 | for(int i = 0; i < abs(sy-ty))
| ^
a.cc:28:32: error: expected ';' before ')' token
28 | for(int i = 0; i < abs(sx-tx))
| ^
a.cc:30:32: error: expected ';' before ')' token
30 | for(int i = 0; i < abs(sy-ty))
| ^
|
s855374952 | p03836 | C++ | #include <bits/stdc++.h>
using namespace std;
#define forx(i, a, b) for (int i = (a); i < (b); i++)
#define rep(j, n) for (int j = 0; j < (n); j++)
typedef long long ll;
int main()
{
int sx, sy, tx, ty;
cin >> sx >> sy >> tx >> ty;
int h = tx - sx;
int v = ty - sy;
rep(i, v) cout << 'U';
rep(i, h) cout << 'R';
cout << 'D';
rep(i, h - 1) cout << 'L';
rep(i, v - 1) cout << 'D';
cout << "LL";
rep(i, v + 1) cout << 'U';
rep(i, h + 1) cout << 'R';
cout << "DRUU";
rep(i, h - 1) cout << 'L';
rep(i, v - 1) cout << 'D';
cout << "LLU" < endl;
return 0;
}
| a.cc: In function 'int main()':
a.cc:25:19: error: no match for 'operator<' (operand types are 'std::basic_ostream<char>' and '<unresolved overloaded function type>')
25 | cout << "LLU" < endl;
| ~~~~~~~~~~~~~~^~~~~~
In file included from /usr/include/c++/14/regex:68,
from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:181,
from a.cc:1:
/usr/include/c++/14/bits/regex.h:1143:5: note: candidate: 'template<class _BiIter> bool std::__cxx11::operator<(const sub_match<_BiIter>&, const sub_match<_BiIter>&)'
1143 | operator<(const sub_match<_BiIter>& __lhs, const sub_match<_BiIter>& __rhs)
| ^~~~~~~~
/usr/include/c++/14/bits/regex.h:1143:5: note: template argument deduction/substitution failed:
a.cc:25:21: note: 'std::basic_ostream<char>' is not derived from 'const std::__cxx11::sub_match<_BiIter>'
25 | cout << "LLU" < endl;
| ^~~~
/usr/include/c++/14/bits/regex.h:1224:5: note: candidate: 'template<class _Bi_iter, class _Ch_traits, class _Ch_alloc> bool std::__cxx11::operator<(__sub_match_string<_Bi_iter, _Ch_traits, _Ch_alloc>&, const sub_match<_BiIter>&)'
1224 | operator<(const __sub_match_string<_Bi_iter, _Ch_traits, _Ch_alloc>& __lhs,
| ^~~~~~~~
/usr/include/c++/14/bits/regex.h:1224:5: note: template argument deduction/substitution failed:
a.cc:25:21: note: 'std::basic_ostream<char>' is not derived from 'std::__cxx11::__sub_match_string<_Bi_iter, _Ch_traits, _Ch_alloc>'
25 | cout << "LLU" < endl;
| ^~~~
/usr/include/c++/14/bits/regex.h:1317:5: note: candidate: 'template<class _Bi_iter, class _Ch_traits, class _Ch_alloc> bool std::__cxx11::operator<(const sub_match<_BiIter>&, __sub_match_string<_Bi_iter, _Ch_traits, _Ch_alloc>&)'
1317 | operator<(const sub_match<_Bi_iter>& __lhs,
| ^~~~~~~~
/usr/include/c++/14/bits/regex.h:1317:5: note: template argument deduction/substitution failed:
a.cc:25:21: note: 'std::basic_ostream<char>' is not derived from 'const std::__cxx11::sub_match<_BiIter>'
25 | cout << "LLU" < endl;
| ^~~~
/usr/include/c++/14/bits/regex.h:1391:5: note: candidate: 'template<class _Bi_iter> bool std::__cxx11::operator<(const typename std::iterator_traits<_Iter>::value_type*, const sub_match<_BiIter>&)'
1391 | operator<(typename iterator_traits<_Bi_iter>::value_type const* __lhs,
| ^~~~~~~~
/usr/include/c++/14/bits/regex.h:1391:5: note: template argument deduction/substitution failed:
a.cc:25:21: note: couldn't deduce template parameter '_Bi_iter'
25 | cout << "LLU" < endl;
| ^~~~
/usr/include/c++/14/bits/regex.h:1485:5: note: candidate: 'template<class _Bi_iter> bool std::__cxx11::operator<(const sub_match<_BiIter>&, const typename std::iterator_traits<_Iter>::value_type*)'
1485 | operator<(const sub_match<_Bi_iter>& __lhs,
| ^~~~~~~~
/usr/include/c++/14/bits/regex.h:1485:5: note: template argument deduction/substitution failed:
a.cc:25:21: note: 'std::basic_ostream<char>' is not derived from 'const std::__cxx11::sub_match<_BiIter>'
25 | cout << "LLU" < endl;
| ^~~~
/usr/include/c++/14/bits/regex.h:1560:5: note: candidate: 'template<class _Bi_iter> bool std::__cxx11::operator<(const typename std::iterator_traits<_Iter>::value_type&, const sub_match<_BiIter>&)'
1560 | operator<(typename iterator_traits<_Bi_iter>::value_type const& __lhs,
| ^~~~~~~~
/usr/include/c++/14/bits/regex.h:1560:5: note: template argument deduction/substitution failed:
a.cc:25:21: note: couldn't deduce template parameter '_Bi_iter'
25 | cout << "LLU" < endl;
| ^~~~
/usr/include/c++/14/bits/regex.h:1660:5: note: candidate: 'template<class _Bi_iter> bool std::__cxx11::operator<(const sub_match<_BiIter>&, const typename std::iterator_traits<_Iter>::value_type&)'
1660 | operator<(const sub_match<_Bi_iter>& __lhs,
| ^~~~~~~~
/usr/include/c++/14/bits/regex.h:1660:5: note: template argument deduction/substitution failed:
a.cc:25:21: note: 'std::basic_ostream<char>' is not derived from 'const std::__cxx11::sub_match<_BiIter>'
25 | cout << "LLU" < endl;
| ^~~~
In file included from /usr/include/c++/14/bits/stl_algobase.h:64,
from /usr/include/c++/14/algorithm:60,
from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:51:
/usr/include/c++/14/bits/stl_pair.h:1045:5: note: candidate: 'template<class _T1, class _T2> constexpr bool std::operator<(const pair<_T1, _T2>&, const pair<_T1, _T2>&)'
1045 | operator<(const pair<_T1, _T2>& __x, const pair<_T1, _T2>& __y)
| ^~~~~~~~
/usr/include/c++/14/bits/stl_pair.h:1045:5: note: template argument deduction/substitution failed:
a.cc:25:21: note: 'std::basic_ostream<char>' is not derived from 'const std::pair<_T1, _T2>'
25 | cout << "LLU" < endl;
| ^~~~
In file included from /usr/include/c++/14/bits/stl_algobase.h:67:
/usr/include/c++/14/bits/stl_iterator.h:448:5: note: candidate: 'template<class _Iterator> constexpr bool std::operator<(const reverse_iterator<_Iterator>&, const reverse_iterator<_Iterator>&)'
448 | operator<(const reverse_iterator<_Iterator>& __x,
| ^~~~~~~~
/usr/include/c++/14/bits/stl_iterator.h:448:5: note: template argument deduction/substitution failed:
a.cc:25:21: note: 'std::basic_ostream<char>' is not derived from 'const std::reverse_iterator<_Iterator>'
25 | cout << "LLU" < endl;
| ^~~~
/usr/include/c++/14/bits/stl_iterator.h:493:5: note: candidate: 'template<class _IteratorL, class _IteratorR> constexpr bool std::operator<(const reverse_iterator<_Iterator>&, const reverse_iterator<_IteratorR>&)'
493 | operator<(const reverse_iterator<_IteratorL>& __x,
| ^~~~~~~~
/usr/include/c++/14/bits/stl_iterator.h:493:5: note: template argument deduction/substitution failed:
a.cc:25:21: note: 'std::basic_ostream<char>' is not derived from 'const std::reverse_iterator<_Iterator>'
25 | cout << "LLU" < endl;
| ^~~~
/usr/include/c++/14/bits/stl_iterator.h:1694:5: note: candidate: 'template<class _IteratorL, class _IteratorR> constexpr bool std::operator<(const move_iterator<_IteratorL>&, const move_iterator<_IteratorR>&)'
1694 | operator<(const move_iterator<_IteratorL>& __x,
| ^~~~~~~~
/usr/include/c++/14/bits/stl_iterator.h:1694:5: note: template argument deduction/substitution failed:
a.cc:25:21: note: 'std::basic_ostream<char>' is not derived from 'const std::move_iterator<_IteratorL>'
25 | cout << "LLU" < endl;
| ^~~~
/usr/include/c++/14/bits/stl_iterator.h:1760:5: note: candidate: 'template<class _Iterator> constexpr bool std::operator<(const move_iterator<_IteratorL>&, const move_iterator<_IteratorL>&)'
1760 | operator<(const move_iterator<_Iterator>& __x,
| ^~~~~~~~
/usr/include/c++/14/bits/stl_iterator.h:1760:5: note: template argument deduction/substitution failed:
a.cc:25:21: note: 'std::basic_ostream<char>' is not derived from 'const std::move_iterator<_IteratorL>'
25 | cout << "LLU" < endl;
| ^~~~
In file included from /usr/include/c++/14/bits/basic_string.h:47,
from /usr/include/c++/14/string:54,
from /usr/include/c++/14/bitset:52,
from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:52:
/usr/include/c++/14/string_view:673:5: note: candidate: 'template<class _CharT, class _Traits> constexpr bool std::operator<(basic_string_view<_CharT, _Traits>, basic_string_view<_CharT, _Traits>)'
673 | operator< (basic_string_view<_CharT, _Traits> __x,
| ^~~~~~~~
/usr/include/c++/14/string_view:673:5: note: template argument deduction/substitution failed:
a.cc:25:21: note: 'std::basic_ostream<char>' is not derived from 'std::basic_string_view<_CharT, _Traits>'
25 | cout << "LLU" < endl;
| ^~~~
/usr/include/c++/14/string_view:680:5: note: candidate: 'template<class _CharT, class _Traits> constexpr bool std::operator<(basic_string_view<_CharT, _Traits>, __type_identity_t<basic_string_view<_CharT, _Traits> >)'
680 | operator< (basic_string_view<_CharT, _Traits> __x,
| ^~~~~~~~
/usr/include/c++/14/string_view:680:5: note: template argument deduction/substitution failed:
a.cc:25:21: note: 'std::basic_ostream<char>' is not derived from 'std::basic_string_view<_CharT, _Traits>'
25 | cout << "LLU" < endl;
| ^~~~
/usr/include/c++/14/string_view:688:5: note: candidate: 'template<class _CharT, class _Traits> constexpr bool std::operator<(__type_identity_t<basic_string_view<_CharT, _Traits> >, basic_string_view<_CharT, _Traits>)'
688 | operator< (__type_identity_t<basic_string_view<_CharT, _Traits>> __x,
| ^~~~~~~~
/usr/include/c++/14/string_view:688:5: note: template argument deduction/substitution failed:
a.cc:25:21: note: couldn't deduce template parameter '_CharT'
25 | cout << "LLU" < endl;
| ^~~~
/usr/include/c++/14/bits/basic_string.h:3874:5: note: candidate: 'template<class _CharT, class _Traits, class _Alloc> bool std::operator<(const __cxx11::basic_string<_CharT, _Traits, _Allocator>&, const __cxx11::basic_string<_CharT, _Traits, _Allocator>&)'
3874 | operator<(const basic_string<_CharT, _Traits, _Alloc>& __lhs,
| ^~~~~~~~
/usr/include/c++/14/bits/basic_string.h:3874:5: note: template argument deduction/substitution failed:
a.cc:25:21: note: 'std::basic_ostream<char>' is not derived from 'const std::__cxx11::basic_string<_CharT, _Traits, _Allocator>'
25 | cout << "LLU" < endl;
| ^~~~
/usr/include/c++/14/bits/basic_string.h:3888:5: note: candidate: 'template<class _CharT, class _Traits, class _Alloc> bool std::operator<(const __cxx11::basic_string<_CharT, _Traits, _Allocator>&, const _CharT*)'
3888 | operator<(const basic_string<_CharT, _Traits, _Alloc>& __lhs,
|
s072584151 | p03836 | C++ | l = input().split(' ')
y = int(l[3]) - int(l[1])
x = int(l[2]) - int(l[0])
def my_print(i,str):
for j in range(i):
print(str,end='')
"""
for i in range(x):
print('U',end='')
for i in range(y):
print('R',end='')
for i in range(x):
print('D',end='')
for i in range(y+1):
print('L',end='')
for i in range"
"""
my_print(y,'U')
my_print(x,'R')
my_print(y,'D')
my_print(x+1,'L')
my_print(y+1,'U')
my_print(x+1,'R')
my_print(1,'D')
my_print(1,'R')
my_print(y,'D')
my_print(x+1,'L')
my_print(1,'U')
print()
| a.cc:8:23: error: empty character constant
8 | print(str,end='')
| ^~
a.cc:9:3: warning: missing terminating " character
9 | """
| ^
a.cc:9:3: error: missing terminating " character
a.cc:11:19: error: empty character constant
11 | print('U',end='')
| ^~
a.cc:14:19: error: empty character constant
14 | print('R',end='')
| ^~
a.cc:17:19: error: empty character constant
17 | print('D',end='')
| ^~
a.cc:20:19: error: empty character constant
20 | print('L',end='')
| ^~
a.cc:22:15: warning: missing terminating " character
22 | for i in range"
| ^
a.cc:22:15: error: missing terminating " character
a.cc:23:3: warning: missing terminating " character
23 | """
| ^
a.cc:23:3: error: missing terminating " character
a.cc:1:1: error: 'l' does not name a type
1 | l = input().split(' ')
| ^
|
s911032905 | p03836 | C++ | #include <iostream>
using namespace std;
int main(){
int sx,sy,tx,ty;
cin >> sx >> sy >> tx >> ty;
const int dx=tx-sx,dy=ty-sy;
cout << string(dy,’U’) << string(dx,’R’);
cout << string(dy,’D’) << string(dx,’L’);
cout << ’L’ << string(dy+1,’U’) << string(dx+1,’R’) << ’D’;
cout << ’R’ << string(dy+1,’D’) << string(dx+1,’L’) << ’U’;
cout << endl;
return 0;
}
| a.cc:8:27: error: extended character ’ is not valid in an identifier
8 | cout << string(dy,’U’) << string(dx,’R’);
| ^
a.cc:8:27: error: extended character ’ is not valid in an identifier
a.cc:8:45: error: extended character ’ is not valid in an identifier
8 | cout << string(dy,’U’) << string(dx,’R’);
| ^
a.cc:8:45: error: extended character ’ is not valid in an identifier
a.cc:9:27: error: extended character ’ is not valid in an identifier
9 | cout << string(dy,’D’) << string(dx,’L’);
| ^
a.cc:9:27: error: extended character ’ is not valid in an identifier
a.cc:9:45: error: extended character ’ is not valid in an identifier
9 | cout << string(dy,’D’) << string(dx,’L’);
| ^
a.cc:9:45: error: extended character ’ is not valid in an identifier
a.cc:10:17: error: extended character ’ is not valid in an identifier
10 | cout << ’L’ << string(dy+1,’U’) << string(dx+1,’R’) << ’D’;
| ^
a.cc:10:17: error: extended character ’ is not valid in an identifier
a.cc:10:36: error: extended character ’ is not valid in an identifier
10 | cout << ’L’ << string(dy+1,’U’) << string(dx+1,’R’) << ’D’;
| ^
a.cc:10:36: error: extended character ’ is not valid in an identifier
a.cc:10:56: error: extended character ’ is not valid in an identifier
10 | cout << ’L’ << string(dy+1,’U’) << string(dx+1,’R’) << ’D’;
| ^
a.cc:10:56: error: extended character ’ is not valid in an identifier
a.cc:10:64: error: extended character ’ is not valid in an identifier
10 | cout << ’L’ << string(dy+1,’U’) << string(dx+1,’R’) << ’D’;
| ^
a.cc:10:64: error: extended character ’ is not valid in an identifier
a.cc:11:17: error: extended character ’ is not valid in an identifier
11 | cout << ’R’ << string(dy+1,’D’) << string(dx+1,’L’) << ’U’;
| ^
a.cc:11:17: error: extended character ’ is not valid in an identifier
a.cc:11:36: error: extended character ’ is not valid in an identifier
11 | cout << ’R’ << string(dy+1,’D’) << string(dx+1,’L’) << ’U’;
| ^
a.cc:11:36: error: extended character ’ is not valid in an identifier
a.cc:11:56: error: extended character ’ is not valid in an identifier
11 | cout << ’R’ << string(dy+1,’D’) << string(dx+1,’L’) << ’U’;
| ^
a.cc:11:56: error: extended character ’ is not valid in an identifier
a.cc:11:64: error: extended character ’ is not valid in an identifier
11 | cout << ’R’ << string(dy+1,’D’) << string(dx+1,’L’) << ’U’;
| ^
a.cc:11:64: error: extended character ’ is not valid in an identifier
a.cc: In function 'int main()':
a.cc:8:27: error: '\U00002019U\U00002019' was not declared in this scope
8 | cout << string(dy,’U’) << string(dx,’R’);
| ^~~
a.cc:8:45: error: '\U00002019R\U00002019' was not declared in this scope
8 | cout << string(dy,’U’) << string(dx,’R’);
| ^~~
a.cc:9:27: error: '\U00002019D\U00002019' was not declared in this scope
9 | cout << string(dy,’D’) << string(dx,’L’);
| ^~~
a.cc:9:45: error: '\U00002019L\U00002019' was not declared in this scope
9 | cout << string(dy,’D’) << string(dx,’L’);
| ^~~
|
s626441737 | p03836 | C++ | #include <iostream>
using namespace std;
int main(){
int sx,sy,tx,ty;
cin >> sx >> sy >> tx >> ty;
const int dx=tx-sx,dy=ty-sy;
cout << string(dy,’U’) << string(dx,’R’);
cout << string(dy,’D’) << string(dx,’L’);
cout << ’L’ << string(dy+1,’U’) << string(dx+1,’R’) << ’D’;
cout << ’R’ << string(dy+1,’D’) << string(dx+1,’L’) << ’U’;
cout << endl;
return 0;
}
| a.cc:8:27: error: extended character ’ is not valid in an identifier
8 | cout << string(dy,’U’) << string(dx,’R’);
| ^
a.cc:8:27: error: extended character ’ is not valid in an identifier
a.cc:8:45: error: extended character ’ is not valid in an identifier
8 | cout << string(dy,’U’) << string(dx,’R’);
| ^
a.cc:8:45: error: extended character ’ is not valid in an identifier
a.cc:9:27: error: extended character ’ is not valid in an identifier
9 | cout << string(dy,’D’) << string(dx,’L’);
| ^
a.cc:9:27: error: extended character ’ is not valid in an identifier
a.cc:9:45: error: extended character ’ is not valid in an identifier
9 | cout << string(dy,’D’) << string(dx,’L’);
| ^
a.cc:9:45: error: extended character ’ is not valid in an identifier
a.cc:10:17: error: extended character ’ is not valid in an identifier
10 | cout << ’L’ << string(dy+1,’U’) << string(dx+1,’R’) << ’D’;
| ^
a.cc:10:17: error: extended character ’ is not valid in an identifier
a.cc:10:36: error: extended character ’ is not valid in an identifier
10 | cout << ’L’ << string(dy+1,’U’) << string(dx+1,’R’) << ’D’;
| ^
a.cc:10:36: error: extended character ’ is not valid in an identifier
a.cc:10:56: error: extended character ’ is not valid in an identifier
10 | cout << ’L’ << string(dy+1,’U’) << string(dx+1,’R’) << ’D’;
| ^
a.cc:10:56: error: extended character ’ is not valid in an identifier
a.cc:10:64: error: extended character ’ is not valid in an identifier
10 | cout << ’L’ << string(dy+1,’U’) << string(dx+1,’R’) << ’D’;
| ^
a.cc:10:64: error: extended character ’ is not valid in an identifier
a.cc:11:17: error: extended character ’ is not valid in an identifier
11 | cout << ’R’ << string(dy+1,’D’) << string(dx+1,’L’) << ’U’;
| ^
a.cc:11:17: error: extended character ’ is not valid in an identifier
a.cc:11:36: error: extended character ’ is not valid in an identifier
11 | cout << ’R’ << string(dy+1,’D’) << string(dx+1,’L’) << ’U’;
| ^
a.cc:11:36: error: extended character ’ is not valid in an identifier
a.cc:11:56: error: extended character ’ is not valid in an identifier
11 | cout << ’R’ << string(dy+1,’D’) << string(dx+1,’L’) << ’U’;
| ^
a.cc:11:56: error: extended character ’ is not valid in an identifier
a.cc:11:64: error: extended character ’ is not valid in an identifier
11 | cout << ’R’ << string(dy+1,’D’) << string(dx+1,’L’) << ’U’;
| ^
a.cc:11:64: error: extended character ’ is not valid in an identifier
a.cc: In function 'int main()':
a.cc:8:27: error: '\U00002019U\U00002019' was not declared in this scope
8 | cout << string(dy,’U’) << string(dx,’R’);
| ^~~
a.cc:8:45: error: '\U00002019R\U00002019' was not declared in this scope
8 | cout << string(dy,’U’) << string(dx,’R’);
| ^~~
a.cc:9:27: error: '\U00002019D\U00002019' was not declared in this scope
9 | cout << string(dy,’D’) << string(dx,’L’);
| ^~~
a.cc:9:45: error: '\U00002019L\U00002019' was not declared in this scope
9 | cout << string(dy,’D’) << string(dx,’L’);
| ^~~
|
s961440578 | p03836 | C++ | #include <iostream>
using namespace std;
int main(){
int sx,sy,tx,ty;
cin >> sx >> sy >> tx >> ty;
const int dx=tx-sx,dy=ty-sy;
cout << string(dy,’U’) << string(dx,’R’);
cout << string(dy,’D’) << string(dx,’L’);
cout << ’L’ << string(dy+1,’U’) << string(dx+1,’R’) << ’D’;
cout << ’R’ << string(dy+1,’D’) << string(dx+1,’L’) << ’U’;
cout << endl;
return 0;
}
| a.cc:9:27: error: extended character ’ is not valid in an identifier
9 | cout << string(dy,’U’) << string(dx,’R’);
| ^
a.cc:9:27: error: extended character ’ is not valid in an identifier
a.cc:9:45: error: extended character ’ is not valid in an identifier
9 | cout << string(dy,’U’) << string(dx,’R’);
| ^
a.cc:9:45: error: extended character ’ is not valid in an identifier
a.cc:11:27: error: extended character ’ is not valid in an identifier
11 | cout << string(dy,’D’) << string(dx,’L’);
| ^
a.cc:11:27: error: extended character ’ is not valid in an identifier
a.cc:11:45: error: extended character ’ is not valid in an identifier
11 | cout << string(dy,’D’) << string(dx,’L’);
| ^
a.cc:11:45: error: extended character ’ is not valid in an identifier
a.cc:13:17: error: extended character ’ is not valid in an identifier
13 | cout << ’L’ << string(dy+1,’U’) << string(dx+1,’R’) << ’D’;
| ^
a.cc:13:17: error: extended character ’ is not valid in an identifier
a.cc:13:36: error: extended character ’ is not valid in an identifier
13 | cout << ’L’ << string(dy+1,’U’) << string(dx+1,’R’) << ’D’;
| ^
a.cc:13:36: error: extended character ’ is not valid in an identifier
a.cc:13:56: error: extended character ’ is not valid in an identifier
13 | cout << ’L’ << string(dy+1,’U’) << string(dx+1,’R’) << ’D’;
| ^
a.cc:13:56: error: extended character ’ is not valid in an identifier
a.cc:13:64: error: extended character ’ is not valid in an identifier
13 | cout << ’L’ << string(dy+1,’U’) << string(dx+1,’R’) << ’D’;
| ^
a.cc:13:64: error: extended character ’ is not valid in an identifier
a.cc:15:17: error: extended character ’ is not valid in an identifier
15 | cout << ’R’ << string(dy+1,’D’) << string(dx+1,’L’) << ’U’;
| ^
a.cc:15:17: error: extended character ’ is not valid in an identifier
a.cc:15:36: error: extended character ’ is not valid in an identifier
15 | cout << ’R’ << string(dy+1,’D’) << string(dx+1,’L’) << ’U’;
| ^
a.cc:15:36: error: extended character ’ is not valid in an identifier
a.cc:15:56: error: extended character ’ is not valid in an identifier
15 | cout << ’R’ << string(dy+1,’D’) << string(dx+1,’L’) << ’U’;
| ^
a.cc:15:56: error: extended character ’ is not valid in an identifier
a.cc:15:64: error: extended character ’ is not valid in an identifier
15 | cout << ’R’ << string(dy+1,’D’) << string(dx+1,’L’) << ’U’;
| ^
a.cc:15:64: error: extended character ’ is not valid in an identifier
a.cc: In function 'int main()':
a.cc:9:27: error: '\U00002019U\U00002019' was not declared in this scope
9 | cout << string(dy,’U’) << string(dx,’R’);
| ^~~
a.cc:9:45: error: '\U00002019R\U00002019' was not declared in this scope
9 | cout << string(dy,’U’) << string(dx,’R’);
| ^~~
a.cc:11:27: error: '\U00002019D\U00002019' was not declared in this scope
11 | cout << string(dy,’D’) << string(dx,’L’);
| ^~~
a.cc:11:45: error: '\U00002019L\U00002019' was not declared in this scope
11 | cout << string(dy,’D’) << string(dx,’L’);
| ^~~
|
s536378817 | p03836 | C++ | #include<cstdio>
#include<algorithm>
#include<cstring>
#include<cmath>
char str[100005];
int main()
{
int sx,sy,tx,ty;
while(scanf("%d%d%d%d",&sx,&sy,&tx,&ty)!=EOF)
{
int ans=sqrt((ty-sy)*(ty-sy));
int sum=sqrt((tx-sx)*(tx-sx));
for(int i=1; i<=ans; i++)
printf("U");
for(int i=1; i<=sum; i++)
printf("R");
// if(ans>=2&&sum>=2)
{
printf("D");
for(int i=1; i<=sum-1; i++)
printf("L");
for(int i=1; i<=ans-1; i++)
printf("D");
printf("LL");
for(int i=1; i<=ans+1; i++)
printf("U");
for(int i=1; i<=sum+2; i++)
printf("R");
printf("DDD");
for(int i=1; i<=sum-1; i++)
printf("L");
for(int i=1; i<=ans-1; i++)
printf("D");
printf("LLU\n");
}
// else
// printf("")
}
return 0;
} | a.cc: In function 'int main()':
a.cc:9:48: error: expected ')' before '\U0000ff01'
9 | while(scanf("%d%d%d%d",&sx,&sy,&tx,&ty)!=EOF)
| ~ ^~
| )
a.cc:9:48: error: '\U0000ff01' was not declared in this scope
9 | while(scanf("%d%d%d%d",&sx,&sy,&tx,&ty)!=EOF)
| ^~
|
s294446733 | p03836 | C++ | // ------------------------------------
// Date:2018/ 2/26
// Problem:ABC 051 BackAndForth c.cpp
//
// ------------------------------------
#include <bits/stdc++.h>
using namespace std;
#define EACH(i,a) for (auto&& i : a)
#define FOR(i,a,b) for(int i=(int)a;i<(int)b;++i)
#define RFOR(i,a,b) for(int i=(int)b-1;i>=(int)a;--i)
#define REP(i,n) FOR(i,0,n)
#define RREP(i,n) RFOR(i,0,n)
#define ALL(a) (a).begin(),(a).end()
#define debug(x) cerr << #x << ":" << x << endl
typedef long long ll;
#define MOD 1000000007
int main()
{
memset(dp,0,sizeof(dp));
int sx,sy,tx,ty;
cin >> sx >> sy >> tx >> ty;
int mx,my;
string output = "";
mx = tx - sx;
my = ty - sy;
REP(h,2) {
if (h == 1) {
output += "D";
}
REP(i,mx+h) {
output += "R";
}
REP(i,my+h) {
output += "U";
}
if (h == 1) {
output += "LU";
}
REP(i,mx+h) {
output += "L";
}
REP(i,my+h) {
output += "D";
}
if (h == 1) {
output += "R";
}
}
cout << output << endl;
return 0;
}
| a.cc: In function 'int main()':
a.cc:25:10: error: 'dp' was not declared in this scope; did you mean 'dup'?
25 | memset(dp,0,sizeof(dp));
| ^~
| dup
|
s162809974 | p03836 | C++ | #include <iostream>
#include <cstdio>
#include <algorithm>
#include <cstring>
#include <string>
#include <stack>
#include <queue>
#include <vector>
#include <set>
#include <cmath>
#define FOR(i,a,b) for(int i=a;i<b;i++)
#define MA(i,j) make_pair(i,j)
#define PA pair<int,int>
#define PB push_back
#define PQ priority_queue<int>
#define PGQ priority_queue<int,vector<int>,greater<int> >
#define VE vector<int>
#define VP vector<PA>
#define YES(i) cout<<(i?"YES":"NO")<<endl
#define Yes(i) cout<<(i?"Yes":"No")<<endl
#define MOD 1000000007
#define INF 1000000007
#define PI 3.14159265358979323846
using namespace std;
//
int SX,SY,TX,TY;
int main(){
cin>>SX>>SY>>TX>>TY;
FOR(i,0,TX-SX){
cout<<"R";
}
FOR(i,0,TY-SY+1){
cout<<"U";
}
FOR(i,0,TX-SX+1){
cout<<"L";
}
FOR(i,0,TY-XY+1){
cout<<"D";
}
cout<<"R";
cout<<"D";
FOR(i,0,TX-SX+1){
cout<<"R";
}
FOR(i,0,TY-XY+1){
cout<<"U";
}
FOR(i,0,TX-SX+1){
cout<<"L";
}
FOR(i,0,TY-SY){
cout<<"D";
}
cout<<endl;
return 0;
}
| a.cc: In function 'int main()':
a.cc:38:14: error: 'XY' was not declared in this scope; did you mean 'TY'?
38 | FOR(i,0,TY-XY+1){
| ^~
a.cc:11:34: note: in definition of macro 'FOR'
11 | #define FOR(i,a,b) for(int i=a;i<b;i++)
| ^
a.cc:46:14: error: 'XY' was not declared in this scope; did you mean 'TY'?
46 | FOR(i,0,TY-XY+1){
| ^~
a.cc:11:34: note: in definition of macro 'FOR'
11 | #define FOR(i,a,b) for(int i=a;i<b;i++)
| ^
|
s561323107 | p03836 | C++ | #include <iostream>
#include <string>
#include <cmath>
using namespace std;
int sx,sy,tx,ty;
int dx,dy;
char right_;
char left_;
char up_;
char down_;
int main()
{
cin >> sx >> sy >> tx >> ty;
if(sx <= tx)
{
right_ = 'R';
left_ = 'L';
}
else
{
right_ = 'L';
left_ = 'R';
}
if(sy <= ty)
{
up_ = 'U';
down_ = 'D';
}
else
{
up_ = 'D';
down_ = 'U';
}
dx = abs(sx - tx);
dy = abs(sy - ty);
for(int i = 0;i < dx;i++)
{
cout << right_;
}
for(int i = 0;i < dy;i++)
{
cout << up_;
}
for(int i = 0;i < dx;i++)
{
cout << left_;
}
for(int i = 0;i < dy;i++)
{
cout << down_;
}
cout << down_;
for(int i = 0;i < dx + 1;i++)
{
cout << right_;
}
for(int i = 0;i < dy + 1;i++)
{
cout << up_;
}
cout << left_;
cout << up_;
for(int i = 0;i < dx + 1;i++)
{
cout << left_;
}
for(int i = 0;i < dy + 1S;i++)
{
cout << down_;
}
cout << right_;
return 0;
} | a.cc: In function 'int main()':
a.cc:75:32: error: unable to find numeric literal operator 'operator""S'
75 | for(int i = 0;i < dy + 1S;i++)
| ^~
|
s627011382 | p03836 | C++ | #include<bits/stdc++.h>
using namespace std;
int main(void){
int sx, sy, tx, ty; cin >> sx >> sy >> tx >> ty;
int x = tx - sx;
int y = ty - sy;
for(int i = 0; i < x; i++) cout << "R" <<;
for(int i = 0; i < y; i++) cout << "U" <<;
for(int i = 0; i < x; i++) cout << "L" <<;
for(int i = 0; i < y; i++) cout << "D" <<;
cout << "D";
for(int i = 0; i <= x; i++) cout << "R" <<;
for(int i = 0; i <= y; i++) cout << "U" <<;
cout << "L";
cout << "U";
for(int i = 0; i <= x; i++) cout << "L" <<;
for(int i = 0; i <= y; i++) cout << "D" <<;
cout << "R" << endl;
return 0;
}
| a.cc: In function 'int main()':
a.cc:9:46: error: expected primary-expression before ';' token
9 | for(int i = 0; i < x; i++) cout << "R" <<;
| ^
a.cc:10:46: error: expected primary-expression before ';' token
10 | for(int i = 0; i < y; i++) cout << "U" <<;
| ^
a.cc:11:46: error: expected primary-expression before ';' token
11 | for(int i = 0; i < x; i++) cout << "L" <<;
| ^
a.cc:12:46: error: expected primary-expression before ';' token
12 | for(int i = 0; i < y; i++) cout << "D" <<;
| ^
a.cc:15:47: error: expected primary-expression before ';' token
15 | for(int i = 0; i <= x; i++) cout << "R" <<;
| ^
a.cc:16:47: error: expected primary-expression before ';' token
16 | for(int i = 0; i <= y; i++) cout << "U" <<;
| ^
a.cc:19:47: error: expected primary-expression before ';' token
19 | for(int i = 0; i <= x; i++) cout << "L" <<;
| ^
a.cc:20:47: error: expected primary-expression before ';' token
20 | for(int i = 0; i <= y; i++) cout << "D" <<;
| ^
|
s608862095 | p03836 | C++ |
using namespace std;
#include<iostream>
#include<string>
int main()
{
int a,b,c,d,e,f;
cin>>a>>b>>c>>d;
f=c-a;
e=d-b;
if(e>1 && f>1)
{
for(int i=0;i<e-1;i++)
cout<<"U";
for(int j=0;j<f-1;j++)
cout<<"R";
cout<<"U"<<"RR";
for(int k=0;k<e;k++)
cout<<"D";
for(int h=0;h<f-1;h++)
cout<<"L";
cout<<"D"<<"LLURU";
for(int b=0;b<f-1;b++)
cout<<"R";
for(int p=0;p<e;p++)
cout<<"U";
for(int q=0;q<f-1;q++)
cout<<"L";
cout<<"DLL";
for(int t=0;t<e;t++)
cout<<"D";
cout<<"R";
}
else
{
for(int b=0;b<e;b++)
cout<<"U";
for(int b=0;b<f;b++)
cout<<"L";
for(int b=0;b<e;b++)
cout<<"D";
for(int b=0;b<f;b++)
cout<<"L";
cout<<"L";
for(int b=0;b<e+1;b++)
cout<<"U";
for(int b=0;b<f+1;b++)
cout<<"R";
cout<<"DR";
for(int b=0;b<e+1;b++)
cout<<"D";
for(int b=0;b<f+1;b++)
cout<<"L";
cout<<"U";
}
}
return 0; | a.cc:63:5: error: expected unqualified-id before 'return'
63 | return 0;
| ^~~~~~
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.