Language: C++

#import<map>
#define r(a)for(int i=0;i<a;i++)
#define s (std::cin>>w,w)
#define c(a,b)a=a<b?a:b
int w,n,m,d[999],p[999];main(){n=s;m=s;r(n)d[i]=s;r(n)p[i]=1e9;r(m){s;r(n)c(p[i],p[i+1]+w*d[n-i-1]);}cout<<*p<<endl;}

Compiler output:
a.cc:1:2: warning: #import is a deprecated GCC extension [-Wdeprecated]
    1 | #import<map>
      |  ^~~~~~
a.cc:5:25: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type]
    5 | int w,n,m,d[999],p[999];main(){n=s;m=s;r(n)d[i]=s;r(n)p[i]=1e9;r(m){s;r(n)c(p[i],p[i+1]+w*d[n-i-1]);}cout<<*p<<endl;}
      |                         ^~~~
a.cc: In function 'int main()':
a.cc:3:17: error: 'cin' is not a member of 'std'
    3 | #define s (std::cin>>w,w)
      |                 ^~~
a.cc:5:34: note: in expansion of macro 's'
    5 | int w,n,m,d[999],p[999];main(){n=s;m=s;r(n)d[i]=s;r(n)p[i]=1e9;r(m){s;r(n)c(p[i],p[i+1]+w*d[n-i-1]);}cout<<*p<<endl;}
      |                                  ^
a.cc:2:1: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
    1 | #import<map>
  +++ |+#include <iostream>
    2 | #define r(a)for(int i=0;i<a;i++)
a.cc:3:17: error: 'cin' is not a member of 'std'
    3 | #define s (std::cin>>w,w)
      |                 ^~~
a.cc:5:38: note: in expansion of macro 's'
    5 | int w,n,m,d[999],p[999];main(){n=s;m=s;r(n)d[i]=s;r(n)p[i]=1e9;r(m){s;r(n)c(p[i],p[i+1]+w*d[n-i-1]);}cout<<*p<<endl;}
      |                                      ^
a.cc:3:17: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
    3 | #define s (std::cin>>w,w)
      |                 ^~~
a.cc:5:38: note: in expansion of macro 's'
    5 | int w,n,m,d[999],p[999];main(){n=s;m=s;r(n)d[i]=s;r(n)p[i]=1e9;r(m){s;r(n)c(p[i],p[i+1]+w*d[n-i-1]);}cout<<*p<<endl;}
      |                                      ^
a.cc:3:17: error: 'cin' is not a member of 'std'
    3 | #define s (std::cin>>w,w)
      |                 ^~~
a.cc:5:49: note: in expansion of macro 's'
    5 | int w,n,m,d[999],p[999];main(){n=s;m=s;r(n)d[i]=s;r(n)p[i]=1e9;r(m){s;r(n)c(p[i],p[i+1]+w*d[n-i-1]);}cout<<*p<<endl;}
      |                                                 ^
a.cc:3:17: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
    3 | #define s (std::cin>>w,w)
      |                 ^~~
a.cc:5:49: note: in expansion of macro 's'
    5 | int w,n,m,d[999],p[999];main(){n=s;m=s;r(n)d[i]=s;r(n)p[i]=1e9;r(m){s;r(n)c(p[i],p[i+1]+w*d[n-i-1]);}cout<<*p<<endl;}
      |                                                 ^
a.cc:3:17: error: 'cin' is not a member of 'std'
    3 | #define s (std::cin>>w,w)
      |                 ^~~
a.cc:5:69: note: in expansion of macro 's'
    5 | int w,n,m,d[999],p[999];main(){n=s;m=s;r(n)d[i]=s;r(n)p[i]=1e9;r(m){s;r(n)c(p[i],p[i+1]+w*d[n-i-1]);}cout<<*p<<endl;}
      |                                                                     ^
a.cc:3:17: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
    3 | #define s (std::cin>>w,w)
      |                 ^~~
a.cc:5:69: note: in expansion of macro 's'
    5 | int w,n,m,d[999],p[999];main(){n=s;m=s;r(n)d[i]=s;r(n)p[i]=1e9;r(m){s;r(n)c(p[i],p[i+1]+w*d[n-i-1]);}cout<<*p<<endl;}
      |                                                                     ^
a.cc:5:102: error: 'cout' was not declared in this scope
    5 | int w,n,m,d[999],p[999];main(){n=s;m=s;r(n)d[i]=s;r(n)p[i]=1e9;r(m){s;r(n)c(p[i],p[i+1]+w*d[n-i-1]);}cout<<*p<<endl;}
      |                                                                                                      ^~~~
a.cc:5:112: error: 'endl' was not declared in this scope
    5 | int w,n,m,d[999],p[999];main(){n=s;m=s;r(n)d[i]=s;r(n)p[i]=1e9;r(m){s;r(n)c(p[i],p[i+1]+w*d[n-i-1]);}cout<<*p<<endl;}
      |                                                                                                                ^~~~