| # | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
|---|---|---|---|---|---|---|---|
| 979816 | asdasdqwer | Hedgehog Daniyar and Algorithms (IZhO19_sortbooks) | C++14 | 3083 ms | 8544 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include <bits/stdc++.h>
using namespace std;
signed main() {
int n,m;cin>>n>>m;
vector<int> a(n);
for (auto &x:a)cin>>x;
for (int i=0;i<m;i++) {
vector<int> tmp;
int l, r,k;cin>>l>>r>>k;l--;r--;
for (int j=l;j<=r;j++) {
tmp.push_back(a[j]);
}
for (int j=0;j<(int)tmp.size();j++) {
for (int o=1;o<(int)tmp.size();o++) {
if (tmp[o-1] > tmp[o] && abs(tmp[o] + tmp[o-1]) <= k) {
swap(tmp[o-1], tmp[o]);
}
}
}
vector<int> tmp2 = tmp;
sort(tmp.begin(), tmp.end());
bool pos = true;
for (int j=0;j<(int)tmp.size();j++) {
if (tmp[j] != tmp2[j]) {
pos = false;
break;
}
}
cout<<pos<<"\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... | ||||
| # | Verdict | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
| # | Verdict | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
| # | Verdict | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
