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

Envío 6419

Problema 0xf2 - Partir un arreglo grande en 2

  • Autor: Camilo15
  • Fecha: 2022-07-05 19:20:24 UTC (Hace más de 2 años)
Caso # Resultado Tiempo Memoria
#1
Error de compilación
                      Main.java:1: error: illegal character: '#'
#include <bits/stdc++.h>
^
Main.java:1: error: class, interface, or enum expected
#include <bits/stdc++.h>
         ^
Main.java:4: error: class, interface, or enum expected
int main() {
^
Main.java:5: error: class, interface, or enum expected
  int n; cin>>n;
         ^
Main.java:6: error: class, interface, or enum expected
  int arr[n];
  ^
Main.java:7: error: class, interface, or enum expected
  for(int i = 0; i < n; i++) {
  ^
Main.java:7: error: class, interface, or enum expected
  for(int i = 0; i < n; i++) {
                 ^
Main.java:7: error: class, interface, or enum expected
  for(int i = 0; i < n; i++) {
                        ^
Main.java:9: error: class, interface, or enum expected
  }
  ^
Main.java:12: error: class, interface, or enum expected
  for(int j = 1; j < n; j++) {
  ^
Main.java:12: error: class, interface, or enum expected
  for(int j = 1; j < n; j++) {
                 ^
Main.java:12: error: class, interface, or enum expected
  for(int j = 1; j < n; j++) {
                        ^
Main.java:14: error: class, interface, or enum expected
  }
  ^
Main.java:16: error: class, interface, or enum expected
  while(k < n && (!rightOk || !leftOk)) {
  ^
Main.java:18: error: class, interface, or enum expected
    leftSum += arr[k-1];
    ^
Main.java:19: error: class, interface, or enum expected
    rightSum -= arr[k-1];
    ^
Main.java:20: error: class, interface, or enum expected
    leftOk = leftSum > 0;
    ^
Main.java:21: error: class, interface, or enum expected
    rightOk = rightSum < 0;
    ^
Main.java:22: error: class, interface, or enum expected
  }
  ^
Main.java:26: error: class, interface, or enum expected
  } else {
  ^
Main.java:28: error: class, interface, or enum expected
  }
  ^
Main.java:30: error: class, interface, or enum expected
}
^
22 errors

                    
#2
Error de compilación
                      Main.java:1: error: illegal character: '#'
#include <bits/stdc++.h>
^
Main.java:1: error: class, interface, or enum expected
#include <bits/stdc++.h>
         ^
Main.java:4: error: class, interface, or enum expected
int main() {
^
Main.java:5: error: class, interface, or enum expected
  int n; cin>>n;
         ^
Main.java:6: error: class, interface, or enum expected
  int arr[n];
  ^
Main.java:7: error: class, interface, or enum expected
  for(int i = 0; i < n; i++) {
  ^
Main.java:7: error: class, interface, or enum expected
  for(int i = 0; i < n; i++) {
                 ^
Main.java:7: error: class, interface, or enum expected
  for(int i = 0; i < n; i++) {
                        ^
Main.java:9: error: class, interface, or enum expected
  }
  ^
Main.java:12: error: class, interface, or enum expected
  for(int j = 1; j < n; j++) {
  ^
Main.java:12: error: class, interface, or enum expected
  for(int j = 1; j < n; j++) {
                 ^
Main.java:12: error: class, interface, or enum expected
  for(int j = 1; j < n; j++) {
                        ^
Main.java:14: error: class, interface, or enum expected
  }
  ^
Main.java:16: error: class, interface, or enum expected
  while(k < n && (!rightOk || !leftOk)) {
  ^
Main.java:18: error: class, interface, or enum expected
    leftSum += arr[k-1];
    ^
Main.java:19: error: class, interface, or enum expected
    rightSum -= arr[k-1];
    ^
Main.java:20: error: class, interface, or enum expected
    leftOk = leftSum > 0;
    ^
Main.java:21: error: class, interface, or enum expected
    rightOk = rightSum < 0;
    ^
Main.java:22: error: class, interface, or enum expected
  }
  ^
Main.java:26: error: class, interface, or enum expected
  } else {
  ^
Main.java:28: error: class, interface, or enum expected
  }
  ^
Main.java:30: error: class, interface, or enum expected
}
^
22 errors

                    
#3
Error de compilación
                      Main.java:1: error: illegal character: '#'
#include <bits/stdc++.h>
^
Main.java:1: error: class, interface, or enum expected
#include <bits/stdc++.h>
         ^
Main.java:4: error: class, interface, or enum expected
int main() {
^
Main.java:5: error: class, interface, or enum expected
  int n; cin>>n;
         ^
Main.java:6: error: class, interface, or enum expected
  int arr[n];
  ^
Main.java:7: error: class, interface, or enum expected
  for(int i = 0; i < n; i++) {
  ^
Main.java:7: error: class, interface, or enum expected
  for(int i = 0; i < n; i++) {
                 ^
Main.java:7: error: class, interface, or enum expected
  for(int i = 0; i < n; i++) {
                        ^
Main.java:9: error: class, interface, or enum expected
  }
  ^
Main.java:12: error: class, interface, or enum expected
  for(int j = 1; j < n; j++) {
  ^
Main.java:12: error: class, interface, or enum expected
  for(int j = 1; j < n; j++) {
                 ^
Main.java:12: error: class, interface, or enum expected
  for(int j = 1; j < n; j++) {
                        ^
Main.java:14: error: class, interface, or enum expected
  }
  ^
Main.java:16: error: class, interface, or enum expected
  while(k < n && (!rightOk || !leftOk)) {
  ^
Main.java:18: error: class, interface, or enum expected
    leftSum += arr[k-1];
    ^
Main.java:19: error: class, interface, or enum expected
    rightSum -= arr[k-1];
    ^
Main.java:20: error: class, interface, or enum expected
    leftOk = leftSum > 0;
    ^
Main.java:21: error: class, interface, or enum expected
    rightOk = rightSum < 0;
    ^
Main.java:22: error: class, interface, or enum expected
  }
  ^
Main.java:26: error: class, interface, or enum expected
  } else {
  ^
Main.java:28: error: class, interface, or enum expected
  }
  ^
Main.java:30: error: class, interface, or enum expected
}
^
22 errors

                    
#4
Error de compilación
                      Main.java:1: error: illegal character: '#'
#include <bits/stdc++.h>
^
Main.java:1: error: class, interface, or enum expected
#include <bits/stdc++.h>
         ^
Main.java:4: error: class, interface, or enum expected
int main() {
^
Main.java:5: error: class, interface, or enum expected
  int n; cin>>n;
         ^
Main.java:6: error: class, interface, or enum expected
  int arr[n];
  ^
Main.java:7: error: class, interface, or enum expected
  for(int i = 0; i < n; i++) {
  ^
Main.java:7: error: class, interface, or enum expected
  for(int i = 0; i < n; i++) {
                 ^
Main.java:7: error: class, interface, or enum expected
  for(int i = 0; i < n; i++) {
                        ^
Main.java:9: error: class, interface, or enum expected
  }
  ^
Main.java:12: error: class, interface, or enum expected
  for(int j = 1; j < n; j++) {
  ^
Main.java:12: error: class, interface, or enum expected
  for(int j = 1; j < n; j++) {
                 ^
Main.java:12: error: class, interface, or enum expected
  for(int j = 1; j < n; j++) {
                        ^
Main.java:14: error: class, interface, or enum expected
  }
  ^
Main.java:16: error: class, interface, or enum expected
  while(k < n && (!rightOk || !leftOk)) {
  ^
Main.java:18: error: class, interface, or enum expected
    leftSum += arr[k-1];
    ^
Main.java:19: error: class, interface, or enum expected
    rightSum -= arr[k-1];
    ^
Main.java:20: error: class, interface, or enum expected
    leftOk = leftSum > 0;
    ^
Main.java:21: error: class, interface, or enum expected
    rightOk = rightSum < 0;
    ^
Main.java:22: error: class, interface, or enum expected
  }
  ^
Main.java:26: error: class, interface, or enum expected
  } else {
  ^
Main.java:28: error: class, interface, or enum expected
  }
  ^
Main.java:30: error: class, interface, or enum expected
}
^
22 errors

                    
#5
Error de compilación
                      Main.java:1: error: illegal character: '#'
#include <bits/stdc++.h>
^
Main.java:1: error: class, interface, or enum expected
#include <bits/stdc++.h>
         ^
Main.java:4: error: class, interface, or enum expected
int main() {
^
Main.java:5: error: class, interface, or enum expected
  int n; cin>>n;
         ^
Main.java:6: error: class, interface, or enum expected
  int arr[n];
  ^
Main.java:7: error: class, interface, or enum expected
  for(int i = 0; i < n; i++) {
  ^
Main.java:7: error: class, interface, or enum expected
  for(int i = 0; i < n; i++) {
                 ^
Main.java:7: error: class, interface, or enum expected
  for(int i = 0; i < n; i++) {
                        ^
Main.java:9: error: class, interface, or enum expected
  }
  ^
Main.java:12: error: class, interface, or enum expected
  for(int j = 1; j < n; j++) {
  ^
Main.java:12: error: class, interface, or enum expected
  for(int j = 1; j < n; j++) {
                 ^
Main.java:12: error: class, interface, or enum expected
  for(int j = 1; j < n; j++) {
                        ^
Main.java:14: error: class, interface, or enum expected
  }
  ^
Main.java:16: error: class, interface, or enum expected
  while(k < n && (!rightOk || !leftOk)) {
  ^
Main.java:18: error: class, interface, or enum expected
    leftSum += arr[k-1];
    ^
Main.java:19: error: class, interface, or enum expected
    rightSum -= arr[k-1];
    ^
Main.java:20: error: class, interface, or enum expected
    leftOk = leftSum > 0;
    ^
Main.java:21: error: class, interface, or enum expected
    rightOk = rightSum < 0;
    ^
Main.java:22: error: class, interface, or enum expected
  }
  ^
Main.java:26: error: class, interface, or enum expected
  } else {
  ^
Main.java:28: error: class, interface, or enum expected
  }
  ^
Main.java:30: error: class, interface, or enum expected
}
^
22 errors

                    
#6
Error de compilación
                      Main.java:1: error: illegal character: '#'
#include <bits/stdc++.h>
^
Main.java:1: error: class, interface, or enum expected
#include <bits/stdc++.h>
         ^
Main.java:4: error: class, interface, or enum expected
int main() {
^
Main.java:5: error: class, interface, or enum expected
  int n; cin>>n;
         ^
Main.java:6: error: class, interface, or enum expected
  int arr[n];
  ^
Main.java:7: error: class, interface, or enum expected
  for(int i = 0; i < n; i++) {
  ^
Main.java:7: error: class, interface, or enum expected
  for(int i = 0; i < n; i++) {
                 ^
Main.java:7: error: class, interface, or enum expected
  for(int i = 0; i < n; i++) {
                        ^
Main.java:9: error: class, interface, or enum expected
  }
  ^
Main.java:12: error: class, interface, or enum expected
  for(int j = 1; j < n; j++) {
  ^
Main.java:12: error: class, interface, or enum expected
  for(int j = 1; j < n; j++) {
                 ^
Main.java:12: error: class, interface, or enum expected
  for(int j = 1; j < n; j++) {
                        ^
Main.java:14: error: class, interface, or enum expected
  }
  ^
Main.java:16: error: class, interface, or enum expected
  while(k < n && (!rightOk || !leftOk)) {
  ^
Main.java:18: error: class, interface, or enum expected
    leftSum += arr[k-1];
    ^
Main.java:19: error: class, interface, or enum expected
    rightSum -= arr[k-1];
    ^
Main.java:20: error: class, interface, or enum expected
    leftOk = leftSum > 0;
    ^
Main.java:21: error: class, interface, or enum expected
    rightOk = rightSum < 0;
    ^
Main.java:22: error: class, interface, or enum expected
  }
  ^
Main.java:26: error: class, interface, or enum expected
  } else {
  ^
Main.java:28: error: class, interface, or enum expected
  }
  ^
Main.java:30: error: class, interface, or enum expected
}
^
22 errors

                    
#7
Error de compilación
                      Main.java:1: error: illegal character: '#'
#include <bits/stdc++.h>
^
Main.java:1: error: class, interface, or enum expected
#include <bits/stdc++.h>
         ^
Main.java:4: error: class, interface, or enum expected
int main() {
^
Main.java:5: error: class, interface, or enum expected
  int n; cin>>n;
         ^
Main.java:6: error: class, interface, or enum expected
  int arr[n];
  ^
Main.java:7: error: class, interface, or enum expected
  for(int i = 0; i < n; i++) {
  ^
Main.java:7: error: class, interface, or enum expected
  for(int i = 0; i < n; i++) {
                 ^
Main.java:7: error: class, interface, or enum expected
  for(int i = 0; i < n; i++) {
                        ^
Main.java:9: error: class, interface, or enum expected
  }
  ^
Main.java:12: error: class, interface, or enum expected
  for(int j = 1; j < n; j++) {
  ^
Main.java:12: error: class, interface, or enum expected
  for(int j = 1; j < n; j++) {
                 ^
Main.java:12: error: class, interface, or enum expected
  for(int j = 1; j < n; j++) {
                        ^
Main.java:14: error: class, interface, or enum expected
  }
  ^
Main.java:16: error: class, interface, or enum expected
  while(k < n && (!rightOk || !leftOk)) {
  ^
Main.java:18: error: class, interface, or enum expected
    leftSum += arr[k-1];
    ^
Main.java:19: error: class, interface, or enum expected
    rightSum -= arr[k-1];
    ^
Main.java:20: error: class, interface, or enum expected
    leftOk = leftSum > 0;
    ^
Main.java:21: error: class, interface, or enum expected
    rightOk = rightSum < 0;
    ^
Main.java:22: error: class, interface, or enum expected
  }
  ^
Main.java:26: error: class, interface, or enum expected
  } else {
  ^
Main.java:28: error: class, interface, or enum expected
  }
  ^
Main.java:30: error: class, interface, or enum expected
}
^
22 errors

                    
#8
Error de compilación
                      Main.java:1: error: illegal character: '#'
#include <bits/stdc++.h>
^
Main.java:1: error: class, interface, or enum expected
#include <bits/stdc++.h>
         ^
Main.java:4: error: class, interface, or enum expected
int main() {
^
Main.java:5: error: class, interface, or enum expected
  int n; cin>>n;
         ^
Main.java:6: error: class, interface, or enum expected
  int arr[n];
  ^
Main.java:7: error: class, interface, or enum expected
  for(int i = 0; i < n; i++) {
  ^
Main.java:7: error: class, interface, or enum expected
  for(int i = 0; i < n; i++) {
                 ^
Main.java:7: error: class, interface, or enum expected
  for(int i = 0; i < n; i++) {
                        ^
Main.java:9: error: class, interface, or enum expected
  }
  ^
Main.java:12: error: class, interface, or enum expected
  for(int j = 1; j < n; j++) {
  ^
Main.java:12: error: class, interface, or enum expected
  for(int j = 1; j < n; j++) {
                 ^
Main.java:12: error: class, interface, or enum expected
  for(int j = 1; j < n; j++) {
                        ^
Main.java:14: error: class, interface, or enum expected
  }
  ^
Main.java:16: error: class, interface, or enum expected
  while(k < n && (!rightOk || !leftOk)) {
  ^
Main.java:18: error: class, interface, or enum expected
    leftSum += arr[k-1];
    ^
Main.java:19: error: class, interface, or enum expected
    rightSum -= arr[k-1];
    ^
Main.java:20: error: class, interface, or enum expected
    leftOk = leftSum > 0;
    ^
Main.java:21: error: class, interface, or enum expected
    rightOk = rightSum < 0;
    ^
Main.java:22: error: class, interface, or enum expected
  }
  ^
Main.java:26: error: class, interface, or enum expected
  } else {
  ^
Main.java:28: error: class, interface, or enum expected
  }
  ^
Main.java:30: error: class, interface, or enum expected
}
^
22 errors

                    
#9
Error de compilación
                      Main.java:1: error: illegal character: '#'
#include <bits/stdc++.h>
^
Main.java:1: error: class, interface, or enum expected
#include <bits/stdc++.h>
         ^
Main.java:4: error: class, interface, or enum expected
int main() {
^
Main.java:5: error: class, interface, or enum expected
  int n; cin>>n;
         ^
Main.java:6: error: class, interface, or enum expected
  int arr[n];
  ^
Main.java:7: error: class, interface, or enum expected
  for(int i = 0; i < n; i++) {
  ^
Main.java:7: error: class, interface, or enum expected
  for(int i = 0; i < n; i++) {
                 ^
Main.java:7: error: class, interface, or enum expected
  for(int i = 0; i < n; i++) {
                        ^
Main.java:9: error: class, interface, or enum expected
  }
  ^
Main.java:12: error: class, interface, or enum expected
  for(int j = 1; j < n; j++) {
  ^
Main.java:12: error: class, interface, or enum expected
  for(int j = 1; j < n; j++) {
                 ^
Main.java:12: error: class, interface, or enum expected
  for(int j = 1; j < n; j++) {
                        ^
Main.java:14: error: class, interface, or enum expected
  }
  ^
Main.java:16: error: class, interface, or enum expected
  while(k < n && (!rightOk || !leftOk)) {
  ^
Main.java:18: error: class, interface, or enum expected
    leftSum += arr[k-1];
    ^
Main.java:19: error: class, interface, or enum expected
    rightSum -= arr[k-1];
    ^
Main.java:20: error: class, interface, or enum expected
    leftOk = leftSum > 0;
    ^
Main.java:21: error: class, interface, or enum expected
    rightOk = rightSum < 0;
    ^
Main.java:22: error: class, interface, or enum expected
  }
  ^
Main.java:26: error: class, interface, or enum expected
  } else {
  ^
Main.java:28: error: class, interface, or enum expected
  }
  ^
Main.java:30: error: class, interface, or enum expected
}
^
22 errors

                    
#10
Error de compilación
                      Main.java:1: error: illegal character: '#'
#include <bits/stdc++.h>
^
Main.java:1: error: class, interface, or enum expected
#include <bits/stdc++.h>
         ^
Main.java:4: error: class, interface, or enum expected
int main() {
^
Main.java:5: error: class, interface, or enum expected
  int n; cin>>n;
         ^
Main.java:6: error: class, interface, or enum expected
  int arr[n];
  ^
Main.java:7: error: class, interface, or enum expected
  for(int i = 0; i < n; i++) {
  ^
Main.java:7: error: class, interface, or enum expected
  for(int i = 0; i < n; i++) {
                 ^
Main.java:7: error: class, interface, or enum expected
  for(int i = 0; i < n; i++) {
                        ^
Main.java:9: error: class, interface, or enum expected
  }
  ^
Main.java:12: error: class, interface, or enum expected
  for(int j = 1; j < n; j++) {
  ^
Main.java:12: error: class, interface, or enum expected
  for(int j = 1; j < n; j++) {
                 ^
Main.java:12: error: class, interface, or enum expected
  for(int j = 1; j < n; j++) {
                        ^
Main.java:14: error: class, interface, or enum expected
  }
  ^
Main.java:16: error: class, interface, or enum expected
  while(k < n && (!rightOk || !leftOk)) {
  ^
Main.java:18: error: class, interface, or enum expected
    leftSum += arr[k-1];
    ^
Main.java:19: error: class, interface, or enum expected
    rightSum -= arr[k-1];
    ^
Main.java:20: error: class, interface, or enum expected
    leftOk = leftSum > 0;
    ^
Main.java:21: error: class, interface, or enum expected
    rightOk = rightSum < 0;
    ^
Main.java:22: error: class, interface, or enum expected
  }
  ^
Main.java:26: error: class, interface, or enum expected
  } else {
  ^
Main.java:28: error: class, interface, or enum expected
  }
  ^
Main.java:30: error: class, interface, or enum expected
}
^
22 errors

                    
#11
Error de compilación
                      Main.java:1: error: illegal character: '#'
#include <bits/stdc++.h>
^
Main.java:1: error: class, interface, or enum expected
#include <bits/stdc++.h>
         ^
Main.java:4: error: class, interface, or enum expected
int main() {
^
Main.java:5: error: class, interface, or enum expected
  int n; cin>>n;
         ^
Main.java:6: error: class, interface, or enum expected
  int arr[n];
  ^
Main.java:7: error: class, interface, or enum expected
  for(int i = 0; i < n; i++) {
  ^
Main.java:7: error: class, interface, or enum expected
  for(int i = 0; i < n; i++) {
                 ^
Main.java:7: error: class, interface, or enum expected
  for(int i = 0; i < n; i++) {
                        ^
Main.java:9: error: class, interface, or enum expected
  }
  ^
Main.java:12: error: class, interface, or enum expected
  for(int j = 1; j < n; j++) {
  ^
Main.java:12: error: class, interface, or enum expected
  for(int j = 1; j < n; j++) {
                 ^
Main.java:12: error: class, interface, or enum expected
  for(int j = 1; j < n; j++) {
                        ^
Main.java:14: error: class, interface, or enum expected
  }
  ^
Main.java:16: error: class, interface, or enum expected
  while(k < n && (!rightOk || !leftOk)) {
  ^
Main.java:18: error: class, interface, or enum expected
    leftSum += arr[k-1];
    ^
Main.java:19: error: class, interface, or enum expected
    rightSum -= arr[k-1];
    ^
Main.java:20: error: class, interface, or enum expected
    leftOk = leftSum > 0;
    ^
Main.java:21: error: class, interface, or enum expected
    rightOk = rightSum < 0;
    ^
Main.java:22: error: class, interface, or enum expected
  }
  ^
Main.java:26: error: class, interface, or enum expected
  } else {
  ^
Main.java:28: error: class, interface, or enum expected
  }
  ^
Main.java:30: error: class, interface, or enum expected
}
^
22 errors

                    
#12
Error de compilación
                      Main.java:1: error: illegal character: '#'
#include <bits/stdc++.h>
^
Main.java:1: error: class, interface, or enum expected
#include <bits/stdc++.h>
         ^
Main.java:4: error: class, interface, or enum expected
int main() {
^
Main.java:5: error: class, interface, or enum expected
  int n; cin>>n;
         ^
Main.java:6: error: class, interface, or enum expected
  int arr[n];
  ^
Main.java:7: error: class, interface, or enum expected
  for(int i = 0; i < n; i++) {
  ^
Main.java:7: error: class, interface, or enum expected
  for(int i = 0; i < n; i++) {
                 ^
Main.java:7: error: class, interface, or enum expected
  for(int i = 0; i < n; i++) {
                        ^
Main.java:9: error: class, interface, or enum expected
  }
  ^
Main.java:12: error: class, interface, or enum expected
  for(int j = 1; j < n; j++) {
  ^
Main.java:12: error: class, interface, or enum expected
  for(int j = 1; j < n; j++) {
                 ^
Main.java:12: error: class, interface, or enum expected
  for(int j = 1; j < n; j++) {
                        ^
Main.java:14: error: class, interface, or enum expected
  }
  ^
Main.java:16: error: class, interface, or enum expected
  while(k < n && (!rightOk || !leftOk)) {
  ^
Main.java:18: error: class, interface, or enum expected
    leftSum += arr[k-1];
    ^
Main.java:19: error: class, interface, or enum expected
    rightSum -= arr[k-1];
    ^
Main.java:20: error: class, interface, or enum expected
    leftOk = leftSum > 0;
    ^
Main.java:21: error: class, interface, or enum expected
    rightOk = rightSum < 0;
    ^
Main.java:22: error: class, interface, or enum expected
  }
  ^
Main.java:26: error: class, interface, or enum expected
  } else {
  ^
Main.java:28: error: class, interface, or enum expected
  }
  ^
Main.java:30: error: class, interface, or enum expected
}
^
22 errors

                    
#13
Error de compilación
                      Main.java:1: error: illegal character: '#'
#include <bits/stdc++.h>
^
Main.java:1: error: class, interface, or enum expected
#include <bits/stdc++.h>
         ^
Main.java:4: error: class, interface, or enum expected
int main() {
^
Main.java:5: error: class, interface, or enum expected
  int n; cin>>n;
         ^
Main.java:6: error: class, interface, or enum expected
  int arr[n];
  ^
Main.java:7: error: class, interface, or enum expected
  for(int i = 0; i < n; i++) {
  ^
Main.java:7: error: class, interface, or enum expected
  for(int i = 0; i < n; i++) {
                 ^
Main.java:7: error: class, interface, or enum expected
  for(int i = 0; i < n; i++) {
                        ^
Main.java:9: error: class, interface, or enum expected
  }
  ^
Main.java:12: error: class, interface, or enum expected
  for(int j = 1; j < n; j++) {
  ^
Main.java:12: error: class, interface, or enum expected
  for(int j = 1; j < n; j++) {
                 ^
Main.java:12: error: class, interface, or enum expected
  for(int j = 1; j < n; j++) {
                        ^
Main.java:14: error: class, interface, or enum expected
  }
  ^
Main.java:16: error: class, interface, or enum expected
  while(k < n && (!rightOk || !leftOk)) {
  ^
Main.java:18: error: class, interface, or enum expected
    leftSum += arr[k-1];
    ^
Main.java:19: error: class, interface, or enum expected
    rightSum -= arr[k-1];
    ^
Main.java:20: error: class, interface, or enum expected
    leftOk = leftSum > 0;
    ^
Main.java:21: error: class, interface, or enum expected
    rightOk = rightSum < 0;
    ^
Main.java:22: error: class, interface, or enum expected
  }
  ^
Main.java:26: error: class, interface, or enum expected
  } else {
  ^
Main.java:28: error: class, interface, or enum expected
  }
  ^
Main.java:30: error: class, interface, or enum expected
}
^
22 errors

                    
#14
Error de compilación
                      Main.java:1: error: illegal character: '#'
#include <bits/stdc++.h>
^
Main.java:1: error: class, interface, or enum expected
#include <bits/stdc++.h>
         ^
Main.java:4: error: class, interface, or enum expected
int main() {
^
Main.java:5: error: class, interface, or enum expected
  int n; cin>>n;
         ^
Main.java:6: error: class, interface, or enum expected
  int arr[n];
  ^
Main.java:7: error: class, interface, or enum expected
  for(int i = 0; i < n; i++) {
  ^
Main.java:7: error: class, interface, or enum expected
  for(int i = 0; i < n; i++) {
                 ^
Main.java:7: error: class, interface, or enum expected
  for(int i = 0; i < n; i++) {
                        ^
Main.java:9: error: class, interface, or enum expected
  }
  ^
Main.java:12: error: class, interface, or enum expected
  for(int j = 1; j < n; j++) {
  ^
Main.java:12: error: class, interface, or enum expected
  for(int j = 1; j < n; j++) {
                 ^
Main.java:12: error: class, interface, or enum expected
  for(int j = 1; j < n; j++) {
                        ^
Main.java:14: error: class, interface, or enum expected
  }
  ^
Main.java:16: error: class, interface, or enum expected
  while(k < n && (!rightOk || !leftOk)) {
  ^
Main.java:18: error: class, interface, or enum expected
    leftSum += arr[k-1];
    ^
Main.java:19: error: class, interface, or enum expected
    rightSum -= arr[k-1];
    ^
Main.java:20: error: class, interface, or enum expected
    leftOk = leftSum > 0;
    ^
Main.java:21: error: class, interface, or enum expected
    rightOk = rightSum < 0;
    ^
Main.java:22: error: class, interface, or enum expected
  }
  ^
Main.java:26: error: class, interface, or enum expected
  } else {
  ^
Main.java:28: error: class, interface, or enum expected
  }
  ^
Main.java:30: error: class, interface, or enum expected
}
^
22 errors

                    
#15
Error de compilación
                      Main.java:1: error: illegal character: '#'
#include <bits/stdc++.h>
^
Main.java:1: error: class, interface, or enum expected
#include <bits/stdc++.h>
         ^
Main.java:4: error: class, interface, or enum expected
int main() {
^
Main.java:5: error: class, interface, or enum expected
  int n; cin>>n;
         ^
Main.java:6: error: class, interface, or enum expected
  int arr[n];
  ^
Main.java:7: error: class, interface, or enum expected
  for(int i = 0; i < n; i++) {
  ^
Main.java:7: error: class, interface, or enum expected
  for(int i = 0; i < n; i++) {
                 ^
Main.java:7: error: class, interface, or enum expected
  for(int i = 0; i < n; i++) {
                        ^
Main.java:9: error: class, interface, or enum expected
  }
  ^
Main.java:12: error: class, interface, or enum expected
  for(int j = 1; j < n; j++) {
  ^
Main.java:12: error: class, interface, or enum expected
  for(int j = 1; j < n; j++) {
                 ^
Main.java:12: error: class, interface, or enum expected
  for(int j = 1; j < n; j++) {
                        ^
Main.java:14: error: class, interface, or enum expected
  }
  ^
Main.java:16: error: class, interface, or enum expected
  while(k < n && (!rightOk || !leftOk)) {
  ^
Main.java:18: error: class, interface, or enum expected
    leftSum += arr[k-1];
    ^
Main.java:19: error: class, interface, or enum expected
    rightSum -= arr[k-1];
    ^
Main.java:20: error: class, interface, or enum expected
    leftOk = leftSum > 0;
    ^
Main.java:21: error: class, interface, or enum expected
    rightOk = rightSum < 0;
    ^
Main.java:22: error: class, interface, or enum expected
  }
  ^
Main.java:26: error: class, interface, or enum expected
  } else {
  ^
Main.java:28: error: class, interface, or enum expected
  }
  ^
Main.java:30: error: class, interface, or enum expected
}
^
22 errors

                    
#16
Error de compilación
                      Main.java:1: error: illegal character: '#'
#include <bits/stdc++.h>
^
Main.java:1: error: class, interface, or enum expected
#include <bits/stdc++.h>
         ^
Main.java:4: error: class, interface, or enum expected
int main() {
^
Main.java:5: error: class, interface, or enum expected
  int n; cin>>n;
         ^
Main.java:6: error: class, interface, or enum expected
  int arr[n];
  ^
Main.java:7: error: class, interface, or enum expected
  for(int i = 0; i < n; i++) {
  ^
Main.java:7: error: class, interface, or enum expected
  for(int i = 0; i < n; i++) {
                 ^
Main.java:7: error: class, interface, or enum expected
  for(int i = 0; i < n; i++) {
                        ^
Main.java:9: error: class, interface, or enum expected
  }
  ^
Main.java:12: error: class, interface, or enum expected
  for(int j = 1; j < n; j++) {
  ^
Main.java:12: error: class, interface, or enum expected
  for(int j = 1; j < n; j++) {
                 ^
Main.java:12: error: class, interface, or enum expected
  for(int j = 1; j < n; j++) {
                        ^
Main.java:14: error: class, interface, or enum expected
  }
  ^
Main.java:16: error: class, interface, or enum expected
  while(k < n && (!rightOk || !leftOk)) {
  ^
Main.java:18: error: class, interface, or enum expected
    leftSum += arr[k-1];
    ^
Main.java:19: error: class, interface, or enum expected
    rightSum -= arr[k-1];
    ^
Main.java:20: error: class, interface, or enum expected
    leftOk = leftSum > 0;
    ^
Main.java:21: error: class, interface, or enum expected
    rightOk = rightSum < 0;
    ^
Main.java:22: error: class, interface, or enum expected
  }
  ^
Main.java:26: error: class, interface, or enum expected
  } else {
  ^
Main.java:28: error: class, interface, or enum expected
  }
  ^
Main.java:30: error: class, interface, or enum expected
}
^
22 errors

                    
#17
Error de compilación
                      Main.java:1: error: illegal character: '#'
#include <bits/stdc++.h>
^
Main.java:1: error: class, interface, or enum expected
#include <bits/stdc++.h>
         ^
Main.java:4: error: class, interface, or enum expected
int main() {
^
Main.java:5: error: class, interface, or enum expected
  int n; cin>>n;
         ^
Main.java:6: error: class, interface, or enum expected
  int arr[n];
  ^
Main.java:7: error: class, interface, or enum expected
  for(int i = 0; i < n; i++) {
  ^
Main.java:7: error: class, interface, or enum expected
  for(int i = 0; i < n; i++) {
                 ^
Main.java:7: error: class, interface, or enum expected
  for(int i = 0; i < n; i++) {
                        ^
Main.java:9: error: class, interface, or enum expected
  }
  ^
Main.java:12: error: class, interface, or enum expected
  for(int j = 1; j < n; j++) {
  ^
Main.java:12: error: class, interface, or enum expected
  for(int j = 1; j < n; j++) {
                 ^
Main.java:12: error: class, interface, or enum expected
  for(int j = 1; j < n; j++) {
                        ^
Main.java:14: error: class, interface, or enum expected
  }
  ^
Main.java:16: error: class, interface, or enum expected
  while(k < n && (!rightOk || !leftOk)) {
  ^
Main.java:18: error: class, interface, or enum expected
    leftSum += arr[k-1];
    ^
Main.java:19: error: class, interface, or enum expected
    rightSum -= arr[k-1];
    ^
Main.java:20: error: class, interface, or enum expected
    leftOk = leftSum > 0;
    ^
Main.java:21: error: class, interface, or enum expected
    rightOk = rightSum < 0;
    ^
Main.java:22: error: class, interface, or enum expected
  }
  ^
Main.java:26: error: class, interface, or enum expected
  } else {
  ^
Main.java:28: error: class, interface, or enum expected
  }
  ^
Main.java:30: error: class, interface, or enum expected
}
^
22 errors

                    
#18
Error de compilación
                      Main.java:1: error: illegal character: '#'
#include <bits/stdc++.h>
^
Main.java:1: error: class, interface, or enum expected
#include <bits/stdc++.h>
         ^
Main.java:4: error: class, interface, or enum expected
int main() {
^
Main.java:5: error: class, interface, or enum expected
  int n; cin>>n;
         ^
Main.java:6: error: class, interface, or enum expected
  int arr[n];
  ^
Main.java:7: error: class, interface, or enum expected
  for(int i = 0; i < n; i++) {
  ^
Main.java:7: error: class, interface, or enum expected
  for(int i = 0; i < n; i++) {
                 ^
Main.java:7: error: class, interface, or enum expected
  for(int i = 0; i < n; i++) {
                        ^
Main.java:9: error: class, interface, or enum expected
  }
  ^
Main.java:12: error: class, interface, or enum expected
  for(int j = 1; j < n; j++) {
  ^
Main.java:12: error: class, interface, or enum expected
  for(int j = 1; j < n; j++) {
                 ^
Main.java:12: error: class, interface, or enum expected
  for(int j = 1; j < n; j++) {
                        ^
Main.java:14: error: class, interface, or enum expected
  }
  ^
Main.java:16: error: class, interface, or enum expected
  while(k < n && (!rightOk || !leftOk)) {
  ^
Main.java:18: error: class, interface, or enum expected
    leftSum += arr[k-1];
    ^
Main.java:19: error: class, interface, or enum expected
    rightSum -= arr[k-1];
    ^
Main.java:20: error: class, interface, or enum expected
    leftOk = leftSum > 0;
    ^
Main.java:21: error: class, interface, or enum expected
    rightOk = rightSum < 0;
    ^
Main.java:22: error: class, interface, or enum expected
  }
  ^
Main.java:26: error: class, interface, or enum expected
  } else {
  ^
Main.java:28: error: class, interface, or enum expected
  }
  ^
Main.java:30: error: class, interface, or enum expected
}
^
22 errors

                    
#19
Error de compilación
                      Main.java:1: error: illegal character: '#'
#include <bits/stdc++.h>
^
Main.java:1: error: class, interface, or enum expected
#include <bits/stdc++.h>
         ^
Main.java:4: error: class, interface, or enum expected
int main() {
^
Main.java:5: error: class, interface, or enum expected
  int n; cin>>n;
         ^
Main.java:6: error: class, interface, or enum expected
  int arr[n];
  ^
Main.java:7: error: class, interface, or enum expected
  for(int i = 0; i < n; i++) {
  ^
Main.java:7: error: class, interface, or enum expected
  for(int i = 0; i < n; i++) {
                 ^
Main.java:7: error: class, interface, or enum expected
  for(int i = 0; i < n; i++) {
                        ^
Main.java:9: error: class, interface, or enum expected
  }
  ^
Main.java:12: error: class, interface, or enum expected
  for(int j = 1; j < n; j++) {
  ^
Main.java:12: error: class, interface, or enum expected
  for(int j = 1; j < n; j++) {
                 ^
Main.java:12: error: class, interface, or enum expected
  for(int j = 1; j < n; j++) {
                        ^
Main.java:14: error: class, interface, or enum expected
  }
  ^
Main.java:16: error: class, interface, or enum expected
  while(k < n && (!rightOk || !leftOk)) {
  ^
Main.java:18: error: class, interface, or enum expected
    leftSum += arr[k-1];
    ^
Main.java:19: error: class, interface, or enum expected
    rightSum -= arr[k-1];
    ^
Main.java:20: error: class, interface, or enum expected
    leftOk = leftSum > 0;
    ^
Main.java:21: error: class, interface, or enum expected
    rightOk = rightSum < 0;
    ^
Main.java:22: error: class, interface, or enum expected
  }
  ^
Main.java:26: error: class, interface, or enum expected
  } else {
  ^
Main.java:28: error: class, interface, or enum expected
  }
  ^
Main.java:30: error: class, interface, or enum expected
}
^
22 errors

                    
#20
Error de compilación
                      Main.java:1: error: illegal character: '#'
#include <bits/stdc++.h>
^
Main.java:1: error: class, interface, or enum expected
#include <bits/stdc++.h>
         ^
Main.java:4: error: class, interface, or enum expected
int main() {
^
Main.java:5: error: class, interface, or enum expected
  int n; cin>>n;
         ^
Main.java:6: error: class, interface, or enum expected
  int arr[n];
  ^
Main.java:7: error: class, interface, or enum expected
  for(int i = 0; i < n; i++) {
  ^
Main.java:7: error: class, interface, or enum expected
  for(int i = 0; i < n; i++) {
                 ^
Main.java:7: error: class, interface, or enum expected
  for(int i = 0; i < n; i++) {
                        ^
Main.java:9: error: class, interface, or enum expected
  }
  ^
Main.java:12: error: class, interface, or enum expected
  for(int j = 1; j < n; j++) {
  ^
Main.java:12: error: class, interface, or enum expected
  for(int j = 1; j < n; j++) {
                 ^
Main.java:12: error: class, interface, or enum expected
  for(int j = 1; j < n; j++) {
                        ^
Main.java:14: error: class, interface, or enum expected
  }
  ^
Main.java:16: error: class, interface, or enum expected
  while(k < n && (!rightOk || !leftOk)) {
  ^
Main.java:18: error: class, interface, or enum expected
    leftSum += arr[k-1];
    ^
Main.java:19: error: class, interface, or enum expected
    rightSum -= arr[k-1];
    ^
Main.java:20: error: class, interface, or enum expected
    leftOk = leftSum > 0;
    ^
Main.java:21: error: class, interface, or enum expected
    rightOk = rightSum < 0;
    ^
Main.java:22: error: class, interface, or enum expected
  }
  ^
Main.java:26: error: class, interface, or enum expected
  } else {
  ^
Main.java:28: error: class, interface, or enum expected
  }
  ^
Main.java:30: error: class, interface, or enum expected
}
^
22 errors

                    
Puntos totales: 0 / 100

Código

#include <bits/stdc++.h>
using namespace std;

int main() {
  int n; cin>>n;
  int arr[n];
  for(int i = 0; i < n; i++) {
    cin>>arr[i];
  }
  
  int leftSum = arr[0], rightSum = 0, k = 1;
  for(int j = 1; j < n; j++) {
    rightSum += arr[j];
  }
  bool rightOk = rightSum < 0, leftOk = leftSum > 0;
  while(k < n && (!rightOk || !leftOk)) {
    k++;
    leftSum += arr[k-1];
    rightSum -= arr[k-1];
    leftOk = leftSum > 0;
    rightOk = rightSum < 0;
  }

  if(rightOk && leftOk) {
    cout<<k<<endl;
  } else {
    cout<<"Impossible"<<endl;
  }
  return 0;
}