제출 #1071393

#제출 시각아이디문제언어결과실행 시간메모리
1071393vjudge1Hedgehog Daniyar and Algorithms (IZhO19_sortbooks)C++17
17 / 100
3066 ms31364 KiB
#include <bits/stdc++.h> using namespace std; #define int long long #define pb push_back #define sz(x) x.size() #define nl '\n' #define F first #define S second const int N = 1e6 + 1; const int inf = 1e18; signed main() { ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0); int n, q; cin >>n >>q; int a[n + 1]; for( int i = 1; i <= n; ++i ) cin >>a[i]; while( q-- ) { int l, r, k; bool ch = false; cin >>l >>r >>k; vector< int >v; v.pb(0); for( int i = l; i <= r; ++i ) v.pb( a[i] ); int p[r - l + 2]; p[0] = 0; for( int i = 1; i < sz(v); ++i ) { p[i] = max(p[i - 1], v[i]); if( i > 0 && p[i - 1] > v[i] && p[i - 1] + v[i] > k ) ch = true; } cout <<(ch ? 0 : 1) <<nl; } }

컴파일 시 표준 에러 (stderr) 메시지

sortbooks.cpp: In function 'int main()':
sortbooks.cpp:35:27: warning: comparison of integer expressions of different signedness: 'long long int' and 'std::vector<long long int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   35 |         for( int i = 1; i < sz(v); ++i )
      |                           ^
#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...