s_id stringlengths 10 10 | p_id stringlengths 6 6 | u_id stringlengths 10 10 | date stringlengths 10 10 | language stringclasses 1
value | original_language stringclasses 11
values | filename_ext stringclasses 1
value | status stringclasses 1
value | cpu_time stringlengths 1 5 | memory stringlengths 1 7 | code_size stringlengths 1 6 | code stringlengths 1 539k |
|---|---|---|---|---|---|---|---|---|---|---|---|
s955033256 | p03835 | u060392346 | 1545611268 | Python | Python (3.4.3) | py | Runtime Error | 18 | 2940 | 148 | k, s = map(int, input().split())
r = 0
for x in range(k+1):
for y in range(k+!):
z = s - x - y
if z >= 0 and z <= k:
r += 1
print(r) |
s201097325 | p03835 | u197300260 | 1545448733 | Python | Python (3.4.3) | py | Runtime Error | 18 | 2940 | 485 | # _*_ coding:utf-8 _*_
# Atcoder_Beginners_Contest051-B
# https://atcoder.jp/contests/abc051/tasks/abc051_b
def queueAnswer(maxValue,sumNumber):
counter = 0
for x in range(0,maxValue+1,1):
for y in range(0,maxValue+1,1):
for z in range(0,maxValue+1,1):
thisSum = x+y+z
if thisSum=sumNumber:
counter = counter + 1
answer = counter
return answer
if __name__ == '__main__':
k,s = map(int,input().strip().split(' '))
solution=queueAnswer(k,s)
print(solution) |
s431132915 | p03835 | u213854484 | 1545023350 | Python | Python (3.4.3) | py | Runtime Error | 18 | 2940 | 148 | K,S = int(input())
c=0
L=list(range(0,K+1))
for i in L:
for j in L:
for k in L:
if i+j+k == S:
c+=1
print(c) |
s852712530 | p03835 | u111365959 | 1542944229 | Python | Python (3.4.3) | py | Runtime Error | 18 | 2940 | 97 | import math
k,s = input().split()
print(math.factorial(s)//(math.factorial(k)*math.factorial(2))) |
s103718562 | p03835 | u111365959 | 1542943445 | Python | Python (3.4.3) | py | Runtime Error | 19 | 3060 | 180 | k,s = input().split()
a = 0
n = 0
while a <= k:
b = 0
while b <= k:
c = 0
while c <= k:
if (a+b+c) == s:
n += 1
c += 1
b += 1
a += 1
print(n)
|
s164095393 | p03835 | u111365959 | 1542943348 | Python | Python (3.4.3) | py | Runtime Error | 17 | 2940 | 146 | k,s = input().split()
a = 0
n = 0
while a <= k:
b = 0
while b <= k:
c = 0
while c <= k:
if (a+b+c) == s:
n += 1
print(n) |
s345506707 | p03835 | u983918956 | 1542405753 | Python | Python (2.7.6) | py | Runtime Error | 11 | 2568 | 154 | K,S = map(int,input().split())
count = 0
for i in range(K+1):
for j in range(K+1):
if 0 <= S - (i+j) <= K:
count += 1
print(count) |
s284573262 | p03835 | u022871813 | 1539460975 | Python | Python (3.4.3) | py | Runtime Error | 17 | 2940 | 290 | k, s = map(int, input().split())
n = 0
for i in range(k + 1):
if (s-i)/2 > k:
continue
elif i > s:
break
for j in range(s-i+1):
if s-i-j > k:
continue
elif j > k:
break
z = s - i - j
if 0<= z <= k
print(n)
|
s105441520 | p03835 | u022871813 | 1539460335 | Python | Python (3.4.3) | py | Runtime Error | 2104 | 3060 | 391 | k, s = map(int, input().split())
n = 0
for i in range(k + 1):
if (s-i)/2 > k:
continue
elif i > s:
break
for j in range(s-i+1):
if s-i-j > k:
continue
elif j > k:
break
for l in range(s-i-j + 1):
if i + j + l == s:
n += 1
elif i + j + l > s:
break
print(n)
vv |
s237136897 | p03835 | u022871813 | 1539457153 | Python | Python (3.4.3) | py | Runtime Error | 17 | 2940 | 327 | \k, s = map(int, input().split())
n = 0
a = k + 1
if k == s:
n += 3
if k*2 > s:
n += s*3
for i in range(1,k + 1):
if (s-i)/2 > k:
continue
for j in range(1,k + 1):
if s-i-j > k:
continue
for l in range(1,k + 1):
if i + j + l == s:
n += 1
print(n)
|
s631764249 | p03835 | u416964274 | 1538961543 | Python | Python (3.4.3) | py | Runtime Error | 17 | 2940 | 167 | K, S = map(int, input().split())
ct = 0
for i in range(K + 1):
for j in range(K + 1):
a = S - i - j
if 0 <= a <= k:
ct += 1
print(ct)
|
s659532230 | p03835 | u693776163 | 1538777014 | Python | Python (3.4.3) | py | Runtime Error | 17 | 2940 | 181 | K = int(input())
S = int(input())
counter = 0
for X in range(0,K+1):
for Y in range(0,K+1):
Z = S - X - Y
if 0 < Z < K:
counter += 1
print(counter)
|
s316588027 | p03835 | u693776163 | 1538776774 | Python | Python (3.4.3) | py | Runtime Error | 17 | 2940 | 203 | K = int(input())
S = int(input())
counter = 0
for X in range(0,K+1):
for Y in range(0,K+1):
for Z in range(0,K+1):
if X + Y + Z == S:
counter += 1
print(counter)
|
s650697691 | p03835 | u348285568 | 1535036028 | Python | Python (3.4.3) | py | Runtime Error | 17 | 2940 | 3 | 2 2 |
s720635929 | p03835 | u890807039 | 1534733741 | Python | Python (3.4.3) | py | Runtime Error | 1452 | 134532 | 298 | k,s = map(int,input().split())
ans = 0
debug = []
for i in range(k+1):
for l in range(k+1):
if (s-i-l) >= 0 and (s-i-l) <= k:
if i+l+(s-i-l) == s:
ans += 1
debug.append(str(i)+"+"+str(l)+"+"+str(s-i-l))
print(debug)
print(ans) |
s576643344 | p03835 | u497625442 | 1533579851 | Python | Python (3.4.3) | py | Runtime Error | 17 | 2940 | 144 | K, S = map(int(), input().split())
s = 0
for X in range(K+1):
for Y in range(K+1):
Z = S - (X+Y)
if 0 <= Z and Z <= K:
s += 1
print(s)
|
s827321992 | p03835 | u140251125 | 1533481741 | Python | Python (3.4.3) | py | Runtime Error | 18 | 3188 | 203 | # input
K, S = map(int, input())
ans = 0
for i in range(K + 1):
for j in range(S - i + 1):
for k in range(S - i - j + 1):
if i + j + k == S:
ans += 1
print(ans) |
s732503375 | p03835 | u451017206 | 1532817027 | Python | Python (3.4.3) | py | Runtime Error | 17 | 3060 | 145 | K, S = map(int,input().split())
from itertools import product
ans = 0
for x,y,z in product(range(K+1),3):
if x + y + z == S:ans += 1
print(ans) |
s019954965 | p03835 | u143536664 | 1529854379 | Python | Python (3.4.3) | py | Runtime Error | 17 | 2940 | 185 | S = input()
K = input()
count = 0
for i in range(K):
for j in range(K):
for k in range(K):
if i + j + k == S:
count += 1
else:
print(count)
|
s826145322 | p03835 | u735588483 | 1528325437 | Python | Python (3.4.3) | py | Runtime Error | 17 | 2940 | 97 | K,S=map(int,input().split())
b=sum(0<=S-x-y<=K for x in range(K+1)for y in range(K+1))
print(sum |
s251120511 | p03835 | u964998676 | 1526509818 | Python | Python (3.4.3) | py | Runtime Error | 17 | 2940 | 165 | def check(x, y, S):
K, S = list(map(int, input('').split()))
count = 0
for x in range(K+1):
for y in range(K+1):
if x + y <= S:
count += 1
print(count)
|
s203937000 | p03835 | u964998676 | 1526509770 | Python | Python (3.4.3) | py | Runtime Error | 17 | 2940 | 164 | def check(x, y, S):
K, S = list(map(int, input('').split()))
count = 0
for x in range(K+1):
for y in range(K+1):
if x + y <= S:
count += 1
print(count) |
s284928109 | p03835 | u964998676 | 1526509041 | Python | Python (3.4.3) | py | Runtime Error | 17 | 3060 | 253 | def check(x, y, K, S):
for z in range(K+1):
if x + y + z == S:
return true
return false
K, S = list(map(int, input('').split()))
count = 0
for x in range(K+1):
for y in range(K+1):
if check(x, y, K, S):
count += 1
print(count) |
s283930730 | p03835 | u743272507 | 1519775228 | Python | Python (3.4.3) | py | Runtime Error | 17 | 2940 | 154 | k,s = int(input().split())
ret = 0
for i in range(k+1):
bmax = min(k,bpc)+1
bmin = max(0,s-i-k)
if bmin < bmax : ret += bmax - bmin
print(ret) |
s821840078 | p03835 | u319612498 | 1519273967 | Python | Python (3.4.3) | py | Runtime Error | 17 | 2940 | 101 | k,s=map(int,input().split())
u=min(k,s)
sum=0
for i in range(u+1):
sum+=min(s-i,2k)+1
print(sum)
|
s803545433 | p03835 | u499259667 | 1519163011 | Python | Python (3.4.3) | py | Runtime Error | 18 | 2940 | 147 | k,s=map(int,input().split())
c=0
for i in range(k+1):
for i2 in range(k+1):
for i3 in range(k+1):
if i+i2+i3i==s:
c+=1
print(c) |
s258662372 | p03835 | u667024514 | 1517183303 | Python | Python (3.4.3) | py | Runtime Error | 17 | 2940 | 237 | k, s = map(int,input().split())
ans = 0
x = 0
y = 0
z = 0
for i in range(k):
for n in range(k):
for m in range(k):
if x + y + z = s:
ans += 1
z += 1
y += 1
x += 1
print(ans) |
s898015820 | p03835 | u143492911 | 1516511207 | Python | Python (3.4.3) | py | Runtime Error | 17 | 2940 | 142 | k,s=map(int,input().split())
count=0
for i in range(k+1):
for j in range(k+1):
if 0<=s-x-y<=k:
count+=1
print(count)
|
s466302391 | p03835 | u257974487 | 1516243086 | Python | Python (3.4.3) | py | Runtime Error | 17 | 2940 | 35 | K, S = map(int,input())
print(S//K) |
s161249332 | p03835 | u003006319 | 1513115830 | Python | Python (3.4.3) | py | Runtime Error | 17 | 2940 | 110 | K,S =map(int, input().split())
c=0
for i in range(K+1)
for j in range(K+1)
if 0<=S-i-j<=K
c+=1
print(c) |
s829894334 | p03835 | u156677492 | 1511491839 | Python | Python (3.4.3) | py | Runtime Error | 17 | 3064 | 447 | N = int(input())
cards = []
for i in range(N):
cards.append(list(map(int,input().split())))
points = []
for i in range(N):
points.append(0)
for i in range(3):
for j in range(N):
flag = 0
for k in range(j):
if cards[j][i] == cards[k][i]:
flag = 1
break
if j+1<N:
for k in range(j+1,N):
if cards[j][i] == cards[k][i]:
flag = 1
break
if flag==0: points[j] += cards[j][i]
for i in range(N):
print(points[i])
|
s968614830 | p03835 | u157322125 | 1506725676 | Python | Python (3.4.3) | py | Runtime Error | 17 | 2940 | 209 | k,s=[int(i) for i in input().split()]
count = 0
for y in range(k+1):
if i < s - k * 2 or s - i < 0:
continue
for x in range(k+1):
if s - x - y >= 0 and s - x - y <= k:
count = count+1
print(count) |
s706619336 | p03835 | u218984487 | 1501034687 | Python | Python (3.4.3) | py | Runtime Error | 17 | 3064 | 323 | k, s = map(int, input().split())
x, y, z = 0, 0, 0
an = s - (k * 2)
bn = s - k
if an >= 0:
x = k - an + 1
step = 1
start = 0
for i in range(x):
start += step
step += 1
elif bn >= 0:
step = 1
start = 0
for i in range(k+1):
start += step
step += 1
print(start)
|
s417792820 | p03835 | u526532903 | 1487726377 | Python | Python (3.4.3) | py | Runtime Error | 17 | 2940 | 250 | k,s = map(int,input().split())
ans = 0
for i in range(k + 1):
if i > s;break
for j in range(k + 1):
if i + j > s;break
for k in range(k + 1):
if i + j + k > s;break
if i + j + k == s:ans+=1
print (ans)
|
s040766380 | p03835 | u359930418 | 1484341364 | Python | Python (3.4.3) | py | Runtime Error | 24 | 3064 | 136 | K = int(input())
S = int(input())
for x in range(0, K):
for y in range(0,K):
for z in range(0,K):
print(x,y,z)
|
s937918790 | p03835 | u443512298 | 1484032485 | Python | Python (3.4.3) | py | Runtime Error | 22 | 3064 | 170 | # coding: utf-8
k, s = list(map(int, input().split()))
and = 0
for i in range(k + 1):
for j in range(k + 1):
if 0 <= s - (i + j) <= k: ans += 1
print(ans)
|
s814445541 | p03835 | u443512298 | 1483985486 | Python | Python (3.4.3) | py | Runtime Error | 1112 | 3064 | 278 | # coding: utf-8
K_MAX = 2500
k, s = list(map(int, input().split()))
smz = [False] * (2 * K_MAX + 1)
for i in range(k + 1):
if s - i >= 0: smz[s - i] = True
cnt = 0
for i in range(k + 1):
for j in range(k + 1):
if smz[i + j]:
cnt += 1
print(cnt)
|
s331149122 | p03835 | u580920947 | 1483851615 | Python | Python (3.4.3) | py | Runtime Error | 22 | 3064 | 207 | # -*- coding: utf-8 -*-
# problem B
k, s = map(int, input().split())
ans = 0
for i in range(k+1):
forj in range(k+1):
z = s-i-j
if 0 <= z and z <=k:
ans = ans+1
print(ans) |
s031584365 | p03835 | u009460507 | 1483847467 | Python | Python (3.4.3) | py | Runtime Error | 22 | 3064 | 182 | k, s = map(int, input_file[0].split())
count = 0
for x in range(k+1):
for y in range(k+1):
z = s - x - y
if z >= 0 and z <= k:
count+=1
print(count)
|
s000378731 | p03835 | u093843560 | 1483846736 | Python | Python (2.7.6) | py | Runtime Error | 16 | 2568 | 208 | import numpy as np
import scipy.misc as scm
S, K = map(int, raw_input().split())
allp = scm.comb(K+2,2)
partp = scm.comb(K-S,2)
ans = allp-3*partp
if ans < 0:
ans=0
if S<3K:
ans =0
print int(ans) |
s005001970 | p03835 | u093843560 | 1483846670 | Python | Python (2.7.6) | py | Runtime Error | 16 | 2568 | 247 | #-*- coding=utf-8 -*-
import numpy as np
import scipy.misc as scm
S, K = map(int, raw_input().split())
allp = scm.comb(K+2,2)
partp = scm.comb(K-S,2)
ans = allp-3*partp
if ans < 0:
ans=0
if S<3K:
ans =0
print int(ans)
~ |
s515065355 | p03835 | u085725262 | 1483844262 | Python | Python (3.4.3) | py | Runtime Error | 22 | 3064 | 228 | , S = map(int, input().split())
all = []
for x in range(0,K+1):
if S-x < 0:
break
for y in range(0, min(K,S-x)+1):
z = S-x-y
if z>-1:
if z < K+1:
all.append(str(x)+str(y)+str(z))
else:
break
print(len(all)) |
s154242153 | p03835 | u085725262 | 1483844120 | Python | Python (3.4.3) | py | Runtime Error | 22 | 3068 | 233 | , S = map(int, input().split())
all = []
for x in range(0,K+1):
if S-x < 0:
break
for y in range(0, min(K,S-x)+1):
z = S-x-y
if z>-1:
if z < K+1:
all.append(str(x)+str(y)+str(z))
else:
break
print(len(set(all))) |
s188429661 | p03835 | u231928431 | 1483843521 | Python | Python (3.4.3) | py | Runtime Error | 23 | 3192 | 550 | #include <bits/stdc++.h>
using namespace std;
#define REP(i,n) for(ll i=0; i<(ll)(n); i++)
#define FOR(i,n,m) for (ll i=n; i<(ll)(m); i++)
#define pb push_back
#define INF 1000000007LL
#define all(a) (a).begin(),(a).end()
typedef long long ll;
typedef pair<int,int> p;
int dy[4]={-1,1,0,0};
int dx[4]={0,0,1,-1};
int K, S;
int main(){
ios::sync_with_stdio(false);
cin >> K >> S;
int ans = 0;
REP(i,K+1) REP(j,K+1) {
int z = S - i - j;
if (0<=z&&z<=K) ans++;
}
cout << ans << endl;
return 0;
} |
s756113853 | p03835 | u279196402 | 1483843483 | Python | Python (2.7.6) | py | Runtime Error | 16 | 2568 | 112 | k,s=map(int,raw_input())
ans=0
for i in range(k+1):
for j in range(k+1):
if 0 <= s-i-j<=k:ans+=1
print ans |
s317803343 | p03835 | u279196402 | 1483843392 | Python | Python (2.7.6) | py | Runtime Error | 16 | 2568 | 109 | k,s=map(int,raw_input())
ans=0
for i in range(k+1):
for j in range(k+1):
if 0 <= s-i-j<=k:ans+=1
print ans |
s602464845 | p03835 | u332570575 | 1483842656 | Python | Python (3.4.3) | py | Runtime Error | 22 | 3068 | 216 | #include <iostream>
int k,s;
int main() {
std::cin>>k>>s;
int ans=0;
for(int i=0;i<=k;++i) {
for(int j=0;j<=k;++j) {
int z=s-i-j;
if(0<=z&&z<=k)
++ans;
}
}
std::cout<<ans<<std::endl;
return 0;
} |
s640238362 | p03835 | u212741988 | 1483841960 | Python | Python (3.4.3) | py | Runtime Error | 23 | 3064 | 317 | def getInput():
input = input().split()
k, s = input[0], input[1]
return k, s
if __name__ == '__main__':
k, s = getInput()
count = 0
for x in range(k):
for y in range(k):
for z in range(k):
if (x + y + z) == s:
++count
print(count)
|
s512534385 | p03835 | u012693733 | 1483841902 | Python | Python (2.7.6) | py | Runtime Error | 16 | 2568 | 154 | #input
K, S = map(int,raw_input().split())
cnt = 0
for i in range(K+1):
for j in range(K+1):
for k in range(K+1):
if i + j + k == S:
cnt += 1
print cnt
|
s317367162 | p03835 | u441532683 | 1483841495 | Python | Python (3.4.3) | py | Runtime Error | 22 | 3068 | 2289 | #include <bits/stdc++.h> // {{{
// clang-format off
#define ARG4(_1, _2, _3, _4, ...) _4
#define rep(...) ARG4(__VA_ARGS__, FOR, REP)(__VA_ARGS__)
#define REP(i, a) FOR(i, 0, a)
#define FOR(i, a, b) for (int i = (a); i < (int)(b); ++i)
#define rrep(...) ARG4(__VA_ARGS__, RFOR, RREP)(__VA_ARGS__)
#define RREP(i, a) RFOR(i, 0, a)
#define RFOR(i, a, b) for (int i = (b)-1; i >= (int)(a); --i)
#define ALL(c) (c).begin(), (c).end()
#define TEN(n) ((ll)(1e##n))
#define pb emplace_back
#define mp make_pair
#define fi first
#define se second
#define USE1(T) template <typename T> inline
#define USE2(T, U) template <typename T, typename U> inline
#define mygc(c) (c) = getchar_unlocked()
#define mypc(c) putchar_unlocked(c)
template<typename T> using vec = std::vector<T>;
template<typename T> using withi = std::pair<T, int>;
using ll = long long;
USE2(T,U)bool chmax(T&x,U a){return x<a&&(x=a,1);}
USE2(T,U)bool chmin(T&x,U a){return a<x&&(x=a,1);}
USE1(T=int)T in(){T x;std::cin>>x;return x;}
USE1(T=int)vec<T>in(int n){vec<T>v;v.reserve(n);rep(i,n)v.pb(in<T>());return v;}
USE2(T,U=withi<T>)vec<U>zipi(const vec<T>&x,int s=0){int N=x.size();vec<U>v;v.reserve(N);rep(i,N)v.pb(x[i],s+i);return v;}
USE1(T)vec<T>ndvec(T v,int n){return vec<T>(n,v);}
USE2(T,...Ts)auto ndvec(T v,int n,Ts...ns)->vec<decltype(ndvec(v,ns...))>{return ndvec(ndvec(v,ns...),n);}
USE1(T)void pr(T x){std::cout<<x<<'\n';}
USE2(T,...Ts)void pr(T x,Ts...xs){std::cout<<x<<' ';pr(xs...);}
USE1(T=int)T rd(){T x=0,m=0,k;for(;;){mygc(k);if(k=='-'){m=1;break;}if('0'<=k&&k<='9'){x=k-'0';break;}}for(;;){mygc(k);if(k<'0'||'9'<k)break;x=x*10+k-'0';}return x;}
USE1(T=int)void wr(T x,char c='\n'){int s=0,m=0;char b[32];if(x<0)m=1,x=-x;for(;x;x/=10)b[s++]=x%10;if(!s)b[s++]=0;if(m)mypc('-');for(;s--;)mypc(b[s]+'0');mypc(c);}
// clang-format on
// }}}
struct IoSetup { // {{{
IoSetup() {
std::ios::sync_with_stdio(0);
std::cin.tie(0);
std::cout.precision(10);
std::cerr.precision(10);
}
} iosetup; //}}}
using namespace std;
const int inf = 1001001001;
const ll infl = 1001001001001001001ll;
const int dd[] = {0, 1, 0, -1, 0};
signed main() {
int K = in(), S = in();
int ans = 0;
rep(X, K + 1) rep(Y, K + 1) {
int Z = S - X - Y;
if (0 <= Z && Z <= K) ans++;
}
pr(ans);
return 0;
}
|
s167909622 | p03835 | u290326033 | 1483841386 | Python | Python (3.4.3) | py | Runtime Error | 22 | 3064 | 223 | data = input().split()
K, S = data[0], data[1]
count = 0
for x in range(S+1):
count += 1
for y in range(S+1):
count += 1
for z in range(S+1):
if x + y + z == S:
count += 1
print(count) |
s611468801 | p03836 | u810625173 | 1600276369 | Python | Python (3.8.2) | py | Runtime Error | 34 | 8988 | 536 | sx, sy, tx, ty = map(int, input().split())
ans = ""
ans += "U" * (ty - sy) + "R" * (tx - sx)
ans += "D" * (ty - sy) + "L" * (tx - sx)
ans += "L" + "U" * (ty - sy + 1) + "R" * (tx - sx + 1) + "D"
ans += "R" + "D" * (ty - sy + 1) + "L" * (tx - sx + 1) + "U"
print(ans)sx, sy, tx, ty = map(int, input().split())
ans = ""
ans += "U" * (ty - sy) + "R" * (tx - sx)
ans += "D" * (ty - sy) + "L" * (tx - sx)
ans += "L" + "U" * (ty - sy + 1) + "R" * (tx - sx + 1) + "D"
ans += "R" + "D" * (ty - sy + 1) + "L" * (tx - sx + 1) + "U"
print(ans) |
s990771254 | p03836 | u468972478 | 1599860021 | Python | Python (3.8.2) | py | Runtime Error | 27 | 8924 | 179 | n = int(input())
s = 1
ans = 1
for i in range(1, n+1):
s *= i
for i in range(2, n+1):
k = 1
while s % i == 0:
s = s // i
k += 1
ans *= k
print(ans % (10 ** 9 + 7)) |
s593246771 | p03836 | u786020649 | 1594929959 | Python | Python (3.8.2) | py | Runtime Error | 29 | 9044 | 293 | d={0:'R', 1:'U', 2:'L', 3:'D'}
dirc=[dx,dy,dx,dy]
def path(sign,x,y,z,w):
return d[sign+1]*abs(z-x) + d[sign+2]*abs(y-w)
s=''
s+='R'
s+=path(-1, sx+1, sy, tx, ty-1)
s+='UU'
s+=path(1, tx,ty+1,sx-1,sy)
s+='RU'
s+=path(-1, sx,sy-1,tx+1,ty)
s+='LL'
s+=path(1, tx-1,ty,sx,sy+1)
s+='U'
print(s) |
s671736923 | p03836 | u786020649 | 1594928716 | Python | Python (3.8.2) | py | Runtime Error | 33 | 8960 | 277 | sx, sy, tx, ty=map(int,inpu().split())
dx=tx-sx
dy=ty-sy
d={0:'R', 1:'U', 2:'L', 3:'D'}
dirc=[dx,dy,dx,dy]
s=''
for j in range(4):
s+=d[j]*(dirc[j]+i)
s+='D'
for j in range(2):
s+=d[j]*(dirc[j]+1)
s+='L'
s+='U'
for j in range(2):
s+=d[j+2]*(dirc[j+2]+1)
s+='R'
print(s) |
s849002132 | p03836 | u786020649 | 1594928635 | Python | Python (3.8.2) | py | Runtime Error | 23 | 8876 | 277 | sx, sy, tx, ty=map(int,inpu().split())
dx=tx-sx
dy=ty-sy
d={0:'R', 1:'U', 2:'L', 3:'D'}
dirc=[dx,dy,dx,dy]
s=''
for j in range(4)"
s+=d[j]*(dirc[j]+i)
s+='D'
for j in range(2):
s+=d[j]*(dirc[j]+1)
s+='L'
s+='U'
for j in range(2):
s+=d[j+2]*(dirc[j+2]+1)
s+='R'
print(s) |
s314250607 | p03836 | u816631826 | 1594247154 | Python | Python (3.8.2) | py | Runtime Error | 23 | 8924 | 1902 | // #define _GLIBCXX_DEBUG
#include <bits/stdc++.h>
using namespace std;
#define uint unsigned int
#define ull unsigned long long
typedef string str;
typedef long long ll;
typedef double db;
typedef pair<int, int> pii;
typedef map<int, int> mii;
typedef vector<int> vi;
typedef vector<bool> vb;
#define pb push_back
#define fi first
#define se second
#define in insert
#define all(x) (x).begin(), (x).end()
#define rall(x) (x).rbegin(), (x).rend()
#define speed ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0)
const int INF = 1e9 + 5;
const int N = 2e5 + 123;
int main(){
speed;
int a, b, x, y;
cin >> a >> b >> x >> y;
int l = x - a;
int r = y - b;
if(l > 0){
for(int i = 0; i < l; ++i){
cout << 'R';
}
if(r > 0){
for(int i = 0; i < r; ++i){
cout << 'U';
}
}
else{
for(int i = 0; i < abs(r); ++i){
cout << 'D';
}
}
for(int i = 0; i < l; ++i){
cout << 'L';
}
if(r > 0){
for(int i = 0; i < abs(r); ++i){
cout << 'D';
}
}
else{
for(int i = 0; i < r; ++i){
cout << 'U';
}
}
}
else{
for(int i = 0; i < abs(l); ++i){
cout << 'L';
}
if(r > 0){
for(int i = 0; i < r; ++i){
cout << 'D';
}
}
else{
for(int i = 0; i < abs(r); ++i){
cout << 'U';
}
}
for(int i = 0; i < abs(l); ++i){
cout << 'R';
}
if(r > 0){
for(int i = 0; i < r; ++i){
cout << 'U';
}
}
else{
for(int i = 0; i < abs(r); ++i){
cout << 'D';
}
}
}
} |
s608754976 | p03836 | u870518235 | 1593987569 | Python | Python (3.8.2) | py | Runtime Error | 20 | 9196 | 346 | N = int(input())
A = list(map(int, input().split()))
ans = 0
A_test = sorted(list(set(A)))
if N % 2 == 1:
judge = [i for i in range(0,N,2)]
if (A_test == judge) and (A.count(0) == 1):
ans = 2**(N//2)
else:
judge = [i for i in range(1,N,2)]
if A_test == judge:
ans = 2**(N//2)
ans = ans % (10**9 + 7)
print(ans)
|
s156026290 | p03836 | u391589398 | 1593653027 | Python | Python (3.8.2) | py | Runtime Error | 2207 | 76516 | 1133 | sx, sy, tx, ty = map(int, input().split())
ofs = 1001
visited = [[0] * 2003 for _ in range(2003)]
stoij = {'U':[0, 1], 'D':[0,-1], 'L':[-1, 0], 'R':[1, 0]}
from collections import deque
def bfs(si, sj, gi, gj):
q = deque([[si, sj, '']])
visitedinbfs = [[0] * 2003 for _ in range(2003)]
visitedinbfs[sj][si] = 1
while q:
i, j, s = q.popleft()
if i == gi and j == gj:
break
for ns in ['U', 'D', 'L', 'R']:
mi, mj = stoij[ns]
ni, nj = i + mi, j + mj
if ni < 0 or 2003 <= ni or nj < 0 or 2003 <= ni:
continue
if visitedinbfs[nj][ni] == 1 or visited[nj][ni] == 1:
continue
visitedinbfs[nj][ni] = 1
q.append([ni, nj, s+ns])
for ss in s:
mi, mj = stoij[ss]
si += mi
sj += mj
if si == gi and sj == gj:
break
visited[sj][si] = 1
return s
ans = bfs(sx+ofs, sy+ofs, tx+ofs, ty+ofs)
ans += bfs(tx+ofs, ty+ofs, sx+ofs, sy+ofs)
ans += bfs(sx+ofs, sy+ofs, tx+ofs, ty+ofs)
ans += bfs(tx+ofs, ty+ofs, sx+ofs, sy+ofs)
print(ans)
|
s211475194 | p03836 | u453642820 | 1590697751 | Python | Python (3.4.3) | py | Runtime Error | 17 | 2940 | 133 | a,b,c,d=map(int,input().split())
x==c-a
y==d-b
print("U"*y+"R"*x+"D"*y+"L"*x+"L"+"U"*(y+1)*"R"*(x+1)+"D"+"R"+"D"*(y+1)+"L"*(x+1)+"U") |
s987372090 | p03836 | u453642820 | 1590697727 | Python | Python (3.4.3) | py | Runtime Error | 17 | 2940 | 131 | a,b,c,d=map(int,input().split())
x=c-a
y=d-b
print("U"*y+"R"*x+"D"*y+"L"*x+"L"+"U"*(y+1)*"R"*(x+1)+"D"+"R"+"D"*(y+1)+"L"*(x+1)+"U") |
s407231102 | p03836 | u344813796 | 1589754629 | Python | Python (3.4.3) | py | Runtime Error | 17 | 2940 | 140 | sx,sy,tx,ty=map(int, input().split()) #a1 a2 a3
m1=(tx-sx)*"R"+(ty-sy)*"U"
m2=(tx-sx)*"L"+(ty-sy)+"D"
print(m1+m2+"DR"+a+"ULUL"+m2+"DR")
|
s213233344 | p03836 | u845650912 | 1588710385 | Python | Python (3.4.3) | py | Runtime Error | 18 | 3064 | 639 | sx, sy, tx, ty = map(int,input().split())
route = ''
updown_num = ty - sy # 0>なら goalは上方向
rightleft_num = tx - sx #0>ならgoalは右方向
#route1
for i in range(updown_num):
route += 'U'
for i in range(rightleft_num):
route += 'R'
route2
for i in range(updown_num):
route += 'D'
for i in range(rightleft_num):
route += 'L'
#route3
route += 'L'
for i in range(updown_num + 1):
route += 'U'
for i in range(rightleft_num + 1):
route += 'R'
route += 'D'
#route4
route += 'R'
for i in range(updown_num + 1):
route += 'D'
for i in range(rightleft_num + 1):
route += 'L'
route += 'U'
print(route) |
s014321749 | p03836 | u390727364 | 1588622021 | Python | PyPy2 (5.6.0) | py | Runtime Error | 34 | 27884 | 517 | def main():
sx, sy, tx, ty = map(int, input().split())
print(
''.join(
[
'U' * (ty - sy),
'R' * (tx - sx),
'D' * (ty - sy),
'L' * (tx - sx + 1),
'U' * (ty - sy + 1),
'R' * (tx - sx + 1),
'D',
'R',
'D' * (ty - sy + 1),
'L' * (tx - sx + 1),
'U'
]
)
)
if __name__ == "__main__":
main()
|
s918515169 | p03836 | u959225525 | 1588456959 | Python | Python (3.4.3) | py | Runtime Error | 17 | 3064 | 617 | sx,sy,tx,ty=map(int,input().split())
ans=[[] for _ in range(4)]
x=sx
y=sy
while y!=ty or x!=tx:
if y<ty:
y+=1
ans[0].append("U")
ans[1].append("D")
elif x<tx:
x+=1
ans[0].append("R")
ans[1].append("L")
x=sx-1
y=sy
ans[2].append("L")
ans[3].append("R")
while 1:
if y<ty+1:
y+=1
ans[2].append("U")
ans[3].append("D")
elif x<tx:
x+=1
ans[2].append("R")
ans[3].append("L")
else:
ans[2].append("D")
ans[3].append("U")
break
print(*ans[0],*ans[1],*ans[2],*ans[3],sep="") |
s107098335 | p03836 | u959225525 | 1588456928 | Python | Python (3.4.3) | py | Runtime Error | 18 | 3064 | 625 | sx,sy,tx,ty=map(int,input().split())
ans=[[] for _ in range(4)]
x=sx
y=sy
while y!=ty or x!=tx:
if y<ty:
y+=1
ans[0].append("U")
ans[1].append("D")
elif x<tx:
x+=1
ans[0].append("R")
ans[1].append("L")
x=sx-1
y=sy
ans[2].append("L")
ans[3].append("R")
while 1:
if y<ty+1:
y+=1
ans[2].append("U")
ans[3].append("D")
elif x<tx:
x+=1
ans[2].append("R")
ans[3].append("L")
else:
ans[2].append("D")
ans[3].append("U")
break
print(*ans[0],*ans[1],*ans[2],*ans[3],sep="")
print() |
s637595784 | p03836 | u024782094 | 1588213005 | Python | Python (3.4.3) | py | Runtime Error | 17 | 2940 | 135 | sx,sy,tx,ty=map(int,input().split())
x=tx-sx
y=ty-sy
print("U"*y+"R"*x+"D"*y+"L"*(x+1)+"U"*(y+1)+"R"*(x+1)+"DR"+"D"*(y+1)+"L"*(x+1)+"U" |
s828606164 | p03836 | u136843617 | 1587090625 | Python | Python (3.4.3) | py | Runtime Error | 17 | 3064 | 729 | def routing(x, y, z = 0):
route = ""
for i in range(2):
if z:
if dy:
route += "D"
else:
route += "U"
if x:
route += "R"*(dx+z)
x = not x
else:
route += "L"+(dx+z)
x = not x
if y:
route += "U"*(dy+z)
y = not y
elif y:
route += "D"*(dy+z)
y = not y
if z:
if dx:
route += "L"
else:
route += "R"
return route
sx, sy, tx, ty = map(int, input().split())
route =""
dx = tx-sx
dy = ty-sy
x = dx>0
y = dy>0
route += routing(dx,dy)
route += routing(dx,dy,1)
print(route) |
s441134712 | p03836 | u136843617 | 1587090591 | Python | Python (3.4.3) | py | Runtime Error | 18 | 3064 | 729 | def routing(x, y, z = 0):
route = ""
for i in range(2):
if z:
if dy:
route += "D"
else:
route += "U"
if x:
route += "R"*(dx+z)
x = not x
else:
route += "L"+(dx+z)
x = not x
if y:
route *= "U"*(dy+z)
y = not y
elif y:
route *= "D"*(dy+z)
y = not y
if z:
if dx:
route += "L"
else:
route += "R"
return route
sx, sy, tx, ty = map(int, input().split())
route =""
dx = tx-sx
dy = ty-sy
x = dx>0
y = dy>0
route += routing(dx,dy)
route += routing(dx,dy,1)
print(route) |
s480106413 | p03836 | u627600101 | 1586225089 | Python | Python (3.4.3) | py | Runtime Error | 18 | 3064 | 399 | sx,sy,tx,ty=map(int,input().split())
x=tx-sx
y=ty-sy
if x>0 and y>0:
for k in range(y):
print(u)
for k in range(x+1):
print(r)
for k in range(y+1):
print(d)
for k in range(x+1):
print(l)
print(u)
print(l)
for k in range(y+1):
print(u)
for k in range(x+1):
print(r)
for k in range(y+1):
print(d)
print(l) |
s494434498 | p03836 | u000123984 | 1584135159 | Python | Python (3.4.3) | py | Runtime Error | 17 | 2940 | 401 | sx, sy, tx, ty = map(int, input().split())
s = ""
dx, dy = abs(tx - sx), abs(ty - sy)
dxy = dx + dy
for a in range(dx):
s += "R"
for b in range(dy):
s += "U"
for c in range(dx):
s += "L"
for d in range(dy):
s += "D"
s + = "D"
for e in range(dx + 1):
s += "R"
for f in range(dy + 1):
s + = "U"
s += "U"
for g in range(dx + 1):
s += "L"
for h in range(dy + 1):
s += "D"
s += "R"
print(s) |
s018334064 | p03836 | u419963262 | 1581776440 | Python | Python (3.4.3) | py | Runtime Error | 17 | 3064 | 813 | X=list(map(int,input().split()))
#X軸に並行
if X[2]-X[0]==0:
if X[3]-X[1]>0:
q=X[3]-X[1]
U="U"
D="D"
else:
q=X[1]-X[3]
U="U"
D="D"
print(U*(q+1)+R*2+D*(q+2)+L*2+U+L+U*q+R*2+D*q+L)
#Y軸に並行
if X[3]-X[1]==0:
if X[2]-X[0]>0:
p=X[2]-X[0]
R="R"
L="L"
else:
p=X[0]-X[2]
R="L"
L="R"
print(R*(p+1)+U*2+L*(p+2)+D*2+R+D+R*p+U*2+L*p+D)
if X[2]-X[0]!=0 and X[3]-X[1]!=0
if X[2]-X[0]>0:
p=X[2]-X[0]
R="R"
L="L"
else:
p=X[0]-X[2]
R="L"
L="R"
if X[3]-X[1]>0:
q=X[3]-X[1]
U="U"
D="D"
else:
q=X[1]-X[3]
U="D"
D="U"
print(U*p+R*(q+1)+D*(p+1)+L*(q+1)+U+L+U*(p+1)+R*(q+1)+D*(p+1)+L*q) |
s147549843 | p03836 | u419963262 | 1581776145 | Python | Python (3.4.3) | py | Runtime Error | 17 | 3064 | 812 | X=list(map(int,input().split()))
#X軸に並行
if X[2]-X[0]==0:
if X[3]-X[1]>0:
q=X[3]-X[1]
U="U"
D="D"
else:
q=X[1]-X[3]
U="U"
D="D"
print(U*(q+1)+R*2+D*(q+2)+L*2+U+L+U*q+R*2+D*q+L)
#Y軸に並行
if X[3]-X[1]==0:
if X[2]-X[0]>0:
p=X[2]-X[0]
R="R"
L="L"
else:
p=X[0]-X[2]
R="L"
L="R"
print(R*(p+1)+U*2+L*(p+2)+D*2+R+D+R*p+U*2+L*p+D)
if X[2]-X[0]!=0 or X[3]-X[1]!=0
if X[2]-X[0]>0:
p=X[2]-X[0]
R="R"
L="L"
else:
p=X[0]-X[2]
R="L"
L="R"
if X[3]-X[1]>0:
q=X[3]-X[1]
U="U"
D="D"
else:
q=X[1]-X[3]
U="D"
D="U"
print(U*p+R*(q+1)+D*(p+1)+L*(q+1)+U+L+U*(p+1)+R*(q+1)+D*(p+1)+L*q) |
s508098256 | p03836 | u419963262 | 1581774299 | Python | Python (3.4.3) | py | Runtime Error | 17 | 3064 | 295 | X=list(map(int.input().split()))
if X[2]-X[0]>0:
p=X[2]-X[0]
U="U"
D="D"
else:
p=X[0]-X[2]
U="D"
D="U"
if X[3]-X[1]>0:
q=X[3]-X[1]
R="R"
L="L"
else:
q=X[1]-X[3]
R="L"
L="R"
print(U*p+R*(q+1)+D*(p+1)+L*(q+1)+U+L+U*(p+1)+R*(q+1)+D*(p+1)+L*q) |
s776714102 | p03836 | u419963262 | 1581774194 | Python | Python (3.4.3) | py | Runtime Error | 17 | 3064 | 301 | X=list(map(int.input().split()))
ans=""
if X[2]-X[0]>0:
p=X[2]-X[0]
U="U"
D="D"
else:
p=X[0]-X[2]
U="D"
D="U"
if X[3]-X[1]>0:
q=X[3]-X[1]
R="R"
L="L"
else:
q=X[1]-X[3]
R="L"
L="R"
print(U*p+R*(q+1)+D*(p+1)+L*(q+1)+U+L+U*(p+1)+R*(q+1)+D*(p+1)+L*q |
s792685826 | p03836 | u805045107 | 1578610207 | Python | Python (3.4.3) | py | Runtime Error | 17 | 3060 | 290 | A, B, N = map(int, input().split())
behavior = input()
for b in behavior:
if b == 'S':
if A > 0:
A -= 1
elif b == 'C':
if B > 0:
B -= 1
elif b == 'E':
if not ((A == 0) and (B == 0)):
if A >= B:
A -= 1
else:
B -= 1
print(A)
print(B) |
s237520840 | p03836 | u457554982 | 1576424622 | Python | Python (3.4.3) | py | Runtime Error | 17 | 3060 | 258 | [sx, sy, tx, ty]=list(map(int,input().split()))
a1=["R"]*(tx-sx)+["U"]*(ty-sy)+["L"]*(tx-sx)+["D"]*(ty-sy)
a2=["D"]+["R"]*(tx-sx+1)+["U"]*(ty-sy+1)+["L"]+["U"]+["L"]*(tx-sx+1)+["D"]*(ty-sy+1)+["R"]
ans=a1+a2
for i in range(len(ans))
print(ans[i],end=" ")
|
s738435065 | p03836 | u442810826 | 1573513018 | Python | Python (3.4.3) | py | Runtime Error | 19 | 3188 | 753 | H,W,A,B = map(int, input().split())
MOD = 10 ** 9 + 7
N = H+W+1
def power(base, num):
if num == 0:
return 1
elif num % 2==0:
return power(base, num//2) **2 % MOD
elif num==1:
return base % MOD
else:
return power(base, num//2) **2 * base % MOD
fact = [0 for i in range(N)]
inv_fact = [0 for i in range(N)]
fact[0] = 1
for i in range(1, N):
fact[i] = fact[i-1] * i % MOD
inv_fact[H+W] = power(fact[H+W], MOD-2)
for i in range(1, N):
inv_fact[N-1-i] = inv_fact[N-i] * (N-i) % MOD
def comb(x,y):
return (fact[x] * inv_fact[y])%MOD * inv_fact[x-y] % MOD
ans = 0
for i in range(1, W-B+1):
ans += comb(H-A+B-2+i, H-A-1) * comb(A-1+W-B-i, A-1) % MOD
ans %= MOD
print(ans%MOD)
|
s178722414 | p03836 | u153902122 | 1570993080 | Python | PyPy3 (2.4.0) | py | Runtime Error | 170 | 38384 | 671 | def make_prime(n):
prime = []
temp = n
for i in range(2, n):
if temp % i == 0:
cnt = 0
while temp % i == 0:
cnt += 1
temp //= i
prime.append([i, cnt])
if temp!=1:
prime.append([temp, 1])
if prime==[]:
prime.append([n, 1])
return prime
from collections import defaultdict
d=defaultdict(lambda :1)
num = int(input())
w=10**9+7
for i in range(2,num+1):
prime_num_list = make_prime(i)
for j in range(len(prime_num_list)):
key = prime_num_list[j][0]
d[key] += prime_num_list[j][1]
cnt=1
for val in d.values():
cnt*=val
print(cnt) |
s345495327 | p03836 | u153902122 | 1570993053 | Python | Python (3.4.3) | py | Runtime Error | 21 | 3316 | 671 | def make_prime(n):
prime = []
temp = n
for i in range(2, n):
if temp % i == 0:
cnt = 0
while temp % i == 0:
cnt += 1
temp //= i
prime.append([i, cnt])
if temp!=1:
prime.append([temp, 1])
if prime==[]:
prime.append([n, 1])
return prime
from collections import defaultdict
d=defaultdict(lambda :1)
num = int(input())
w=10**9+7
for i in range(2,num+1):
prime_num_list = make_prime(i)
for j in range(len(prime_num_list)):
key = prime_num_list[j][0]
d[key] += prime_num_list[j][1]
cnt=1
for val in d.values():
cnt*=val
print(cnt) |
s146775887 | p03836 | u901582103 | 1568288952 | Python | Python (3.4.3) | py | Runtime Error | 17 | 2940 | 174 | sx,sy=map(int,input().split())
tx,ty=map(int,input().split())
dx,dy=tx-sx,ty-sy
print('U'*dy+'R'*dx+'D'*dy+'L'*dx+'L'+'U'*(dy+1)+'R'*(dx+1)+'D'+'R'+'D'*(dy+1)+'L'*(dx+1)+'U') |
s185460288 | p03836 | u177411511 | 1567747798 | Python | PyPy3 (2.4.0) | py | Runtime Error | 190 | 38640 | 628 | import sys
import copy
import string
from _bisect import *
from collections import *
from operator import itemgetter
from math import factorial
"""
from fractions import gcd
def lcm(x, y):
return (x * y) // gcd(x, y)
"""
stdin = sys.stdin
ni = lambda: int(ns())
na = lambda: list(map(int, stdin.readline().split()))
ns = lambda: stdin.readline()
sx, sy, tx, ty = na()
ans = ""
dx = tx - sx
dy = ty - sy
ans += dy * "U"
ans += dx * "R"
ans += dy * 'D'
ans += dx * "L"
ans += "L"
ans += "U" * (dy + 1)
ans += 'R' * (dx + 1)
ans += "D"
ans += "R"
ans += 'D' * (dy + 1)
ans += "L" * (dx + 1)
ans += "U"
print(ans)
|
s280615858 | p03836 | u679325651 | 1566118912 | Python | Python (3.4.3) | py | Runtime Error | 20 | 3064 | 428 | sx,sy,tx,ty = [int(i) for i in input().split()]
ans = ""
for i in range(ty-sy):
ans += "U"
for i in range(tx-sx):
ans += "R"
for i in range(ty-sy):
ans += "D"
for i in range(tx-sx):
ans += "L"
ans += "L"
for i in range(ty-sy+1):
ans += "U"
for i in range(tx-sx+1):
ans += "R"
ans += "D"
ans += "R"
for i in range(ty-sy+1):
ans += "D"
for i in range(tx-sx+1):
ans += "L"
ans += "U"
print(ans==ex) |
s977940546 | p03836 | u361841553 | 1564783577 | Python | Python (3.4.3) | py | Runtime Error | 17 | 3060 | 211 | sx, sy, tx, ty = [int(x) for x in input().split()]
y = ty - sy
l = ["R"]*x + ["U"]*y + ["L"]*x + ["D"]*y + ["D"] + ["R"] * (x+1) + ["U"]*(y+1) + ["L"] + ["U"] + ["L"]*(x+1) + ["D"]*(y+1) +["R"]
print("".join(l)) |
s680867472 | p03836 | u361841553 | 1564783495 | Python | Python (3.4.3) | py | Runtime Error | 17 | 3060 | 265 | from sys import stdin
sx, sy, tx, ty = [int(x) for x in stdin().readline().rstrip().split()]
x = tx - sx
y = ty - sy
l = ["R"]*x + ["U"]*y + ["L"]*x + ["D"]*y + ["D"] + ["R"] * (x+1) + ["U"]*(y+1) + ["L"] + ["U"] + ["L"]*(x+1) + ["D"]*(y+1) +["R"]
print("".join(l)) |
s839991803 | p03836 | u361841553 | 1564783446 | Python | Python (3.4.3) | py | Runtime Error | 18 | 3064 | 335 | from sys import stdin
def main():
sx, sy, tx, ty = [int(x) for x in stdin().readline().rstrip().split()]
x = tx - sx
y = ty - sy
l = ["R"]*x + ["U"]*y + ["L"]*x + ["D"]*y + ["D"] + ["R"] * (x+1) + ["U"]*(y+1) + ["L"] + ["U"] + ["L"]*(x+1) + ["D"]*(y+1) +["R"]
print("".join(l))
if __name__ == "__main__":
main() |
s592817151 | p03836 | u361841553 | 1564783335 | Python | Python (3.4.3) | py | Runtime Error | 17 | 3060 | 243 | sx, sy, tx, ty = [int(x) for x in stdin().readline().rstrip().split()]
x = tx - sx
y = ty - sy
l = ["R"]*x + ["U"]*y + ["L"]*x + ["D"]*y + ["D"] + ["R"] * (x+1) + ["U"]*(y+1) + ["L"] + ["U"] + ["L"]*(x+1) + ["D"]*(y+1) +["R"]
print("".join(l)) |
s541844156 | p03836 | u081275802 | 1564006623 | Python | Python (3.4.3) | py | Runtime Error | 17 | 2940 | 872 | #include<iostream>
#define X 2
#define Y 0
using namespace std;
int main(){
int sx,tx,sy,ty;
int dis_x,dis_y;
int abs_dis_x, abs_dis_y;
cin >> sx >> sy >> tx >> ty;
dis_x = tx - sx;
dis_y = ty - sy;
char code[5] = "UDRL";
bool code_x,code_y;
int i;
code_x = 0;
code_y = 0;
for(i=0;i<dis_x;i++){
cout << "R";
}
for(i=0;i<dis_y;i++){
cout << "U";
}
for(i=0;i< dis_x;i++){
cout << "L";
}
for(i=0;i< dis_y;i++){
cout << "D";
}
cout << "D";
for(i=0;i<abs_dis_x+1;i++){
cout << "R";
}
for(i=0;i<abs_dis_y+1;i++){
cout << "U";
}
cout << "L";
cout << "U";
for(i=0;i<abs_dis_x+1;i++){
cout << "L";
}
for(i=0;i<abs_dis_y+1;i++){
cout << "D";
}
cout << "R";
cout << endl;
}
|
s847601433 | p03836 | u180058306 | 1562181384 | Python | Python (3.4.3) | py | Runtime Error | 20 | 3188 | 977 | # 座標を入力
sx, sy, tx, ty = map(int, input().split())
S = np.array([sx, sy])
T = np.array([tx, ty])
# 2点の最短経路を返す関数を定義(左右移動優先かつ方向転換1回のみ)
def shortest_path(start, end):
if start[0] <= end[0]:
lr_path = "R" * (end[0] - start[0])
else:
lr_path = "L" * (start[0] - end[0])
if start[1] <= end[1]:
ud_path = "U" * (end[1] - start[1])
else:
ud_path = "D" * (start[1] - end[1])
return lr_path + ud_path
# 点Sから点Tまでの経路(1回目)
path_1 = shortest_path(S, T)
# 点Tから点Sまでの経路(1回目)
path_2 = shortest_path(T, S)
# 点Sから点Tまでの経路(2回目)
path_3 = "D" + shortest_path(S + np.array([0, -1]), T + np.array([1, 0])) + "L"
# 点Tから点Sまでの経路(2回目)
path_4 = "L" + shortest_path(S + np.array([-1, 0]), T + np.array([0, 1])) + "D"
# 全経路を出力
print(path_1 + path_2 + path_3 + path_4) |
s796823210 | p03836 | u180058306 | 1562181189 | Python | Python (3.4.3) | py | Runtime Error | 17 | 3064 | 977 | # 座標を入力
sx, sy, tx, ty = map(int, input().split())
S = np.array([sx, sy])
T = np.array([tx, ty])
# 2点の最短経路を返す関数を定義(左右移動優先かつ方向転換1回のみ)
def shortest_path(start, end):
if start[0] <= end[0]:
lr_path = "R" * (end[0] - start[0])
else:
lr_path = "L" * (start[0] - end[0])
if start[1] <= end[1]:
ud_path = "U" * (end[1] - start[1])
else:
ud_path = "D" * (start[1] - end[1])
return lr_path + ud_path
# 点Sから点Tまでの経路(1回目)
path_1 = shortest_path(S, T)
# 点Tから点Sまでの経路(1回目)
path_2 = shortest_path(T, S)
# 点Sから点Tまでの経路(2回目)
path_3 = "D" + shortest_path(S + np.array([0, -1]), T + np.array([1, 0])) + "L"
# 点Tから点Sまでの経路(2回目)
path_4 = "L" + shortest_path(S + np.array([-1, 0]), T + np.array([0, 1])) + "D"
# 全経路を出力
print(path_1 + path_2 + path_3 + path_4) |
s152605784 | p03836 | u180058306 | 1562180710 | Python | Python (3.4.3) | py | Runtime Error | 17 | 3064 | 969 | # 座標を入力
sx, sy, tx, ty = map(int, input())
S = np.array([sx, sy])
T = np.array([tx, ty])
# 2点の最短経路を返す関数を定義(左右移動優先かつ方向転換1回のみ)
def shortest_path(start, end):
if start[0] <= end[0]:
lr_path = "R" * (end[0] - start[0])
else:
lr_path = "L" * (start[0] - end[0])
if start[1] <= end[1]:
ud_path = "U" * (end[0] - start[0])
else:
ud_path = "D" * (start[0] - end[0])
return lr_path + ud_path
# 点Sから点Tまでの経路(1回目)
path_1 = shortest_path(S, T)
# 点Tから点Sまでの経路(1回目)
path_2 = shortest_path(T, S)
# 点Sから点Tまでの経路(2回目)
path_3 = "D" + shortest_path(S + np.array([0, -1]), T + np.array([1, 0])) + "L"
# 点Tから点Sまでの経路(2回目)
path_4 = "L" + shortest_path(S + np.array([-1, 0]), T + np.array([0, 1])) + "D"
# 全経路を出力
print(path_1 + path_2 + path_3 + path_4) |
s285707973 | p03836 | u554954744 | 1561583822 | Python | PyPy3 (2.4.0) | py | Runtime Error | 185 | 38256 | 184 | K, S = map(int, input().split())
cnt = 0
for i in range(K+1):
for j in range(K+1):
for k in range(K+1):
if i + j + k == S:
cnt += 1
print(cnt) |
s773169357 | p03836 | u583276018 | 1559769630 | Python | Python (3.4.3) | py | Runtime Error | 17 | 3064 | 559 | sx, sy, tx, ty = [int(i) for i in input().split()]
sx = i
sy = j
while(i < tx):
print("R", end = "")
i += 1
while(j < ty):
print("U", end = "")
j += 1
while(i > sx):
print("L", end = "")
i -= 1
while(j > sy):
print("D", end = "")
j -= 1
i -= 1
print("L", end = "")
while(j < ty+1):
print("U", end = "")
j += 1
while(i < tx):
print("R", end = "")
i += 1
j -= 1
print("D", end = "")
i += 1
print("U", end = "")
while(j > sy-1):
print("D", end = "")
j -= 1
while(i > sx):
print("L", end = "")
i -= 1
j += 1
print("U", end = "")
|
s048485531 | p03836 | u055941944 | 1559098129 | Python | Python (3.4.3) | py | Runtime Error | 17 | 3060 | 169 | sx,sy,tx,ty=map(int,input().split())
a=tx-sx
b=ty-sy
ans=""
ans="U"*b+"R"*a
ans+="D"*b+"L"*a
ans+="D"+"R"(a+1)+"U"*(b+1)+"L"
ans+="U"+"L"(a+1)+"D"(b+1)+"R"
print(ans) |
s113255550 | p03836 | u163320134 | 1557906706 | Python | Python (3.4.3) | py | Runtime Error | 17 | 3064 | 210 | sx,sy,tx,ty=map(int,input().split())
w=tx-sx
h=ty-xy
ans=''
ans+='R'*w
ans+='U'*h
ans+='L'*w
ans+='D'*h
ans+='D'
ans+='R'*(h+1)
ans+='U'*(w+1)
ans+='L'
ans+='U'
ans+='L'*(h+1)
ans+='D'*(w+1)
ans+='R'
print(ans) |
s136488481 | p03836 | u263830634 | 1556546004 | Python | Python (3.4.3) | py | Runtime Error | 18 | 2940 | 177 | K, S = map(int, input().split())
count = 0
for x in range(0,K+1):
for y in range(0,K+1):
a = S-x-y
if a <= K and a>= 0:
count += 1
print (count) |
s613102040 | p03836 | u013629972 | 1556059915 | Python | PyPy3 (2.4.0) | py | Runtime Error | 294 | 65132 | 1079 | import math, string, itertools, fractions, heapq, collections, re, array, bisect, sys, random, time, copy, functools
sys.setrecursionlimit(10**7)
inf = 10 ** 20
eps = 1.0 / 10**10
mod = 10**9+7
dd = [(-1, 0), (0, 1), (1, 0), (0, -1)]
ddn = [(-1, 0), (-1, 1), (0, 1), (1, 1), (1, 0), (1, -1), (0, -1), (-1, -1)]
def LI(): return [int(x) for x in sys.stdin.readline().split()]
def LI_(): return [int(x)-1 for x in sys.stdin.readline().split()]
def LF(): return [float(x) for x in sys.stdin.readline().split()]
def LS(): return sys.stdin.readline().split()
def _I(): return int(sys.stdin.readline())
def _F(): return float(sys.stdin.readline())
def pf(s): return print(s, flush=True, end="")
sx,sy,tx,ty=LI()
for i in range(abs(ty-sy)):
pf("U")
for i in range(abs(sx-tx)):
pf("R")
for i in range(abs(ty-sy)):
pf("D")
for i in range(abs(sx-tx)):
pf("L")
pf("L")
for i in range(abs(ty-sy)):
pf("U")
pf("U")
pf("R")
for i in range(abs(sx-tx)):
pf("R")
pf("D")
pf("R")
for i in range(abs(ty-sy)):
pf("D")
pf("D")
pf("L")
for i in range(abs(tx-sx)):
pf("L")
pf("U") |
s180587543 | p03836 | u971091945 | 1555520732 | Python | Python (3.4.3) | py | Runtime Error | 20 | 3188 | 227 | sx, sy, tx, ty= map(int, input().split())
w = tx-sx
h = ty-sy
ans = ""
ans+="R"*w
ans+="U"*h
ans+="L"*w
ans+="D"*h
ans+="D"
ans+="R"*(x+1)
ans+="U"*(y+1)
ans+="L"
ans+="U"
ans+="L"*(x+1)
ans+="D"*(y+1)
ans+="R"
print(ans) |
s771788955 | p03836 | u798129018 | 1554749665 | Python | Python (3.4.3) | py | Runtime Error | 18 | 2940 | 164 | sx,sy,tx,ty = map(int,input().split())
print("U"*(ty-sy)+"R"*(tx-sx)+"D"*(ty-sy)+"L"*(ty-sy)+"L"+"U"*(ty-sy+1)+"R"*(tx-sx+1)+"D"+"R"+"D"*(ty-sy+1)+"L"*(tx-sx+1)+"U" |
s341715800 | p03836 | u912625807 | 1554607256 | Python | Python (3.4.3) | py | Runtime Error | 17 | 3064 | 281 | sx = int(input())
sy = int(input())
tx = int(input())
ty = int(input())
dx = tx - sx
dy = ty - sy
p1 = dy * 'U' + dx * 'R'
p2 = dy * 'D' + dx * 'L'
p3 = 'D' + (dx + 1) * 'R' + \
(dy + 1) * 'U' + 'L'
p4 = 'U' + (dx + 1) * 'L' + \
(dy + 1) * 'D' + 'R'
print(p1 + p2 + p3 + p4) |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.