Submission #1007960

# Submission time Handle Problem Language Result Execution time Memory
1007960 2024-06-26T03:30:13 Z Rolo678 Triple Jump (JOI19_jumps) C++14
0 / 100
4000 ms 15880 KB
#include<bits/stdc++.h>
using namespace std;

int main()
{
    int n;
    cin >> n;
    vector<long long>a(n+1);
    for(int i = 1;i<=n;i++)
    {
        cin >> a[i];
    }
    vector<vector<pair<long long,long long>>>p(n+1);
      for(int i = 1;i<=n;i++)
    {
              long long mx = 0;
             for(int j = i+1;j<=n;j++)
            {
                 if(a[j] >= mx )
                 {
                     p[i].push_back({a[j],j});
                 }
                 mx = max(a[j],mx);
           }

    }

    int q;
    cin >> q;
    while(q--)
    {
        int l,r;
        cin >> l >> r;
        long long ans = 0;
        int a1,b,c;
        for(int i = l;i<=r-2;i++)
        {
            for(auto j :p[i])
            {
                if(j.second > r-1)
                {
                    continue;
                }

                for(int k = 2*(j.second) - i;k <= r;k++)
                {
                    if(k<1 || !(k -j.second >= j.second - i )|| k <=j.second || k<=i)
                    {
                        continue;
                    }

                }
            }
        }

        cout << ans  <<'\n';

    }
}

Compilation message

jumps.cpp: In function 'int main()':
jumps.cpp:35:13: warning: unused variable 'a1' [-Wunused-variable]
   35 |         int a1,b,c;
      |             ^~
jumps.cpp:35:16: warning: unused variable 'b' [-Wunused-variable]
   35 |         int a1,b,c;
      |                ^
jumps.cpp:35:18: warning: unused variable 'c' [-Wunused-variable]
   35 |         int a1,b,c;
      |                  ^
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 348 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 348 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Execution timed out 4008 ms 15880 KB Time limit exceeded
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 348 KB Output isn't correct
2 Halted 0 ms 0 KB -