| # | Time | Username | Problem | Language | Result | Execution time | Memory |
|---|---|---|---|---|---|---|---|
| 1287872 | quocbaoo | Hedgehog Daniyar and Algorithms (IZhO19_sortbooks) | C++20 | 68 ms | 4132 KiB |
#include<bits/stdc++.h>
#define fi first
#define se second
#define ll long long
using namespace std;
int n,m,a[1000005];
namespace sub1{
void xuly(){
while (m--){
int l,r,w;cin>>l>>r>>w;int ma=0;
for (int i=l;i<=r;i++){
for (int j=i+1;j<=r;j++){
if (a[i]>a[j]){
ma=max(ma,a[i]+a[j]);
}
}
}
if (ma>w) cout<<"0"<<'\n';
else cout<<"1"<<'\n';
}
}
}
int main(){
if (fopen("sortbooks.inp","r")){
freopen("sortbooks.inp","r",stdin);
freopen("sortbooks.out","w",stdout);
}
ios_base::sync_with_stdio(0);
cin.tie(0);cout.tie(0);
cin>>n>>m;
for (int i=1;i<=n;i++) cin>>a[i];
if (n<=500&&m<=500) return sub1::xuly(),0;
}
Compilation message (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... | ||||
