답안 #875583

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
875583 2023-11-20T05:36:56 Z NeroZein Gap (APIO16_gap) C++17
0 / 100
740 ms 3872 KB
#include "gap.h"
#include "bits/stdc++.h"

using namespace std; 

long long findGap(int T, int N) {
  long long ret = 0; 
  vector<long long> a(N + 1);
  MinMax(0, LLONG_MAX, &a[1], &a[N]); 
  for (int i = 1; i < N - 1; ++i) {//find i + 1
    long long s = (a[N] - a[i] + N - i - 1) / (N - i) - 1;
    long long z = 0; 
    MinMax(a[i] + 1, a[i] + s, &z, &z); 
    if (z == -1) {
      long long t = 0; 
      for (int j = 60; j >= 0; --j) {
        if ((1LL << j) > a[N]) {
          continue; 
        }
        MinMax(a[i] + 1, a[i] + t + (1LL << j), &z, &z);
        if (z == -1) {
          t += (1 << j); 
        }
      }
      ret = max(ret, t + 1); 
      a[i + 1] = a[i] + t + 1; 
    } else {
      a[i + 1] = z; 
      if (z == a[N]) {
        break; 
      }
    }
  }
  ret = max(ret, a[N] - a[N - 1]); 
  return ret; 
}
# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 344 KB Output is correct
2 Runtime error 0 ms 2392 KB Execution failed because the return code was nonzero
3 Runtime error 0 ms 2392 KB Execution failed because the return code was nonzero
4 Runtime error 1 ms 2392 KB Execution failed because the return code was nonzero
5 Incorrect 0 ms 2392 KB Output isn't correct
6 Runtime error 1 ms 2392 KB Execution failed because the return code was nonzero
7 Runtime error 1 ms 2392 KB Execution failed because the return code was nonzero
8 Runtime error 2 ms 2392 KB Execution failed because the return code was nonzero
9 Runtime error 0 ms 2392 KB Execution failed because the return code was nonzero
10 Runtime error 1 ms 2392 KB Execution failed because the return code was nonzero
11 Runtime error 1 ms 2392 KB Execution failed because the return code was nonzero
12 Runtime error 1 ms 2392 KB Execution failed because the return code was nonzero
13 Runtime error 1 ms 2640 KB Execution failed because the return code was nonzero
14 Runtime error 1 ms 2392 KB Execution failed because the return code was nonzero
15 Incorrect 7 ms 2392 KB Output isn't correct
16 Runtime error 4 ms 2588 KB Execution failed because the return code was nonzero
17 Runtime error 4 ms 2592 KB Execution failed because the return code was nonzero
18 Runtime error 4 ms 2724 KB Execution failed because the return code was nonzero
19 Runtime error 4 ms 2584 KB Execution failed because the return code was nonzero
20 Runtime error 4 ms 2900 KB Execution failed because the return code was nonzero
21 Runtime error 15 ms 3736 KB Execution failed because the return code was nonzero
22 Runtime error 15 ms 3580 KB Execution failed because the return code was nonzero
23 Runtime error 15 ms 3628 KB Execution failed because the return code was nonzero
24 Runtime error 14 ms 3872 KB Execution failed because the return code was nonzero
25 Incorrect 740 ms 3616 KB Output isn't correct
26 Runtime error 16 ms 3628 KB Execution failed because the return code was nonzero
27 Runtime error 15 ms 3688 KB Execution failed because the return code was nonzero
28 Runtime error 17 ms 3628 KB Execution failed because the return code was nonzero
29 Runtime error 14 ms 3520 KB Execution failed because the return code was nonzero
30 Runtime error 15 ms 3612 KB Execution failed because the return code was nonzero
31 Runtime error 1 ms 2392 KB Execution failed because the return code was nonzero
32 Runtime error 0 ms 2392 KB Execution failed because the return code was nonzero
# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 2392 KB Output is correct
2 Runtime error 1 ms 2392 KB Execution failed because the return code was nonzero
3 Runtime error 0 ms 2392 KB Execution failed because the return code was nonzero
4 Runtime error 0 ms 2392 KB Execution failed because the return code was nonzero
5 Partially correct 0 ms 2392 KB Partially correct
6 Runtime error 1 ms 2392 KB Execution failed because the return code was nonzero
7 Runtime error 1 ms 2392 KB Execution failed because the return code was nonzero
8 Runtime error 0 ms 2392 KB Execution failed because the return code was nonzero
9 Runtime error 1 ms 2392 KB Execution failed because the return code was nonzero
10 Runtime error 0 ms 2392 KB Execution failed because the return code was nonzero
11 Runtime error 1 ms 2392 KB Execution failed because the return code was nonzero
12 Runtime error 1 ms 2392 KB Execution failed because the return code was nonzero
13 Runtime error 1 ms 2392 KB Execution failed because the return code was nonzero
14 Runtime error 1 ms 2392 KB Execution failed because the return code was nonzero
15 Partially correct 7 ms 2520 KB Partially correct
16 Runtime error 4 ms 2584 KB Execution failed because the return code was nonzero
17 Runtime error 4 ms 2752 KB Execution failed because the return code was nonzero
18 Runtime error 5 ms 2596 KB Execution failed because the return code was nonzero
19 Runtime error 4 ms 2744 KB Execution failed because the return code was nonzero
20 Runtime error 3 ms 2576 KB Execution failed because the return code was nonzero
21 Runtime error 15 ms 3616 KB Execution failed because the return code was nonzero
22 Runtime error 14 ms 3628 KB Execution failed because the return code was nonzero
23 Runtime error 15 ms 3604 KB Execution failed because the return code was nonzero
24 Runtime error 14 ms 3632 KB Execution failed because the return code was nonzero
25 Incorrect 735 ms 3616 KB Expected int32, but "10532484794" found
26 Runtime error 14 ms 3624 KB Execution failed because the return code was nonzero
27 Runtime error 15 ms 3624 KB Execution failed because the return code was nonzero
28 Runtime error 14 ms 3624 KB Execution failed because the return code was nonzero
29 Runtime error 14 ms 3624 KB Execution failed because the return code was nonzero
30 Runtime error 14 ms 3624 KB Execution failed because the return code was nonzero
31 Runtime error 0 ms 2392 KB Execution failed because the return code was nonzero
32 Runtime error 0 ms 2392 KB Execution failed because the return code was nonzero