답안 #875588

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
875588 2023-11-20T06:02:35 Z NeroZein Gap (APIO16_gap) C++17
0 / 100
720 ms 3868 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, -1);
  MinMax(0, LLONG_MAX, &a[1], &a[N]); 
  for (int i = 1; i < N - 1; ++i) {//find i + 1
    if (a[i] == a[N]) {
      break; 
    }
    long long s = (a[N] - a[i] + N - i - 1) / (N - i) - 1;
    if (s == 0) {
      break; 
    }
    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 += (1LL << j); 
        }
      }
      ret = max(ret, t + 1); 
      a[i + 1] = a[i] + t + 1; 
    } else {
      a[i + 1] = z;  
    }
  }
  if (a[N - 1] != -1) {
    ret = max(ret, a[N] - a[N - 1]);     
  }
  return ret; 
}
# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 344 KB Output is correct
2 Incorrect 0 ms 2392 KB Output isn't correct
3 Incorrect 0 ms 2392 KB Output isn't correct
4 Incorrect 0 ms 2392 KB Output isn't correct
5 Incorrect 1 ms 2392 KB Output isn't correct
6 Incorrect 1 ms 2388 KB Output isn't correct
7 Incorrect 1 ms 2392 KB Output isn't correct
8 Incorrect 1 ms 2392 KB Output isn't correct
9 Incorrect 1 ms 2392 KB Output isn't correct
10 Correct 0 ms 2392 KB Output is correct
11 Incorrect 5 ms 2392 KB Output isn't correct
12 Incorrect 5 ms 2392 KB Output isn't correct
13 Incorrect 5 ms 2392 KB Output isn't correct
14 Incorrect 5 ms 2392 KB Output isn't correct
15 Incorrect 7 ms 2392 KB Output isn't correct
16 Incorrect 102 ms 2588 KB Output isn't correct
17 Incorrect 101 ms 2596 KB Output isn't correct
18 Incorrect 102 ms 2584 KB Output isn't correct
19 Incorrect 102 ms 2584 KB Output isn't correct
20 Correct 3 ms 2580 KB Output is correct
21 Incorrect 467 ms 3868 KB Output isn't correct
22 Incorrect 468 ms 3620 KB Output isn't correct
23 Incorrect 475 ms 3604 KB Output isn't correct
24 Incorrect 473 ms 3616 KB Output isn't correct
25 Incorrect 715 ms 3620 KB Output isn't correct
26 Incorrect 493 ms 3624 KB Output isn't correct
27 Incorrect 468 ms 3632 KB Output isn't correct
28 Incorrect 480 ms 3620 KB Output isn't correct
29 Incorrect 471 ms 3628 KB Output isn't correct
30 Correct 15 ms 3592 KB Output is correct
31 Incorrect 1 ms 2392 KB Output isn't correct
32 Incorrect 1 ms 2392 KB Output isn't correct
# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 2392 KB Output is correct
2 Partially correct 0 ms 2392 KB Partially correct
3 Partially correct 0 ms 2388 KB Partially correct
4 Partially correct 0 ms 2388 KB Partially correct
5 Partially correct 1 ms 2392 KB Partially correct
6 Partially correct 1 ms 2392 KB Partially correct
7 Partially correct 1 ms 2392 KB Partially correct
8 Partially correct 1 ms 2392 KB Partially correct
9 Partially correct 1 ms 2392 KB Partially correct
10 Partially correct 0 ms 2392 KB Partially correct
11 Partially correct 5 ms 2392 KB Partially correct
12 Partially correct 5 ms 2392 KB Partially correct
13 Partially correct 5 ms 2392 KB Partially correct
14 Partially correct 5 ms 2392 KB Partially correct
15 Partially correct 7 ms 2392 KB Partially correct
16 Partially correct 102 ms 2584 KB Partially correct
17 Partially correct 104 ms 2580 KB Partially correct
18 Partially correct 101 ms 2588 KB Partially correct
19 Partially correct 101 ms 2584 KB Partially correct
20 Correct 3 ms 2572 KB Output is correct
21 Incorrect 479 ms 3624 KB Expected int32, but "3738663473" found
22 Incorrect 475 ms 3620 KB Expected int32, but "3734306730" found
23 Incorrect 471 ms 3624 KB Expected int32, but "3707831611" found
24 Incorrect 473 ms 3624 KB Expected int32, but "3741233199" found
25 Incorrect 720 ms 3620 KB Expected int32, but "10532484794" found
26 Incorrect 471 ms 3628 KB Expected int32, but "3729446733" found
27 Incorrect 475 ms 3628 KB Expected int32, but "3747709649" found
28 Incorrect 476 ms 3628 KB Expected int32, but "3747992178" found
29 Incorrect 477 ms 3628 KB Expected int32, but "3726314379" found
30 Partially correct 15 ms 3600 KB Partially correct
31 Partially correct 1 ms 2392 KB Partially correct
32 Partially correct 1 ms 2392 KB Partially correct