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
s933075042
p03796
u631914718
1487479427
Python
Python (3.4.3)
py
Runtime Error
2227
114112
224
n = int(input()) import sys sys.setrecursionlimit(100000) def fa(n, memo=dict()): if n==0 or n == 1: return 1 elif n in memo.keys(): return memo[n] else: temp = fa(n-1)*n memo[n] = temp return temp print(fa(n))
s936990273
p03796
u327543932
1487476461
Python
Python (2.7.6)
py
Runtime Error
22
3460
110
n=input() def P(n): if n==1: return 1 else: return P(n-1)*n print int((P(n)%(1e9 +7)))
s509889489
p03796
u327543932
1487476364
Python
Python (2.7.6)
py
Runtime Error
22
3460
105
n=input() def P(n): if n==1: return 1 else: return P(n-1)*n print (P(n)%(1e9 +7))
s474932970
p03796
u327543932
1487476234
Python
Python (2.7.6)
py
Runtime Error
22
3460
105
n=input() def P(n): if n==1: return 1 else: return P(n-1)*n print (P(n)/(1e9 +7))
s415749245
p03796
u327543932
1487476107
Python
Python (2.7.6)
py
Runtime Error
22
3460
96
n=input() def P(n): if n==1: return 1 else: return P(n-1)*n print (P(n))
s569708002
p03796
u820315626
1487474271
Python
Python (3.4.3)
py
Runtime Error
229
3980
73
import math n = int(input()) print(math.factorial(n) / (pow(10, 9) + 7))
s876126724
p03796
u811388439
1487472255
Python
Python (3.4.3)
py
Runtime Error
17
2940
142
def sunuke_f2(n): power = 1 for i in range(1, n+1, 1): power *= i i += 1 print(power % (10 ** 9 + 7)) sunuke_f2(N)
s412261247
p03796
u631914718
1487470164
Python
Python (3.4.3)
py
Runtime Error
72
4140
202
def f(n, memo = dict()): if n == 0 or n == 1: return 1 elif n in memo.keys(): return memo[n] else: temp = (f(n-1) * n) % int(10e9+7) memo[n] = temp return temp n = int(input()) print(f(n))
s055255153
p03797
u666550725
1599859543
Python
PyPy3 (7.3.0)
py
Runtime Error
358
94488
91
N, M = map(int, input()) if N * 2 >= M: print(M // 2) else: print(N + (M - N * 2) // 3)
s924417473
p03797
u235210692
1598917744
Python
Python (3.8.2)
py
Runtime Error
25
9088
225
n, m = [int(i) for i in input().split()] if n >= 2 * m: print(m // 2) else: print(n + (m - 2 * n) // 2) n, m = [int(i) for i in input().split()] if n >= 2 * m: print(m // 2) else: print(n + (m - 2 * n) // 4)
s299915565
p03797
u235210692
1598917639
Python
Python (3.8.2)
py
Runtime Error
27
9068
226
n, m = [int(i) for i in input().split()] if n >= 2 * m: print(m // 2) else: print(n + (m - 2 * n) // 2) n, m = [int(i) for i in input().split()] if n >= 2 * m: print(m // 2) else: print(n + (m - 2 * n) // 4)
s196469549
p03797
u752774573
1597809736
Python
PyPy3 (7.3.0)
py
Runtime Error
93
74628
66
N,M=list(map(int, input().split())) K=N-2*M print(max(N+K//3,N))
s391383717
p03797
u909716307
1597613335
Python
Python (3.8.2)
py
Runtime Error
26
9104
65
n,m=map(int,input().split()) c=n%(m//2) d=m-2*c c+=d//4 print(c)
s269417545
p03797
u334700364
1594713000
Python
Python (3.8.2)
py
Runtime Error
22
9044
141
n, m = map(int, input()) possible_c = m possible_s = n * 2 one_valid = 4 result = (possible_c + possible_s) // one_valid print (result)
s248038848
p03797
u001577246
1589391835
Python
Python (3.4.3)
py
Runtime Error
17
2940
47
n=int(input()) m=int(input()) print((2*n+m)//4)
s407111859
p03797
u519923151
1589128343
Python
Python (3.4.3)
py
Runtime Error
18
2940
119
n,m = map(int, input().split()) if n*2 <= m: ma = m-n*2 ans = n+(ma//4) else: ans = ma//2 print(ans)
s531986249
p03797
u633450100
1588290404
Python
Python (3.4.3)
py
Runtime Error
17
2940
352
N,M = [int(i) for i in input().split()] count = 0 if 2 * N <= M: count = N M -= 2 * N if M >= 4: count += M // 4 print(count) else: print(count) else: if N != 0: while N == 0 or M <= 1: count += 1 N -= 1 M - = 2 print(count)...
s029854479
p03797
u633450100
1588290374
Python
Python (3.4.3)
py
Runtime Error
17
2940
352
N,M = [int(i) for i in input().split()] count = 0 if 2 * N <= M: count = N M -= 2 * N if M >= 4: count += M // 4 print(count) else: print(count) else: if N != 0: while N == 0 or M <= 1: count += 1 N -= 1 M - = 2 print(count)...
s777633149
p03797
u189479417
1587611581
Python
Python (3.4.3)
py
Runtime Error
17
2940
110
N, M = map(int,input().split()) if 2 * N >= M: print(M // 2) else: k = M - 2 * S print(S + k // 4)
s535614873
p03797
u149991748
1587419366
Python
Python (3.4.3)
py
Runtime Error
17
2940
123
n, m = map(int, input().split()) if n*2 < m: c = m - (n*2) ans = int(c/4) + n else: ans = int(c/2) print(ans)
s706139005
p03797
u230717961
1587088681
Python
Python (3.4.3)
py
Runtime Error
18
2940
201
def slove(n, m): tmp = n if n < m // 2 else m // 2 tmp2 = (m - tmp * 2) // 4 return tmp + tmp2 if __name__ == "__main__": n, m = [i for i in input().split()] print(slove(n, m))
s762760276
p03797
u482157295
1585968197
Python
Python (3.4.3)
py
Runtime Error
17
2940
196
n = int(input()) ans = 1 dummy1,dummy2 = divmod(n,2) for i in range(1,dummy1+1): ans *= i ans *= n+1-i ans = ans % (10**9+7) if dummy2 == 1: ans = ((dummy1+1)*ans % (10**9+7)) print(ans)
s757637732
p03797
u089142196
1585084117
Python
Python (3.4.3)
py
Runtime Error
17
2940
89
N,M=map(int,input().split()) O = M//2 if N>=O: print(N) elpe: P = (N+O)//2 print(P)
s373459612
p03797
u263824932
1583564109
Python
Python (3.4.3)
py
Runtime Error
19
2940
199
N,M=map(int,input().split()) count=0 if N>=1 and M>=2: a=M//2 if N>=a: M=M-2*a answer=a else: M=M-2*N answer=N if M>=4: kotae=M//4 print(answer+kotae)
s556079643
p03797
u349091349
1582767881
Python
PyPy3 (2.4.0)
py
Runtime Error
167
38384
71
n,m=map(int,input().split()) print(min(n , (m - 2*i)//2) + (m-2*n)//4)
s114262202
p03797
u823044869
1579908701
Python
Python (3.4.3)
py
Runtime Error
17
2940
95
n,m = map(int,input().split()) if 2*n <= m: print(n+(m-2*n)//4) elif 2*n > m: print(c//2)
s030621989
p03797
u386089355
1578445155
Python
Python (3.4.3)
py
Runtime Error
17
2940
105
n, m = map(int, input().split()) if 2 * n >= m: print(min(n, m//2) else: print((2 * n + m) // 4)
s120830974
p03797
u807084817
1578183261
Python
PyPy3 (2.4.0)
py
Runtime Error
183
38896
199
def resolve(): s,c= map(int,input().split()) if s>=c/2: print(str(math.floor(c/2))) else: zanc = c - (s * 2) print(str(s + math.floor(zanc/4))) resolve()
s730937589
p03797
u557494880
1573998920
Python
PyPy3 (2.4.0)
py
Runtime Error
174
38384
114
N,M = map(int,input().split()) a = M - 2*N if a <= 0: ans = C//2 else: a = a//4 ans = N + a print(ans)
s583885634
p03797
u876688988
1572907436
Python
Python (2.7.6)
py
Runtime Error
10
2568
220
s,c = map(int, input().split()) cnt = 0 while(True): if(c > 2): if(s > 0): s = s - 1 c = c - 2 else: c = c - 3 cnt = cnt + 1 else: break
s159301260
p03797
u033606236
1568989813
Python
Python (3.4.3)
py
Runtime Error
17
2940
83
S,C = map(int,input().split()) if C >= S*2:ans = S ans += (C-ans*2) // 4 print(ans)
s387602279
p03797
u703890795
1567076201
Python
Python (3.4.3)
py
Runtime Error
17
2940
66
N, M = map(int, input().split()) M2 += N*2 print(min(M2//4, M//2))
s423531617
p03797
u777283665
1565563021
Python
PyPy3 (2.4.0)
py
Runtime Error
182
38256
68
if c < 2 * s: print(c // 2) else: c -= 2 * s print(s + c // 4)
s115159414
p03797
u670180528
1565245867
Python
Python (3.4.3)
py
Runtime Error
18
2940
63
n,m=map(int,input().split()) print(min(s,c//2)+max(0,c-s*2)//4)
s275515790
p03797
u695079172
1564966383
Python
Python (3.4.3)
py
Runtime Error
17
2940
383
s,c = map(int,input().split(" ")) counter = 0 if s >= 1 and c >= 2: temp = min(s,c//2) s -= temp c -= temp * 2 counter += temp #print("s:",s) #print("c:",c) #print("counter:",counter) if s<=0 and c >= 4: temp = c // 4 counter += temp c -= temp #print("s:",s) #p...
s643974198
p03797
u695079172
1564966277
Python
Python (3.4.3)
py
Runtime Error
17
3060
377
s,c = map(int,input().split(" ")) counter = 0 if s >= 1 and c >= 2: temp = min(s,c//2) s -= temp c -= temp * 2 counter += temp print("s:",s) print("c:",c) print("counter:",counter) if s<=0 and c >= 4: temp = c // 4 counter += temp c -= temp print("s:",s) print(...
s005851268
p03797
u695079172
1564966232
Python
Python (3.4.3)
py
Runtime Error
20
3316
377
s,c = map(int,input().split(" ")) counter = 0 if s >= 1 and c >= 2: temp = min(s,c//2) s -= temp c -= temp * 2 counter += temp print("s:",s) print("c:",c) print("counter:",counter) if s<=0 and c >= 4: temp = c // 4 counter += temp c -= temp print("s:",s) print(...
s425381056
p03797
u695079172
1564966061
Python
Python (3.4.3)
py
Runtime Error
17
2940
214
s,c = map(int,input().split(" ")) counter = 0 if s >= 1 and c >= 2: temp = min(s,c//2) s -= temp c -= temp counter += temp if s<=0 and c >= 4: temp = c // 4 counter += temp c -= temp print(temp)
s937363185
p03797
u552122040
1562024519
Python
Python (3.4.3)
py
Runtime Error
17
2940
158
n = int(input()) power = [1] if n == 1: print(1) exit() for i in range(2, n+1): power.append((i * power[-1]) % (10 ** 9 + 7)) print(power[-1])
s592786883
p03797
u552122040
1562024490
Python
Python (3.4.3)
py
Runtime Error
17
2940
158
n = int(input()) power = [1] if n == 1: print(1) exit() for i in range(2, n+1): power.append((i * power[-1]) % (10 ** 9 + 7)) print(power[-1])
s399109873
p03797
u552122040
1562024454
Python
Python (3.4.3)
py
Runtime Error
18
3068
158
n = int(input()) power = [1] if n == 1: print(1) exit() for i in range(2, n+1): power.append((i * power[-1]) % (10 ** 9 + 7)) print(power[-1])
s732717797
p03797
u403660920
1559019602
Python
Python (3.4.3)
py
Runtime Error
17
2940
129
List=[int(j) for j in input().split()] a=List[1] b=List[2] if b>2*a: c=b-2*a d=c//4 print(a+d) else: print(b//2)
s966625128
p03797
u403660920
1559019399
Python
Python (3.4.3)
py
Runtime Error
17
2940
121
List=input().split() a=int(List[1]) b=int(List[2]) if b>2*a: c=b-2*a d=c//4 print(a+d) else: print(b//2)
s753559818
p03797
u403660920
1559019018
Python
Python (3.4.3)
py
Runtime Error
17
2940
91
a,b=input().split() if b>2*a: c=b-2*a d=c//4 print(a+d) else: print(b//2)
s805119859
p03797
u403660920
1559018890
Python
Python (3.4.3)
py
Runtime Error
17
2940
95
a,b=int(input().split()) if b>2*a: c=b-2*a d=c//4 print(a+d) else: print(b//2)
s532286189
p03797
u403660920
1559018719
Python
Python (3.4.3)
py
Runtime Error
17
2940
69
a=int(input()) b=int(input()) c=b-2*a d=c//4 print(a+d)
s009649707
p03797
u403660920
1559018660
Python
Python (3.4.3)
py
Runtime Error
17
2940
100
a=int(input()) b=int(input()) if b>2*a: c=b-2*a d=c//4 print(a+d) else: print(b//2)
s806422349
p03797
u113711423
1555951489
Python
Python (3.4.3)
py
Runtime Error
2104
2940
170
N, M = map(int, input().split()) for scc in range(M//2, -1, -1): excess_c = M - scc*2 if excess_c//2 + N >= scc: print(scc) sys.exit(0) print(0)
s364241109
p03797
u619458041
1555277816
Python
Python (3.4.3)
py
Runtime Error
18
3056
333
import sys def main(): input = sys.stdin.readline N, M = map(int, input().split()) if N >= M // 2: ans = M // 2 S -= M // 2 ans += S // 2 return ans else: ans = N M -= 2 * N ans += M // 4 return ans if __name__ == '__main__': p...
s716783543
p03797
u677440371
1554870229
Python
Python (3.4.3)
py
Runtime Error
20
2940
152
N, M = map(int, input().split()) if 2 * N <= M: ans1 = N M -= ans1 * 2 # print(ans1) # print(M) ans2 = M // 4 # print(ans2) print(ans1 + ans2)
s733000504
p03797
u707498674
1553813080
Python
Python (3.4.3)
py
Runtime Error
17
2940
70
N, M = map(int, input().split()) temp = N * 2 + M print(temp // 4)
s066776061
p03797
u766684188
1550787593
Python
Python (3.4.3)
py
Runtime Error
17
2940
115
n,m=map(int,input().split()) print((n+m//2)//2)n,m=map(int,input().split()) m//=2 print((n+(m-n)//2) if n<m else m)
s893833395
p03797
u106297876
1548732131
Python
Python (3.4.3)
py
Runtime Error
18
2940
139
N,M = map(int,input().split()) ans = 0 #S型をN個を使い切る if 2*N <= M: M -= 2*N ans += N #C型で作る ans += //4 print(ans)
s338517542
p03797
u643840641
1545521249
Python
Python (3.4.3)
py
Runtime Error
17
2940
71
n, m = map(int, input()) print(n + max(0, (m-2*n)//4) if m>=2 else "0")
s800275080
p03797
u643840641
1545521215
Python
Python (3.4.3)
py
Runtime Error
18
2940
69
n, m = map(int, input()) print(n + max(0, (m-2*n)//4) if m>=2 else 0)
s204246841
p03797
u111365959
1543850130
Python
Python (3.4.3)
py
Runtime Error
18
3064
69
n,m = [int(x) for x in input().split()] c = n if m - n >= 0 else pass
s603872987
p03797
u037098269
1542228066
Python
Python (3.4.3)
py
Runtime Error
18
2940
174
n, m = map(int, input().split()) if m >= n*2: leave_c = m - n*2 available = leave_c // 4 print(n + available) else: availabe_c = m // 2 print(available_c)
s468752530
p03797
u940102677
1539291348
Python
Python (3.4.3)
py
Runtime Error
17
2940
88
n, m = map(int, input().split()) if m <= 2*n: print(m//2) else: print((m-2n)//3 + n)
s296559587
p03797
u115682115
1532903387
Python
Python (3.4.3)
py
Runtime Error
17
2940
133
s,c = map(int,input().split()) if s<c/2: c_s = (c-2*s)//4 sc = s print(c_s+sc) else: sc = (min(s,c//2) print(sc)
s997157899
p03797
u698479721
1529379263
Python
Python (3.4.3)
py
Runtime Error
17
2940
98
N,M = map(int, input().split()) s = N c = M if 2*N>=M: print(M//2) else: t = 2*s+c print(t//4)
s046090668
p03797
u856232850
1524355903
Python
Python (3.4.3)
py
Runtime Error
17
2940
57
if s >= c//2: print(c//2) else: print((2*s+c)//4)
s770219642
p03797
u503901534
1523598209
Python
Python (3.4.3)
py
Runtime Error
17
2940
194
n , m = list(map(int,input().split())) counter = 0 if n < m // 2: counter = n m = m - 2* n else: counter = m //2 n = n - m //2 counter = counter + m //4 print(count)
s422337894
p03797
u846150137
1521315885
Python
Python (3.4.3)
py
Runtime Error
17
2940
164
s,c=[int(i) for i in input().split()] def cul(s,c): if s >= c // 2: x = s c = c - s * 2, 0 x += c//4 else: x = c//2 return x print(cul(s,c))
s547040163
p03797
u735154525
1504647490
Python
Python (2.7.6)
py
Runtime Error
10
2568
225
n , m = map(int, raw_input().split()) tmp = m - (2 * n) ans = 0 if tmp < 0: tmp = m - 2 * (n - tmp) if tmp >= 0: n -= n - tmp break m = tmp ans += n ans += tmp / 4 print ans
s047008577
p03797
u735154525
1504647330
Python
Python (2.7.6)
py
Runtime Error
3113
6512
276
n , m = map(int, raw_input().split()) tmp = m - (2 * n) ans = 0 if tmp < 0: for i in range(n): tmp = m - 2 * (n - i) if tmp >= 0: n -= i break m = tmp ans += n ans += tmp / 4 print ans
s656829969
p03797
u667084803
1494530501
Python
Python (3.4.3)
py
Runtime Error
17
3060
150
S,C=map(int,input().split()) if C<2*S: print(int(C/2)) else: if (C-2*S)%4==0: k=(C-2*S)/4 else: k=int(1+(C-2*S)/4) print(int((C-2*k)/2))
s901496312
p03797
u162172626
1488834784
Python
Python (3.4.3)
py
Runtime Error
17
2940
82
n,m = gets.chomp.split.map(&:to_i) if n > m / 2 p m / 2 else p (m+2*n) / 4 end
s020827972
p03797
u503813943
1488735815
Python
Python (3.4.3)
py
Runtime Error
17
2940
77
s,c = map(int,input()) if c/2 <= s: print(c//2) else: print(s + (c-s*2)//4)
s569888591
p03797
u873904588
1488504317
Python
Python (3.4.3)
py
Runtime Error
17
2940
154
import math N,M = map(int,input().split()) count = 0 if N*2>M: count = math.floor(M/2) else: temp=M-2*N ans = N+math.floor(temp/4) print(ans)
s932195549
p03797
u873904588
1488504251
Python
Python (3.4.3)
py
Runtime Error
17
2940
160
import math N,M = map(int,input().split()) count = 0 if N*2>M: count = math.floor(M/2) else: temp=M-2*N ans = N+math.floor(temp/4) print(ans)
s124001355
p03797
u481333386
1487662419
Python
Python (3.4.3)
py
Runtime Error
17
2940
188
s, c = [int(e) for e in input().split()] def main(s, c): ret = 0 for i in range(s): ret += 1 c -= 2 ret += c // 4 return ret ans = main(n) print(ans)
s647114751
p03797
u622011073
1487482733
Python
Python (3.4.3)
py
Runtime Error
17
2940
71
n,m=map(int,input().split()) a=n%(m//2) m-=2*a if m<0:m=0 print(a+m//4)
s802691308
p03797
u622011073
1487482468
Python
Python (3.4.3)
py
Runtime Error
17
2940
59
n,m=map(int,input().split()) a=n%(m//2) print(a+(m-2*a)//4)
s350400767
p03797
u811388439
1487475127
Python
Python (3.4.3)
py
Runtime Error
18
2940
181
def sunuke_f3(n, m) : if n >= m : return(m//2) else : if 2*n < m : return(n + (m-2*n)//4) else : return(m//2) sunuke_f3(N, M)
s115901622
p03797
u631914718
1487474430
Python
Python (3.4.3)
py
Runtime Error
17
3192
1442
# if a > b return true def compare(a, b): # a also b are both string l = max(len(a), len(b)) a_ = a.rjust(l, '0') b_ = b.rjust(l, '0') return a_ > b_ def divide(num, den): # den is integer quo = ''; resi = 0 digit = len(num) if int(num[0]) >= den else len(num)-1 for i in range(len(num)): temp = (int(num[i]...
s387365997
p03797
u846552659
1487471609
Python
Python (3.4.3)
py
Runtime Error
17
2940
168
#include <stdio.h> int main(void){ long long int N, M; scanf("%lld %lld", &N, &M); long long int ans = (N+M/2)/2; printf("%lld\n", ans); return 0; }
s505092773
p03797
u562120243
1487471569
Python
Python (3.4.3)
py
Runtime Error
17
2940
173
import math Sc = input().split() Scc = int(Sc[1])/4 math.floor(Scc) for i in range(int(Sc[0])): if int(Sc[1])%4 == 2*int(Sc[0]): Scc+=1 math.floor(Scc) print(Scc
s444140106
p03797
u631914718
1487470497
Python
Python (3.4.3)
py
Runtime Error
17
2940
85
s, c = map(int, ip().split()) if s >= c//2: print(c//2) else: print(s + (c-s*2)//4)
s591459725
p03798
u074220993
1597516969
Python
Python (3.8.2)
py
Runtime Error
31
9284
534
N = int(input()) s = input() init = ["SS", "SW","WS","WW"] next_animal = { ("S","o","S"):"S", ("S","o","W"):"W", ("S","x","S"):"W", ("S","x","W"):"S", ("W","o","S"):"W", ("W","o","W"):"S", ("W","x","S"):"S", ...
s074147582
p03798
u786020649
1595277791
Python
Python (3.8.2)
py
Runtime Error
138
13224
555
import sys from collections import deque dic={'o':lambda s:1-(s[1]^s[0]), 'x':lambda s:s[1]^s[0]} def mknseq(ox,ld): for x in ld: x.append(dic[ox]((x[-2],x[-1]))) def main(): N=int(sys.stdin.readline().strip()) s=list(sys.stdin.readline().strip()) ans=[deque([x,y]) for x in range(2) for y in ra...
s906618858
p03798
u514687406
1593820024
Python
Python (3.8.2)
py
Runtime Error
52
11996
355
# import sys;input = lambda : sys.stdin.readline() n = int(input()) s = input() x=[] ans=["s"]*n for i in range(n): if s[i]=='x': x.append(i) if len(x)>1: for i in range(0,len(x),2): ans[x[i]+1:x[i+1]]=["w"]*(x[i+1]-x[i]-1) print(("".join(ans)).upper()) elif len(x)==1: print(-1) elif len...
s767291159
p03798
u098012509
1590544702
Python
Python (3.4.3)
py
Runtime Error
79
4780
1671
import sys input = sys.stdin.readline def main(): N = int(input()) S = input().strip() def solve(current_index, ans): if current_index <= 0: solve(current_index + 1, ans + "S") solve(current_index + 1, ans + "W") elif current_index == N - 1: if ans[-1...
s567918957
p03798
u098012509
1590544361
Python
Python (3.4.3)
py
Runtime Error
80
4776
1658
import sys input = sys.stdin.readline def main(): N = int(input()) S = input().strip() def solve(current_index, ans): if current_index == 0: solve(1, ans + "S") solve(1, ans + "W") elif current_index == N - 1: if ans[-1] == "S": if S[c...
s020872931
p03798
u588794534
1589980620
Python
PyPy3 (2.4.0)
py
Runtime Error
2112
135332
990
n=int(input()) s=input() def rev(x): if x=="S": return "W" else: return "S" def wolfsheep(xy): global n,s result=[xy[0],xy[1]] for i in range(1,n+1): if result[i]=="S": s+=s[0] if s[i]=="o": result.append(result[i-1]) els...
s297887316
p03798
u588794534
1589980584
Python
PyPy3 (2.4.0)
py
Runtime Error
2111
135884
990
n=int(input()) s=input() def rev(x): if x=="S": return "W" else: return "S" def wolfsheep(xy): global n,s result=[xy[0],xy[1]] for i in range(1,n+1): if result[i]=="S": s+=s[0] if s[i]=="o": result.append(result[i-1]) els...
s139899427
p03798
u588794534
1589980516
Python
PyPy3 (2.4.0)
py
Runtime Error
187
47088
970
n=int(input()) s=input() def rev(x): if x=="S": return "W" else: return "S" def wolfsheep(xy): global n,s result=[xy[0],xy[1]] for i in range(1,n+1): if result[i]=="S": if s[i]=="o": result.append(result[i-1]) else: r...
s756784406
p03798
u203843959
1589337717
Python
Python (3.4.3)
py
Runtime Error
178
5840
1609
import sys N=int(input()) slist=[x=="o" for x in input()] #print(slist) answer_list=[0]*(N+1) if N==3: if slist.count(True)==3: print("SSS") elif slist.count(False)==3: print("WWW") else: print(-1) sys.exit(0) ok=False for p1,p2 in [(1,1),(1,-1),(-1,1),(-1,-1)]: answer_list[1]=p1 answer_list[...
s592595728
p03798
u977193988
1589125938
Python
Python (3.4.3)
py
Runtime Error
1585
4764
1991
import sys import queue def input(): return sys.stdin.readline().strip() sys.setrecursionlimit(20000000) MOD = 10 ** 9 + 7 def main(): N = int(input()) s = input() Animal = ["WW", "WS", "SS", "SW"] for i in range(1, N - 1): if s[i] == "o": for j in range(4): ...
s547184415
p03798
u064963667
1587997368
Python
Python (3.4.3)
py
Runtime Error
61
4212
1529
n = int(input()) s = input() s = [s[i] for i in range(n)] answer = '' current = 'S' # 1: sheep, -1: wolf first_flag = False for i,l in enumerate(s): if current == 'S': if l == 'x': if first_flag == False: answer += current current = 'W' first_fla...
s056038782
p03798
u111555888
1585236619
Python
Python (3.4.3)
py
Runtime Error
96
8080
1921
n=int(input()) s=str(input()) l=[0]*n flag=1 if s[0]=='x': flag=0 new_s='' for j in range(n): if s[j]=='x': new_s+='o' else: new_s+='x' s=new_s def check(i,l): if i==0: l11=[0]*n l12=[0]*n l21=[0]*n l22=[0]*n l11[0]='S' l11[1]=l11[n-1]='S' l12[0]='S' l12...
s370622633
p03798
u111555888
1585236119
Python
Python (3.4.3)
py
Runtime Error
100
8104
2092
n=int(input()) s=str(input()) l=[0]*n flag=1 if s[0]=='x': flag=0 def check(i,l): if i==0: l11=[0]*n l12=[0]*n l21=[0]*n l22=[0]*n if s[i]=='o': l11[0]='S' l11[1]=l11[n-1]='S' l12[0]='S' l12[1]=l12[n-1]='W' tmp1=check(i+1,l11) tmp2=check(i+1,l12) l21[0]=...
s760227458
p03798
u863442865
1583687624
Python
Python (3.4.3)
py
Runtime Error
88
4340
1249
#始めの2匹が決まるとあとは自動的に決まるので矛盾していないかどうか判定 def main(): import sys #input = sys.stdin.readline sys.setrecursionlimit(10000000) from collections import Counter, deque #from collections import defaultdict from itertools import combinations, permutations #from itertools import accumulate, product ...
s848938323
p03798
u368796742
1582256755
Python
Python (3.4.3)
py
Runtime Error
18
3064
1009
n = int(input()) l = list(input()) check = [[1,1],[1,-1],[-1,1],[-1,-1]] for j,k in check: ans = [0]*n ans[0] = j ans[1] = k for i in range(1,n): if ans[i] == 1: if l[i] == "o": ans[(i+1)%n] = ans[i-1] else: ans[(i+1)%n] = -ans[i-1] ...
s389412297
p03798
u557494880
1580004180
Python
Python (3.4.3)
py
Runtime Error
18
3492
3564
N = int(input()) S = input() def f(n): if n == 'S': return 'W' if n == 'W': return 'S' A = ['S','S'] fa = 1 B = ['S','W'] fb = 1 C = [W,W] fc = 1 D = [W,S] fd = 1 s = fa + fb + fc + fd for i in range(1,N-1): x = S[i] if x == 'o': if A[i] == 'S': A.append(A[i-1]) ...
s709071877
p03798
u121921603
1579038521
Python
PyPy3 (2.4.0)
py
Runtime Error
211
44848
792
import sys input = sys.stdin.readline n=int(input()) s=input() def solve(): for i in range(1,n): if (ans[i]=="S" and s[i]=="o") or (ans[i]=="W" and s[i]=="x"): ans[i+1]=ans[i-1] else: if ans[i-1]=="S": ans[i+1]="W" else: ans[i+1]="S...
s815536637
p03798
u989345508
1579034816
Python
Python (3.4.3)
py
Runtime Error
656
3540
1144
n=int(input()) s=input() x=["SS","SW","WS","WW"] def check(i,j): if j==0: l=0 else: l=1 if x[i][l]=="S": if s[l]=="o": if x[i][l-1]=="S": return x[i][l+1]=="S" else: return x[i][l+1]=="W" else: if x[i][-1]==...
s026682590
p03798
u989345508
1579034766
Python
Python (3.4.3)
py
Runtime Error
648
3608
1146
n=int(input()) s=input() x=["SS","SW","WS","WW"] def check(i,j): if j==0: l=0 else: l=1 if x[i][l]=="S": if s[l]=="o": if x[i][l-1]=="S": return x[i][l+1]=="S" else: return x[i][l+1]=="W" else: if x[i][-1]==...
s076835204
p03798
u314089899
1577330946
Python
Python (3.4.3)
py
Runtime Error
104
9212
1553
#55d from functools import lru_cache N = int(input()) s = list(input()) #深さ優先探索 def dfs(ans_list): if len(ans_list) == N: if ((is_contradiction(ans_list[-2],ans_list[-1],ans_list[0],s[-1]) == 0) and (is_contradiction(ans_list[-1],ans_list[0],ans_list[1],s[0]) == 0)): return ans_lis...
s129561767
p03798
u768896740
1575141995
Python
Python (3.4.3)
py
Runtime Error
80
4148
2062
n = int(input()) s = input() def print_animal(): for k in animal_list: print(k, end='') exit() def checker(animal): # print(animal_list) global position position += 1 # print(s[position]) if position != n-1: if s[position] == 'o' and animal == 'S' and animal_list[position...
s274367524
p03798
u768896740
1575140865
Python
Python (3.4.3)
py
Runtime Error
82
4152
2011
n = int(input()) s = input() def print_animal(): for k in animal_list: print(k, end='') exit() def checker(animal): global position position += 1 if position != n-1: if s[position] == 'o' and animal == 'S' and animal_list[position-1] == 'S': animal_list.append('S') ...