Submission #955530

# Submission time Handle Problem Language Result Execution time Memory
955530 2024-03-30T20:47:07 Z Kakarot Foehn Phenomena (JOI17_foehn_phenomena) C++
Compilation error
0 ms 0 KB
#include <bits/stdc++.h>#define int int64_tusing namespace std;void setIO() {  cin.tie(0)->sync_with_stdio(0);}void solve() {  int n, q, s, t;  cin >> n >> q >> s >> t;  vector<int> a(n+2), temp(n+1);  for(int i = 0; i <= n; i++) cin >> a[i];  while(q--) {    int l, r, x;    cin >> l >> r >> x;    a[l] += x, a[r+1] -= x;  }  for(int i = 1; i <= n; i++) a[i] += a[i-1];  for(int i = 1; i <= n; i++) temp[i] = temp[i-1] + (a[i] <= a[i-1] ? (a[i-1]-a[i])*t : (a[i]-a[i-1])*s);  cout << temp[n];}int32_t main() {  setIO();  solve();  return 0;}

Compilation message

foehn_phenomena.cpp:1:25: warning: extra tokens at end of #include directive
    1 | #include <bits/stdc++.h>#define int int64_tusing namespace std;void setIO() {  cin.tie(0)->sync_with_stdio(0);}void solve() {  int n, q, s, t;  cin >> n >> q >> s >> t;  vector<int> a(n+2), temp(n+1);  for(int i = 0; i <= n; i++) cin >> a[i];  while(q--) {    int l, r, x;    cin >> l >> r >> x;    a[l] += x, a[r+1] -= x;  }  for(int i = 1; i <= n; i++) a[i] += a[i-1];  for(int i = 1; i <= n; i++) temp[i] = temp[i-1] + (a[i] <= a[i-1] ? (a[i-1]-a[i])*t : (a[i]-a[i-1])*s);  cout << temp[n];}int32_t main() {  setIO();  solve();  return 0;}
      |                         ^
/usr/bin/ld: /usr/lib/gcc/x86_64-linux-gnu/10/../../../x86_64-linux-gnu/crt1.o: in function `_start':
(.text+0x24): undefined reference to `main'
collect2: error: ld returned 1 exit status