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
s901040163
p03946
u984351908
1478907466
Python
Python (3.4.3)
py
Runtime Error
22
3064
299
n, t = list(map(int, input().split())) a = list(map(int, input().split())) c = 0 max_dif = 0 for i in range(n): for j in range(i + 1, n): if a[j] - a[i] > max_dif: c = 1 max_dif = a[j] - a[i] elif: a[j] - a[i] == max_dif: c += 1 print(str(c))
s047995425
p03946
u984351908
1478907238
Python
Python (3.4.3)
py
Runtime Error
22
3064
294
n, t = list(map(int, input().split())) a = list(map(int, input().split())) c = 0 max_dif = 0 for i in range(n): for j in range(i + 1, n): if a[j] - a[i] > max_dif: c = 1 max_dif = a[j] - a[i] elif: a[j] - a[i] == max_dif: c += 1 print(c)
s277035284
p03946
u984351908
1478907129
Python
Python (3.4.3)
py
Runtime Error
23
3064
290
n, t = list(map(int, input().split())) a = list(map(int, input().split())) c = 0 max_dif = 0 for i in range(n): for j in range(i, n): if a[j] - a[i] > max_dif: c = 1 max_dif = a[j] - a[i] elif: a[j] - a[i] == max_dif: c += 1 print(c)
s248777598
p03946
u123756661
1478492441
Python
Python (2.7.6)
py
Runtime Error
16
2568
181
IS=float('inf') x=IS y=0 for i in a: if x>i: x=i elif y<i: y=i if i-x>chk: ans=1 elif i-x==chk: ans+=1 chk=max(chk,i-x) print ans
s349058884
p03946
u272496669
1478488094
Python
Python (3.4.3)
py
Runtime Error
22
3064
397
list1 = input().split() n = int(list1[0]) t = int(list1[1]) a = input().split() list = [] l = 0 i = 0 while l < n: i = l + 1 if i == n: list.append(int(a[i-1])-int(a[l])) break else: while i < n: if a[i-1]<a[i]: i += 1 else: list.append(in...
s546545703
p03946
u731028462
1478486518
Python
Python (3.4.2)
py
Runtime Error
22
3064
298
INF = 1000000 n, m = list(map(int, input().split())) a = list(map(int, input().split())) + [0] b = a[0] arr = [] for i in range(1, n+1): if a[i - 1] > a[i]: x = a[i - 1] - b arr += [x] if x != 0 else [] b = a[i] mx = max(arr)g ans = min(arr.count(mx),m//2) print(ans)
s297569772
p03947
u863370423
1596657239
Python
PyPy3 (7.3.0)
py
Runtime Error
88
74588
195
#include <bits/stdc++.h> using namespace std; string s; int main() { ios::sync_with_stdio(false); cin >> s; cout << unique(s.begin(), s.end()) - s.begin() - 1 << endl; return 0; }
s311793120
p03947
u417014669
1577108580
Python
Python (3.4.3)
py
Runtime Error
17
2940
79
s=input() cnt=0 for i range(1,len(s)): if s[i]!=s[i-1]: cnt+=1 print(cnt)
s844940486
p03947
u374802266
1563249829
Python
Python (3.4.3)
py
Runtime Error
64
3188
115
a=input() n,b=0,0 while True: if a[n]!=a[n+1]: b+=1 n+=1 if n+1==len(a): break print(b)
s230596724
p03947
u118642796
1554221735
Python
Python (3.4.3)
py
Runtime Error
18
2940
58
S = input() print(sum([a!=b for a,b in zip(S[:-1],S[1:])])
s198306270
p03947
u485137520
1549054895
Python
Python (3.4.3)
py
Runtime Error
18
2940
177
s_long = input() count = 0 prev = '' for s in s_long: if prev == '' prev = s continue if prev != s: count += 1 prev = s print(count)
s958159862
p03947
u329865314
1524345718
Python
Python (3.4.3)
py
Runtime Error
17
3188
83
s=input() ans = 0 for I in range(len(s)-1): if s[i]!=s[i+1]: ans += 1 print(ans)
s336742521
p03947
u272028993
1497744859
Python
PyPy2 (5.6.0)
py
Runtime Error
40
29420
1116
import sys sys.setrecursionlimit(10**8) class Segtree(): INT_MIN=-10**9 def __init__(self,size): self.size=1 while self.size<size: self.size=self.size*2 self.node=[self.INT_MIN]*(2*self.size-1) def update(self,k,a): k+=self.size-1 self.node[k]=a ...
s522272279
p03947
u620868411
1479616843
Python
Python (2.7.6)
py
Runtime Error
43
3972
1040
import unittest class TestFunc(unittest.TestCase): def test_1(self): self.assertEqual(fun(5,8,[50,30,40,10,20]),2) self.assertEqual(fun(3,2,[100,50,200]),1) self.assertEqual(fun(10,100,[7,10,4,5,9,3,6,8,2,1]),2) self.assertEqual(fun(5,2,[1,2,3,2,4]),1) def fun(n,t,a): aa = ...
s776488975
p03947
u382423941
1478980875
Python
Python (3.4.3)
py
Runtime Error
23
3064
128
s = open('input', 'r').read() prev = s[0] ans = 0 for c in s: if c != prev: ans += 1 prev = c print(ans-1)
s995235276
p03947
u943885161
1478926258
Python
Python (2.7.6)
py
Runtime Error
17
2568
107
s = raw_input() cnt = 0 last last = s[0] for c in s[1:end]: if c ! last cnt = cnt+1 last = c print cnt
s967565909
p03947
u972416428
1478572700
Python
Python (2.7.6)
py
Runtime Error
18
2944
91
inp = input().strip() print len( [ i for i in range( len(inp)-1 ) if inp[i] != inp[i+1] ] )
s993069444
p03947
u972416428
1478572663
Python
Python (2.7.6)
py
Runtime Error
16
2568
89
inp = input().strip() print len( [ for i in range( len(inp)-1 ) if inp[i] != inp[i+1] ] )
s728159169
p03947
u326569562
1478488603
Python
Python (2.7.6)
py
Runtime Error
18
3076
1961
def main(): N = input() edges = [raw_input() for _ in range(N-1)] K = input() VP = [raw_input() for _ in range(K)] VP = [map(int, _.strip().split()) for _ in VP] edges = [map(int, _.strip().split()) for _ in edges] # print VP # print edges scores = {} for n_idx, value in VP: ...
s472944684
p03947
u232757112
1478487360
Python
Python (3.4.3)
py
Runtime Error
23
3444
1337
from sys import stdin input = stdin.readline N,T = map(int,input().split()) prices = list(map(int,input().split())) last = 10000000000 highestTally = [prices[-1]] highestCount = [1] for price in prices[-2:-N-1:-1]: if price==highestTally[-1]: highestCount.append(highestCount[-1]+1) else: highes...
s775105370
p03947
u232757112
1478487312
Python
Python (3.4.3)
py
Runtime Error
24
3444
1337
from sys import stdin input = stdin.readline N,T = map(int,input().split()) prices = list(map(int,input().split())) last = 10000000000 highestTally = [prices[-1]] highestCount = [1] for price in prices[-2:-N-1:-1]: if price==highestTally[-1]: highestCount.append(highestCount[-1]+1) else: highes...
s266914761
p03947
u232757112
1478485832
Python
Python (3.4.3)
py
Runtime Error
24
3316
820
from sys import stdin input = stdin.readline N,T = map(int,input().split()) prices = list(map(int,input().split())) last = 10000000000 highestTally = [prices[-1]] for price in prices[-2:-N-1:-1]: highestTally.append(max(highestTally[-1],price)) highestTally.reverse() biggestJump=0 sellingPriceForBiggestJump=0 coun...
s884839353
p03947
u765237551
1478484204
Python
Python (3.4.3)
py
Runtime Error
226
101176
116
def solve(s): if len(s)<=1: return 0 return (s[0]!=s[1]) + solve(s[1:]) S = input() print(solve(S))
s763590742
p03948
u918935103
1563307392
Python
Python (3.4.3)
py
Runtime Error
82
14676
283
n,t = map(int,input().split()) a = list(map(int,input().split())) l = [] count = 0 for i in range(n-1): if a[i] <= a[i+1]: count = count + a[i+1] - a[i] else: l.append(count) count = 0 l.append(count) l.remove(0) d = max(l) ans = l.count(d) print(ans)
s076004768
p03948
u422104747
1530912824
Python
Python (3.4.3)
py
Runtime Error
17
3060
163
s=input().split() l=[] for i in range(1,len(s)): l.append(int(s[i])-int(s[i-1])) l.sort() m=l[-1] for i in range(2,len(s)+1): if l[-i]!=m: break print(i-1)
s057137301
p03948
u639989198
1480826235
Python
Python (3.4.3)
py
Runtime Error
308
32312
105
from numpy import * input() a=array(input().split()) d=a-minimum.accumulate(a) print((d==d.max()).sum())
s571183108
p03948
u382423941
1478982224
Python
Python (3.4.3)
py
Runtime Error
22
3064
283
n, t = map(int, input().split())) A = list(map(int, input().split())) ans = 0 max_diff = 0 min_a = A[0] for a in A: min_a = min(min_a, a) if (a - min_a) == max_diff: ans += 1 elif (a - min_a) > max_diff: ans = 1 max_diff = (a - min_a) print(ans)
s115458010
p03948
u281372625
1478489431
Python
Python (2.7.6)
py
Runtime Error
64
11304
394
N, T = map(int, raw_input().split()) A_n = map(int, raw_input().split()) min_element = min(A_n[0], A_n[1]) for i in xrange(1, len(A_n)): if A_n[i] - min_element > max_profit: max_profit = A_n[i] - min_element if A_n[i] < min_element: min_element = A_n[i] count = 0 for j in xrange(0, len(A_n)):...
s098371544
p03948
u326569562
1478488824
Python
Python (2.7.6)
py
Runtime Error
17
2816
1685
def main(): N = input() edges = [raw_input() for _ in range(N-1)] K = input() VP = [raw_input() for _ in range(K)] VP = [map(int, _.strip().split()) for _ in VP] edges = [map(int, _.strip().split()) for _ in edges] # print VP # print edges scores = {} for n_idx, value in VP: ...
s308661710
p03949
u340781749
1599539115
Python
Python (3.8.2)
py
Runtime Error
521
77368
1311
import sys def dfs(v, parent, odd): hi = INF lo = -INF if fixed[v] != INF: if odd_even[v] != odd: print('No') exit() hi = lo = fixed[v] for u in links[v]: if u == parent: continue chi, clo = dfs(u, v, odd ^ 1) if hi < clo or c...
s036026214
p03949
u754022296
1592461752
Python
Python (3.4.3)
py
Runtime Error
339
36476
985
import sys input = sys.stdin.readline sys.setrecursionlimit(10**7) n = int(input()) T = [[] for _ in range(n+1)] for _ in range(n-1): a, b = map(int, input().split()) T[a].append(b) T[b].append(a) k = int(input()) VP = tuple(tuple(map(int, input().split())) for _ in range(k)) P = [-1]*(n+1) A = [-1]*(n+1) r, c =...
s948308343
p03949
u828766688
1587737736
Python
Python (3.4.3)
py
Runtime Error
1311
32272
1919
""" Writer: SPD_9X2 https://atcoder.jp/contests/arc063/tasks/arc063_c 数字が置かれている頂点は範囲指定の制約になる →制約をすべての点に伝播させれば、後はその範囲内から適当に選んで実装すればよい 一度根方向に制約を集め、それを全方位に伝播させればよい? →それっぽさそう 偶奇に関してはちゃんと考えてね →条件の両端の偶奇で判断可能 """ import sys N = int(input()) lis = [ [] for i in range(N) ] for i in range(N-1): a,b = map(int,input()...
s222115755
p03949
u543954314
1571245295
Python
Python (3.4.3)
py
Runtime Error
1357
40828
1352
import sys sys.setrecursionlimit = 10**6 n = int(input()) tr = [list() for _ in range(n)] num = [None]*n ran = [0]*n dep = [0]*n for _ in range(n-1): a,b = map(int,input().split()) a -= 1; b -= 1 tr[a].append(b) tr[b].append(a) k = int(input()) root,c = map(int,input().split()) root -= 1 num[root] = c def dfs...
s913682422
p03949
u543954314
1571244240
Python
Python (3.4.3)
py
Runtime Error
1250
40348
1365
import sys sys.setrecursionlimit = 10**8 n = int(input()) tr = [list() for _ in range(n)] num = [None]*n ran = [0]*n par = [-1]*n dep = [0]*n for _ in range(n-1): a,b = map(int,input().split()) a -= 1; b -= 1 tr[a].append(b) tr[b].append(a) k = int(input()) root,c = map(int,input().split()) root -= 1 num[root...
s469845431
p03949
u543954314
1571244170
Python
Python (3.4.3)
py
Runtime Error
1211
40352
1365
import sys sys.setrecursionlimit = 10**6 n = int(input()) tr = [list() for _ in range(n)] num = [None]*n ran = [0]*n par = [-1]*n dep = [0]*n for _ in range(n-1): a,b = map(int,input().split()) a -= 1; b -= 1 tr[a].append(b) tr[b].append(a) k = int(input()) root,c = map(int,input().split()) root -= 1 num[root...
s658933141
p03949
u777923818
1548916238
Python
Python (3.4.3)
py
Runtime Error
1323
44360
1394
from collections import deque def inpl(): return list(map(int, input().split())) N = int(input()) G = [[] for _ in range(N+1)] X = [-1 for _ in range(N+1)] # is odd U = [1e7 for _ in range(N+1)] L = [-1e7 for _ in range(N+1)] for _ in range(N-1): a, b = inpl() G[a].append(b) G[b].append(a) K = int(input...
s008015488
p03949
u777923818
1548915922
Python
Python (3.4.3)
py
Runtime Error
1232
44232
1358
from collections import deque def inpl(): return list(map(int, input().split())) N = int(input()) G = [[] for _ in range(N+1)] X = [-1 for _ in range(N+1)] # is odd U = [1e7 for _ in range(N+1)] L = [-1e7 for _ in range(N+1)] for _ in range(N-1): a, b = inpl() G[a].append(b) G[b].append(a) K = int(input...
s603171165
p03949
u924339359
1537388310
Python
Python (3.4.3)
py
Runtime Error
17
2940
1243
#include<bits/stdc++.h> using namespace std; typedef long long ll; typedef pair<int,int> P; const ll INF=1000000010; const ll MOD=1000000007; int v[100010],p[100010],lb[100010],ub[100010]; vector<int> G[100010]; bool f=false; int n; void dfs(int i,int pre,int l,int r){//(頂点、前の頂点、ありうるmin、ありうるmax) if(p[i]!=-1){ if(p[i...
s067850956
p03949
u226155577
1518387242
Python
Python (3.4.3)
py
Runtime Error
2107
37840
830
N = int(input()) G = [[] for i in range(N)] for i in range(N-1): A, B = map(int, input().split()) G[A-1].append(B-1) G[B-1].append(A-1) M = {} K = int(input()) for i in range(K): V, P = map(int, input().split()) M[V-1] = P memo = [0]*N def dfs(v, p, x, y): if v in M: x = y = M[v] x0 ...
s779218434
p03949
u280667879
1500255491
Python
Python (2.7.6)
py
Runtime Error
2110
63224
507
from scipy.sparse import* g=[] n=int(raw_input()) for _ in xrange(n-1): a,b=map(int,raw_input().split()) g+=[(a-1,b-1,1)] z=[-1]*n for _ in xrange(int(raw_input())): a,b=map(int,raw_input().split()) g+=[(n,a-1,b)] z[a-1]=b a,b,c=zip(*g) a=map(int,csgraph.dijkstra(csr_matrix((c,(a,b)),[n+1]*2),0,n)) for i in xrange...
s316229081
p03949
u280667879
1478557428
Python
Python (3.4.3)
py
Runtime Error
24
3068
604
from heapq import* R=range;I=lambda:map(int,input().split());n=int(input());g=[[]for _ in R(n+1)];z=[-1]*n;d=[1e9]*n+[0];q=[-1]*(n+1);r=;Q=[];heappush(Q,(0,-2,n)) for _ in R(n-1):a,b=I();a-=1;b-=1;g[a]+=[(1,a,b)];g[b]+=[(1,b,a)] for _ in R(*I()):a,b=I();a-=1;g[n]+=[(b,n,a)];z[a]=b while Q: e=heappop(Q) if q[e[2]]!=-1...
s762679236
p03949
u280667879
1478555498
Python
Python (3.4.3)
py
Runtime Error
56
10332
887
#!/usr/bin/python def shortestPath(g,s,dist,prev): n = len(g)-1 Q=[] heapq.heappush(Q,(0,-2,s)) while Q: e = heapq.heappop(Q) if prev[e[2]]!=-1: continue prev[e[2]] = e[1] for f in g[e[2]]: if dist[f[2]] > e[0] + f[0]: dist[f[2]] = e[0] + f[0] heapq.heappush(Q,(e[0]+f[0],f[1],f[2])) import sys,h...
s730656804
p03949
u132291455
1478495988
Python
PyPy2 (5.6.0)
py
Runtime Error
343
54428
545
import sys import heapq o=lambda:map(int,raw_input().split()) n=int(raw_input()) e=[[] for _ in range(n+1)] for _ in range(n-1):a,b=o();e[a]+=[(b,1)];e[b]+=[(a,1)] k=int(raw_input()) for _ in range(k):v,p=o();e[v]+=[(0,p)];e[0]+=[(v,p)] vis=[False]*n q=[(0,0)] heapq.heapify(q) while len(q): c,v=heapq.heappop(q) ...
s722927293
p03949
u132291455
1478495880
Python
PyPy2 (5.6.0)
py
Runtime Error
341
54428
603
import sys import heapq sys.setrecursionlimit(200000) o=lambda:map(int,raw_input().split()) n=int(raw_input()) e=[[] for _ in range(n+1)] for _ in range(n-1): a,b=o() e[a]+=[(b,1)];e[b]+=[(a,1)] k=int(raw_input()) for _ in range(k): v,p=o() e[v]+=[(0,p)];e[0]+=[(v,p)] vis=[False]*n q=[(0,0)] heapq.heapi...
s239992455
p03949
u132291455
1478495867
Python
Python (2.7.6)
py
Runtime Error
1005
58260
603
import sys import heapq sys.setrecursionlimit(200000) o=lambda:map(int,raw_input().split()) n=int(raw_input()) e=[[] for _ in range(n+1)] for _ in range(n-1): a,b=o() e[a]+=[(b,1)];e[b]+=[(a,1)] k=int(raw_input()) for _ in range(k): v,p=o() e[v]+=[(0,p)];e[0]+=[(v,p)] vis=[False]*n q=[(0,0)] heapq.heapi...
s884875268
p03949
u132291455
1478488441
Python
PyPy2 (5.6.0)
py
Runtime Error
36
8944
921
import sys sys.setrecursionlimit(200000) o=lambda:map(int,raw_input().split()) n=int(raw_input()) e=[[] for _ in range(n)] for _ in range(n-1): a,b=o() e[a-1]+=[b-1];e[b-1]+=[a-1] k=int(raw_input()) INF=float('inf') r=[(-INF,INF)for _ in range(n)] for _ in range(k): v,p=o() r[v-1]=(p,p) vis=[False]*n de...
s474064392
p03949
u132291455
1478488352
Python
PyPy2 (5.6.0)
py
Runtime Error
37
9072
897
import sys sys.setrecursionlimit(200000) o=lambda:map(int,raw_input().split()) n=int(raw_input()) e=[[] for _ in range(n)] for _ in range(n-1): a,b=o() e[a-1]+=[b-1];e[b-1]+=[a-1] k=int(raw_input()) INF=float('inf') r=[(-INF,INF)for _ in range(n)] for _ in range(k): v,p=o() r[v-1]=(p,p) vis=[False]*n de...
s568178122
p03950
u326569562
1478488815
Python
Python (2.7.6)
py
Runtime Error
17
2824
1685
def main(): N = input() edges = [raw_input() for _ in range(N-1)] K = input() VP = [raw_input() for _ in range(K)] VP = [map(int, _.strip().split()) for _ in VP] edges = [map(int, _.strip().split()) for _ in edges] # print VP # print edges scores = {} for n_idx, value in VP: ...
s325994561
p03951
u306412379
1599692493
Python
Python (3.8.2)
py
Runtime Error
25
9140
110
n = int(input()) s = input() t = input() for i in range(n): if t.startswith(s[i:]): x = n + i print(x)
s078914067
p03951
u697690147
1596771764
Python
Python (3.8.2)
py
Runtime Error
20
8872
355
if (n == len(s) and (s == t)): print(n) else: ind = [0] for i in range(1, len(s)): if s[-i:] == t[:i]: ind.append(i) ind.reverse() for i in ind: if i == 0: print(2*n) else: res = s[0:-i] + t if len(res) >= n: pr...
s874299402
p03951
u137228327
1596686392
Python
Python (3.8.2)
py
Runtime Error
26
9128
133
n=int(input()) s=input() t=input() for i in range(n,2*n-1): if s[:2*n-i] == t[2*n-i]: print(i) exit() print(2*n)
s587706928
p03951
u167906550
1596472080
Python
PyPy3 (7.3.0)
py
Runtime Error
85
68772
117
n=input() s=raw_input() t=raw_input() for i in xrange(0, n + 1): if s[i : n] == t[0 : n - i]: print n + i break
s645046340
p03951
u167906550
1596472051
Python
Python (3.8.2)
py
Runtime Error
25
8976
117
n=input() s=raw_input() t=raw_input() for i in xrange(0, n + 1): if s[i : n] == t[0 : n - i]: print n + i break
s356735631
p03951
u933068010
1596195849
Python
PyPy3 (7.3.0)
py
Runtime Error
91
74636
9472
#include <bits/stdc++.h> using namespace std; typedef long long ll; #define pb(x) push_back(x) #define mp(a, b) make_pair(a, b) #define all(x) x.begin(), x.end() #define rall(x) x.rbegin(), x.rend() #define lscan(x) scanf("%I64d", &x) #define lprint(x) printf("%I64d", x) #define rep(i, n) for (int i = 0; i < n; i++) #d...
s910446263
p03951
u766566560
1593916704
Python
Python (3.8.2)
py
Runtime Error
25
9084
142
N = int(input()) s = input() t = input() if s[N-3] == t[0]: print(len(s[:N-3] + t)) elif s == t: print(len(s)) else: print(len(s + t))
s235338515
p03951
u766566560
1593661672
Python
Python (3.8.2)
py
Runtime Error
24
9136
201
N = int(input()) s = input() t = input() if s[N-1] == t[0]: if s[N-2] == t[1]: print(len(s[:N-2] + t)) exit() print(len(s[:N-1] + t)) elif s == t: print(len(s)) else: print(len(s + t))
s822592088
p03951
u350093546
1593658058
Python
Python (3.8.2)
py
Runtime Error
22
8940
103
n=int(input()) s=input() t=input() while True: if s==t: break s=s[1:] t=[:-1] n+=1 print(n)
s618530352
p03951
u699089116
1593481145
Python
PyPy3 (7.3.0)
py
Runtime Error
87
74804
144
n = int(input()) s = input() t = input() for i in range(n): if s[i:] == t[:n-i]: print(n + cnt) exit() else: print(n*2)
s256155000
p03951
u841021102
1593059600
Python
Python (3.8.2)
py
Runtime Error
27
8964
187
n = int(input()) s = input() t = input() answer = n for i in range (n + 1) : if answer == n : newstring = s[0:i] + t[:n] if newstring[0:n] == s : answer += i print (answer)
s913441679
p03951
u841021102
1593059521
Python
Python (3.8.2)
py
Runtime Error
26
8892
185
n = int(input()) s = input() t = input() answer = n for i in range (n + 1) : if answer == n : newstring = s[0:i] + t[:n] if newstring[0:n] == s : answer += i print (answer)
s663098902
p03951
u841021102
1593052321
Python
Python (3.8.2)
py
Runtime Error
24
9020
152
s = input() t = input() s1 = [] t1 = [] for i in range(0 , n): s1.append(s[i]) for i in range(0 , n): t1.append(t[i]) a = set(s1 + t1) print(len(a))
s043013257
p03951
u290187182
1592089343
Python
PyPy3 (2.4.0)
py
Runtime Error
259
62572
481
import sys import copy import math import bisect import pprint import bisect from functools import reduce from copy import deepcopy from collections import deque from decimal import * import numpy as np import math if __name__ == '__main__': n = int(input()) s =input() t = input() count = 2*n fo...
s614806799
p03951
u391819434
1591645917
Python
Python (3.4.3)
py
Runtime Error
17
3064
268
N=int(input()) S=input() T=input() ans=S+T while ans[-N:]==T: recover=ans if ans[N-1]==ans[N]: ans=ans[:N]+ans[N+1:] else: recover=ans break if S in T: print(len(T)) elif T in S: print(len(S)) else: print(len(recover))
s787783550
p03951
u408375121
1589487546
Python
Python (3.4.3)
py
Runtime Error
17
3060
193
n = int(input()) s = input() t = input() for i in range(n): cnt = 0 for j in range(i, n): if s[j] != t[j-i]: break cnt += 1 if cnt == n-i: ans = n+i break print(ans)
s585000632
p03951
u408375121
1589486965
Python
Python (3.4.3)
py
Runtime Error
18
3188
119
n = int(input()) s = input() t = input() for i in range(n): if s[i:] == t[:n-i]: ans = n + i break print(ans)
s522220974
p03951
u335793707
1588371377
Python
Python (3.4.3)
py
Runtime Error
17
2940
179
n = int(input()) s = input() t = input() if s == t: print(n) return r = 0 for i in range(0, n): if s[-(i + 1)] != t[i]: break r += 1 print((n * 2) - r)
s504822576
p03951
u114641312
1587927628
Python
Python (3.4.3)
py
Runtime Error
17
2940
1012
# from math import factorial,sqrt,ceil,gcd # from itertools import permutations as permus # from collections import deque,Counter # import re # from functools import lru_cache # 簡単メモ化 @lru_cache(maxsize=1000) # from decimal import Decimal, getcontext # # getcontext().prec = 1000 # # eps = Decimal(10) ** (-100) # impor...
s341832489
p03951
u797550216
1586919577
Python
PyPy3 (2.4.0)
py
Runtime Error
167
38256
129
import sys n = int(input()) s = input() t = input() for i in range(n): if s[i:] == t[:n-i]: print(n+i) exit() print(2*n)
s752395277
p03951
u606523772
1586910483
Python
Python (3.4.3)
py
Runtime Error
18
3060
202
N = int(input()) s = list(input()) t = list(input()) cnt = 0 if s==t: ans = N elif N==1: ans = N*2 else: for i in range(N): if s[i:]==t[:-i]: ans = N*2 - (N-i) print(ans)
s757893287
p03951
u606523772
1586910163
Python
Python (3.4.3)
py
Runtime Error
17
3060
177
N = int(input()) s = list(input()) t = list(input()) cnt = 0 if s==t: ans = N else: for i in range(N): if s[i:]==t[:-i]: ans = N*2 - (N-i) print(ans)
s251677703
p03951
u942123514
1581542743
Python
Python (3.4.3)
py
Runtime Error
18
3060
96
n=int(input())*2 s=input() t=input() a=0 b=-1 while s[b] == t[a]: a=a+1 b=b-1 print(n-a)
s427020087
p03951
u423585790
1578078643
Python
PyPy3 (2.4.0)
py
Runtime Error
180
38512
1137
#!/usr/bin/env python3 from collections import defaultdict,deque from heapq import heappush, heappop from bisect import bisect_left, bisect_right import sys, random, itertools, math sys.setrecursionlimit(10**5) input = sys.stdin.readline sqrt = math.sqrt def LI(): return list(map(int, input().split())) def LF(): return...
s333311076
p03951
u102960641
1577347197
Python
Python (3.4.3)
py
Runtime Error
17
2940
119
n,x = map(int, input().split()) if n != x: print("No") else: print("Yes") for i in range(1, 2 * n): print(i)
s063972639
p03951
u094191970
1576009079
Python
Python (3.4.3)
py
Runtime Error
17
2940
101
n=int(input()) s=input() t=input() for i in range(n): if s[-i-1:]==t[:i+1]: cnt=i+1 print(2*n-cnt)
s039342403
p03951
u066455063
1575772904
Python
Python (3.4.3)
py
Runtime Error
17
2940
249
N = int(input()) s = input() t = input() ans = 0 if s == t: print(N) exit() else: s = input()[::-1] for i in range(N): if s[i] != t[i]: ans += len(s) ans += len(t[i:]) break print(ans)
s961827445
p03951
u595893956
1575516782
Python
Python (3.4.3)
py
Runtime Error
17
2940
172
import sys n=int(input()) s=input() t=input() if s == t: print len(s) sys.exit() for i in range(1,n): tmp=s+t[-1*i:] if tmp[-n:] == t: print n+i sys.exit()
s937296848
p03951
u623687794
1573136931
Python
Python (3.4.3)
py
Runtime Error
18
3064
270
n,x=map(int,input().split()) if x==1 or x==2*n-1:print("No") else: print("Yes") b=[0]*n b[n//2]=x b[n//2-1]=x-1 b[n//2+1]=x+1 tor=[i+1 for i in range(n)] del tor[x-2:x+1] for i in range(n): if b[i]==0: b[i]=tor.pop() for i in b: print(i)
s139094928
p03951
u623687794
1573136765
Python
Python (3.4.3)
py
Runtime Error
18
3064
279
n,x=map(int,input().split()) if x==1 or x==n:print("No") else: print("Yes") b=[0]*n b[n//2]=x b[n//2-1]=x-1 b[n//2+1]=x+1 tor=[i+1 for i in range(n)] del tor[x-2:x+1] print(tor) for i in range(n): if b[i]==0: b[i]=tor.pop() for i in b: print(i)
s395470752
p03951
u889344512
1565372625
Python
PyPy3 (2.4.0)
py
Runtime Error
178
38640
131
n=int(input()) s=input() t=input() count=0 for i in range(n): if s[n-1-i:n]==t[0:i+1]: count+=i+1 break print(2×n-count)
s682025145
p03951
u889344512
1565371998
Python
PyPy3 (2.4.0)
py
Runtime Error
168
38256
131
n=int(input()) s=input() t=input() count=0 for i in range(n): if s[n-1-i]==t[i]: count+=1 else: break print(2×n-count)
s984575618
p03951
u539517139
1562073482
Python
Python (3.4.3)
py
Runtime Error
17
2940
112
n=int(input()) s=input() t=input() for i in range(n): if s[i:]==t[:n-i]: l=n+i break print(min(n*2,l))
s096524939
p03951
u196697332
1559860298
Python
Python (3.4.3)
py
Runtime Error
18
2940
201
N = int(input()) s = str(input()) t = str(input()) word = s + t for i in range(N): if word[len(s) - 1] == word[len(s)] and : s = s[:N - 1] word = s + t print(len(word))
s380283806
p03951
u196697332
1559859993
Python
Python (3.4.3)
py
Runtime Error
17
3064
323
import sys N = int(input()) s = str(input()) t = str(input()) word = s + t for letter in s: if letter not in letter_list: letter_list.append(letter) for letter in t: if letter not in list(letter_dict.keys()): letter_dict[letter] = 1 if s == t: print(N) sys.exit() else: print(len(letter_dic...
s780896686
p03951
u196697332
1559859950
Python
Python (3.4.3)
py
Runtime Error
18
3060
316
import sys N = int(input()) s = str(input()) t = str(input()) word = s + t if s == t: print(N) sys.exit() for letter in s: if letter not in letter_list: letter_list.append(letter) for letter in t: if letter not in list(letter_dict.keys()): letter_dict[letter] = 1 print(len(letter_dict))
s269342378
p03951
u196697332
1559859918
Python
Python (3.4.3)
py
Runtime Error
18
3060
292
N = int(input()) s = str(input()) t = str(input()) word = s + t if s == t: print(N) for letter in s: if letter not in letter_list: letter_list.append(letter) for letter in t: if letter not in list(letter_dict.keys()): letter_dict[letter] = 1 print(len(letter_dict))
s190946866
p03951
u513900925
1555132247
Python
Python (3.4.3)
py
Runtime Error
17
3060
158
N = input() N =int(N) s = input() t = input() for i in range(N): q = s[-(i+1):] r = t[:i+1] if q == r : x = q y =i+1 print(N*2-y)
s536441237
p03951
u565204025
1555132218
Python
Python (3.4.3)
py
Runtime Error
21
3060
358
# -*- coding: utf-8 -*- n = int(input()) s = list(input()) t = list(input()) for i in range(n): match = True for j in range(n): if i + j < n: if s[i + j] != t[j]: match = False if match: if i == 0: print(n) else: print(n + i) ...
s216014610
p03951
u513900925
1555131983
Python
Python (3.4.3)
py
Runtime Error
17
3060
162
N = input() N =int(N) s = input() t = input() for i in range(N): q = s[-(i+1):] r = t[:i+1] if q == r : x = q y =i+1 print(s[:N-y]+t)
s384583680
p03951
u367130284
1553724601
Python
Python (3.4.3)
py
Runtime Error
17
2940
93
input();s=input();t=input();print(2*len(s)-max([i for i in range(n+1)if s[-i:]==t[:i]]or[0]))
s580729007
p03951
u887207211
1552534582
Python
Python (3.4.3)
py
Runtime Error
17
2940
127
N = int(input()) S = input() T = input() for i in range(N, 0, -1): if(S[-i:] == T[:i]): tmp = i break print(N*2-tmp)
s508306252
p03951
u741397536
1552010819
Python
Python (3.4.3)
py
Runtime Error
17
2940
208
N = int(input()) s = input() t = input() count = 0 for i in range(len(s)): if t[i] == s[-i-1]: count += 1 else: break if s = t: print(len(s)) else: print(len(s)+len(t)-count)
s167027693
p03951
u023229441
1550982711
Python
Python (3.4.3)
py
Runtime Error
17
2940
153
n=int(input()) A=input() B=input() s=0 ans=2*n for i in range(n) if A[-i-1:]!=B[:i+1]: s=1 print(ans) exit() else: ans-=1 print(ans)
s585793907
p03951
u371467115
1546038123
Python
Python (3.4.3)
py
Runtime Error
2103
3060
154
n=int(input()) s=[input() for i in range(n)] t=[input() for j in range(n)] s.reverse() l=0 for k in range(n): while s[k]==t[k]: l+=1 print(l)
s671527802
p03951
u853900545
1542822284
Python
Python (3.4.3)
py
Runtime Error
17
2940
157
n = int(input()) s = input() t = input() c == 1 for i in range(n): if s[n-i:n] == t[0:i+1]: print(i+1) c = 0 break if c == 1: print(0)
s950060498
p03951
u030726788
1521598018
Python
Python (3.4.3)
py
Runtime Error
17
2940
117
n=int(input()) s=input() t=input() for i in range(n): if(t[i]==s[-(i+1)]): t=t[1:] else:break print(n+len(t))
s357320048
p03951
u986399983
1490053349
Python
Python (3.4.3)
py
Runtime Error
17
2940
139
N = int(input()) s = input() l = input() for i in range(1,N): if s[-i:]!=l[:i]: a=2*N-i+1 break print(a if s!=l else N)
s874634704
p03951
u272496669
1477803427
Python
Python (3.4.3)
py
Runtime Error
23
3064
83
n = int(input()) s = str(input()) t = str(input()) i = 0 while t.find(s[i,n])>-1:
s206051932
p03951
u820351940
1477801483
Python
Python (3.4.3)
py
Runtime Error
23
3064
273
N, K = map(int, input().split()) m = 2 * N - 1 if 2 <= K < m: mid = list((3, 2, 1) if K == 2 else (K - 1, K, K + 1, K - 2)) a = list(set(range(1, m + 1)) - set(mid)) print("Yes\n" + "\n".join(map(str, a[:m//2 - 1] + mid + a[m//2 - 1:]))) else: print("No")
s273111243
p03951
u582243208
1477798868
Python
Python (3.4.3)
py
Runtime Error
22
3064
257
n=int(input()) s=input() t=input() if s==t: print(n) else: ans=2*n f=False for i in range(n): for j range(i+1): if t[j]!=s[n-1-i+j]: f=True if not f: break ans-=1 print(ans)
s236923514
p03951
u765237551
1477796684
Python
Python (3.4.3)
py
Runtime Error
23
3064
411
N, x = map(int, input().split()) if x==1 or x==2*N-1: print('No') else: print('Yes') if x <= 2*N: y = list(i for i in range(2, 2*N-2) if i!=x) l = len(y)//2 print("\n".join(map(str, y[:l] + [2*N-1, x, 1, 2*N-2] + y[l:]))) else: y = list(i for i in range(3, 2*N-1) if i!=x)...