제출 #129316

#제출 시각아이디문제언어결과실행 시간메모리
129316lamkhanhFoehn Phenomena (JOI17_foehn_phenomena)C++17
컴파일 에러
0 ms0 KiB
#include<bits/stdc++.h> #pragma GCC optimize ("O3"); using namespace std; const int MaxN = 200002; long long a[MaxN], kc[MaxN]; long long type[MaxN]; long long n, q, s, t, l, r, x, i; long long ans; int main(){ cin >> n >> q >> s >> t; for(i=0;i<=n;i++) cin >> a[i]; for(i=0;i<=n-1;i++){ kc[i] = a[i]-a[i+1]; if(kc[i]>=0) type[i] = 0; else type[i] = 1; ans += ((!type[i]) ? t : s)*kc[i]; } for(i=0;i<q;i++){ cin >> l >> r >> x; kc[l-1] -= x; if(kc[l-1]>=0&&type[l-1]){ type[l-1] = 0; ans = ans + kc[l-1]*t - (kc[l-1]+x)*s; } else if(kc[l-1]<0&&!type[l-1]){ type[l-1] = 1; ans = ans + kc[l-1]*s - (kc[l-1]+x)*t; } else if(kc[l-1]>=0&&!type[l-1]) ans -= x*t; else ans -= x*s; if(r<n){ kc[r] += x; if(kc[r]>=0&&type[r]){ type[r] = 0; ans = ans + kc[r]*t - (kc[r]-x)*s; } else if(kc[r]<0&&!type[r]){ type[r] = 1; ans = ans + kc[r]*s - (kc[r]-x)*t; } else if(kc[r]>=0&&!type[r]) ans += x*t; else ans += x*s; } cout << ans << "\n"; } }

컴파일 시 표준 에러 (stderr) 메시지

foehn_phenomena.cpp:2:28: error: #pragma GCC optimize string... is badly formed
 #pragma GCC optimize ("O3");
                            ^