submission_id stringlengths 10 10 | problem_id stringlengths 6 6 | language stringclasses 3 values | code stringlengths 1 522k | compiler_output stringlengths 43 10.2k |
|---|---|---|---|---|
s135321238 | p03835 | Java |
import java.util.Scanner;
public class Main {
public static void main(String[] ar)
{
Scanner sc = new Scanner(System.in);
int cnt = 0;
int k = sc.nextInt(), def = sc.nextInt();
int x = 0, y = 0, z = def;
if (x <= k && y <= k && z <= k) { ++cnt; }
// y -> x
while (true)
{
z = def - x;
y = 0;
// z -> y
while (true)
{
if (x <= k && y <= k && z <= k) { ++cnt; }
if (z == 0) { break;}
--z; ++y;
}
++x;
}
System.out.println(cnt);
}
}
| Main.java:35: error: unreachable statement
System.out.println(cnt);
^
1 error
|
s061569842 | p03835 | C++ | import java.util.Scanner;
public class Main {
public static void main(String[] args) {
// TODO 自動生成されたメソッド・スタブ
Scanner sc = new Scanner(System.in);
int K = sc.nextInt();
int S = sc.nextInt();
int count = 0;
for(int X = 0; X <= K; X++) {
for(int Y = 0; Y <= K; Y++) {
int Z = S - (X + Y);
if(0 <= Z && Z <= K) {
count++;
}
}
}
System.out.print(count);
}
}
| a.cc:1:1: error: 'import' does not name a type
1 | import java.util.Scanner;
| ^~~~~~
a.cc:1:1: note: C++20 'import' only available with '-fmodules-ts'
a.cc:2:1: error: expected unqualified-id before 'public'
2 | public class Main {
| ^~~~~~
|
s955223306 | p03835 | C++ | import java.util.Scanner;
public class Main {
public static void main(String[] args) {
// TODO 自動生成されたメソッド・スタブ
Scanner sc = new Scanner(System.in);
int K = sc.nextInt();
int S = sc.nextInt();
int count = 0;
for(int X = 0; X <= K; X++) {
for(int Y = 0; Y <= K; Y++) {
int Z = S - (X + Y);
if(0 <= Z && Z <= K) {
count++;
}
}
}
System.out.print(count);
}
}
| a.cc:1:1: error: 'import' does not name a type
1 | import java.util.Scanner;
| ^~~~~~
a.cc:1:1: note: C++20 'import' only available with '-fmodules-ts'
a.cc:2:1: error: expected unqualified-id before 'public'
2 | public class Main {
| ^~~~~~
|
s197360444 | p03835 | C++ | #include <iostream>
#include <cstdio>
#include <cstring>
#include <algorithm>
#include <vector>
#include <queue>
using namespace std;
int main()
{
int k,s;
scanf("%d%d",&k,&s)
int cnt=0;
for(int i=0; i<=k; i++)
for(int j=0; j<=k; j++)
{
int z=s-i-j;
if(z>=0&&z<=k)
cnt++;
}
printf("%d\n",cnt);
return 0;
}
| a.cc: In function 'int main()':
a.cc:13:24: error: expected ';' before 'int'
13 | scanf("%d%d",&k,&s)
| ^
| ;
14 | int cnt=0;
| ~~~
a.cc:20:17: error: 'cnt' was not declared in this scope; did you mean 'int'?
20 | cnt++;
| ^~~
| int
a.cc:22:19: error: 'cnt' was not declared in this scope; did you mean 'int'?
22 | printf("%d\n",cnt);
| ^~~
| int
|
s478033482 | p03835 | C++ | int main() {
int K, S;
int cnt=0;
cin >> K >> S;
for (int i=0; i <= K; i++) {
for (int j=0; j <= K; j++) {
if (0 <= (j + i - S) && (j + i - S) <= K) {
cnt++;
}
}
}
cout<<cnt<<endl;
return 0;
} | a.cc: In function 'int main()':
a.cc:5:9: error: 'cin' was not declared in this scope
5 | cin >> K >> S;
| ^~~
a.cc:16:9: error: 'cout' was not declared in this scope
16 | cout<<cnt<<endl;
| ^~~~
a.cc:16:20: error: 'endl' was not declared in this scope
16 | cout<<cnt<<endl;
| ^~~~
|
s251341880 | p03835 | C++ | #include <iostream>
#include <string>
using std::cin;
using std::cout;
using std::endl;
using std::string;
int main()
{
int K, S;
int X, Y, Z;
int cnt = 0;
cin >> K >> S;
for(int i = 0; i <= K; i++) {
for(int j = 0; j <= K; j++) {
z = S - x - y;
if(z >= 0 && z <= K) {
cnt++;
}
}
}
cout << cnt << endl;
} | a.cc: In function 'int main()':
a.cc:19:7: error: 'z' was not declared in this scope
19 | z = S - x - y;
| ^
a.cc:19:15: error: 'x' was not declared in this scope
19 | z = S - x - y;
| ^
a.cc:19:19: error: 'y' was not declared in this scope
19 | z = S - x - y;
| ^
|
s630649334 | p03835 | C++ | #include <iostream>
#include <string>
using std::cin;
using std::cout;
using std::endl;
using std::string;
int main()
{
int K, S;
int X, Y, Z;
int cnt = 0;
cin >> K >> S;
for(int i = 0; i <= K; i++) {
for(int j = 0; j <= K; j++) {
z = S - x - y
if(z >= 0 && z <= K) {
cnt++;
}
}
}
cout << cnt << endl;
} | a.cc: In function 'int main()':
a.cc:19:7: error: 'z' was not declared in this scope
19 | z = S - x - y
| ^
a.cc:19:15: error: 'x' was not declared in this scope
19 | z = S - x - y
| ^
a.cc:19:19: error: 'y' was not declared in this scope
19 | z = S - x - y
| ^
|
s222329128 | p03835 | Java | import java.util.*;
public class Main {
public static void main(String[] args) {
// TODO Auto-generated method stub
Scanner sc=new Scanner(System.in);
int c=0,x,y,z,s,k;
k=sc.nextInt();
s=sc.nextInt();
for(x=0;i<=s;i++)
{
for(y=0;y<=s;y++)
{
for(z=0;z<=s;z++)
{
if((x+y+z)==s)
c++;
}
}
}
System.out.println(c);
}
}
| Main.java:10: error: cannot find symbol
for(x=0;i<=s;i++)
^
symbol: variable i
location: class Main
Main.java:10: error: cannot find symbol
for(x=0;i<=s;i++)
^
symbol: variable i
location: class Main
2 errors
|
s631091556 | p03835 | Java | import java.util.Scanner;
public class Main {
public static void main(String args[]) {
Scanner scanner = new Scanner(System.in);
String inputString = scanner.nextLine();
String[] strStdIn = inputString.split(" ", 0);
int initialNum = Integer.parseInt(strStdIn[0]);
int totalNum = Integer.parseInt(strStdIn[1]);
int count = 0;
if (3 * initialNum == totalNum) {
System.out.println("1");
return;
} else if (3 * initialNum < totalNum) {
System.out.println("0");
return;
}
int calculatedNum = (3 *initialNum) - totalNum;
int terminater = 0;
if ((initialNum - calculatedNum) > 0) {
terminater = initialNum - calculatedNum;
}
count = 3 * (initialNum - terminater);
/* for (int i=initialNum; i >= terminater; i--) {
for (int m=initialNum; m >= terminater; m--) {
for (int n=initialNum; n >= terminater; n--) {
if ((3 *initialNum) - (i + m + n) == calculatedNum) {
count++;
}
}
}
*/ }
System.out.println(count);
}
} | Main.java:40: error: <identifier> expected
System.out.println(count);
^
Main.java:40: error: <identifier> expected
System.out.println(count);
^
Main.java:42: error: class, interface, enum, or record expected
}
^
3 errors
|
s857858924 | p03835 | C++ | #include<iostream>
using namespace std;
int main(){
int k,s;
int ans = 0;
cin>>k>>s;
for(int a=0;a<=k;a++){
for(int b=0;b<=k;b++){
int c = s-a-b;
if(c>=0 && c=<k){
ans++;
}
}
}
cout<<ans<<endl;
return 0;
}
| a.cc: In function 'int main()':
a.cc:12:30: error: expected primary-expression before '<' token
12 | if(c>=0 && c=<k){
| ^
|
s362614432 | p03835 | Java |
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
public class Main {
public static void main(String[] args) throws IOException {
BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
String[] s = br.readLine().split(" ", 0);
int K = Integer.parseInt(s[0]);
int S = Integer.parseInt(s[1]);
int X, Y, Z = 0;
int count = 0;
for (X = 0; X <= K; X++) {
for (Y = 0; Y <= K; Y++) {
if (X + Y + Z == S) {
count += 1;
break;
}
for (Z = 0; Z <= K; Z++) {
if (X + Y + Z == S) {
count += 1;
break;
}
}
}
}
System.out.println(count);
}
}
} | Main.java:33: error: class, interface, enum, or record expected
}
^
1 error
|
s871866500 | p03835 | C++ | #include <iostream>
#include <string>
#include <vector>
#include <algorithm>
#include <numeric>
#include <map>
#define REP(i,n) for (int i=0;i<(n);i++)
#define ll long long
#define ull unsigned long long
int dx[4] = {1, 0, -1, 0};
int dy[4] = {0, 1, 0, -1};
using namespace std;
int main(){
cin.tie(0);
ios::sync_with_stdio(false);
int k,s;
cin >> k >> s;
int ct=0;
REP(i,k){
REP(j,k){
int z = s - i - j;
if(z >= 0 && z <= k)ct++;
}
}
cout << ct << endl;
}
return 0;
}
| a.cc:29:3: error: expected unqualified-id before 'return'
29 | return 0;
| ^~~~~~
a.cc:30:1: error: expected declaration before '}' token
30 | }
| ^
|
s451971935 | p03835 | Java | import java.util.*;
public class Main{
public static void main(String[] args){
Scanner sc = new Scanner(System.in);
int k = sc.nextInt();
int s = sc.nextInt();
int c=0;
int ans = 0;
for( int a=0; a<=k; a++ ){
for(int b=0; b<=k; b++){
c = s-a-b;
if( z >= 0 && z <= k){
ans++;
}
}
}
System.out.println(ans);
return;
}
} | Main.java:14: error: cannot find symbol
if( z >= 0 && z <= k){
^
symbol: variable z
location: class Main
Main.java:14: error: cannot find symbol
if( z >= 0 && z <= k){
^
symbol: variable z
location: class Main
2 errors
|
s667631413 | p03835 | Java | ds | Main.java:1: error: reached end of file while parsing
ds
^
1 error
|
s207925017 | p03835 | C++ | #include<bits/stdc++.h>
#define int long long int
#define rep(a,b,c) for(int a=b;a<c;a++)
#define repm(a,b,c) for(int a=(b-1);a>=c;a--)
#define pb push_back
#define str string
#define sf(a) scanfs("%d",&a)
#define pb push_back
#define mp make_pair
#define Fi first
#define Se second
#define ALL(v) (v).begin(), (v).end()
using namespace std;
const int INF = 1e18 + 9;
const int Mod = 1e9 + 7;
inline int replac(str s){double ans=0;rep(i,0,s.length()){ans+=(s[i]-'0')*pow(10,s.length()-i-1);}return (int)ans;}
inline string numstr(int m){str s="";while(m>0){char c;int a=m/10;if(a>0)a=m%(a*10);else a=m;c=(char)('0'+a);s+=c;m/=10;}str st="";for(int i=s.size()-1;i>=0;i--){st+=s[i];}return st;}
typedef vector<int> vi;
typedef pair<int,int> pii;
typedef vector<pii> vii;
str s;
void ans2();
void ans3();
signed main()
{
/*
cin >> s;
rep(i,0,s.size()){
if(s[i]==',')cout << " ";
else cout << s[i];
}
cout << endl;
*/
// str ss;
// cin >> ss;
// cout << ss.size() << endl;
//ans2();
ans3();
return 0;
}
/*
void ans2(){
int a,b,c,d;
cin >> a >> b >> c >> d;
str a1="";
str a2="";
str b1="";
str b2="";
rep(i,b,d){
a1+='U';
b1+='D';
}
rep(j,a,c){
a2+='R';
b2+='L';
}
str ans=a1;
ans+=a2;
ans+=b1;
ans+=b2;
ans+='L';
ans+=a1;
ans+='U';
ans+=a2;
ans+="RDR";
ans+=b1;
ans+='D';
ans+=b2;
ans+="LU";
cout << ans << endl;
// cout << ans.size() << endl;
return ;
}*/
set<string> an;
void ans3(){
int n,m;
cin >> n >> m;
rep(i,0,n){
rep(j,0,n){
if((i+j)>=(m-n)&&(i+j)<=m){
str ss=to_string(i);
ss+='#';
ss+=to_string(j);
ss+='#';
ss+=to_string(m-(i+j));
an.insert(ss);
}
}
}
cout << ss.size() << endl;
return;
}
| a.cc: In function 'void ans3()':
a.cc:94:13: error: 'ss' was not declared in this scope; did you mean 's'?
94 | cout << ss.size() << endl;
| ^~
| s
|
s185597748 | p03835 | C | #include<cstdio>
int main(){
int k,s;
scanf("%d%d",&k,&s);
printf("%d\n",(++s*s+s-(k>s?0:3*(s-k)*(s-k-1))+(k*2>s?0:3*(s-2*k-1)*(s-2*k-2)))/2);++s;
return 0;
}
| main.c:1:9: fatal error: cstdio: No such file or directory
1 | #include<cstdio>
| ^~~~~~~~
compilation terminated.
|
s072297726 | p03835 | C++ | #include<iostream>
#include<vector>
#include<math.h>
using namespace std;
int main() {
int a, b, ans = 0;
cin >> a >> b;
for(int i = 0; i <= a; i++) {
if(b < i + j + k) break;
for(int j = 0; j <= a; j++) {
if(b < i + j + k) break;
for(int k = 0; k <= a; k++) {
if(b < i + j + k) break;
if(i + j + k == b) ans++;
}
}
}
cout << ans << endl;
}
| a.cc: In function 'int main()':
a.cc:10:16: error: 'j' was not declared in this scope
10 | if(b < i + j + k) break;
| ^
a.cc:10:20: error: 'k' was not declared in this scope
10 | if(b < i + j + k) break;
| ^
a.cc:12:22: error: 'k' was not declared in this scope
12 | if(b < i + j + k) break;
| ^
|
s351630365 | p03835 | C | #include <stdio.h>
int main(){
int K, S;
int cnt = 0;
scanf("%d", &K);
scanf("%d", &S);
if(3*K == S) {
printf("1\n");
return 0;
}
for(int i = 0; i <=K; i++) {
if(i+K+K < S) break;
for(int j = 0; j <=K; j++) {
if(i+j+K < S) break;
if(i+j+K/2 > S) {
for(int l = 0; l <=K; l++) {
if(i+j+l == S) {
cnt++;
break;
}
}
} else {
for(int l = K/2; l <=K; l++) {
if(i+j+l == S) {
cnt++;
break;
}
}
}
printf("%d\n", cnt);
return 0;
} | main.c: In function 'main':
main.c:34:1: error: expected declaration or statement at end of input
34 | }
| ^
main.c:34:1: error: expected declaration or statement at end of input
|
s750958502 | p03835 | C | #include <stdio.h>
int main(){
int K, S;
int cnt = 0;
scanf("%d", &K);
scanf("%d", &S);
if(3*K == S) {
printf("1\n");
return 0;
}
for(int i = 0; i <=K; i++) {
if(i+K+K < S) break;
for(int j = 0; j <=K; j++) {
if(i+j+K < S) break;
if(i+j+k/2 > S) {
for(int l = 0; l <=K; l++) {
if(i+j+l == S) {
cnt++;
break;
}
}
} else {
for(int l = K/2; l <=K; l++) {
if(i+j+l == S) {
cnt++;
break;
}
}
}
printf("%d\n", cnt);
return 0;
} | main.c: In function 'main':
main.c:17:16: error: 'k' undeclared (first use in this function)
17 | if(i+j+k/2 > S) {
| ^
main.c:17:16: note: each undeclared identifier is reported only once for each function it appears in
main.c:34:1: error: expected declaration or statement at end of input
34 | }
| ^
main.c:34:1: error: expected declaration or statement at end of input
|
s425913203 | p03835 | C | #include <stdio.h>
int main(){
int K, S;
int cnt = 0;
scanf(" %d", &K);
scanf(" %d", &S);
if(3*K == S) {
printf("1\n");
return 0;
}
for(int i = 0; i <=K; i++) {
for(int j = 0; j <=K; j++) {
for(int l = 0; l <=K; l++) {
if(i+j+l == S) {
cnt++;
break
}
}
}
}
printf("%d\n", cnt);
return 0;
} | main.c: In function 'main':
main.c:18:20: error: expected ';' before '}' token
18 | break
| ^
| ;
19 | }
| ~
|
s591741367 | p03835 | C++ | #include <bits/stdc++.h>
#define rep(i,a,b) for(int i=(a); i<(b); i++)
#define all(c) (c).begin(),(c).end()
#define rall(c) (c).rbegin(),(c).rend()
#define sort(v,n) sort(v,v+n);
#define vsort(v) sort(v.begin(),v.end());
#define ll long long
#define pb(a) push_back(a)
#define fi first
#define se second
#define inf 999999999
using namespace std;
typedef pair<int,int> p;
typedef pair<ll,ll> lp;
bool is_uruu(int y) {
return y % 4 == 0 && (y % 100 != 0 || y % 400 == 0);
}
const ll MOD=1e9+7;
//---------------------------------------------------------------------------//
int main(){
int s,k;
cin>>k;
cin>>s;
if(3*k==s) {
cout<<1<<endl;
return 0;
}
else if(3*k-1==s) {
cout<<3<<endl;
return 0;
}else if(3*k-2>=as) {
cout<<(k+1)*k*(k-1)<<endl;
}
}
| a.cc: In function 'int main()':
a.cc:32:25: error: 'as' was not declared in this scope; did you mean 's'?
32 | }else if(3*k-2>=as) {
| ^~
| s
|
s175062518 | p03835 | C++ | // b.cpp : 定义控制台应用程序的入口点。
//
#include "stdafx.h"
#include<iostream>
using namespace std;
int main()
{
int K, S;
cin >> K >> S;
int res = 0;
for (int left = 0; left <= K; left++)
{
int right = K;
for (; right >= left; right--)
{
int mid = S - left - right;
if (mid < left || mid > right)
continue;
if (left == right && mid == left)
res += 1;
else if (left != mid && left != right && mid != right)
res += 6;
else
res += 3;
}
}
cout << res << endl;
return 0;
}
| a.cc:4:10: fatal error: stdafx.h: No such file or directory
4 | #include "stdafx.h"
| ^~~~~~~~~~
compilation terminated.
|
s210151645 | p03835 | C | #include<stdio.h>
int main(void){
int k,s;
int i=0;
int a, b, c;
scanf("%d %d",&k,&s);
for(a=0;a<=k;a++){
for(b=0;b<=k;b++){
for(c=0;c<=k;c++){
if(a+b+c==s)i++;
else(a+b+c>s)break;
}
}
}
printf("%d\n",i);
return 0;
}
| main.c: In function 'main':
main.c:15:22: error: expected ';' before 'break'
15 | else(a+b+c>s)break;
| ^~~~~
| ;
|
s721618482 | p03835 | C++ | include <iostream>
#include <vector>
#include <algorithm>
#include <string>
#define FOR(i,k,n) for((i)=(k);(i)<(n);(i)++)
#define REP(i,n) for (int i=0;i<=(n);i++)
#define pb push_back
#define VSORT(S) sort(S.begin(), S.end());
using namespace std;
int main(){
int S,K,i,j,count;
count = 0;
cin>>K; cin>>S;
REP(i,K){
REP(j,K)
if((S-K<=i+j)&&(i+j<=S)) count++;
}
cout<<count<<endl;
return 0;
} | a.cc:1:1: error: 'include' does not name a type
1 | include <iostream>
| ^~~~~~~
In file included from /usr/include/c++/14/bits/stl_algobase.h:62,
from /usr/include/c++/14/vector:62,
from a.cc:2:
/usr/include/c++/14/ext/type_traits.h:164:35: error: 'constexpr const bool __gnu_cxx::__is_null_pointer' redeclared as different kind of entity
164 | __is_null_pointer(std::nullptr_t)
| ^
/usr/include/c++/14/ext/type_traits.h:159:5: note: previous declaration 'template<class _Type> constexpr bool __gnu_cxx::__is_null_pointer(_Type)'
159 | __is_null_pointer(_Type)
| ^~~~~~~~~~~~~~~~~
/usr/include/c++/14/ext/type_traits.h:164:26: error: 'nullptr_t' is not a member of 'std'
164 | __is_null_pointer(std::nullptr_t)
| ^~~~~~~~~
In file included from /usr/include/c++/14/bits/stl_pair.h:60,
from /usr/include/c++/14/bits/stl_algobase.h:64:
/usr/include/c++/14/type_traits:295:27: error: 'size_t' has not been declared
295 | template <typename _Tp, size_t = sizeof(_Tp)>
| ^~~~~~
/usr/include/c++/14/type_traits:666:33: error: 'nullptr_t' is not a member of 'std'
666 | struct is_null_pointer<std::nullptr_t>
| ^~~~~~~~~
/usr/include/c++/14/type_traits:666:42: error: template argument 1 is invalid
666 | struct is_null_pointer<std::nullptr_t>
| ^
/usr/include/c++/14/type_traits:670:48: error: template argument 1 is invalid
670 | struct is_null_pointer<const std::nullptr_t>
| ^
/usr/include/c++/14/type_traits:674:51: error: template argument 1 is invalid
674 | struct is_null_pointer<volatile std::nullptr_t>
| ^
/usr/include/c++/14/type_traits:678:57: error: template argument 1 is invalid
678 | struct is_null_pointer<const volatile std::nullptr_t>
| ^
/usr/include/c++/14/type_traits:984:26: error: 'size_t' has not been declared
984 | template<typename _Tp, size_t _Size>
| ^~~~~~
/usr/include/c++/14/type_traits:985:40: error: '_Size' was not declared in this scope
985 | struct __is_array_known_bounds<_Tp[_Size]>
| ^~~~~
/usr/include/c++/14/type_traits:985:46: error: template argument 1 is invalid
985 | struct __is_array_known_bounds<_Tp[_Size]>
| ^
/usr/include/c++/14/type_traits:1429:37: error: 'size_t' is not a member of 'std'
1429 | : public integral_constant<std::size_t, alignof(_Tp)>
| ^~~~~~
/usr/include/c++/14/type_traits:1429:57: error: template argument 1 is invalid
1429 | : public integral_constant<std::size_t, alignof(_Tp)>
| ^
/usr/include/c++/14/type_traits:1429:57: note: invalid template non-type parameter
/usr/include/c++/14/type_traits:1438:37: error: 'size_t' is not a member of 'std'
1438 | : public integral_constant<std::size_t, 0> { };
| ^~~~~~
/usr/include/c++/14/type_traits:1438:46: error: template argument 1 is invalid
1438 | : public integral_constant<std::size_t, 0> { };
| ^
/usr/include/c++/14/type_traits:1438:46: note: invalid template non-type parameter
/usr/include/c++/14/type_traits:1440:26: error: 'std::size_t' has not been declared
1440 | template<typename _Tp, std::size_t _Size>
| ^~~
/usr/include/c++/14/type_traits:1441:21: error: '_Size' was not declared in this scope
1441 | struct rank<_Tp[_Size]>
| ^~~~~
/usr/include/c++/14/type_traits:1441:27: error: template argument 1 is invalid
1441 | struct rank<_Tp[_Size]>
| ^
/usr/include/c++/14/type_traits:1442:37: error: 'size_t' is not a member of 'std'
1442 | : public integral_constant<std::size_t, 1 + rank<_Tp>::value> { };
| ^~~~~~
/usr/include/c++/14/type_traits:1442:65: error: template argument 1 is invalid
1442 | : public integral_constant<std::size_t, 1 + rank<_Tp>::value> { };
| ^
/usr/include/c++/14/type_traits:1442:65: note: invalid template non-type parameter
/usr/include/c++/14/type_traits:1446:37: error: 'size_t' is not a member of 'std'
1446 | : public integral_constant<std::size_t, 1 + rank<_Tp>::value> { };
| ^~~~~~
/usr/include/c++/14/type_traits:1446:65: error: template argument 1 is invalid
1446 | : public integral_constant<std::size_t, 1 + rank<_Tp>::value> { };
| ^
/usr/include/c++/14/type_traits:1446:65: note: invalid template non-type parameter
/usr/include/c++/14/type_traits:1451:32: error: 'size_t' was not declared in this scope
1451 | : public integral_constant<size_t, 0> { };
| ^~~~~~
/usr/include/c++/14/type_traits:64:1: note: 'size_t' is defined in header '<cstddef>'; this is probably fixable by adding '#include <cstddef>'
63 | #include <bits/version.h>
+++ |+#include <cstddef>
64 |
/usr/include/c++/14/type_traits:1451:41: error: template argument 1 is invalid
1451 | : public integral_constant<size_t, 0> { };
| ^
/usr/include/c++/14/type_traits:1451:41: note: invalid template non-type parameter
/usr/include/c++/14/type_traits:1453:26: error: 'size_t' has not been declared
1453 | template<typename _Tp, size_t _Size>
| ^~~~~~
/usr/include/c++/14/type_traits:1454:23: error: '_Size' was not declared in this scope
1454 | struct extent<_Tp[_Size], 0>
| ^~~~~
/usr/include/c++/14/type_traits:1454:32: error: template argument 1 is invalid
1454 | struct extent<_Tp[_Size], 0>
| ^
/usr/include/c++/14/type_traits:1455:32: error: 'size_t' was not declared in this scope
1455 | : public integral_constant<size_t, _Size> { };
| ^~~~~~
/usr/include/c++/14/type_traits:1455:32: note: 'size_t' is defined in header '<cstddef>'; this is probably fixable by adding '#include <cstddef>'
/usr/include/c++/14/type_traits:1455:40: error: '_Size' was not declared in this scope
1455 | : public integral_constant<size_t, _Size> { };
| ^~~~~
/usr/include/c++/14/type_traits:1455:45: error: template argument 1 is invalid
1455 | : public integral_constant<size_t, _Size> { };
| ^
/usr/include/c++/14/type_traits:1455:45: error: template argument 2 is invalid
/usr/include/c++/14/type_traits:1457:42: error: 'size_t' has not been declared
1457 | template<typename _Tp, unsigned _Uint, size_t _Size>
| ^~~~~~
/usr/include/c++/14/type_traits:1458:23: error: '_Size' was not declared in this scope
1458 | struct extent<_Tp[_Size], _Uint>
| ^~~~~
/usr/include/c++/14/type_traits:1458:36: error: template argument 1 is invalid
1458 | struct extent<_Tp[_Size], _Uint>
| ^
/usr/include/c++/14/type_traits:1463:32: error: 'size_t' was not declared in this scope
1463 | : public integral_constant<size_t, 0> { };
| ^~~~~~
/usr/include/c++/14/type_traits:1463:32: note: 'size_t' is defined in header '<cstddef>'; this is probably fixable by adding '#include <cstddef>'
/usr/include/c++/14/type_traits:1463:41: error: template argument 1 is invalid
1463 | : public integral_constant<size_t, 0> { };
| ^
/usr/include/c++/14/type_traits:1463:41: note: invalid template non-type parameter
/usr/include/c++/14/type_traits:1857:26: error: 'size_t' does not name a type
1857 | { static constexpr size_t __size = sizeof(_Tp); };
| ^~~~~~
/usr/include/c++/14/type_traits:1857:26: note: 'size_t' is defined in header '<cstddef>'; this is probably fixable by adding '#include <cstddef>'
/usr/include/c++/14/type_traits:1859:14: error: 'size_t' has not been declared
1859 | template<size_t _Sz, typename _Tp, bool = (_Sz <= _Tp::__size)>
| ^~~~~~
/usr/include/c++/14/type_traits:1859:48: error: '_Sz' was not declared in this scope
1859 | template<size_t _Sz, typename _Tp, bool = (_Sz <= _Tp::__size)>
| ^~~
/usr/include/c++/14/type_traits:1860:14: error: no default argument for '_Tp'
1860 | struct __select;
| ^~~~~~~~
/usr/include/c++/14/type_traits:1862:14: error: 'size_t' has not been declared
1862 | template<size_t _Sz, typename _Uint, typename... _UInts>
| ^~~~~~
/usr/include/c++/14/type_traits:1863:23: error: '_Sz' was not declared in this scope
1863 | struct __select<_Sz, _List<_Uint, _UInts...>, true>
| ^~~
/usr/include/c++/14/type_traits:1863:57: error: template argument 1 is invalid
1863 | struct __select<_Sz, _List<_Uint, _UInts...>, true>
| ^
/usr/include/c++/14/type_traits:1866:14: error: 'size_t' has not been declared
1866 | template<size_t _Sz, typename _Uint, typename... _UInts>
| ^~~~~~
/usr/include/c++/14/type_traits:1867:23: error: '_Sz' was not declared in this scope
1867 | struct __select<_Sz, _List<_Uint, _UInts...>, false>
| ^~~
/usr/include/c++/14/type_traits:1867:58: error: template argument 1 is invalid
1867 | struct __select<_Sz, _List<_Uint, _UInts...>, false>
| |
s151845856 | p03835 | C | include<stdio.h>
int main(void){
int K,S;
int x,y,z;
int count = 0;
scanf("%d %d",&K,&S);
for(x=0;x<=K;x++){
for(y=0;y<=K;y++){
for(z=0;z<=K;z++){
if(x+y+z==S){
count++;
}
}
}
}
printf("%d\n",count);
return 0;
} | main.c:1:8: error: expected '=', ',', ';', 'asm' or '__attribute__' before '<' token
1 | include<stdio.h>
| ^
|
s393880218 | p03835 | C++ | #include <iostream>
#include <algorithm>
#include <string>
#include <vector>
#include <cstdio>
#include <cstring>
#include <cstdlib>
#include <set>
#include <map>
#include <queue>
#include <stack>
using namespace std;
#define INF 1010001000
#define EPS 1e-10
#define rep(i, N) for (int i = 0; i < N; i++)
#define pb push_back
typedef pair<int, int> i_i;
typedef long long int llong;
typedef pair<llong, llong> ll_ll;
typedef struct edge {int f, t;}Edge;
int main()
{
int k, s;
cin >> k >> s;
llong ret = 0;
for (int i = 0; i <= k; i++) {
for (int j = 0; j <= k; j++) {
for (int l = 0; l <= k; l++) {
if (i + j + l == s) {
ret++;
}
}
}
}
cout << ret << endl;
return 0;
| a.cc: In function 'int main()':
a.cc:42:14: error: expected '}' at end of input
42 | return 0;
| ^
a.cc:26:1: note: to match this '{'
26 | {
| ^
|
s718574104 | p03835 | C++ | #include <bits/stdc++.h>
using namespace std;
#define rep(i,n) for (int (i)=(0);(i)<=(int)(n);++(i))
int main() {
int K, S: cin >> K >> S;
long long ans=0;
rep(i,K) rep(j,K) rep(k,K) {
if (i+j+k == S) ans++;
}
cout<<ans<<endl;
return 0;
} | a.cc: In function 'int main()':
a.cc:6:13: error: found ':' in nested-name-specifier, expected '::'
6 | int K, S: cin >> K >> S;
| ^
| ::
a.cc:6:12: error: 'S' has not been declared
6 | int K, S: cin >> K >> S;
| ^
a.cc:6:19: error: qualified-id in declaration before '>>' token
6 | int K, S: cin >> K >> S;
| ^~
a.cc:9:22: error: 'S' was not declared in this scope
9 | if (i+j+k == S) ans++;
| ^
|
s936822124 | 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:11:19: error: extended character ’ is not valid in an identifier
11 | cout << string(dy,’U’) << string(dx,’R’);
| ^
a.cc:11:19: error: extended character ’ is not valid in an identifier
a.cc:11:37: error: extended character ’ is not valid in an identifier
11 | cout << string(dy,’U’) << string(dx,’R’);
| ^
a.cc:11:37: error: extended character ’ is not valid in an identifier
a.cc:14:19: error: extended character ’ is not valid in an identifier
14 | cout << string(dy,’D’) << string(dx,’L’);
| ^
a.cc:14:19: error: extended character ’ is not valid in an identifier
a.cc:14:37: error: extended character ’ is not valid in an identifier
14 | cout << string(dy,’D’) << string(dx,’L’);
| ^
a.cc:14:37: error: extended character ’ is not valid in an identifier
a.cc:17:9: error: extended character ’ is not valid in an identifier
17 | cout << ’L’ << string(dy+1,’U’) << string(dx+1,’R’) << ’D’;
| ^
a.cc:17:9: error: extended character ’ is not valid in an identifier
a.cc:17:28: error: extended character ’ is not valid in an identifier
17 | cout << ’L’ << string(dy+1,’U’) << string(dx+1,’R’) << ’D’;
| ^
a.cc:17:28: error: extended character ’ is not valid in an identifier
a.cc:17:48: error: extended character ’ is not valid in an identifier
17 | cout << ’L’ << string(dy+1,’U’) << string(dx+1,’R’) << ’D’;
| ^
a.cc:17:48: error: extended character ’ is not valid in an identifier
a.cc:17:56: error: extended character ’ is not valid in an identifier
17 | cout << ’L’ << string(dy+1,’U’) << string(dx+1,’R’) << ’D’;
| ^
a.cc:17:56: error: extended character ’ is not valid in an identifier
a.cc:20:9: error: extended character ’ is not valid in an identifier
20 | cout << ’R’ << string(dy+1,’D’) << string(dx+1,’L’) << ’U’;
| ^
a.cc:20:9: error: extended character ’ is not valid in an identifier
a.cc:20:28: error: extended character ’ is not valid in an identifier
20 | cout << ’R’ << string(dy+1,’D’) << string(dx+1,’L’) << ’U’;
| ^
a.cc:20:28: error: extended character ’ is not valid in an identifier
a.cc:20:48: error: extended character ’ is not valid in an identifier
20 | cout << ’R’ << string(dy+1,’D’) << string(dx+1,’L’) << ’U’;
| ^
a.cc:20:48: error: extended character ’ is not valid in an identifier
a.cc:20:56: error: extended character ’ is not valid in an identifier
20 | cout << ’R’ << string(dy+1,’D’) << string(dx+1,’L’) << ’U’;
| ^
a.cc:20:56: error: extended character ’ is not valid in an identifier
a.cc: In function 'int main()':
a.cc:11:19: error: '\U00002019U\U00002019' was not declared in this scope
11 | cout << string(dy,’U’) << string(dx,’R’);
| ^~~
a.cc:11:37: error: '\U00002019R\U00002019' was not declared in this scope
11 | cout << string(dy,’U’) << string(dx,’R’);
| ^~~
a.cc:14:19: error: '\U00002019D\U00002019' was not declared in this scope
14 | cout << string(dy,’D’) << string(dx,’L’);
| ^~~
a.cc:14:37: error: '\U00002019L\U00002019' was not declared in this scope
14 | cout << string(dy,’D’) << string(dx,’L’);
| ^~~
|
s544819895 | p03836 | Java | import java.util.*;
import java.io.*;
public class HelloWorld{
public static void main(String []args){
Scanner scanner = new Scanner(System.in);
int sx = scanner.nextInt();
int sy =scanner.nextInt();
int tx = scanner.nextInt();
int ty =scanner.nextInt();
int y = ty- sy;
int x = tx - sx;
for(int i=0;i<y;i++)
System.out.print("U");
for(int i=0;i<x;i++)
System.out.print("R");
for(int i=0;i<y;i++)
System.out.print("D");
for(int i=0;i<=x;i++)
System.out.print("L");
for(int i=0;i<=y;i++)
System.out.print("U");
for(int i=0;i<=x;i++)
System.out.print("R");
System.out.print("D");
System.out.print("R");
for(int i=0;i<=y;i++)
System.out.print("D");
for(int i=0;i<=x;i++)
System.out.print("L");
System.out.print("U");
}
} | Main.java:5: error: class HelloWorld is public, should be declared in a file named HelloWorld.java
public class HelloWorld{
^
1 error
|
s248816957 | p03836 | C++ | #include<iostream>
using namespace std;
int main(){
int sx,sy,tx,ty;
cin >> sx >> sy >> tx >> ty;
int i;
for(i=0;i<tx-sx;i++)cout << 'R';
for(i=0;i<ty-sy;i++)cout << 'U';
for(i=0;i<tx-sx;i++)cout << 'L';
for(i=0;i<ty-sy;i++)cout << 'D';
cout << 'D';
for(i=0;i<tx-sx+1;i++)cout << 'R';
for(i=0;i<ty-sy+1;i++)cout << 'U';
cout << "LU";
for(i=0;i<tx-sx+1;i++)cout << 'L';
for(i=0;i<ty-sy+1;i++)cout << 'D';
cout << 'R' << endl;
return 0; | a.cc: In function 'int main()':
a.cc:18:12: error: expected '}' at end of input
18 | return 0;
| ^
a.cc:3:11: note: to match this '{'
3 | int main(){
| ^
|
s137124317 | p03836 | Java | import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.util.AbstractMap;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
import java.util.NoSuchElementException;
public class Main {
public static void main(String[] args) {
for(int i=0;i<1;i++) {
slover();
out.flush();
}
}
static FastScanner sc = new FastScanner();
static PrintWriter out = new PrintWriter(System.out);
private static class D{
ArrayList<Integer> X=new ArrayList<Integer>();
ArrayList<Integer> Y=new ArrayList<Integer>();
int t=0;
int index=0;
D(ArrayList<Integer> X,ArrayList<Integer> Y,int t,int index){
this.X=X;;
this.Y=Y;
this.t=t;
this.index=index;
}
}
//Set<Long> a=new HashSet<Long>();
//Integer.toBinaryString(i);
//Integer.toString(i, 2);
// //Integer.parseInt(bin, 2);
//bitset
//StringBuffer S = new StringBuffer(sc.next());
//String hoge2 = str.reverse().toString();
//map.containsKey(A)
//Map<Integer, Integer> map = new HashMap<Integer, Integer>(N);
/*for ( キーのデータ型 key : マップの名前.keySet() ) {
データのデータ型 data = マップの名前.get( key );
// keyやdataを使った処理;
}*/
//int i = Integer.parseInt(s);
//Queue<String> qq=new ArrayDeque<>(); //add,poll,peek BFSは前から実行される
//Deque<String> dd=new ArrayDeque<>();//push後ろに入れる,poll(pop)後ろからとる,peek addは先頭に入るからバグ注意
//stackdfsは後ろから実行される
//ArrayList<Integer> cc = new ArrayList<>(N);
//cc.contains(tmp)
//Arrays.asList(c).contains("a")
//list.set(1,"walk");//1 1 2 3 5
//PriorityQueue<Integer> r=new PriorityQueue<Integer>();//add poll
public static class Pair<K, V> extends AbstractMap.SimpleEntry<K, V> implements Comparable<Pair<K, V>> {
/** serialVersionUID. */
private static final long serialVersionUID = 6411527075103472113L;
public Pair(final K key, final V value) {
super(key, value);
}
@Override
public int compareTo(Pair<K, V> o) {
Comparable key = (Comparable)this.getKey();
Comparable key2 = (Comparable)o.getKey();
return key.compareTo(key2);
}
}
// 文字列として入力を取得
private static long mod=1000000007;
private static int INF =999999999;
private static long LINF=4000000000000000000L;
private static long ncr(long n,long r) {
long res=1;
for(int i=0;i<r;i++) {
res*=n-i;
res/=i+1;
}
return res;
}
private static int StringCount(String T,String v) {
int res=0;
int t=0;
while(T.indexOf(v,t)>=0) {
//p(t);
res++;
t=T.indexOf(v,t)+1;
}
return res;
}
private static int slover() {
int sx=sc.nextInt(),sy=sc.nextInt(),tx=sc.nextInt(),ty=sc.nextInt();
String T="";
if(sx!=tx&&sy!=ty) {
String P1="";//上り
String P2="";//下り
String P3="";//右
String P4="";//左
for(int i=0;i<Math.abs(ty-sy);i++) {
P1+="U";
P2+="D";
}
for(int i=0;i<Math.abs(tx-sx);i++) {
P3+="R";
P4+="L";
}
if(sy<ty)T+=P1;
else T+=P2;
if(sx<tx)T+=P3;
else T+=P4;
if(sy<ty)T+=P2;
else T+=P1;
if(sx<tx)T+=P4;
else T+=P3;
if(sy<ty)T+="D";
else T+="U";
if(sx<tx)T+=P3+"R";
else T+=P4+"L";
if(sy<ty)T+="U"+P1;
else T+="D"+P2;
if(sx<tx)T+="L";
else T+="R";
if(sy<ty)T+="U";
else T+="D";
if(sx<tx)T+=P4+"L";
else T+=P3+"R";
if(sy<ty)T+="D"+P2;
else T+="U"+P1;
if(sx<tx)T+="R";
else T+="L";
}p(T);
return 0;
}else {
}
private static void shape(int Q[]) {
for(int i=0;i<Q.length;i++) {
find2(Q,i);
}
}
private static int find2(int Q[],int a) {
//aの根をbの根にする。
if(Q[a]==a) {
return Q[a];
}else {
return Q[a]=find2(Q,Q[a]);
}
}
private static void union2(int Q[],int a,int b) {
int root1=find2(Q,a);
int root2=find2(Q,b);
Q[root1]=Q[root2];
}
private static void set_add(int Q[],int index,int value) {
if(Q[index]==value) {
}
else if(Q[index]==INF) {
Q[index]=value;
}else if(value<Q[index]) {
set_add(Q,index*2+1,value);
}else {
set_add(Q,index*2+2,value);
}
}
private static void priority_queue_add(int Queue[],int index,int value) {
Queue[index]=value;
if(index!=0) {
if((index-1)/2>=0&&Queue[(index-1)/2]>value) {
Queue[index]=Queue[(index-1)/2];
priority_queue_add(Queue,(index-1)/2,value);
}
if((index-2)/2>=0&&Queue[(index-2)/2]>value) {
Queue[index]=Queue[(index-2)/2];
priority_queue_add(Queue,(index-2)/2,value);
}
}
}
private static int priority_queue_getFirst(int[] Queue) {
int res=Queue[0];
Queue[0]=Queue[Queue.length-1];
Queue[Queue.length-1]=INF;
//System.out.println(Arrays.toString(Queue));
//大きさのチェック
Q_shape(Queue,0);
return res;
}
private static void Q_shape(int[] Queue,int index) {
if(index*2+1<Queue.length&&Queue[index*2+1]<Queue[index]) {
int v=Queue[index];
Queue[index]=Queue[index*2+1];
Queue[index*2+1]=v;
Q_shape(Queue,index*2+1);
}
if(index*2+2<Queue.length&&Queue[index*2+2]<Queue[index]) {
int v=Queue[index];
Queue[index]=Queue[index*2+2];
Queue[index*2+2]=v;
Q_shape(Queue,index*2+2);
}
}
private static int union_MaxSize(int[] tree) {
union_shape(tree);
int V[]=new int[tree.length+1];
for(int i=0;i<tree.length;i++) {
V[tree[i]]++;
}
int max=0;
for(int i=0;i<=tree.length;i++) {
max=Math.max(max, V[i]);
}
return max;
}
public static int find(int[] tree,int idx) {
if(tree[idx]==idx) return idx;
else {
return tree[idx] = find(tree,tree[idx]);
}
}
public static void union_shape(int[] tree) {
for(int i=0;i<tree.length;i++) {
find(tree,i);
}
}
//union idx2 tree to idx1 tree O(a(N))
public static int[] union(int tree[],int idx1,int idx2) {
int root1 = find(tree,idx1);
int root2 = find(tree,idx2);
tree[root2] = root1;
return tree;
}
private static boolean heihou(long T) {
if(Math.pow((int)Math.sqrt(T), 2)==T)return true;
return false;
}
private static String zeroume(String S) {
while(S.length()<6)S='0'+S;
return S;
}
//速度が足りないときは、前計算を1回だけにしたり、longをintに変えたりするといい
private static long modNcR2(int n,int r) {
long x_b=1;
for(int i=0;i<r;i++) {
x_b*=(n-i);
x_b%=mod;
}
long y=1;
for(int i=1;i<=r;i++) {
y*=i;
y%=mod;
//nPrにr!%modの逆元を掛ける
}
return (x_b*modPow((int) y,mod-2,mod)%mod);
}
private static long modPow(int i,long t,long mod) {
//iのt乗をO(log t)で返す
i%=mod;
t%=mod;
long a=i;
long res=1;
//for(int i=0;i<S.length();i++) {if(S.charAt(N-i)=='1') {res=res*a%mod;}
//tをStringで受け取りたい時用
while(t!=0) {
if((1&t)==1) {
res=res*a%mod;
}
a=a*a%mod;
t=t>>1;
}
return res;
}
public static long gcd(long num1,long num2) {
if(num2==0) return num1;
else return gcd(num2,num1%num2);
}
public static long lcm(long num1,long num2) {
return num1*num2/gcd(num1,num2);
}
//O(N^0.5)
private static boolean isPrime(long t) {
if(t<2)return false;
for(int i=2;i*i<=t;i++) {
if(t%i==0)return false;
}
return true;
}
private static ArrayList<Long> Divisors(long t) {
ArrayList<Long> c=new ArrayList<Long>();
for(long i=1;i*i<=t;i++) {
if(t%i==0) {
if(i*i!=t) {
c.add(t/i);
}
c.add((long)i);
}
}
return c;
}
private static ArrayList<Long> Sorted_Divisors(long t) {
ArrayList<Long> c=new ArrayList<Long>();
for(long i=2;i*i<=t;i++) {
if(t%i==0) {
p(t+" "+i);
c.add((long)i);
t/=i;
i--;
}
}
if(t!=1)c.add(t);
Collections.sort(c);
return c;
}
private static void bubunwa() {
int N=sc.nextInt();
int K=sc.nextInt();
int a[]=sc.nextIntArray(N, false);
boolean dp[] =new boolean[K+1];
Arrays.fill(dp, false);
dp[0]=true;
for(int i=0;i<N;i++) {
for(int x=K-a[i];x>=0;x--) {
if(dp[x])dp[x+a[i]]=true;
}
}
p(dp[K] ? "Yes":"No");
}
private static String bitToString(int i) {
return Integer.toBinaryString(i);
}
/*********************************************************************/
//target以下までの値のindexを返す
//target以上が欲しいときは返り値+1すればいい
//0-indexで個数を求めるときはさらにindex+1する必要あり
private static int lower_bound(long a[],long target) {
//p(target+ " "+Arrays.toString(a));
if(a[0]>target)return -1;
//最後の値がtarget以下であるときは最後のindexを返す。
//target以上が欲しいときは注意する必要あり
if(a[a.length-1]<=target) return a.length-1;
int S=-1;
int E=a.length;
while(S<E) {
int G=(S+E)/2;
if(G+1==a.length) {
G--;
}
//未満にしたいときは=の場所を変える
if(a[G]<=target&&a[G+1]>target) {
return G;
}else if(a[G]<=target){
S=G;
}else if(a[G]>target) {
E=G;
}
}
return -1;
}
static String nextPermutation(String s) {
ArrayList<Character> list=new ArrayList<Character>();
for(int i=0;i<s.length();i++) {
list.add(s.charAt(i));
}
int pivotPos=-1;
char pivot=0;
for(int i=list.size()-2;i>=0;i--) {
if(list.get(i)<list.get(i+1)) {
pivotPos=i;
pivot=list.get(i);
break;
}
}
if(pivotPos==-1&&pivot==0) {
return "Final";
}
int L=pivotPos+1,R=list.size()-1;
int minPos=-1;
char min =Character.MAX_VALUE;
for(int i=R;i>=L;i--) {
if(pivot<list.get(i)) {
if(list.get(i)<min) {
min=list.get(i);
minPos=i;
}
}
}
Collections.swap(list, pivotPos, minPos);
Collections.sort(list.subList(L, R+1));
StringBuilder sb=new StringBuilder();
for(int i=0;i<list.size();i++) {
sb.append(list.get(i));
}
return sb.toString();
}
private static long[][] com;
private static void nCr() {
int MAX = 3001;
com= new long[MAX][MAX];
for(int i = 0; i < MAX; i++)
com[i][0] = 1;
for(int i = 1; i < MAX; i++) {
for(int j = 1; j <= i; j++) {
com[i][j] = com[i-1][j-1] + com[i-1][j];
com[i][j] %= mod;
}
}
}
static void p(String ans) {out.println(ans);}
static void p(int ans) {out.println(ans);}
static void p() {out.println();}
static void p(long ans) {out.println(ans);}
static void p(double ans) {out.println(ans);}
static void p(boolean ans) {out.println(ans);}
static void pn(String ans) {out.print(ans);};
static void pn(int ans) {out.print(ans);};
static void pn() {out.print("");};
static void pn(long ans) {out.print(ans);};
static void pn(double ans) {out.print(ans);};
static class FastScanner {
private final InputStream in = System.in;
private final byte[] buffer = new byte[1024];
private int ptr = 0;
private int buflen = 0;
private boolean hasNextByte() {
if (ptr < buflen) {
return true;
} else {
ptr = 0;
try {
buflen = in.read(buffer);
} catch (IOException e) {
e.printStackTrace();
}
if (buflen <= 0) {
return false;
}
}
return true;
}
private int readByte() {
if (hasNextByte()) return buffer[ptr++];
else return -1;
}
private static boolean isPrintableChar(int c) {
return 33 <= c && c <= 126;
}
private void skipUnprintable() {
while (hasNextByte() && !isPrintableChar(buffer[ptr])) ptr++;
}
public boolean hasNext() {
skipUnprintable();
return hasNextByte();
}
public String next() {
if (!hasNext()) throw new NoSuchElementException();
StringBuilder sb = new StringBuilder();
int b = readByte();
while (isPrintableChar(b)) {
sb.appendCodePoint(b);
b = readByte();
}
return sb.toString();
}
public long nextLong() {
if (!hasNext()) throw new NoSuchElementException();
long n = 0;
boolean minus = false;
int b = readByte();
if (b == '-') {
minus = true;
b = readByte();
}
if (b < '0' || '9' < b) {
throw new NumberFormatException();
}
while (true) {
if ('0' <= b && b <= '9') {
n *= 10;
n += b - '0';
} else if (b == -1 || !isPrintableChar(b)) {
return minus ? -n : n;
} else {
throw new NumberFormatException();
}
b = readByte();
}
}
public int nextInt() {
return (int) nextLong();
}
public double nextDouble(){
return Double.parseDouble(next());
}
public int[] nextIntArray(int N, boolean oneBased) {
if (oneBased) {
int[] array = new int[N + 1];
for (int i = 1; i <= N; i++) {
array[i] = sc.nextInt();
}
return array;
} else {
int[] array = new int[N];
for (int i = 0; i < N; i++) {
array[i] = sc.nextInt();
}
return array;
}
}
public long[] nextLongArray(int N, boolean oneBased) {
if (oneBased) {
long[] array = new long[N + 1];
for (int i = 1; i <= N; i++) {
array[i] = sc.nextLong();
}
return array;
} else {
long[] array = new long[N];
for (int i = 0; i < N; i++) {
array[i] = sc.nextLong();
}
return array;
}
}
}
}
| Main.java:171: error: illegal start of type
}else {
^
1 error
|
s273876557 | p03836 | Java | import java.util.*;
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();
int x = tx - sx;
int y = ty - sy;
for (int j = 1; j <= 2; i++) {
for (int i = 1; i <= x; i++) {
System.out.print("R");
}
for (int i = 1; i <= y; i++) {
System.out.print("U");
}
for (int i = 1; i <= x; i++) {
System.out.print("L");
}
for (int i = 1; i <= y; i++) {
System.out.print("D");
}
}
}
} | Main.java:14: error: cannot find symbol
for (int j = 1; j <= 2; i++) {
^
symbol: variable i
location: class Main
1 error
|
s259062769 | p03836 | C++ | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
const int N = 5e4+5;
const int mod = 1e9+7;
//R , L , D , U
string dr = "RLDU";
int dx[]{1 , -1 , 0 , 0};
int dy[]{0 , 0 , -1 , 1};
int sx , sy;
int tx , ty;
string ans = "";
bool vis[N][N];
bool act[N][N];
pair < int , int > from[N][N];
char is[N][N];
void bfs(int a , int b , int c , int d){
for(int i = 0; i < N; i++)
for(int j = 0; j < N; j++){
from[i][j] = {0 , 0};
}
bool reach;
memset(vis , 0 , sizeof vis);
queue < pair < int , int > > q;
q.push({a , b});
while(q.size()){
int x = q.front().first;
int y = q.front().second;
q.pop();
if(x == c && y == d){
break;
}
vis[x][y] = 1;
for(int d = 0; d < 4; d++){
int X = dx[d] + x;
int Y = dy[d] + y;
if(!vis[X][Y] && !act[X][Y] && X >= 0 && Y >= 0){
from[X][Y].first = x;
from[X][Y].second = y;
is[X][Y] = dr[d];
vis[X][Y] = 1;
q.push({X , Y});
}
}
}
string cur;
int X = c , Y = d;
while(abs(X - a) + abs(Y - b) != 0){
cur = is[X][Y] + cur;
act[X][Y] = 1;
pair < int , int > p = from[X][Y];
X = p.first;
Y = p.second;
}
act[a][b] = 0;
act[c][d] = 0;
ans += cur;
//system("PAUSE");
}
int main() {
scanf("%d%d%d%d" , &sx , &sy , &tx , &ty);
sx += 1e3;
sy += 1e3;
tx += 1e3;
ty += 1e3;
bfs(sx , sy , tx , ty);
bfs(tx , ty , sx , sy);
bfs(sx , sy , tx , ty);
bfs(tx , ty , sx , sy);
printf("%s\n" , ans.c_str());
return 0;
}
| /tmp/cc2mnSYL.o: in function `bfs(int, int, int, int)':
a.cc:(.text+0x7b): relocation truncated to fit: R_X86_64_PC32 against symbol `from' defined in .bss section in /tmp/cc2mnSYL.o
a.cc:(.text+0x223): relocation truncated to fit: R_X86_64_PC32 against symbol `act' defined in .bss section in /tmp/cc2mnSYL.o
a.cc:(.text+0x27a): relocation truncated to fit: R_X86_64_PC32 against symbol `from' defined in .bss section in /tmp/cc2mnSYL.o
a.cc:(.text+0x2aa): relocation truncated to fit: R_X86_64_PC32 against symbol `from' defined in .bss section in /tmp/cc2mnSYL.o
a.cc:(.text+0x2ed): relocation truncated to fit: R_X86_64_PC32 against symbol `is' defined in .bss section in /tmp/cc2mnSYL.o
a.cc:(.text+0x3bd): relocation truncated to fit: R_X86_64_PC32 against symbol `is' defined in .bss section in /tmp/cc2mnSYL.o
a.cc:(.text+0x419): relocation truncated to fit: R_X86_64_PC32 against symbol `act' defined in .bss section in /tmp/cc2mnSYL.o
a.cc:(.text+0x443): relocation truncated to fit: R_X86_64_PC32 against symbol `from' defined in .bss section in /tmp/cc2mnSYL.o
a.cc:(.text+0x4b2): relocation truncated to fit: R_X86_64_PC32 against symbol `act' defined in .bss section in /tmp/cc2mnSYL.o
a.cc:(.text+0x4da): relocation truncated to fit: R_X86_64_PC32 against symbol `act' defined in .bss section in /tmp/cc2mnSYL.o
collect2: error: ld returned 1 exit status
|
s890785665 | p03836 | C++ | #include <iostream>
#include <queue>
#include <cstring>
using namespace std;
const int N=2010;
const int offset=1000;
typedef pair<int,int> PII;
int sx, sy, tx, ty;
int g[N][N];//0-路,1-墙
int dist[N][N];
int dx[]={0,1,0,-1},dy[]={1,0,-1,0};
PII prev[N][N];
void bfs(int sx, int sy, int tx, int ty){
memset(prev,0,sizeof(prev));
queue<PII> q;
memset(dist, -1, sizeof(dist));
q.push({sx,sy});
dist[sx][sy]=0;
while(q.size()){
PII t=q.front();q.pop();
int x=t.first, y=t.second;
if(x==tx && y==ty){
PII k=make_pair(tx,ty);
// printf("(%d,%d)->",tx-offset,ty-offset);
k=prev[tx][ty];
int p=tx,q=ty;
int a,b;
while(true){
a=k.first, b=k.second;
if(a==sx && b==sy) break;
g[a][b]=1;
if(a==p && b<q) cout<<'D';
else if(a==p && b>q) cout<<'U';
else if(a<p && b==q) cout<<'L';
else if(a>p && b==q) cout<<'R';
// printf("(%d,%d)->",a-offset,b-offset);
k=prev[a][b];
p=a,q=b;
}
a=sx,b=sy;
if(a==p && b<q) cout<<'D';
else if(a==p && b>q) cout<<'U';
else if(a<p && b==q) cout<<'L';
else if(a>p && b==q) cout<<'R';
break;
}
for(int i=0;i<4;i++){
int a=dx[i]+x,b=dy[i]+y;
if(dist[a][b]==-1 && g[a][b]!=1){
dist[a][b]=dist[x][y]+1;
prev[a][b]={x,y};
q.push({a,b});
}
}
}
}
int main(){
cin>>sx>>sy>>tx>>ty;
sx+=offset, sy+=offset, tx+=offset,ty+=offset;//to be positive
bfs(tx, ty, sx, sy);
bfs(sx, sy, tx, ty);
bfs(tx, ty, sx, sy);
bfs(sx, sy, tx, ty);
return 0;
}
| a.cc: In function 'void bfs(int, int, int, int)':
a.cc:14:16: error: reference to 'prev' is ambiguous
14 | memset(prev,0,sizeof(prev));
| ^~~~
In file included from /usr/include/c++/14/string:47,
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/stl_iterator_base_funcs.h:244:5: note: candidates are: 'template<class _BidirectionalIterator> constexpr _BidirectionalIterator std::prev(_BidirectionalIterator, typename iterator_traits<_Iter>::difference_type)'
244 | prev(_BidirectionalIterator __x, typename
| ^~~~
a.cc:12:5: note: 'PII prev [2010][2010]'
12 | PII prev[N][N];
| ^~~~
a.cc:14:30: error: reference to 'prev' is ambiguous
14 | memset(prev,0,sizeof(prev));
| ^~~~
/usr/include/c++/14/bits/stl_iterator_base_funcs.h:244:5: note: candidates are: 'template<class _BidirectionalIterator> constexpr _BidirectionalIterator std::prev(_BidirectionalIterator, typename iterator_traits<_Iter>::difference_type)'
244 | prev(_BidirectionalIterator __x, typename
| ^~~~
a.cc:12:5: note: 'PII prev [2010][2010]'
12 | PII prev[N][N];
| ^~~~
a.cc:28:27: error: reference to 'prev' is ambiguous
28 | k=prev[tx][ty];
| ^~~~
/usr/include/c++/14/bits/stl_iterator_base_funcs.h:244:5: note: candidates are: 'template<class _BidirectionalIterator> constexpr _BidirectionalIterator std::prev(_BidirectionalIterator, typename iterator_traits<_Iter>::difference_type)'
244 | prev(_BidirectionalIterator __x, typename
| ^~~~
a.cc:12:5: note: 'PII prev [2010][2010]'
12 | PII prev[N][N];
| ^~~~
a.cc:40:35: error: reference to 'prev' is ambiguous
40 | k=prev[a][b];
| ^~~~
/usr/include/c++/14/bits/stl_iterator_base_funcs.h:244:5: note: candidates are: 'template<class _BidirectionalIterator> constexpr _BidirectionalIterator std::prev(_BidirectionalIterator, typename iterator_traits<_Iter>::difference_type)'
244 | prev(_BidirectionalIterator __x, typename
| ^~~~
a.cc:12:5: note: 'PII prev [2010][2010]'
12 | PII prev[N][N];
| ^~~~
a.cc:56:33: error: reference to 'prev' is ambiguous
56 | prev[a][b]={x,y};
| ^~~~
/usr/include/c++/14/bits/stl_iterator_base_funcs.h:244:5: note: candidates are: 'template<class _BidirectionalIterator> constexpr _BidirectionalIterator std::prev(_BidirectionalIterator, typename iterator_traits<_Iter>::difference_type)'
244 | prev(_BidirectionalIterator __x, typename
| ^~~~
a.cc:12:5: note: 'PII prev [2010][2010]'
12 | PII prev[N][N];
| ^~~~
|
s862165840 | p03836 | C++ | #include <bits/stdc++.h>
using namespace std;
int main() {
int sx, sy, tx, ty;
cin >> sx >> sy >> tx >> ty;
int dx = tx - sx; dy = ty - sy;
for (int i = 0; i < dy; i++) {
cout << "U";
}
for (int i = 0; i < dx; i++) {
cout << "R";
}
for (int i = 0; i < dy; i++) {
cout << "D";
}
for (int i = 0; i < dx+1; i++) {
cout << "L";
}
for (int i = 0; i < dy + 1; i++) {
cout << "U";
}
for (int i = 0; i < dx + 1; i++) {
cout << "R";
}
cout << "DR";
for (int i = 0; i < dy + 1; i++) {
cout << "D";
}
for (int i = 0; i < dx + 1; i++) {
cout << "L";
}
cout << "U" << endl;
} | a.cc: In function 'int main()':
a.cc:9:21: error: 'dy' was not declared in this scope; did you mean 'dx'?
9 | int dx = tx - sx; dy = ty - sy;
| ^~
| dx
|
s505242475 | p03836 | C++ | #include<bits/stdc++.h>
using namespace std;
using ll = long long;
#define rep(i,n) for(ll i=0;i<n;i++)
#define repl(i,l,r) for(ll i=(l);i<(r);i++)
#define per(i,n) for(ll i=n-1;i>=0;i--)
#define perl(i,r,l) for(ll i=r-1;i>=l;i--)
#define fi first
#define se second
#define pb push_back
#define ins insert
#define all(x) (x).begin(),(x).end()
using vl=vector<ll>;
using vvl=vector<vector<ll>>;
const ll MOD=1000000007;
const ll MOD9=998244353;
const int inf=1e9+10;
const ll INF=4e18;
const ll dy[8]={1,0,-1,0,1,1,-1,-1};
const ll dx[8]={0,-1,0,1,1,-1,1,-1};
using Graph = vector<vector<int>>;
const double pi=acos(-1);
template<int MOD> struct Fp {
long long val;
constexpr Fp(long long v = 0) noexcept : val(v % MOD) {
if (val < 0) val += MOD;
}
constexpr int getmod() { return MOD; }
constexpr Fp operator - () const noexcept {
return val ? MOD - val : 0;
}
constexpr Fp operator + (const Fp& r) const noexcept { return Fp(*this) += r; }
constexpr Fp operator - (const Fp& r) const noexcept { return Fp(*this) -= r; }
constexpr Fp operator * (const Fp& r) const noexcept { return Fp(*this) *= r; }
constexpr Fp operator / (const Fp& r) const noexcept { return Fp(*this) /= r; }
constexpr Fp& operator += (const Fp& r) noexcept {
val += r.val;
if (val >= MOD) val -= MOD;
return *this;
}
constexpr Fp& operator -= (const Fp& r) noexcept {
val -= r.val;
if (val < 0) val += MOD;
return *this;
}
constexpr Fp& operator *= (const Fp& r) noexcept {
val = val * r.val % MOD;
return *this;
}
constexpr Fp& operator /= (const Fp& r) noexcept {
long long a = r.val, b = MOD, u = 1, v = 0;
while (b) {
long long t = a / b;
a -= t * b; swap(a, b);
u -= t * v; swap(u, v);
}
val = val * u % MOD;
if (val < 0) val += MOD;
return *this;
}
constexpr bool operator == (const Fp& r) const noexcept {
return this->val == r.val;
}
constexpr bool operator != (const Fp& r) const noexcept {
return this->val != r.val;
}
friend constexpr ostream& operator << (ostream &os, const Fp<MOD>& x) noexcept {
return os << x.val;
}
friend constexpr Fp<MOD> modpow(const Fp<MOD> &a, long long n) noexcept {
if (n == 0) return 1;
auto t = modpow(a, n / 2);
t = t * t;
if (n & 1) t = t * a;
return t;
}
};
using mint = Fp<MOD>;
vector<bool> seen,finished;
int pos = -1;
int ca=0;
int f=0;
void dfs(const Graph &G, int v, int p) {
seen[v] = true;
for (auto nv : G[v]) {
if (nv == p) continue;
if (finished[nv]) continue;
if (seen[nv] && !finished[nv]) {
pos = nv;f++;
return;
}
dfs(G, nv, v);
// サイクル検出したならば真っ直ぐに抜けていく
if (pos != -1) {
return;}}
finished[v] = true;
}
mint calc(long long N, long long K) {
mint res = 1;
for (long long n = 0; n < K; ++n) {
res *= (N - n);
res /= (n + 1);
}
return res;
}
void dfs(string s, char m){
if((int)s.size()==n){
cout << s << endl;}
else{
for(char c='a';c<=m; c++){
dfs(s+c,((c==m)?char(m+1):m));
}
}
}
int main() {
ll n,m,x,y; cin>>n>>m>>x>>y;
ll w = x - n;
ll h = y - m;
rep(i,h){
cout << "U";}
rep(i,w+1) cout << "R";
rep(i,h+1) cout << "D";
rep(i,w+1) cout << "L";
cout << "U";
cout << "L";
rep(i,h+1) cout << "U";
rep(i,w+1) cout << "R";
rep(i,h+1) cout << "D";
rep(i,w) cout << "L";
cout << endl;} | a.cc: In function 'void dfs(std::string, char)':
a.cc:109:21: error: 'n' was not declared in this scope
109 | if((int)s.size()==n){
| ^
|
s721386619 | p03836 | C++ | #include<iostream>
#include<vector>
#include<string>
#include<algorithm>
#include<cmath>
#include<bitset>
#include<deque>
#include<functional>
#include<iterator>
#include<map>
#include<set>
#include<stack>
#include<queue>
#include<utility>
using namespace std;
typedef long long ll;
typedef pair<ll,ll> P;
#define a first
#define b second
#define sz(x) (ll)((x).size())
#define pb push_back
#define mp make_pair
#define bg begin()
#define ed end()
#define all(x) (x).bg,(x).ed
#define rep(i,n) for(ll i=0;i<(n);i++)
#define rep1(i,n) for(ll i=1;i<=(n);i++)
#define rrep(i,n) for(ll i=(n)-1;i>=0;i--)
#define rrep1(i,n) for(ll i=(n);i>=1;i--)
#define FOR(i,a,b) for(ll i=(a);i<(b);i++)
const ll MOD=1000000007;
const ll INF=1000000000000000;
template<class T> inline bool chmin(T& a, T b){if(a>b){a=b;return true;}return false;}
template<class T> inline bool chmax(T& a, T b){if(a<b){a=b;return true;}return false;}
ll maxx(ll x,ll y,ll z){return max(max(x,y),z);}
ll minn(ll x,ll y,ll z){return min(min(x,y),z);}
ll gcd(ll x,ll y){if(x%y==0) return y;else return gcd(y,x%y);}
ll lcm(ll x,ll y){return x*(y/gcd(x,y));}
ll digsz(ll x){if(x==0) return 1;else{ll ans=0;while(x){x/=10;ans++;}return ans;}}
ll digsum(ll x){ll sum=0;while(x){sum+=x%10;x/=10;}return sum;}
vector<ll> pw2(62,1);vector<ll> pw10(19,1);
int main(){
{rep1(i,61) pw2[i]=2*pw2[i-1];}
{rep1(i,18) pw10[i]=10*pw10[i-1];}
ll sz,sy,tx,ty; cin>>sx>>sy>>tx>>ty;
ll X=tx-sx,Y=ty-sy;
rep(i,Y) cout<<'U';
rep(i,X) cout<<'R';
rep(i,Y) cout<<'D';
rep(i,X) cout<<'L';
cout<<'L';
rep(i,Y+1) cout<<'U';
rep(i,X+1) cout<<'R';
cout<<'D';
cout<<'R';
rep(i,Y+1) cout<<'D';
rep(i,X+1) cout<<'L';
cout<<'U';
}
| a.cc: In function 'int main()':
a.cc:48:26: error: 'sx' was not declared in this scope; did you mean 'tx'?
48 | ll sz,sy,tx,ty; cin>>sx>>sy>>tx>>ty;
| ^~
| tx
a.cc:50:11: error: 'Y' was not declared in this scope
50 | rep(i,Y) cout<<'U';
| ^
a.cc:26:32: note: in definition of macro 'rep'
26 | #define rep(i,n) for(ll i=0;i<(n);i++)
| ^
a.cc:52:11: error: 'Y' was not declared in this scope
52 | rep(i,Y) cout<<'D';
| ^
a.cc:26:32: note: in definition of macro 'rep'
26 | #define rep(i,n) for(ll i=0;i<(n);i++)
| ^
a.cc:55:11: error: 'Y' was not declared in this scope
55 | rep(i,Y+1) cout<<'U';
| ^
a.cc:26:32: note: in definition of macro 'rep'
26 | #define rep(i,n) for(ll i=0;i<(n);i++)
| ^
a.cc:59:11: error: 'Y' was not declared in this scope
59 | rep(i,Y+1) cout<<'D';
| ^
a.cc:26:32: note: in definition of macro 'rep'
26 | #define rep(i,n) for(ll i=0;i<(n);i++)
| ^
|
s052675716 | 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: In function 'int main()':
a.cc:4:2: error: 'cin' was not declared in this scope
4 | cin >> sx >> sy >> tx >> ty;
| ^~~
a.cc:9:2: error: 'cout' was not declared in this scope
9 | cout << string(dy,"U") << string(dx,"R");
| ^~~~
a.cc:9:10: error: 'string' was not declared in this scope
9 | cout << string(dy,"U") << string(dx,"R");
| ^~~~~~
a.cc:21:10: error: 'endl' was not declared in this scope
21 | cout << endl;
| ^~~~
|
s741438213 | p03836 | C++ | #include <iostream>
#include <string>
#include <stdio.h>
#include <cassert>
#include <vector>
#include <algorithm>
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: In function 'int main()':
a.cc:15:23: error: no matching function for call to 'std::__cxx11::basic_string<char>::basic_string(const int&, const char [2])'
15 | 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:15:20: error: invalid conversion from 'const char*' to 'std::__cxx11::basic_string<char>::size_type' {aka 'long unsigned int'} [-fpermissive]
15 | 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:15:23: note: deduced conflicting types for parameter '_InputIterator' ('int' and 'const char*')
15 | 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:15:20: note: cannot convert '"U"' (type 'const char [2]') to type 'char'
15 | 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:15:17: note: cannot convert 'dy' (type 'const int') to type 'const char*'
15 | 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: candida |
s126469952 | 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: 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:10: error: 'string' was not declared in this scope
8 | cout << string(dy,"U") << string(dx,"R");
| ^~~~~~
a.cc:20:10: error: 'endl' was not declared in this scope
20 | cout << endl;
| ^~~~
|
s227509745 | 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;
| ^~~~
|
s614262243 | p03836 | C++ | #define EXE
#ifdef EXE
// -------------------------------------------------------
#include <iostream>
#include <string>
#include <stdio.h>
#include <cassert>
#include <vector>
#include <algorithm>
using namespace std;
int min_steps = 10000;
int painted_offset = 10;
// string s;
int sx = 0;
int sy = 0;
int tx = 1;
int ty = 2;
#ifdef DEBUG
#else
cin >> sx >> sy >> tx >> ty;
#endif
vector<vector<int>> min_painted(20, vector<int>(20, -1));
string min_route;
void a(const int i0, const int j0, const int ax, const int ay, int now_steps, vector<vector<int>> painted, string route, int num, string direction) {
now_steps++;
route += direction;
if (now_steps > min_steps) return;
if (painted[i0 + painted_offset][j0 + painted_offset] != 9) {
if (painted[i0 + painted_offset][j0 + painted_offset] != -1) {
return;
}
painted[i0 + painted_offset][j0 + painted_offset] = num;
}
if (i0 == ax && j0 == ay) {
//cout << "goal" << min_steps << " " << now_steps << " " << i0 << " " << j0 << endl;
if (min_steps > now_steps)
{
min_steps = now_steps;
min_painted = painted;
min_route = route;
//cout << i0 << " " << j0 << " " << min_steps << endl;
}
return;
}
int move_i, move_j;
if (!num) {
move_i = 0;
move_j = 0;
}
else {
move_i = -1;
move_j = -1;
}
for (int i = move_i; i < 2; i++) {
for (int j = move_j; j < 2; j++) {
if (abs(i) == abs(j)) continue;
if (painted[i0 + i + painted_offset][j0 + j + painted_offset] != -1 && painted[i0 + i + painted_offset][j0 + j + painted_offset] != 9) {
continue;
}
if (abs(i0 + i) > 8 || abs(j0 + j) > 8) {
continue;
}
if (num) {
int tmp_i = i0 + i + painted_offset;
int tmp_j = j0 + j + painted_offset;
int num_neighbor_painted = 0;
for (int ii = -1; ii < 2; ii++) {
for (int jj = -1; jj < 2; jj++) {
if (painted[tmp_i + ii][tmp_j + jj] != -1 && painted[tmp_i + ii][tmp_j + jj] != num)num_neighbor_painted++;
}
}
if (!num_neighbor_painted) {
continue;
}
}
string next_direction;
if (i == -1) {
next_direction = "L";
}
else if (i == 1) {
next_direction = "R";
}
else if (j == -1) {
next_direction = "D";
}
else if (j == 1) {
next_direction = "U";
}
else {
assert(0);
}
a(i0 + i, j0 + j, ax, ay, now_steps, painted, route, num, next_direction);
}
}
return;
}
int main() {
vector<int> s{ sx, sy };
vector<vector<int>> painted(20, vector<int>(20, -1));
painted[painted_offset + sx][painted_offset + sy] = 9;
painted[painted_offset + tx][painted_offset + ty] = 9;
vector<int> t{ tx, ty };
int now_steps = 0;
string first_direction;
a(sx, sy, tx, ty, now_steps, painted, min_route, 0, first_direction);
if (0) {
for (vector<int> painted_y : min_painted) {
for (int painted_x : painted_y) {
cout << painted_x << " ";
}
cout << endl;
}
}
min_steps = 10000;
a(tx, ty, sx, sy, now_steps, min_painted, min_route, 1, first_direction);
if (0) {
for (vector<int> painted_y : min_painted) {
for (int painted_x : painted_y) {
cout << painted_x << " ";
}
cout << endl;
}
}
//std::cout << min_steps << endl;
min_steps = 10000;
a(sx, sy, tx, ty, now_steps, min_painted, min_route, 2, first_direction);
min_steps = 10000;
if (0) {
for (vector<int> painted_y : min_painted) {
for (int painted_x : painted_y) {
cout << painted_x << " ";
}
cout << endl;
}
}
min_steps = 10000;
a(tx, ty, sx, sy, now_steps, min_painted, min_route, 3, first_direction);
cout << min_route << endl;
if (0) {
for (vector<int> painted_y : min_painted) {
for (int painted_x : painted_y) {
cout << painted_x << " ";
}
cout << endl;
}
}
//std::cout << min_steps << endl;
#ifdef DEBUG
int z;
cin >> z;
#endif
return 0;
}
// -------------------------------------------------------
#endif | a.cc:26:1: error: 'cin' does not name a type
26 | cin >> sx >> sy >> tx >> ty;
| ^~~
|
s992607712 | p03836 | C++ | #include <bits/stdc++.h>
using namespace std;
int maiin()
{
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 << "D";
for (int i = 0; i < tx - sx; i++)cout << "L";
for (int i = 0; i < ty - sy; i++)cout << "U";
cout << "U";
for (int i = 0; i < tx - sx + 1; i++)cout << "R";
for (int i = 0; i < ty - sy + 1; i++)cout << "D";
cout << "LD";
for (int i = 0; i < tx - sx + 1; i++)cout << "L";
for (int i = 0; i < ty - sy + 1; i++)cout << "U";
cout << "R";
} | a.cc: In function 'int maiin()':
a.cc:21:1: warning: no return statement in function returning non-void [-Wreturn-type]
21 | }
| ^
/usr/bin/ld: /usr/lib/gcc/x86_64-linux-gnu/14/../../../x86_64-linux-gnu/Scrt1.o: in function `_start':
(.text+0x17): undefined reference to `main'
collect2: error: ld returned 1 exit status
|
s111309198 | p03836 | C++ | #include <iostream>
#include <vector>
#include <cmath>
#include <iomanip>
#include <algorithm>
#include <queue>
using namespace std;
#define rep(i,n) for(int i=0; i<(n); i++)
#define all(x) (x).begin(), (x).end()
int main() {
int sx,sy,tx,ty;
cin>>sx>>sy>>tx>>ty;
int u,r;
u=ty-sy;
r=tx-sx;
rep(i,u)cout<<'U';
rep(i,r)cout<<'R';
rep(i,u)cout<<'D';
rep(i,r+1)cout<<'L';
rep(i,u+1)cout<<'U';
rep(i,r+1)cout<<'R';
cout<<'D'<<'R';
rep(i,d+1)cout<<'D';
rep(i,r+1)cout<<'L';
cout<<'U';
return 0;
}
| a.cc: In function 'int main()':
a.cc:24:11: error: 'd' was not declared in this scope
24 | rep(i,d+1)cout<<'D';
| ^
a.cc:8:34: note: in definition of macro 'rep'
8 | #define rep(i,n) for(int i=0; i<(n); i++)
| ^
|
s542674359 | p03836 | C++ | || oj test -c ./app
|| [!] update available: 7.6.0 -> 10.0.3
|| [*] run: $ pip3 install -U online-judge-tools
|| [*] see: https://github.com/kmyk/online-judge-tools/blob/master/CHANGELOG.md
|| [*] 4 cases found
||
|| [*] sample-1
|| [x] time: 0.011114 sec
|| [-] WA
|| output:
|| UUUUUUUUUUDDDDDDDDDDUUUUUUUUUUUDRDDDDDDDDDDDU
||
|| expected:
|| 9
||
||
|| [*] sample-2
|| [x] time: 0.010931 sec
|| [-] WA
|| output:
|| UUUUUDDDDDUUUUUUDRDDDDDDU
||
|| expected:
|| 6
||
||
|| [*] sample-3
| a.cc:2:26: error: too many decimal points in number
2 | || [!] update available: 7.6.0 -> 10.0.3
| ^~~~~
a.cc:2:35: error: too many decimal points in number
2 | || [!] update available: 7.6.0 -> 10.0.3
| ^~~~~~
a.cc:1:1: error: expected unqualified-id before '||' token
1 | || oj test -c ./app
| ^~
|
s209298136 | p03836 | C++ | #include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
int64_t MOD=1000000007;
int main() {
int a,b,x,y;
cin>>a>>b>>x>>y;
x-=a;
y-=b;
rep(i,x) coyt<<"R";
rep(i,y) cout<<"U";
rep(i,x) cout<<"L";
rep(i,y+1) cout<<"D";
rep(i,x+1) cout<<"R";
rep(i,y+1) cout<<"U";
cout<<"LU";
rep(i,x+1) cout<<"L";
rep(i,y+1) cout<<"D";
cout<<"R";
}
| a.cc: In function 'int main()':
a.cc:11:12: error: 'coyt' was not declared in this scope
11 | rep(i,x) coyt<<"R";
| ^~~~
|
s944207889 | p03836 | Java | import java.util.*;
public class Main {
public static int verticalSide;
public static int holizonticalSide;
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();
// 答えをここに入れていくよ
List<String> ansList = new ArrayList<>();
// 縦の辺の長さ
verticalSide = tx - sx;
// 横の辺の長さ
holizonticalSide = ty - sy;
// 1往復目_行き
shortest(ansList, "R", "U");
// 1往復目_帰り
ansList.add("R");
verticalMove(ansList, "D");
ansList.add("D");
ansList.add("L");
holizonticalMove(ansList, "L");
ansList.add("U");
// 2往復目_行き
ansList.add("L");
verticalMove(ansList, "U");
ansList.add("U");
ansList.add("R");
holizonticalMove(ansList, "R");
ansList.add("D");
// 2往復目_帰り
shortest(ansList, "L", "U");
// 出力
System.out.println(ansList);
}
// 最短で行く場合の道のり
private static void shortest(List<String> ansList, String horizonticalChar, String verticalChar){
// 長方形の横の辺上を移動する
holizonticalMove(ansList, horizonticalChar);
// 長方形の縦の辺上を移動する
verticalMove(ansList, verticalChar);
}
// 長方形の横の辺上を移動する
private void holizonticalMove(List<String> ansList, String horizonticalChar){
for(int i = 0; i < holizonticalSide ; i++){
ansList.add(horizonticalChar);
}
}
// 長方形の縦の辺上を移動する
private void verticalMove(List<String> ansList, String verticalChar){
for(int i = 0; i < verticalSide ; i++){
ansList.add(verticalChar);
}
}
} | Main.java:27: error: non-static method verticalMove(List<String>,String) cannot be referenced from a static context
verticalMove(ansList, "D");
^
Main.java:30: error: non-static method holizonticalMove(List<String>,String) cannot be referenced from a static context
holizonticalMove(ansList, "L");
^
Main.java:35: error: non-static method verticalMove(List<String>,String) cannot be referenced from a static context
verticalMove(ansList, "U");
^
Main.java:38: error: non-static method holizonticalMove(List<String>,String) cannot be referenced from a static context
holizonticalMove(ansList, "R");
^
Main.java:51: error: non-static method holizonticalMove(List<String>,String) cannot be referenced from a static context
holizonticalMove(ansList, horizonticalChar);
^
Main.java:53: error: non-static method verticalMove(List<String>,String) cannot be referenced from a static context
verticalMove(ansList, verticalChar);
^
6 errors
|
s826404635 | p03836 | C++ | #include <bits/stdc++.h>
using namespace std;
int main() {
int A,B,C,D;
cin >> A >> B >> C >> D;
for(int i = 0; i < C-A; i++) {
cout << 'U';
}
for(int i = 0; i < D-B; i++) {
cout << 'R';
}
for(int i = 0; i < D-B+1; i++) {
cout << 'L';
}
for(int i = 0; i < C-A+1: i++) {
cout << 'D';
}
for(int i = 0; i < C-A; i++) {
cout << 'R';
}
for(int i = 0; i < D-B; i++) {
cout << 'U';
}
for(int i = 0; i < D-B+1; i++) {
cout << 'D';
}
for(int i = 0; i < C-A+1: i++) {
cout << 'L';
}
} | a.cc: In function 'int main()':
a.cc:15:20: warning: range-based 'for' loops with initializer only available with '-std=c++20' or '-std=gnu++20' [-Wc++20-extensions]
15 | for(int i = 0; i < C-A+1: i++) {
| ^
a.cc:15:29: error: expected ';' before ':' token
15 | for(int i = 0; i < C-A+1: i++) {
| ^
| ;
a.cc:18:5: error: expected primary-expression before 'for'
18 | for(int i = 0; i < C-A; i++) {
| ^~~
a.cc:17:6: error: expected ';' before 'for'
17 | }
| ^
| ;
18 | for(int i = 0; i < C-A; i++) {
| ~~~
a.cc:18:5: error: expected primary-expression before 'for'
18 | for(int i = 0; i < C-A; i++) {
| ^~~
a.cc:17:6: error: expected ')' before 'for'
17 | }
| ^
| )
18 | for(int i = 0; i < C-A; i++) {
| ~~~
a.cc:15:8: note: to match this '('
15 | for(int i = 0; i < C-A+1: i++) {
| ^
a.cc:27:20: warning: range-based 'for' loops with initializer only available with '-std=c++20' or '-std=gnu++20' [-Wc++20-extensions]
27 | for(int i = 0; i < C-A+1: i++) {
| ^
a.cc:27:29: error: expected ';' before ':' token
27 | for(int i = 0; i < C-A+1: i++) {
| ^
| ;
a.cc:30:1: error: expected primary-expression before '}' token
30 | }
| ^
a.cc:29:6: error: expected ';' before '}' token
29 | }
| ^
| ;
30 | }
| ~
a.cc:30:1: error: expected primary-expression before '}' token
30 | }
| ^
a.cc:29:6: error: expected ')' before '}' token
29 | }
| ^
| )
30 | }
| ~
a.cc:27:8: note: to match this '('
27 | for(int i = 0; i < C-A+1: i++) {
| ^
a.cc:30:1: error: expected primary-expression before '}' token
30 | }
| ^
|
s318608575 | p03836 | Java | import java.util.*;
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();
String first =
// 出力
System.out.println((a+b+c) + " " + s);
}
} | Main.java:14: error: cannot find symbol
System.out.println((a+b+c) + " " + s);
^
symbol: variable a
location: class Main
Main.java:14: error: cannot find symbol
System.out.println((a+b+c) + " " + s);
^
symbol: variable b
location: class Main
Main.java:14: error: cannot find symbol
System.out.println((a+b+c) + " " + s);
^
symbol: variable c
location: class Main
Main.java:14: error: cannot find symbol
System.out.println((a+b+c) + " " + s);
^
symbol: variable s
location: class Main
4 errors
|
s904556619 | 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<(ty-sy);i++){
cout << "U" <<end;
}
for(int i=0;i<(tx-sx);i++){
cout << "R" <<end;
}
for(int i=0;i<(ty-sy);i++){
cout << "D" <<end;
}
for(int i=0;i<(tx-sx);i++){
cout << "L" <<end;
}
cout << "L" <<end;
for(int i=0;i<(ty-sy+1);i++){
cout << "U" <<end;
}
for(int i=0;i<(tx-sx+1);i++){
cout << "R" <<end;
}
cout << "D" << end;
for(int i=0;i<(ty-sy+1);i++){
cout << "D" <<end;
}
for(int i=0;i<(tx-sx+1);i++){
cout << "L" <<end;
}
cout << "U" << end;
} | a.cc: In function 'int main()':
a.cc:8:17: error: no match for 'operator<<' (operand types are 'std::basic_ostream<char>' and '<unresolved overloaded function type>')
8 | cout << "U" <<end;
| ~~~~~~~~~~~~^~~~~
In file included from /usr/include/c++/14/istream:41,
from /usr/include/c++/14/sstream:40,
from /usr/include/c++/14/complex:45,
from /usr/include/c++/14/ccomplex:39,
from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:127,
from a.cc:1:
/usr/include/c++/14/ostream:116:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(__ostream_type& (*)(__ostream_type&)) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>]'
116 | operator<<(__ostream_type& (*__pf)(__ostream_type&))
| ^~~~~~~~
/usr/include/c++/14/ostream:116:36: note: no known conversion for argument 1 from '<unresolved overloaded function type>' 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 '<unresolved overloaded function type>' 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 '<unresolved overloaded function type>' 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 '<unresolved overloaded function type>' 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 '<unresolved overloaded function type>' 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 '<unresolved overloaded function type>' 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 '<unresolved overloaded function type>' 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 '<unresolved overloaded function type>' 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 '<unresolved overloaded function type>' 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 '<unresolved overloaded function type>' 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 '<unresolved overloaded function type>' 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 '<unresolved overloaded function type>' 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 '<unresolved overloaded function type>' 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 '<unresolved overloaded function type>' to 'float'
235 | operator<<(float __f)
| ~~~~~~^~~
/usr/include/c++/14/ostream:243:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(long double) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>]'
243 | operator<<(long double __f)
| ^~~~~~~~
/usr/include/c++/14/ostream:243:30: note: no known conversion for argument 1 from '<unresolved overloaded function type>' to 'long double'
243 | operator<<(long double __f)
| ~~~~~~~~~~~~^~~
/usr/include/c++/14/ostream:301:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(const void*) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>]'
301 | operator<<(const void* __p)
| ^~~~~~~~
/usr/include/c++/14/ostream:301:30: note: no known conversion for argument 1 from '<unresolved overloaded function type>' to 'const void*'
301 | operator<<(const void* __p)
| ~~~~~~~~~~~~^~~
/usr/include/c++/14/ostream:306:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(std::nullptr_t) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>; std::nullptr_t = std::nullptr_t]'
306 | o |
s209860327 | p03836 | C++ | #include <bits/stdc++.h>
#include <map> // pair
using namespace std;
typedef long long ll;
#define vec vector<int>
#define vecll vector<ll>
#define rep(i,n) for(int i=(int)0; i<(int)n; i++)
#define llrep(i,n) for(ll i=(ll)0; i<(ll)n; i++)
#define REP(i,m,n) for(int i=(int)m; i<(int)n; i++)
#define prt_dbl(i,var) cout<<fixed<<setprecision(i)<<var<<endl;
#define dpair pair<double,double>
template <typename Val>
Val gcd(Val a, Val b) {
//use ll or int for gcd
if (b==0) return a;
else return gcd(b, a%b);
}
template <typename Val>
Val vec_max(vector<Val> v){
return *max_element(v.begin(),v.end());
}
template <typename Val>
Val vec_min(vector<Val> v){
return *min_element(v.begin(),v.end());
}
template <typename Val>
void show_vec(vector<Val> *v){
cout<<endl;
rep(i,v->size()){
cout<<v->at(i)<<" ";
}
cout<<endl;
}
template <typename Val,typename Number>
void count_vector(vector<Val>* A,vector<pair<Number,Val>>*R){
sort(A->begin(),A->end());
int count = 1;
rep(i,A->size()){
if(i<A->size()-1){
if(A->at(i)==A->at(i+1))count++;
else{
R->emplace_back(count,A->at(i));
count = 1;
}
}else{
R->emplace_back(count,A->at(i));
}
}
}
//---------------------------------------------------------------
int main(){
Point s;
Point t;
string ans;
cin>>s.x>>s.y>>t.x>>t.y;
int step_x = - s.x + t.x;
int step_y = - s.y + t.y;
rep(i,step_y){
ans.push_back('U');
}
rep(i,step_x){
ans.push_back('R');
}
rep(i,step_y){
ans.push_back('B');
}
rep(i,step_x){
ans.push_back('L');
}
ans.push_back('L');
rep(i,step_y+1){
ans.push_back('U');
}
rep(i,step_x+1){
ans.push_back('R');
}
ans.push_back('B');
ans.push_back('R');
rep(i,step_y+1){
ans.push_back('B');
}
rep(i,step_x+1){
ans.push_back('L');
}
ans.push_back('U');
cout<<ans<<endl;
}
| a.cc: In function 'int main()':
a.cc:60:3: error: 'Point' was not declared in this scope
60 | Point s;
| ^~~~~
a.cc:61:8: error: expected ';' before 't'
61 | Point t;
| ^~
| ;
a.cc:63:8: error: 's' was not declared in this scope
63 | cin>>s.x>>s.y>>t.x>>t.y;
| ^
a.cc:63:18: error: 't' was not declared in this scope; did you mean 'tm'?
63 | cin>>s.x>>s.y>>t.x>>t.y;
| ^
| tm
|
s180548842 | p03836 | C++ | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
ll main(){
ll sx,sy,tx,ty;
cin >>sx>>sy>>tx>>ty;
string s;
for (ll i = 0; i < ty-sy; i++) {
s.push_back('U');
}
for (ll i = 0; i < tx-sx; i++) {
s.push_back('R');
}
for (ll i = 0; i < ty-sy; i++) {
s.push_back('D');
}
for (ll i = 0; i <= tx-sx; i++) {
s.push_back('L');
}
for (ll i = 0; i <= ty-sy; i++) {
s.push_back('U');
}
for (ll i = 0; i <= tx-sx; i++) {
s.push_back('R');
}
s.push_back('D');
s.push_back('R');
for (ll i = 0; i <= tx-sx; i++) {
s.push_back('D');
}
for (ll i = 0; i <= tx-sx; i++) {
s.push_back('L');
}
s.push_back('U');
cout << s << endl;
}
| a.cc:5:1: error: '::main' must return 'int'
5 | ll main(){
| ^~
|
s121271975 | p03836 | C++ | # back and force
ln = list(map(int, input().split(' ')))
disX = ln[2] - ln[0]
disY = ln[3] - ln[1]
output=''
u='U'
d='D'
r='R'
l='L'
# 一周め
for i in range(disY):
output+= u
for i in range(disX):
output+= r
for i in range(disY):
output+= d
for i in range(disX):
output+= l
#2週め
output+= l+u
for i in range(disY):
output+= u
for i in range(disX):
output+= r
output+= r+d +r+d
for i in range(disY):
output+= d
for i in range(disX):
output+= l
output+= l+u
print(output) | a.cc:1:3: error: invalid preprocessing directive #back
1 | # back and force
| ^~~~
a.cc:5:8: error: empty character constant
5 | output=''
| ^~
a.cc:10:2: error: extended character is not valid in an identifier
10 | # 一周め
| ^
a.cc:10:2: error: invalid preprocessing directive #\U00003000\U00004e00\U00005468\U00003081
10 | # 一周め
| ^~~~~~~~
a.cc:19:2: error: "2週め" after # is not a positive integer
19 | #2週め
| ^~~~~
a.cc:2:1: error: 'ln' does not name a type; did you mean 'long'?
2 | ln = list(map(int, input().split(' ')))
| ^~
| long
|
s198318888 | p03836 | C++ | int hori = abs(sx-tx);
string ans = "";
adder(ans,verti,'U');
adder(ans,hori,'R');
adder(ans,verti,'D');
adder(ans,hori,'L');
adder(ans,1,'L');
adder(ans,verti+1,'U');
adder(ans,hori+1,'R');
adder(ans,1,'D');
adder(ans,1,'R');
adder(ans,verti+1,'D');
adder(ans,hori+1,'L');
adder(ans,1,'U');
cout<<ans<<endl; | a.cc:1:17: error: 'sx' was not declared in this scope
1 | int hori = abs(sx-tx);
| ^~
a.cc:1:20: error: 'tx' was not declared in this scope
1 | int hori = abs(sx-tx);
| ^~
a.cc:1:13: error: 'abs' was not declared in this scope
1 | int hori = abs(sx-tx);
| ^~~
a.cc:2:5: error: 'string' does not name a type
2 | string ans = "";
| ^~~~~~
a.cc:3:10: error: expected constructor, destructor, or type conversion before '(' token
3 | adder(ans,verti,'U');
| ^
a.cc:4:10: error: expected constructor, destructor, or type conversion before '(' token
4 | adder(ans,hori,'R');
| ^
a.cc:5:10: error: expected constructor, destructor, or type conversion before '(' token
5 | adder(ans,verti,'D');
| ^
a.cc:6:10: error: expected constructor, destructor, or type conversion before '(' token
6 | adder(ans,hori,'L');
| ^
a.cc:7:10: error: expected constructor, destructor, or type conversion before '(' token
7 | adder(ans,1,'L');
| ^
a.cc:8:10: error: expected constructor, destructor, or type conversion before '(' token
8 | adder(ans,verti+1,'U');
| ^
a.cc:9:10: error: expected constructor, destructor, or type conversion before '(' token
9 | adder(ans,hori+1,'R');
| ^
a.cc:10:10: error: expected constructor, destructor, or type conversion before '(' token
10 | adder(ans,1,'D');
| ^
a.cc:11:10: error: expected constructor, destructor, or type conversion before '(' token
11 | adder(ans,1,'R');
| ^
a.cc:12:10: error: expected constructor, destructor, or type conversion before '(' token
12 | adder(ans,verti+1,'D');
| ^
a.cc:13:10: error: expected constructor, destructor, or type conversion before '(' token
13 | adder(ans,hori+1,'L');
| ^
a.cc:14:10: error: expected constructor, destructor, or type conversion before '(' token
14 | adder(ans,1,'U');
| ^
a.cc:15:5: error: 'cout' does not name a type
15 | cout<<ans<<endl;
| ^~~~
|
s792041538 | 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+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";
cout<<"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"<<endl;
return 0;
} | a.cc: In function 'int main()':
a.cc:6:28: error: expected ';' before ')' token
6 | for(int i=0<i<(tx-sx);i++)
| ^
| ;
|
s814666505 | p03836 | C++ | #include <bits/stdc++.h>
#define rep(i,n) for (int i = 0; i < (n); i++)
using namespace std;
typedef long long ll;
const int inf = 1001001001;
void forth(int x, int y, bool grid[2000][2000]){
grid.at(x).at(y) == 0;
if(int x < tx && grid.at(x+1).at(y) == 1){
x++;
cout << 'R' << endl;
return next(x,y);
}
if(int y < ty && grid.at(x).at(y+1) == 1){
y++;
cout << 'U' << endl;
return next(x,y);
}
if(x == tx && y == ty) return 0;
}
void back(int x, int y){
grid.at(x).at(y) == 0;
if(int x > sx && grid.at(x-1).at(y) == 1){
x--;
cout << 'L' << endl;
return back(x,y);
}
if(int y > sy && grid.at(x).at(y-1) == 1){
y--;
cout << 'U' << endl;
return back(x,y);
}
if(x == sx && y == sy) return 0;
}
int main(){
int sx,sy,tx,ty;
cin >> sx >> sy >> tx >> ty;
vector<vector<bool>> grid(ty, vector<bool> (tx,1));
forth(0, 0, grid);
back(tx, ty, grid);
} | a.cc: In function 'void forth(int, int, bool (*)[2000])':
a.cc:8:8: error: request for member 'at' in 'grid', which is of non-class type 'bool (*)[2000]'
8 | grid.at(x).at(y) == 0;
| ^~
a.cc:9:12: error: expected initializer before '<' token
9 | if(int x < tx && grid.at(x+1).at(y) == 1){
| ^
a.cc:9:11: error: expected ')' before '<' token
9 | if(int x < tx && grid.at(x+1).at(y) == 1){
| ~ ^~
| )
a.cc:12:16: error: no matching function for call to 'next(int&, int&)'
12 | return next(x,y);
| ~~~~^~~~~
In file included from /usr/include/c++/14/bits/stl_algobase.h:66,
from /usr/include/c++/14/algorithm:60,
from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:51,
from a.cc:1:
/usr/include/c++/14/bits/stl_iterator_base_funcs.h:232:5: note: candidate: 'template<class _InputIterator> constexpr _InputIterator std::next(_InputIterator, typename iterator_traits<_Iter>::difference_type)'
232 | next(_InputIterator __x, typename
| ^~~~
/usr/include/c++/14/bits/stl_iterator_base_funcs.h:232:5: note: template argument deduction/substitution failed:
/usr/include/c++/14/bits/stl_iterator_base_funcs.h: In substitution of 'template<class _InputIterator> constexpr _InputIterator std::next(_InputIterator, typename iterator_traits<_Iter>::difference_type) [with _InputIterator = int]':
a.cc:12:16: required from here
12 | return next(x,y);
| ~~~~^~~~~
/usr/include/c++/14/bits/stl_iterator_base_funcs.h:232:5: error: no type named 'difference_type' in 'struct std::iterator_traits<int>'
232 | next(_InputIterator __x, typename
| ^~~~
a.cc:14:12: error: expected initializer before '<' token
14 | if(int y < ty && grid.at(x).at(y+1) == 1){
| ^
a.cc:14:11: error: expected ')' before '<' token
14 | if(int y < ty && grid.at(x).at(y+1) == 1){
| ~ ^~
| )
a.cc:17:16: error: no matching function for call to 'next(int&, int&)'
17 | return next(x,y);
| ~~~~^~~~~
/usr/include/c++/14/bits/stl_iterator_base_funcs.h:232:5: note: candidate: 'template<class _InputIterator> constexpr _InputIterator std::next(_InputIterator, typename iterator_traits<_Iter>::difference_type)'
232 | next(_InputIterator __x, typename
| ^~~~
/usr/include/c++/14/bits/stl_iterator_base_funcs.h:232:5: note: template argument deduction/substitution failed:
/usr/include/c++/14/bits/stl_iterator_base_funcs.h: In substitution of 'template<class _InputIterator> constexpr _InputIterator std::next(_InputIterator, typename iterator_traits<_Iter>::difference_type) [with _InputIterator = int]':
a.cc:17:16: required from here
17 | return next(x,y);
| ~~~~^~~~~
/usr/include/c++/14/bits/stl_iterator_base_funcs.h:232:5: error: no type named 'difference_type' in 'struct std::iterator_traits<int>'
232 | next(_InputIterator __x, typename
| ^~~~
a.cc:19:11: error: 'tx' was not declared in this scope; did you mean 'x'?
19 | if(x == tx && y == ty) return 0;
| ^~
| x
a.cc:19:22: error: 'ty' was not declared in this scope; did you mean 'y'?
19 | if(x == tx && y == ty) return 0;
| ^~
| y
a.cc:19:33: error: return-statement with a value, in function returning 'void' [-fpermissive]
19 | if(x == tx && y == ty) return 0;
| ^
a.cc: In function 'void back(int, int)':
a.cc:23:3: error: 'grid' was not declared in this scope
23 | grid.at(x).at(y) == 0;
| ^~~~
a.cc:24:12: error: expected initializer before '>' token
24 | if(int x > sx && grid.at(x-1).at(y) == 1){
| ^
a.cc:24:11: error: expected ')' before '>' token
24 | if(int x > sx && grid.at(x-1).at(y) == 1){
| ~ ^~
| )
a.cc:29:12: error: expected initializer before '>' token
29 | if(int y > sy && grid.at(x).at(y-1) == 1){
| ^
a.cc:29:11: error: expected ')' before '>' token
29 | if(int y > sy && grid.at(x).at(y-1) == 1){
| ~ ^~
| )
a.cc:34:13: error: 'sx' was not declared in this scope; did you mean 'x'?
34 | if(x == sx && y == sy) return 0;
| ^~
| x
a.cc:34:24: error: 'sy' was not declared in this scope; did you mean 'y'?
34 | if(x == sx && y == sy) return 0;
| ^~
| y
a.cc:34:35: error: return-statement with a value, in function returning 'void' [-fpermissive]
34 | if(x == sx && y == sy) return 0;
| ^
a.cc: In function 'int main()':
a.cc:42:15: error: cannot convert 'std::vector<std::vector<bool> >' to 'bool (*)[2000]'
42 | forth(0, 0, grid);
| ^~~~
| |
| std::vector<std::vector<bool> >
a.cc:7:31: note: initializing argument 3 of 'void forth(int, int, bool (*)[2000])'
7 | void forth(int x, int y, bool grid[2000][2000]){
| ~~~~~^~~~~~~~~~~~~~~~
a.cc:43:7: error: too many arguments to function 'void back(int, int)'
43 | back(tx, ty, grid);
| ~~~~^~~~~~~~~~~~~~
a.cc:22:6: note: declared here
22 | void back(int x, int y){
| ^~~~
|
s929971073 | p03836 | C++ | sx, sy, tx, ty = gets.split.map(&:to_i)
a = tx - sx
b = ty - sy
print "U" * b + "R" * a
print "D" * b + "L" * a
print "L" + "U" * (b + 1) + "R" * (a + 1) + "D"
print "R" + "D" * (b + 1) + "L" * (a + 1) + "U" + "\n" | a.cc:1:1: error: 'sx' does not name a type
1 | sx, sy, tx, ty = gets.split.map(&:to_i)
| ^~
|
s277028206 | p03836 | C++ | #include <bits/stdc++.h>
using namespace std;
typedef long long int ll;
#define FOR(i,l,r) for(i=l;i<r;i++)
#define REP(i,n) FOR(i,0,n)
#define ALL(x) x.begin(),x.end()
#define P pair<ll,ll>
#define F first
#define S second
signed main(){
ll sx,sy,X,Y,i;
cin>>sx>>sy>>X>>Y;
X-=sx;Y-=sy
REP(i,X)cout<<'R';
REP(i,Y)cout<<'U';
REP(i,X)cout<<'L';
REP(i,Y+1)cout<<'D';
REP(i,X+1)cout<<'R';
REP(i,Y+1)cout<<'U';
cout<<"LU";
REP(i,X+1)cout<<'L';
REP(i,Y+1)cout<<'D';
cout<<'R'<<endl;
return 0;
} | a.cc: In function 'int main()':
a.cc:13:14: error: expected ';' before 'for'
13 | X-=sx;Y-=sy
| ^
| ;
a.cc:4:35: error: expected ';' before ')' token
4 | #define FOR(i,l,r) for(i=l;i<r;i++)
| ^
a.cc:5:18: note: in expansion of macro 'FOR'
5 | #define REP(i,n) FOR(i,0,n)
| ^~~
a.cc:14:3: note: in expansion of macro 'REP'
14 | REP(i,X)cout<<'R';
| ^~~
|
s689200701 | p03836 | C++ | #include <bits/stdc++.h>
using namespace std;
typedef long long int ll;
#define FOR(i,l,r) for(i=l;i<r;i++)
#define REP(i,n) FOR(i,0,n)
#define ALL(x) x.begin(),x.end()
#define P pair<ll,ll>
#define F first
#define S second
signed main(){
ll sx,sy,X,Y,i;
cin>>sx>>sy>>X>>Y;
X-=sx;Y-=sy
REP(i,X)cout<<'R';
REP(i,Y)cout<<'U';
REP(i,X)cout<<'L';
REP(i,Y+1)cout<<'D';
REP(i,X+1)cout<<'R';
REP(i,Y+1)cout<<'U';
cout<<"LU";
REP(i,X+1)cout<<'L';
REP(i,Y+1)cout<<'D';
cout<<'R'<<endl;
return 0;
} | a.cc: In function 'int main()':
a.cc:13:14: error: expected ';' before 'for'
13 | X-=sx;Y-=sy
| ^
| ;
a.cc:4:35: error: expected ';' before ')' token
4 | #define FOR(i,l,r) for(i=l;i<r;i++)
| ^
a.cc:5:18: note: in expansion of macro 'FOR'
5 | #define REP(i,n) FOR(i,0,n)
| ^~~
a.cc:14:3: note: in expansion of macro 'REP'
14 | REP(i,X)cout<<'R';
| ^~~
|
s537729309 | p03836 | C++ | #include <bits/stdc++.h>
using namespace std;
typedef long long int ll;
#define FOR(i,l,r) for(i=l;i<r;i++)
#define REP(i,n) FOR(i,0,n)
#define ALL(x) x.begin(),x.end()
#define P pair<ll,ll>
#define F first
#define S second
signed main(){
ll sx,sy,X,Y,i;
cin>>sx>>sy>>X>>Y;
X-=sx;Y-=sy
REP(i,X)cout<<'R';
REP(i,Y)cout<<'U';
REP(i,X)cout<<'L';
REP(i,Y+1)cout<<'D';
REP(i,X+1)cout<<'R';
REP(i,Y+1)cout<<'U';
cout<<"LU";
REP(i,X+1)cout<<'L';
REP(i,Y+1)cout<<'D';
cout<<'R'<<endl;
return 0;
} | a.cc: In function 'int main()':
a.cc:13:14: error: expected ';' before 'for'
13 | X-=sx;Y-=sy
| ^
| ;
a.cc:4:35: error: expected ';' before ')' token
4 | #define FOR(i,l,r) for(i=l;i<r;i++)
| ^
a.cc:5:18: note: in expansion of macro 'FOR'
5 | #define REP(i,n) FOR(i,0,n)
| ^~~
a.cc:14:3: note: in expansion of macro 'REP'
14 | REP(i,X)cout<<'R';
| ^~~
|
s876966274 | p03836 | C++ | #include <iostream>
#include <vector>
#include <queue>
#include <stack>
#include <string>
using namespace std;
using P = pair<int, int>;
const int maplen = 2020;
const int offset = 1010;
string ans = "";
vector<vector<bool>> isvisit(maplen, vector<bool>(maplen, false));
void search(int sx, int sy, int tx, int ty){
isvisit[sx+offset][sy+offset] = false;
isvisit[tx+offset][ty+offset] = false;
vector<vector<bool>> isvisit_1(maplen, vector<bool>(maplen, false));
vector<vector<P>> past(maplen, vector<P>(maplen));
for(int i = 0; i < maplen; i++){
for(int j = 0; j < maplen; j++) isvisit_1[i][j] = isvisit[i][j];
}
queue<P> Q1;
Q1.push(make_pair(sx+offset, sy+offset));
while(!Q1.empty() && !isvisit_1[tx+offset][ty+offset]){
int curx, cury;
curx = Q1.front().first;
cury = Q1.front().second;
Q1.pop();
if(cury+1 < maplen && !isvisit_1[curx][cury+1]){
past[curx][cury+1] = make_pair(curx, cury);
isvisit_1[curx][cury+1] = true;
Q1.push(make_pair(curx, cury+1));
}
if(cury-1 >= 0 && !isvisit_1[curx][cury-1]){
past[curx][cury-1] = make_pair(curx, cury);
isvisit_1[curx][cury-1] = true;
Q1.push(make_pair(curx, cury-1));
}
if(curx+1 < maplen && !isvisit_1[curx+1][cury]){
past[curx+1][cury] = make_pair(curx, cury);
isvisit_1[curx+1][cury] = true;
Q1.push(make_pair(curx+1, cury));
}
if(curx-1 >= 0 && !isvisit_1[curx-1][cury]){
past[curx-1][cury] = make_pair(curx, cury);
isvisit_1[curx-1][cury] = true;
Q1.push(make_pair(curx-1, cury));
}
}
stack<char> coans;
P cur = make_pair(tx+offset, ty+offset);
while(cur != make_pair(sx+offset, sy+offset)){
int curx = cur.first;
int cury = cur.second;
int pastx = past[curx][cury].first;
int pasty = past[curx][cury].second;
isvisit[pastx][pasty] = true;
if(curx == pastx){
if(cury > pasty){
coans.push('U');
}else{
coans.push('D');
}
}else{
if(curx > pastx){
coans.push('R');
}else{
coans.push('L');
}
}
cur = make_pair(pastx, pasty);
}
while(!coans.empty()){
ans += coans.top();
coans.pop();
}
int main(){
int sx, sy, tx, ty;
cin >> sx >> sy >> tx >> ty;
search(sx, sy, tx, ty);
search(tx, ty, sx, sy);
search(sx, sy, tx, ty);
search(tx, ty, sx, sy);
cout << ans << endl;
return 0;
} | a.cc: In function 'void search(int, int, int, int)':
a.cc:84:9: warning: empty parentheses were disambiguated as a function declaration [-Wvexing-parse]
84 | int main(){
| ^~
a.cc:84:9: note: remove parentheses to default-initialize a variable
84 | int main(){
| ^~
| --
a.cc:84:9: note: or replace parentheses with braces to value-initialize a variable
a.cc:84:11: error: a function-definition is not allowed here before '{' token
84 | int main(){
| ^
a.cc:95:2: error: expected '}' at end of input
95 | }
| ^
a.cc:14:44: note: to match this '{'
14 | void search(int sx, int sy, int tx, int ty){
| ^
|
s891108293 | p03836 | C++ | #include<bits/stdc++.h>
using namespace std;
using ll = long long;
int main(){
int sx,sy,gx,gy;
cin >> sx >> sy >> gx >> gy;
vector<char> a;
for(int i = sx - gx; i != 0; (sx > gx ? i-- : i++)){
a.emplace_back(sx > gx ? 'L' : 'R');
if(sx > gx)
a.emplace_back('L');
else if(sx < gx)
a.emplace_back('R');
}
for(int i = sy - gy; i != 0; (sy > gy ? i-- : i++)){
if(sy > gy)
a.emplace_back('D');
else if(sy < gy)
a.emplace_back('U');
}
for(int i = sx - gx; i != 0; (sx > gx ? i-- : i++)){
a.emplace_back(sx > gx ? 'L' : 'R');
if(sx > gx)
a.emplace_back('R');
else if(sx < gx)
a.emplace_back('L');
}
for(int i = sy - gy; i != 0; (sy > gy ? i-- : i++)){
if(sy > gy)
a.emplace_back('U');
else if(sy < gy)
a.emplace_back('D');
}
if(sx > gx)
a.emplace_back('R');
else if (sx < gx){
a.emplace_back('L');
}
for(int i = abs(sy - gy) + 1; i > 0; i--){
if(sy < gy)
a.emplace_back('U');
else if(sy > gy)
a.emplace_back('D');
}
for(int i = abs(sx - gx) + 1; i > 0; i--){
if(sx < gx)
a.emplace_back('R');
else if(sy > gy)
a.emplace_back('L');
}
if(sy > gy)
a.emplace_back('U');
else if(sy < gy)
a.emplace_back('D');
if(sx > gx)
a.emplace_back('L')
else if(sx < gx)
a.emplace_back('R');
for(int i = abs(sy - gy) + 1; i > 0; i--){
if(sy < gy)
a.emplace_back('D');
else if(sy > gy)
a.emplace_back('U');
}
for(int i = abs(sx - gx) + 1; i > 0; i--){
if(sx < gx)
a.emplace_back('L');
else if(sy > gy)
a.emplace_back('R');
}
if(sy > gy)
a.emplace_back('D');
else if(sy < gy)
a.emplace_back('U');
for(int i = 0; i < a.size(); i++){
cout << a[i];
}
cout << endl;
} | a.cc: In function 'int main()':
a.cc:56:24: error: expected ';' before 'else'
56 | a.emplace_back('L')
| ^
| ;
57 | else if(sx < gx)
| ~~~~
|
s113681938 | p03836 | C++ | #pragma GCC optimize("O3")
#include <bits/stdc++.h>
#define ll long long
#define rep(i,n) for(ll i=0;i<(n);i++)
#define pll pair<ll,ll>
#define pq priority_queue
#define pb push_back
#define eb emplace_back
#define fi first
#define se second
#define ios ios_base::sync_with_stdio(0),cin.tie(0),cout.tie(0);
#define lb(c,x) distance(c.begin(),lower_bound(all(c),x))
#define ub(c,x) distance(c.begin(),upper_bound(all(c),x))
using namespace std;
template<class T> inline bool chmax(T& a,T b){if(a<b){a=b;return 1;}return 0;}
template<class T> inline bool chmin(T& a,T b){if(a>b){a=b;return 1;}return 0;}
const ll INF=1e9+7;
int main()
{
ll sx,sy,tx,ty;
cin >> sx >> sy >> tx >> ty;
ll h=ty-sy;
ll w=tx-sx;
rep(i,h){
cout << 'U';
}
rep(i,w){
cout << 'R';
}
rep(i,h){
cout << 'D';
}
rep(i,w){
cout << 'L';
}
cout << 'L';
rep(i,h+1){
cout << 'U';
}
rep(i,w+1){
cout << 'R';
}
cout << 'D' << 'R';
rep(i,h+1){
cout << 'D';
}
rep(i,w+1){
cout << 'L'
}
cout << 'U' << endl;
return 0;
} | a.cc: In function 'int main()':
a.cc:53:20: error: expected ';' before '}' token
53 | cout << 'L'
| ^
| ;
54 | }
| ~
|
s786896331 | p03836 | C++ | #pragma GCC optimize("O3")
#include <bits/stdc++.h>
#define ll long long
#define rep(i,n) for(ll i=0;i<(n);i++)
#define pll pair<ll,ll>
#define pq priority_queue
#define pb push_back
#define eb emplace_back
#define fi first
#define se second
#define ios ios_base::sync_with_stdio(0),cin.tie(0),cout.tie(0);
#define lb(c,x) distance(c.begin(),lower_bound(all(c),x))
#define ub(c,x) distance(c.begin(),upper_bound(all(c),x))
using namespace std;
template<class T> inline bool chmax(T& a,T b){if(a<b){a=b;return 1;}return 0;}
template<class T> inline bool chmin(T& a,T b){if(a>b){a=b;return 1;}return 0;}
const ll INF=1e9+7;
int main()
{
ll sx,sy,tx,ty;
cin >> sx >> sy >> tx >> ty;
ll h=ty-sy;
ll w=tx-sx;
rep(i,h){
cout << 'U';
}
reo(i,w){
cout << 'R';
}
rep(i,h){
cout << 'D';
}
rep(i,w){
cout << 'L';
}
cout << 'L';
rep(i,h+1){
cout << 'U';
}
rep(i,w+1){
cout << 'R';
}
cout << 'D' << 'R';
rep(i,h+1){
cout << 'D';
}
rep(i,w+1){
cout << 'L'
}
cout << 'U' << endl;
return 0;
}
| a.cc: In function 'int main()':
a.cc:32:9: error: 'i' was not declared in this scope
32 | reo(i,w){
| ^
a.cc:32:5: error: 'reo' was not declared in this scope; did you mean 'rep'?
32 | reo(i,w){
| ^~~
| rep
a.cc:53:20: error: expected ';' before '}' token
53 | cout << 'L'
| ^
| ;
54 | }
| ~
|
s413641167 | p03836 | C++ | using System;
using System.Linq;
using System.Collections;
using System.Collections.Generic;
using System.Text;
class Program
{
static void Main(string[] args)
{
// 入力
//var s = Console.ReadLine();
//var n = int.Parse(Console.ReadLine());
int[] n = Console.ReadLine().Split().Select(int.Parse).ToArray();
var sx = n[0];
var sy = n[1];
var tx = n[2];
var ty = n[3];
StringBuilder ans = new StringBuilder("");
//1
//右にsx-tx
for (int i = sx; i < tx; i++)
{
ans.Append("R");
}
//上にsy-ty
for (int i = sy; i < ty; i++)
{
ans.Append("U");
}
//2
//左ににtx-sx
for (int i = tx; i > sx; i--)
{
ans.Append("L");
}
//下にsy-ty
for (int i = ty; i > sy; i--)
{
ans.Append("D");
}
//3
//下に
ans.Append("D");
//右にsx-tx
for (int i = sx; i <= tx; i++)
{
ans.Append("R");
}
//上にsy-ty
for (int i = sy; i < ty; i++)
{
ans.Append("U");
}
//左に
ans.Append("L");
//4
//上に
ans.Append("U");
//左ににtx-sx
for (int i = tx; i >= sx; i--)
{
ans.Append("L");
}
//下にsy-ty
for (int i = ty; i > sy; i--)
{
ans.Append("D");
}
ans.Append("R");
// 出力
Console.WriteLine(ans);
}
} | a.cc:1:7: error: expected nested-name-specifier before 'System'
1 | using System;
| ^~~~~~
a.cc:2:7: error: expected nested-name-specifier before 'System'
2 | using System.Linq;
| ^~~~~~
a.cc:3:7: error: expected nested-name-specifier before 'System'
3 | using System.Collections;
| ^~~~~~
a.cc:4:7: error: expected nested-name-specifier before 'System'
4 | using System.Collections.Generic;
| ^~~~~~
a.cc:5:7: error: expected nested-name-specifier before 'System'
5 | using System.Text;
| ^~~~~~
a.cc:10:22: error: 'string' has not been declared
10 | static void Main(string[] args)
| ^~~~~~
a.cc:10:31: error: expected ',' or '...' before 'args'
10 | static void Main(string[] args)
| ^~~~
a.cc:80:2: error: expected ';' after class definition
80 | }
| ^
| ;
a.cc: In static member function 'static void Program::Main(int*)':
a.cc:15:12: error: structured binding declaration cannot have type 'int'
15 | int[] n = Console.ReadLine().Split().Select(int.Parse).ToArray();
| ^~
a.cc:15:12: note: type must be cv-qualified 'auto' or reference to cv-qualified 'auto'
a.cc:15:12: error: empty structured binding declaration
a.cc:15:15: error: expected initializer before 'n'
15 | int[] n = Console.ReadLine().Split().Select(int.Parse).ToArray();
| ^
a.cc:16:9: error: 'var' was not declared in this scope
16 | var sx = n[0];
| ^~~
a.cc:17:13: error: expected ';' before 'sy'
17 | var sy = n[1];
| ^~
a.cc:18:13: error: expected ';' before 'tx'
18 | var tx = n[2];
| ^~
a.cc:19:13: error: expected ';' before 'ty'
19 | var ty = n[3];
| ^~
a.cc:21:9: error: 'StringBuilder' was not declared in this scope
21 | StringBuilder ans = new StringBuilder("");
| ^~~~~~~~~~~~~
a.cc:24:22: error: 'sx' was not declared in this scope
24 | for (int i = sx; i < tx; i++)
| ^~
a.cc:24:30: error: 'tx' was not declared in this scope
24 | for (int i = sx; i < tx; i++)
| ^~
a.cc:26:13: error: 'ans' was not declared in this scope
26 | ans.Append("R");
| ^~~
a.cc:29:22: error: 'sy' was not declared in this scope
29 | for (int i = sy; i < ty; i++)
| ^~
a.cc:29:30: error: 'ty' was not declared in this scope
29 | for (int i = sy; i < ty; i++)
| ^~
a.cc:31:13: error: 'ans' was not declared in this scope
31 | ans.Append("U");
| ^~~
a.cc:36:22: error: 'tx' was not declared in this scope
36 | for (int i = tx; i > sx; i--)
| ^~
a.cc:36:30: error: 'sx' was not declared in this scope
36 | for (int i = tx; i > sx; i--)
| ^~
a.cc:38:13: error: 'ans' was not declared in this scope
38 | ans.Append("L");
| ^~~
a.cc:41:22: error: 'ty' was not declared in this scope
41 | for (int i = ty; i > sy; i--)
| ^~
a.cc:41:30: error: 'sy' was not declared in this scope
41 | for (int i = ty; i > sy; i--)
| ^~
a.cc:43:13: error: 'ans' was not declared in this scope
43 | ans.Append("D");
| ^~~
a.cc:48:9: error: 'ans' was not declared in this scope
48 | ans.Append("D");
| ^~~
a.cc:50:22: error: 'sx' was not declared in this scope
50 | for (int i = sx; i <= tx; i++)
| ^~
a.cc:50:31: error: 'tx' was not declared in this scope
50 | for (int i = sx; i <= tx; i++)
| ^~
a.cc:55:22: error: 'sy' was not declared in this scope
55 | for (int i = sy; i < ty; i++)
| ^~
a.cc:55:30: error: 'ty' was not declared in this scope
55 | for (int i = sy; i < ty; i++)
| ^~
a.cc:67:22: error: 'tx' was not declared in this scope
67 | for (int i = tx; i >= sx; i--)
| ^~
a.cc:67:31: error: 'sx' was not declared in this scope
67 | for (int i = tx; i >= sx; i--)
| ^~
a.cc:72:22: error: 'ty' was not declared in this scope
72 | for (int i = ty; i > sy; i--)
| ^~
a.cc:72:30: error: 'sy' was not declared in this scope
72 | for (int i = ty; i > sy; i--)
| ^~
a.cc:78:9: error: 'Console' was not declared in this scope
78 | Console.WriteLine(ans);
| ^~~~~~~
|
s532052477 | p03836 | C++ | #include <bits/stdc++.h>
#define rep(i,n) for(int i=0;i<(int)(n);i++)
#define coR() cout << 'R'
#define coL() cout << 'L'
#define coU() cout << 'U'
#define coD() cout << 'D'
using namespace std;
int main(){
int sx,sy,tx,ty;
cin >> sx >> sy >> tx >> ty;
int distx = tx - sx;
int disty = tx - sx;
rep(i,distx){ coR(); }
rep(i,disty){ coU(); }
rep(i,distx){ coL(); }
rep(i,disty+1){ coD(); }
rep(i,distx+1){ coR(); }
rep(i,disty+1){ coU(); }
coL();
coU();
rep(i,distx+1){ coL(); }
rep(i,disty+1){ coD(); }
coR();
| a.cc: In function 'int main()':
a.cc:24:9: error: expected '}' at end of input
24 | coR();
| ^
a.cc:8:11: note: to match this '{'
8 | int main(){
| ^
|
s167708922 | p03836 | C++ | #include <bits/stdc++.h>
#define rep(i,n) for(int i=0;i<(int)(n);i++)
#define co('a') cout << 'a' << endl
using namespace std;
int main(){
int sx,sy,tx,ty;
cin >> sx >> sy >> tx >> ty;
int distx = tx - sx;
int disty = tx - sx;
rep(i,distx){ co(R); }
rep(i,disty){ co(U); }
rep(i,distx){ co(L); }
rep(i,disty+1){ co(D); }
rep(i,distx+1){ co(R); }
rep(i,disty+1){ co(U); }
co(L);
co(U);
rep(i,distx+1){ co(L); }
rep(i,disty+1){ co(D); }
co(R);
} | a.cc:3:12: error: expected parameter name, found "'a'"
3 | #define co('a') cout << 'a' << endl
| ^~~
a.cc: In function 'int main()':
a.cc:11:20: error: 'R' was not declared in this scope
11 | rep(i,distx){ co(R); }
| ^
a.cc:11:17: error: 'co' was not declared in this scope; did you mean 'cos'?
11 | rep(i,distx){ co(R); }
| ^~
| cos
a.cc:12:20: error: 'U' was not declared in this scope
12 | rep(i,disty){ co(U); }
| ^
a.cc:12:17: error: 'co' was not declared in this scope; did you mean 'cos'?
12 | rep(i,disty){ co(U); }
| ^~
| cos
a.cc:13:20: error: 'L' was not declared in this scope
13 | rep(i,distx){ co(L); }
| ^
a.cc:13:17: error: 'co' was not declared in this scope; did you mean 'cos'?
13 | rep(i,distx){ co(L); }
| ^~
| cos
a.cc:14:22: error: 'D' was not declared in this scope
14 | rep(i,disty+1){ co(D); }
| ^
a.cc:14:19: error: 'co' was not declared in this scope; did you mean 'cos'?
14 | rep(i,disty+1){ co(D); }
| ^~
| cos
a.cc:15:22: error: 'R' was not declared in this scope
15 | rep(i,distx+1){ co(R); }
| ^
a.cc:15:19: error: 'co' was not declared in this scope; did you mean 'cos'?
15 | rep(i,distx+1){ co(R); }
| ^~
| cos
a.cc:16:22: error: 'U' was not declared in this scope
16 | rep(i,disty+1){ co(U); }
| ^
a.cc:16:19: error: 'co' was not declared in this scope; did you mean 'cos'?
16 | rep(i,disty+1){ co(U); }
| ^~
| cos
a.cc:17:6: error: 'L' was not declared in this scope
17 | co(L);
| ^
a.cc:17:3: error: 'co' was not declared in this scope; did you mean 'cos'?
17 | co(L);
| ^~
| cos
a.cc:18:6: error: 'U' was not declared in this scope
18 | co(U);
| ^
a.cc:20:22: error: 'D' was not declared in this scope
20 | rep(i,disty+1){ co(D); }
| ^
a.cc:21:6: error: 'R' was not declared in this scope
21 | co(R);
| ^
|
s077291062 | p03836 | C++ | #include <bits/stdc++.h>
#define rep(i,n) for(int i=0;i<(int)(n);i++)
#define co(a) cout << a << endl
using namespace std;
int main(){
int sx,sy,tx,ty;
cin >> sx >> sy >> tx >> ty;
distx = tx - sx;
disty = tx - sx;
rep(i,distx){ co(R); }
rep(i,disty){ co(U); }
rep(i,distx){ co(L); }
rep(i,disty+1){ co(D); }
rep(i,distx+1){ co(R); }
rep(i,disty+1){ co(U); }
co(L);
co(U);
rep(i,distx+1){ co(L); }
rep(i,disty+1){ co(D); }
co(R);
} | a.cc: In function 'int main()':
a.cc:8:3: error: 'distx' was not declared in this scope
8 | distx = tx - sx;
| ^~~~~
a.cc:9:3: error: 'disty' was not declared in this scope
9 | disty = tx - sx;
| ^~~~~
a.cc:11:20: error: 'R' was not declared in this scope
11 | rep(i,distx){ co(R); }
| ^
a.cc:3:23: note: in definition of macro 'co'
3 | #define co(a) cout << a << endl
| ^
a.cc:12:20: error: 'U' was not declared in this scope
12 | rep(i,disty){ co(U); }
| ^
a.cc:3:23: note: in definition of macro 'co'
3 | #define co(a) cout << a << endl
| ^
a.cc:13:20: error: 'L' was not declared in this scope
13 | rep(i,distx){ co(L); }
| ^
a.cc:3:23: note: in definition of macro 'co'
3 | #define co(a) cout << a << endl
| ^
a.cc:14:22: error: 'D' was not declared in this scope
14 | rep(i,disty+1){ co(D); }
| ^
a.cc:3:23: note: in definition of macro 'co'
3 | #define co(a) cout << a << endl
| ^
a.cc:15:22: error: 'R' was not declared in this scope
15 | rep(i,distx+1){ co(R); }
| ^
a.cc:3:23: note: in definition of macro 'co'
3 | #define co(a) cout << a << endl
| ^
a.cc:16:22: error: 'U' was not declared in this scope
16 | rep(i,disty+1){ co(U); }
| ^
a.cc:3:23: note: in definition of macro 'co'
3 | #define co(a) cout << a << endl
| ^
a.cc:17:6: error: 'L' was not declared in this scope
17 | co(L);
| ^
a.cc:3:23: note: in definition of macro 'co'
3 | #define co(a) cout << a << endl
| ^
a.cc:18:6: error: 'U' was not declared in this scope
18 | co(U);
| ^
a.cc:3:23: note: in definition of macro 'co'
3 | #define co(a) cout << a << endl
| ^
a.cc:20:22: error: 'D' was not declared in this scope
20 | rep(i,disty+1){ co(D); }
| ^
a.cc:3:23: note: in definition of macro 'co'
3 | #define co(a) cout << a << endl
| ^
a.cc:21:6: error: 'R' was not declared in this scope
21 | co(R);
| ^
a.cc:3:23: note: in definition of macro 'co'
3 | #define co(a) cout << a << endl
| ^
|
s327529738 | p03836 | C++ | #include <bits/stdc++.h>
#define rep(i, n) for(int i = 0; i < n; ++i)
#define rrep(i, n) for(int i = n-1; i >= 0; --i)
#define fi first
#define se second
using namespace std;
using lint = long long;
using uint = unsigned int;
using ulint = unsigned long long;
using ldouble = long double;
using pii = pair<int, int>;
using pli = pair<lint, lint>;
using pdd = pair<double, double>;
using pld = pair<ldouble, ldouble>;
using v1i = vector<int>;
using v1li = vector<lint>;
using v2i = vector<vector<int>>;
using v2li = vector<vector<lint>>;
using v3i = vector<vector<vector<int>>>;
using v3li = vector<vector<vector<lint>>>;
using v1b = vector<bool>;
using v2b = vector<vector<bool>>;
using v3b = vector<vector<vector<bool>>>;
using v1c = vector<char>;
using v2c = vector<vector<char>>;
using v3c = vector<vector<vector<char>>>;
constexpr lint mod1 = 1e9+7;
constexpr lint mod2 = 998244353;
int main() {
int a, b, c, d;
cin >> a >> b >> c >> d;
string t = "";
rep(i, c-a) t += 'R';
rep(i, d-b) t += 'U';
rep(i, c-a) t += 'L';
rep(i, d-b) t += 'D';
t += 'D';
rep(i, c-a+1) t += 'R';
rep(i, d-b+1) t += 'U';
t += 'L';
t += 'U';
rep(i, c-a+1) t += 'L';
rep(i, d-b+1) t += 'D';
t += 'R'
cout << t << endl;
return 0;
} | a.cc: In function 'int main()':
a.cc:45:11: error: expected ';' before 'cout'
45 | t += 'R'
| ^
| ;
46 | cout << t << endl;
| ~~~~
|
s541546518 | p03836 | C++ | #define _GLIBCXX_DEBUG
#include<bits/stdc++.h>
#define rep(i,n) for (int i = 0;i < (n);i++)
#define all(v) v.begin(),v.end()
using namespace std;
using ll = long long;
using P = pair<ll,ll>;
using vl = vector<ll>;
using vvl = vector<vl>;
int main(){
ll sx,sy,tx,ty; cin >> sx >> sy >> tx >> ty;
ll dx = tx-sx; ll dy = ty-sy;
cout << string(dx,'R') << string(dy,'U') << string(dx,'L')
<< string(dy,'D') << 'D' << string(dx+1,'R') <<
<< string(dy+1,'U') << 'L' << 'U' << string(dx+1,'L')
<< string(dy+1,'D') << 'R' << endl;
} | a.cc: In function 'int main()':
a.cc:18:8: error: expected primary-expression before '<<' token
18 | << string(dy+1,'U') << 'L' << 'U' << string(dx+1,'L')
| ^~
|
s809102896 | p03836 | C++ | #include<bits/stdc++.h>
#include<iomanip>
using namespace std;
typedef long long ll;
typedef long l;
typedef pair<int,int> P;
#define rep(i,n) for(int i=0;i<n;i++)
#define fs first
#define sc second
#define pb push_back
#define mp make_pair
#define eb emplace_back
#define ALL(A) A.begin(),A.end()
const double PI=3.141592653589;
const int INF=1000000007;
const ll LMAX=1000000000000001;
ll gcd(ll a,ll b){if(a<b)swap(a,b);ll c=a%b;while(c!=0){a=b;b=c;c=a%b;}return b;}
ll lcm(ll a,ll b){return a*b/gcd(a,b);}
int dx[]={-1,0,1,0};
int dy[]={0,1,0,-1};
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<<"LU";
rep(i,tx-sx+1) cout<<"L";
rep(i,ty-sy+1) cout<<"D";
cout<<"R"<<endl;
return 0;
}
| a.cc: In function 'int main()':
a.cc:28:12: error: expected ';' before 'for'
28 | cout<<"D"
| ^
| ;
a.cc:29:7: error: 'i' was not declared in this scope
29 | rep(i,tx-sx+1) cout<<"R";
| ^
a.cc:7:30: note: in definition of macro 'rep'
7 | #define rep(i,n) for(int i=0;i<n;i++)
| ^
|
s595205726 | p03836 | C++ | #include <bits/stdc++.h>
using namespace std;
using int64 = long long;
#define int int64
#define rep(i, n) for(int i=0; i<n; i++)
#define FOR(i, a, b) for(int i=a; i<b; i++)
#define SORT(x) sort(x.begin(), x.end())
#define GSORT(x) sort(x.begin(), x.end(), greater<int>())
#define mk make_pair
#define fi first
#define se second
#define pb push_back
#define ALL(x) x.begin(), x.end()
#define V(T) vector<T>
typedef pair<int, int> P;
typedef pair<P, P> PP;
typedef vector<int> vi;
typedef vector<vi> vvi;
int max(int a, int b) {if(b>a) return b; else return a;}
int min(int a, int b) {if(b<a) return b; else return a;}
signed main() {
int sx, sy, tx, ty;
cin >> sx >> sy >> tx >> ty;
//int x=sx, y=sy;
//cout << sx << " " << sy << endl;
string res = "";
rep(i, tx-sx) res += 'R';
rep(i, ty-sy) res += 'U';
rep(i, tx-sx) res += 'L';
rep(i, ty-sy) res += 'D';
res += 'D';
rep(i, tx-sx+1) res += 'R';
rep(i, ty-sy+1) res += 'U';
res += "LU";
rep(i, tx-sx+1) res += 'L';
rep(i, ty-sy+1) res += 'D';
res += 'R';
rep(i, res.size()) {
switch(res[i]) {
case 'U':
y++;
break;
case 'D':
y--;
break;
case 'R':
x++;
break;
case 'L':
x--;
break;
}
}
//cout << x << " " << y << endl;
cout << res << endl;
return 0;
} | a.cc: In function 'int main()':
a.cc:44:17: error: 'y' was not declared in this scope
44 | y++;
| ^
a.cc:52:17: error: 'x' was not declared in this scope
52 | x++;
| ^
|
s165871872 | p03836 | Java | import java.util.ArrayList;
import java.util.List;
import java.util.Scanner;
public class Main {
public static void main(String[] args) {
// TODO 自動生成されたメソッド・スタブ
Scanner scanner = new Scanner(System.in);
int sx = scanner.nextInt();
int sy = scanner.nextInt();
int tx = scanner.nextInt();
int ty = scanner.nextInt();
scanner.close();
// String result = "";
List<String> result = new ArrayList<String>();
// String rr = "";
StringBuilder sb = new StringBuilder();
sb.append("U");
System.out.println(sb);
// 1回目
for(int i = 0; i < ty - sy; i++){
// result += "U";
sb.append("U")
}
for(int i = 0; i < tx - sx; i++){
// result += "R";
sb.append("R");
}
for(int i = 0; i < ty - sy; i++){
// result += "D";
sb.append("D");
}
for(int i = 0; i < tx - sx; i++){
// result += "L";
sb.append("L");
}
/// 2回目
// result += "L";
sb.append("L");
for(int i = 0; i < ty - sy; i++){
// result += "U";
sb.append("U");
}
// result += "U";
for(int i = 0; i < tx - sx; i++){
// result += "R";
sb.append("R");
}
// result += "RDR";
sb.append("RDR");
for(int i = 0; i < ty - sy; i++){
// result += "D";
sb.append("D");
}
// result += "D";
for(int i = 0; i < tx - sx; i++){
// result += "L";
sb.append("L");
}
// result += "LU";
sb.append("LU");
// System.out.println(result);
System.out.println(sb);
}
}
| Main.java:24: error: ';' expected
sb.append("U")
^
1 error
|
s273140482 | p03836 | C++ | #include<bits/stdc++.h>
using namespace std;
int main(){
int a,b,aa,bb; cin >> a >> b >> aa >> bb;
int x = aa - a;
int y = bb - b;
int signx , signy = 0;0;
if(x<0){
signx = -1;
}
else{
signx = 1;
}
if(y<0){
signy = -1;
}
else{
signy = 1
}
int countx,county = 0;0;
while(x!=0){
if(x<0){
cout << 'R';
x++;
}
else{
cout << 'L';
x--;
}
countx++;
}
while(y!=0){
if(y<0){
cout << 'U';
y++;
}
else{
cout << 'D';
y--;
}
county++;
}
if(signx == 1){
x += countx;
}
else{
x -= countx;
}
if(signy == 1){
y += county;
}
else{
y -= county;
}
while(x!=0){
if(x<0){
cout << 'L';
x++;
}
else{
cout << 'R';
x--;
}
countx++;
}
while(y!=0){
if(y<0){
cout << 'D';
y++;
}
else{
cout << 'U';
y--;
}
county++;
}
if(signx == 1){
x += countx;
}
else{
x -= countx;
}
if(signy == 1){
y += county;
}
else{
y -= county;
}
if(signx == 1){
cout << 'L';
}
else{
cout << 'R';
}
if(signy == 1){
cout << 'U';
}
else{
cout << 'D';
}
while(x!=0){
if(x<0){
cout << 'R';
x++;
}
else{
cout << 'L';
x--;
}
countx++;
}
while(y!=0){
if(y<0){
cout << 'U';
y++;
}
else{
cout << 'D';
y--;
}
county++;
}
if(signx == 1){
x += countx;
}
else{
x -= countx;
}
if(signy == 1){
y += county;
}
else{
y -= county;
}
if(signy == 1){
cout << 'D';
}
else{
cout << 'U';
}
if(signx == 1){
cout << 'R';
}
else{
cout << 'L';
}
if(signy == 1){
cout << 'D';
}
else{
cout << 'U';
}
if(signx == 1){
cout << 'R';
}
else{
cout << 'L';
}
while(x!=0){
if(x<0){
cout << 'L';
x++;
}
else{
cout << 'R';
x--;
}
countx++;
}
while(y!=0){
if(y<0){
cout << 'D';
y++;
}
else{
cout << 'U';
y--;
}
county++;
}
if(signx == 1){
cout << 'L';
}
else{
cout << 'R';
}
if(signy == 1){
cout << 'U';
}
else{
cout << 'D';
}
} | a.cc: In function 'int main()':
a.cc:21:14: error: expected ';' before '}' token
21 | signy = 1
| ^
| ;
22 | }
| ~
|
s656437499 | p03836 | C++ | #include<bits/stdc++.h>
using namespace std;
int main(){
int a,b,aa,bb; cin >> a >> b >> aa >> bb;
int x = aa - a;
int y = bb - b;
int signx , signy = 0,0;
if(x<0){
signx = -1;
}
else{
signx = 1;
}
if(y<0){
signy = -1;
}
else{
signy = 1
}
int countx,county = 0,0;
while(x!=0){
if(x<0){
cout << 'R';
x++;
}
else{
cout << 'L';
x--;
}
countx++;
}
while(y!=0){
if(y<0){
cout << 'U';
y++;
}
else{
cout << 'D';
y--;
}
county++;
}
if(signx == 1){
x += countx;
}
else{
x -= countx;
}
if(signy == 1){
y += county;
}
else{
y -= county;
}
while(x!=0){
if(x<0){
cout << 'L';
x++;
}
else{
cout << 'R';
x--;
}
countx++;
}
while(y!=0){
if(y<0){
cout << 'D';
y++;
}
else{
cout << 'U';
y--;
}
county++;
}
if(signx == 1){
x += countx;
}
else{
x -= countx;
}
if(signy == 1){
y += county;
}
else{
y -= county;
}
if(signx == 1){
cout << 'L';
}
else{
cout << 'R';
}
if(signy == 1){
cout << 'U';
}
else{
cout << 'D';
}
while(x!=0){
if(x<0){
cout << 'R';
x++;
}
else{
cout << 'L';
x--;
}
countx++;
}
while(y!=0){
if(y<0){
cout << 'U';
y++;
}
else{
cout << 'D';
y--;
}
county++;
}
if(signx == 1){
x += countx;
}
else{
x -= countx;
}
if(signy == 1){
y += county;
}
else{
y -= county;
}
if(signy == 1){
cout << 'D';
}
else{
cout << 'U';
}
if(signx == 1){
cout << 'R';
}
else{
cout << 'L';
}
if(signy == 1){
cout << 'D';
}
else{
cout << 'U';
}
if(signx == 1){
cout << 'R';
}
else{
cout << 'L';
}
while(x!=0){
if(x<0){
cout << 'L';
x++;
}
else{
cout << 'R';
x--;
}
countx++;
}
while(y!=0){
if(y<0){
cout << 'D';
y++;
}
else{
cout << 'U';
y--;
}
county++;
}
if(signx == 1){
cout << 'L';
}
else{
cout << 'R';
}
if(signy == 1){
cout << 'U';
}
else{
cout << 'D';
}
} | a.cc: In function 'int main()':
a.cc:9:25: error: expected unqualified-id before numeric constant
9 | int signx , signy = 0,0;
| ^
a.cc:21:14: error: expected ';' before '}' token
21 | signy = 1
| ^
| ;
22 | }
| ~
a.cc:24:25: error: expected unqualified-id before numeric constant
24 | int countx,county = 0,0;
| ^
|
s458168853 | p03836 | C++ | #include<bits/stdc++.h>
using namespace std;
int main(){
int a,b,aa,bb; cin >> a >> b >> aa >> bb;
int x = aa - a;
int y = bb - b;
if(x<0){
signx = -1;
}
else{
signx = 1;
}
if(y<0){
signy = -1;
}
else{
signy = 1
}
int countx,county = 0,0;
while(x!=0){
if(x<0){
cout << 'R';
x++;
}
else{
cout << 'L';
x--;
}
countx++;
}
while(y!=0){
if(y<0){
cout << 'U';
y++;
}
else{
cout << 'D';
y--;
}
county++;
}
if(signx == 1){
x += countx;
}
else{
x -= countx;
}
if(signy == 1){
y += county;
}
else{
y -= county;
}
while(x!=0){
if(x<0){
cout << 'L';
x++;
}
else{
cout << 'R';
x--;
}
countx++;
}
while(y!=0){
if(y<0){
cout << 'D';
y++;
}
else{
cout << 'U';
y--;
}
county++;
}
if(signx == 1){
x += countx;
}
else{
x -= countx;
}
if(signy == 1){
y += county;
}
else{
y -= county;
}
if(signx == 1){
cout << 'L';
}
else{
cout << 'R';
}
if(signy == 1){
cout << 'U';
}
else{
cout << 'D';
}
while(x!=0){
if(x<0){
cout << 'R';
x++;
}
else{
cout << 'L';
x--;
}
countx++;
}
while(y!=0){
if(y<0){
cout << 'U';
y++;
}
else{
cout << 'D';
y--;
}
county++;
}
if(signx == 1){
x += countx;
}
else{
x -= countx;
}
if(signy == 1){
y += county;
}
else{
y -= county;
}
if(signy == 1){
cout << 'D';
}
else{
cout << 'U';
}
if(signx == 1){
cout << 'R';
}
else{
cout << 'L';
}
if(signy == 1){
cout << 'D';
}
else{
cout << 'U';
}
if(signx == 1){
cout << 'R';
}
else{
cout << 'L';
}
while(x!=0){
if(x<0){
cout << 'L';
x++;
}
else{
cout << 'R';
x--;
}
countx++;
}
while(y!=0){
if(y<0){
cout << 'D';
y++;
}
else{
cout << 'U';
y--;
}
county++;
}
if(signx == 1){
cout << 'L';
}
else{
cout << 'R';
}
if(signy == 1){
cout << 'U';
}
else{
cout << 'D';
}
} | a.cc: In function 'int main()':
a.cc:9:5: error: 'signx' was not declared in this scope
9 | signx = -1;
| ^~~~~
a.cc:12:5: error: 'signx' was not declared in this scope
12 | signx = 1;
| ^~~~~
a.cc:16:5: error: 'signy' was not declared in this scope
16 | signy = -1;
| ^~~~~
a.cc:19:5: error: 'signy' was not declared in this scope
19 | signy = 1
| ^~~~~
a.cc:22:25: error: expected unqualified-id before numeric constant
22 | int countx,county = 0,0;
| ^
a.cc:46:6: error: 'signx' was not declared in this scope
46 | if(signx == 1){
| ^~~~~
a.cc:53:6: error: 'signy' was not declared in this scope
53 | if(signy == 1){
| ^~~~~
a.cc:84:6: error: 'signx' was not declared in this scope
84 | if(signx == 1){
| ^~~~~
a.cc:91:6: error: 'signy' was not declared in this scope
91 | if(signy == 1){
| ^~~~~
a.cc:98:6: error: 'signx' was not declared in this scope
98 | if(signx == 1){
| ^~~~~
a.cc:104:6: error: 'signy' was not declared in this scope
104 | if(signy == 1){
| ^~~~~
a.cc:134:6: error: 'signx' was not declared in this scope
134 | if(signx == 1){
| ^~~~~
a.cc:141:6: error: 'signy' was not declared in this scope
141 | if(signy == 1){
| ^~~~~
a.cc:149:6: error: 'signy' was not declared in this scope
149 | if(signy == 1){
| ^~~~~
a.cc:155:6: error: 'signx' was not declared in this scope
155 | if(signx == 1){
| ^~~~~
a.cc:162:6: error: 'signy' was not declared in this scope
162 | if(signy == 1){
| ^~~~~
a.cc:168:6: error: 'signx' was not declared in this scope
168 | if(signx == 1){
| ^~~~~
a.cc:199:6: error: 'signx' was not declared in this scope
199 | if(signx == 1){
| ^~~~~
a.cc:205:6: error: 'signy' was not declared in this scope
205 | if(signy == 1){
| ^~~~~
|
s431072549 | p03836 | C++ | #include <bits/stdc++.h>
using namespace std;
int main() {
int sx,sy,tx,ty;
cin >> sx >> sy >> tx >> ty;
int xx = tx - sx;
int yy = ty - sy;
string rz = "";
string lz = "";
for (int i = 0; i < xx; i++) {
rz += "R";
lz += "L";
}
string dz = "";
string uz = "";
for (int i = 0; i < yy; i++) {
dz += "D";
uz += "U";
}
string firs = uz + rz + dz + lz;
string secon = "D" + rz + "R" + uz + "ULUL" + lz + dz + "DR"
cout << firs + secon << endl;
return 0;
} | a.cc: In function 'int main()':
a.cc:24:1: error: expected ',' or ';' before 'cout'
24 | cout << firs + secon << endl;
| ^~~~
|
s828365712 | p03836 | C++ | #include <bits/stdc++.h>
using namespace std;
int main() {
int sx,sy,tx,ty;
cin >> sx >> sy >> tx >> ty;
int xx = tx - sx;
int yy = ty - sy;
string one = "U" * yy + "R" * xx;
string two = "D" * yy + "L" * xx;
string three = "D" + "R" * (xx + 1) + "U" * (yy + 1) + "L";
string four = "U" + "L" * (xx + 1) + "D" * (yy + 1) + "R";
cout << one + two + three + four << endl;
return 0;
} | a.cc: In function 'int main()':
a.cc:8:20: error: invalid operands of types 'const char [2]' and 'int' to binary 'operator*'
8 | string one = "U" * yy + "R" * xx;
| ~~~ ^ ~~
| | |
| | int
| const char [2]
a.cc:8:31: error: invalid operands of types 'const char [2]' and 'int' to binary 'operator*'
8 | string one = "U" * yy + "R" * xx;
| ~~~ ^ ~~
| | |
| | int
| const char [2]
a.cc:9:20: error: invalid operands of types 'const char [2]' and 'int' to binary 'operator*'
9 | string two = "D" * yy + "L" * xx;
| ~~~ ^ ~~
| | |
| | int
| const char [2]
a.cc:9:31: error: invalid operands of types 'const char [2]' and 'int' to binary 'operator*'
9 | string two = "D" * yy + "L" * xx;
| ~~~ ^ ~~
| | |
| | int
| const char [2]
a.cc:10:28: error: invalid operands of types 'const char [2]' and 'int' to binary 'operator*'
10 | string three = "D" + "R" * (xx + 1) + "U" * (yy + 1) + "L";
| ~~~ ^ ~~~~~~~~
| | |
| | int
| const char [2]
a.cc:10:45: error: invalid operands of types 'const char [2]' and 'int' to binary 'operator*'
10 | string three = "D" + "R" * (xx + 1) + "U" * (yy + 1) + "L";
| ~~~ ^ ~~~~~~~~
| | |
| | int
| const char [2]
a.cc:11:27: error: invalid operands of types 'const char [2]' and 'int' to binary 'operator*'
11 | string four = "U" + "L" * (xx + 1) + "D" * (yy + 1) + "R";
| ~~~ ^ ~~~~~~~~
| | |
| | int
| const char [2]
a.cc:11:44: error: invalid operands of types 'const char [2]' and 'int' to binary 'operator*'
11 | string four = "U" + "L" * (xx + 1) + "D" * (yy + 1) + "R";
| ~~~ ^ ~~~~~~~~
| | |
| | int
| const char [2]
|
s945497471 | p03836 | C++ | #include <bits/stdc++.h>
using namespace std;
string add_root(string root, string direct, int count) {
for (int i < 0; i < count; i++) {
root = root + direct;
}
return root;
}
int main() {
int sx, sy, tx, ty;
cin >> sx >> sy >> tx >> ty;
int dx = tx - sx, dy = ty - sy;
string r;
r = add_root(r, "R", dx);
r = add_root(r, "U", dy);
r = add_root(r, "L", dx);
r = add_root(r, "D", dy + 1);
r = add_root(r, "R", dx + 1);
r = add_root(r, "U", dy + 1);
r = add_root(r, "L", 1);
r = add_root(r, "U", 1);
r = add_root(r, "L", dx + 1);
r = add_root(r, "D", dy + 1);
r = add_root(r, "R", 1);
cout << r << endl;
} | a.cc: In function 'std::string add_root(std::string, std::string, int)':
a.cc:5:13: error: expected ';' before '<' token
5 | for (int i < 0; i < count; i++) {
| ^~
| ;
a.cc:5:14: error: expected primary-expression before '<' token
5 | for (int i < 0; i < count; i++) {
| ^
a.cc:5:28: error: expected ')' before ';' token
5 | for (int i < 0; i < count; i++) {
| ~ ^
| )
a.cc:5:30: error: 'i' was not declared in this scope
5 | for (int i < 0; i < count; i++) {
| ^
|
s798343515 | p03836 | C++ | #include <iostream>
#include <algorithm>
#include <string>
#include <vector>
using namespace std;
int main() {
int sx, sy, tx, ty;
cin >> sx >> sy >> tx >> ty;
int dx = tx - sx;
int dy = ty - sy;
string outstr = str(dy, 'U') + str(dx, 'R') + str(dy, 'D') + str(dx, 'L');
outstr += 'L' + str(dy + 1, 'U') + str(dx + 1, 'R') + 'D';
outstr += 'R' + str(dy + 1, 'D') + str(dx + 1, 'L') + 'U';
cout << outstr << endl;
return 0;
}
| a.cc: In function 'int main()':
a.cc:15:19: error: 'str' was not declared in this scope; did you mean 'std'?
15 | string outstr = str(dy, 'U') + str(dx, 'R') + str(dy, 'D') + str(dx, 'L');
| ^~~
| std
|
s532585685 | p03836 | C++ | #include <iostream>
#include <algorithm>
#include <string>
#include <vector>
using namespace std;
int main() {
int sx, sy, tx, ty;
cin >> sx >> sy >> tx >> ty;
int dx = tx - sx;
int dy = ty - sy;
string outstr = 'U' * dy + 'R' * dx + 'D' * dy + 'L' * dx;
outstr += 'L' + 'U' * (dy + 1) + 'R' * (dx + 1) + 'D';
outstr += 'R' + 'D' * (dy + 1) + 'L' * (dx + 1) + 'U';
cout << outstr << endl;
return 0;
} | a.cc: In function 'int main()':
a.cc:15:50: error: conversion from 'int' to non-scalar type 'std::string' {aka 'std::__cxx11::basic_string<char>'} requested
15 | string outstr = 'U' * dy + 'R' * dx + 'D' * dy + 'L' * dx;
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~
|
s417139944 | p03836 | C++ | #include<iostream>
#include<cstdio>
#include<cmath>
using namespace std;
int main() {
int sx,sy,tx,ty;
cin >> sx >> sy >> tx >> ty;
int dx = abs(tx-sx);
int dy = abs(ty-sy);
const char* rightup = "URDLDRULULDR";
const char* leftdown = "DLURRDLULURD";
const char* ans;
if(tx > sx) ans = rightup;
else ans = leftdown;
for(int i = 0; i < dx; i++) printf(ans[0]);
for(int i = 0; i < dy; i++) printf(ans[1]);
for(int i = 0; i < dx; i++) printf(ans[2]);
for(int i = 0; i < dy; i++) printf(ans[3]);
printf(ans[4]);
for(int i = 0; i < dx+1; i++) printf(ans[5]);
for(int i = 0; i < dy+1; i++) printf(ans[6]);
printf(ans[7]);
printf(ans[8]);
for(int i = 0; i < dx+1; i++) printf(ans[9]);
for(int i = 0; i < dy+1; i++) printf(ans[10]);
printf(ans[11]);
return 0;
} | a.cc: In function 'int main()':
a.cc:20:43: error: invalid conversion from 'char' to 'const char*' [-fpermissive]
20 | for(int i = 0; i < dx; i++) printf(ans[0]);
| ~~~~~^
| |
| char
In file included from /usr/include/c++/14/cstdio:42,
from /usr/include/c++/14/ext/string_conversions.h:45,
from /usr/include/c++/14/bits/basic_string.h:4154,
from /usr/include/c++/14/string:54,
from /usr/include/c++/14/bits/locale_classes.h:40,
from /usr/include/c++/14/bits/ios_base.h:41,
from /usr/include/c++/14/ios:44,
from /usr/include/c++/14/ostream:40,
from /usr/include/c++/14/iostream:41,
from a.cc:1:
/usr/include/stdio.h:363:43: note: initializing argument 1 of 'int printf(const char*, ...)'
363 | extern int printf (const char *__restrict __format, ...);
| ~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~
a.cc:21:43: error: invalid conversion from 'char' to 'const char*' [-fpermissive]
21 | for(int i = 0; i < dy; i++) printf(ans[1]);
| ~~~~~^
| |
| char
/usr/include/stdio.h:363:43: note: initializing argument 1 of 'int printf(const char*, ...)'
363 | extern int printf (const char *__restrict __format, ...);
| ~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~
a.cc:22:43: error: invalid conversion from 'char' to 'const char*' [-fpermissive]
22 | for(int i = 0; i < dx; i++) printf(ans[2]);
| ~~~~~^
| |
| char
/usr/include/stdio.h:363:43: note: initializing argument 1 of 'int printf(const char*, ...)'
363 | extern int printf (const char *__restrict __format, ...);
| ~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~
a.cc:23:43: error: invalid conversion from 'char' to 'const char*' [-fpermissive]
23 | for(int i = 0; i < dy; i++) printf(ans[3]);
| ~~~~~^
| |
| char
/usr/include/stdio.h:363:43: note: initializing argument 1 of 'int printf(const char*, ...)'
363 | extern int printf (const char *__restrict __format, ...);
| ~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~
a.cc:25:15: error: invalid conversion from 'char' to 'const char*' [-fpermissive]
25 | printf(ans[4]);
| ~~~~~^
| |
| char
/usr/include/stdio.h:363:43: note: initializing argument 1 of 'int printf(const char*, ...)'
363 | extern int printf (const char *__restrict __format, ...);
| ~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~
a.cc:26:45: error: invalid conversion from 'char' to 'const char*' [-fpermissive]
26 | for(int i = 0; i < dx+1; i++) printf(ans[5]);
| ~~~~~^
| |
| char
/usr/include/stdio.h:363:43: note: initializing argument 1 of 'int printf(const char*, ...)'
363 | extern int printf (const char *__restrict __format, ...);
| ~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~
a.cc:27:45: error: invalid conversion from 'char' to 'const char*' [-fpermissive]
27 | for(int i = 0; i < dy+1; i++) printf(ans[6]);
| ~~~~~^
| |
| char
/usr/include/stdio.h:363:43: note: initializing argument 1 of 'int printf(const char*, ...)'
363 | extern int printf (const char *__restrict __format, ...);
| ~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~
a.cc:28:15: error: invalid conversion from 'char' to 'const char*' [-fpermissive]
28 | printf(ans[7]);
| ~~~~~^
| |
| char
/usr/include/stdio.h:363:43: note: initializing argument 1 of 'int printf(const char*, ...)'
363 | extern int printf (const char *__restrict __format, ...);
| ~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~
a.cc:29:15: error: invalid conversion from 'char' to 'const char*' [-fpermissive]
29 | printf(ans[8]);
| ~~~~~^
| |
| char
/usr/include/stdio.h:363:43: note: initializing argument 1 of 'int printf(const char*, ...)'
363 | extern int printf (const char *__restrict __format, ...);
| ~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~
a.cc:30:45: error: invalid conversion from 'char' to 'const char*' [-fpermissive]
30 | for(int i = 0; i < dx+1; i++) printf(ans[9]);
| ~~~~~^
| |
| char
/usr/include/stdio.h:363:43: note: initializing argument 1 of 'int printf(const char*, ...)'
363 | extern int printf (const char *__restrict __format, ...);
| ~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~
a.cc:31:46: error: invalid conversion from 'char' to 'const char*' [-fpermissive]
31 | for(int i = 0; i < dy+1; i++) printf(ans[10]);
| ~~~~~~^
| |
| char
/usr/include/stdio.h:363:43: note: initializing argument 1 of 'int printf(const char*, ...)'
363 | extern int printf (const char *__restrict __format, ...);
| ~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~
a.cc:32:16: error: invalid conversion from 'char' to 'const char*' [-fpermissive]
32 | printf(ans[11]);
| ~~~~~~^
| |
| char
/usr/include/stdio.h:363:43: note: initializing argument 1 of 'int printf(const char*, ...)'
363 | extern int printf (const char *__restrict __format, ...);
| ~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~
|
s002449620 | p03836 | C++ | #include<iostream>
#include<cstdio>
#include<cmath>
using namespace std;
int main() {
int sx,sy,tx,ty;
cin >> sx >> sy >> tx >> ty;
int dx = abs(tx-sx);
int dy = abs(ty-sy);
char* rightup = "URDLDRULULDR";
char* leftdown = "DLURRDLULURD";
char* ans;
if(tx > sx) ans = rightup;
else ans = leftdown;
for(int i = 0; i < dx; i++) printf(ans[0]);
for(int i = 0; i < dy; i++) printf(ans[1]);
for(int i = 0; i < dx; i++) printf(ans[2]);
for(int i = 0; i < dy; i++) printf(ans[3]);
printf(ans[4]);
for(int i = 0; i < dx+1; i++) printf(ans[5]);
for(int i = 0; i < dy+1; i++) printf(ans[6]);
printf(ans[7]);
printf(ans[8]);
for(int i = 0; i < dx+1; i++) printf(ans[9]);
for(int i = 0; i < dy+1; i++) printf(ans[10]);
printf(ans[11]);
return 0;
} | a.cc: In function 'int main()':
a.cc:13:19: warning: ISO C++ forbids converting a string constant to 'char*' [-Wwrite-strings]
13 | char* rightup = "URDLDRULULDR";
| ^~~~~~~~~~~~~~
a.cc:14:20: warning: ISO C++ forbids converting a string constant to 'char*' [-Wwrite-strings]
14 | char* leftdown = "DLURRDLULURD";
| ^~~~~~~~~~~~~~
a.cc:20:43: error: invalid conversion from 'char' to 'const char*' [-fpermissive]
20 | for(int i = 0; i < dx; i++) printf(ans[0]);
| ~~~~~^
| |
| char
In file included from /usr/include/c++/14/cstdio:42,
from /usr/include/c++/14/ext/string_conversions.h:45,
from /usr/include/c++/14/bits/basic_string.h:4154,
from /usr/include/c++/14/string:54,
from /usr/include/c++/14/bits/locale_classes.h:40,
from /usr/include/c++/14/bits/ios_base.h:41,
from /usr/include/c++/14/ios:44,
from /usr/include/c++/14/ostream:40,
from /usr/include/c++/14/iostream:41,
from a.cc:1:
/usr/include/stdio.h:363:43: note: initializing argument 1 of 'int printf(const char*, ...)'
363 | extern int printf (const char *__restrict __format, ...);
| ~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~
a.cc:21:43: error: invalid conversion from 'char' to 'const char*' [-fpermissive]
21 | for(int i = 0; i < dy; i++) printf(ans[1]);
| ~~~~~^
| |
| char
/usr/include/stdio.h:363:43: note: initializing argument 1 of 'int printf(const char*, ...)'
363 | extern int printf (const char *__restrict __format, ...);
| ~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~
a.cc:22:43: error: invalid conversion from 'char' to 'const char*' [-fpermissive]
22 | for(int i = 0; i < dx; i++) printf(ans[2]);
| ~~~~~^
| |
| char
/usr/include/stdio.h:363:43: note: initializing argument 1 of 'int printf(const char*, ...)'
363 | extern int printf (const char *__restrict __format, ...);
| ~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~
a.cc:23:43: error: invalid conversion from 'char' to 'const char*' [-fpermissive]
23 | for(int i = 0; i < dy; i++) printf(ans[3]);
| ~~~~~^
| |
| char
/usr/include/stdio.h:363:43: note: initializing argument 1 of 'int printf(const char*, ...)'
363 | extern int printf (const char *__restrict __format, ...);
| ~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~
a.cc:25:15: error: invalid conversion from 'char' to 'const char*' [-fpermissive]
25 | printf(ans[4]);
| ~~~~~^
| |
| char
/usr/include/stdio.h:363:43: note: initializing argument 1 of 'int printf(const char*, ...)'
363 | extern int printf (const char *__restrict __format, ...);
| ~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~
a.cc:26:45: error: invalid conversion from 'char' to 'const char*' [-fpermissive]
26 | for(int i = 0; i < dx+1; i++) printf(ans[5]);
| ~~~~~^
| |
| char
/usr/include/stdio.h:363:43: note: initializing argument 1 of 'int printf(const char*, ...)'
363 | extern int printf (const char *__restrict __format, ...);
| ~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~
a.cc:27:45: error: invalid conversion from 'char' to 'const char*' [-fpermissive]
27 | for(int i = 0; i < dy+1; i++) printf(ans[6]);
| ~~~~~^
| |
| char
/usr/include/stdio.h:363:43: note: initializing argument 1 of 'int printf(const char*, ...)'
363 | extern int printf (const char *__restrict __format, ...);
| ~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~
a.cc:28:15: error: invalid conversion from 'char' to 'const char*' [-fpermissive]
28 | printf(ans[7]);
| ~~~~~^
| |
| char
/usr/include/stdio.h:363:43: note: initializing argument 1 of 'int printf(const char*, ...)'
363 | extern int printf (const char *__restrict __format, ...);
| ~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~
a.cc:29:15: error: invalid conversion from 'char' to 'const char*' [-fpermissive]
29 | printf(ans[8]);
| ~~~~~^
| |
| char
/usr/include/stdio.h:363:43: note: initializing argument 1 of 'int printf(const char*, ...)'
363 | extern int printf (const char *__restrict __format, ...);
| ~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~
a.cc:30:45: error: invalid conversion from 'char' to 'const char*' [-fpermissive]
30 | for(int i = 0; i < dx+1; i++) printf(ans[9]);
| ~~~~~^
| |
| char
/usr/include/stdio.h:363:43: note: initializing argument 1 of 'int printf(const char*, ...)'
363 | extern int printf (const char *__restrict __format, ...);
| ~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~
a.cc:31:46: error: invalid conversion from 'char' to 'const char*' [-fpermissive]
31 | for(int i = 0; i < dy+1; i++) printf(ans[10]);
| ~~~~~~^
| |
| char
/usr/include/stdio.h:363:43: note: initializing argument 1 of 'int printf(const char*, ...)'
363 | extern int printf (const char *__restrict __format, ...);
| ~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~
a.cc:32:16: error: invalid conversion from 'char' to 'const char*' [-fpermissive]
32 | printf(ans[11]);
| ~~~~~~^
| |
| char
/usr/include/stdio.h:363:43: note: initializing argument 1 of 'int printf(const char*, ...)'
363 | extern int printf (const char *__restrict __format, ...);
| ~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~
|
s502434870 | p03836 | C++ | #include<iostream>
#include<cstdio>
#include<cmath>
using namespace std;
int main() {
int sx,sy,tx,ty;
cin >> sx >> sy >> tx >> ty;
int dx = abs(tx-sx);
int dy = abs(ty-sy);
char rightup[] = ['U','R','D','L','D','R','U','L','U','L','D','R'];
char leftdown[] = ['D','L','U','R','R','D','L','U','L','U','R','D'];
for(int i = 0; i < dx; i++) printf("U");
for(int i = 0; i < dy; i++) printf("R");
for(int i = 0; i < dx; i++) printf("D");
for(int i = 0; i < dy; i++) printf("L");
printf("D");
for(int i = 0; i < dx+1; i++) printf("R");
for(int i = 0; i < dy+1; i++) printf("U");
printf("L");
printf("U");
for(int i = 0; i < dx+1; i++) printf("L");
for(int i = 0; i < dy+1; i++) printf("D");
printf("R");
return 0;
} | a.cc: In function 'int main()':
a.cc:13:21: error: expected identifier before 'U'
13 | char rightup[] = ['U','R','D','L','D','R','U','L','U','L','D','R'];
| ^~~
a.cc:13:24: error: expected ']' before ',' token
13 | char rightup[] = ['U','R','D','L','D','R','U','L','U','L','D','R'];
| ^
| ]
a.cc: In lambda function:
a.cc:13:24: error: expected '{' before ',' token
a.cc: In function 'int main()':
a.cc:13:20: error: initializer fails to determine size of 'rightup'
13 | char rightup[] = ['U','R','D','L','D','R','U','L','U','L','D','R'];
| ^~~~
a.cc:13:20: error: array must be initialized with a brace-enclosed initializer
a.cc:13:25: error: expected unqualified-id before 'R'
13 | char rightup[] = ['U','R','D','L','D','R','U','L','U','L','D','R'];
| ^~~
a.cc:14:22: error: expected identifier before 'D'
14 | char leftdown[] = ['D','L','U','R','R','D','L','U','L','U','R','D'];
| ^~~
a.cc:14:25: error: expected ']' before ',' token
14 | char leftdown[] = ['D','L','U','R','R','D','L','U','L','U','R','D'];
| ^
| ]
a.cc: In lambda function:
a.cc:14:25: error: expected '{' before ',' token
a.cc: In function 'int main()':
a.cc:14:21: error: initializer fails to determine size of 'leftdown'
14 | char leftdown[] = ['D','L','U','R','R','D','L','U','L','U','R','D'];
| ^~~~
a.cc:14:21: error: array must be initialized with a brace-enclosed initializer
a.cc:14:26: error: expected unqualified-id before 'L'
14 | char leftdown[] = ['D','L','U','R','R','D','L','U','L','U','R','D'];
| ^~~
|
s710470264 | p03836 | C++ | #include<iostream>
#include<cstdio>
#include<cmath>
using namespace std;
int main() {
int sx,sy,tx,ty;
cin >> sx >> sy >> tx >> ty;
int dx = abs(tx-sx);
int dy = abs(ty-sy);
char[] rightup = ['U','R','D','L','D','R','U','L','U','L','D','R'];
char[] leftdown = ['D','L','U','R','R','D','L','U','L','U','R','D'];
for(int i = 0; i < dx; i++) printf("U");
for(int i = 0; i < dy; i++) printf("R");
for(int i = 0; i < dx; i++) printf("D");
for(int i = 0; i < dy; i++) printf("L");
printf("D");
for(int i = 0; i < dx+1; i++) printf("R");
for(int i = 0; i < dy+1; i++) printf("U");
printf("L");
printf("U");
for(int i = 0; i < dx+1; i++) printf("L");
for(int i = 0; i < dy+1; i++) printf("D");
printf("R");
return 0;
} | a.cc: In function 'int main()':
a.cc:13:7: error: structured binding declaration cannot have type 'char'
13 | char[] rightup = ['U','R','D','L','D','R','U','L','U','L','D','R'];
| ^~
a.cc:13:7: note: type must be cv-qualified 'auto' or reference to cv-qualified 'auto'
a.cc:13:7: error: empty structured binding declaration
a.cc:13:10: error: expected initializer before 'rightup'
13 | char[] rightup = ['U','R','D','L','D','R','U','L','U','L','D','R'];
| ^~~~~~~
a.cc:14:7: error: structured binding declaration cannot have type 'char'
14 | char[] leftdown = ['D','L','U','R','R','D','L','U','L','U','R','D'];
| ^~
a.cc:14:7: note: type must be cv-qualified 'auto' or reference to cv-qualified 'auto'
a.cc:14:7: error: empty structured binding declaration
a.cc:14:10: error: expected initializer before 'leftdown'
14 | char[] leftdown = ['D','L','U','R','R','D','L','U','L','U','R','D'];
| ^~~~~~~~
|
s669949651 | p03836 | C++ | #include <bits/stdc++.h>
#define rep(i,n) for(int i=0;i<n;i++)
#define FOR(i,start,end) for(int i=start;i<=end;i++)
const int INF = 1001001001;
typedef long long ll;
const ll MOD=1000000007;
using namespace std;
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return 1; } return 0; }
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return 1; } return 0; }
template<class T>auto MAX(const T& a) { return *max_element(a.begin(),a.end()); }
template<class T>auto MIN(const T& a) { return *min_element(a.begin(),a.end()); }
template<class T, class U>U SUM(const T& a, const U& v) { return accumulate(a.begin(),a.end(), v); }
template<class T, class U>U COUNT(const T& a, const U& v) { return count(a.begin(),a.end(), v); }
template<class T, class U>int LOWER(const T& a, const U& v) { return lower_bound(a.begin(),a.end(), v) - a.begin(); }
template<class T, class U>int UPPER(const T& a, const U& v) { return upper_bound(a.begin(),a.end(), v) - a.begin(); }
int GCD(int a, int b) { return b ? GCD(b, a%b) : a; }
int LCM(int a, int b) { int g = GCD(a, b); return a / g * b; }
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;
} | a.cc:26:19: error: extended character ’ is not valid in an identifier
26 | cout << string(dy,’U’) << string(dx,’R’);
| ^
a.cc:26:19: error: extended character ’ is not valid in an identifier
a.cc:26:37: error: extended character ’ is not valid in an identifier
26 | cout << string(dy,’U’) << string(dx,’R’);
| ^
a.cc:26:37: error: extended character ’ is not valid in an identifier
a.cc:29:19: error: extended character ’ is not valid in an identifier
29 | cout << string(dy,’D’) << string(dx,’L’);
| ^
a.cc:29:19: error: extended character ’ is not valid in an identifier
a.cc:29:37: error: extended character ’ is not valid in an identifier
29 | cout << string(dy,’D’) << string(dx,’L’);
| ^
a.cc:29:37: error: extended character ’ is not valid in an identifier
a.cc:32:9: error: extended character ’ is not valid in an identifier
32 | cout << ’L’ << string(dy+1,’U’) << string(dx+1,’R’) << ’D’;
| ^
a.cc:32:9: error: extended character ’ is not valid in an identifier
a.cc:32:28: error: extended character ’ is not valid in an identifier
32 | cout << ’L’ << string(dy+1,’U’) << string(dx+1,’R’) << ’D’;
| ^
a.cc:32:28: error: extended character ’ is not valid in an identifier
a.cc:32:48: error: extended character ’ is not valid in an identifier
32 | cout << ’L’ << string(dy+1,’U’) << string(dx+1,’R’) << ’D’;
| ^
a.cc:32:48: error: extended character ’ is not valid in an identifier
a.cc:32:56: error: extended character ’ is not valid in an identifier
32 | cout << ’L’ << string(dy+1,’U’) << string(dx+1,’R’) << ’D’;
| ^
a.cc:32:56: error: extended character ’ is not valid in an identifier
a.cc:35:9: error: extended character ’ is not valid in an identifier
35 | cout << ’R’ << string(dy+1,’D’) << string(dx+1,’L’) << ’U’;
| ^
a.cc:35:9: error: extended character ’ is not valid in an identifier
a.cc:35:28: error: extended character ’ is not valid in an identifier
35 | cout << ’R’ << string(dy+1,’D’) << string(dx+1,’L’) << ’U’;
| ^
a.cc:35:28: error: extended character ’ is not valid in an identifier
a.cc:35:48: error: extended character ’ is not valid in an identifier
35 | cout << ’R’ << string(dy+1,’D’) << string(dx+1,’L’) << ’U’;
| ^
a.cc:35:48: error: extended character ’ is not valid in an identifier
a.cc:35:56: error: extended character ’ is not valid in an identifier
35 | cout << ’R’ << string(dy+1,’D’) << string(dx+1,’L’) << ’U’;
| ^
a.cc:35:56: error: extended character ’ is not valid in an identifier
a.cc: In function 'int main()':
a.cc:26:19: error: '\U00002019U\U00002019' was not declared in this scope
26 | cout << string(dy,’U’) << string(dx,’R’);
| ^~~
a.cc:26:37: error: '\U00002019R\U00002019' was not declared in this scope
26 | cout << string(dy,’U’) << string(dx,’R’);
| ^~~
a.cc:29:19: error: '\U00002019D\U00002019' was not declared in this scope
29 | cout << string(dy,’D’) << string(dx,’L’);
| ^~~
a.cc:29:37: error: '\U00002019L\U00002019' was not declared in this scope
29 | cout << string(dy,’D’) << string(dx,’L’);
| ^~~
|
s944804431 | p03836 | C++ | #include <bits/stdc++.h>
#define rep(i,n) for(int i=0;i<n;i++)
#define FOR(i,start,end) for(int i=start;i<=end;i++)
const int INF = 1001001001;
typedef long long ll;
const ll MOD=1000000007;
using namespace std;
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return 1; } return 0; }
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return 1; } return 0; }
template<class T>auto MAX(const T& a) { return *max_element(a.begin(),a.end()); }
template<class T>auto MIN(const T& a) { return *min_element(a.begin(),a.end()); }
template<class T, class U>U SUM(const T& a, const U& v) { return accumulate(a.begin(),a.end(), v); }
template<class T, class U>U COUNT(const T& a, const U& v) { return count(a.begin(),a.end(), v); }
template<class T, class U>int LOWER(const T& a, const U& v) { return lower_bound(a.begin(),a.end(), v) - a.begin(); }
template<class T, class U>int UPPER(const T& a, const U& v) { return upper_bound(a.begin(),a.end(), v) - a.begin(); }
int GCD(int a, int b) { return b ? GCD(b, a%b) : a; }
int LCM(int a, int b) { int g = GCD(a, b); return a / g * b; }
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;
} | a.cc:26:19: error: extended character ’ is not valid in an identifier
26 | cout << string(dy,’U’) << string(dx,’R’);
| ^
a.cc:26:19: error: extended character ’ is not valid in an identifier
a.cc:26:37: error: extended character ’ is not valid in an identifier
26 | cout << string(dy,’U’) << string(dx,’R’);
| ^
a.cc:26:37: error: extended character ’ is not valid in an identifier
a.cc:29:19: error: extended character ’ is not valid in an identifier
29 | cout << string(dy,’D’) << string(dx,’L’);
| ^
a.cc:29:19: error: extended character ’ is not valid in an identifier
a.cc:29:37: error: extended character ’ is not valid in an identifier
29 | cout << string(dy,’D’) << string(dx,’L’);
| ^
a.cc:29:37: error: extended character ’ is not valid in an identifier
a.cc:32:10: error: extended character ’ is not valid in an identifier
32 | cout << ’L’ << string(dy+1,’U’) << string(dx+1,’R’) << ’D’;
| ^
a.cc:32:10: error: extended character ’ is not valid in an identifier
a.cc:32:29: error: extended character ’ is not valid in an identifier
32 | cout << ’L’ << string(dy+1,’U’) << string(dx+1,’R’) << ’D’;
| ^
a.cc:32:29: error: extended character ’ is not valid in an identifier
a.cc:32:49: error: extended character ’ is not valid in an identifier
32 | cout << ’L’ << string(dy+1,’U’) << string(dx+1,’R’) << ’D’;
| ^
a.cc:32:49: error: extended character ’ is not valid in an identifier
a.cc:32:57: error: extended character ’ is not valid in an identifier
32 | cout << ’L’ << string(dy+1,’U’) << string(dx+1,’R’) << ’D’;
| ^
a.cc:32:57: error: extended character ’ is not valid in an identifier
a.cc:35:10: error: extended character ’ is not valid in an identifier
35 | cout << ’R’ << string(dy+1,’D’) << string(dx+1,’L’) << ’U’;
| ^
a.cc:35:10: error: extended character ’ is not valid in an identifier
a.cc:35:29: error: extended character ’ is not valid in an identifier
35 | cout << ’R’ << string(dy+1,’D’) << string(dx+1,’L’) << ’U’;
| ^
a.cc:35:29: error: extended character ’ is not valid in an identifier
a.cc:35:49: error: extended character ’ is not valid in an identifier
35 | cout << ’R’ << string(dy+1,’D’) << string(dx+1,’L’) << ’U’;
| ^
a.cc:35:49: error: extended character ’ is not valid in an identifier
a.cc:35:57: error: extended character ’ is not valid in an identifier
35 | cout << ’R’ << string(dy+1,’D’) << string(dx+1,’L’) << ’U’;
| ^
a.cc:35:57: error: extended character ’ is not valid in an identifier
a.cc: In function 'int main()':
a.cc:26:19: error: '\U00002019U\U00002019' was not declared in this scope
26 | cout << string(dy,’U’) << string(dx,’R’);
| ^~~
a.cc:26:37: error: '\U00002019R\U00002019' was not declared in this scope
26 | cout << string(dy,’U’) << string(dx,’R’);
| ^~~
a.cc:29:19: error: '\U00002019D\U00002019' was not declared in this scope
29 | cout << string(dy,’D’) << string(dx,’L’);
| ^~~
a.cc:29:37: error: '\U00002019L\U00002019' was not declared in this scope
29 | cout << string(dy,’D’) << string(dx,’L’);
| ^~~
|
s255649608 | 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;
} | a.cc:10:19: error: extended character ’ is not valid in an identifier
10 | cout << string(dy,’U’) << string(dx,’R’);
| ^
a.cc:10:19: error: extended character ’ is not valid in an identifier
a.cc:10:37: error: extended character ’ is not valid in an identifier
10 | cout << string(dy,’U’) << string(dx,’R’);
| ^
a.cc:10:37: error: extended character ’ is not valid in an identifier
a.cc:13:19: error: extended character ’ is not valid in an identifier
13 | cout << string(dy,’D’) << string(dx,’L’);
| ^
a.cc:13:19: error: extended character ’ is not valid in an identifier
a.cc:13:37: error: extended character ’ is not valid in an identifier
13 | cout << string(dy,’D’) << string(dx,’L’);
| ^
a.cc:13:37: 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:19: error: '\U00002019U\U00002019' was not declared in this scope
10 | cout << string(dy,’U’) << string(dx,’R’);
| ^~~
a.cc:10:37: error: '\U00002019R\U00002019' was not declared in this scope
10 | cout << string(dy,’U’) << string(dx,’R’);
| ^~~
a.cc:13:19: error: '\U00002019D\U00002019' was not declared in this scope
13 | cout << string(dy,’D’) << string(dx,’L’);
| ^~~
a.cc:13:37: error: '\U00002019L\U00002019' was not declared in this scope
13 | cout << string(dy,’D’) << string(dx,’L’);
| ^~~
|
s529562806 | 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:19: error: extended character ’ is not valid in an identifier
10 | cout << string(dy,’U’) << string(dx,’R’);
| ^
a.cc:10:19: error: extended character ’ is not valid in an identifier
a.cc:10:37: error: extended character ’ is not valid in an identifier
10 | cout << string(dy,’U’) << string(dx,’R’);
| ^
a.cc:10:37: error: extended character ’ is not valid in an identifier
a.cc:13:19: error: extended character ’ is not valid in an identifier
13 | cout << string(dy,’D’) << string(dx,’L’);
| ^
a.cc:13:19: error: extended character ’ is not valid in an identifier
a.cc:13:37: error: extended character ’ is not valid in an identifier
13 | cout << string(dy,’D’) << string(dx,’L’);
| ^
a.cc:13:37: 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:19: error: '\U00002019U\U00002019' was not declared in this scope
10 | cout << string(dy,’U’) << string(dx,’R’);
| ^~~
a.cc:10:37: error: '\U00002019R\U00002019' was not declared in this scope
10 | cout << string(dy,’U’) << string(dx,’R’);
| ^~~
a.cc:13:19: error: '\U00002019D\U00002019' was not declared in this scope
13 | cout << string(dy,’D’) << string(dx,’L’);
| ^~~
a.cc:13:37: error: '\U00002019L\U00002019' was not declared in this scope
13 | cout << string(dy,’D’) << string(dx,’L’);
| ^~~
|
s149362281 | p03836 | C++ | #include <bits/stdc++.h>
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:9:19: error: extended character ’ is not valid in an identifier
9 | cout << string(dy,’U’) << string(dx,’R’);
| ^
a.cc:9:19: error: extended character ’ is not valid in an identifier
a.cc:9:37: error: extended character ’ is not valid in an identifier
9 | cout << string(dy,’U’) << string(dx,’R’);
| ^
a.cc:9:37: error: extended character ’ is not valid in an identifier
a.cc:12:19: error: extended character ’ is not valid in an identifier
12 | cout << string(dy,’D’) << string(dx,’L’);
| ^
a.cc:12:19: error: extended character ’ is not valid in an identifier
a.cc:12:37: error: extended character ’ is not valid in an identifier
12 | cout << string(dy,’D’) << string(dx,’L’);
| ^
a.cc:12:37: error: extended character ’ is not valid in an identifier
a.cc:15:10: error: extended character ’ is not valid in an identifier
15 | cout << ’L’ << string(dy+1,’U’) << string(dx+1,’R’) << ’D’;
| ^
a.cc:15:10: error: extended character ’ is not valid in an identifier
a.cc:15:29: error: extended character ’ is not valid in an identifier
15 | cout << ’L’ << string(dy+1,’U’) << string(dx+1,’R’) << ’D’;
| ^
a.cc:15:29: error: extended character ’ is not valid in an identifier
a.cc:15:49: error: extended character ’ is not valid in an identifier
15 | cout << ’L’ << string(dy+1,’U’) << string(dx+1,’R’) << ’D’;
| ^
a.cc:15:49: error: extended character ’ is not valid in an identifier
a.cc:15:57: error: extended character ’ is not valid in an identifier
15 | cout << ’L’ << string(dy+1,’U’) << string(dx+1,’R’) << ’D’;
| ^
a.cc:15:57: error: extended character ’ is not valid in an identifier
a.cc:18:10: error: extended character ’ is not valid in an identifier
18 | cout << ’R’ << string(dy+1,’D’) << string(dx+1,’L’) << ’U’;
| ^
a.cc:18:10: error: extended character ’ is not valid in an identifier
a.cc:18:29: error: extended character ’ is not valid in an identifier
18 | cout << ’R’ << string(dy+1,’D’) << string(dx+1,’L’) << ’U’;
| ^
a.cc:18:29: error: extended character ’ is not valid in an identifier
a.cc:18:49: error: extended character ’ is not valid in an identifier
18 | cout << ’R’ << string(dy+1,’D’) << string(dx+1,’L’) << ’U’;
| ^
a.cc:18:49: error: extended character ’ is not valid in an identifier
a.cc:18:57: error: extended character ’ is not valid in an identifier
18 | cout << ’R’ << string(dy+1,’D’) << string(dx+1,’L’) << ’U’;
| ^
a.cc:18:57: error: extended character ’ is not valid in an identifier
a.cc: In function 'int main()':
a.cc:4:1: error: 'cin' was not declared in this scope; did you mean 'std::cin'?
4 | 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:9:1: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
9 | cout << string(dy,’U’) << string(dx,’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:9:19: error: '\U00002019U\U00002019' was not declared in this scope
9 | cout << string(dy,’U’) << string(dx,’R’);
| ^~~
a.cc:9:9: error: 'string' was not declared in this scope
9 | cout << string(dy,’U’) << string(dx,’R’);
| ^~~~~~
a.cc:9:9: 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>;
| ^~~~~~
a.cc:9:37: error: '\U00002019R\U00002019' was not declared in this scope
9 | cout << string(dy,’U’) << string(dx,’R’);
| ^~~
a.cc:12:19: error: '\U00002019D\U00002019' was not declared in this scope
12 | cout << string(dy,’D’) << string(dx,’L’);
| ^~~
a.cc:12:37: error: '\U00002019L\U00002019' was not declared in this scope
12 | cout << string(dy,’D’) << string(dx,’L’);
| ^~~
a.cc:21:9: error: 'endl' was not declared in this scope; did you mean 'std::endl'?
21 | cout << 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)
| ^~~~
|
s487386728 | 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:1: 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:9: error: 'endl' was not declared in this scope
20 | cout << endl;
| ^~~~
|
s180189297 | p03836 | C++ | #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;
rep(i, dx) {
cout << "R";
}
rep(i, dy) {
cout << "U";
}
rep(i, dx) {
cout << "L";
}
rep(i, dy) {
cout << "D";
}
}
| a.cc: In function 'int main()':
a.cc:11:7: error: 'i' was not declared in this scope
11 | rep(i, dx) {
| ^
a.cc:11:3: error: 'rep' was not declared in this scope
11 | rep(i, dx) {
| ^~~
|
s672898611 | p03836 | C++ | #include<bits/stdc++.h>
#include <iostream>
#include <string>
#include <cmath>
using namespace std;
#define ll long long
#define rep(i, n) for (ll i = 0; i < (n); i++)
#define FOR(i,a,b) for(ll i=(a);i<(b);i++)
#define FORR(i,a,b)for(ll i=(a);i<=(b);i++)
#define repR(i,n) for(ll i=n;i>=0;i--)
#define all(v)(v).begin(),(v).end()
#define rall(v)(v).rbegin(),(v).rend()
#define F first
#define S second
#define pb push_back
#define pu push
#define COUT(x) cout<<(x)<<endl
#define PQ priority_queue<ll>
#define PQR priority_queue<ll,vector<ll>,greater<ll>>
#define YES(n) cout << ((n) ? "YES" : "NO" ) << endl
#define Yes(n) cout << ((n) ? "Yes" : "No" ) << endl
#define mp make_pair
#define maxs(x,y) (x = max(x,y))
#define mins(x,y) (x = min(x,y))
#define sz(x) (int)(x).size()
typedef pair<int,int> pii;
typedef pair<ll,ll> pll;
const ll MOD = 1000000007LL;
const ll INF = 1LL << 60;
using vll = vector<ll>;
using vb = vector<bool>;
using vvb = vector<vb>;
using vvll = vector<vll>;
using vstr = vector<string>;
using pll = pair<ll, ll>;
int main(){
ll sx,sy,tx,ty;
cin>>sx>>sy>>tx>>ty;
vector<char> ans(0);
rep(i,tx-sx){
ans.pb('R');
}
rep(i,ty-sy){
ans.pb('U');
}
rep(i,tx-sx){
ans.pb('L');
}
rep(i,ty-sy){
ans.pb('D');
}
ans.pb('D');
rep(i,ts-sx+1){
ans.pb('R');
}
rep(i,ty-sy+1){
ans.pb('U');
}
ans.pb('L');
ans.pb('U');
rep(i,ts-sx+1){
ans.pb('L');
}
rep(i,ty-sy+1){
ans.pb('D');
}
ans.pb('R');
rep(i,sz(ans)){
cout<<ans[i];
}
} | a.cc: In function 'int main()':
a.cc:53:9: error: 'ts' was not declared in this scope; did you mean 'ty'?
53 | rep(i,ts-sx+1){
| ^~
a.cc:7:39: note: in definition of macro 'rep'
7 | #define rep(i, n) for (ll i = 0; i < (n); i++)
| ^
a.cc:61:9: error: 'ts' was not declared in this scope; did you mean 'ty'?
61 | rep(i,ts-sx+1){
| ^~
a.cc:7:39: note: in definition of macro 'rep'
7 | #define rep(i, n) for (ll i = 0; i < (n); i++)
| ^
|
s230065510 | p03836 | C++ | #include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (n); ++i)
#define reps(i, n) for (int i = (a); i < (n); ++i)
#define int long long
int main(){
int s1, s2, t1, t2;
cin << s1 << s2 << t1 << t2;
string S;
}
| cc1plus: error: '::main' must return 'int'
a.cc: In function 'int main()':
a.cc:9:7: error: no match for 'operator<<' (operand types are 'std::istream' {aka 'std::basic_istream<char>'} and 'long long int')
9 | cin << s1 << s2 << t1 << t2;
| ~~~ ^~ ~~
| | |
| | long long int
| std::istream {aka std::basic_istream<char>}
a.cc:9:7: note: candidate: 'operator<<(int, long long int)' (built-in)
9 | cin << s1 << s2 << t1 << t2;
| ~~~~^~~~~
a.cc:9:7: note: no known conversion for argument 1 from 'std::istream' {aka 'std::basic_istream<char>'} to 'int'
In file included from /usr/include/c++/14/regex:68,
from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:181,
from a.cc:1:
/usr/include/c++/14/bits/regex.h:1715:5: note: candidate: 'template<class _Ch_type, class _Ch_traits, class _Bi_iter> std::basic_ostream<_CharT, _Traits>& std::__cxx11::operator<<(std::basic_ostream<_CharT, _Traits>&, const sub_match<_Bi_iter>&)'
1715 | operator<<(basic_ostream<_Ch_type, _Ch_traits>& __os,
| ^~~~~~~~
/usr/include/c++/14/bits/regex.h:1715:5: note: template argument deduction/substitution failed:
a.cc:9:10: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<_CharT, _Traits>'
9 | cin << s1 << s2 << t1 << t2;
| ^~
In file included from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:41:
/usr/include/c++/14/cstddef:125:5: note: candidate: 'template<class _IntegerType> constexpr std::__byte_op_t<_IntegerType> std::operator<<(byte, _IntegerType)'
125 | operator<<(byte __b, _IntegerType __shift) noexcept
| ^~~~~~~~
/usr/include/c++/14/cstddef:125:5: note: template argument deduction/substitution failed:
a.cc:9:3: note: cannot convert 'std::cin' (type 'std::istream' {aka 'std::basic_istream<char>'}) to type 'std::byte'
9 | cin << s1 << s2 << t1 << t2;
| ^~~
In file included from /usr/include/c++/14/bits/basic_string.h:47,
from /usr/include/c++/14/string:54,
from /usr/include/c++/14/bitset:52,
from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:52:
/usr/include/c++/14/string_view:763:5: note: candidate: 'template<class _CharT, class _Traits> std::basic_ostream<_CharT, _Traits>& std::operator<<(basic_ostream<_CharT, _Traits>&, basic_string_view<_CharT, _Traits>)'
763 | operator<<(basic_ostream<_CharT, _Traits>& __os,
| ^~~~~~~~
/usr/include/c++/14/string_view:763:5: note: template argument deduction/substitution failed:
a.cc:9:10: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<_CharT, _Traits>'
9 | cin << s1 << s2 << t1 << t2;
| ^~
/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:9:10: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<_CharT, _Traits>'
9 | cin << s1 << s2 << t1 << t2;
| ^~
/usr/include/c++/14/bitset:1687:5: note: candidate: 'template<class _CharT, class _Traits, long unsigned int _Nb> std::basic_ostream<_CharT, _Traits>& std::operator<<(basic_ostream<_CharT, _Traits>&, const bitset<_Nb>&)'
1687 | operator<<(std::basic_ostream<_CharT, _Traits>& __os,
| ^~~~~~~~
/usr/include/c++/14/bitset:1687:5: note: template argument deduction/substitution failed:
a.cc:9:10: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<_CharT, _Traits>'
9 | cin << s1 << s2 << t1 << t2;
| ^~
In file included from /usr/include/c++/14/bits/ios_base.h:46,
from /usr/include/c++/14/streambuf:43,
from /usr/include/c++/14/bits/streambuf_iterator.h:35,
from /usr/include/c++/14/iterator:66,
from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:54:
/usr/include/c++/14/system_error:339:5: note: candidate: 'template<class _CharT, class _Traits> std::basic_ostream<_CharT, _Traits>& std::operator<<(basic_ostream<_CharT, _Traits>&, const error_code&)'
339 | operator<<(basic_ostream<_CharT, _Traits>& __os, const error_code& __e)
| ^~~~~~~~
/usr/include/c++/14/system_error:339:5: note: template argument deduction/substitution failed:
a.cc:9:10: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<_CharT, _Traits>'
9 | cin << s1 << s2 << t1 << t2;
| ^~
In file included from /usr/include/c++/14/memory:80,
from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:56:
/usr/include/c++/14/bits/shared_ptr.h:70:5: note: candidate: 'template<class _Ch, class _Tr, class _Tp, __gnu_cxx::_Lock_policy _Lp> std::basic_ostream<_CharT, _Traits>& std::operator<<(basic_ostream<_CharT, _Traits>&, const __shared_ptr<_Tp, _Lp>&)'
70 | operator<<(std::basic_ostream<_Ch, _Tr>& __os,
| ^~~~~~~~
/usr/include/c++/14/bits/shared_ptr.h:70:5: note: template argument deduction/substitution failed:
a.cc:9:10: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<_CharT, _Traits>'
9 | cin << s1 << s2 << t1 << t2;
| ^~
In file included from /usr/include/c++/14/istream:41,
from /usr/include/c++/14/sstream:40,
from /usr/include/c++/14/complex:45,
from /usr/include/c++/14/ccomplex:39,
from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:127:
/usr/include/c++/14/ostream:563:5: note: candidate: 'template<class _CharT, class _Traits> std::basic_ostream<_CharT, _Traits>& std::operator<<(basic_ostream<_CharT, _Traits>&, _CharT)'
563 | operator<<(basic_ostream<_CharT, _Traits>& __out, _CharT __c)
| ^~~~~~~~
/usr/include/c++/14/ostream:563:5: note: template argument deduction/substitution failed:
a.cc:9:10: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<_CharT, _Traits>'
9 | cin << s1 << s2 << t1 << t2;
| ^~
/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:9:10: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<_CharT, _Traits>'
9 | cin << s1 << s2 << t1 << t2;
| ^~
/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:9:10: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<char, _Traits>'
9 | cin << s1 << s2 << t1 << t2;
| ^~
/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:9:10: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<char, _Traits>'
9 | cin << s1 << s2 << t1 << t2;
| ^~
/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:9:10: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<char, _Traits>'
9 | cin << s1 << s2 << t1 << t2;
| ^~
/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:9:10: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<_CharT, _Traits>'
9 | cin << s1 << s2 << t1 << t2;
| ^~
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:9:10: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<_CharT, _Traits>'
9 | cin << s1 << s2 << t1 << t2;
| ^~
/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: templ |
s248657060 | p03836 | C | #include<stdio.h>
int main(void){
int sx,sy,tx,ty,i,x,y;
scanf("%d%d%d%d",&sx,&sy,&tx,&ty);
x=tx-sx;
y=ty-sy;
for(i=1;i<=y;i++){
printf("U");//一回目行きy
}
for(i=1;i<=x;i++)
printf("R");//一回目行きx
}
for(i=1;i<=y;i++)
printf("D");//一回目帰りy
}
for(i=1;i<=x;i++)
printf("L");//一回目帰りx
}
//二回目行き
printf("L");
for(i=1;i<=y+1;i++){
printf("U");//二回目行きy
}
for(i=1;i<=x+1;i++){
printf("R");//二回目行きx
}
printf("D");
//二回目帰り
printf("R");
for(i=1;i<=y+1;i++){
printf("D");//二回目帰りy
}
for(i=1;i<=x+1;i++){
printf("L");//二回目帰りx
}
printf("U\n");
return 0;
}
| main.c:13:1: error: expected identifier or '(' before 'for'
13 | for(i=1;i<=y;i++)
| ^~~
main.c:13:10: error: expected '=', ',', ';', 'asm' or '__attribute__' before '<=' token
13 | for(i=1;i<=y;i++)
| ^~
main.c:13:15: error: expected '=', ',', ';', 'asm' or '__attribute__' before '++' token
13 | for(i=1;i<=y;i++)
| ^~
main.c:15:1: error: expected identifier or '(' before '}' token
15 | }
| ^
main.c:16:1: error: expected identifier or '(' before 'for'
16 | for(i=1;i<=x;i++)
| ^~~
main.c:16:10: error: expected '=', ',', ';', 'asm' or '__attribute__' before '<=' token
16 | for(i=1;i<=x;i++)
| ^~
main.c:16:15: error: expected '=', ',', ';', 'asm' or '__attribute__' before '++' token
16 | for(i=1;i<=x;i++)
| ^~
main.c:18:1: error: expected identifier or '(' before '}' token
18 | }
| ^
main.c:20:8: error: expected declaration specifiers or '...' before string constant
20 | printf("L");
| ^~~
main.c:21:2: error: expected identifier or '(' before 'for'
21 | for(i=1;i<=y+1;i++){
| ^~~
main.c:21:11: error: expected '=', ',', ';', 'asm' or '__attribute__' before '<=' token
21 | for(i=1;i<=y+1;i++){
| ^~
main.c:21:18: error: expected '=', ',', ';', 'asm' or '__attribute__' before '++' token
21 | for(i=1;i<=y+1;i++){
| ^~
main.c:24:2: error: expected identifier or '(' before 'for'
24 | for(i=1;i<=x+1;i++){
| ^~~
main.c:24:11: error: expected '=', ',', ';', 'asm' or '__attribute__' before '<=' token
24 | for(i=1;i<=x+1;i++){
| ^~
main.c:24:18: error: expected '=', ',', ';', 'asm' or '__attribute__' before '++' token
24 | for(i=1;i<=x+1;i++){
| ^~
main.c:27:8: error: expected declaration specifiers or '...' before string constant
27 | printf("D");
| ^~~
main.c:29:8: error: expected declaration specifiers or '...' before string constant
29 | printf("R");
| ^~~
main.c:30:2: error: expected identifier or '(' before 'for'
30 | for(i=1;i<=y+1;i++){
| ^~~
main.c:30:11: error: expected '=', ',', ';', 'asm' or '__attribute__' before '<=' token
30 | for(i=1;i<=y+1;i++){
| ^~
main.c:30:18: error: expected '=', ',', ';', 'asm' or '__attribute__' before '++' token
30 | for(i=1;i<=y+1;i++){
| ^~
main.c:33:4: error: expected identifier or '(' before 'for'
33 | for(i=1;i<=x+1;i++){
| ^~~
main.c:33:13: error: expected '=', ',', ';', 'asm' or '__attribute__' before '<=' token
33 | for(i=1;i<=x+1;i++){
| ^~
main.c:33:20: error: expected '=', ',', ';', 'asm' or '__attribute__' before '++' token
33 | for(i=1;i<=x+1;i++){
| ^~
main.c:36:8: error: expected declaration specifiers or '...' before string constant
36 | printf("U\n");
| ^~~~~
main.c:37:1: error: expected identifier or '(' before 'return'
37 | return 0;
| ^~~~~~
main.c:38:1: error: expected identifier or '(' before '}' token
38 | }
| ^
|
s959287190 | p03836 | C++ | #include<bits/stdc++.h>
using namespace std;
bool check(int nx, int ny, vector<pair<int, int> >vis)
{
for(int i = 0; i < vis.size(); i++)
{
if(nx == v[i].first && ny == v[i].second)
return true;
}
return false;
}
void fun(queue<pair<int, int> > &q, int sx, int sy, int tx, int ty, vector<pair<int, int> >&vis, int row[], int col[])
{
vis[sx][sy] = true;
while(!q.empty())
{
pair<int, int> t = q.front();
q.pop();
if(t.first == tx && t.second == ty)
break;
/*if((t.first == sx && t.second == sy) || (t.first == tx && t.second == ty))
vis[t.first][t.second] = true;*/
for(int i = 0; i < 4; i++)
{
int nx = t.first + row[i];
int ny = t.second + col[i];
if(nx >= -1000 && nx <= 1000 && ny >= -1000 && ny <= 1000 && check(nx, ny, vis) == false)
{
//vis[nx][ny] = true;
vis.push_back(make_pair(nx, ny));
q.push(make_pair(nx, ny));
if(row[i] == 1)
cout<<"D";
else if(row[i] == -1)
cout<<"U";
else if(col[i] == 1)
cout<<"R";
else
cout<<"L";
}
}
}
}
int main()
{
int sx, sy, tx, ty;
cin>>sx>>sy>>tx>>ty;
/*vector<vector<bool> > vis( 1000 , vector<int> (1000, false));*/
vector<pair<int, int> >vis;
int row[] = {-1, 0, 0, 1};
int col[] = {0, 1, -1, 0};
queue<pair<int, int> >q;
q.push(make_pair(sx, sy));
fun(q, sx, sy, tx, ty, vis, row, col);
fun(q, tx, ty, sx, sy, vis, row, col);
fun(q, sx, sy, tx, ty, vis, row, col);
fun(q, tx, ty, sx, sy, vis, row, col);
return 0;
} | a.cc: In function 'bool check(int, int, std::vector<std::pair<int, int> >)':
a.cc:8:18: error: 'v' was not declared in this scope
8 | if(nx == v[i].first && ny == v[i].second)
| ^
a.cc: In function 'void fun(std::queue<std::pair<int, int> >&, int, int, int, int, std::vector<std::pair<int, int> >&, int*, int*)':
a.cc:16:16: error: no match for 'operator[]' (operand types are '__gnu_cxx::__alloc_traits<std::allocator<std::pair<int, int> >, std::pair<int, int> >::value_type' {aka 'std::pair<int, int>'} and 'int')
16 | vis[sx][sy] = true;
| ^
|
s243908281 | p03836 | C++ | #include<bits/stdc++.h>
using namespace std;
bool check(int nx, int ny, vector<pair<int, int> >vis)
{
for(int i = 0; i < vis.size(); i++)
{
if(nx == v[i].first && ny == v[i].second)
return true;
}
return false;
}
void fun(queue<pair<int, int> > &q, int sx, int sy, int tx, int ty, vector<pair<int, int> >&vis, int row[], int col[])
{
vis[sx][sy] = true;
while(!q.empty())
{
pair<int, int> t = q.front();
q.pop();
if(t.first == tx && t.second == ty)
break;
/*if((t.first == sx && t.second == sy) || (t.first == tx && t.second == ty))
vis[t.first][t.second] = true;*/
for(int i = 0; i < 4; i++)
{
int nx = t.first + row[i];
int ny = t.second + col[i];
if(nx >= -1000 && nx <= 1000 && ny >= -1000 && ny <= 1000 && check(nx, ny, vis) == false)
{
//vis[nx][ny] = true;
vis.push(make_pair(nx, ny));
q.push(make_pair(nx, ny));
if(row[i] == 1)
cout<<"D";
else if(row[i] == -1)
cout<<"U";
else if(col[i] == 1)
cout<<"R";
else
cout<<"L";
}
}
}
}
int main()
{
int sx, sy, tx, ty;
cin>>sx>>sy>>tx>>ty;
/*vector<vector<bool> > vis( 1000 , vector<int> (1000, false));*/
vector<pair<int, int> >vis;
int row[] = {-1, 0, 0, 1};
int col[] = {0, 1, -1, 0};
queue<pair<int, int> >q;
q.push(make_pair(sx, sy));
fun(q, sx, sy, tx, ty, vis, row, col);
fun(q, tx, ty, sx, sy, vis, row, col);
fun(q, sx, sy, tx, ty, vis, row, col);
fun(q, tx, ty, sx, sy, vis, row, col);
return 0;
} | a.cc: In function 'bool check(int, int, std::vector<std::pair<int, int> >)':
a.cc:8:18: error: 'v' was not declared in this scope
8 | if(nx == v[i].first && ny == v[i].second)
| ^
a.cc: In function 'void fun(std::queue<std::pair<int, int> >&, int, int, int, int, std::vector<std::pair<int, int> >&, int*, int*)':
a.cc:16:16: error: no match for 'operator[]' (operand types are '__gnu_cxx::__alloc_traits<std::allocator<std::pair<int, int> >, std::pair<int, int> >::value_type' {aka 'std::pair<int, int>'} and 'int')
16 | vis[sx][sy] = true;
| ^
a.cc:32:21: error: 'class std::vector<std::pair<int, int> >' has no member named 'push'
32 | vis.push(make_pair(nx, ny));
| ^~~~
|
s481253552 | p03836 | C++ | #include <bits/stdc++.h>
#define rep(i,n) for(int i=0;i<(n);i++)
using namespace std;
typedef long long ll;
typedef pair<int,int> P;
int main(){
int sx,sy,tx,ty;
cin>>sx>>sy>>tx>>ty;
rep(i,ty-tx){
cout<<'U';
}
rep(i,tx-sx){
cout<<'R';
}
rep(i,ty-tx){
cout<<'D';
}
rep(i,tx-sx){
cout<<'L';
}
cout<<'L';
rep(i,ty-tx+1){
cout<<'U';
}
rep(i,tx-sx){
cout<<'R';
}
cout<<"DR"
rep(i,ty-tx){
cout<<'D';
}
rep(i,tx-sx){
cout<<'L';
}
cout<<'U';
return 0;
} | a.cc: In function 'int main()':
a.cc:29:13: error: expected ';' before 'for'
29 | cout<<"DR"
| ^
| ;
a.cc:30:7: error: 'i' was not declared in this scope
30 | rep(i,ty-tx){
| ^
a.cc:2:30: note: in definition of macro 'rep'
2 | #define rep(i,n) for(int i=0;i<(n);i++)
| ^
|
s804182323 | p03836 | C++ | #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; 20 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:10:27: error: extended character ’ is not valid in an identifier
10 | cout << string(dy,’D’) << string(dx,’L’);
| ^
a.cc:10:27: error: extended character ’ is not valid in an identifier
a.cc:10:45: error: extended character ’ is not valid in an identifier
10 | cout << string(dy,’D’) << string(dx,’L’);
| ^
a.cc:10:45: error: extended character ’ is not valid in an identifier
a.cc:11:17: error: extended character ’ is not valid in an identifier
11 | cout << ’L’ << string(dy+1,’U’) << string(dx+1,’R’) << ’D’;
| ^
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 << ’L’ << string(dy+1,’U’) << string(dx+1,’R’) << ’D’;
| ^
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 << ’L’ << string(dy+1,’U’) << string(dx+1,’R’) << ’D’;
| ^
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 << ’L’ << string(dy+1,’U’) << string(dx+1,’R’) << ’D’;
| ^
a.cc:11:64: error: extended character ’ is not valid in an identifier
a.cc:12:17: error: extended character ’ is not valid in an identifier
12 | cout << ’R’ << string(dy+1,’D’) << string(dx+1,’L’) << ’U’;
| ^
a.cc:12:17: error: extended character ’ is not valid in an identifier
a.cc:12:36: error: extended character ’ is not valid in an identifier
12 | cout << ’R’ << string(dy+1,’D’) << string(dx+1,’L’) << ’U’;
| ^
a.cc:12:36: error: extended character ’ is not valid in an identifier
a.cc:12:56: error: extended character ’ is not valid in an identifier
12 | cout << ’R’ << string(dy+1,’D’) << string(dx+1,’L’) << ’U’;
| ^
a.cc:12:56: error: extended character ’ is not valid in an identifier
a.cc:12:64: error: extended character ’ is not valid in an identifier
12 | cout << ’R’ << string(dy+1,’D’) << string(dx+1,’L’) << ’U’;
| ^
a.cc:12: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:10:27: error: '\U00002019D\U00002019' was not declared in this scope
10 | cout << string(dy,’D’) << string(dx,’L’);
| ^~~
a.cc:10:45: error: '\U00002019L\U00002019' was not declared in this scope
10 | cout << string(dy,’D’) << string(dx,’L’);
| ^~~
a.cc:14:25: error: expected ';' before 'return'
14 | cout << endl; 20 return 0;
| ^~~~~~~
| ;
|
s102754023 | p03836 | C++ | //おまじないc++
//おまじないc++
#include <iostream>
#include<cmath>
#include<vector>
#include <algorithm>
using namespace std;
#define rep(i, n) for(int i = 0; i < (int)(n); i++)
#define all(x) (x).begin(),(x).end()
int main() {
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<dx;i++){
cout<<'R';
}
for(int i=0;i<dy;i++){
cout<<'U';
}
for(int i=0;i<dx;i++){
cout<<'L';
}
rep(i,dy){
cout<<'D';
}
cout<<'D';
for(int i=0;i<dx;i++){
cout<<'R';
}
cout<<'R'<<'U';
for(int i=0;i<dy;i++){
cout<<'U';
}
cout<<'L'<<'U';
for(int i=0;i<dx;i++){
cout<<'L';
}
cout<<'L'<<'D';
rep(i,dy){
cout<<'D';
}
cout<<'R';
}
| a.cc: In function 'int main()':
a.cc:13:9: warning: empty parentheses were disambiguated as a function declaration [-Wvexing-parse]
13 | int main() {
| ^~
a.cc:13:9: note: remove parentheses to default-initialize a variable
13 | int main() {
| ^~
| --
a.cc:13:9: note: or replace parentheses with braces to value-initialize a variable
a.cc:13:12: error: a function-definition is not allowed here before '{' token
13 | int main() {
| ^
a.cc:63:2: error: expected '}' at end of input
63 | }
| ^
a.cc:11:12: note: to match this '{'
11 | int main() {
| ^
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.