| # | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
|---|---|---|---|---|---|---|---|
| 493168 | erkm | Hedgehog Daniyar and Algorithms (IZhO19_sortbooks) | C++11 | 3085 ms | 6964 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include<bits/stdc++.h>
#define loop(n) for(int i=0; i<n; i++)
#define ll long long
#define ld long double
#define ull unsigned long long
#define ff first
#define ss second
#define p_b push_back
#define l_b lower_bound
#define u_b upper_bound
#define m_p make_pair
#define m_t make_tuple
#define ar array
using namespace std;
const int M=1e9, mxN=1e5;
int main(){
ios_base::sync_with_stdio(0);
cin.tie(NULL);
//cout.tie(NULL);
int n, m;
cin>>n>>m;
int w[n];
for(int i=0; i<n; i++){
cin>>w[i];
}
while(m--){
int l, r, k;
cin>>l>>r>>k;
l--; r--;
int ans=0;
for(int i=l; i<=r; i++){
for(int j=i+1; j<=r; j++){
if(w[i]>w[j]){
ans=max(ans, w[i]+w[j]);
}
}
}
// cout<<ans<<endl;
ans>k? cout<<0: cout<<1;
cout<<'\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... | ||||
