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
s186874284
p03761
u135346354
1592289194
Python
Python (3.4.3)
py
Runtime Error
18
3060
241
N = int(input()) S = [50]*26 for i in range(N): s = [0]*26 for item in input(): s[ord(item)-97] += 1 for i in range(26): S[i] = min(S[i], s[i]) ans = "" for i in range(N): ans += chr(97+i)*S[i] print(ans)
s582690404
p03761
u232733545
1592151012
Python
Python (3.4.3)
py
Runtime Error
20
3316
226
# from collections import Counter as cn d = int(input()) l = [] for k in range(d): r = input() l.append(Counter(r)) oi = l[0] for g in range(1,d): oi = oi & l[g] print("".join(sorted(oi.elements())))
s464394057
p03761
u232733545
1592149663
Python
Python (3.4.3)
py
Runtime Error
22
3316
265
# Hello World program in Python from collections import Counter as cn d = int (input()) l = [] for k in range(d): r = input() p = cn(r) l.append(p) oi = l[0] for g in range(1,n): oi = oi & l[g] print(oi) print("".join(sorted(oi.elements())))
s693989582
p03761
u232733545
1592149551
Python
Python (3.4.3)
py
Runtime Error
21
3316
263
# Hello World program in Python from collections import Counter as cn d = int (input()) l = [] for k in range(d): r = input() p = cn(r) l.append(p) oi = l[0] for g in range(n): oi = oi & l[g] print(oi) print("".join(sorted(oi.elements())))
s012862827
p03761
u085334230
1591244976
Python
Python (3.4.3)
py
Runtime Error
22
3316
512
import collections n = int(input()) s = [input() for i in range(n)] w = "" if n == 1: r = sorted(collections.Counter(s)) for k, v in r.items(): w += k * r[k] print(w) exit() a = collections.Counter(s[0]) b = collections.Counter(s[1]) res = a & b if n <= 2: for k in sorted(res): w += k * res[k] print(w) else: for i in s[2:]: res = res & collections.Counter(i) if not res: print("") for k in sorted(res): w += k * res[k] print(w)
s910081084
p03761
u085334230
1591244932
Python
Python (3.4.3)
py
Runtime Error
27
3316
514
import collections n = int(input()) s = [input() for i in range(n)] w = "" if n == 1: r = sorted(collections.Counter(s[0])) for k, v in r.items(): w += k * r[k] print(w) exit() a = collections.Counter(s[0]) b = collections.Counter(s[1]) res = a & b if n <= 2: for k in sorted(res): w += k * res[k] print(w) else: for i in s[2:]: res = res & collections.Counter(i) if not res: print("") for k in sorted(res): w += k * res[k] print(w)
s550400102
p03761
u085334230
1591244667
Python
Python (3.4.3)
py
Runtime Error
22
3316
387
import collections n = int(input()) s = [input() for i in range(n)] a = collections.Counter(s[0]) b = collections.Counter(s[1]) res = a & b w = "" if n <= 2: for k in sorted(res): w += k * res[k] print(w) else: for i in s[2:]: res = res & collections.Counter(i) if not res: print("") for k in sorted(res): w += k * res[k] print(w)
s428605354
p03761
u134019875
1590363307
Python
Python (3.4.3)
py
Runtime Error
22
3316
261
from collections import Counter n = int(input()) L = [Counter(str(input())) for _ in range(n)] ans = '' for k in L[0]: for i in range(1, n): m = L[0][k] if L[i][k] < L[0][k]: m = min(m, L[i][k]) ans = ans + k * m print(ans)
s780184655
p03761
u829249049
1590315446
Python
Python (3.4.3)
py
Runtime Error
19
3064
472
import sys n=int(input()) S=[] for i in range(n): s=list(input()) S+=[s] ANS=[] if n==1: ANS=S[0] ANS.sort() ans="".join(ANS) print(ans) sys.exit() for k in range(len(S[0])): if S[0][k] in S[1]: ANS+=[S[0][k]] S[1].remove(S[0][k]) for i in ANS: flag=0 rem=[] for k in range(2,n): if i in S[k]: S[k].remove(i) elif flag!=1: rem+=[i] flag=1 for i in rem: ANS.remove[i] ANS.sort() ans="".join(ANS) print(ans)
s530635021
p03761
u829249049
1590314244
Python
Python (3.4.3)
py
Runtime Error
18
3064
330
n=int(input()) S=[] for i in range(n): s=list(input()) S+=[s] ANS=[] for k in range(len(S[0])): if S[0][k] in S[1]: ANS+=[S[0][k]] S[1].remove(S[0][k]) for i in ANS: for k in range(2,n): if i in S[k]: S[k].remove(i) else: ANS.remove(i) break ANS.sort() ans="".join(ANS) print(ans)
s208857680
p03761
u829249049
1590313790
Python
Python (3.4.3)
py
Runtime Error
18
3064
324
n=int(input()) S=[] for i in range(n): s=list(input()) S+=[s] ANS=[] for k in range(len(S[0])): if S[0][k] in S[1]: ANS+=[S[0][k]] S[1].remove(S[0][k]) for i in ANS: for k in range(2,n): if i in S[k]: S[k].remove(i) else: ANS.remove(i) ANS.sort() ans="".join(ANS) print(ans)
s494158347
p03761
u496821919
1590006725
Python
Python (3.4.3)
py
Runtime Error
19
3064
385
from operator import itemgetter n = int(input()) data = [] s = input() data.append(s) S = set(list(s)) for i in range(n-1): s = input() S = S & set(list(s)) data.append(s) A = [] for i in S: ans = float("inf") for j in range(n-1): ans = min(ans,data[j].count(i)) A.append([i,ans]) A.sort(key=itemgetter(0)) s = "" for i in A: s += i[0]*i[1] print(s)
s905778394
p03761
u922449550
1589832339
Python
Python (3.4.3)
py
Runtime Error
18
3064
326
n = int(input()) alpha = list('abcdefghijklmnopqrstuvwxyz') num_s = dict(zip(alpha, [50]*len(alpha))) for i in range(n): S = input() d = dict(zip(alpha, [0]*len(alpha))) for s in S: d[s] += 1 for s in d: num_s[s] = min(num_s[s], d[s]) ans = '' for s in num_s: ans += s*num_s[0] print(''.join(sorted(ans)))
s220319765
p03761
u781262926
1589316755
Python
Python (3.4.3)
py
Runtime Error
26
3692
337
from collections import Counter from functools import reduce n, *S = open(0).read().split() keys = reduce(and_, map(set, S)) d = {c:10**6 for c in keys} for counter in map(Counter, S): for c in keys: if c in counter: d[c] = min(d[c], counter[c]) ans = '' for k, v in sorted(d.items()): ans += k * v print(ans)
s572780035
p03761
u366369712
1589309130
Python
Python (3.4.3)
py
Runtime Error
18
3064
438
n = int(input()) slist = [] for i in range(n): s = sorted(list(input())) slist.append(s) common = [s for s in slist[0]] for i in range(1,n): poplist = [] for j in range(len(common)): if common[j] in slist[i]: slist[i].remove(common[j]) else: poplist.append(j) for j in range(len(poplist)): common.pop(poplist[j]) #print(common) common.sort() print(''.join(common))
s915330312
p03761
u366369712
1589308857
Python
Python (3.4.3)
py
Runtime Error
19
3064
431
n = int(input()) slist = [] for i in range(n): s = sorted(list(input())) slist.append(s) common = [s for s in slist[0]] for i in range(1,n): poplist = [] for j in range(len(common)): if common[j] in slist[i]: slist[i].remove(common[j]) else: poplist.append(j) for j in range(len(poplist)): common.pop(poplist[j]) #print(common) print(''.join(common))
s936157199
p03761
u872538555
1588940844
Python
Python (3.4.3)
py
Runtime Error
17
2940
380
mport collections n = int(input()) d = collections.Counter(input()) for i in range(n - 1): words = collections.Counter(input()) for w in words.keys(): d[w] = min(words[w], d[w]) for w in d.keys(): d[w] = min(words[w], d[w]) ans = [] for char in d.keys(): for i in range(d[char]): ans.append(char) ans.sort() print(''.join(ans))
s944515603
p03761
u293198424
1588716619
Python
PyPy3 (2.4.0)
py
Runtime Error
186
39408
349
from collections import Counter n = int(input()) s = list(input()) ans1 = dict(Counter(s)) for i in range(n-1): ans = {} s = list(input()) ans2 = dict(Counter(s)) for j in ans2: if j in ans1: ans[j] = min(ans1[j],ans2[j]) st = [] sorted(ans) for i,j in zip(ans,ans.values()): st.append(i*j) print(''.join(st))
s768691151
p03761
u149991748
1588142799
Python
Python (3.4.3)
py
Runtime Error
18
3064
282
n = int(input()) s = [] for i in range(n): s.append(input()) ans = "" for i in range(len(s[0])): check = 0 for j in range(n): if not s[0][i] in s[j+1]: check = 1 if check == 0: ans = ans + s[0][i] ans = ''.join(sorted(ans)) print(ans)
s738250130
p03761
u423665486
1587771877
Python
PyPy3 (2.4.0)
py
Runtime Error
176
38256
282
def cnt(s, b): ans = [] for i in s: if i in b: ans.append(i) return ans def intersection(lst1, lst2): lst3 = [value for value in lst1 if value in lst2] cnt1 = cnt(lst1, lst3) cnt2 = cnt(lst2, lst3) if len(cnt1) > len(cnt2): return cnt2 else: return cnt1 resolve()
s452027354
p03761
u914797917
1587387266
Python
Python (3.4.3)
py
Runtime Error
22
3064
638
n=int(input()) s=[input() for i in range(n)] X=[[] for i in range(n)] Z=[[] for i in range(n)] lenmax=0 for i in range(n): lenmax=max(lenmax,len(s[i])) for i in range(n): for j in range(len(s[i])): X[i].append(s[i][j]) for i in range(n): X[i]=sorted(X[i]) Z=set(X[0]) for i in range(1,n-1): Z=sorted(set(Z) & set(X[i+1])) #print(Z) #print(Z) nz=len(Z) minZ=[lenmax for i in range(nz)] for i in range(nz): for j in range(n): minZ[i]=min(minZ[i],X[j].count(Z[i])) #print(minZ) ans='' for i in range(nz): for j in range(minZ[i]): #print(i,j) ans = ans+Z[i] #print(Z[i],ans) print(ans)
s680521737
p03761
u914797917
1587383514
Python
Python (3.4.3)
py
Runtime Error
19
3064
593
n=int(input()) s=[input() for i in range(n)] X=[[] for i in range(n)] Z=[[] for i in range(n)] lenmax=0 for i in range(n): lenmax=max(lenmax,len(s[i])) for i in range(n): for j in range(len(s[i])): X[i].append(s[i][j]) for i in range(n): X[i]=sorted(X[i]) #print(X) Z=set(X[0]) for i in range(1,n-1): Z=sorted(Z & set(X[i+1])) #print(Z) nz=len(Z) minZ=[lenmax for i in range(nz)] for i in range(nz): for j in range(n): minZ[i]=min(minZ[i],X[j].count(Z[i])) #print(minZ) ans='' for i in range(nz): for j in range(minZ[i]): ans = ans+Z[i] print(ans)
s666657956
p03761
u686036872
1587261905
Python
Python (3.4.3)
py
Runtime Error
21
3316
231
import collections N = int(input()) S = collections.Counter(list(input())) for i in range(N-1): c = collections.Counter(list(input())) S &= c ans = [] for i in S.items(): ans += i[0]*i[1] A.sort() print(*ans, sep="")
s622278544
p03761
u549383771
1587227483
Python
Python (3.4.3)
py
Runtime Error
18
3064
740
n = int(input()) ans = {'a':0,'b':0,'c':0,'d':0,'e':0,'f':0,'g':0,'h':0,'i':0,'j':0,'k':0,'l':0, 'm':0,'n':0,'o':0,'p':0,'q':0,'r':0,'s':0,'t':0,'u':0,'v':0,'w':0,'x':0, 'y':0,'z':0} for i in range(n): if i == 0: string = input() for j in string: ans[j] += 1 else: tmp = {'a':0,'b':0,'c':0,'d':0,'e':0,'f':0,'g':0,'h':0,'i':0,'j':0,'k':0,'l':0, 'm':0,'n':0,'o':0,'p':0,'q':0,'r':0,'s':0,'t':0,'u':0,'v':0,'w':0,'x':0, 'y':0,'z':0} string = input() for j in string: tmp[j] += 1 for j in tmp: ans[j] = min(ans[j],tmp[j]) anser = '' for i in ans: for j in range(ans[i]): anser += i print(anser.sort())
s533385577
p03761
u440161695
1586956291
Python
Python (3.4.3)
py
Runtime Error
21
3316
277
from collections import Counter N=int(input()) d={chr(i):100 for i in range(ord("a"),ord("z")+1)} for i in range(N): A=Counter(list(input())) for i in A: if d[i]>A[i]: d[i]=A[i] for i in d: if d[i]==100: d[i]=0 ans="" for i in d: ans=d*d[i]+ans print(ans)
s748560902
p03761
u591503175
1586491140
Python
Python (3.4.3)
py
Runtime Error
21
3316
608
def resolve(): ''' code here ''' import collections N = int(input()) S_list = [collections.Counter(input()) for _ in range(N)] abcd_list = string.ascii_lowercase cnt_dict = S_list[0] for line in S_list: for item in cnt_dict.keys(): cnt_dict[item] = min(line[item], cnt_dict[item]) prev_dict = cnt_dict # print(cnt_dict) cnt_tuple = sorted(cnt_dict.items()) # print(cnt_tuple) res = '' for i, v in cnt_tuple: if v > 0: res += i*v print(res) if __name__ == "__main__": resolve()
s632509971
p03761
u038408819
1586329655
Python
Python (3.4.3)
py
Runtime Error
18
3188
617
N = int(input()) s_cnt = [] for i in range(N): cnt = {} s = input() for si in s: if si in cnt: cnt[si] += 1 else: cnt[si] = 1 s_cnt.append(cnt) #from collections import defaultdict #min_ = defaultdict(int) min_ = {} for i in s_cnt: for j in i: for i in range(N): if j not in s_cnt[i]: continue if j not in min_: min_[j] = i[j] else: min_[j] = min(min_[j], i[j]) string = '' for i in min_: #list_.append(i * min_[i]) string += i * min_[i] s = sorted(string) print(''.join(s))
s061306758
p03761
u038408819
1586329609
Python
Python (3.4.3)
py
Runtime Error
17
2940
610
N = int(input()) s_cnt = [] for i in range(N): cnt = {} s = input() for si in s: if si in cnt: cnt[si] += 1 else: cnt[si] = 1 s_cnt.append(cnt) #from collections import defaultdict #min_ = defaultdict(int) min_ = {} for i in s_cnt: for j in i: for i in range(N): if j not in s_cnt[n]: continue if j not in min_: min_[j] = i[j] else: min_[j] = min(min_[j], i[j]) string = '' for i in min_: #list_.append(i * min_[i]) string += i * min_[i] s = sorted(string) print(''.join(s))
s811751730
p03761
u038408819
1586329417
Python
Python (3.4.3)
py
Runtime Error
19
3064
625
N = int(input()) s_cnt = [] for i in range(N): cnt = {} s = input() for si in s: if si in cnt: cnt[si] += 1 else: cnt[si] = 1 s_cnt.append(cnt) #from collections import defaultdict #min_ = defaultdict(int) min_ = {} for i in s_cnt: for j in i: if j not in s_cnt[0] or j not in s_cnt[1] or j not in s_cnt[2]: continue if j not in min_: min_[j] = i[j] else: min_[j] = min(min_[j], i[j]) string = '' for i in min_: #list_.append(i * min_[i]) string += i * min_[i] s = sorted(string) print(''.join(s))
s385712465
p03761
u762420987
1586143435
Python
Python (3.4.3)
py
Runtime Error
21
3316
266
from collections import defaultdict, Counter def f(): return 10**9 d = defaultdict(f) n = int(input()) for _ in range(N): S = Counter(input()) for k, v in S.items(): d[k] = min(d[k], v) ans = "" for k, v in d.items(): ans += k * v print(ans)
s752347298
p03761
u693007703
1585619423
Python
Python (3.4.3)
py
Runtime Error
17
2940
547
from collections import Counter N = int(input()) strings = [input() for i i in range(N)] string_set = list(map(set,strings)) count_set = list(map(Counter, strings)) common_letter = string_set[0] for s in string_set: common_letter = common_letter & s common_letter_nums = {} for l in common_letter: common_letter_nums.setdefault(l, []) for c in count_set: common_letter_nums[l].append(c[l]) output_letter = '' for k, v in common_letter_nums.items(): output_letter += k * min(v) print(''.join(sorted(output_letter)))
s268516667
p03761
u691018832
1585088316
Python
Python (3.4.3)
py
Runtime Error
23
3572
820
import sys from collections import Counter input = sys.stdin.readline n = int(input()) s = [] memo = [] ans = '' for i in range(n): s.append(list(input().rstrip('\n'))) s[i].sort() memo.append(list(Counter(s[i]).items())) for i in range(1, n): check = [0] * len(memo[0]) cnt = 0 for j in range(len(memo[0])): if len(memo[i]) == cnt: continue memo[i][cnt] = list(memo[i][cnt]) if memo[0][j][0] == memo[i][cnt][0]: if memo[0][j][1] > memo[i][cnt][1]: memo[0][j][1] = memo[i][cnt][1] cnt += 1 check[j] = 1 if check[j] == 0: memo[0][j] = list(memo[0][j]) memo[0][j][1] = 0 for i in range(len(memo[0])): for j in range(memo[0][i][1]): ans += memo[0][i][0] print(ans)
s579153937
p03761
u686036872
1585000688
Python
Python (3.4.3)
py
Runtime Error
23
3316
260
import collections N = int(input()) c = collections.Counter(input()) for i in range(N-1): x = collections.Counter(input()) ans=[] for j in c.keys(): c[j] = min(c[j], x[j]) ans.append(j*c[j]) ans.sort() print(*ans, sep="")
s010501338
p03761
u686036872
1585000627
Python
Python (3.4.3)
py
Runtime Error
23
3316
241
import collections N = int(input()) c = collections.Counter(input()) for i in range(N-1): x = collections.Counter(input()) ans=[] for j in c.keys(): c[j] = min(c[j], x[j]) ans.append(j*c[j]) print(*ans, sep="")
s227712521
p03761
u680851063
1584921650
Python
Python (3.4.3)
py
Runtime Error
17
3064
254
n = int(input()) l = [list(list(input())) for _ in range(n)] x = [] for i in range(len(l[0])): if (l[0][i] in l[1]) and (l[0][i] in l[2]): x.append(l[0][i]) l[1].remove(l[0][i]) l[2].remove(l[0][i]) print(''.join(sorted(x)))
s308485045
p03761
u680851063
1584917365
Python
Python (3.4.3)
py
Runtime Error
17
3060
221
n = int(input()) l = [list(list(input())) for _ in range(n)] for i in range(n): l[i].sort() x = [] for i in range(len(l[0])): if l[0][i] == l[1][i] == l[2][i]: x.append(l[1][i]) print(''.join(sorted(x)))
s002861863
p03761
u680851063
1584917224
Python
Python (3.4.3)
py
Runtime Error
18
3060
212
n = int(input()) l = [list(list(input())) for _ in range(n)] for i in range(n): l[i].sort() x = [] for i in range(len(l[0])): if l[0][i] == l[1][i] == l[2][i]: x.append(l[1][i]) print(*sorted(x))
s950783553
p03761
u241159583
1584619677
Python
Python (3.4.3)
py
Runtime Error
18
3064
379
n = int(input()) S = list(input() for _ in range(n)) def intersect_list(l1, l2): arr = [] lst = l1.copy() for element in l2: try: lst.remove(element) except ValueError: pass else: arr.append(element) return arr l = intersect_list(list(S[0]), list(S[1])) for i in range(2, n): l = intersect_list(l, list(S[i])) l.sort() print("".join(l))
s446517275
p03761
u620084012
1584618339
Python
Python (3.4.3)
py
Runtime Error
23
3316
273
from collections import Counter N = int(input()) W = [Counter(input()) for k in range(N)] A = [100000]*26 S = "abcdefghijklmnopqrstuvwxyz" for e in W: for s in S: A[ord(s)-97] = min(A[ord(s)-97],e[s]) ans = "" for k in range(N): ans += S[k]*A[k] print(ans)
s244661567
p03761
u448659077
1584134905
Python
Python (3.4.3)
py
Runtime Error
17
2940
170
n = int(input()) s = [input() for _ in range(n)] l = [] for i in s[0]: #print(i) if all(i in s[j] for j in range(n)): #print(l) print("".join(sorted(l)))
s800020829
p03761
u627803856
1582853452
Python
PyPy3 (2.4.0)
py
Runtime Error
196
39280
363
from collections import Counter n=int(input()) s=[Counter(input()) for _ in range(n)] c = counter[0] #各アルファベット(a,b,c,...,z)に対して,使用回数の最小値を求める c = s[0] for i in range(1,n): for k,v in c.items(): c[k] = min(s[i][k], c[k]) c = sorted(c.items()) ans = '' for k,v in c: ans += k*v print(ans)
s476891436
p03761
u627803856
1582851292
Python
PyPy3 (2.4.0)
py
Runtime Error
172
38640
397
n=int(input()) def intersect_list(lst1, lst2): arr = [] lst = lst1.copy() for element in lst2: try: lst.remove(element) except ValueError: pass else: arr.append(element) return arr res = list(input()) for _ in range(n-1): s = list(input()) res = intersect_list(res,s) res.sort() ans = ''.join(res) print(ans)
s458848592
p03761
u627803856
1582850642
Python
PyPy3 (2.4.0)
py
Runtime Error
169
38256
404
n=int(input()) def intersect_list(lst1, lst2): arr = [] lst = lst1.copy() for element in lst2: try: lst.remove(element) except ValueError: pass else: arr.append(element) return arr res = list(input()) for _ in range(n-1): s = list(input()) res = intersect_list(res,s) res.sort() ans = ''.join(res) print(*ans, sep='')
s363819063
p03761
u408375121
1582059070
Python
Python (3.4.3)
py
Runtime Error
17
3064
462
n = int(input()) list_1 = ['a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z'] dic = {} for al in list_1: dic[al] = 100 for i in range(n): s = input() for al in list_1: count for t in s: if al == t: count += 1 if dic[al] > count: dic[al] = count ans = '' for al in list_1: if dic[al] > 0: for i in range(dic[al]): ans += al print(ans)
s288029676
p03761
u810066979
1581667969
Python
Python (3.4.3)
py
Runtime Error
17
3064
218
n=int(input()) s=[input() for num in range(n)] for i in range(97,97+26,1): s0=s[0].count(chr(i)) s1=s[1].count(chr(i)) s2=s[2].count(chr(i)) count=(min(s0,min(s1,s2))) for j in range(count): print(chr(i),end="")
s803557319
p03761
u644360640
1580716596
Python
Python (3.4.3)
py
Runtime Error
1936
3064
418
n = int(input()) ans = [[0]*26 for i in range(n)] ans2 = [10**9 for i in range(26)] answer = '' for i in range(n): s = input() for j in s: ans[i][ord(j)-97] += 1 for i in range(n-1): for j in range(26): ans2[j] = min(ans2[j],min(ans[i][j],ans[i+1][j])) if max(ans2)==0: print('') else: for i,j in enumerate(ans2): temp = chr(97+i) answer += temp*j print(answer)
s195260745
p03761
u875600867
1579396237
Python
Python (3.4.3)
py
Runtime Error
17
3064
783
N = int(input()) # 二次元配列の初期化 # 0番目をaの出現回数、 # 1番目をbの出現回数とする x = [[0 for i in range(24)] for j in range(N)] #print(x) for n in range(N): tmp=list(input()) # 文字列をソートする tmp.sort() # 重複排除して、それぞれの文字が何回出現したかを数える tmp2 = set(tmp) for l in tmp2: #print(n, ord(l)-97,l, tmp.count(l)) x[n][ord(l)-97]= tmp.count(l) ans =[] # a~zまで調べていき、全員最低1回以上出していれば、 # その文字は出力する。最低出現回数分連続させる。 for i in range(24): tmp3 = [row[i] for row in x] tmp4 = chr(97+i)* min(tmp3) if min(tmp3) != 0 else "" ans.append(tmp4) print("".join(ans))
s963477615
p03761
u875600867
1579373662
Python
Python (3.4.3)
py
Runtime Error
17
3064
446
N = int(input()) s=[] x = [[0 for i in range(24)] for j in range(N)] #print(x) for n in range(N): tmp=list(input()) tmp.sort() s.append(tmp) tmp2 = set(tmp) for l in tmp2: #print(n, ord(l)-97,l, tmp.count(l)) x[n][ord(l)-97]= tmp.count(l) ans =[] for i in range(len(x)): tmp3 = [row[i] for row in x] tmp4 = chr(97+i)* min(tmp3) if min(tmp3) != 0 else "" ans.append(tmp4) print("".join(ans))
s889871389
p03761
u225388820
1579268870
Python
Python (3.4.3)
py
Runtime Error
17
3064
252
n=int(input()) s=[input() for i in range(n)] dic={} for i in range(n): for j in s[i]: if not(j in dic[s[i]]): dic[j]=[0 for i in range(n)] dic[j][i]+=1 ans=[] for i in dic.keys(): ans.append(i*min(dic[i])) ans.sort() print(ans,sep='')
s916150193
p03761
u941434715
1577558421
Python
Python (3.4.3)
py
Runtime Error
17
2940
1540
#include<stdio.h> #include<stdlib.h> #include<string.h> #define NEW(p,n){p=malloc((n)*sizeof(p[0]));if(p==NULL){printf("not enough memory\n");exit(1);};} //pの型の変数n個の要素分のメモリを確保し、そのアドレスをpに代入するマクロ #define MAX(a, b) ((a) > (b) ? (a) : (b)) #define MIN(a, b) ((a) < (b) ? (a) : (b)) #define SWAP(type, x, y) do { type tmp = x; x = y; y = tmp; } while (0) #define MOD 1000000007 typedef char* String; String string_input(void){ int i,len; char buf[100]; String str; scanf("%s",buf);//buf=入力した文字列が入るchar型の配列 len=strlen(buf);//len=文字列の長さを表すint型変数 NEW(str,len+1);//strはただのポインタだから、ここでNEWを使ってメモリを確保しなくちゃいけない for(i=0;i<len;i++){ str[i]=buf[i]; } str[len]=0; return str; } int main(void){ int N; scanf("%d",&N); //A[0]~A[N-1]に格納する String* S; NEW(S,N); for(int i=0;i<N;i++){ S[i]=string_input(); } int* ans; NEW(ans,26); for(int i=0;i<26;i++) ans[i]=50; int* tmp; NEW(tmp,26); for(int i=0;i<N;i++){ for(int j=0;j<26;j++) tmp[j]=0; for(int j=0;j<strlen(S[i]);j++){ tmp[S[i][j]-'a']++; } for(int j=0;j<26;j++) ans[j]=MIN(ans[j],tmp[j]); } for(int i=0;i<26;i++){ char c='a'+i; for(int j=1;j<=ans[i];j++) printf("%c",c); } printf("\n"); return 0; }
s887003313
p03761
u905582793
1576508841
Python
Python (3.4.3)
py
Runtime Error
17
2940
71
n=int(input()) s=[list(input()) for in range(n)] for i in s: i.sort()
s428131898
p03761
u905582793
1576508810
Python
Python (3.4.3)
py
Runtime Error
16
2940
55
n=int(input()) s=[list(input()).sort() for in range(n)]
s295775522
p03761
u981931040
1576088957
Python
PyPy3 (2.4.0)
py
Runtime Error
184
39280
566
from collections import Counter N = int(input()) S = [] for _ in range(N): s = list(input()) s.sort() S.append(s) work = S[0] for i in range(1 , N): work_lst = [] for j in range(max(len(S[i]) , len(work))): if len(work) == 0 or len(S[i]) == 0: break if work[0] == S[i][0]: c = S[i].pop(0) c = work.pop(0) work_lst.append(c) elif work[0] > S[i][0]: S[i].pop(0) elif work[0] < S[i][0]: work.pop(0) work = work_lst print("".join(work_lst))
s319842599
p03761
u961674365
1575762300
Python
Python (3.4.3)
py
Runtime Error
17
3060
176
n=int(input()) abc='abcdefghijklmnopqrstuvwxyz' ans='' for x in abc: z=100 v=100 for i in range(n): s=input() z=s.count(x) v=min(z,v) ans+=x*v print(ans)
s264031537
p03761
u896741788
1575690158
Python
Python (3.4.3)
py
Runtime Error
17
2940
112
from collections import Counter as c n=int(input()) l=[[s,cou for s,cou in c(input()).items()]for i in range(n)]
s728056481
p03761
u143278390
1574993928
Python
Python (3.4.3)
py
Runtime Error
20
3316
402
import collections n=int(input()) c=[0]*3 alphabet=set() for i in range(n): s=input() counter=collections.Counter(s) c[i]=counter for moji in s: if(moji not in alphabet): alphabet.add(moji) alphabet=sorted(alphabet) text='' for moji in alphabet: count1=c[0][moji] count2=c[1][moji] count3=c[2][moji] text+=moji*min(count1,count2,count3) print(text)
s257152818
p03761
u143278390
1574971771
Python
Python (3.4.3)
py
Runtime Error
20
3316
402
import collections n=int(input()) c=[0]*3 alphabet=set() for i in range(n): s=input() counter=collections.Counter(s) c[i]=counter for moji in s: if(moji not in alphabet): alphabet.add(moji) alphabet=sorted(alphabet) text='' for moji in alphabet: count1=c[0][moji] count2=c[1][moji] count3=c[2][moji] text+=moji*min(count1,count2,count3) print(text)
s927587542
p03761
u662613022
1572751967
Python
Python (3.4.3)
py
Runtime Error
17
3064
344
li = [] moji = [] ans = '' for i in range(N): li.append(input()) for w in li[0]: countw = 1 for j in range(1,N): for k in range(len(li[j])): if li[j][k] == w: countw += 1 li[j].replace(w, '', 1) break if countw == N: moji.append(w) moji.sort() for i in range(len(moji)): ans += moji[i] print(ans)
s597048556
p03761
u937642029
1572660202
Python
PyPy3 (2.4.0)
py
Runtime Error
186
39280
721
def main(): n=int(input()) s=list(input()) dict1={} for i in range(len(s)): if s[i] not in dict1: dict1[s[i]]=1 else: dict1[s[i]]+=1 for _ in range(n-1): dict2={} t=list(input()) for i in range(len(t)): if t[i] in dict1 and dict1[t[i]]>0: if t[i] not in dict2: dict2[t[i]]=1 dict1[t[i]]-=1 else: dict2[t[i]]+=1 dict1[t[i]]-=1 dict1=dict2 ans=[] for i in dict2: for _ in range(dict2[i]): ans.append(i) ans.sort() print(''.join(ans)) if __name__ == "__main__": main()
s873863721
p03761
u905203728
1572036493
Python
Python (3.4.3)
py
Runtime Error
22
3316
203
from collections import Counter n=int(input()) s=[input() for i in range(n)] count=Counter(s[0]) for i in range(n): count &=s[i] ans="" for i in sorted(count.keys()): ans +=i*count[i] print(ans)
s415969950
p03761
u343454379
1571594961
Python
Python (3.4.3)
py
Runtime Error
17
2940
260
from collections import Counter N=int(input()) S=Counter(list(input())) for i in range(1,N): S_=Counter(list(input())) for s in S: if S_[s]<S[s]: S[s]=S_[s] ans=[] for s in S: for _ in range(S[s]): ans.append(s) print("".join(sorted(ans))
s368363059
p03761
u552192779
1571346149
Python
Python (3.4.3)
py
Runtime Error
17
3064
572
strs = [] inter1 = {} for _ in range(n): strs.append(input()) for char in strs[0]: if char in inter1: inter1[char] +=1 else: inter1[char] = 1 for i in range(1,n): inter2 = {} for char in strs[i]: if (char in inter1): if char in inter2: if inter2[char] < inter1[char]: inter2[char] +=1 else: inter2[char] =1 inter1 = inter2 inter = sorted(inter1.items()) ans = '' for char,i in inter: for _ in range(i): ans +=char print(ans)
s952208548
p03761
u094191970
1571281696
Python
Python (3.4.3)
py
Runtime Error
22
3316
170
from collections import Counter n=int(input()) c=Counter(input()) for i in range(n-1): c&=Counter(input()) s='' for k,v in sorted(count.items()): s+=k*v print(s)
s145413897
p03761
u377989038
1569865991
Python
Python (3.4.3)
py
Runtime Error
18
3064
308
n = int(input()) s = [] length = 100 for i in range(n): S = sorted(input()) s.append(S) length = min(length, len(S)) ans = "" for i in range(length): tmp = 0 for j in range(n-1): if s[j][i] == s[j+1][i]: tmp += 1 if tmp == n - 1: ans += s[j][i] print(ans)
s489231719
p03761
u698176039
1569360097
Python
Python (3.4.3)
py
Runtime Error
19
3192
443
N = int(input()) S = [input() for _ in range(N)] a2n = lambda c: ord(c) - ord('a') n2a = lambda c: chr(c+97) inf = 2 ** 30 - 1 idxs = [[0]*26 for _ in range(26)] idx = [inf] * 26 for i in range(N): for s in S[i]: idxs[i][a2n(s)] += 1 for i in range(26): for j in range(N): idx[i] = min(idx[i],idxs[j][i]) ans = '' for i in range(26): for j in range(idx[i]): ans += n2a(i) print(ans)
s203636410
p03761
u532514769
1567918326
Python
PyPy3 (2.4.0)
py
Runtime Error
166
38896
342
n=int(input()) h = [input() for d in range (n)] alphabet=['a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p','q','r','s','t','u','v','w','x','y','z'] list=[] for k in range(26): for i in range (n): m=50 x =h[i].count(alphabet[k]) m =min(x,m) list.append(alphabet[k]*m) print('',join(list))
s725415076
p03761
u626337957
1564944621
Python
Python (3.4.3)
py
Runtime Error
18
3064
475
N = int(input()) dict_c = {} for char in input(): if char in dict_c: dict_c[char] += 1 else: dict_c[char] = 1 for _ in range(N-1): word = input() dict_t = dict_c for char in word: if char in dict_t: dict_t[char] += 1 else: dict_t[char] = 1 for char, cnt in dict_c.items(): if cnt != 0 and cnt != dict_c[char]: dict_c[char] = 0 ans = '' for char, cnt in dict_c.items().sort(key=lambda x: x[0]): ans += char*(cnt) print(ans)
s519350199
p03761
u820047642
1564371438
Python
Python (3.4.3)
py
Runtime Error
19
3064
400
n=int(input()) S=input() D={} for i in range(len(S)): s=S[i] if s in D:D[s]+=1 else:D[s]=1 for _ in range(n-1): S=input() E={} DD={} for i in range(len(S)): s=S[i] if s in E:E[s]+=1 else:E[s]=1 for i in D: if i in E:DD[i]=min(E[i],D[i]) ans=[] for j in DD: for _ in range(DD[j]): ans.append(j) ans.sort() print("".join(ans))
s576359189
p03761
u652057333
1564208275
Python
Python (3.4.3)
py
Runtime Error
18
3064
352
n = int(input()) s = [] for i in range(n): s.append(list(str(input()))) alphabet = set(s[0]) for i in range(1, n): alphabet = alphabet & set(s[i]) count_min = {} for a in sorted(alphabet): count_min[a] = min(count_min[a], s[0].count(a)) ans = "" for k, v in sorted(count_min.items()): for i in range(v): ans += k print(ans)
s479546233
p03761
u652057333
1564208229
Python
Python (3.4.3)
py
Runtime Error
18
3064
338
n = int(input()) s = [] for i in range(n): s.append(list(str(input()))) alphabet = set(s[0]) for i in range(1, n): alphabet = alphabet & set(s[i]) count_min = {} for a in sorted(alphabet): count_min[a] = min(s[0].count(a)) ans = "" for k, v in sorted(count_min.items()): for i in range(v): ans += k print(ans)
s453255785
p03761
u817845505
1564088775
Python
PyPy3 (2.4.0)
py
Runtime Error
189
40048
551
def smaller(x, y): if x < y: return x return y N = int(input()) anscounter = [] for i in range(0, 26): anscounter.append(0) S = input() for i in range(0, len(S)): anscounter[ord(S[i])-97] += 1 for i in range(1, N): tmpcounter = [] for j in range(0, 26): tmpcounter.append(0) newS = input() for j in range(0, len(S)): tmpcounter[ord(newS[j])-97] += 1 for j in range(0, 26): anscounter[j] = smaller(anscounter[j], tmpcounter[j]) ans = '' for i in range(0, 26): for j in range(0, anscounter[i]): ans = ans + str(chr(i+97)) print(ans)
s056489555
p03761
u817845505
1564088439
Python
PyPy3 (2.4.0)
py
Runtime Error
179
39408
551
def smaller(x, y): if x < y: return x return y N = int(input()) anscounter = [] for i in range(0, 26): anscounter.append(0) S = input() for i in range(0, len(S)): anscounter[ord(S[i])-97] += 1 for i in range(1, N): tmpcounter = [] for j in range(0, 26): tmpcounter.append(0) newS = input() for j in range(0, len(S)): tmpcounter[ord(newS[j])-97] += 1 for j in range(0, 26): anscounter[j] = smaller(anscounter[j], tmpcounter[j]) ans = '' for i in range(0, 26): for j in range(0, anscounter[i]): ans = ans + str(chr(i+97)) print(ans)
s142662661
p03761
u933214067
1563936946
Python
Python (3.4.3)
py
Runtime Error
158
13652
622
import math import fractions import copy import numpy as np def ip(): return int(input()) def iprow(): return [int(i) for i in input().split()] def ips(): return (int(i) for i in input().split()) n = ip() s = input() scut = [s[i] for i in range(len(s))] scut.sort() for i in range(n-1): s = input() sncut = [s[i] for i in range(len(s))] sncut.sort() nextline = [] while len(sncut) and len(scut): if sncut[0] == scut[0]: nextline.append(sncut[0]) scut.pop(0) sncut.pop(0) elif sncut[0] > scut[0]: scut.pop(0) else: sncut.pop(0) scut = copy.copy(nextline) print(''.join(nextline))
s415707212
p03761
u584174687
1563563949
Python
PyPy3 (2.4.0)
py
Runtime Error
224
42736
538
from collections import defaultdict, Counter def main(): num = int(input()) ans_dic = Counter(list(input())) for i in range(num - 1): aaa = Counter(list(input())) ans = defaultdict(int) for ele in ans_dic.keys(): if ele in aaa.keys(): ans[ele] += min(ans_dic[ele], aaa[ele]) ans = sorted(ans.items(), key=lambda x: -x[1]) for moji, kosuu in ans: for i in range(kosuu): print(moji, end='') print() if __name__ == '__main__': main()
s887281434
p03761
u601082779
1563343794
Python
Python (3.4.3)
py
Runtime Error
17
2940
82
n=int(input()) a=input() for i in range(n-1): a=a.intersection(input()) print(a)
s000931722
p03761
u601082779
1563343749
Python
Python (3.4.3)
py
Runtime Error
18
2940
81
n=int(input()) a=input() for i in range(n-1) a=a.intersection(input()) print(a)
s757689606
p03761
u539517139
1561982546
Python
Python (3.4.3)
py
Runtime Error
21
3064
323
n=int(input()) if n!=1: a=input() b=input() m=[] for i in a: for j in b: if i==j: m.append(i) break for _ in range(n-2): s=input() l=[] for i in m: for j in s: if i==j: l.append(i) break m=l print(''.join(sorted(m))) else: print(a)
s750200967
p03761
u539517139
1561982386
Python
Python (3.4.3)
py
Runtime Error
2105
23900
293
n=int(input()) if n!=1: a=input() b=input() m=[] for i in a: for j in b: if i==j: m.append(i) for _ in range(n-2): s=input() l=[] for i in s: for j in m: if i==j: l.append(i) m=l print(''.join(sorted(m))) else: print(a)
s690190417
p03761
u539517139
1561981841
Python
Python (3.4.3)
py
Runtime Error
2105
23420
240
n=int(input()) a=input() b=input() m=[] for i in a: for j in b: if i==j: m.append(i) for _ in range(n-2): s=input() l=[] for i in s: for j in m: if i==j: l.append(i) m=l print(''.join(sorted(m)))
s841599228
p03761
u497596438
1561502640
Python
Python (3.4.3)
py
Runtime Error
17
3060
256
n=int(input()) l=[defaultdict(int) for i in range(n)] for i in range(n): S=input() for s in S: l[i][s]+=1 t="" for i in range(26): a=10**30 for j in range(n): a=min(a,l[j][chr(i+ord("a"))]) t+=chr(i+ord("a"))*a print(t)
s951557870
p03761
u614734359
1560835580
Python
Python (3.4.3)
py
Runtime Error
21
3316
429
from collections import Counter n = int(input()) t = [input() for _ in range(n)] init = ''.join(['a' for _ in range(50)]) for s in t: if len(init) > len(s): init = s t.remove(init) init = {k:v for k,v in Counter([s for s in sorted(list(init))]).items()} for s in t: for k,v in init.items(): if s.count(k) < v: init[k] = s.count(k) ans = '' for k,v in init.items(): for i in range(v): ans += k print(ans)
s347476962
p03761
u614734359
1560835235
Python
Python (3.4.3)
py
Runtime Error
2121
278124
514
from collections import Counter from itertools import permutations n = int(input()) t = [input() for _ in range(n)] init = ''.join(['a' for _ in range(50)]) for s in t: if len(init) > len(s): init = s t.remove(init) init = {k:v for k,v in Counter([s for s in init]).items()} for s in t: for k,v in init.items(): if s.count(k) < v: init[k] = s.count(k) s = '' for k,v in init.items(): for i in range(v): s += k ans = sorted([''.join(list(a)) for a in permutations(s,len(s))]) print(ans[0])
s923652107
p03761
u416773418
1560573469
Python
Python (3.4.3)
py
Runtime Error
23
3064
376
n=int(input()) s=[] for i in range(n): s+=[input()] s1=s[0] s=s[1:] a=[] for i in s1: for j in range(len(s)): c1=0 for k in range(len(s[j])): if i==s[j][k]: s[j]=s[j][:k]+s[j][k+1:] c1+=1 break if c1==0: break if c1==1: a+=[i] a.sort() a=''.join(a) print(a)
s066461888
p03761
u416773418
1560573127
Python
Python (3.4.3)
py
Runtime Error
23
3064
376
n=int(input()) s=[] for i in range(n): s+=[input()] s1=s[0] s=s[1:] a=[] for i in s1: for j in range(len(s)): c1=0 for k in range(len(s[j])): if i==s[j][k]: s[j]=s[j][:k]+s[j][k+1:] c1+=1 break if c1==0: break if c1==1: a+=[i] a.sort() a=''.join(a) print(a)
s784397617
p03761
u167681750
1560463179
Python
Python (3.4.3)
py
Runtime Error
17
3060
346
n = int(input()) s_counted = Counter(input()) for i in range(n - 1): si_counted = Counter(input()) for j in s_counted: if j in si_counted: s_counted[j] = min(s_counted[j], si_counted[j]) else: s_counted[j] = 0 ans = "" for i in sorted(s_counted.most_common()): ans += i[1] * i[0] print(ans)
s671599121
p03761
u695429668
1560401830
Python
Python (3.4.3)
py
Runtime Error
45
3064
482
N = int(input()) S = [] for i in range(N): S.append(input()) S = sorted(S) _list = [] ans = list(S.pop(1)) # print(S) for e in range(len(S)): buff = ans.copy() buff2 = [] for n in range(len(S[e])): # print(e, n, S[e]) for a in range(len(buff)): if S[e][n] == buff[a]: buff2.append(buff[a]) buff[a] = '00000000' # print(buff2) ans = buff2.copy() ans = sorted(ans) ans = ''.join(ans) print(ans)
s038142004
p03761
u978210902
1558057541
Python
PyPy3 (2.4.0)
py
Runtime Error
171
38640
260
N = int(input()) SS = [] for _ in range(N): SS.append(sorted(input())) common = SS[0] for s in SS: sc = s.copy() z = [] for c in common: if c in sc: sc.remove(c) z.append(c) common = z print(''.join(common))
s850069663
p03761
u221345507
1556657577
Python
Python (3.4.3)
py
Runtime Error
17
2940
191
n = int(input()) l = list(input()) l = collections.Counter(list(l)) for i in range (n-1): l_temp = list(input()) l_temp = collections.Counter(list(l_temp)) l = l & l_temp print(l)
s742144085
p03761
u357050210
1555281548
Python
Python (3.4.3)
py
Runtime Error
17
2940
544
n = int(input()) cnt = [ int(1e9) for i in range(26) ] for i in range(n): s = input() nw = [ 0 for j in range(26) ] for j in s: nw[ord(j) - ord('a')]+=1 for j in range(26): cnt[j] = min( cnt[j], nw[j] ) ans = "" for i in range(26): if cnt[i] != int(1e9): ans += chr(i+97) * int(cnt[i]) print(ans)
s228605310
p03761
u777864981
1554357019
Python
Python (3.4.3)
py
Runtime Error
18
3060
258
N = int(input()) slist = [input() for _ in range(N)] abc = 'abcdefghijklmnopqrstuvwxyz' l = [50] * 26 ans = '' for i in range(N): for s in slist: l[i] = min(l[i],s.count(abc[i])) for j in range(N): ans = ans + (abc[j] * l[j]) print(ans)
s877705504
p03761
u565204025
1554321659
Python
Python (3.4.3)
py
Runtime Error
18
3064
572
# -*- coding: utf-8 -*- n = int(input()) s = [0]*n for i in range(n): s[i] = list(input()) def list_intersection(a,b): c = [] for i in range(len(a)): for j in range(len(b)): if a[i] == b[j]: c.append(a[i]) a[i] = "_" b[j] = "&" return c if n == 1: ans = s[0].sort() elif n == 2: ans = list_intersection(s[0],s[1]) ans.sort() else: ans = list_intersection(s[0],s[1]) for i in range(2,n): ans = list_intersection(ans,s[2]) ans.sort() print("".join(ans))
s883583438
p03761
u282228874
1553741550
Python
Python (3.4.3)
py
Runtime Error
17
2940
8
3 a aa b
s443530729
p03761
u766684188
1552882243
Python
Python (3.4.3)
py
Runtime Error
18
2940
390
import string from collections n=int(input()) A=list(string.ascii_lowercase) d={} for _ in range(n): s=input() c=collections.Counter(s) for i in A: if i in c.keys(): if i not in d: d[i]=c[i] else: d[i]=min(d[i],c[i]) else: d[i]=0 ans=[] for i in d: ans+=i*d[i] ans.sort() print(*ans,sep='')
s206437743
p03761
u905715926
1552525322
Python
Python (3.4.3)
py
Runtime Error
18
2940
196
n = int(input()) s = input() s2 = input() s3 = input() alp = "abcdefghijklmnopqrstuvwxyz" ans = "" for a in alp: for i in range(min(s.count(a),s2.count(a),s3.count(a))): ans += a print(ans)
s179486378
p03761
u905715926
1552525208
Python
Python (3.4.3)
py
Runtime Error
18
3060
195
n = int(input()) s = input() s2 = input() s3 = input() alp = "abcdefghijklmnopqrstuvwxyz" ans = "" for a in alp: for i in range(min(s.count(a),s2.count(a),s3.count(a))): ans += a print(ans)
s031872337
p03761
u572144347
1551636646
Python
PyPy3 (2.4.0)
py
Runtime Error
176
38384
308
N=int(input()) from collections import Counter,defaultdict s=input() ddict=defaultdict(int) for c in s: ddict[c]+=1 for i in range(N-1): s=input() cnt=Counter[s] for k in cnt.keys(): ddict[k]=min(ddict[k],cnt[k]) ans="" for k in range(26): c =chr(ord("a")+k) ans+=c*ddict[c] print(ans)
s408624703
p03761
u812973725
1550280955
Python
Python (2.7.6)
py
Runtime Error
12
2692
380
N = input() data = [list(raw_input()) for i in range(N)] alpha = [chr(i) for i in range(97,97+26)] cnt = [[0 for i in range(26)] for i in range(N)] for i in range(N): for j in range(26): cnt[i][j] = data[i].count(alpha[j]) ans = '' for i in range(26): mini = 10000 for j in range(n): mini = min(mini,cnt[j][i]) ans += alpha[i]*mini print ans
s459352399
p03761
u513081876
1546134539
Python
Python (3.4.3)
py
Runtime Error
20
3316
234
n = int(input()) S = [input() for i in range(n)] check = set(S[i]) ans = [] for c in check: num = float('inf') for s in S: num = min(num, s.count(c)) ans.append(num*c) print(''.join(sorted(''.join(ans))))
s734440608
p03761
u037098269
1542404935
Python
Python (3.4.3)
py
Runtime Error
19
3064
589
count = int(input()) ent_list = [] for i in range(count): org_list = [j for j in input()] new_list = sorted(org_list) ent_list.append(new_list) if count == 1: result = "".join(ent_list[0]) print(result) else: for i in range(count-1): for j in range(len(ent_list[i+1])): if ent_list[i+1][j] in ent_list[i] == True: ent_list[i].remove(ent_list[i+1][j]) else: ent_list[i+1].remove(ent_list[i+1][j]) result = "".join(ent_list[count-1]) print(result) #3 #cbaa #daacc #acacac
s196366593
p03761
u863370423
1542323106
Python
Python (3.4.3)
py
Runtime Error
20
3064
856
n = int(input()) alp = [chr(i) for i in range(97, 97+26)] ans = [] for i in range(n): a = list(input()) a.sort() if i == 0: ans = a else: k = 0 if len(a) >= len(ans): while k < len(a): if k >= len(ans): break if a[k] < ans[k]: del a[k] elif a[k] == ans[k]: k += 1 elif a[k] > ans[k]: del ans[k] else: while k < len(ans): if k >= len(a): del ans[k] k += 1 if a[k] < ans[k]: del a[k] elif a[k] == ans[k]: k += 1 elif a[k] > ans[k]: del ans[k] for i in ans: print(i, end="")