Submission #955530

#TimeUsernameProblemLanguageResultExecution timeMemory
955530KakarotFoehn Phenomena (JOI17_foehn_phenomena)C++98
Compilation error
0 ms0 KiB
#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 (stderr)

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