Submission #197016

#TimeUsernameProblemLanguageResultExecution timeMemory
197016quocnguyen1012Foehn Phenomena (JOI17_foehn_phenomena)C++14
Compilation error
0 ms0 KiB
Skip to content Why GitHub? Enterprise Explore Marketplace Pricing Search Sign in Sign up mostafa-saad / MyCompetitiveProgramming 1614030 Code Issues 0 Pull requests 0 Projects 0 Security Insights Join GitHub today GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together. MyCompetitiveProgramming/Olympiad/JOI/official/JOI/2017/2017-ho-t1-sample.cpp @mostafa-saad mostafa-saad local a013b2b on 12 Jul, 2019 46 lines (45 sloc) 727 Bytes #include<stdio.h> #include<vector> #include<algorithm> using namespace std; typedef long long ll; ll s1,s2; ll dif[300001]; ll get(ll t) { if(t>0)return -s1*t; else return -s2*t; } int main() { int num,query; scanf("%d%d%lld%lld",&num,&query,&s1,&s2); vector<int>v; for(int i=0;i<=num;i++) { int z; scanf("%d",&z); v.push_back(z); } ll ans=0; for(int i=0;i<num;i++) { dif[i]=v[i+1]-v[i]; ans+=get(dif[i]); } for(int i=0;i<query;i++) { int za,zb,zc; scanf("%d%d%d",&za,&zb,&zc); ans-=get(dif[za-1]); dif[za-1]+=zc; ans+=get(dif[za-1]); if(zb!=num) { ans-=get(dif[zb]); dif[zb]-=zc; ans+=get(dif[zb]); } printf("%lld\n",ans); } }

Compilation message (stderr)

foehn_phenomena.cpp:20:1: error: stray '@' in program
 @mostafa-saad mostafa-saad local
 ^
foehn_phenomena.cpp:1:1: error: 'Skip' does not name a type
 Skip to content
 ^~~~
In file included from /usr/include/c++/7/bits/exception_ptr.h:38:0,
                 from /usr/include/c++/7/exception:142,
                 from /usr/include/c++/7/new:40,
                 from /usr/include/c++/7/ext/new_allocator.h:33,
                 from /usr/include/x86_64-linux-gnu/c++/7/bits/c++allocator.h:33,
                 from /usr/include/c++/7/bits/allocator.h:46,
                 from /usr/include/c++/7/vector:61,
                 from foehn_phenomena.cpp:25:
/usr/include/c++/7/bits/cxxabi_init_exception.h:63:32: error: 'size_t' was not declared in this scope
       __cxa_allocate_exception(size_t) _GLIBCXX_NOTHROW;
                                ^~~~~~
/usr/include/c++/7/bits/cxxabi_init_exception.h:63:32: note: suggested alternative:
In file included from /usr/include/c++/7/bits/stl_algobase.h:59:0,
                 from /usr/include/c++/7/vector:60,
                 from foehn_phenomena.cpp:25:
/usr/include/x86_64-linux-gnu/c++/7/bits/c++config.h:231:26: note:   'std::size_t'
   typedef __SIZE_TYPE__  size_t;
                          ^~~~~~
In file included from /usr/include/c++/7/exception:142:0,
                 from /usr/include/c++/7/new:40,
                 from /usr/include/c++/7/ext/new_allocator.h:33,
                 from /usr/include/x86_64-linux-gnu/c++/7/bits/c++allocator.h:33,
                 from /usr/include/c++/7/bits/allocator.h:46,
                 from /usr/include/c++/7/vector:61,
                 from foehn_phenomena.cpp:25:
/usr/include/c++/7/bits/exception_ptr.h: In function 'std::__exception_ptr::exception_ptr std::make_exception_ptr(_Ex)':
/usr/include/c++/7/bits/exception_ptr.h:185:71: error: '__cxxabiv1::__cxa_allocate_exception' cannot be used as a function
           void *__e = __cxxabiv1::__cxa_allocate_exception(sizeof(_Ex));
                                                                       ^
In file included from /usr/include/endian.h:60:0,
                 from /usr/include/x86_64-linux-gnu/bits/waitstatus.h:64,
                 from /usr/include/stdlib.h:42,
                 from /usr/include/c++/7/cstdlib:75,
                 from /usr/include/c++/7/bits/stl_algo.h:59,
                 from /usr/include/c++/7/algorithm:62,
                 from foehn_phenomena.cpp:26:
/usr/include/x86_64-linux-gnu/bits/byteswap.h: At global scope:
/usr/include/x86_64-linux-gnu/bits/byteswap.h:108:17: error: '__uint64_t' does not name a type; did you mean '__uint128_t'?
 static __inline __uint64_t
                 ^~~~~~~~~~
                 __uint128_t
In file included from /usr/include/c++/7/cstdlib:75:0,
                 from /usr/include/c++/7/bits/stl_algo.h:59,
                 from /usr/include/c++/7/algorithm:62,
                 from foehn_phenomena.cpp:26:
/usr/include/stdlib.h:139:8: error: 'size_t' does not name a type; did you mean '__size_t'?
 extern size_t __ctype_get_mb_cur_max (void) __THROW __wur;
        ^~~~~~
        __size_t
In file included from /usr/include/stdlib.h:314:0,
                 from /usr/include/c++/7/cstdlib:75,
                 from /usr/include/c++/7/bits/stl_algo.h:59,
                 from /usr/include/c++/7/algorithm:62,
                 from foehn_phenomena.cpp:26:
/usr/include/x86_64-linux-gnu/sys/types.h:33:9: error: '__u_char' does not name a type; did you mean 'char'?
 typedef __u_char u_char;
         ^~~~~~~~
         char
/usr/include/x86_64-linux-gnu/sys/types.h:34:9: error: '__u_short' does not name a type; did you mean '__u_intN_t'?
 typedef __u_short u_short;
         ^~~~~~~~~
         __u_intN_t
/usr/include/x86_64-linux-gnu/sys/types.h:35:9: error: '__u_int' does not name a type; did you mean '__unix'?
 typedef __u_int u_int;
         ^~~~~~~
         __unix
/usr/include/x86_64-linux-gnu/sys/types.h:36:9: error: '__u_long' does not name a type; did you mean 'long'?
 typedef __u_long u_long;
         ^~~~~~~~
         long
/usr/include/x86_64-linux-gnu/sys/types.h:37:9: error: '__quad_t' does not name a type; did you mean '__muldc3'?
 typedef __quad_t quad_t;
         ^~~~~~~~
         __muldc3
/usr/include/x86_64-linux-gnu/sys/types.h:38:9: error: '__u_quad_t' does not name a type; did you mean '_IO_uid_t'?
 typedef __u_quad_t u_quad_t;
         ^~~~~~~~~~
         _IO_uid_t
/usr/include/x86_64-linux-gnu/sys/types.h:39:9: error: '__fsid_t' does not name a type; did you mean '__size_t'?
 typedef __fsid_t fsid_t;
         ^~~~~~~~
         __size_t
/usr/include/x86_64-linux-gnu/sys/types.h:44:9: error: '__loff_t' does not name a type; did you mean '_IO_off_t'?
 typedef __loff_t loff_t;
         ^~~~~~~~
         _IO_off_t
/usr/include/x86_64-linux-gnu/sys/types.h:48:9: error: '__ino_t' does not name a type; did you mean '__intN_t'?
 typedef __ino_t ino_t;
         ^~~~~~~
         __intN_t
/usr/include/x86_64-linux-gnu/sys/types.h:55:9: error: '__ino64_t' does not name a type; did you mean '__intN_t'?
 typedef __ino64_t ino64_t;
         ^~~~~~~~~
         __intN_t
/usr/include/x86_64-linux-gnu/sys/types.h:60:9: error: '__dev_t' does not name a type; did you mean 'lldiv_t'?
 typedef __dev_t dev_t;
         ^~~~~~~
         lldiv_t
/usr/include/x86_64-linux-gnu/sys/types.h:65:9: error: '__gid_t' does not name a type; did you mean '_IO_pid_t'?
 typedef __gid_t gid_t;
         ^~~~~~~
         _IO_pid_t
/usr/include/x86_64-linux-gnu/sys/types.h:70:9: error: '__mode_t' does not name a type; did you mean '__size_t'?
 typedef __mode_t mode_t;
         ^~~~~~~~
         __size_t
/usr/include/x86_64-linux-gnu/sys/types.h:75:9: error: '__nlink_t' does not name a type; did you mean '__size_t'?
 typedef __nlink_t nlink_t;
         ^~~~~~~~~
         __size_t
/usr/include/x86_64-linux-gnu/sys/types.h:80:9: error: '__uid_t' does not name a type; did you mean '_IO_uid_t'?
 typedef __uid_t uid_t;
         ^~~~~~~
         _IO_uid_t
/usr/include/x86_64-linux-gnu/sys/types.h:98:9: error: '__pid_t' does not name a type; did you mean '_IO_pid_t'?
 typedef __pid_t pid_t;
         ^~~~~~~
         _IO_pid_t
/usr/include/x86_64-linux-gnu/sys/types.h:104:9: error: '__id_t' does not name a type; did you mean 'ldiv_t'?
 typedef __id_t id_t;
         ^~~~~~
         ldiv_t
/usr/include/x86_64-linux-gnu/sys/types.h:115:9: error: '__daddr_t' does not name a type; did you mean '__ptr_t'?
 typedef __daddr_t daddr_t;
         ^~~~~~~~~
         __ptr_t
/usr/include/x86_64-linux-gnu/sys/types.h:116:9: error: '__caddr_t' does not name a type; did you mean '__ptr_t'?
 typedef __caddr_t caddr_t;
         ^~~~~~~~~
         __ptr_t
/usr/include/x86_64-linux-gnu/sys/types.h:122:9: error: '__key_t' does not name a type; did you mean '__ptr_t'?
 typedef __key_t key_t;
         ^~~~~~~
         __ptr_t
In file included from /usr/include/x86_64-linux-gnu/sys/types.h:132:0,
                 from /usr/include/stdlib.h:314,
                 from /usr/include/c++/7/cstdlib:75,
                 from /usr/include/c++/7/bits/stl_algo.h:59,
                 from /usr/include/c++/7/algorithm:62,
                 from foehn_phenomena.cpp:26:
/usr/include/time.h:59:9: error: '__clock_t' does not name a type; did you mean '__locale_t'?
 typedef __clock_t clock_t;
         ^~~~~~~~~
         __locale_t
/usr/include/time.h:75:9: error: '__time_t' does not name a type; did you mean '__size_t'?
 typedef __time_t time_t;
         ^~~~~~~~
         __size_t
/usr/include/time.h:91:9: error: '__clockid_t' does not name a type; did you mean '__locale_t'?
 typedef __clockid_t clockid_t;
         ^~~~~~~~~~~
         __locale_t
/usr/include/time.h:103:9: error: '__timer_t' does not name a type; did you mean '__size_t'?
 typedef __timer_t timer_t;
         ^~~~~~~~~
         __size_t
In file included from /usr/include/stdlib.h:314:0,
                 from /usr/include/c++/7/cstdlib:75,
                 from /usr/include/c++/7/bits/stl_algo.h:59,
                 from /usr/include/c++/7/algorithm:62,
                 from foehn_phenomena.cpp:26:
/usr/include/x86_64-linux-gnu/sys/types.h:136:9: error: '__useconds_t' does not name a type; did you mean '__u_intN_t'?
 typedef __useconds_t useconds_t;
         ^~~~~~~~~~~~
         __u_intN_t
/usr/include/x86_64-linux-gnu/sys/types.h:140:9: error: '__suseconds_t' does not name a type
 typedef __suseconds_t suseconds_t;
         ^~~~~~~~~~~~~
In file included from /usr/include/x86_64-linux-gnu/sys/select.h:43:0,
                 from /usr/include/x86_64-linux-gnu/sys/types.h:219,
                 from /usr/include/stdlib.h:314,
                 from /usr/include/c++/7/cstdlib:75,
                 from /usr/include/c++/7/bits/stl_algo.h:59,
                 from /usr/include/c++/7/algorithm:62,
                 from foehn_phenomena.cpp:26:
/usr/include/time.h:122:5: error: '__time_t' does not name a type; did you mean '__size_t'?
     __time_t tv_sec;  /* Seconds.  */
     ^~~~~~~~
     __size_t
/usr/include/time.h:123:5: error: '__syscall_slong_t' does not name a type
     __syscall_slong_t tv_nsec; /* Nanoseconds.  */
     ^~~~~~~~~~~~~~~~~
In file included from /usr/include/x86_64-linux-gnu/sys/select.h:45:0,
                 from /usr/include/x86_64-linux-gnu/sys/types.h:219,
                 from /usr/include/stdlib.h:314,
                 from /usr/include/c++/7/cstdlib:75,
                 from /usr/include/c++/7/bits/stl_algo.h:59,
                 from /usr/include/c++/7/algorithm:62,
                 from foehn_phenomena.cpp:26:
/usr/include/x86_64-linux-gnu/bits/time.h:32:5: error: '__time_t' does not name a type; did you mean '__size_t'?
     __time_t tv_sec;  /* Seconds.  */
     ^~~~~~~~
     __size_t
/usr/include/x86_64-linux-gnu/bits/time.h:33:5: error: '__suseconds_t' does not name a type
     __suseconds_t tv_usec; /* Microseconds.  */
     ^~~~~~~~~~~~~
In file included from /usr/include/stdlib.h:314:0,
                 from /usr/include/c++/7/cstdlib:75,
                 from /usr/include/c++/7/bits/stl_algo.h:59,
                 from /usr/include/c++/7/algorithm:62,
                 from foehn_phenomena.cpp:26:
/usr/include/x86_64-linux-gnu/sys/types.h:228:9: error: '__blksize_t' does not name a type; did you mean '__size_t'?
 typedef __blksize_t blksize_t;
         ^~~~~~~~~~~
         __size_t
/usr/include/x86_64-linux-gnu/sys/types.h:235:9: error: '__blkcnt_t' does not name a type; did you mean '__sigset_t'?
 typedef __blkcnt_t blkcnt_t;  /* Type to count number of disk blocks.  */
         ^~~~~~~~~~
         __sigset_t
/usr/include/x86_64-linux-gnu/sys/types.h:239:9: error: '__fsblkcnt_t' does not name a type; did you mean '__sigset_t'?
 typedef __fsblkcnt_t fsblkcnt_t; /* Type to count file system blocks.  */
         ^~~~~~~~~~~~
         __sigset_t
/usr/include/x86_64-linux-gnu/sys/types.h:243:9: error: '__fsfilcnt_t' does not name a type; did you mean '__sigset_t'?
 typedef __fsfilcnt_t fsfilcnt_t; /* Type to count file system inodes.  */
         ^~~~~~~~~~~~
         __sigset_t
/usr/include/x86_64-linux-gnu/sys/types.h:262:9: error: '__blkcnt64_t' does not name a type; did you mean 'u_int64_t'?
 typedef __blkcnt64_t blkcnt64_t;     /* Type to count number of disk blocks. */
         ^~~~~~~~~~~~
         u_int64_t
/usr/include/x86_64-linux-gnu/sys/types.h:263:9: error: '__fsblkcnt64_t' does not name a type; did you mean 'u_int64_t'?
 typedef __fsblkcnt64_t fsblkcnt64_t; /* Type to count file system blocks.  */
         ^~~~~~~~~~~~~~
         u_int64_t
/usr/include/x86_64-linux-gnu/sys/types.h:264:9: error: '__fsfilcnt64_t' does not name a type; did you mean 'u_int64_t'?
 typedef __fsfilcnt64_t fsfilcnt64_t; /* Type to count file system inodes.  */
         ^~~~~~~~~~~~~~
         u_int64_t
In file included from /usr/include/c++/7/cstdlib:75:0,
                 from /usr/include/c++/7/bits/stl_algo.h:59,
                 from /usr/include/c++/7/algorithm:62,
                 from foehn_phenomena.cpp:26:
/usr/include/stdlib.h:331:4: error: 'size_t' has not been declared
    size_t __statelen) __THROW __nonnull ((2));
    ^~~~~~
/usr/include/stdlib.h:361:4: error: 'size_t' has not been declared
    size_t __statelen,
    ^~~~~~
/usr/include/stdlib.h:466:22: error: 'size_t' was not declared in this scope
 extern void *malloc (size_t __size) __THROW __attribute_malloc__ __wur;
                      ^~~~~~
/usr/include/stdlib.h:466:22: note: suggested alternatives:
In file included from /usr/include/c++/7/bits/stl_algobase.h:59:0,
                 from /usr/include/c++/7/vector:60,
                 from foehn_phenomena.cpp:25:
/usr/include/x86_64-linux-gnu/c++/7/bits/c++config.h:231:26: note:   'std::size_t'
   typedef __SIZE_TYPE__  size_t;
                          ^~~~~~
/usr/include/x86_64-linux-gnu/c++/7/bits/c++config.h:231:26: note:   'std::size_t'
In file included from /usr/include/c++/7/cstdlib:75:0,
                 from /usr/include/c++/7/bits/stl_algo.h:59,
                 from /usr/include/c++/7/algorithm:62,
                 from foehn_phenomena.cpp:26:
/usr/include/stdlib.h:468:22: error: 'size_t' was not declared in this scope
 extern void *calloc (size_t __nmemb, size_t __size)
                      ^~~~~~
/usr/include/stdlib.h:468:22: note: suggested alternatives:
In file included from /usr/include/c++/7/bits/stl_algobase.h:59:0,
                 from /usr/include/c++/7/vector:60,
                 from foehn_phenomena.cpp:25:
/usr/include/x86_64-linux-gnu/c++/7/bits/c++config.h:231:26: note:   'std::size_t'
   typedef __SIZE_TYPE__  size_t;
                          ^~~~~~
/usr/include/x86_64-linux-gnu/c++/7/bits/c++config.h:231:26: note:   'std::size_t'
In file included from /usr/include/c++/7/cstdlib:75:0,
                 from /usr/include/c++/7/bits/stl_algo.h:59,
                 from /usr/include/c++/7/algorithm:62,
                 from foehn_phenomena.cpp:26:
/usr/include/stdlib.h:468:38: error: 'size_t' was not declared in this scope
 extern void *calloc (size_t __nmemb, size_t __size)
                                      ^~~~~~
/usr/include/stdlib.h:468:38: note: suggested alternatives:
In file included from /usr/include/c++/7/bits/stl_algobase.h:59:0,
                 from /usr/include/c++/7/vector:60,
                 from foehn_phenomena.cpp:25:
/usr/include/x86_64-linux-gnu/c++/7/bits/c++config.h:231:26: note:   'std::size_t'
   typedef __SIZE_TYPE__  size_t;
                          ^~~~~~
/usr/include/x86_64-linux-gnu/c++/7/bits/c++config.h:231:26: note:   'std::size_t'
In file included from /usr/include/c++/7/cstdlib:75:0,
                 from /usr/include/c++/7/bits/stl_algo.h:59,
                 from /usr/include/c++/7/algorithm:62,
                 from foehn_phenomena.cpp:26:
/usr/include/stdlib.h:468:51: error: expression list treated as compound expression in initializer [-fpermissive]
 extern void *calloc (size_t __nmemb, size_t __size)
                                                   ^
/usr/include/stdlib.h:480:36: error: 'size_t' has not been declared
 extern void *realloc (void *__ptr, size_t __size)
                                    ^~~~~~
In file included from /usr/include/stdlib.h:492:0,
                 from /usr/include/c++/7/cstdlib:75,
                 from /usr/include/c++/7/bits/stl_algo.h:59,
                 from /usr/include/c++/7/algorithm:62,
                 from foehn_phenomena.cpp:26:
/usr/include/alloca.h:32:22: error: 'size_t' was not declared in this scope
 extern void *alloca (size_t __size) __THROW;
                      ^~~~~~
/usr/include/alloca.h:32:22: note: suggested alternatives:
In file included from /usr/include/c++/7/bits/stl_algobase.h:59:0,
                 from /usr/include/c++/7/vector:60,
                 from foehn_phenomena.cpp:25:
/usr/include/x86_64-linux-gnu/c++/7/bits/c++config.h:231:26: note:   'std::size_t'
   typedef __SIZE_TYPE__  size_t;
                          ^~~~~~
/usr/include/x86_64-linux-gnu/c++/7/bits/c++config.h:231:26: note:   'std::size_t'
In file included from /usr/include/c++/7/cstdlib:75:0,
                 from /usr/include/c++/7/bits/stl_algo.h:59,
                 from /usr/include/c++/7/algorithm:62,
                 from foehn_phenomena.cpp:26:
/usr/include/stdlib.h:498:22: error: 'size_t' was not declared in this scope
 extern void *valloc (size_t __size) __THROW __attribute_malloc__ __wur;
                      ^~~~~~
/usr/include/stdlib.h:498:22: note: suggested alternatives:
In file included from /usr/include/c++/7/bits/stl_algobase.h:59:0,
                 from /usr/include/c++/7/vector:60,
                 from foehn_phenomena.cpp:25:
/usr/include/x86_64-linux-gnu/c++/7/bits/c++config.h:231:26: note:   'std::size_t'
   typedef __SIZE_TYPE__  size_t;
                          ^~~~~~
/usr/include/x86_64-linux-gnu/c++/7/bits/c++config.h:231:26: note:   'std::size_t'
In file included from /usr/include/c++/7/cstdlib:75:0,
                 from /usr/include/c++/7/bits/stl_algo.h:59,
                 from /usr/include/c++/7/algorithm:62,
                 from foehn_phenomena.cpp:26:
/usr/include/stdlib.h:503:45: error: 'size_t' has not been declared
 extern int posix_memalign (void **__memptr, size_t __alignment, size_t __size)
                                             ^~~~~~
/usr/include/stdlib.h:503:65: error: 'size_t' has not been declared
 extern int posix_memalign (void **__memptr, size_t __alignment, size_t __size)
                                                                 ^~~~~~
/usr/include/stdlib.h:509:29: error: 'size_t' was not declared in this scope
 extern void *aligned_alloc (size_t __alignment, size_t __size)
                             ^~~~~~
/usr/include/stdlib.h:509:29: note: suggested alternatives:
In file included from /usr/include/c++/7/bits/stl_algobase.h:59:0,
                 from /usr/include/c++/7/vector:60,
                 from foehn_phenomena.cpp:25:
/usr/include/x86_64-linux-gnu/c++/7/bits/c++config.h:231:26: note:   'std::size_t'
   typedef __SIZE_TYPE__  size_t;
                          ^~~~~~
/usr/include/x86_64-linux-gnu/c++/7/bits/c++config.h:231:26: note:   'std::size_t'
In file included from /usr/include/c++/7/cstdlib:75:0,
                 from /usr/include/c++/7/bits/stl_algo.h:59,
                 from /usr/include/c++/7/algorithm:62,
                 from foehn_phenomena.cpp:26:
/usr/include/stdlib.h:509:49: error: 'size_t' was not declared in this scope
 extern void *aligned_alloc (size_t __alignment, size_t __size)
                                                 ^~~~~~
/usr/include/stdlib.h:509:49: note: suggested alternatives:
In file included from /usr/include/c++/7/bits/stl_algobase.h:59:0,
                 from /usr/include/c++/7/vector:60,
                 from foehn_phenomena.cpp:25:
/usr/include/x86_64-linux-gnu/c++/7/bits/c++config.h:231:26: note:   'std::size_t'
   typedef __SIZE_TYPE__  size_t;
                          ^~~~~~
/usr/include/x86_64-linux-gnu/c++/7/bits/c++config.h:231:26: note:   'std::size_t'
In file included from /usr/include/c++/7/cstdlib:75:0,
                 from /usr/include/c++/7/bits/stl_algo.h:59,
                 from /usr/include/c++/7/algorithm:62,
                 from foehn_phenomena.cpp:26:
/usr/include/stdlib.h:509:62: error: expression list treated as compound expression in initializer [-fpermissive]
 extern void *aligned_alloc (size_t __alignment, size_t __size)