# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
754061 | vjudge1 | Foehn Phenomena (JOI17_foehn_phenomena) | C++17 | 1071 ms | 3520 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include <bits/stdc++.h>
#define ll long long;
using namespace std;
int main(){
long long n,q,s,t,hasil;
cin>>n>>q>>s>>t;
long long a[n], b[n];
long long l,r,x,naik,turun;
for(int i=0; i<=n; i++){
cin>>a[i];
b[i]=a[i];
}
for(int z=0; z<q; z++){
cin>>l>>r>>x;
for(int c=l; c<=r; c++){
a[c] += x;
}
hasil = 0;
naik = 0;
turun = 0;
for(int y=0; y<n; y++){
if(a[y]>a[y+1]){
turun += a[y]-a[y+1];
}
if(a[y]<a[y+1]){
naik += a[y+1]-a[y];
}
}
naik = naik * s;
turun = turun * t;
hasil = turun-naik;
cout<<hasil<<endl;
}
return 0;
}
컴파일 시 표준 에러 (stderr) 메시지
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |