답안 #47956

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
47956 2018-05-09T08:31:18 Z 3zp Gap (APIO16_gap) C++14
0 / 100
82 ms 1532 KB
#include "gap.h"
#define ll long long
#include<bits/stdc++.h>
using namespace std;
long long findGap(int T, int N)
{
    ll s, t;
    MinMax(0, 1e18, &s, &t);
    ll L = t - s;
    ll d = (L + N - 2) / (N - 1);
    d++;
    ll ans = d-1;
    ll x = s;
    while(x != t){
        ll p, q;
        if(x + d >= t) break;
         MinMax(x + 1, x + d, &p , &q);
        if(q != -1) {
            ans = max(ans, p - x);
            x = q;
            continue;
        }
        ll w = 2;
        while(1){
            if(x + w*d >= t) {

                MinMax(x + 1,t-1,&p , &q);
                ans = max(ans, p-x);
                return ans;
            }
            MinMax(x + 1,min( x + w * d, (ll)1e18),&p , &q);
            if(q == -1) {w++; continue;}
            ans = max(ans, p - x);
            x = q;
            break;
        }
    }
    return ans;
}
# 결과 실행 시간 메모리 Grader output
1 Correct 2 ms 248 KB Output is correct
2 Incorrect 2 ms 356 KB Output isn't correct
3 Incorrect 2 ms 408 KB Output isn't correct
4 Incorrect 2 ms 408 KB Output isn't correct
5 Incorrect 2 ms 468 KB Output isn't correct
6 Incorrect 2 ms 516 KB Output isn't correct
7 Incorrect 2 ms 540 KB Output isn't correct
8 Incorrect 2 ms 664 KB Output isn't correct
9 Incorrect 2 ms 664 KB Output isn't correct
10 Incorrect 2 ms 664 KB Output isn't correct
11 Incorrect 3 ms 664 KB Output isn't correct
12 Incorrect 3 ms 664 KB Output isn't correct
13 Incorrect 3 ms 740 KB Output isn't correct
14 Incorrect 3 ms 740 KB Output isn't correct
15 Incorrect 2 ms 740 KB Output isn't correct
16 Incorrect 21 ms 812 KB Output isn't correct
17 Incorrect 21 ms 812 KB Output isn't correct
18 Incorrect 21 ms 812 KB Output isn't correct
19 Incorrect 21 ms 812 KB Output isn't correct
20 Incorrect 9 ms 812 KB Output isn't correct
21 Incorrect 81 ms 1408 KB Output isn't correct
22 Incorrect 81 ms 1448 KB Output isn't correct
23 Incorrect 82 ms 1448 KB Output isn't correct
24 Incorrect 81 ms 1448 KB Output isn't correct
25 Incorrect 66 ms 1448 KB Output isn't correct
26 Incorrect 81 ms 1448 KB Output isn't correct
27 Incorrect 81 ms 1448 KB Output isn't correct
28 Incorrect 82 ms 1448 KB Output isn't correct
29 Incorrect 80 ms 1448 KB Output isn't correct
30 Incorrect 36 ms 1448 KB Output isn't correct
31 Incorrect 2 ms 1448 KB Output isn't correct
32 Incorrect 2 ms 1448 KB Output isn't correct
# 결과 실행 시간 메모리 Grader output
1 Correct 2 ms 1448 KB Output is correct
2 Partially correct 2 ms 1448 KB Partially correct
3 Partially correct 2 ms 1448 KB Partially correct
4 Partially correct 2 ms 1448 KB Partially correct
5 Correct 2 ms 1448 KB Output is correct
6 Partially correct 2 ms 1448 KB Partially correct
7 Partially correct 2 ms 1448 KB Partially correct
8 Partially correct 2 ms 1448 KB Partially correct
9 Partially correct 2 ms 1448 KB Partially correct
10 Correct 2 ms 1448 KB Output is correct
11 Partially correct 3 ms 1448 KB Partially correct
12 Partially correct 3 ms 1448 KB Partially correct
13 Partially correct 3 ms 1448 KB Partially correct
14 Partially correct 3 ms 1448 KB Partially correct
15 Correct 3 ms 1448 KB Output is correct
16 Partially correct 21 ms 1448 KB Partially correct
17 Partially correct 21 ms 1448 KB Partially correct
18 Partially correct 21 ms 1448 KB Partially correct
19 Partially correct 21 ms 1448 KB Partially correct
20 Correct 9 ms 1448 KB Output is correct
21 Partially correct 81 ms 1448 KB Partially correct
22 Partially correct 80 ms 1532 KB Partially correct
23 Partially correct 80 ms 1532 KB Partially correct
24 Partially correct 80 ms 1532 KB Partially correct
25 Correct 66 ms 1532 KB Output is correct
26 Partially correct 81 ms 1532 KB Partially correct
27 Partially correct 81 ms 1532 KB Partially correct
28 Partially correct 80 ms 1532 KB Partially correct
29 Partially correct 82 ms 1532 KB Partially correct
30 Correct 36 ms 1532 KB Output is correct
31 Incorrect 2 ms 1532 KB Output isn't correct
32 Correct 2 ms 1532 KB Output is correct