Borderou de evaluare (job #2602696)

Utilizator alex_benescubenescu alexandru alex_benescu Data 17 aprilie 2020 17:12:48
Problema Sir Status done
Runda Arhiva de probleme Compilator cpp-64 | Vezi sursa
Scor 100

Raport evaluator

Compilare: main.cpp:1:2: warning: #import is a deprecated GCC extension [-Wdeprecated] #import<stdio.h> ^~~~~~ main.cpp:2:151: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type] int n,k,f=1,b,i,m,q=1,o,a[100001],d[100001],h[100001],x,y,z,g,j=1,c,e,l;int Q(int e[],int c,int b,int j) {for(;c<=b&&e[c]<j;c++);return a[e[c]];}main(){freopen("sir.in","r",stdin),freopen("sir.out","w",stdout),scanf("%d%d%d%d",&n,&x,&y,&z);for(i=1;i<=n;i++) {scanf("%d",a+i);for(;f<=b&&a[i]>=a[d[b]];b--);for(;q<=o&&a[i]<=a[h[o]];o--);d[++b]=h[++o]=i;for(;(j<=i-y||(l=Q(d,f,b,j)-Q(h,q,o,j))>z)&&j<=i-x+1;j++);if(j<=i-x+1&&l<=z&&g<=i-j+1)g=i-j+1,c=j,e=i;}if(g)printf("%d %d %d",g,c,e);else printf("-1");} ^ main.cpp: In function 'int main()': main.cpp:2:240: warning: ignoring return value of 'FILE* freopen(const char*, const char*, FILE*)', declared with attribute warn_unused_result [-Wunused-result] int n,k,f=1,b,i,m,q=1,o,a[100001],d[100001],h[100001],x,y,z,g,j=1,c,e,l;int Q(int e[],int c,int b,int j) {for(;c<=b&&e[c]<j;c++);return a[e[c]];}main(){freopen("sir.in","r",stdin),freopen("sir.out","w",stdout),scanf("%d%d%d%d",&n,&x,&y,&z);for(i=1;i<=n;i++) {scanf("%d",a+i);for(;f<=b&&a[i]>=a[d[b]];b--);for(;q<=o&&a[i]<=a[h[o]];o--);d[++b]=h[++o]=i;for(;(j<=i-y||(l=Q(d,f,b,j)-Q(h,q,o,j))>z)&&j<=i-x+1;j++);if(j<=i-x+1&&l<=z&&g<=i-j+1)g=i-j+1,c=j,e=i;}if(g)printf("%d %d %d",g,c,e);else printf("-1");} ^ main.cpp:2:240: warning: ignoring return value of 'FILE* freopen(const char*, const char*, FILE*)', declared with attribute warn_unused_result [-Wunused-result] main.cpp:2:240: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result] main.cpp:2:275: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result] int n,k,f=1,b,i,m,q=1,o,a[100001],d[100001],h[100001],x,y,z,g,j=1,c,e,l;int Q(int e[],int c,int b,int j) {for(;c<=b&&e[c]<j;c++);return a[e[c]];}main(){freopen("sir.in","r",stdin),freopen("sir.out","w",stdout),scanf("%d%d%d%d",&n,&x,&y,&z);for(i=1;i<=n;i++) {scanf("%d",a+i);for(;f<=b&&a[i]>=a[d[b]];b--);for(;q<=o&&a[i]<=a[h[o]];o--);d[++b]=h[++o]=i;for(;(j<=i-y||(l=Q(d,f,b,j)-Q(h,q,o,j))>z)&&j<=i-x+1;j++);if(j<=i-x+1&&l<=z&&g<=i-j+1)g=i-j+1,c=j,e=i;}if(g)printf("%d %d %d",g,c,e);else printf("-1");} ^
Test Timp executie Memorie folosita Mesaj Punctaj/test
12ms131kbOK5
22ms131kbOK5
32ms131kbOK5
42ms131kbOK5
54ms131kbOK5
66ms131kbOK5
710ms262kbOK5
816ms262kbOK5
918ms262kbOK5
1023ms262kbOK5
1127ms393kbOK5
1230ms393kbOK5
1329ms393kbOK5
1440ms524kbOK5
1551ms524kbOK5
1642ms524kbOK5
176ms131kbOK5
1842ms524kbOK5
1944ms524kbOK5
2044ms524kbOK5
Punctaj total100

Ceva nu functioneaza?