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

Envío 1083

Problema 0xf2 - Partir un arreglo grande en 2

  • Autor: svanegas
  • Fecha: 2020-10-09 22:38:44 UTC (Hace alrededor de 4 años)
Caso # Resultado Tiempo Memoria
#1
Error de compilación
                      main.cpp:13:3: error: use of undeclared identifier 'memset'; did you mean 'wmemset'?
  memset(sum, 0, sizeof(sum));
  ^~~~~~
  wmemset
/usr/include/wchar.h:271:17: note: 'wmemset' declared here
extern wchar_t *wmemset (wchar_t *__s, wchar_t __c, size_t __n) __THROW;
                ^
main.cpp:13:10: error: cannot initialize a parameter of type 'wchar_t *' with an lvalue of type 'int [500005]'
  memset(sum, 0, sizeof(sum));
         ^~~
/usr/include/wchar.h:271:35: note: passing argument to parameter '__s' here
extern wchar_t *wmemset (wchar_t *__s, wchar_t __c, size_t __n) __THROW;
                                  ^
2 errors generated.

                    
#2
Error de compilación
                      main.cpp:13:3: error: use of undeclared identifier 'memset'; did you mean 'wmemset'?
  memset(sum, 0, sizeof(sum));
  ^~~~~~
  wmemset
/usr/include/wchar.h:271:17: note: 'wmemset' declared here
extern wchar_t *wmemset (wchar_t *__s, wchar_t __c, size_t __n) __THROW;
                ^
main.cpp:13:10: error: cannot initialize a parameter of type 'wchar_t *' with an lvalue of type 'int [500005]'
  memset(sum, 0, sizeof(sum));
         ^~~
/usr/include/wchar.h:271:35: note: passing argument to parameter '__s' here
extern wchar_t *wmemset (wchar_t *__s, wchar_t __c, size_t __n) __THROW;
                                  ^
2 errors generated.

                    
#3
Error de compilación
                      main.cpp:13:3: error: use of undeclared identifier 'memset'; did you mean 'wmemset'?
  memset(sum, 0, sizeof(sum));
  ^~~~~~
  wmemset
/usr/include/wchar.h:271:17: note: 'wmemset' declared here
extern wchar_t *wmemset (wchar_t *__s, wchar_t __c, size_t __n) __THROW;
                ^
main.cpp:13:10: error: cannot initialize a parameter of type 'wchar_t *' with an lvalue of type 'int [500005]'
  memset(sum, 0, sizeof(sum));
         ^~~
/usr/include/wchar.h:271:35: note: passing argument to parameter '__s' here
extern wchar_t *wmemset (wchar_t *__s, wchar_t __c, size_t __n) __THROW;
                                  ^
2 errors generated.

                    
#4
Error de compilación
                      main.cpp:13:3: error: use of undeclared identifier 'memset'; did you mean 'wmemset'?
  memset(sum, 0, sizeof(sum));
  ^~~~~~
  wmemset
/usr/include/wchar.h:271:17: note: 'wmemset' declared here
extern wchar_t *wmemset (wchar_t *__s, wchar_t __c, size_t __n) __THROW;
                ^
main.cpp:13:10: error: cannot initialize a parameter of type 'wchar_t *' with an lvalue of type 'int [500005]'
  memset(sum, 0, sizeof(sum));
         ^~~
/usr/include/wchar.h:271:35: note: passing argument to parameter '__s' here
extern wchar_t *wmemset (wchar_t *__s, wchar_t __c, size_t __n) __THROW;
                                  ^
2 errors generated.

                    
#5
Error de compilación
                      main.cpp:13:3: error: use of undeclared identifier 'memset'; did you mean 'wmemset'?
  memset(sum, 0, sizeof(sum));
  ^~~~~~
  wmemset
/usr/include/wchar.h:271:17: note: 'wmemset' declared here
extern wchar_t *wmemset (wchar_t *__s, wchar_t __c, size_t __n) __THROW;
                ^
main.cpp:13:10: error: cannot initialize a parameter of type 'wchar_t *' with an lvalue of type 'int [500005]'
  memset(sum, 0, sizeof(sum));
         ^~~
/usr/include/wchar.h:271:35: note: passing argument to parameter '__s' here
extern wchar_t *wmemset (wchar_t *__s, wchar_t __c, size_t __n) __THROW;
                                  ^
2 errors generated.

                    
#6
Error de compilación
                      main.cpp:13:3: error: use of undeclared identifier 'memset'; did you mean 'wmemset'?
  memset(sum, 0, sizeof(sum));
  ^~~~~~
  wmemset
/usr/include/wchar.h:271:17: note: 'wmemset' declared here
extern wchar_t *wmemset (wchar_t *__s, wchar_t __c, size_t __n) __THROW;
                ^
main.cpp:13:10: error: cannot initialize a parameter of type 'wchar_t *' with an lvalue of type 'int [500005]'
  memset(sum, 0, sizeof(sum));
         ^~~
/usr/include/wchar.h:271:35: note: passing argument to parameter '__s' here
extern wchar_t *wmemset (wchar_t *__s, wchar_t __c, size_t __n) __THROW;
                                  ^
2 errors generated.

                    
#7
Error de compilación
                      main.cpp:13:3: error: use of undeclared identifier 'memset'; did you mean 'wmemset'?
  memset(sum, 0, sizeof(sum));
  ^~~~~~
  wmemset
/usr/include/wchar.h:271:17: note: 'wmemset' declared here
extern wchar_t *wmemset (wchar_t *__s, wchar_t __c, size_t __n) __THROW;
                ^
main.cpp:13:10: error: cannot initialize a parameter of type 'wchar_t *' with an lvalue of type 'int [500005]'
  memset(sum, 0, sizeof(sum));
         ^~~
/usr/include/wchar.h:271:35: note: passing argument to parameter '__s' here
extern wchar_t *wmemset (wchar_t *__s, wchar_t __c, size_t __n) __THROW;
                                  ^
2 errors generated.

                    
#8
Error de compilación
                      main.cpp:13:3: error: use of undeclared identifier 'memset'; did you mean 'wmemset'?
  memset(sum, 0, sizeof(sum));
  ^~~~~~
  wmemset
/usr/include/wchar.h:271:17: note: 'wmemset' declared here
extern wchar_t *wmemset (wchar_t *__s, wchar_t __c, size_t __n) __THROW;
                ^
main.cpp:13:10: error: cannot initialize a parameter of type 'wchar_t *' with an lvalue of type 'int [500005]'
  memset(sum, 0, sizeof(sum));
         ^~~
/usr/include/wchar.h:271:35: note: passing argument to parameter '__s' here
extern wchar_t *wmemset (wchar_t *__s, wchar_t __c, size_t __n) __THROW;
                                  ^
2 errors generated.

                    
#9
Error de compilación
                      main.cpp:13:3: error: use of undeclared identifier 'memset'; did you mean 'wmemset'?
  memset(sum, 0, sizeof(sum));
  ^~~~~~
  wmemset
/usr/include/wchar.h:271:17: note: 'wmemset' declared here
extern wchar_t *wmemset (wchar_t *__s, wchar_t __c, size_t __n) __THROW;
                ^
main.cpp:13:10: error: cannot initialize a parameter of type 'wchar_t *' with an lvalue of type 'int [500005]'
  memset(sum, 0, sizeof(sum));
         ^~~
/usr/include/wchar.h:271:35: note: passing argument to parameter '__s' here
extern wchar_t *wmemset (wchar_t *__s, wchar_t __c, size_t __n) __THROW;
                                  ^
2 errors generated.

                    
#10
Error de compilación
                      main.cpp:13:3: error: use of undeclared identifier 'memset'; did you mean 'wmemset'?
  memset(sum, 0, sizeof(sum));
  ^~~~~~
  wmemset
/usr/include/wchar.h:271:17: note: 'wmemset' declared here
extern wchar_t *wmemset (wchar_t *__s, wchar_t __c, size_t __n) __THROW;
                ^
main.cpp:13:10: error: cannot initialize a parameter of type 'wchar_t *' with an lvalue of type 'int [500005]'
  memset(sum, 0, sizeof(sum));
         ^~~
/usr/include/wchar.h:271:35: note: passing argument to parameter '__s' here
extern wchar_t *wmemset (wchar_t *__s, wchar_t __c, size_t __n) __THROW;
                                  ^
2 errors generated.

                    
#11
Error de compilación
                      main.cpp:13:3: error: use of undeclared identifier 'memset'; did you mean 'wmemset'?
  memset(sum, 0, sizeof(sum));
  ^~~~~~
  wmemset
/usr/include/wchar.h:271:17: note: 'wmemset' declared here
extern wchar_t *wmemset (wchar_t *__s, wchar_t __c, size_t __n) __THROW;
                ^
main.cpp:13:10: error: cannot initialize a parameter of type 'wchar_t *' with an lvalue of type 'int [500005]'
  memset(sum, 0, sizeof(sum));
         ^~~
/usr/include/wchar.h:271:35: note: passing argument to parameter '__s' here
extern wchar_t *wmemset (wchar_t *__s, wchar_t __c, size_t __n) __THROW;
                                  ^
2 errors generated.

                    
#12
Error de compilación
                      main.cpp:13:3: error: use of undeclared identifier 'memset'; did you mean 'wmemset'?
  memset(sum, 0, sizeof(sum));
  ^~~~~~
  wmemset
/usr/include/wchar.h:271:17: note: 'wmemset' declared here
extern wchar_t *wmemset (wchar_t *__s, wchar_t __c, size_t __n) __THROW;
                ^
main.cpp:13:10: error: cannot initialize a parameter of type 'wchar_t *' with an lvalue of type 'int [500005]'
  memset(sum, 0, sizeof(sum));
         ^~~
/usr/include/wchar.h:271:35: note: passing argument to parameter '__s' here
extern wchar_t *wmemset (wchar_t *__s, wchar_t __c, size_t __n) __THROW;
                                  ^
2 errors generated.

                    
#13
Error de compilación
                      main.cpp:13:3: error: use of undeclared identifier 'memset'; did you mean 'wmemset'?
  memset(sum, 0, sizeof(sum));
  ^~~~~~
  wmemset
/usr/include/wchar.h:271:17: note: 'wmemset' declared here
extern wchar_t *wmemset (wchar_t *__s, wchar_t __c, size_t __n) __THROW;
                ^
main.cpp:13:10: error: cannot initialize a parameter of type 'wchar_t *' with an lvalue of type 'int [500005]'
  memset(sum, 0, sizeof(sum));
         ^~~
/usr/include/wchar.h:271:35: note: passing argument to parameter '__s' here
extern wchar_t *wmemset (wchar_t *__s, wchar_t __c, size_t __n) __THROW;
                                  ^
2 errors generated.

                    
#14
Error de compilación
                      main.cpp:13:3: error: use of undeclared identifier 'memset'; did you mean 'wmemset'?
  memset(sum, 0, sizeof(sum));
  ^~~~~~
  wmemset
/usr/include/wchar.h:271:17: note: 'wmemset' declared here
extern wchar_t *wmemset (wchar_t *__s, wchar_t __c, size_t __n) __THROW;
                ^
main.cpp:13:10: error: cannot initialize a parameter of type 'wchar_t *' with an lvalue of type 'int [500005]'
  memset(sum, 0, sizeof(sum));
         ^~~
/usr/include/wchar.h:271:35: note: passing argument to parameter '__s' here
extern wchar_t *wmemset (wchar_t *__s, wchar_t __c, size_t __n) __THROW;
                                  ^
2 errors generated.

                    
#15
Error de compilación
                      main.cpp:13:3: error: use of undeclared identifier 'memset'; did you mean 'wmemset'?
  memset(sum, 0, sizeof(sum));
  ^~~~~~
  wmemset
/usr/include/wchar.h:271:17: note: 'wmemset' declared here
extern wchar_t *wmemset (wchar_t *__s, wchar_t __c, size_t __n) __THROW;
                ^
main.cpp:13:10: error: cannot initialize a parameter of type 'wchar_t *' with an lvalue of type 'int [500005]'
  memset(sum, 0, sizeof(sum));
         ^~~
/usr/include/wchar.h:271:35: note: passing argument to parameter '__s' here
extern wchar_t *wmemset (wchar_t *__s, wchar_t __c, size_t __n) __THROW;
                                  ^
2 errors generated.

                    
#16
Error de compilación
                      main.cpp:13:3: error: use of undeclared identifier 'memset'; did you mean 'wmemset'?
  memset(sum, 0, sizeof(sum));
  ^~~~~~
  wmemset
/usr/include/wchar.h:271:17: note: 'wmemset' declared here
extern wchar_t *wmemset (wchar_t *__s, wchar_t __c, size_t __n) __THROW;
                ^
main.cpp:13:10: error: cannot initialize a parameter of type 'wchar_t *' with an lvalue of type 'int [500005]'
  memset(sum, 0, sizeof(sum));
         ^~~
/usr/include/wchar.h:271:35: note: passing argument to parameter '__s' here
extern wchar_t *wmemset (wchar_t *__s, wchar_t __c, size_t __n) __THROW;
                                  ^
2 errors generated.

                    
#17
Error de compilación
                      main.cpp:13:3: error: use of undeclared identifier 'memset'; did you mean 'wmemset'?
  memset(sum, 0, sizeof(sum));
  ^~~~~~
  wmemset
/usr/include/wchar.h:271:17: note: 'wmemset' declared here
extern wchar_t *wmemset (wchar_t *__s, wchar_t __c, size_t __n) __THROW;
                ^
main.cpp:13:10: error: cannot initialize a parameter of type 'wchar_t *' with an lvalue of type 'int [500005]'
  memset(sum, 0, sizeof(sum));
         ^~~
/usr/include/wchar.h:271:35: note: passing argument to parameter '__s' here
extern wchar_t *wmemset (wchar_t *__s, wchar_t __c, size_t __n) __THROW;
                                  ^
2 errors generated.

                    
#18
Error de compilación
                      main.cpp:13:3: error: use of undeclared identifier 'memset'; did you mean 'wmemset'?
  memset(sum, 0, sizeof(sum));
  ^~~~~~
  wmemset
/usr/include/wchar.h:271:17: note: 'wmemset' declared here
extern wchar_t *wmemset (wchar_t *__s, wchar_t __c, size_t __n) __THROW;
                ^
main.cpp:13:10: error: cannot initialize a parameter of type 'wchar_t *' with an lvalue of type 'int [500005]'
  memset(sum, 0, sizeof(sum));
         ^~~
/usr/include/wchar.h:271:35: note: passing argument to parameter '__s' here
extern wchar_t *wmemset (wchar_t *__s, wchar_t __c, size_t __n) __THROW;
                                  ^
2 errors generated.

                    
#19
Error de compilación
                      main.cpp:13:3: error: use of undeclared identifier 'memset'; did you mean 'wmemset'?
  memset(sum, 0, sizeof(sum));
  ^~~~~~
  wmemset
/usr/include/wchar.h:271:17: note: 'wmemset' declared here
extern wchar_t *wmemset (wchar_t *__s, wchar_t __c, size_t __n) __THROW;
                ^
main.cpp:13:10: error: cannot initialize a parameter of type 'wchar_t *' with an lvalue of type 'int [500005]'
  memset(sum, 0, sizeof(sum));
         ^~~
/usr/include/wchar.h:271:35: note: passing argument to parameter '__s' here
extern wchar_t *wmemset (wchar_t *__s, wchar_t __c, size_t __n) __THROW;
                                  ^
2 errors generated.

                    
#20
Error de compilación
                      main.cpp:13:3: error: use of undeclared identifier 'memset'; did you mean 'wmemset'?
  memset(sum, 0, sizeof(sum));
  ^~~~~~
  wmemset
/usr/include/wchar.h:271:17: note: 'wmemset' declared here
extern wchar_t *wmemset (wchar_t *__s, wchar_t __c, size_t __n) __THROW;
                ^
main.cpp:13:10: error: cannot initialize a parameter of type 'wchar_t *' with an lvalue of type 'int [500005]'
  memset(sum, 0, sizeof(sum));
         ^~~
/usr/include/wchar.h:271:35: note: passing argument to parameter '__s' here
extern wchar_t *wmemset (wchar_t *__s, wchar_t __c, size_t __n) __THROW;
                                  ^
2 errors generated.

                    
Puntos totales: 0 / 100

Código

#include <iostream>

using namespace std;

typedef long long ll;

const int MAXN = 500005;
int n, sum[MAXN];

int
main() {
  cin >> n;
  memset(sum, 0, sizeof(sum));
  for (int i = 0; i < n; ++i) {
    cin >> sum[i];
    if (i > 0) sum[i] += sum[i - 1];
  }
  int left = 0, right = 0;
  for (int i = 1; i < n; ++i) {
    left = sum[i - 1];
    right = sum[n - 1] - sum[i - 1];
    if (left > 0 && right < 0) {
      cout << i << endl;
      return 0;
    }
  }
  cout << "Impossible" << endl;
  return 0;
}