| # | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
|---|---|---|---|---|---|---|---|
| 1343349 | coin_ | Hedgehog Daniyar and Algorithms (IZhO19_sortbooks) | C++20 | 3095 ms | 8260 KiB |
#include <bits/stdc++.h>
#define int long long
#define endl '\n'
using namespace std;
signed main(){
ios_base::sync_with_stdio(0);
cin.tie(nullptr);
int n, q;
cin >> n >> q;
vector<int> bk(n+1);
for (int i = 1; i <= n; i++){
cin >> bk[i];
}
while(q--){
int u, v, k;
cin >> u >> v >> k;
// for each query determine whether the largest swap >= k or not
// sub 3, basically checking if subarray is sorted
int ok = 1;
for (int i = u; i <= v; i++){
for (int j = i+1; j <= v; j++){
if (bk[i] > bk[j] && bk[i] + bk[j] > k){
ok = 0;
break;
}
}
}
cout << ok << endl;
}
}| # | 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... | ||||
