| # | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
|---|---|---|---|---|---|---|---|
| 1356697 | Johan | Hedgehog Daniyar and Algorithms (IZhO19_sortbooks) | C++20 | 3094 ms | 23952 KiB |
#include <bits/stdc++.h>
using namespace std;
#define int long long
const int N = 1e6 + 5;
const int INF = 1e18;
int l, r, k;
bool cmp(pair < int , int > a, pair < int , int > b){
}
signed main(){
ios_base::sync_with_stdio(0);
cin.tie(0);
cout.tie(0);
int n, q;
cin >> n >> q;
vector < int > a(n);
for(int &i : a)cin >> i;
while(q--){
cin >> l >> r >> k;
l--, r--;
vector < int > v;
for(int i = l; i <= r; i++)
v.push_back(a[i]);
for(int i = 1; i < v.size(); i++){
int j = i;
while(j > 0 && v[j] < v[j - 1] && v[j] + v[j - 1] <= k){
swap(v[j], v[j - 1]);
j--;
}
}
if(is_sorted(v.begin(), v.end()) == true){
cout << 1 << endl;
}
else {
cout << 0 << endl;
}
}
}컴파일 시 표준 에러 (stderr) 메시지
| # | 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... | ||||
