# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
1013826 | snpmrnhlol | Foehn Phenomena (JOI17_foehn_phenomena) | C++17 | 77 ms | 11344 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;
typedef long long ll;
const int N = 2e5;
int v[N + 1];
ll dif[N + 1];
int n,q,s,t;
ll ans = 0;
void modify(int i, int x){
if(i > n || i <= 0)return;
if(dif[i] > 0){
ans+=1ll*s*abs(dif[i]);
}else{
ans-=1ll*t*abs(dif[i]);
}
dif[i] = x;
if(dif[i] > 0){
ans-=1ll*s*abs(dif[i]);
}else{
ans+=1ll*t*abs(dif[i]);
}
}
int main(){
ios_base::sync_with_stdio(0);
cin.tie(0);
cin>>n>>q>>s>>t;
for(int i = 0;i <= n;i++){
cin>>v[i];
if(i){
dif[i] = v[i] - v[i - 1];
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |