Submission #1015129

# Submission time Handle Problem Language Result Execution time Memory
1015129 2024-07-06T06:31:14 Z vjudge1 Gap (APIO16_gap) C++17
0 / 100
20 ms 1968 KB
#include<bits/stdc++.h>
#include "gap.h"

using namespace std;

typedef long long ll;

ll subtask1(int N)
{
  int i = 0, j = N - 1;
  ll s = 0, e = 1e18;
  ll *mn, *mx;

  vector<ll> v(N);
  
  while(i <= j)
    {
      MinMax(s, e, mn, mx);
      v[i] = *mn;
      v[j] = *mx;
      i++, j--;
      s = *mn + 1;
      e = *mx - 1;
    }

  ll ans = 0;
  for(int i = 1; i < v.size(); i++)
    ans = max(ans, v[i] - v[i - 1]);
  return ans;
}

ll findGap(int T, int N)
{
  if(T == 1)
    return subtask1(N);
  return 1ll * N;
}

Compilation message

gap.cpp: In function 'll subtask1(int)':
gap.cpp:27:20: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<long long int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   27 |   for(int i = 1; i < v.size(); i++)
      |                  ~~^~~~~~~~~~
gap.cpp:18:13: warning: 'mn' may be used uninitialized in this function [-Wmaybe-uninitialized]
   18 |       MinMax(s, e, mn, mx);
      |       ~~~~~~^~~~~~~~~~~~~~
gap.cpp:18:13: warning: 'mx' may be used uninitialized in this function [-Wmaybe-uninitialized]
# Verdict Execution time Memory Grader output
1 Runtime error 1 ms 340 KB Execution failed because the return code was nonzero
2 Runtime error 0 ms 344 KB Execution failed because the return code was nonzero
3 Runtime error 0 ms 344 KB Execution failed because the return code was nonzero
4 Runtime error 0 ms 344 KB Execution failed because the return code was nonzero
5 Runtime error 0 ms 344 KB Execution failed because the return code was nonzero
6 Runtime error 0 ms 344 KB Execution failed because the return code was nonzero
7 Runtime error 0 ms 344 KB Execution failed because the return code was nonzero
8 Runtime error 0 ms 344 KB Execution failed because the return code was nonzero
9 Runtime error 1 ms 344 KB Execution failed because the return code was nonzero
10 Runtime error 0 ms 344 KB Execution failed because the return code was nonzero
11 Runtime error 0 ms 344 KB Execution failed because the return code was nonzero
12 Runtime error 0 ms 344 KB Execution failed because the return code was nonzero
13 Runtime error 0 ms 344 KB Execution failed because the return code was nonzero
14 Runtime error 0 ms 344 KB Execution failed because the return code was nonzero
15 Runtime error 1 ms 456 KB Execution failed because the return code was nonzero
16 Runtime error 3 ms 724 KB Execution failed because the return code was nonzero
17 Runtime error 3 ms 856 KB Execution failed because the return code was nonzero
18 Runtime error 3 ms 692 KB Execution failed because the return code was nonzero
19 Runtime error 4 ms 856 KB Execution failed because the return code was nonzero
20 Runtime error 2 ms 856 KB Execution failed because the return code was nonzero
21 Runtime error 17 ms 1872 KB Execution failed because the return code was nonzero
22 Runtime error 12 ms 1880 KB Execution failed because the return code was nonzero
23 Runtime error 10 ms 1956 KB Execution failed because the return code was nonzero
24 Runtime error 13 ms 1968 KB Execution failed because the return code was nonzero
25 Runtime error 17 ms 1880 KB Execution failed because the return code was nonzero
26 Runtime error 11 ms 1880 KB Execution failed because the return code was nonzero
27 Runtime error 12 ms 1880 KB Execution failed because the return code was nonzero
28 Runtime error 12 ms 1960 KB Execution failed because the return code was nonzero
29 Runtime error 12 ms 1880 KB Execution failed because the return code was nonzero
30 Runtime error 7 ms 1904 KB Execution failed because the return code was nonzero
31 Runtime error 0 ms 344 KB Execution failed because the return code was nonzero
32 Runtime error 0 ms 344 KB Execution failed because the return code was nonzero
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 344 KB Output isn't correct
2 Incorrect 0 ms 344 KB Output isn't correct
3 Incorrect 0 ms 344 KB Output isn't correct
4 Incorrect 0 ms 344 KB Output isn't correct
5 Incorrect 0 ms 344 KB Output isn't correct
6 Incorrect 0 ms 344 KB Output isn't correct
7 Incorrect 0 ms 344 KB Output isn't correct
8 Incorrect 0 ms 344 KB Output isn't correct
9 Incorrect 0 ms 344 KB Output isn't correct
10 Incorrect 0 ms 344 KB Output isn't correct
11 Incorrect 1 ms 344 KB Output isn't correct
12 Incorrect 0 ms 344 KB Output isn't correct
13 Incorrect 1 ms 344 KB Output isn't correct
14 Incorrect 1 ms 344 KB Output isn't correct
15 Incorrect 0 ms 344 KB Output isn't correct
16 Incorrect 4 ms 600 KB Output isn't correct
17 Incorrect 3 ms 600 KB Output isn't correct
18 Incorrect 4 ms 600 KB Output isn't correct
19 Incorrect 3 ms 600 KB Output isn't correct
20 Incorrect 4 ms 600 KB Output isn't correct
21 Incorrect 12 ms 1176 KB Output isn't correct
22 Incorrect 12 ms 1112 KB Output isn't correct
23 Incorrect 20 ms 1192 KB Output isn't correct
24 Incorrect 12 ms 1112 KB Output isn't correct
25 Incorrect 11 ms 1112 KB Output isn't correct
26 Incorrect 15 ms 1180 KB Output isn't correct
27 Incorrect 12 ms 1112 KB Output isn't correct
28 Incorrect 12 ms 1112 KB Output isn't correct
29 Incorrect 16 ms 1112 KB Output isn't correct
30 Incorrect 8 ms 1112 KB Output isn't correct
31 Incorrect 0 ms 344 KB Output isn't correct
32 Incorrect 0 ms 344 KB Output isn't correct