| # | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
|---|---|---|---|---|---|---|---|
| 751102 | vjudge1 | Foehn Phenomena (JOI17_foehn_phenomena) | C++17 | 1068 ms | 1080 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include <bits/stdc++.h>
using namespace std;
int main(){
ios_base::sync_with_stdio(0);
cin.tie(0);
int n,q,s,t; cin>>n>>q>>s>>t;
int suhu[n+1] = {};
for(int i = 0; i < n+1; i++){
cin>>suhu[i];
}
while(q--){
int l = 0, r = 0, x = 0;
int total = 0;
cin>>l>>r>>x;
for(int i = 0; i < n+1; i++){
if(i >= l && i <= r){
suhu[i] += x;
}
}
for(int i = 0; i < n; i++){
if(suhu[i+1] > suhu[i]){
total -= abs(suhu[i+1] - suhu[i]) * s;
}
else if(suhu[i+1] < suhu[i]){
total += abs(suhu[i+1] - suhu[i]) * t;
}
}
cout<<total<<"\n";
}
//
}| # | Verdict | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
| # | Verdict | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
| # | Verdict | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
