Language: C++


1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
#include<stdio.h>
#include<string.h>
#include<iostream>
#include<fstream>
#include<vector>
#include<algorithm>
#include<math.h>
using namespace std;
  
int main(){
    std::istream & c_in = cin;
    const long INIT = 2147483647;
    int n, q;
    c_in >> n >> q;
    vector<long> A(n, INIT);
    while (q-- > 0)
    {
        int com, x;
        long y;
        c_in >> com >> x >> y;
        if (com == 0)   //update
        {
            A[x] = y;
        }
        else if (com == 1)  //find 
        {
            long m = *min_element(A.begin() + x, A.begin() + y+1);
            cout << m << endl;
        }
    }
}

Compiler output:
a.cc:2:1: error: expected unqualified-id before numeric constant
    2 | 1
      | ^
In file included from a.cc:34:
/usr/include/string.h:44:22: error: 'size_t' has not been declared
   44 |                      size_t __n) __THROW __nonnull ((1, 2));
      |                      ^~~~~~
/usr/include/string.h:47:56: error: 'size_t' has not been declared
   47 | extern void *memmove (void *__dest, const void *__src, size_t __n)
      |                                                        ^~~~~~
/usr/include/string.h:55:32: error: 'size_t' has not been declared
   55 |                       int __c, size_t __n)
      |                                ^~~~~~
/usr/include/string.h:61:42: error: 'size_t' has not been declared
   61 | extern void *memset (void *__s, int __c, size_t __n) __THROW __nonnull ((1));
      |                                          ^~~~~~
/usr/include/string.h:64:56: error: 'size_t' has not been declared
   64 | extern int memcmp (const void *__s1, const void *__s2, size_t __n)
      |                                                        ^~~~~~
/usr/include/string.h:80:60: error: 'size_t' has not been declared
   80 | extern int __memcmpeq (const void *__s1, const void *__s2, size_t __n)
      |                                                            ^~~~~~
/usr/include/string.h:87:42: error: 'size_t' has not been declared
   87 | extern void *memchr (void *__s, int __c, size_t __n)
      |                                          ^~~~~~
/usr/include/string.h:89:54: error: 'size_t' has not been declared
   89 | extern const void *memchr (const void *__s, int __c, size_t __n)
      |                                                      ^~~~~~
/usr/include/string.h:126:49: error: 'size_t' has not been declared
  126 | extern "C++" void *memrchr (void *__s, int __c, size_t __n)
      |                                                 ^~~~~~
/usr/include/string.h:129:61: error: 'size_t' has not been declared
  129 | extern "C++" const void *memrchr (const void *__s, int __c, size_t __n)
      |                                                             ^~~~~~
/usr/include/string.h:145:53: error: 'size_t' has not been declared
  145 |                       const char *__restrict __src, size_t __n)
      |                                                     ^~~~~~
/usr/include/string.h:153:23: error: 'size_t' has not been declared
  153 |                       size_t __n) __THROW __nonnull ((1, 2));
      |                       ^~~~~~
/usr/include/string.h:159:57: error: 'size_t' has not been declared
  159 | extern int strncmp (const char *__s1, const char *__s2, size_t __n)
      |                                                         ^~~~~~
/usr/include/string.h:166:8: error: 'size_t' does not name a type
  166 | extern size_t strxfrm (char *__restrict __dest,
      |        ^~~~~~
/usr/include/string.h:34:1: note: 'size_t' is defined in header '<cstddef>'; this is probably fixable by adding '#include <cstddef>'
   33 | #include <stddef.h>
  +++ |+#include <cstddef>
   34 | 
/usr/include/string.h:179:8: error: 'size_t' does not name a type
  179 | extern size_t strxfrm_l (char *__dest, const char *__src, size_t __n,
      |        ^~~~~~
/usr/include/string.h:179:8: note: 'size_t' is defined in header '<cstddef>'; this is probably fixable by adding '#include <cstddef>'
/usr/include/string.h:195:45: error: 'size_t' has not been declared
  195 | extern char *strndup (const char *__string, size_t __n)
      |                                             ^~~~~~
/usr/include/string.h:293:8: error: 'size_t' does not name a type
  293 | extern size_t strcspn (const char *__s, const char *__reject)
      |        ^~~~~~
/usr/include/string.h:293:8: note: 'size_t' is defined in header '<cstddef>'; this is probably fixable by adding '#include <cstddef>'
/usr/include/string.h:297:8: error: 'size_t' does not name a type
  297 | extern size_t strspn (const char *__s, const char *__accept)
      |        ^~~~~~
/usr/include/string.h:297:8: note: 'size_t' is defined in header '<cstddef>'; this is probably fixable by adding '#include <cstddef>'
/usr/include/string.h:389:46: error: 'size_t' has not been declared
  389 | extern void *memmem (const void *__haystack, size_t __haystacklen,
      |                                              ^~~~~~
/usr/include/string.h:390:44: error: 'size_t' has not been declared
  390 |                      const void *__needle, size_t __needlelen)
      |                                            ^~~~~~
/usr/include/string.h:398:55: error: 'size_t' has not been declared
  398 |                         const void *__restrict __src, size_t __n)
      |                                                       ^~~~~~
/usr/include/string.h:401:53: error: 'size_t' has not been declared
  401 |                       const void *__restrict __src, size_t __n)
      |                                                     ^~~~~~
/usr/include/string.h:407:8: error: 'size_t' does not name a type
  407 | extern size_t strlen (const char *__s)
      |        ^~~~~~
/usr/include/string.h:407:8: note: 'size_t' is defined in header '<cstddef>'; this is probably fixable by adding '#include <cstddef>'
/usr/include/string.h:413:8: error: 'size_t' does not name a type
  413 | extern size_t strnlen (const char *__string, size_t __maxlen)
      |        ^~~~~~
/usr/include/string.h:413:8: note: 'size_t' is defined in header '<cstddef>'; this is probably fixable by adding '#include <cstddef>'
/usr/include/string.h:444:53: error: 'size_t' has not been declared
  444 | extern char *strerror_r (int __errnum, char *__buf, size_t __buflen)
      |                                                     ^~~~~~
In file included from /usr/include/string.h:462:
/usr/include/strings.h:34:54: error: 'size_t' has not been declared
   34 | extern int bcmp (const void *__s1, const void *__s2, size_t __n)
      |                                                      ^~~~~~
/usr/include/strings.h:38:53: error: 'size_t' has not been declared
   38 | extern void bcopy (const void *__src, void *__dest, size_t __n)
      |                                                     ^~~~~~
/usr/include/strings.h:42:31: error: 'size_t' has not been declared
   42 | extern void bzero (void *__s, size_t __n) __THROW __nonnull ((1));
      |                               ^~~~~~
/usr/include/strings.h:120:61: error: 'size_t' has not been declared
  120 | extern int strncasecmp (const char *__s1, const char *__s2, size_t __n)
      |                                                             ^~~~~~
/usr/include/strings.h:134:27: error: 'size_t' has not been declared
  134 |                           size_t __n, locale_t __loc)
      |                           ^~~~~~
/usr/include/string.h:466:40: error: 'size_t' has not been declared
  466 | extern void explicit_bzero (void *__s, size_t __n) __THROW __nonnull ((1))
      |                                        ^~~~~~
/usr/include/string.h:497:55: error: 'size_t' has not been declared
  497 |                         const char *__restrict __src, size_t __n)
      |                                                       ^~~~~~
/usr/include/string.h:500:53: error: 'size_t' has not been declared
  500 |                       const char *__restrict __src, size_t __n)
      |                                                     ^~~~~~
/usr/include/string.h:506:8: error: 'size_t' does not name a type
  506 | extern size_t strlcpy (char *__restrict __dest,
      |        ^~~~~~
/usr/include/string.h:506:8: note: 'size_t' is defined in header '<cstddef>'; this is probably fixable by adding '#include <cstddef>'
/usr/include/string.h:512:8: error: 'size_t' does not name a type
  512 | extern size_t strlcat (char *__restrict __dest,
      |        ^~~~~~
/usr/include/string.h:512:8: note: 'size_t' is defined in header '<cstddef>'; this is probably fixable by adding '#include <cstddef>'
/usr/include/string.h:526:34: error: 'size_t' has not been declared
  526 | extern void *memfrob (void *__s, size_t __n) __THROW __nonnull ((1))
      |                                  ^~~~~~
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:35:
/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:54:1: note: 'size_t' is defined in header '<cstddef>'; this is probably fixable by adding '#include <cstddef>'
   53 | #include <bits/types/mbstate_t.h>
  +++ |+#include <cstddef>
   54 | #include <bits/types/__FILE.h>
/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: 'siz