Submission #570354

# Submission time Handle Problem Language Result Execution time Memory
570354 2022-05-29T09:56:38 Z urd05 Triple Jump (JOI19_jumps) C++17
5 / 100
4 ms 444 KB
#include <bits/stdc++.h>
using namespace std;

int arr[101];

int main() {
    int n,q;
    scanf("%d",&n);
    for(int i=1;i<=n;i++) {
        scanf("%d",&arr[i]);
    }
    scanf("%d",&q);
    for(int i=0;i<q;i++) {
        int l,r;
        scanf("%d %d",&l,&r);
        int ret=0;
        for(int i=l;i<=r;i++) {
            for(int j=i+1;j<=r;j++) {
                for(int k=j+1;k<=r;k++) {
                    if (j-i<=k-j) {
                        ret=max(ret,arr[i]+arr[j]+arr[k]);
                    }
                }
            }
        }
        printf("%d\n",ret);
    }
    return 0;
}

Compilation message

jumps.cpp: In function 'int main()':
jumps.cpp:8:10: warning: ignoring return value of 'int scanf(const char*, ...)' declared with attribute 'warn_unused_result' [-Wunused-result]
    8 |     scanf("%d",&n);
      |     ~~~~~^~~~~~~~~
jumps.cpp:10:14: warning: ignoring return value of 'int scanf(const char*, ...)' declared with attribute 'warn_unused_result' [-Wunused-result]
   10 |         scanf("%d",&arr[i]);
      |         ~~~~~^~~~~~~~~~~~~~
jumps.cpp:12:10: warning: ignoring return value of 'int scanf(const char*, ...)' declared with attribute 'warn_unused_result' [-Wunused-result]
   12 |     scanf("%d",&q);
      |     ~~~~~^~~~~~~~~
jumps.cpp:15:14: warning: ignoring return value of 'int scanf(const char*, ...)' declared with attribute 'warn_unused_result' [-Wunused-result]
   15 |         scanf("%d %d",&l,&r);
      |         ~~~~~^~~~~~~~~~~~~~~
# Verdict Execution time Memory Grader output
1 Correct 1 ms 212 KB Output is correct
2 Correct 3 ms 212 KB Output is correct
3 Correct 3 ms 300 KB Output is correct
4 Correct 3 ms 212 KB Output is correct
5 Correct 3 ms 212 KB Output is correct
6 Correct 3 ms 212 KB Output is correct
7 Correct 3 ms 212 KB Output is correct
8 Correct 3 ms 212 KB Output is correct
9 Correct 4 ms 212 KB Output is correct
10 Correct 2 ms 212 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 1 ms 212 KB Output is correct
2 Correct 3 ms 212 KB Output is correct
3 Correct 3 ms 300 KB Output is correct
4 Correct 3 ms 212 KB Output is correct
5 Correct 3 ms 212 KB Output is correct
6 Correct 3 ms 212 KB Output is correct
7 Correct 3 ms 212 KB Output is correct
8 Correct 3 ms 212 KB Output is correct
9 Correct 4 ms 212 KB Output is correct
10 Correct 2 ms 212 KB Output is correct
11 Runtime error 2 ms 412 KB Execution killed with signal 11
12 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Runtime error 1 ms 444 KB Execution killed with signal 11
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 1 ms 212 KB Output is correct
2 Correct 3 ms 212 KB Output is correct
3 Correct 3 ms 300 KB Output is correct
4 Correct 3 ms 212 KB Output is correct
5 Correct 3 ms 212 KB Output is correct
6 Correct 3 ms 212 KB Output is correct
7 Correct 3 ms 212 KB Output is correct
8 Correct 3 ms 212 KB Output is correct
9 Correct 4 ms 212 KB Output is correct
10 Correct 2 ms 212 KB Output is correct
11 Runtime error 2 ms 412 KB Execution killed with signal 11
12 Halted 0 ms 0 KB -