CSES - APIO 2016 - Results
Submission details
Task:Gap
Sender:ollpu
Submission time:2019-04-13 18:26:45 +0300
Language:C++
Status:READY
Result:0
Feedback
groupverdictscore
#10
#20
Test results
testverdicttimescoregroup
#10.03 s01details
#20.02 s01details
#30.02 s01details
#40.02 s01details
#50.01 s01details
#60.02 s01details
#70.01 s01details
#80.02 s01details
#90.01 s01details
#100.02 s01details
#110.02 s01details
#120.01 s01details
#130.02 s01details
#140.02 s01details
#150.02 s01details
#160.05 s01details
#170.04 s01details
#180.04 s01details
#190.05 s01details
#200.04 s01details
#210.12 s01details
#220.12 s01details
#230.12 s01details
#240.13 s01details
#250.09 s01details
#260.12 s01details
#270.11 s01details
#280.12 s01details
#290.11 s01details
#300.06 s01details
#310.02 s01details
#320.02 s01details
#33ACCEPTED0.02 s702details
#340.01 s02details
#350.02 s02details
#360.02 s02details
#370.03 s02details
#380.02 s02details
#390.02 s02details
#400.02 s02details
#410.02 s02details
#420.02 s02details
#430.01 s02details
#440.02 s02details
#450.02 s02details
#460.02 s02details
#470.03 s02details
#480.05 s02details
#490.05 s02details
#500.05 s02details
#510.05 s02details
#520.03 s02details
#530.11 s02details
#540.11 s02details
#550.11 s02details
#560.11 s02details
#570.09 s02details
#580.12 s02details
#590.11 s02details
#600.12 s02details
#610.11 s02details
#620.06 s02details
#630.02 s02details
#640.01 s02details

Compiler report

input/code.cpp: In function 'long long int findGap(int, int)':
input/code.cpp:9:21: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
     while (a.size() < n) {
            ~~~~~~~~~^~~

Code

#include "gap.h"
#include <bits/stdc++.h>
using namespace std;
const long inf = 1e18;
long long findGap(int n, int t) { // int ??
  if (t == 1) {
    set<long> a;
    long s = 0, t = inf;
    while (a.size() < n) {
      long long ns, nt;
      MinMax(s, t, &ns, &nt);
      a.insert(ns);
      a.insert(nt);
      s = ns+1;
      t = nt-1;
    }
    long la = -1;
    long res = 0;
    for (long ta : a) {
      if (la != -1) {
        res = max(res, ta-la);
      }
      la = ta;
    }
    return res;
  } else {
    long long b, e;
    MinMax(0, inf, &b, &e);
    long step = (e-b)/(n-1) + !!((e-b)%(n-1));
    long res = step;
    long lm = b, ku = b;
    while (ku < e) {
      long long mn, mx;
      MinMax(ku+1, ku+step, &mn, &mx);
      if (mn != -1) {
        res = max(res, long(mn-lm));
        lm = mx;
      }
      ku = ku+step;
    }
    return res;
  }
}

Test details

Test 1

Group: 1

Verdict:

input
1 2
29659227736649406 728704890713...

correct output
(empty)

user output
(empty)

Test 2

Group: 1

Verdict:

input
1 15
4910834401530995 8236651085889...

correct output
(empty)

user output
(empty)

Test 3

Group: 1

Verdict:

input
1 15
26822012613602297 830163366163...

correct output
(empty)

user output
(empty)

Test 4

Group: 1

Verdict:

input
1 15
9924552505919890 2065094604777...

correct output
(empty)

user output
(empty)

Test 5

Group: 1

Verdict:

input
1 15
5829742 7847985 9866228 118844...

correct output
(empty)

user output
(empty)

Test 6

Group: 1

Verdict:

input
1 100
3343298378001251 1748440243612...

correct output
(empty)

user output
(empty)

Test 7

Group: 1

Verdict:

input
1 100
6615965004180765 1318520746045...

correct output
(empty)

user output
(empty)

Test 8

Group: 1

Verdict:

input
1 100
709357564623321 77128246965710...

correct output
(empty)

user output
(empty)

Test 9

Group: 1

Verdict:

input
1 100
14237546663715875 268988673144...

correct output
(empty)

user output
(empty)

Test 10

Group: 1

Verdict:

input
1 100
1 2 3 4 5 6 7 8 9 10 11 12 13 ...

correct output
(empty)

user output
(empty)

Test 11

Group: 1

Verdict:

input
1 1500
393226341882178 13216496468619...

correct output
(empty)

user output
(empty)

Test 12

Group: 1

Verdict:

input
1 1500
276387254568267 34829856602130...

correct output
(empty)

user output
(empty)

Test 13

Group: 1

Verdict:

input
1 1500
394502620394491 47759565208720...

correct output
(empty)

user output
(empty)

Test 14

Group: 1

Verdict:

input
1 1500
232644703989174 91492562377220...

correct output
(empty)

user output
(empty)

Test 15

Group: 1

Verdict:

input
1 1500
5829742 7847985 9866228 118844...

correct output
(empty)

user output
(empty)

Test 16

Group: 1

Verdict:

input
1 25000
9133780858698 37909498824529 4...

correct output
(empty)

user output
(empty)

Test 17

Group: 1

Verdict:

input
1 25000
95371433023390 183850194127179...

correct output
(empty)

user output
(empty)

Test 18

Group: 1

Verdict:

input
1 25000
7504645895952 60172453317399 8...

correct output
(empty)

user output
(empty)

Test 19

Group: 1

Verdict:

input
1 25000
39499604978204 102114332324801...

correct output
(empty)

user output
(empty)

Test 20

Group: 1

Verdict:

input
1 25000
1 2 3 4 5 6 7 8 9 10 11 12 13 ...

correct output
(empty)

user output
(empty)

Test 21

Group: 1

Verdict:

input
1 100000
4488179349610 16973330836139 4...

correct output
(empty)

user output
(empty)

Test 22

Group: 1

Verdict:

input
1 100000
13149709307416 18293717155215 ...

correct output
(empty)

user output
(empty)

Test 23

Group: 1

Verdict:

input
1 100000
5111699493996 19396274992433 2...

correct output
(empty)

user output
(empty)

Test 24

Group: 1

Verdict:

input
1 100000
12448126808805 14955287440308 ...

correct output
(empty)

user output
(empty)

Test 25

Group: 1

Verdict:

input
1 100000
5829742 7847985 9866228 118844...

correct output
(empty)

user output
(empty)

Test 26

Group: 1

Verdict:

input
1 100000
15609355723226 28246203120916 ...

correct output
(empty)

user output
(empty)

Test 27

Group: 1

Verdict:

input
1 100000
10126035265316 18812438778817 ...

correct output
(empty)

user output
(empty)

Test 28

Group: 1

Verdict:

input
1 100000
5196984998043 10787031331530 5...

correct output
(empty)

user output
(empty)

Test 29

Group: 1

Verdict:

input
1 100000
19821024745776 35883956869682 ...

correct output
(empty)

user output
(empty)

Test 30

Group: 1

Verdict:

input
1 100000
1 2 3 4 5 6 7 8 9 10 11 12 13 ...

correct output
(empty)

user output
(empty)

Test 31

Group: 1

Verdict:

input
1 118
1 2 3 4 5 6 7 8 9 10 11 12 13 ...

correct output
(empty)

user output
(empty)

Test 32

Group: 1

Verdict:

input
1 118
1 500000000000000001 750000000...

correct output
(empty)

user output
(empty)

Test 33

Group: 2

Verdict: ACCEPTED

input
2 2
78103569500113815 605712887753...

correct output
(empty)

user output
70

Test 34

Group: 2

Verdict:

input
2 15
61436558421029682 834292060079...

correct output
(empty)

user output
0

Test 35

Group: 2

Verdict:

input
2 15
59675445208809451 142100938168...

correct output
(empty)

user output
0

Test 36

Group: 2

Verdict:

input
2 15
57755783461204076 725499461376...

correct output
(empty)

user output
0

Test 37

Group: 2

Verdict:

input
2 15
5829742 7847985 9866228 118844...

correct output
(empty)

user output
0

Test 38

Group: 2

Verdict:

input
2 100
4935323238097746 2853421336222...

correct output
(empty)

user output
0

Test 39

Group: 2

Verdict:

input
2 100
329840134021571 35247166734885...

correct output
(empty)

user output
0

Test 40

Group: 2

Verdict:

input
2 100
20951091854749146 393866653367...

correct output
(empty)

user output
0

Test 41

Group: 2

Verdict:

input
2 100
8683327277022804 1152589874346...

correct output
(empty)

user output
0

Test 42

Group: 2

Verdict:

input
2 100
1 2 3 4 5 6 7 8 9 10 11 12 13 ...

correct output
(empty)

user output
0

Test 43

Group: 2

Verdict:

input
2 1500
1618213394018307 1726930763754...

correct output
(empty)

user output
0

Test 44

Group: 2

Verdict:

input
2 1500
423747667147233 15612870327743...

correct output
(empty)

user output
0

Test 45

Group: 2

Verdict:

input
2 1500
64452176748519 137423800315192...

correct output
(empty)

user output
0

Test 46

Group: 2

Verdict:

input
2 1500
324495733956306 33247199518693...

correct output
(empty)

user output
0

Test 47

Group: 2

Verdict:

input
2 1500
5829742 7847985 9866228 118844...

correct output
(empty)

user output
0

Test 48

Group: 2

Verdict:

input
2 25000
112605853915943 12530590767415...

correct output
(empty)

user output
0

Test 49

Group: 2

Verdict:

input
2 25000
53697824651228 59941694110355 ...

correct output
(empty)

user output
0

Test 50

Group: 2

Verdict:

input
2 25000
236383646331590 30973864010249...

correct output
(empty)

user output
0

Test 51

Group: 2

Verdict:

input
2 25000
52783945537122 62819045853889 ...

correct output
(empty)

user output
0

Test 52

Group: 2

Verdict:

input
2 25000
1 2 3 4 5 6 7 8 9 10 11 12 13 ...

correct output
(empty)

user output
0

Test 53

Group: 2

Verdict:

input
2 100000
3977422187752 9172657585884 24...

correct output
(empty)

user output
0

Test 54

Group: 2

Verdict:

input
2 100000
13262637344137 25327517069541 ...

correct output
(empty)

user output
0

Test 55

Group: 2

Verdict:

input
2 100000
18832120122902 29507339632281 ...

correct output
(empty)

user output
0

Test 56

Group: 2

Verdict:

input
2 100000
6181561812375 6378266039481 17...

correct output
(empty)

user output
0

Test 57

Group: 2

Verdict:

input
2 100000
5829742 7847985 9866228 118844...

correct output
(empty)

user output
0

Test 58

Group: 2

Verdict:

input
2 100000
535929232534 21492335528903 25...

correct output
(empty)

user output
0

Test 59

Group: 2

Verdict:

input
2 100000
9057012105366 20678972320055 2...

correct output
(empty)

user output
0

Test 60

Group: 2

Verdict:

input
2 100000
7697039304820 22564329077790 2...

correct output
(empty)

user output
0

Test 61

Group: 2

Verdict:

input
2 100000
39366590558911 39585546629301 ...

correct output
(empty)

user output
0

Test 62

Group: 2

Verdict:

input
2 100000
1 2 3 4 5 6 7 8 9 10 11 12 13 ...

correct output
(empty)

user output
0

Test 63

Group: 2

Verdict:

input
2 118
1 2 3 4 5 6 7 8 9 10 11 12 13 ...

correct output
(empty)

user output
0

Test 64

Group: 2

Verdict:

input
2 118
1 500000000000000001 750000000...

correct output
(empty)

user output
0