Submission #1013826

#TimeUTC-0UsernameProblemLanguageResultExecution timeMemory
10138262024-07-04 06:39:27snpmrnhlolFoehn Phenomena (JOI17_foehn_phenomena)C++17
30 / 100
77 ms11344 KiB
#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];
 
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...