답안 #928250

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
928250 2024-02-16T06:11:38 Z vjudge1 Hedgehog Daniyar and Algorithms (IZhO19_sortbooks) C++17
0 / 100
375 ms 25560 KB
// Problem: A - Hedgehog Daniyar and Algorithms
// Contest: Virtual Judge - IOI contest #3 (div 1 + 2)
// URL: https://vjudge.net/contest/610287#problem/A
// Memory Limit: 256 MB
// Time Limit: 3000 ms
// 
// Powered by CP Editor (https://cpeditor.org)

#include <bits/stdc++.h>
#define noSuccess t--
#define int long long
#define pb push_back 
#define pf push_front
#define F first	
#define S second
#define highspeed ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
#define all(s) s.begin(),s.end()
#define sr(a) sort(a+1,a+1+n);reverse(a+1,a+1+n)
#define s(a) sort(a+1,a+1+n)
#define in insert
#define upb upper_bound
#define issrt is_sorted(a+1,a+1+n)
#define yes "YES\n"
#define no "NO\n"
#define sz size
#define pii pair<int,int>
#define INT(n) int n
 
 
using namespace std;
const int maxn = 1e6 + 5;
int pr[maxn];
void tryAgain(){
  int n,m;
  INT(A);
  cin>>n>>m;
  int a[n+5];
  int b[n+5];
  cin>>a[1];
  for(int i=2;i<=n;i++){
    cin>>a[i];
    if(a[i]>=a[i-1]) continue;
    else pr[i]++;
  }
  while(m--){
    int l,r,v;
    cin>>l>>r>>v;
    bool ok=true;
    if(pr[r]-pr[l-1]>0) ok=false;
    cout<<ok<<'\n';
  }
}
signed main(){
  // freopen("something", "r", stdin);
  // freopen("something", "w", stdout);
	highspeed	
	int t = 1;
  //cin >> t;	
	while(noSuccess){
		tryAgain();
	}
}

Compilation message

sortbooks.cpp: In function 'void tryAgain()':
sortbooks.cpp:35:7: warning: unused variable 'A' [-Wunused-variable]
   35 |   INT(A);
      |       ^
sortbooks.cpp:27:20: note: in definition of macro 'INT'
   27 | #define INT(n) int n
      |                    ^
sortbooks.cpp:38:7: warning: unused variable 'b' [-Wunused-variable]
   38 |   int b[n+5];
      |       ^
# 결과 실행 시간 메모리 Grader output
1 Incorrect 1 ms 348 KB Output isn't correct
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 1 ms 348 KB Output isn't correct
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 375 ms 25560 KB Output isn't correct
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 30 ms 3732 KB Output isn't correct
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 1 ms 348 KB Output isn't correct
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 1 ms 348 KB Output isn't correct
2 Halted 0 ms 0 KB -