# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
646003 | JJAnawat | Foehn Phenomena (JOI17_foehn_phenomena) | C++14 | 115 ms | 14664 KiB |
This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#include<bits/stdc++.h>
using namespace std;
long long n,q,s,t;
long long ar[200005],dif[200005],fw[200005];
void upd(long long x,long long val){
for(;x<=200000;x+=x&-x)
fw[x]+=val;
}
long long qr(long long x){
long long sum=0;
for(;x>=1;x-=x&-x)
sum+=fw[x];
return sum;
}
int main(){
ios_base::sync_with_stdio(false);
cin.tie(NULL);
cin >> n >> q >> s >> t >> ar[0];
for(long long i=1;i<=n;i++){
cin >> ar[i];
dif[i]=ar[i]-ar[i-1];
if(dif[i]>0){
upd(i,-dif[i]*s);
}
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |