Language: C++

#define _CRT_SECURE_NO_WARNINGS
 
#include<stdio.h>
#include<iostream>
#include<cmath>
#include<vector>
#include<string>
#include<string.h>
#include<algorithm>
#include<numeric>
using namespace std;
 
 
int main() {
	int N = 0;
	vector <long long> a;
	
	long long mi = 0;
	cin >> N;
 
	for (int i = 0; i<N; i++) {
		long  long num = 0;
		cin >> num;
		a.push_back(num);
	}
	
	mi = abs(a[0] - accumulate(a.begin()+1, a.end(), 0));
 
	for (int i = 0; i<N; i++) {
		
	
		
		if (i == 0) {
			
			
			if (mi >= abs(a[0] - accumulate(a.begin() + 1, a.end(), 0))) {
				mi = abs(a[0] - (int)accumulate(a.begin()+1, a.end(), 0));
			
			}
 
		
		}
		
		else {
		
			
			if (mi > abs(accumulate(a.begin(), a.begin() + i, 0) - accumulate(a.begin()+i, a.end(), 0))) {
				mi = abs(accumulate(a.begin(), a.begin() + i, 0) - accumulate(a.begin()+i, a.end(), 0));
				
			}
		}
		}
 
	cout << mi << endl;
 
	return 0;
 
 
}

Compiler output:
a.cc:2:1: error: extended character   is not valid in an identifier
    2 |  
      | ^
a.cc:12:1: error: extended character   is not valid in an identifier
   12 |  
      | ^
a.cc:13:1: error: extended character   is not valid in an identifier
   13 |  
      | ^
a.cc:20:1: error: extended character   is not valid in an identifier
   20 |  
      | ^
a.cc:28:1: error: extended character   is not valid in an identifier
   28 |  
      | ^
a.cc:40:1: error: extended character   is not valid in an identifier
   40 |  
      | ^
a.cc:53:1: error: extended character   is not valid in an identifier
   53 |  
      | ^
a.cc:55:1: error: extended character   is not valid in an identifier
   55 |  
      | ^
a.cc:57:1: error: extended character   is not valid in an identifier
   57 |  
      | ^
a.cc:58:1: error: extended character   is not valid in an identifier
   58 |  
      | ^
a.cc:2:1: error: '\U000000a0' does not name a type
    2 |  
      | ^
In file included from /usr/include/wchar.h:53,
                 from /usr/include/c++/14/cwchar:44,
                 from /usr/include/c++/14/bits/postypes.h:40,
                 from /usr/include/c++/14/iosfwd:42,
                 from /usr/include/c++/14/ios:40,
                 from /usr/include/c++/14/ostream:40,
                 from /usr/include/c++/14/iostream:41,
                 from a.cc:4:
/usr/include/x86_64-linux-gnu/bits/types/mbstate_t.h:6:9: error: '__mbstate_t' does not name a type
    6 | typedef __mbstate_t mbstate_t;
      |         ^~~~~~~~~~~
/usr/include/wchar.h:104:59: error: 'size_t' has not been declared
  104 |                          const wchar_t *__restrict __src, size_t __n)
      |                                                           ^~~~~~
/usr/include/wchar.h:109:8: error: 'size_t' does not name a type
  109 | extern size_t wcslcpy (wchar_t *__restrict __dest,
      |        ^~~~~~
/usr/include/wchar.h:61:1: note: 'size_t' is defined in header '<cstddef>'; this is probably fixable by adding '#include <cstddef>'
   60 | # include <bits/types/locale_t.h>
  +++ |+#include <cstddef>
   61 | #endif
/usr/include/wchar.h:115:8: error: 'size_t' does not name a type
  115 | extern size_t wcslcat (wchar_t *__restrict __dest,
      |        ^~~~~~
/usr/include/wchar.h:115:8: note: 'size_t' is defined in header '<cstddef>'; this is probably fixable by adding '#include <cstddef>'
/usr/include/wchar.h:126:59: error: 'size_t' has not been declared
  126 |                          const wchar_t *__restrict __src, size_t __n)
      |                                                           ^~~~~~
/usr/include/wchar.h:133:63: error: 'size_t' has not been declared
  133 | extern int wcsncmp (const wchar_t *__s1, const wchar_t *__s2, size_t __n)
      |                                                               ^~~~~~
/usr/include/wchar.h:142:25: error: 'size_t' has not been declared
  142 |                         size_t __n) __THROW;
      |                         ^~~~~~
/usr/include/wchar.h:150:27: error: 'size_t' has not been declared
  150 |                           size_t __n, locale_t __loc) __THROW;
      |                           ^~~~~~
/usr/include/wchar.h:159:8: error: 'size_t' does not name a type
  159 | extern size_t wcsxfrm (wchar_t *__restrict __s1,
      |        ^~~~~~
/usr/include/wchar.h:159:8: note: 'size_t' is defined in header '<cstddef>'; this is probably fixable by adding '#include <cstddef>'
/usr/include/wchar.h:174:8: error: 'size_t' does not name a type
  174 | extern size_t wcsxfrm_l (wchar_t *__s1, const wchar_t *__s2,
      |        ^~~~~~
/usr/include/wchar.h:174:8: note: 'size_t' is defined in header '<cstddef>'; this is probably fixable by adding '#include <cstddef>'
/usr/include/wchar.h:212:8: error: 'size_t' does not name a type
  212 | extern size_t wcscspn (const wchar_t *__wcs, const wchar_t *__reject)
      |        ^~~~~~
/usr/include/wchar.h:212:8: note: 'size_t' is defined in header '<cstddef>'; this is probably fixable by adding '#include <cstddef>'
/usr/include/wchar.h:216:8: error: 'size_t' does not name a type
  216 | extern size_t wcsspn (const wchar_t *__wcs, const wchar_t *__accept)
      |        ^~~~~~
/usr/include/wchar.h:216:8: note: 'size_t' is defined in header '<cstddef>'; this is probably fixable by adding '#include <cstddef>'
/usr/include/wchar.h:247:8: error: 'size_t' does not name a type
  247 | extern size_t wcslen (const wchar_t *__s) __THROW __attribute_pure__;
      |        ^~~~~~
/usr/include/wchar.h:247:8: note: 'size_t' is defined in header '<cstddef>'; this is probably fixable by adding '#include <cstddef>'
/usr/include/wchar.h:265:8: error: 'size_t' does not name a type
  265 | extern size_t wcsnlen (const wchar_t *__s, size_t __maxlen)
      |        ^~~~~~
/usr/include/wchar.h:265:8: note: 'size_t' is defined in header '<cstddef>'; this is probably fixable by adding '#include <cstddef>'
/usr/include/wchar.h:272:59: error: 'size_t' has not been declared
  272 | extern "C++" wchar_t *wmemchr (wchar_t *__s, wchar_t __c, size_t __n)
      |                                                           ^~~~~~
/usr/include/wchar.h:275:38: error: 'size_t' has not been declared
  275 |                                      size_t __n)
      |                                      ^~~~~~
/usr/include/wchar.h:283:63: error: 'size_t' has not been declared
  283 | extern int wmemcmp (const wchar_t *__s1, const wchar_t *__s2, size_t __n)
      |                                                               ^~~~~~
/usr/include/wchar.h:288:58: error: 'size_t' has not been declared
  288 |                          const wchar_t *__restrict __s2, size_t __n) __THROW;
      |                                                          ^~~~~~
/usr/include/wchar.h:292:63: error: 'size_t' has not been declared
  292 | extern wchar_t *wmemmove (wchar_t *__s1, const wchar_t *__s2, size_t __n)
      |                                                               ^~~~~~
/usr/include/wchar.h:296:53: error: 'size_t' has not been declared
  296 | extern wchar_t *wmemset (wchar_t *__s, wchar_t __c, size_t __n) __THROW;
      |                                                     ^~~~~~
/usr/include/wchar.h:302:59: error: 'size_t' has not been declared
  302 |                           const wchar_t *__restrict __s2, size_t __n)
      |                                                           ^~~~~~
/usr/include/wchar.h:317:27: error: 'mbstate_t' does not name a type
  317 | extern int mbsinit (const mbstate_t *__ps) __THROW __attribute_pure__;
      |                           ^~~~~~~~~
/usr/include/wchar.h:321:8: error: 'size_t' does not name a type
  321 | extern size_t mbrtowc (wchar_t *__restrict __pwc,
      |        ^~~~~~
/usr/include/wchar.h:321:8: note: 'size_t' is defined in header '<cstddef>'; this is probably fixable by adding '#include <cstddef>'
/usr/include/wchar.h:326:8: error: 'size_t' does not name a type
  326 | extern size_t wcrtomb (char *__restrict __s, wchar_t __wc,
      |        ^~~~~~
/usr/include/wchar.h:326:8: note: 'size_t' is defined in header '<cstddef>'; this is probably fixable by adding '#include <cstddef>'
/usr/include/wchar.h:330:8: error: 'size_t' does not name a type
  330 | extern size_t __mbrlen (const char *__restrict __s, size_t __n,
      |        ^~~~~~
/usr/include/wchar.h:330:8: note: 'size_t' is defined in header '<cstddef>'; this is probably fixable by adding '#include <cstddef>'
/usr/include/wchar.h:332:8: error: 'size_t' does not name a type
  332 | extern size_t mbrlen (const char *__restrict __s, size_t __n,
      |        ^~~~~~
/usr/include/wchar.h:332:8: note: 'size_t' is defined in header '<cstddef>'; this is probably fixable by adding '#include <cstddef>'
/usr/include/wchar.h:362:8: error: 'size_t' does not name a type
  362 | extern size_t mbsrtowcs (wchar_t *__restrict __dst,
      |        ^~~~~~
/usr/include/wchar.h:362:8: note: 'size_t' is defined in header '<cstddef>'; this is probably fixable by adding '#include <cstddef>'
/usr/include/wchar.h:368:8: error: 'size_t' does not name a type
  368 | extern size_t wcsrtombs (char *__restrict __dst,
      |        ^~~~~~
/usr/include/wchar.h:368:8: note: 'size_t' is defined in header '<cstddef>'; this is probably fixable by adding '#include <cstddef>'
/usr/include/wchar.h:376:8: error: 'size_t' does not name a type
  376 | extern size_t mbsnrtowcs (wchar_t *__restrict __dst,
      |        ^~~~~~
/usr/include/wchar.h:376:8: note: 'size_t' is defined in header '<cstddef>'; this is probably fixable by adding '#include <cstddef>'
/usr/include/wchar.h:382:8: error: 'size_t' does not name a type
  382 | extern size_t wcsnrtombs (char *__restrict __dst,
      |        ^~~~~~
/usr/include/wchar.h:382:8: note: 'size_t' is defined in header '<cstddef>'; this is probably fixable by adding '#include <cstddef>'
/usr/include/wchar.h:396:42: error: 'size_t' has not been declared
  396 | extern int wcswidth (const wchar_t *__s, size_t __n) __THROW;
      |                                          ^~~~~~
/usr/include/wchar.h:695:59: error: 'size_t' has not been declared
  695 |                          const wchar_t *__restrict __src, size_t __n)
      |                                                           ^~~~~~
/usr/include/wchar.h:718:8: error: '__FILE' does not name a type; did you mean 'EMFILE'?
  718 | extern __FILE *open_wmemstream (wchar_t **__bufloc, size_t *__sizeloc) __THROW
      |        ^~~~~~
      |        EMFILE
/usr/include/wchar.h:725:19: error: '__FILE' was not declared in this scope; did you mean 'EMFILE'?
  725 | extern int fwide (__FILE *__fp, int __mode) __THROW;
      |                   ^~~~~~
      |                   EMFILE
/usr/include/wchar.h:725:27: error: '__fp' was not declared in this scope
  725 | extern int fwide (__FILE *__fp, int __mode) __THROW;
      |                           ^~~~
/usr/include/wchar.h:725:33: error: expected primary-expression before 'int'
  725 | extern int fwide (__FILE *__fp, int __mode) __THROW;
      |                                 ^~~
/usr/include/wchar.h:725:43: error: expression list treated as compound expression in initializer [-fpermissive]
  725 | extern