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
int64
0
100
memory
stringlengths
4
6
code_size
int64
15
14.7k
code
stringlengths
15
14.7k
problem_id
stringlengths
6
6
problem_description
stringlengths
358
9.83k
input
stringlengths
2
4.87k
output
stringclasses
807 values
__index_level_0__
int64
1.1k
1.22M
s223266590
p01086
u931913851
1562322629
Python
Python3
py
Accepted
30
5608
793
"短句" # 各単語を始まりとして57577が作れるかどうか while True: n = int(input()) if n == 0: break words = [str(input()) for _ in range(n)] tanku = [5, 7, 5, 7, 7] target = 0 ans = 0 for i in range(n): now_len = 0 # print("i : ", i) for j in range(i, n): now_len += len...
p01086
<h2>Short Phrase</h2> <p> A <em>Short Phrase</em> (aka. Tanku) is a fixed verse, inspired by Japanese poetry Tanka and Haiku. It is a sequence of words, each consisting of lowercase letters 'a' to 'z', and must satisfy the following condition: </p> <blockquote> (The Condition for a Short Phrase)<br> The sequence o...
9 do the best and enjoy today at acm icpc 14 oh yes by far it is wow so bad to me you know hey 15 abcde fghijkl mnopq rstuvwx yzz abcde fghijkl mnopq rstuvwx yz abcde fghijkl mnopq rstuvwx yz 0
1 2 6
25,344
s411892133
p01086
u464321546
1562138327
Python
Python3
py
Accepted
30
5612
551
checklis = [5,7,5,7,7] def check(S): b = 0 index = 0 for s in S: b += len(s) if checklis[index] == b: index += 1 b = 0 if index == 5: return True elif checklis[index] > b: continue else: return False ...
p01086
<h2>Short Phrase</h2> <p> A <em>Short Phrase</em> (aka. Tanku) is a fixed verse, inspired by Japanese poetry Tanka and Haiku. It is a sequence of words, each consisting of lowercase letters 'a' to 'z', and must satisfy the following condition: </p> <blockquote> (The Condition for a Short Phrase)<br> The sequence o...
9 do the best and enjoy today at acm icpc 14 oh yes by far it is wow so bad to me you know hey 15 abcde fghijkl mnopq rstuvwx yzz abcde fghijkl mnopq rstuvwx yz abcde fghijkl mnopq rstuvwx yz 0
1 2 6
25,345
s146220721
p01086
u200148444
1562121854
Python
Python3
py
Accepted
30
5612
502
def es(k,le): i=k x=0 while le>x: x+=len(l[i]) i+=1 if le==x:return i else: return 0 while True: n=int(input()) if n==0:break l=[input() for _ in range(n)] ans=1 for i in range(n): k=i k=es(k,5) if k==0:continue k=es(k,7) ...
p01086
<h2>Short Phrase</h2> <p> A <em>Short Phrase</em> (aka. Tanku) is a fixed verse, inspired by Japanese poetry Tanka and Haiku. It is a sequence of words, each consisting of lowercase letters 'a' to 'z', and must satisfy the following condition: </p> <blockquote> (The Condition for a Short Phrase)<br> The sequence o...
9 do the best and enjoy today at acm icpc 14 oh yes by far it is wow so bad to me you know hey 15 abcde fghijkl mnopq rstuvwx yzz abcde fghijkl mnopq rstuvwx yz abcde fghijkl mnopq rstuvwx yz 0
1 2 6
25,346
s388512558
p01086
u292492602
1561994137
Python
Python3
py
Accepted
60
7424
968
import sys from inspect import currentframe def pri(*args): names = {id(v): k for k, v in currentframe().f_back.f_locals.items()} # print(', '.join(names.get(id(arg), '???')+' = '+repr(arg) for arg in args)) def solve(n, w_count): pri("solve") right_count = [5, 7, 5, 7, 7] for i in range(n): ...
p01086
<h2>Short Phrase</h2> <p> A <em>Short Phrase</em> (aka. Tanku) is a fixed verse, inspired by Japanese poetry Tanka and Haiku. It is a sequence of words, each consisting of lowercase letters 'a' to 'z', and must satisfy the following condition: </p> <blockquote> (The Condition for a Short Phrase)<br> The sequence o...
9 do the best and enjoy today at acm icpc 14 oh yes by far it is wow so bad to me you know hey 15 abcde fghijkl mnopq rstuvwx yzz abcde fghijkl mnopq rstuvwx yz abcde fghijkl mnopq rstuvwx yz 0
1 2 6
25,347
s117660780
p01086
u317942270
1561854102
Python
Python3
py
Accepted
30
5624
551
ans_list = [] def judge(array): res = 0 cnt = 0 st = [5,7,5,7,7,400] for a in array: res += len(a) if res > st[cnt]: return False if res == st[cnt]: cnt += 1 res = 0 if cnt == 5: return True while True: n = int(input()) if...
p01086
<h2>Short Phrase</h2> <p> A <em>Short Phrase</em> (aka. Tanku) is a fixed verse, inspired by Japanese poetry Tanka and Haiku. It is a sequence of words, each consisting of lowercase letters 'a' to 'z', and must satisfy the following condition: </p> <blockquote> (The Condition for a Short Phrase)<br> The sequence o...
9 do the best and enjoy today at acm icpc 14 oh yes by far it is wow so bad to me you know hey 15 abcde fghijkl mnopq rstuvwx yzz abcde fghijkl mnopq rstuvwx yz abcde fghijkl mnopq rstuvwx yz 0
1 2 6
25,348
s176899375
p01086
u215870135
1561295065
Python
Python3
py
Accepted
30
5604
464
while True: n = int(input()) if n == 0: break count = [0] * n for i in range(n): count[i] = len(input()) for i in range(n-4): ind = i fin = True for tmp in [5, 7, 5, 7, 7]: while tmp > 0 and ind < n: tmp -= count[ind] ...
p01086
<h2>Short Phrase</h2> <p> A <em>Short Phrase</em> (aka. Tanku) is a fixed verse, inspired by Japanese poetry Tanka and Haiku. It is a sequence of words, each consisting of lowercase letters 'a' to 'z', and must satisfy the following condition: </p> <blockquote> (The Condition for a Short Phrase)<br> The sequence o...
9 do the best and enjoy today at acm icpc 14 oh yes by far it is wow so bad to me you know hey 15 abcde fghijkl mnopq rstuvwx yzz abcde fghijkl mnopq rstuvwx yz abcde fghijkl mnopq rstuvwx yz 0
1 2 6
25,349
s654756562
p01086
u075436827
1560855281
Python
Python3
py
Accepted
30
5624
976
flag=False def dbg(a,b=None): print(a,b) if flag else None def hante(arr,num): sum=0 for i in range(len(arr)): sum+=arr[i] if sum==num: dbg((True,i),arr) return (True,i+1) if sum>num: dbg((False,None),arr) return (False,None) dbg((False,None),arr) return (False,None) ...
p01086
<h2>Short Phrase</h2> <p> A <em>Short Phrase</em> (aka. Tanku) is a fixed verse, inspired by Japanese poetry Tanka and Haiku. It is a sequence of words, each consisting of lowercase letters 'a' to 'z', and must satisfy the following condition: </p> <blockquote> (The Condition for a Short Phrase)<br> The sequence o...
9 do the best and enjoy today at acm icpc 14 oh yes by far it is wow so bad to me you know hey 15 abcde fghijkl mnopq rstuvwx yzz abcde fghijkl mnopq rstuvwx yz abcde fghijkl mnopq rstuvwx yz 0
1 2 6
25,350
s060207951
p01086
u420485708
1560771104
Python
Python3
py
Accepted
30
5612
1,184
while True: n = int(input()) if n == 0: break w = [] go = 0 flag = True x = 0 count = 0 for i in range(n): w.append(input()) else: while count < 5: for i in range(x,n): go += len(w[i]) if flag == True: ...
p01086
<h2>Short Phrase</h2> <p> A <em>Short Phrase</em> (aka. Tanku) is a fixed verse, inspired by Japanese poetry Tanka and Haiku. It is a sequence of words, each consisting of lowercase letters 'a' to 'z', and must satisfy the following condition: </p> <blockquote> (The Condition for a Short Phrase)<br> The sequence o...
9 do the best and enjoy today at acm icpc 14 oh yes by far it is wow so bad to me you know hey 15 abcde fghijkl mnopq rstuvwx yzz abcde fghijkl mnopq rstuvwx yz abcde fghijkl mnopq rstuvwx yz 0
1 2 6
25,351
s048702164
p01086
u537067968
1558591968
Python
Python3
py
Accepted
30
5612
490
a = [5,7,5,7,7] while True: n = int(input()) if n == 0: break w = list(map(lambda x: len(input()) , range(n))) ans = 0 for i in range(n): aa, g = 0, 0 for j in range(i, n): g += w[j] if g == a[aa]: g = 0 aa += 1 ...
p01086
<h2>Short Phrase</h2> <p> A <em>Short Phrase</em> (aka. Tanku) is a fixed verse, inspired by Japanese poetry Tanka and Haiku. It is a sequence of words, each consisting of lowercase letters 'a' to 'z', and must satisfy the following condition: </p> <blockquote> (The Condition for a Short Phrase)<br> The sequence o...
9 do the best and enjoy today at acm icpc 14 oh yes by far it is wow so bad to me you know hey 15 abcde fghijkl mnopq rstuvwx yzz abcde fghijkl mnopq rstuvwx yz abcde fghijkl mnopq rstuvwx yz 0
1 2 6
25,352
s629692951
p01086
u158979022
1558166679
Python
Python3
py
Accepted
30
5616
400
tanku = [5, 7, 5, 7, 7] while True: n = int(input()) if n==0: break w = [len(input()) for i in range(n)] ans = 0 for i in range(n): sum = 0 k = 0 for j in range(i, n): sum += w[j] if sum == tanku[k]: sum = 0 k += 1 if k==5: ans = i+1 brea...
p01086
<h2>Short Phrase</h2> <p> A <em>Short Phrase</em> (aka. Tanku) is a fixed verse, inspired by Japanese poetry Tanka and Haiku. It is a sequence of words, each consisting of lowercase letters 'a' to 'z', and must satisfy the following condition: </p> <blockquote> (The Condition for a Short Phrase)<br> The sequence o...
9 do the best and enjoy today at acm icpc 14 oh yes by far it is wow so bad to me you know hey 15 abcde fghijkl mnopq rstuvwx yzz abcde fghijkl mnopq rstuvwx yz abcde fghijkl mnopq rstuvwx yz 0
1 2 6
25,353
s565367632
p01086
u701749469
1556292711
Python
Python3
py
Accepted
20
5612
1,333
def main(): while True: w_num = int(input()) if w_num == 0: break w_list = [] for i in range(w_num): w_list.append(input()) for i in range(len(w_list)): #print(w_list) leng = 0 for item in w_list: #print("leng"...
p01086
<h2>Short Phrase</h2> <p> A <em>Short Phrase</em> (aka. Tanku) is a fixed verse, inspired by Japanese poetry Tanka and Haiku. It is a sequence of words, each consisting of lowercase letters 'a' to 'z', and must satisfy the following condition: </p> <blockquote> (The Condition for a Short Phrase)<br> The sequence o...
9 do the best and enjoy today at acm icpc 14 oh yes by far it is wow so bad to me you know hey 15 abcde fghijkl mnopq rstuvwx yzz abcde fghijkl mnopq rstuvwx yz abcde fghijkl mnopq rstuvwx yz 0
1 2 6
25,354
s385933337
p01086
u717526540
1544669593
Python
Python3
py
Accepted
30
5604
750
def check(word): l = 0 step = 0 for w in word: l += len(w) if step == 0 or step == 2: if l == 5: step += 1 l = 0 elif l > 5: return False elif step == 1 or step == 3: if l == 7: step +...
p01086
<h2>Short Phrase</h2> <p> A <em>Short Phrase</em> (aka. Tanku) is a fixed verse, inspired by Japanese poetry Tanka and Haiku. It is a sequence of words, each consisting of lowercase letters 'a' to 'z', and must satisfy the following condition: </p> <blockquote> (The Condition for a Short Phrase)<br> The sequence o...
9 do the best and enjoy today at acm icpc 14 oh yes by far it is wow so bad to me you know hey 15 abcde fghijkl mnopq rstuvwx yzz abcde fghijkl mnopq rstuvwx yz abcde fghijkl mnopq rstuvwx yz 0
1 2 6
25,355
s368805814
p01086
u036729444
1544290487
Python
Python3
py
Accepted
30
5608
783
class CheckError(Exception): pass def check(wclist, count): c = 0 while True: c += wclist.pop(0) if c == count: return wclist elif c > count: raise CheckError def tanku_check(wclist): for i in range(len(wclist)): try: wcl = wclist[:][...
p01086
<h2>Short Phrase</h2> <p> A <em>Short Phrase</em> (aka. Tanku) is a fixed verse, inspired by Japanese poetry Tanka and Haiku. It is a sequence of words, each consisting of lowercase letters 'a' to 'z', and must satisfy the following condition: </p> <blockquote> (The Condition for a Short Phrase)<br> The sequence o...
9 do the best and enjoy today at acm icpc 14 oh yes by far it is wow so bad to me you know hey 15 abcde fghijkl mnopq rstuvwx yzz abcde fghijkl mnopq rstuvwx yz abcde fghijkl mnopq rstuvwx yz 0
1 2 6
25,356
s435808295
p01086
u281836941
1513348955
Python
Python3
py
Accepted
30
5612
801
# coding: utf-8 while 1: data=[] for i in range(int(input())): data.append(len(input())) if len(data)==0: break for i in range(len(data)): j=i tmp=0 while tmp<5: tmp+=data[j] j+=1 if tmp!=5: continue tmp=0 ...
p01086
<h2>Short Phrase</h2> <p> A <em>Short Phrase</em> (aka. Tanku) is a fixed verse, inspired by Japanese poetry Tanka and Haiku. It is a sequence of words, each consisting of lowercase letters 'a' to 'z', and must satisfy the following condition: </p> <blockquote> (The Condition for a Short Phrase)<br> The sequence o...
9 do the best and enjoy today at acm icpc 14 oh yes by far it is wow so bad to me you know hey 15 abcde fghijkl mnopq rstuvwx yzz abcde fghijkl mnopq rstuvwx yz abcde fghijkl mnopq rstuvwx yz 0
1 2 6
25,357
s394650100
p01087
u847467233
1531430376
Python
Python3
py
Accepted
30
5608
572
# AOJ 1602: ICPC Calculator # Python3 2018.7.13 bal4u def calc(lvl, idx): c = e[idx][lvl] if c.isdigit(): return [int(c), idx+1] lvl, idx = lvl+1, idx+1 x = 0 if c == '+' else 1 while idx < len(e): f = i = 0 while i < len(e[idx]) and i < lvl: if e[idx][i] != '.': break i += 1 if i < lvl: break if e[...
p01087
<h2>ICPC Calculator</h2> <p> In mathematics, we usually specify the order of operations by using parentheses. For example, 7 × (3 + 2) always means multiplying 7 by the result of 3 + 2 and never means adding 2 to the result of 7 × 3. However, there are people who do not like parentheses. International Counter of Par...
1 9 4 + .1 .2 .3 9 + .0 .+ ..* ...1 ...* ....1 ....2 ..0 10 + .+ ..6 ..2 .+ ..1 ..* ...7 ...6 .3 0
9 6 2 54
25,358
s140435478
p01087
u328199937
1556174713
Python
Python3
py
Accepted
40
5632
1,191
ans_list = [] def calclater(a, num_list): if a == "*": ans = 1 for i in num_list: ans *= int(i) elif a == "+": ans = 0 for i in num_list: ans += int(i) return str(ans) while True: n = int(input()) if not n: break s_list = [[] for i...
p01087
<h2>ICPC Calculator</h2> <p> In mathematics, we usually specify the order of operations by using parentheses. For example, 7 × (3 + 2) always means multiplying 7 by the result of 3 + 2 and never means adding 2 to the result of 7 × 3. However, there are people who do not like parentheses. International Counter of Par...
1 9 4 + .1 .2 .3 9 + .0 .+ ..* ...1 ...* ....1 ....2 ..0 10 + .+ ..6 ..2 .+ ..1 ..* ...7 ...6 .3 0
9 6 2 54
25,359
s972549450
p01087
u802625365
1480770615
Python
Python3
py
Accepted
40
7676
650
def product(lst): ret = 1 for i in lst: ret *= i return ret def dfs(lst, index, level): nums = [] for i in range(index, len(lst)): dn = lst[i].count(".") if level == dn: s = lst[i][level] if s=='+': nums.append(sum(dfs(lst, i+1, level+...
p01087
<h2>ICPC Calculator</h2> <p> In mathematics, we usually specify the order of operations by using parentheses. For example, 7 × (3 + 2) always means multiplying 7 by the result of 3 + 2 and never means adding 2 to the result of 7 × 3. However, there are people who do not like parentheses. International Counter of Par...
1 9 4 + .1 .2 .3 9 + .0 .+ ..* ...1 ...* ....1 ....2 ..0 10 + .+ ..6 ..2 .+ ..1 ..* ...7 ...6 .3 0
9 6 2 54
25,360
s838103164
p01087
u260980560
1482771001
Python
Python
py
Accepted
10
6420
928
def expression(ss, i, c_level): s = ss[i] code = s[-1] if code == "+": return plus(ss, i+1, c_level+1) elif code == "*": return product(ss, i+1, c_level+1) return int(s[c_level:]) def plus(ss, i, c_level): num = 0 while i < len(ss): s = ss[i] level = len(s)-1...
p01087
<h2>ICPC Calculator</h2> <p> In mathematics, we usually specify the order of operations by using parentheses. For example, 7 × (3 + 2) always means multiplying 7 by the result of 3 + 2 and never means adding 2 to the result of 7 × 3. However, there are people who do not like parentheses. International Counter of Par...
1 9 4 + .1 .2 .3 9 + .0 .+ ..* ...1 ...* ....1 ....2 ..0 10 + .+ ..6 ..2 .+ ..1 ..* ...7 ...6 .3 0
9 6 2 54
25,361
s600672673
p01087
u408260374
1493635668
Python
Python3
py
Accepted
30
7656
626
def parser(i): idx = i dep = s[i].count('.') i += 1 arr = [] while i < N and s[i].count(".") > dep: if "+" in s[i] or "*" in s[i]: num, i = parser(i) arr.append(num) else: arr.append(int(s[i].replace('.', ''))) i += 1 if "+" in s[idx]: ...
p01087
<h2>ICPC Calculator</h2> <p> In mathematics, we usually specify the order of operations by using parentheses. For example, 7 × (3 + 2) always means multiplying 7 by the result of 3 + 2 and never means adding 2 to the result of 7 × 3. However, there are people who do not like parentheses. International Counter of Par...
1 9 4 + .1 .2 .3 9 + .0 .+ ..* ...1 ...* ....1 ....2 ..0 10 + .+ ..6 ..2 .+ ..1 ..* ...7 ...6 .3 0
9 6 2 54
25,362
s235332726
p01087
u724963150
1496330861
Python
Python3
py
Accepted
30
7632
1,359
while True: n=int(input()) if n==0: break; elif n==1: print(input()) continue; li=[input() for i in range(n)] index=0 def pls(depth): k=0 global index while len(li[index])>depth and li[index][depth-1]=='.': if (not li[index][depth]=='+'...
p01087
<h2>ICPC Calculator</h2> <p> In mathematics, we usually specify the order of operations by using parentheses. For example, 7 × (3 + 2) always means multiplying 7 by the result of 3 + 2 and never means adding 2 to the result of 7 × 3. However, there are people who do not like parentheses. International Counter of Par...
1 9 4 + .1 .2 .3 9 + .0 .+ ..* ...1 ...* ....1 ....2 ..0 10 + .+ ..6 ..2 .+ ..1 ..* ...7 ...6 .3 0
9 6 2 54
25,363
s078813105
p01087
u667806071
1497274224
Python
Python3
py
Accepted
40
7628
985
def resolve(): n = int(input()) if n == 0: return False field = [] def add(a): result = 0 for i in a: result += i return result def mult(a): result = 1 for i in a: result *= i return result op = {"+": add, "*": m...
p01087
<h2>ICPC Calculator</h2> <p> In mathematics, we usually specify the order of operations by using parentheses. For example, 7 × (3 + 2) always means multiplying 7 by the result of 3 + 2 and never means adding 2 to the result of 7 × 3. However, there are people who do not like parentheses. International Counter of Par...
1 9 4 + .1 .2 .3 9 + .0 .+ ..* ...1 ...* ....1 ....2 ..0 10 + .+ ..6 ..2 .+ ..1 ..* ...7 ...6 .3 0
9 6 2 54
25,364
s111593546
p01087
u283315132
1498010583
Python
Python3
py
Accepted
40
7800
1,473
opr_list = ["+", "*"] def solve(): N = int(input()) while(N != 0): if(N == 1): print(int(input())) else: ans = [0 for i in range(20)] s = [] opr = [0 for i in range(20)] for i in range(N): s.append(list(input())) ...
p01087
<h2>ICPC Calculator</h2> <p> In mathematics, we usually specify the order of operations by using parentheses. For example, 7 × (3 + 2) always means multiplying 7 by the result of 3 + 2 and never means adding 2 to the result of 7 × 3. However, there are people who do not like parentheses. International Counter of Par...
1 9 4 + .1 .2 .3 9 + .0 .+ ..* ...1 ...* ....1 ....2 ..0 10 + .+ ..6 ..2 .+ ..1 ..* ...7 ...6 .3 0
9 6 2 54
25,365
s152739256
p01087
u339921062
1499232838
Python
Python
py
Accepted
20
6524
741
while 1: n = input() if n == 0: break st = [[]] for i in xrange(n): s = raw_input() lev = s.count('.') v = s[lev:] while lev+1 < len(st): top = st.pop() op = st[-1].pop() if op == '+': st[-1].append(sum(top)) ...
p01087
<h2>ICPC Calculator</h2> <p> In mathematics, we usually specify the order of operations by using parentheses. For example, 7 × (3 + 2) always means multiplying 7 by the result of 3 + 2 and never means adding 2 to the result of 7 × 3. However, there are people who do not like parentheses. International Counter of Par...
1 9 4 + .1 .2 .3 9 + .0 .+ ..* ...1 ...* ....1 ....2 ..0 10 + .+ ..6 ..2 .+ ..1 ..* ...7 ...6 .3 0
9 6 2 54
25,366
s278779037
p01087
u881891940
1522132640
Python
Python3
py
Accepted
40
5604
576
def inp(): global n n = int(input()) return n def strinp(): l = 0 s = list(input()) for i in s: if i == '.': l += 1 else: c = i return [l,c] def calc(p): global f l = f[p][0] c = f[p][1] p += 1 if c == '+': ans = 0 for i in range(p,n): if f[i][0] == l: break elif f[i][0] == l+1: ...
p01087
<h2>ICPC Calculator</h2> <p> In mathematics, we usually specify the order of operations by using parentheses. For example, 7 × (3 + 2) always means multiplying 7 by the result of 3 + 2 and never means adding 2 to the result of 7 × 3. However, there are people who do not like parentheses. International Counter of Par...
1 9 4 + .1 .2 .3 9 + .0 .+ ..* ...1 ...* ....1 ....2 ..0 10 + .+ ..6 ..2 .+ ..1 ..* ...7 ...6 .3 0
9 6 2 54
25,367
s187866465
p01087
u509278866
1528707162
Python
Python3
py
Accepted
70
9048
1,827
import math,string,itertools,fractions,heapq,collections,re,array,bisect,sys,random,time,copy,functools sys.setrecursionlimit(10**7) inf = 10**20 eps = 1.0 / 10**10 mod = 998244353 dd = [(0,-1),(1,0),(0,1),(-1,0)] ddn = [(0,-1),(1,-1),(1,0),(1,1),(0,1),(-1,-1),(-1,0),(-1,1)] def LI(): return [int(x) for x in sys.stdi...
p01087
<h2>ICPC Calculator</h2> <p> In mathematics, we usually specify the order of operations by using parentheses. For example, 7 × (3 + 2) always means multiplying 7 by the result of 3 + 2 and never means adding 2 to the result of 7 × 3. However, there are people who do not like parentheses. International Counter of Par...
1 9 4 + .1 .2 .3 9 + .0 .+ ..* ...1 ...* ....1 ....2 ..0 10 + .+ ..6 ..2 .+ ..1 ..* ...7 ...6 .3 0
9 6 2 54
25,368
s560861080
p01087
u855199458
1530204793
Python
Python3
py
Accepted
40
6012
691
# -*- coding: utf-8 -*- from collections import defaultdict def inpl(): return list(map(int, input().split())) N = int(input()) def cal(i): if B[i] == "*": tmp = 1 for g in G[i]: tmp *= cal(g) elif B[i] == "+": tmp = 0 for g in G[i]: tmp += cal(g) el...
p01087
<h2>ICPC Calculator</h2> <p> In mathematics, we usually specify the order of operations by using parentheses. For example, 7 × (3 + 2) always means multiplying 7 by the result of 3 + 2 and never means adding 2 to the result of 7 × 3. However, there are people who do not like parentheses. International Counter of Par...
1 9 4 + .1 .2 .3 9 + .0 .+ ..* ...1 ...* ....1 ....2 ..0 10 + .+ ..6 ..2 .+ ..1 ..* ...7 ...6 .3 0
9 6 2 54
25,369
s740153381
p01087
u986045679
1530263471
Python
Python3
py
Accepted
60
6560
755
import re def dotexit(s): return re.sub("^\.","",s) def prod(l): x=1 for i in l: x *= i return x def rec(s): nums=[dotexit(x) for x in s[1:]] ad = [] for i in range(len(nums)): if nums[i]=='+' or nums[i]=='*': rl=[nums[i]] for j in range(i+1,len(nums)): if nums[j][0] == '.': ...
p01087
<h2>ICPC Calculator</h2> <p> In mathematics, we usually specify the order of operations by using parentheses. For example, 7 × (3 + 2) always means multiplying 7 by the result of 3 + 2 and never means adding 2 to the result of 7 × 3. However, there are people who do not like parentheses. International Counter of Par...
1 9 4 + .1 .2 .3 9 + .0 .+ ..* ...1 ...* ....1 ....2 ..0 10 + .+ ..6 ..2 .+ ..1 ..* ...7 ...6 .3 0
9 6 2 54
25,370
s482037977
p01087
u798087532
1530349854
Python
Python3
py
Accepted
30
5604
534
def cal(lst,op): if op == '+': return sum(lst) else: ret = 1 for num in lst: ret *= num return ret def rec (): global n,S,idx op = S[idx][-1] nst = len(S[idx]) idx += 1 lst = [] while idx < n: if len(S[idx]) <= nst: break if not S[idx][-1].isdigit(): lst.append(rec()) else: lst.appen...
p01087
<h2>ICPC Calculator</h2> <p> In mathematics, we usually specify the order of operations by using parentheses. For example, 7 × (3 + 2) always means multiplying 7 by the result of 3 + 2 and never means adding 2 to the result of 7 × 3. However, there are people who do not like parentheses. International Counter of Par...
1 9 4 + .1 .2 .3 9 + .0 .+ ..* ...1 ...* ....1 ....2 ..0 10 + .+ ..6 ..2 .+ ..1 ..* ...7 ...6 .3 0
9 6 2 54
25,371
s138119905
p01087
u731941832
1530458844
Python
Python3
py
Accepted
40
5608
822
while True: n = int(input()) if n == 0:break a = [input() for _ in range(n)] while True: if len(a) == 1:break c = 0 s = 0 for i in range(len(a)): if a[i].count('.') > c: c = a[i].count('.') s = i e = s while e < ...
p01087
<h2>ICPC Calculator</h2> <p> In mathematics, we usually specify the order of operations by using parentheses. For example, 7 × (3 + 2) always means multiplying 7 by the result of 3 + 2 and never means adding 2 to the result of 7 × 3. However, there are people who do not like parentheses. International Counter of Par...
1 9 4 + .1 .2 .3 9 + .0 .+ ..* ...1 ...* ....1 ....2 ..0 10 + .+ ..6 ..2 .+ ..1 ..* ...7 ...6 .3 0
9 6 2 54
25,372
s370334753
p01087
u467175809
1530533832
Python
Python
py
Accepted
30
5076
1,189
#!/usr/bin/env python from collections import deque import itertools as it import sys import math while True: n = input() lst = [] if n == 0: break if n == 1: num = input() print num continue for loop in range(n): S = raw_input() lst.append((len(S), ...
p01087
<h2>ICPC Calculator</h2> <p> In mathematics, we usually specify the order of operations by using parentheses. For example, 7 × (3 + 2) always means multiplying 7 by the result of 3 + 2 and never means adding 2 to the result of 7 × 3. However, there are people who do not like parentheses. International Counter of Par...
1 9 4 + .1 .2 .3 9 + .0 .+ ..* ...1 ...* ....1 ....2 ..0 10 + .+ ..6 ..2 .+ ..1 ..* ...7 ...6 .3 0
9 6 2 54
25,373
s827960821
p01087
u464321546
1562813617
Python
Python3
py
Accepted
30
5612
1,199
def dfs(l): x = len(l[0]) if l[0][-1] == "+": b = 0 i = 1 while i < len(l): if len(l[i]) == x + 1 and "0" <= l[i][-1] <= "9": b += int(l[i][-1]) i += 1 elif len(l[i]) == x + 1 and (l[i][-1] == "+" or l[i][-1] == "*"): ...
p01087
<h2>ICPC Calculator</h2> <p> In mathematics, we usually specify the order of operations by using parentheses. For example, 7 × (3 + 2) always means multiplying 7 by the result of 3 + 2 and never means adding 2 to the result of 7 × 3. However, there are people who do not like parentheses. International Counter of Par...
1 9 4 + .1 .2 .3 9 + .0 .+ ..* ...1 ...* ....1 ....2 ..0 10 + .+ ..6 ..2 .+ ..1 ..* ...7 ...6 .3 0
9 6 2 54
25,374
s239537708
p01087
u881776454
1562768437
Python
Python3
py
Accepted
30
5608
480
while True: n = int(input()) if n == 0: break w = [input() for _ in range(n)] w = reversed(w) eles = [[] for _ in range(9)] for item in w: d,c = len(item) - 1,item[-1] if c == "+": eles[d].append(sum(eles[d+1])) eles[d+1] = [] elif c == "*": tmp = 1 for ...
p01087
<h2>ICPC Calculator</h2> <p> In mathematics, we usually specify the order of operations by using parentheses. For example, 7 × (3 + 2) always means multiplying 7 by the result of 3 + 2 and never means adding 2 to the result of 7 × 3. However, there are people who do not like parentheses. International Counter of Par...
1 9 4 + .1 .2 .3 9 + .0 .+ ..* ...1 ...* ....1 ....2 ..0 10 + .+ ..6 ..2 .+ ..1 ..* ...7 ...6 .3 0
9 6 2 54
25,375
s334532371
p01087
u191474223
1562675587
Python
Python3
py
Accepted
60
7176
1,969
from collections import defaultdict,deque import sys,heapq,bisect,math,itertools,string,queue,copy,time sys.setrecursionlimit(10**8) INF = float('inf') mod = 10**9+7 eps = 10**-7 def inp(): return int(input()) def inpl(): return list(map(int, input().split())) def inpl_str(): return list(input().split()) while True: ...
p01087
<h2>ICPC Calculator</h2> <p> In mathematics, we usually specify the order of operations by using parentheses. For example, 7 × (3 + 2) always means multiplying 7 by the result of 3 + 2 and never means adding 2 to the result of 7 × 3. However, there are people who do not like parentheses. International Counter of Par...
1 9 4 + .1 .2 .3 9 + .0 .+ ..* ...1 ...* ....1 ....2 ..0 10 + .+ ..6 ..2 .+ ..1 ..* ...7 ...6 .3 0
9 6 2 54
25,376
s525214606
p01087
u215870135
1562500581
Python
Python3
py
Accepted
30
5636
1,198
import sys input = sys.stdin.readline def calc(i, level, fs, lim): if fs[i][1] not in "+*": return i, int(fs[i][1]) if fs[i][1] == "+": tmp = 0 j = i+1 while j < lim: if fs[j][0] <= level: break if fs[j][1] in "*+": j, tmp2...
p01087
<h2>ICPC Calculator</h2> <p> In mathematics, we usually specify the order of operations by using parentheses. For example, 7 × (3 + 2) always means multiplying 7 by the result of 3 + 2 and never means adding 2 to the result of 7 × 3. However, there are people who do not like parentheses. International Counter of Par...
1 9 4 + .1 .2 .3 9 + .0 .+ ..* ...1 ...* ....1 ....2 ..0 10 + .+ ..6 ..2 .+ ..1 ..* ...7 ...6 .3 0
9 6 2 54
25,377
s055067942
p01087
u317942270
1561896226
Python
Python3
py
Accepted
30
5628
700
ans_list = [] def calc(i0=0): if S[i0][-1] == "+": res = 0 for i in range(i0+1,n): if len(S[i]) == len(S[i0]) + 1: res += calc(i) elif len(S[i]) <= len(S[i0]): return res elif S[i0][-1] == "*": res = 1 for i in range(i0+1,n...
p01087
<h2>ICPC Calculator</h2> <p> In mathematics, we usually specify the order of operations by using parentheses. For example, 7 × (3 + 2) always means multiplying 7 by the result of 3 + 2 and never means adding 2 to the result of 7 × 3. However, there are people who do not like parentheses. International Counter of Par...
1 9 4 + .1 .2 .3 9 + .0 .+ ..* ...1 ...* ....1 ....2 ..0 10 + .+ ..6 ..2 .+ ..1 ..* ...7 ...6 .3 0
9 6 2 54
25,378
s643639769
p01087
u591052358
1561787077
Python
Python3
py
Accepted
30
5616
1,182
def solve(x,a,ind): # print(x,a,ind) if "0" <= a[0][ind] <="9": return int(a[0][ind]) if a[0][ind] =="+": i = j= 1 su = 0 while(i < x): if a[i][ind+1] == "+" or a[i][ind+1]=="*": j+=1 while j < x and a[j][ind +1]==".": ...
p01087
<h2>ICPC Calculator</h2> <p> In mathematics, we usually specify the order of operations by using parentheses. For example, 7 × (3 + 2) always means multiplying 7 by the result of 3 + 2 and never means adding 2 to the result of 7 × 3. However, there are people who do not like parentheses. International Counter of Par...
1 9 4 + .1 .2 .3 9 + .0 .+ ..* ...1 ...* ....1 ....2 ..0 10 + .+ ..6 ..2 .+ ..1 ..* ...7 ...6 .3 0
9 6 2 54
25,379
s054777524
p01087
u537067968
1561724857
Python
Python3
py
Accepted
60
6580
704
import re while True : n = int(input()) if n == 0:break s = [input() for _ in range(n)] stack = [] for n in reversed(s): if re.match("\.*(\+|\*)",n): ope = n[-1] depth = n.count(".") + 1 if ope == "+":ans = 0 else: ans = 1 for i,a...
p01087
<h2>ICPC Calculator</h2> <p> In mathematics, we usually specify the order of operations by using parentheses. For example, 7 × (3 + 2) always means multiplying 7 by the result of 3 + 2 and never means adding 2 to the result of 7 × 3. However, there are people who do not like parentheses. International Counter of Par...
1 9 4 + .1 .2 .3 9 + .0 .+ ..* ...1 ...* ....1 ....2 ..0 10 + .+ ..6 ..2 .+ ..1 ..* ...7 ...6 .3 0
9 6 2 54
25,380
s047637042
p01087
u217669130
1561708119
Python
Python3
py
Accepted
50
5620
1,097
from sys import setrecursionlimit setrecursionlimit(10 ** 8) def mul(A): res = 1 for a in A: res *= a return res O = {'+': sum, '*': mul} class Source(): def __init__(self, S, i = 0): self.S = S self.pos = i def peek(S): return S.S[S.pos] if S.pos < len(S.S) else 'a' de...
p01087
<h2>ICPC Calculator</h2> <p> In mathematics, we usually specify the order of operations by using parentheses. For example, 7 × (3 + 2) always means multiplying 7 by the result of 3 + 2 and never means adding 2 to the result of 7 × 3. However, there are people who do not like parentheses. International Counter of Par...
1 9 4 + .1 .2 .3 9 + .0 .+ ..* ...1 ...* ....1 ....2 ..0 10 + .+ ..6 ..2 .+ ..1 ..* ...7 ...6 .3 0
9 6 2 54
25,381
s355037416
p01087
u853158149
1560807719
Python
Python3
py
Accepted
40
6016
4,317
#2005_c """ n = int(input()) k = list("mcxi") for i in range(n): d = {"m":0,"c":0,"x":0,"i":0} a,b = input().split() a = list(a) b = list(b) a.insert(0,1) b.insert(0,1) for j in range(1,len(a)): if a[j] in k: if a[j-1] in k: d[a[j]] += 1 else:...
p01087
<h2>ICPC Calculator</h2> <p> In mathematics, we usually specify the order of operations by using parentheses. For example, 7 × (3 + 2) always means multiplying 7 by the result of 3 + 2 and never means adding 2 to the result of 7 × 3. However, there are people who do not like parentheses. International Counter of Par...
1 9 4 + .1 .2 .3 9 + .0 .+ ..* ...1 ...* ....1 ....2 ..0 10 + .+ ..6 ..2 .+ ..1 ..* ...7 ...6 .3 0
9 6 2 54
25,382
s123740830
p01087
u046108504
1560610196
Python
Python3
py
Accepted
60
6568
908
import re while True: N = int(input()) if N == 0: break formula = [input() for _ in range(N)] # print(formula) stack = [] for i in reversed(formula): # print(stack) if re.match("\.*(\*|\+)", i): depth = i.count(".") i = i.replace(".", "") ...
p01087
<h2>ICPC Calculator</h2> <p> In mathematics, we usually specify the order of operations by using parentheses. For example, 7 × (3 + 2) always means multiplying 7 by the result of 3 + 2 and never means adding 2 to the result of 7 × 3. However, there are people who do not like parentheses. International Counter of Par...
1 9 4 + .1 .2 .3 9 + .0 .+ ..* ...1 ...* ....1 ....2 ..0 10 + .+ ..6 ..2 .+ ..1 ..* ...7 ...6 .3 0
9 6 2 54
25,383
s738066228
p01087
u245823788
1559993905
Python
Python3
py
Accepted
40
5608
793
while True: n = int(input()) if n==0: break if n==1: print(int(input())) continue op = "+*" f = [input() for i in range(n)] f = f[::-1] stack = [] for i in range(n): if f[i][-1] not in op: stack.append(f[i]) else: nest = f[i].count(".") if f[i][-1]=="*": c...
p01087
<h2>ICPC Calculator</h2> <p> In mathematics, we usually specify the order of operations by using parentheses. For example, 7 × (3 + 2) always means multiplying 7 by the result of 3 + 2 and never means adding 2 to the result of 7 × 3. However, there are people who do not like parentheses. International Counter of Par...
1 9 4 + .1 .2 .3 9 + .0 .+ ..* ...1 ...* ....1 ....2 ..0 10 + .+ ..6 ..2 .+ ..1 ..* ...7 ...6 .3 0
9 6 2 54
25,384
s996203644
p01087
u150984829
1559976707
Python
Python3
py
Accepted
40
5612
532
for n in iter(input, '0'): st = '' prv_lv = 0 ops = [''] for _ in range(int(n)): line = input() lv = line.count('.') op = line[lv:] while prv_lv > lv: ops.pop() st += ')' prv_lv -= 1 if op in '*+': st += ops[-1] ...
p01087
<h2>ICPC Calculator</h2> <p> In mathematics, we usually specify the order of operations by using parentheses. For example, 7 × (3 + 2) always means multiplying 7 by the result of 3 + 2 and never means adding 2 to the result of 7 × 3. However, there are people who do not like parentheses. International Counter of Par...
1 9 4 + .1 .2 .3 9 + .0 .+ ..* ...1 ...* ....1 ....2 ..0 10 + .+ ..6 ..2 .+ ..1 ..* ...7 ...6 .3 0
9 6 2 54
25,385
s737417713
p01087
u352394527
1545168130
Python
Python3
py
Accepted
60
6296
950
from functools import reduce import operator while True: n = int(input()) if n == 0:break def fix(x): if x[-1] in ("+", "*"): return (x.count("."), x[-1]) else: return (x.count("."), int(x[-1])) lst = [fix(input()) for _ in range(n)] while True: if len(lst) == 1: print(lst[0][1...
p01087
<h2>ICPC Calculator</h2> <p> In mathematics, we usually specify the order of operations by using parentheses. For example, 7 × (3 + 2) always means multiplying 7 by the result of 3 + 2 and never means adding 2 to the result of 7 × 3. However, there are people who do not like parentheses. International Counter of Par...
1 9 4 + .1 .2 .3 9 + .0 .+ ..* ...1 ...* ....1 ....2 ..0 10 + .+ ..6 ..2 .+ ..1 ..* ...7 ...6 .3 0
9 6 2 54
25,386
s916199007
p01087
u036729444
1544313340
Python
Python3
py
Accepted
50
6292
806
import functools import operator def calc(exps, level): lst = [] while exps: exp = exps[0] nlevel = len(exp)-1 if nlevel < level: break else: val = exps.pop(0)[-1] if val in ('+', '*'): operand = calc(exps, level+1) ...
p01087
<h2>ICPC Calculator</h2> <p> In mathematics, we usually specify the order of operations by using parentheses. For example, 7 × (3 + 2) always means multiplying 7 by the result of 3 + 2 and never means adding 2 to the result of 7 × 3. However, there are people who do not like parentheses. International Counter of Par...
1 9 4 + .1 .2 .3 9 + .0 .+ ..* ...1 ...* ....1 ....2 ..0 10 + .+ ..6 ..2 .+ ..1 ..* ...7 ...6 .3 0
9 6 2 54
25,387
s987170507
p01087
u281836941
1532335153
Python
Python3
py
Accepted
50
6276
631
# coding: utf-8 from functools import reduce def check(dt,st,lv): global p if p>=len(dt): return st if not dt[p][-1].isdigit() and lv==len(dt[p]): tmp=p p+=1 st.append(reduce(lambda a,b:a+b if dt[tmp][-1]=='+' else a*b,check(dt,[],lv+1))) return check(dt,st,l...
p01087
<h2>ICPC Calculator</h2> <p> In mathematics, we usually specify the order of operations by using parentheses. For example, 7 × (3 + 2) always means multiplying 7 by the result of 3 + 2 and never means adding 2 to the result of 7 × 3. However, there are people who do not like parentheses. International Counter of Par...
1 9 4 + .1 .2 .3 9 + .0 .+ ..* ...1 ...* ....1 ....2 ..0 10 + .+ ..6 ..2 .+ ..1 ..* ...7 ...6 .3 0
9 6 2 54
25,388
s153703217
p01093
u847467233
1531430856
Python
Python3
py
Accepted
40
5628
274
# AOJ 1608: Selection of Participants of an Experime... # Python3 2018.7.13 bal4u while True: n = int(input()) if n == 0: break a = list(map(int, input().split())) a.sort() ans = a[1]-a[0] for i in range(2, n): if a[i]-a[i-1] < ans: ans = a[i]-a[i-1]; print(ans)
p01093
<h3>Selection of Participants of an Experiment</h3> <p> Dr. Tsukuba has devised a new method of programming training. In order to evaluate the effectiveness of this method, he plans to carry out a control experiment. Having two students as the participants of the experiment, one of them will be trained under the conv...
5 10 10 10 10 10 5 1 5 8 9 11 7 11 34 83 47 59 29 70 0
0 1 5
25,389
s188712880
p01093
u786072601
1541128002
Python
Python3
py
Accepted
40
5652
334
n=int(input()) result=[] while n!=0: data=list(map(int,input().split())) data=sorted(data) answer=1000000 for i in range(0,n-1): d=data[i+1]-data[i] if d<answer: answer=d result.append(answer) n=int(input()) for i in range(0,len(result)): pri...
p01093
<h3>Selection of Participants of an Experiment</h3> <p> Dr. Tsukuba has devised a new method of programming training. In order to evaluate the effectiveness of this method, he plans to carry out a control experiment. Having two students as the participants of the experiment, one of them will be trained under the conv...
5 10 10 10 10 10 5 1 5 8 9 11 7 11 34 83 47 59 29 70 0
0 1 5
25,390
s265772762
p01093
u046108504
1555945651
Python
Python3
py
Accepted
50
5648
224
while True: N = int(input()) if N == 0: break A = sorted(list(map(int, input().split()))) ans = float('inf') for i in range(1, len(A)): ans = min(abs(A[i] - A[i - 1]), ans) print(ans)
p01093
<h3>Selection of Participants of an Experiment</h3> <p> Dr. Tsukuba has devised a new method of programming training. In order to evaluate the effectiveness of this method, he plans to carry out a control experiment. Having two students as the participants of the experiment, one of them will be trained under the conv...
5 10 10 10 10 10 5 1 5 8 9 11 7 11 34 83 47 59 29 70 0
0 1 5
25,391
s132395088
p01093
u191474223
1559120733
Python
Python3
py
Accepted
80
7524
495
from collections import defaultdict,deque import sys,heapq,bisect,math,itertools,string,queue,datetime sys.setrecursionlimit(10**8) INF = float('inf') mod = 10**9+7 eps = 10**-7 def inpl(): return list(map(int, input().split())) def inpl_str(): return list(input().split()) while True: n = int(input()) if n == ...
p01093
<h3>Selection of Participants of an Experiment</h3> <p> Dr. Tsukuba has devised a new method of programming training. In order to evaluate the effectiveness of this method, he plans to carry out a control experiment. Having two students as the participants of the experiment, one of them will be trained under the conv...
5 10 10 10 10 10 5 1 5 8 9 11 7 11 34 83 47 59 29 70 0
0 1 5
25,392
s646396944
p01093
u777299405
1480065873
Python
Python3
py
Accepted
50
7688
237
while True: n = int(input()) if n == 0: break a = sorted(list(map(int, input().split()))) ans = 1000001 for i in range(n - 1): j = a[i + 1] - a[i] if j < ans: ans = j print(ans)
p01093
<h3>Selection of Participants of an Experiment</h3> <p> Dr. Tsukuba has devised a new method of programming training. In order to evaluate the effectiveness of this method, he plans to carry out a control experiment. Having two students as the participants of the experiment, one of them will be trained under the conv...
5 10 10 10 10 10 5 1 5 8 9 11 7 11 34 83 47 59 29 70 0
0 1 5
25,393
s369819249
p01093
u685815919
1481250465
Python
Python
py
Accepted
30
6284
175
while True: n=int(raw_input()) if n==0: break a=sorted(map(int,raw_input().split())) d=10**9 for i in xrange(n-1): d=min(d,a[i+1]-a[i]) print d
p01093
<h3>Selection of Participants of an Experiment</h3> <p> Dr. Tsukuba has devised a new method of programming training. In order to evaluate the effectiveness of this method, he plans to carry out a control experiment. Having two students as the participants of the experiment, one of them will be trained under the conv...
5 10 10 10 10 10 5 1 5 8 9 11 7 11 34 83 47 59 29 70 0
0 1 5
25,394
s790084722
p01093
u301729341
1481673099
Python
Python3
py
Accepted
50
7640
284
while True: Sa = 1000000 n = int(input()) if n == 0: break Num_lis = list(map(int,input().split())) Num_lis = sorted(Num_lis) for i in range(n - 1): if Num_lis[i + 1] - Num_lis[i] < Sa: Sa = Num_lis[i + 1] - Num_lis[i] print(Sa)
p01093
<h3>Selection of Participants of an Experiment</h3> <p> Dr. Tsukuba has devised a new method of programming training. In order to evaluate the effectiveness of this method, he plans to carry out a control experiment. Having two students as the participants of the experiment, one of them will be trained under the conv...
5 10 10 10 10 10 5 1 5 8 9 11 7 11 34 83 47 59 29 70 0
0 1 5
25,395
s928749959
p01093
u660912567
1481732317
Python
Python3
py
Accepted
50
7676
179
while True: n = int(input()) if n==0: break l = sorted(list(map(int,input().split()))) r = [] for i in range(n-1): r += [l[i+1]-l[i]] print(min(r))
p01093
<h3>Selection of Participants of an Experiment</h3> <p> Dr. Tsukuba has devised a new method of programming training. In order to evaluate the effectiveness of this method, he plans to carry out a control experiment. Having two students as the participants of the experiment, one of them will be trained under the conv...
5 10 10 10 10 10 5 1 5 8 9 11 7 11 34 83 47 59 29 70 0
0 1 5
25,396
s089464046
p01093
u078042885
1484762946
Python
Python3
py
Accepted
50
7732
138
while 1: n=int(input()) if n==0:break a=sorted(list(map(int,input().split()))) print(min(a[i+1]-a[i] for i in range(n-1)))
p01093
<h3>Selection of Participants of an Experiment</h3> <p> Dr. Tsukuba has devised a new method of programming training. In order to evaluate the effectiveness of this method, he plans to carry out a control experiment. Having two students as the participants of the experiment, one of them will be trained under the conv...
5 10 10 10 10 10 5 1 5 8 9 11 7 11 34 83 47 59 29 70 0
0 1 5
25,397
s211704949
p01093
u408260374
1492944304
Python
Python3
py
Accepted
50
7716
152
while True: N = int(input()) if not N: break A = sorted(map(int, input().split())) print(min(A[i+1] - A[i] for i in range(N-1)))
p01093
<h3>Selection of Participants of an Experiment</h3> <p> Dr. Tsukuba has devised a new method of programming training. In order to evaluate the effectiveness of this method, he plans to carry out a control experiment. Having two students as the participants of the experiment, one of them will be trained under the conv...
5 10 10 10 10 10 5 1 5 8 9 11 7 11 34 83 47 59 29 70 0
0 1 5
25,398
s748438480
p01093
u546285759
1494747787
Python
Python3
py
Accepted
60
7676
207
while True: n = int(input()) if n == 0: break a = sorted(list(map(int, input().split()))) minv = 1000000 for i in range(n-1): minv = min(minv, a[i+1]-a[i]) print(minv)
p01093
<h3>Selection of Participants of an Experiment</h3> <p> Dr. Tsukuba has devised a new method of programming training. In order to evaluate the effectiveness of this method, he plans to carry out a control experiment. Having two students as the participants of the experiment, one of them will be trained under the conv...
5 10 10 10 10 10 5 1 5 8 9 11 7 11 34 83 47 59 29 70 0
0 1 5
25,399
s239412523
p01093
u011621222
1497753359
Python
Python3
py
Accepted
60
7732
205
while True: n = int(input()) if n==0: break a = [int(i) for i in input().split()] a.sort() mindiff = 10000000 for i in range(n-1): mindiff = min(mindiff, a[i+1]-a[i]) print(mindiff)
p01093
<h3>Selection of Participants of an Experiment</h3> <p> Dr. Tsukuba has devised a new method of programming training. In order to evaluate the effectiveness of this method, he plans to carry out a control experiment. Having two students as the participants of the experiment, one of them will be trained under the conv...
5 10 10 10 10 10 5 1 5 8 9 11 7 11 34 83 47 59 29 70 0
0 1 5
25,400
s330226420
p01093
u590871958
1498641436
Python
Python3
py
Accepted
50
7684
120
while int(input()) > 0: s = sorted(map(int, input().split())) print(min(abs(a - b) for (a, b) in zip(s, s[1:])))
p01093
<h3>Selection of Participants of an Experiment</h3> <p> Dr. Tsukuba has devised a new method of programming training. In order to evaluate the effectiveness of this method, he plans to carry out a control experiment. Having two students as the participants of the experiment, one of them will be trained under the conv...
5 10 10 10 10 10 5 1 5 8 9 11 7 11 34 83 47 59 29 70 0
0 1 5
25,401
s459093378
p01093
u590871958
1498726070
Python
Python3
py
Accepted
40
7704
158
while True: if int(input()) == 0: break s = sorted(map(int, input().split())) r = min(abs(x - y) for (x, y) in zip(s, s[1:])) print(r)
p01093
<h3>Selection of Participants of an Experiment</h3> <p> Dr. Tsukuba has devised a new method of programming training. In order to evaluate the effectiveness of this method, he plans to carry out a control experiment. Having two students as the participants of the experiment, one of them will be trained under the conv...
5 10 10 10 10 10 5 1 5 8 9 11 7 11 34 83 47 59 29 70 0
0 1 5
25,402
s450135823
p01093
u503263570
1501166158
Python
Python3
py
Accepted
40
7760
215
while True: n=int(input()) if n==0:break a=list(map(int,input().split())) a.sort() saisho=1000000 for i,iv in enumerate(a): if i!=0: saisho=abs(iv-b) if saisho > abs(iv-b)else saisho b=iv print(saisho)
p01093
<h3>Selection of Participants of an Experiment</h3> <p> Dr. Tsukuba has devised a new method of programming training. In order to evaluate the effectiveness of this method, he plans to carry out a control experiment. Having two students as the participants of the experiment, one of them will be trained under the conv...
5 10 10 10 10 10 5 1 5 8 9 11 7 11 34 83 47 59 29 70 0
0 1 5
25,403
s870446674
p01093
u503263570
1501166165
Python
Python3
py
Accepted
50
7736
215
while True: n=int(input()) if n==0:break a=list(map(int,input().split())) a.sort() saisho=1000000 for i,iv in enumerate(a): if i!=0: saisho=abs(iv-b) if saisho > abs(iv-b)else saisho b=iv print(saisho)
p01093
<h3>Selection of Participants of an Experiment</h3> <p> Dr. Tsukuba has devised a new method of programming training. In order to evaluate the effectiveness of this method, he plans to carry out a control experiment. Having two students as the participants of the experiment, one of them will be trained under the conv...
5 10 10 10 10 10 5 1 5 8 9 11 7 11 34 83 47 59 29 70 0
0 1 5
25,404
s818215186
p01093
u503263570
1501166169
Python
Python3
py
Accepted
50
7780
215
while True: n=int(input()) if n==0:break a=list(map(int,input().split())) a.sort() saisho=1000000 for i,iv in enumerate(a): if i!=0: saisho=abs(iv-b) if saisho > abs(iv-b)else saisho b=iv print(saisho)
p01093
<h3>Selection of Participants of an Experiment</h3> <p> Dr. Tsukuba has devised a new method of programming training. In order to evaluate the effectiveness of this method, he plans to carry out a control experiment. Having two students as the participants of the experiment, one of them will be trained under the conv...
5 10 10 10 10 10 5 1 5 8 9 11 7 11 34 83 47 59 29 70 0
0 1 5
25,405
s784100698
p01093
u503263570
1501166172
Python
Python3
py
Accepted
50
7780
215
while True: n=int(input()) if n==0:break a=list(map(int,input().split())) a.sort() saisho=1000000 for i,iv in enumerate(a): if i!=0: saisho=abs(iv-b) if saisho > abs(iv-b)else saisho b=iv print(saisho)
p01093
<h3>Selection of Participants of an Experiment</h3> <p> Dr. Tsukuba has devised a new method of programming training. In order to evaluate the effectiveness of this method, he plans to carry out a control experiment. Having two students as the participants of the experiment, one of them will be trained under the conv...
5 10 10 10 10 10 5 1 5 8 9 11 7 11 34 83 47 59 29 70 0
0 1 5
25,406
s479115747
p01093
u633333374
1502973208
Python
Python
py
Accepted
40
6556
186
while 1: n = int(input()) if n == 0: break a = sorted(map(int,raw_input().split())) b = [] for i in range(n-1): b.append(a[i+1]-a[i]) print min(b)
p01093
<h3>Selection of Participants of an Experiment</h3> <p> Dr. Tsukuba has devised a new method of programming training. In order to evaluate the effectiveness of this method, he plans to carry out a control experiment. Having two students as the participants of the experiment, one of them will be trained under the conv...
5 10 10 10 10 10 5 1 5 8 9 11 7 11 34 83 47 59 29 70 0
0 1 5
25,407
s491490398
p01093
u506554532
1513049598
Python
Python3
py
Accepted
50
5624
205
while True: N = int(input()) if N == 0: break src = list(map(int,input().split())) src.sort() ans = 10**7 for s1,s2 in zip(src,src[1:]): ans = min(ans, s2-s1) print(ans)
p01093
<h3>Selection of Participants of an Experiment</h3> <p> Dr. Tsukuba has devised a new method of programming training. In order to evaluate the effectiveness of this method, he plans to carry out a control experiment. Having two students as the participants of the experiment, one of them will be trained under the conv...
5 10 10 10 10 10 5 1 5 8 9 11 7 11 34 83 47 59 29 70 0
0 1 5
25,408
s929485595
p01093
u146816547
1523089691
Python
Python
py
Accepted
30
4712
165
while True: n = int(raw_input()) if n == 0: break a = sorted(map(int, raw_input().split())) print min([a[i+1]-a[i] for i in range(n-1)])
p01093
<h3>Selection of Participants of an Experiment</h3> <p> Dr. Tsukuba has devised a new method of programming training. In order to evaluate the effectiveness of this method, he plans to carry out a control experiment. Having two students as the participants of the experiment, one of them will be trained under the conv...
5 10 10 10 10 10 5 1 5 8 9 11 7 11 34 83 47 59 29 70 0
0 1 5
25,409
s801244866
p01093
u023471147
1526611380
Python
Python3
py
Accepted
50
5624
225
while True: n = int(input()) if n == 0: break a = list(map(int, input().split())) a.sort() mind = 1000000 for i in range(len(a) - 1): mind = min(mind, a[i + 1] - a[i]) print(mind)
p01093
<h3>Selection of Participants of an Experiment</h3> <p> Dr. Tsukuba has devised a new method of programming training. In order to evaluate the effectiveness of this method, he plans to carry out a control experiment. Having two students as the participants of the experiment, one of them will be trained under the conv...
5 10 10 10 10 10 5 1 5 8 9 11 7 11 34 83 47 59 29 70 0
0 1 5
25,410
s824901774
p01093
u777277984
1527758025
Python
Python3
py
Accepted
50
5636
288
while True: n = int(input()) if n == 0: break a = sorted(list(map(int, input().split()))) # 要素間の差を求め、最も差の小さい値を抽出する b = [] for i, x in enumerate(a[:-1]): b.append(abs(x - a[i+1])) print(min(b))
p01093
<h3>Selection of Participants of an Experiment</h3> <p> Dr. Tsukuba has devised a new method of programming training. In order to evaluate the effectiveness of this method, he plans to carry out a control experiment. Having two students as the participants of the experiment, one of them will be trained under the conv...
5 10 10 10 10 10 5 1 5 8 9 11 7 11 34 83 47 59 29 70 0
0 1 5
25,411
s973765365
p01093
u509278866
1527841484
Python
Python3
py
Accepted
70
9120
891
import math,string,itertools,fractions,heapq,collections,re,array,bisect,sys,random,time,copy,functools sys.setrecursionlimit(10**7) inf = 10**20 eps = 1.0 / 10**10 mod = 10**9+7 def LI(): return [int(x) for x in sys.stdin.readline().split()] def LI_(): return [int(x)-1 for x in sys.stdin.readline().split()] def LF()...
p01093
<h3>Selection of Participants of an Experiment</h3> <p> Dr. Tsukuba has devised a new method of programming training. In order to evaluate the effectiveness of this method, he plans to carry out a control experiment. Having two students as the participants of the experiment, one of them will be trained under the conv...
5 10 10 10 10 10 5 1 5 8 9 11 7 11 34 83 47 59 29 70 0
0 1 5
25,412
s663949087
p01093
u651355315
1529317055
Python
Python3
py
Accepted
50
5632
287
# -*- coding: utf-8 -*- while True: n = int(input()) if n == 0: break l = list(map(int, input().split())) l.sort() l.reverse() min = 10**10 for i in range(n-1): dif = l[i] - l[i+1] if dif < min: min = dif print(min)
p01093
<h3>Selection of Participants of an Experiment</h3> <p> Dr. Tsukuba has devised a new method of programming training. In order to evaluate the effectiveness of this method, he plans to carry out a control experiment. Having two students as the participants of the experiment, one of them will be trained under the conv...
5 10 10 10 10 10 5 1 5 8 9 11 7 11 34 83 47 59 29 70 0
0 1 5
25,413
s773601537
p01093
u531592024
1529593612
Python
Python3
py
Accepted
50
5620
254
while True: n = int(input()) if n == 0: break arr = list(map(int, input().split())) arr.sort() ge = arr[-1] for i in range(n - 1): tmp = arr[i + 1] - arr[i] if tmp < ge: ge = tmp print(ge)
p01093
<h3>Selection of Participants of an Experiment</h3> <p> Dr. Tsukuba has devised a new method of programming training. In order to evaluate the effectiveness of this method, he plans to carry out a control experiment. Having two students as the participants of the experiment, one of them will be trained under the conv...
5 10 10 10 10 10 5 1 5 8 9 11 7 11 34 83 47 59 29 70 0
0 1 5
25,414
s948977087
p01093
u136916346
1530159493
Python
Python3
py
Accepted
60
5644
191
while int(input()): l=sorted(map(int,input().split())) ll=range(len(l)) m=[0 for _ in ll] m[1]=abs(l[0]-l[1]) for i in ll[2:]: m[i]=min(m[i-1],abs(l[i]-l[i-1])) print(m[-1])
p01093
<h3>Selection of Participants of an Experiment</h3> <p> Dr. Tsukuba has devised a new method of programming training. In order to evaluate the effectiveness of this method, he plans to carry out a control experiment. Having two students as the participants of the experiment, one of them will be trained under the conv...
5 10 10 10 10 10 5 1 5 8 9 11 7 11 34 83 47 59 29 70 0
0 1 5
25,415
s771657699
p01093
u779523319
1596798789
Python
Python3
py
Accepted
50
5636
240
BIG_NUM=10000000 while True: n=int(input()) if n==0: break else: a=sorted(list(map(int,input().split()))) tmp=BIG_NUM for i in range(n-1): tmp=min(tmp,a[i+1]-a[i]) print(tmp)
p01093
<h3>Selection of Participants of an Experiment</h3> <p> Dr. Tsukuba has devised a new method of programming training. In order to evaluate the effectiveness of this method, he plans to carry out a control experiment. Having two students as the participants of the experiment, one of them will be trained under the conv...
5 10 10 10 10 10 5 1 5 8 9 11 7 11 34 83 47 59 29 70 0
0 1 5
25,416
s809027580
p01093
u141099640
1594439609
Python
Python3
py
Accepted
50
5640
199
while True: n = int(input()) if n == 0: break A = sorted(list(map(int, input().split()))) D =[] for i in range(n - 1): D.append(A[i + 1] - A[i]) print(min(D))
p01093
<h3>Selection of Participants of an Experiment</h3> <p> Dr. Tsukuba has devised a new method of programming training. In order to evaluate the effectiveness of this method, he plans to carry out a control experiment. Having two students as the participants of the experiment, one of them will be trained under the conv...
5 10 10 10 10 10 5 1 5 8 9 11 7 11 34 83 47 59 29 70 0
0 1 5
25,417
s471899966
p01093
u108112600
1592982398
Python
Python3
py
Accepted
40
5632
287
while True: n = int(input()) if n == 0: break scores = [int(line) for line in input().split()] scores.sort() c = scores[1] - scores[0] for i in range(2, n): if scores[i] - scores[i - 1] < c: c = scores[i] - scores[i - 1] print(c)
p01093
<h3>Selection of Participants of an Experiment</h3> <p> Dr. Tsukuba has devised a new method of programming training. In order to evaluate the effectiveness of this method, he plans to carry out a control experiment. Having two students as the participants of the experiment, one of them will be trained under the conv...
5 10 10 10 10 10 5 1 5 8 9 11 7 11 34 83 47 59 29 70 0
0 1 5
25,418
s426322028
p01093
u489396453
1592676212
Python
Python3
py
Accepted
50
5624
308
while True: n = int(input()) if n == 0: break dataset = list(map(int, input().split())) dataset.sort() minimumDiff = 99999999999999 for i in range(0,n-1): temp = dataset[i+1] - dataset[i] if minimumDiff > temp: minimumDiff = temp print(minimumDiff)
p01093
<h3>Selection of Participants of an Experiment</h3> <p> Dr. Tsukuba has devised a new method of programming training. In order to evaluate the effectiveness of this method, he plans to carry out a control experiment. Having two students as the participants of the experiment, one of them will be trained under the conv...
5 10 10 10 10 10 5 1 5 8 9 11 7 11 34 83 47 59 29 70 0
0 1 5
25,419
s461839894
p01093
u842461513
1589760925
Python
Python3
py
Accepted
50
5640
406
#入力数を入力し、0だったら入力を終わる while True: num = int(input()) if num == 0:break #入力をし、空リスト作成 line = sorted(list(map(int,input().split()))) kotae = [] #差を求め、差が一番小さい値を出力する for i in range(0,num - 1): num1 = abs(line[i] - line[i + 1]) kotae.append(num1) print(min(kotae))
p01093
<h3>Selection of Participants of an Experiment</h3> <p> Dr. Tsukuba has devised a new method of programming training. In order to evaluate the effectiveness of this method, he plans to carry out a control experiment. Having two students as the participants of the experiment, one of them will be trained under the conv...
5 10 10 10 10 10 5 1 5 8 9 11 7 11 34 83 47 59 29 70 0
0 1 5
25,420
s466758316
p01093
u198060418
1589624763
Python
Python3
py
Accepted
50
5628
203
while True: n=int(input()) if n==0:break; a=list(map(int, input().split())) a.sort() ans=a[1]-a[0] for i in range(2, n): if a[i]-a[i-1]<ans:ans=a[i]-a[i-1] print(ans)
p01093
<h3>Selection of Participants of an Experiment</h3> <p> Dr. Tsukuba has devised a new method of programming training. In order to evaluate the effectiveness of this method, he plans to carry out a control experiment. Having two students as the participants of the experiment, one of them will be trained under the conv...
5 10 10 10 10 10 5 1 5 8 9 11 7 11 34 83 47 59 29 70 0
0 1 5
25,421
s430963275
p01093
u353888999
1586288784
Python
Python3
py
Accepted
50
5620
215
while 1: n = int(input()) if n == 0: break a = list(map(int,input().split())) Min = 9999999999 a.sort() for i in range(n-1): Min = min(Min,abs(a[i] - a[i+1])) print(Min)
p01093
<h3>Selection of Participants of an Experiment</h3> <p> Dr. Tsukuba has devised a new method of programming training. In order to evaluate the effectiveness of this method, he plans to carry out a control experiment. Having two students as the participants of the experiment, one of them will be trained under the conv...
5 10 10 10 10 10 5 1 5 8 9 11 7 11 34 83 47 59 29 70 0
0 1 5
25,422
s479301165
p01093
u391297085
1584813104
Python
Python3
py
Accepted
50
5636
239
while True: n = int(input()) if n==0:break a = list(map(int, input().split())) a = sorted(a) ans = 10000000 for i in range(len(a)-1): if a[i+1]-a[i] < ans: ans = a[i+1]-a[i] print(ans)
p01093
<h3>Selection of Participants of an Experiment</h3> <p> Dr. Tsukuba has devised a new method of programming training. In order to evaluate the effectiveness of this method, he plans to carry out a control experiment. Having two students as the participants of the experiment, one of them will be trained under the conv...
5 10 10 10 10 10 5 1 5 8 9 11 7 11 34 83 47 59 29 70 0
0 1 5
25,423
s648213115
p01093
u206124123
1584002057
Python
Python3
py
Accepted
50
5636
1,221
def get_input(): input_data = int(input()) return input_data def get_data_list(): data_list = input().split() for i in range(len(data_list)): data_list[i] = int(data_list[i]) return data_list class Checker: def __init__(self, sorted_list): self.sorted_list = sorted_list ...
p01093
<h3>Selection of Participants of an Experiment</h3> <p> Dr. Tsukuba has devised a new method of programming training. In order to evaluate the effectiveness of this method, he plans to carry out a control experiment. Having two students as the participants of the experiment, one of them will be trained under the conv...
5 10 10 10 10 10 5 1 5 8 9 11 7 11 34 83 47 59 29 70 0
0 1 5
25,424
s040816251
p01093
u399902185
1581508345
Python
Python3
py
Accepted
60
5624
207
while True: n = int(input()) if(n == 0): break a = list(map(int,input().split())) a.sort() ans = 10**9 for i in range(n-1): ans = min(ans,a[i+1]-a[i]) print(ans)
p01093
<h3>Selection of Participants of an Experiment</h3> <p> Dr. Tsukuba has devised a new method of programming training. In order to evaluate the effectiveness of this method, he plans to carry out a control experiment. Having two students as the participants of the experiment, one of them will be trained under the conv...
5 10 10 10 10 10 5 1 5 8 9 11 7 11 34 83 47 59 29 70 0
0 1 5
25,425
s139455628
p01093
u829695570
1578305312
Python
Python3
py
Accepted
40
5640
160
while 1: n = int(input()) if n == 0:break a = sorted(list(map(int, input().split()))) b = [a[i+1] - a[i] for i in range(n-1)] print(min(b))
p01093
<h3>Selection of Participants of an Experiment</h3> <p> Dr. Tsukuba has devised a new method of programming training. In order to evaluate the effectiveness of this method, he plans to carry out a control experiment. Having two students as the participants of the experiment, one of them will be trained under the conv...
5 10 10 10 10 10 5 1 5 8 9 11 7 11 34 83 47 59 29 70 0
0 1 5
25,426
s425740895
p01093
u153447291
1577963535
Python
Python3
py
Accepted
50
5636
234
while True: a = int(input()) if a == 0: break b = sorted(list(map(int,input().split()))) di = -1 for i in range(a-1): h = b[i+1]-b[i] if di == -1 or h < di: di = h print(di)
p01093
<h3>Selection of Participants of an Experiment</h3> <p> Dr. Tsukuba has devised a new method of programming training. In order to evaluate the effectiveness of this method, he plans to carry out a control experiment. Having two students as the participants of the experiment, one of them will be trained under the conv...
5 10 10 10 10 10 5 1 5 8 9 11 7 11 34 83 47 59 29 70 0
0 1 5
25,427
s881451711
p01093
u314166831
1564067599
Python
Python3
py
Accepted
50
5712
3,275
# coding=utf-8 ### ### for python program ### import sys import math # math class class mymath: ### pi pi = 3.14159265358979323846264338 ### Prime Number def pnum_eratosthenes(self, n): ptable = [0 for i in range(n+1)] plist = [] for i in range(2, n+1): if ptable...
p01093
<h3>Selection of Participants of an Experiment</h3> <p> Dr. Tsukuba has devised a new method of programming training. In order to evaluate the effectiveness of this method, he plans to carry out a control experiment. Having two students as the participants of the experiment, one of them will be trained under the conv...
5 10 10 10 10 10 5 1 5 8 9 11 7 11 34 83 47 59 29 70 0
0 1 5
25,428
s519143832
p01093
u464046224
1562747501
Python
Python3
py
Accepted
70
6868
862
import sys, re from collections import deque, defaultdict, Counter from math import ceil, sqrt, hypot, factorial, pi, sin, cos, radians from itertools import permutations, combinations, product from operator import itemgetter, mul from copy import deepcopy from string import ascii_lowercase, ascii_uppercase, digits d...
p01093
<h3>Selection of Participants of an Experiment</h3> <p> Dr. Tsukuba has devised a new method of programming training. In order to evaluate the effectiveness of this method, he plans to carry out a control experiment. Having two students as the participants of the experiment, one of them will be trained under the conv...
5 10 10 10 10 10 5 1 5 8 9 11 7 11 34 83 47 59 29 70 0
0 1 5
25,429
s092645189
p01093
u590790367
1562746060
Python
Python3
py
Accepted
50
5624
208
while True: n = int(input()) if n==0: break a = list(map(int,input().split())) a.sort() res = a[1]-a[0] for i in range(1,n): res = min(res,a[i]-a[i-1]) print(res)
p01093
<h3>Selection of Participants of an Experiment</h3> <p> Dr. Tsukuba has devised a new method of programming training. In order to evaluate the effectiveness of this method, he plans to carry out a control experiment. Having two students as the participants of the experiment, one of them will be trained under the conv...
5 10 10 10 10 10 5 1 5 8 9 11 7 11 34 83 47 59 29 70 0
0 1 5
25,430
s193459944
p01093
u449777933
1562493516
Python
Python3
py
Accepted
50
5644
380
import sys def input(): return sys.stdin.readline().strip() def INT(): return int(input()) def LIST(): return list(map(int, input().split())) def MAP(): return map(int, input().split()) ans = [] while 1: n = INT() if n == 0: break a = LIST() a.sort() min_ = 100000000 for i in range(n-1): min_ = min(min_, abs...
p01093
<h3>Selection of Participants of an Experiment</h3> <p> Dr. Tsukuba has devised a new method of programming training. In order to evaluate the effectiveness of this method, he plans to carry out a control experiment. Having two students as the participants of the experiment, one of them will be trained under the conv...
5 10 10 10 10 10 5 1 5 8 9 11 7 11 34 83 47 59 29 70 0
0 1 5
25,431
s006237593
p01093
u537067968
1562221023
Python
Python3
py
Accepted
50
5620
216
while True: n = int(input()) if n == 0: break score = list(map(int,input().split())) score.sort() ans = max(score) for i in range(1,n): aa = abs(score[i] - score[i-1]) if ans > aa: ans = aa print(ans)
p01093
<h3>Selection of Participants of an Experiment</h3> <p> Dr. Tsukuba has devised a new method of programming training. In order to evaluate the effectiveness of this method, he plans to carry out a control experiment. Having two students as the participants of the experiment, one of them will be trained under the conv...
5 10 10 10 10 10 5 1 5 8 9 11 7 11 34 83 47 59 29 70 0
0 1 5
25,432
s155842677
p01093
u998734722
1562202955
Python
Python3
py
Accepted
50
5636
212
while True: n = int(input()) if n == 0: break x = list(map(int,input().split())) x = sorted(x) ans = 1000000 for i in range(n-1): ans = min(ans,x[i+1]-x[i]) print(ans)
p01093
<h3>Selection of Participants of an Experiment</h3> <p> Dr. Tsukuba has devised a new method of programming training. In order to evaluate the effectiveness of this method, he plans to carry out a control experiment. Having two students as the participants of the experiment, one of them will be trained under the conv...
5 10 10 10 10 10 5 1 5 8 9 11 7 11 34 83 47 59 29 70 0
0 1 5
25,433
s789886778
p01093
u200148444
1561973956
Python
Python3
py
Accepted
50
5628
191
while True: n=int(input()) if n==0:break l=list(map(int,input().split())) l.sort() ans=l[-1]-l[0] for i in range(n-1): ans=min(ans,l[i+1]-l[i]) print(ans)
p01093
<h3>Selection of Participants of an Experiment</h3> <p> Dr. Tsukuba has devised a new method of programming training. In order to evaluate the effectiveness of this method, he plans to carry out a control experiment. Having two students as the participants of the experiment, one of them will be trained under the conv...
5 10 10 10 10 10 5 1 5 8 9 11 7 11 34 83 47 59 29 70 0
0 1 5
25,434
s946003234
p01093
u464321546
1561802381
Python
Python3
py
Accepted
40
5632
267
def main(n): a = list(map(int, input().split())) a.sort() ans = 10 ** 20 for i in range(n - 1): if ans > a[i + 1] - a[i]: ans = a[i + 1] - a[i] print(ans) while 1: n = int(input()) if n == 0: break main(n)
p01093
<h3>Selection of Participants of an Experiment</h3> <p> Dr. Tsukuba has devised a new method of programming training. In order to evaluate the effectiveness of this method, he plans to carry out a control experiment. Having two students as the participants of the experiment, one of them will be trained under the conv...
5 10 10 10 10 10 5 1 5 8 9 11 7 11 34 83 47 59 29 70 0
0 1 5
25,435
s441273146
p01093
u616775713
1561178884
Python
Python3
py
Accepted
50
5624
266
while(True): n = int(input()) if n == 0: break else: lis = list(map(int,input().split())) lis.sort() min = 10**9+7 i = 0 while(i<len(lis)-1): if lis[i+1] - lis[i] < min: min = lis[i+1] - lis[i] i += 1 print(min)
p01093
<h3>Selection of Participants of an Experiment</h3> <p> Dr. Tsukuba has devised a new method of programming training. In order to evaluate the effectiveness of this method, he plans to carry out a control experiment. Having two students as the participants of the experiment, one of them will be trained under the conv...
5 10 10 10 10 10 5 1 5 8 9 11 7 11 34 83 47 59 29 70 0
0 1 5
25,436
s277891258
p01093
u215870135
1560743524
Python
Python3
py
Accepted
50
5648
253
ans = [] while True: n = int(input()) if n == 0: break a = sorted(list(map(int, input().split()))) min_ = a[-1] for i in range(1, n): min_ = min(min_, a[i] - a[i-1]) ans.append(min_) for i in ans: print(i)
p01093
<h3>Selection of Participants of an Experiment</h3> <p> Dr. Tsukuba has devised a new method of programming training. In order to evaluate the effectiveness of this method, he plans to carry out a control experiment. Having two students as the participants of the experiment, one of them will be trained under the conv...
5 10 10 10 10 10 5 1 5 8 9 11 7 11 34 83 47 59 29 70 0
0 1 5
25,437
s455131372
p01093
u788553535
1559723312
Python
Python3
py
Accepted
60
5628
212
while True: n = int(input()) if n == 0: break a = list(map(int,input().split())) a.sort() ans = 10**10 for i in range(n-1): ans = min(ans, abs(a[i]-a[i+1])) print(ans)
p01093
<h3>Selection of Participants of an Experiment</h3> <p> Dr. Tsukuba has devised a new method of programming training. In order to evaluate the effectiveness of this method, he plans to carry out a control experiment. Having two students as the participants of the experiment, one of them will be trained under the conv...
5 10 10 10 10 10 5 1 5 8 9 11 7 11 34 83 47 59 29 70 0
0 1 5
25,438
s092081503
p01093
u418561899
1558598364
Python
Python3
py
Accepted
50
5636
531
#成績の差が最も小さい 2 人を選ぶプログラム #1 行目には学生の人数 n (2 ≤ n ≤ 1000) #2 行目には  ai(1 ≤ i ≤ n)が i 番目の学生の成績 while True: #1行目nを読み込む n =int(input()) #もしn==0ならbreak if n==0: break else : #配列a[i]を読み込む(1<=i<=n) a = sorted(list(map(int, input().strip().split()))) a_sub = 1000000 for i in range(n-1): if...
p01093
<h3>Selection of Participants of an Experiment</h3> <p> Dr. Tsukuba has devised a new method of programming training. In order to evaluate the effectiveness of this method, he plans to carry out a control experiment. Having two students as the participants of the experiment, one of them will be trained under the conv...
5 10 10 10 10 10 5 1 5 8 9 11 7 11 34 83 47 59 29 70 0
0 1 5
25,439
s393832386
p01093
u886122084
1558329989
Python
Python3
py
Accepted
40
5664
399
# -*- coding: utf-8 -*- # python template for atcoder1 import sys sys.setrecursionlimit(10**9) input = sys.stdin.readline def solve(): N = int(input()) if N == 0: exit() L = list(map(int, input().split())) L = sorted(L) min_diff = float('inf') for l1, l2 in zip(L, L[1:]): min_d...
p01093
<h3>Selection of Participants of an Experiment</h3> <p> Dr. Tsukuba has devised a new method of programming training. In order to evaluate the effectiveness of this method, he plans to carry out a control experiment. Having two students as the participants of the experiment, one of them will be trained under the conv...
5 10 10 10 10 10 5 1 5 8 9 11 7 11 34 83 47 59 29 70 0
0 1 5
25,440
s216913923
p01093
u158979022
1558108337
Python
Python3
py
Accepted
50
5632
182
while True: n = int(input()) if n==0: break a = sorted(list(map(int, input().split()))) ans = 1000000 for i in range(n-1): ans = min(ans, a[i+1]-a[i]) print(ans)
p01093
<h3>Selection of Participants of an Experiment</h3> <p> Dr. Tsukuba has devised a new method of programming training. In order to evaluate the effectiveness of this method, he plans to carry out a control experiment. Having two students as the participants of the experiment, one of them will be trained under the conv...
5 10 10 10 10 10 5 1 5 8 9 11 7 11 34 83 47 59 29 70 0
0 1 5
25,441
s976682910
p01093
u282479278
1557980257
Python
Python3
py
Accepted
50
5628
272
j = 0 while 1: m = int(input()) if m == 0: break a = list(map(int,input().split())) min = 99999999999 a.sort() for i in range(len(a)-1): num = a[i+1] - a[i] if min > num: min = num print(min) j += 1
p01093
<h3>Selection of Participants of an Experiment</h3> <p> Dr. Tsukuba has devised a new method of programming training. In order to evaluate the effectiveness of this method, he plans to carry out a control experiment. Having two students as the participants of the experiment, one of them will be trained under the conv...
5 10 10 10 10 10 5 1 5 8 9 11 7 11 34 83 47 59 29 70 0
0 1 5
25,442
s054690192
p01093
u805464373
1557892214
Python
Python3
py
Accepted
50
5632
268
while True: try: ans=1000000 n=int(input()) ls=list(map(int,input().split())) ls.sort() for i in range(1,n): if ls[i]-ls[i-1]<ans: ans=ls[i]-ls[i-1] print(ans) except: break;
p01093
<h3>Selection of Participants of an Experiment</h3> <p> Dr. Tsukuba has devised a new method of programming training. In order to evaluate the effectiveness of this method, he plans to carry out a control experiment. Having two students as the participants of the experiment, one of them will be trained under the conv...
5 10 10 10 10 10 5 1 5 8 9 11 7 11 34 83 47 59 29 70 0
0 1 5
25,443