Caso # | Resultado | Tiempo | Memoria |
---|---|---|---|
#1 |
Correcto
|
0.007 s | 1 KBi |
#2 |
Correcto
|
0.007 s | 23 KBi |
#3 |
Correcto
|
0.006 s | 17 KBi |
#4 |
Correcto
|
0.005 s | 1 KBi |
#5 |
Incorrecto
|
0.006 s | 1 KBi |
#6 |
Correcto
|
0.006 s | 1 KBi |
#7 |
Correcto
|
0.005 s | 1 KBi |
#8 |
Correcto
|
0.005 s | 1 KBi |
#9 |
Correcto
|
0.006 s | 17 KBi |
#10 |
Incorrecto
|
0.004 s | 2 KBi |
#11 |
Incorrecto
|
0.006 s | 1 KBi |
#12 |
Incorrecto
|
0.005 s | 1 KBi |
#13 |
Incorrecto
|
0.006 s | 2 KBi |
#14 |
Incorrecto
|
0.109 s | 5 KBi |
#15 |
Correcto
|
0.11 s | 5 KBi |
#16 |
Correcto
|
0.127 s | 15 KBi |
#17 |
Incorrecto
|
0.108 s | 5 KBi |
#18 |
Incorrecto
|
0.122 s | 5 KBi |
#19 |
Incorrecto
|
0.123 s | 5 KBi |
#20 |
Incorrecto
|
0.172 s | 5 KBi |
#include<iostream> using namespace std; int main(){ long n; cin>>n; long arr[n]; long aux=0; for(int i=0;i<n;i++)cin>>arr[i]; for(int i=n-1;i>=0;i--){ aux +=arr[i]; arr[i] = aux; } for(int i=n-1;i>0;i--){ if(arr[i]<0 && arr[i-1]>0){ cout<<i<<endl; return 0; } } cout<<"Impossible"<<endl; return 0; }