제출 #1171695

#제출 시각아이디문제언어결과실행 시간메모리
1171695ibrahim001Hedgehog Daniyar and Algorithms (IZhO19_sortbooks)C++20
8 / 100
3094 ms1860 KiB
#include "bits/stdc++.h"
#include <chrono>
#include <thread>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace __gnu_pbds;
#define ordered_set tree<pair<ld, int>, null_type,less<pair<ld, int>>, rb_tree_tag,tree_order_statistics_node_update>
#define intt long long
#define int intt
#define pb push_back
#define endl '\n'
#define F first
#define S second
#define pii pair<int,int>
#define pll pair<intt,intt>
#define ld long double
#define fastio ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
#define all(x) x.begin(), x.end()
using namespace std;
// mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());
const int sz = 2e5+5;
const int sz1 = 2005;
const int mod = 998244353;
const int inf = 2e9+7;
const intt infl = 1e18;
const ld eps = 1e-9;
int a[sz];
int i,j;
void solve(){
    int n, m;
    cin >> n >> m;
    for ( i = 1; i <= n; i++ )  cin >> a[i];
    while ( m-- ){
        int l, r, k;
        cin >> l >> r >> k;
        bool flag=true;
        for ( i = l; i <= r; i++ ){
            for ( j = i+1; j <= r; j++ ){
                if ( a[i] > a[j] and a[i]+a[j] > k )    flag=false;
            }
        }
        cout << flag << endl;
    }
}
signed main(){
    fastio;
    int t = 1;
    // cin >> t;
    for ( int cs = 1; cs <= t; cs++ ) {
        // cout << "Case " << cs << ": ";
        solve();
    }
    // while ( cin >> n and n ){
    //     cin >> m;
    //     solve();
    // }
}
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...