█████████ ████ ███░░░░░███ ░░███ ███ ░░░ ██████ ███████ ██████ ██████ ░███ ███░░███ ███░░███ ███░░███ ███░░███ ░███ ░███ ░███░███ ░███ ░███████ ░███ ░███ ░░███ ███░███ ░███░███ ░███ ░███░░░ ░███ ░███ ░░█████████ ░░██████ ░░████████░░██████ ░░██████ ░░░░░░░░░ ░░░░░░ ░░░░░░░░ ░░░░░░ ░░░░░░

Envío 1473

Problema 0xf2 - Partir un arreglo grande en 2

  • Autor: Serivt
  • Fecha: 2020-10-28 01:50:16 UTC (Hace alrededor de 4 años)
Caso # Resultado Tiempo Memoria
#1
Error de compilación
                      main.c:1:1: error: unknown type name 'import'
import itertools
^
main.c:1:17: error: expected ';' after top level declarator
import itertools
                ^
                ;
2 errors generated.

                    
#2
Error de compilación
                      main.c:1:1: error: unknown type name 'import'
import itertools
^
main.c:1:17: error: expected ';' after top level declarator
import itertools
                ^
                ;
2 errors generated.

                    
#3
Error de compilación
                      main.c:1:1: error: unknown type name 'import'
import itertools
^
main.c:1:17: error: expected ';' after top level declarator
import itertools
                ^
                ;
2 errors generated.

                    
#4
Error de compilación
                      main.c:1:1: error: unknown type name 'import'
import itertools
^
main.c:1:17: error: expected ';' after top level declarator
import itertools
                ^
                ;
2 errors generated.

                    
#5
Error de compilación
                      main.c:1:1: error: unknown type name 'import'
import itertools
^
main.c:1:17: error: expected ';' after top level declarator
import itertools
                ^
                ;
2 errors generated.

                    
#6
Error de compilación
                      main.c:1:1: error: unknown type name 'import'
import itertools
^
main.c:1:17: error: expected ';' after top level declarator
import itertools
                ^
                ;
2 errors generated.

                    
#7
Error de compilación
                      main.c:1:1: error: unknown type name 'import'
import itertools
^
main.c:1:17: error: expected ';' after top level declarator
import itertools
                ^
                ;
2 errors generated.

                    
#8
Error de compilación
                      main.c:1:1: error: unknown type name 'import'
import itertools
^
main.c:1:17: error: expected ';' after top level declarator
import itertools
                ^
                ;
2 errors generated.

                    
#9
Error de compilación
                      main.c:1:1: error: unknown type name 'import'
import itertools
^
main.c:1:17: error: expected ';' after top level declarator
import itertools
                ^
                ;
2 errors generated.

                    
#10
Error de compilación
                      main.c:1:1: error: unknown type name 'import'
import itertools
^
main.c:1:17: error: expected ';' after top level declarator
import itertools
                ^
                ;
2 errors generated.

                    
#11
Error de compilación
                      main.c:1:1: error: unknown type name 'import'
import itertools
^
main.c:1:17: error: expected ';' after top level declarator
import itertools
                ^
                ;
2 errors generated.

                    
#12
Error de compilación
                      main.c:1:1: error: unknown type name 'import'
import itertools
^
main.c:1:17: error: expected ';' after top level declarator
import itertools
                ^
                ;
2 errors generated.

                    
#13
Error de compilación
                      main.c:1:1: error: unknown type name 'import'
import itertools
^
main.c:1:17: error: expected ';' after top level declarator
import itertools
                ^
                ;
2 errors generated.

                    
#14
Error de compilación
                      main.c:1:1: error: unknown type name 'import'
import itertools
^
main.c:1:17: error: expected ';' after top level declarator
import itertools
                ^
                ;
2 errors generated.

                    
#15
Error de compilación
                      main.c:1:1: error: unknown type name 'import'
import itertools
^
main.c:1:17: error: expected ';' after top level declarator
import itertools
                ^
                ;
2 errors generated.

                    
#16
Error de compilación
                      main.c:1:1: error: unknown type name 'import'
import itertools
^
main.c:1:17: error: expected ';' after top level declarator
import itertools
                ^
                ;
2 errors generated.

                    
#17
Error de compilación
                      main.c:1:1: error: unknown type name 'import'
import itertools
^
main.c:1:17: error: expected ';' after top level declarator
import itertools
                ^
                ;
2 errors generated.

                    
#18
Error de compilación
                      main.c:1:1: error: unknown type name 'import'
import itertools
^
main.c:1:17: error: expected ';' after top level declarator
import itertools
                ^
                ;
2 errors generated.

                    
#19
Error de compilación
                      main.c:1:1: error: unknown type name 'import'
import itertools
^
main.c:1:17: error: expected ';' after top level declarator
import itertools
                ^
                ;
2 errors generated.

                    
#20
Error de compilación
                      main.c:1:1: error: unknown type name 'import'
import itertools
^
main.c:1:17: error: expected ';' after top level declarator
import itertools
                ^
                ;
2 errors generated.

                    
Puntos totales: 0 / 100

Código

import itertools

n = int(input())
arr = list(map(int, input().split(" ")))
acum = list(itertools.accumulate(arr))
total = acum[n - 1]
middle = None

for i in range(0, n):
    right = acum[i] if i != 0 else 0
    if acum[i] > 0 and total - acum[i] < 0:
        middle = i + 1
        break
print(middle or "Impossible")