제출 #343273

#제출 시각아이디문제언어결과실행 시간메모리
343273fixikmilaHedgehog Daniyar and Algorithms (IZhO19_sortbooks)C++14
0 / 100
3071 ms25176 KiB
#include <bits/stdc++.h> using namespace std; #define MOD 1000000007 typedef long long ll; typedef pair<ll,ll>pll; typedef long double ld; ll bin_pow(ll a,ll b){ if(b==0)return 1; if(b%2==0){ ll t=bin_pow(a,b/2); return t*t%MOD; } else return a*bin_pow(a,b-1)%MOD; } struct cat{ll a,b;}; cat tree[20001]; ll a[1000000]; int main() { //freopen("stones.in","r",stdin); //freopen("stones.out","w",stdout); ios::sync_with_stdio(false); cin.tie(0); ll t=1,n,m,k=0,sum=0,l=0,r=0,x=0,y=0,z=0,ans=0,mn=LLONG_MAX,mx=LLONG_MIN; cin>>n>>m; for(int i=0;i<n;i++)cin>>a[i],mx=max(mx,a[i]); //build_tree(1,0,n-1); for(int i=0;i<m;i++){ cin>>l>>r>>k; l--,r--; z=1; ll mx1=-1,v; vector<ll>b; for(int j=l;j<=r;j++)b.push_back(a[j]); sort(b.begin(),b.end()); for(int j=ll(b.size())-1;j>=0;j--){ //cout<<a[l+j]<<"gggg"; if(b[j]>a[l+j]){ mx1=max(mx1,b[j]+a[l+j]); } } //cout<<mx1<<"uu"<<endl; if(mx1<=k)z=1; else z=0; cout<<z; cout<<"\n"; } return 0; }

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

sortbooks.cpp: In function 'int main()':
sortbooks.cpp:32:27: warning: unused variable 'v' [-Wunused-variable]
   32 |                 ll mx1=-1,v;
      |                           ^
sortbooks.cpp:24:8: warning: unused variable 't' [-Wunused-variable]
   24 |     ll t=1,n,m,k=0,sum=0,l=0,r=0,x=0,y=0,z=0,ans=0,mn=LLONG_MAX,mx=LLONG_MIN;
      |        ^
sortbooks.cpp:24:20: warning: unused variable 'sum' [-Wunused-variable]
   24 |     ll t=1,n,m,k=0,sum=0,l=0,r=0,x=0,y=0,z=0,ans=0,mn=LLONG_MAX,mx=LLONG_MIN;
      |                    ^~~
sortbooks.cpp:24:34: warning: unused variable 'x' [-Wunused-variable]
   24 |     ll t=1,n,m,k=0,sum=0,l=0,r=0,x=0,y=0,z=0,ans=0,mn=LLONG_MAX,mx=LLONG_MIN;
      |                                  ^
sortbooks.cpp:24:38: warning: unused variable 'y' [-Wunused-variable]
   24 |     ll t=1,n,m,k=0,sum=0,l=0,r=0,x=0,y=0,z=0,ans=0,mn=LLONG_MAX,mx=LLONG_MIN;
      |                                      ^
sortbooks.cpp:24:46: warning: unused variable 'ans' [-Wunused-variable]
   24 |     ll t=1,n,m,k=0,sum=0,l=0,r=0,x=0,y=0,z=0,ans=0,mn=LLONG_MAX,mx=LLONG_MIN;
      |                                              ^~~
sortbooks.cpp:24:52: warning: unused variable 'mn' [-Wunused-variable]
   24 |     ll t=1,n,m,k=0,sum=0,l=0,r=0,x=0,y=0,z=0,ans=0,mn=LLONG_MAX,mx=LLONG_MIN;
      |                                                    ^~
#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...