Submission #524334

# Submission time Handle Problem Language Result Execution time Memory
524334 2022-02-09T04:25:39 Z AzamatRustamov Hedgehog Daniyar and Algorithms (IZhO19_sortbooks) C++14
8 / 100
3000 ms 6228 KB
#include <stdio.h>
using namespace std;

int main()
{
    int n, m;
    scanf("%d %d", &n, &m);

    int w[n+1];
    w[0] = 0;

    for (int i=1; i<=n; i++) scanf("%d", &w[i]);
    for (int i=0; i<m; i++)
    {
        int l, r, k;
        scanf("%d %d %d", &l, &r, &k);

        bool can = 1;
        for (int i = l; can && i < r; i++)
            for (int j = i+1; can && j <= r; j++)
                if (w[i]>w[j] && w[i]+w[j]>k)
                    can = 0;

        printf("%d\n", can);
    }

    return 0;
}

Compilation message

sortbooks.cpp: In function 'int main()':
sortbooks.cpp:7:10: warning: ignoring return value of 'int scanf(const char*, ...)' declared with attribute 'warn_unused_result' [-Wunused-result]
    7 |     scanf("%d %d", &n, &m);
      |     ~~~~~^~~~~~~~~~~~~~~~~
sortbooks.cpp:12:35: warning: ignoring return value of 'int scanf(const char*, ...)' declared with attribute 'warn_unused_result' [-Wunused-result]
   12 |     for (int i=1; i<=n; i++) scanf("%d", &w[i]);
      |                              ~~~~~^~~~~~~~~~~~~
sortbooks.cpp:16:14: warning: ignoring return value of 'int scanf(const char*, ...)' declared with attribute 'warn_unused_result' [-Wunused-result]
   16 |         scanf("%d %d %d", &l, &r, &k);
      |         ~~~~~^~~~~~~~~~~~~~~~~~~~~~~~
# Verdict Execution time Memory Grader output
1 Correct 0 ms 204 KB Output is correct
2 Correct 0 ms 244 KB Output is correct
3 Correct 1 ms 204 KB Output is correct
4 Correct 1 ms 204 KB Output is correct
5 Correct 1 ms 204 KB Output is correct
6 Correct 2 ms 204 KB Output is correct
7 Correct 3 ms 276 KB Output is correct
8 Correct 32 ms 276 KB Output is correct
9 Correct 12 ms 280 KB Output is correct
10 Correct 7 ms 204 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 0 ms 204 KB Output is correct
2 Correct 0 ms 244 KB Output is correct
3 Correct 1 ms 204 KB Output is correct
4 Correct 1 ms 204 KB Output is correct
5 Correct 1 ms 204 KB Output is correct
6 Correct 2 ms 204 KB Output is correct
7 Correct 3 ms 276 KB Output is correct
8 Correct 32 ms 276 KB Output is correct
9 Correct 12 ms 280 KB Output is correct
10 Correct 7 ms 204 KB Output is correct
11 Correct 29 ms 204 KB Output is correct
12 Correct 197 ms 276 KB Output is correct
13 Correct 109 ms 268 KB Output is correct
14 Correct 272 ms 276 KB Output is correct
15 Correct 154 ms 276 KB Output is correct
16 Execution timed out 3058 ms 224 KB Time limit exceeded
17 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 547 ms 6080 KB Output is correct
2 Correct 524 ms 6068 KB Output is correct
3 Correct 538 ms 6104 KB Output is correct
4 Correct 606 ms 6228 KB Output is correct
5 Execution timed out 3081 ms 4168 KB Time limit exceeded
6 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Execution timed out 3082 ms 588 KB Time limit exceeded
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 0 ms 204 KB Output is correct
2 Correct 0 ms 244 KB Output is correct
3 Correct 1 ms 204 KB Output is correct
4 Correct 1 ms 204 KB Output is correct
5 Correct 1 ms 204 KB Output is correct
6 Correct 2 ms 204 KB Output is correct
7 Correct 3 ms 276 KB Output is correct
8 Correct 32 ms 276 KB Output is correct
9 Correct 12 ms 280 KB Output is correct
10 Correct 7 ms 204 KB Output is correct
11 Correct 29 ms 204 KB Output is correct
12 Correct 197 ms 276 KB Output is correct
13 Correct 109 ms 268 KB Output is correct
14 Correct 272 ms 276 KB Output is correct
15 Correct 154 ms 276 KB Output is correct
16 Execution timed out 3058 ms 224 KB Time limit exceeded
17 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 0 ms 204 KB Output is correct
2 Correct 0 ms 244 KB Output is correct
3 Correct 1 ms 204 KB Output is correct
4 Correct 1 ms 204 KB Output is correct
5 Correct 1 ms 204 KB Output is correct
6 Correct 2 ms 204 KB Output is correct
7 Correct 3 ms 276 KB Output is correct
8 Correct 32 ms 276 KB Output is correct
9 Correct 12 ms 280 KB Output is correct
10 Correct 7 ms 204 KB Output is correct
11 Correct 29 ms 204 KB Output is correct
12 Correct 197 ms 276 KB Output is correct
13 Correct 109 ms 268 KB Output is correct
14 Correct 272 ms 276 KB Output is correct
15 Correct 154 ms 276 KB Output is correct
16 Execution timed out 3058 ms 224 KB Time limit exceeded
17 Halted 0 ms 0 KB -