first commit
This commit is contained in:
commit
31bda4481f
37 changed files with 4645 additions and 0 deletions
1
2015/one/input.example
Normal file
1
2015/one/input.example
Normal file
File diff suppressed because one or more lines are too long
16
2015/one/solution-2.py
Normal file
16
2015/one/solution-2.py
Normal file
|
@ -0,0 +1,16 @@
|
|||
n = 7000
|
||||
f = 0
|
||||
peb = 0
|
||||
instructions = input()
|
||||
ins = list(instructions)
|
||||
|
||||
for i in range(n):
|
||||
if ins[i] == "(":
|
||||
f += 1
|
||||
else:
|
||||
f -= 1
|
||||
if f == -1:
|
||||
pob = i;
|
||||
break;
|
||||
|
||||
print(pob+1) # variables start from zero or sum shit
|
12
2015/one/solution.py
Normal file
12
2015/one/solution.py
Normal file
|
@ -0,0 +1,12 @@
|
|||
n = 7000
|
||||
f = 0
|
||||
instructions = input()
|
||||
ins = list(instructions)
|
||||
|
||||
for i in range(n):
|
||||
if ins[i] == "(":
|
||||
f += 1
|
||||
else:
|
||||
f -= 1
|
||||
|
||||
print(f)
|
Loading…
Add table
Add a link
Reference in a new issue