Submission #154095

# Submission time Handle Problem Language Result Execution time Memory
154095 2019-09-18T11:09:37 Z beso123 Hedgehog Daniyar and Algorithms (IZhO19_sortbooks) C++14
17 / 100
3000 ms 43128 KB
#include<bits/stdc++.h>
#define ll long long
#define x first
#define y second
using namespace std;
vector<ll>a;
int main(){
ll n,m;
scanf("%lld%lld",&n,&m);
a.resize(n+1);

for (ll i=1;i<=n;i++)
{
  scanf("%lld",&a[i]);
}
for (ll i=1;i<=m;i++)
{
    ll l,r,k;
scanf("%lld%lld%lld",&l,&r,&k);
    if (m>1000000 && n>1000000)
    {
      printf("%d\n",1);
    continue;

    }
    ll mx=a[l],ind=1;
    for (ll j=l+1;j<=r;j++)
    {
        if (mx>a[j])
        {
            if (mx+a[j]>k)

            {
                ind=0;
                   printf("%d\n",0);
            break;
            }
        }
         else
            mx=a[j];
    }
    if (ind)   printf("%d\n",1);
}

return 0;}

Compilation message

sortbooks.cpp: In function 'int main()':
sortbooks.cpp:9:6: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
 scanf("%lld%lld",&n,&m);
 ~~~~~^~~~~~~~~~~~~~~~~~
sortbooks.cpp:14:8: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
   scanf("%lld",&a[i]);
   ~~~~~^~~~~~~~~~~~~~
sortbooks.cpp:19:6: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
 scanf("%lld%lld%lld",&l,&r,&k);
 ~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~
# Verdict Execution time Memory Grader output
1 Correct 2 ms 256 KB Output is correct
2 Correct 2 ms 256 KB Output is correct
3 Correct 2 ms 256 KB Output is correct
4 Correct 2 ms 376 KB Output is correct
5 Correct 2 ms 256 KB Output is correct
6 Correct 2 ms 376 KB Output is correct
7 Correct 2 ms 376 KB Output is correct
8 Correct 2 ms 376 KB Output is correct
9 Correct 3 ms 252 KB Output is correct
10 Correct 2 ms 376 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 2 ms 256 KB Output is correct
2 Correct 2 ms 256 KB Output is correct
3 Correct 2 ms 256 KB Output is correct
4 Correct 2 ms 376 KB Output is correct
5 Correct 2 ms 256 KB Output is correct
6 Correct 2 ms 376 KB Output is correct
7 Correct 2 ms 376 KB Output is correct
8 Correct 2 ms 376 KB Output is correct
9 Correct 3 ms 252 KB Output is correct
10 Correct 2 ms 376 KB Output is correct
11 Correct 4 ms 376 KB Output is correct
12 Correct 5 ms 504 KB Output is correct
13 Correct 5 ms 504 KB Output is correct
14 Correct 7 ms 504 KB Output is correct
15 Correct 7 ms 508 KB Output is correct
16 Correct 13 ms 504 KB Output is correct
17 Correct 12 ms 504 KB Output is correct
18 Correct 11 ms 376 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 874 ms 23996 KB Output is correct
2 Correct 861 ms 43104 KB Output is correct
3 Correct 868 ms 42876 KB Output is correct
4 Correct 919 ms 43128 KB Output is correct
5 Execution timed out 3038 ms 18448 KB Time limit exceeded
# Verdict Execution time Memory Grader output
1 Correct 451 ms 1584 KB Output is correct
2 Correct 1356 ms 3428 KB Output is correct
3 Execution timed out 3009 ms 3532 KB Time limit exceeded
4 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 2 ms 256 KB Output is correct
2 Correct 2 ms 256 KB Output is correct
3 Correct 2 ms 256 KB Output is correct
4 Correct 2 ms 376 KB Output is correct
5 Correct 2 ms 256 KB Output is correct
6 Correct 2 ms 376 KB Output is correct
7 Correct 2 ms 376 KB Output is correct
8 Correct 2 ms 376 KB Output is correct
9 Correct 3 ms 252 KB Output is correct
10 Correct 2 ms 376 KB Output is correct
11 Correct 4 ms 376 KB Output is correct
12 Correct 5 ms 504 KB Output is correct
13 Correct 5 ms 504 KB Output is correct
14 Correct 7 ms 504 KB Output is correct
15 Correct 7 ms 508 KB Output is correct
16 Correct 13 ms 504 KB Output is correct
17 Correct 12 ms 504 KB Output is correct
18 Correct 11 ms 376 KB Output is correct
19 Correct 1691 ms 8848 KB Output is correct
20 Correct 1671 ms 9008 KB Output is correct
21 Execution timed out 3005 ms 6700 KB Time limit exceeded
22 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 2 ms 256 KB Output is correct
2 Correct 2 ms 256 KB Output is correct
3 Correct 2 ms 256 KB Output is correct
4 Correct 2 ms 376 KB Output is correct
5 Correct 2 ms 256 KB Output is correct
6 Correct 2 ms 376 KB Output is correct
7 Correct 2 ms 376 KB Output is correct
8 Correct 2 ms 376 KB Output is correct
9 Correct 3 ms 252 KB Output is correct
10 Correct 2 ms 376 KB Output is correct
11 Correct 4 ms 376 KB Output is correct
12 Correct 5 ms 504 KB Output is correct
13 Correct 5 ms 504 KB Output is correct
14 Correct 7 ms 504 KB Output is correct
15 Correct 7 ms 508 KB Output is correct
16 Correct 13 ms 504 KB Output is correct
17 Correct 12 ms 504 KB Output is correct
18 Correct 11 ms 376 KB Output is correct
19 Correct 874 ms 23996 KB Output is correct
20 Correct 861 ms 43104 KB Output is correct
21 Correct 868 ms 42876 KB Output is correct
22 Correct 919 ms 43128 KB Output is correct
23 Execution timed out 3038 ms 18448 KB Time limit exceeded