Caso # | Resultado | Tiempo | Memoria |
---|---|---|---|
#1 |
Incorrecto
|
0.004 s | 0 KBi |
#2 |
Incorrecto
|
0.003 s | 3 KBi |
#3 |
Correcto
|
0.006 s | 21 KBi |
#4 |
Correcto
|
0.001 s | 0 KBi |
#5 |
Incorrecto
|
0.002 s | 0 KBi |
#6 |
Correcto
|
0.002 s | 0 KBi |
#7 |
Correcto
|
0.001 s | 0 KBi |
#8 |
Correcto
|
0.002 s | 0 KBi |
#9 |
Correcto
|
0.002 s | 0 KBi |
#10 |
Incorrecto
|
0.001 s | 0 KBi |
#11 |
Incorrecto
|
0.001 s | 0 KBi |
#12 |
Incorrecto
|
0.004 s | 63 KBi |
#13 |
Incorrecto
|
0.002 s | 0 KBi |
#14 |
Incorrecto
|
0.11 s | 2 KBi |
#15 |
Incorrecto
|
0.101 s | 4 KBi |
#16 |
Correcto
|
0.163 s | 7 KBi |
#17 |
Incorrecto
|
0.094 s | 2 KBi |
#18 |
Incorrecto
|
0.044 s | 2 KBi |
#19 |
Incorrecto
|
0.045 s | 2 KBi |
#20 |
Incorrecto
|
0.181 s | 2 KBi |
#include<iostream> #include<vector> using namespace std; int main(){ vector<int> in; int left = 0, act_left, right = 0, n, idx; bool possible = false; cin >> n; for (int i = 0; i < n; i ++){ int k; cin>>k; in.push_back(k); right += k; } for (int i = 0; i < n; i ++){ left += in[i]; right -= in[i]; if (left > 0 && right < 0) { possible = true; idx = i; act_left = left; } } if (possible) cout<<idx<<'\n'; else cout<<"Impossible\n"; }