Submission #429344

# Submission time Handle Problem Language Result Execution time Memory
429344 2021-06-15T21:01:44 Z JeanBombeur Aliens (IOI16_aliens) C++17
100 / 100
160 ms 6656 KB
#include <iostream>
#include <cstdio>
#include <vector>
#include <algorithm>
#include <bits/stdc++.h>
#include "aliens.h"
using namespace std;
 
//    <|°_°|>
 
const int MAX_POINTS = (100 * 1000);
const int LOG = (40);
 
struct droite {
    long long pente, cst;
    int prix;
};
 
pair <long long, long long> Points[MAX_POINTS];
pair <int, int> Aliens[MAX_POINTS];
 
droite Deque[MAX_POINTS];
int deb = 0, fin = 0;
 
int nbPoints = 0;

bool Compare(pair <int, int> a, pair <int, int> b) {
    if (a.first != b.first)
        return a.first < b.first;
    return a.second > b.second;
}

void Insert(droite a) {
    while (fin > deb + 1 && (a.cst - Deque[fin - 1].cst) * (Deque[fin - 2].pente - Deque[fin - 1].pente) < (Deque[fin - 1].pente - a.pente) * (Deque[fin - 1].cst - Deque[fin - 2].cst))
        fin --;
    Deque[fin ++] = a;
    return;
}
 
pair <long long, int> GetMin(long long absc) {
    while (fin > deb + 1 && (absc * Deque[deb].pente + Deque[deb].cst) > (absc * Deque[deb + 1].pente + Deque[deb + 1].cst))
        deb ++;
    return {Deque[deb].pente * absc + Deque[deb].cst, Deque[deb].prix};
}
 
pair <long long, int> FindDP(long long lambda) {
    deb = 0, fin = 0;
    pair <long long, int> DP = {0LL, 0};
    Insert({- 2 * Points[0].first, Points[0].first * Points[0].first, 0});
    for (int i = 0; i < nbPoints; i ++)
    {
        DP = GetMin(Points[i].second);
        DP.first += Points[i].second * Points[i].second + lambda;
        DP.second ++;
        if (i + 1 < nbPoints)
        {
            long long d1 = max(0LL, Points[i].second - Points[i + 1].first), d2 = Points[i + 1].first;
            Insert({-2 * d2, DP.first - d1 * d1 + d2 * d2, DP.second});
        }
    }
    return DP;
}
 
long long take_photos(int nbAliens, int tailleMax, int nbPhotos, vector<int> Lignes, vector<int> Colonnes) {
    
    tailleMax ++;
    
    for (int i = 0; i < nbAliens; i ++)
    {
        if (Lignes[i] > Colonnes[i])
            swap(Lignes[i], Colonnes[i]);
        Aliens[i] = {Lignes[i], ++ Colonnes[i]};
    }
    sort(Aliens, Aliens + nbAliens, Compare);
    
    for (int i = 0; i < nbAliens; i ++)
    {
        if (nbPoints == 0 || Aliens[i].second > (int)Points[nbPoints - 1].second)
            Points[nbPoints ++] = Aliens[i];
    }
    
    long long lambda = -1;
    pair <long long, int> DP;

    for (long long i = (1LL << LOG); i > 0; i /= 2)
    {
        DP = FindDP(lambda + i);
        if (DP.second > nbPhotos)
            lambda += i;
    }
    DP = FindDP(++ lambda);
    return DP.first - lambda * nbPhotos;
}
# Verdict Execution time Memory Grader output
1 Correct 1 ms 204 KB Correct answer: answer = 4
2 Correct 0 ms 204 KB Correct answer: answer = 4
3 Correct 0 ms 204 KB Correct answer: answer = 4
4 Correct 1 ms 204 KB Correct answer: answer = 12
5 Correct 1 ms 204 KB Correct answer: answer = 52
6 Correct 1 ms 204 KB Correct answer: answer = 210
7 Correct 1 ms 204 KB Correct answer: answer = 88
8 Correct 1 ms 204 KB Correct answer: answer = 7696
9 Correct 1 ms 204 KB Correct answer: answer = 1
10 Correct 1 ms 204 KB Correct answer: answer = 2374
11 Correct 1 ms 204 KB Correct answer: answer = 9502
12 Correct 1 ms 204 KB Correct answer: answer = 49
13 Correct 1 ms 204 KB Correct answer: answer = 151
14 Correct 1 ms 204 KB Correct answer: answer = 7550
15 Correct 1 ms 204 KB Correct answer: answer = 7220
16 Correct 1 ms 204 KB Correct answer: answer = 7550
17 Correct 1 ms 204 KB Correct answer: answer = 10000
18 Correct 0 ms 204 KB Correct answer: answer = 10000
19 Correct 1 ms 204 KB Correct answer: answer = 624
20 Correct 1 ms 204 KB Correct answer: answer = 10000
# Verdict Execution time Memory Grader output
1 Correct 0 ms 204 KB Correct answer: answer = 1
2 Correct 1 ms 204 KB Correct answer: answer = 4
3 Correct 1 ms 204 KB Correct answer: answer = 1
4 Correct 1 ms 204 KB Correct answer: answer = 5
5 Correct 0 ms 204 KB Correct answer: answer = 41
6 Correct 1 ms 204 KB Correct answer: answer = 71923
7 Correct 1 ms 204 KB Correct answer: answer = 77137
8 Correct 1 ms 332 KB Correct answer: answer = 764
9 Correct 1 ms 332 KB Correct answer: answer = 250000
10 Correct 1 ms 332 KB Correct answer: answer = 500
11 Correct 1 ms 204 KB Correct answer: answer = 32
12 Correct 2 ms 204 KB Correct answer: answer = 130050
13 Correct 2 ms 332 KB Correct answer: answer = 5110
14 Correct 1 ms 204 KB Correct answer: answer = 2626
15 Correct 1 ms 204 KB Correct answer: answer = 796
16 Correct 1 ms 332 KB Correct answer: answer = 7580
17 Correct 1 ms 332 KB Correct answer: answer = 1904
18 Correct 1 ms 332 KB Correct answer: answer = 996004
19 Correct 1 ms 204 KB Correct answer: answer = 38817
20 Correct 1 ms 332 KB Correct answer: answer = 4096
21 Correct 1 ms 204 KB Correct answer: answer = 1
22 Correct 1 ms 204 KB Correct answer: answer = 1
23 Correct 1 ms 332 KB Correct answer: answer = 2040
24 Correct 1 ms 204 KB Correct answer: answer = 2
# Verdict Execution time Memory Grader output
1 Correct 1 ms 204 KB Correct answer: answer = 4
2 Correct 0 ms 204 KB Correct answer: answer = 4
3 Correct 0 ms 204 KB Correct answer: answer = 4
4 Correct 1 ms 204 KB Correct answer: answer = 12
5 Correct 1 ms 204 KB Correct answer: answer = 52
6 Correct 1 ms 204 KB Correct answer: answer = 210
7 Correct 1 ms 204 KB Correct answer: answer = 88
8 Correct 1 ms 204 KB Correct answer: answer = 7696
9 Correct 1 ms 204 KB Correct answer: answer = 1
10 Correct 1 ms 204 KB Correct answer: answer = 2374
11 Correct 1 ms 204 KB Correct answer: answer = 9502
12 Correct 1 ms 204 KB Correct answer: answer = 49
13 Correct 1 ms 204 KB Correct answer: answer = 151
14 Correct 1 ms 204 KB Correct answer: answer = 7550
15 Correct 1 ms 204 KB Correct answer: answer = 7220
16 Correct 1 ms 204 KB Correct answer: answer = 7550
17 Correct 1 ms 204 KB Correct answer: answer = 10000
18 Correct 0 ms 204 KB Correct answer: answer = 10000
19 Correct 1 ms 204 KB Correct answer: answer = 624
20 Correct 1 ms 204 KB Correct answer: answer = 10000
21 Correct 0 ms 204 KB Correct answer: answer = 1
22 Correct 1 ms 204 KB Correct answer: answer = 4
23 Correct 1 ms 204 KB Correct answer: answer = 1
24 Correct 1 ms 204 KB Correct answer: answer = 5
25 Correct 0 ms 204 KB Correct answer: answer = 41
26 Correct 1 ms 204 KB Correct answer: answer = 71923
27 Correct 1 ms 204 KB Correct answer: answer = 77137
28 Correct 1 ms 332 KB Correct answer: answer = 764
29 Correct 1 ms 332 KB Correct answer: answer = 250000
30 Correct 1 ms 332 KB Correct answer: answer = 500
31 Correct 1 ms 204 KB Correct answer: answer = 32
32 Correct 2 ms 204 KB Correct answer: answer = 130050
33 Correct 2 ms 332 KB Correct answer: answer = 5110
34 Correct 1 ms 204 KB Correct answer: answer = 2626
35 Correct 1 ms 204 KB Correct answer: answer = 796
36 Correct 1 ms 332 KB Correct answer: answer = 7580
37 Correct 1 ms 332 KB Correct answer: answer = 1904
38 Correct 1 ms 332 KB Correct answer: answer = 996004
39 Correct 1 ms 204 KB Correct answer: answer = 38817
40 Correct 1 ms 332 KB Correct answer: answer = 4096
41 Correct 1 ms 204 KB Correct answer: answer = 1
42 Correct 1 ms 204 KB Correct answer: answer = 1
43 Correct 1 ms 332 KB Correct answer: answer = 2040
44 Correct 1 ms 204 KB Correct answer: answer = 2
45 Correct 1 ms 204 KB Correct answer: answer = 4
46 Correct 1 ms 204 KB Correct answer: answer = 9
47 Correct 1 ms 204 KB Correct answer: answer = 9
48 Correct 1 ms 204 KB Correct answer: answer = 21
49 Correct 1 ms 204 KB Correct answer: answer = 71
50 Correct 1 ms 204 KB Correct answer: answer = 77
51 Correct 1 ms 204 KB Correct answer: answer = 400
52 Correct 1 ms 204 KB Correct answer: answer = 996004
53 Correct 1 ms 204 KB Correct answer: answer = 997310
54 Correct 1 ms 204 KB Correct answer: answer = 990781
55 Correct 1 ms 204 KB Correct answer: answer = 996545
56 Correct 1 ms 204 KB Correct answer: answer = 484
57 Correct 1 ms 204 KB Correct answer: answer = 484
58 Correct 1 ms 204 KB Correct answer: answer = 63501
59 Correct 1 ms 332 KB Correct answer: answer = 323501
60 Correct 1 ms 332 KB Correct answer: answer = 752500
61 Correct 1 ms 204 KB Correct answer: answer = 761480
62 Correct 1 ms 204 KB Correct answer: answer = 758932
63 Correct 1 ms 204 KB Correct answer: answer = 1000000
64 Correct 1 ms 332 KB Correct answer: answer = 750500
65 Correct 1 ms 204 KB Correct answer: answer = 1000000
66 Correct 1 ms 204 KB Correct answer: answer = 250000
67 Correct 1 ms 204 KB Correct answer: answer = 250000
68 Correct 1 ms 204 KB Correct answer: answer = 1000000
69 Correct 1 ms 320 KB Correct answer: answer = 994009
70 Correct 1 ms 204 KB Correct answer: answer = 59315
71 Correct 1 ms 204 KB Correct answer: answer = 25454
72 Correct 1 ms 204 KB Correct answer: answer = 1504
73 Correct 1 ms 204 KB Correct answer: answer = 37486
74 Correct 1 ms 204 KB Correct answer: answer = 4284
75 Correct 1 ms 236 KB Correct answer: answer = 158008
76 Correct 1 ms 204 KB Correct answer: answer = 51860
77 Correct 1 ms 204 KB Correct answer: answer = 12985
# Verdict Execution time Memory Grader output
1 Correct 1 ms 204 KB Correct answer: answer = 4
2 Correct 0 ms 204 KB Correct answer: answer = 4
3 Correct 0 ms 204 KB Correct answer: answer = 4
4 Correct 1 ms 204 KB Correct answer: answer = 12
5 Correct 1 ms 204 KB Correct answer: answer = 52
6 Correct 1 ms 204 KB Correct answer: answer = 210
7 Correct 1 ms 204 KB Correct answer: answer = 88
8 Correct 1 ms 204 KB Correct answer: answer = 7696
9 Correct 1 ms 204 KB Correct answer: answer = 1
10 Correct 1 ms 204 KB Correct answer: answer = 2374
11 Correct 1 ms 204 KB Correct answer: answer = 9502
12 Correct 1 ms 204 KB Correct answer: answer = 49
13 Correct 1 ms 204 KB Correct answer: answer = 151
14 Correct 1 ms 204 KB Correct answer: answer = 7550
15 Correct 1 ms 204 KB Correct answer: answer = 7220
16 Correct 1 ms 204 KB Correct answer: answer = 7550
17 Correct 1 ms 204 KB Correct answer: answer = 10000
18 Correct 0 ms 204 KB Correct answer: answer = 10000
19 Correct 1 ms 204 KB Correct answer: answer = 624
20 Correct 1 ms 204 KB Correct answer: answer = 10000
21 Correct 0 ms 204 KB Correct answer: answer = 1
22 Correct 1 ms 204 KB Correct answer: answer = 4
23 Correct 1 ms 204 KB Correct answer: answer = 1
24 Correct 1 ms 204 KB Correct answer: answer = 5
25 Correct 0 ms 204 KB Correct answer: answer = 41
26 Correct 1 ms 204 KB Correct answer: answer = 71923
27 Correct 1 ms 204 KB Correct answer: answer = 77137
28 Correct 1 ms 332 KB Correct answer: answer = 764
29 Correct 1 ms 332 KB Correct answer: answer = 250000
30 Correct 1 ms 332 KB Correct answer: answer = 500
31 Correct 1 ms 204 KB Correct answer: answer = 32
32 Correct 2 ms 204 KB Correct answer: answer = 130050
33 Correct 2 ms 332 KB Correct answer: answer = 5110
34 Correct 1 ms 204 KB Correct answer: answer = 2626
35 Correct 1 ms 204 KB Correct answer: answer = 796
36 Correct 1 ms 332 KB Correct answer: answer = 7580
37 Correct 1 ms 332 KB Correct answer: answer = 1904
38 Correct 1 ms 332 KB Correct answer: answer = 996004
39 Correct 1 ms 204 KB Correct answer: answer = 38817
40 Correct 1 ms 332 KB Correct answer: answer = 4096
41 Correct 1 ms 204 KB Correct answer: answer = 1
42 Correct 1 ms 204 KB Correct answer: answer = 1
43 Correct 1 ms 332 KB Correct answer: answer = 2040
44 Correct 1 ms 204 KB Correct answer: answer = 2
45 Correct 1 ms 204 KB Correct answer: answer = 4
46 Correct 1 ms 204 KB Correct answer: answer = 9
47 Correct 1 ms 204 KB Correct answer: answer = 9
48 Correct 1 ms 204 KB Correct answer: answer = 21
49 Correct 1 ms 204 KB Correct answer: answer = 71
50 Correct 1 ms 204 KB Correct answer: answer = 77
51 Correct 1 ms 204 KB Correct answer: answer = 400
52 Correct 1 ms 204 KB Correct answer: answer = 996004
53 Correct 1 ms 204 KB Correct answer: answer = 997310
54 Correct 1 ms 204 KB Correct answer: answer = 990781
55 Correct 1 ms 204 KB Correct answer: answer = 996545
56 Correct 1 ms 204 KB Correct answer: answer = 484
57 Correct 1 ms 204 KB Correct answer: answer = 484
58 Correct 1 ms 204 KB Correct answer: answer = 63501
59 Correct 1 ms 332 KB Correct answer: answer = 323501
60 Correct 1 ms 332 KB Correct answer: answer = 752500
61 Correct 1 ms 204 KB Correct answer: answer = 761480
62 Correct 1 ms 204 KB Correct answer: answer = 758932
63 Correct 1 ms 204 KB Correct answer: answer = 1000000
64 Correct 1 ms 332 KB Correct answer: answer = 750500
65 Correct 1 ms 204 KB Correct answer: answer = 1000000
66 Correct 1 ms 204 KB Correct answer: answer = 250000
67 Correct 1 ms 204 KB Correct answer: answer = 250000
68 Correct 1 ms 204 KB Correct answer: answer = 1000000
69 Correct 1 ms 320 KB Correct answer: answer = 994009
70 Correct 1 ms 204 KB Correct answer: answer = 59315
71 Correct 1 ms 204 KB Correct answer: answer = 25454
72 Correct 1 ms 204 KB Correct answer: answer = 1504
73 Correct 1 ms 204 KB Correct answer: answer = 37486
74 Correct 1 ms 204 KB Correct answer: answer = 4284
75 Correct 1 ms 236 KB Correct answer: answer = 158008
76 Correct 1 ms 204 KB Correct answer: answer = 51860
77 Correct 1 ms 204 KB Correct answer: answer = 12985
78 Correct 2 ms 332 KB Correct answer: answer = 997864126212
79 Correct 2 ms 332 KB Correct answer: answer = 998608411647
80 Correct 2 ms 332 KB Correct answer: answer = 995265560477
81 Correct 5 ms 460 KB Correct answer: answer = 10125000
82 Correct 6 ms 456 KB Correct answer: answer = 2291668
83 Correct 3 ms 332 KB Correct answer: answer = 42388
84 Correct 3 ms 428 KB Correct answer: answer = 10318
85 Correct 3 ms 332 KB Correct answer: answer = 3416
86 Correct 6 ms 460 KB Correct answer: answer = 331708193881
87 Correct 6 ms 476 KB Correct answer: answer = 2861193756
88 Correct 7 ms 460 KB Correct answer: answer = 114646930
89 Correct 5 ms 460 KB Correct answer: answer = 9280921
90 Correct 5 ms 460 KB Correct answer: answer = 999984053400
91 Correct 6 ms 508 KB Correct answer: answer = 750935949134
92 Correct 2 ms 332 KB Correct answer: answer = 1000000000000
93 Correct 2 ms 332 KB Correct answer: answer = 998762383161
94 Correct 6 ms 460 KB Correct answer: answer = 23017412908
95 Correct 3 ms 332 KB Correct answer: answer = 728143410622
96 Correct 2 ms 332 KB Correct answer: answer = 2
97 Correct 6 ms 460 KB Correct answer: answer = 1824916
98 Correct 5 ms 460 KB Correct answer: answer = 10680029
99 Correct 6 ms 460 KB Correct answer: answer = 18351700
100 Correct 5 ms 460 KB Correct answer: answer = 16040026
101 Correct 2 ms 332 KB Correct answer: answer = 253968628325
102 Correct 3 ms 332 KB Correct answer: answer = 10267
103 Correct 6 ms 472 KB Correct answer: answer = 2582408
104 Correct 2 ms 332 KB Correct answer: answer = 78024964781
105 Correct 2 ms 332 KB Correct answer: answer = 9866346457
106 Correct 2 ms 332 KB Correct answer: answer = 3327720949
107 Correct 2 ms 332 KB Correct answer: answer = 86064128360
108 Correct 3 ms 332 KB Correct answer: answer = 12698259150
109 Correct 6 ms 464 KB Correct answer: answer = 1185259288
# Verdict Execution time Memory Grader output
1 Correct 1 ms 204 KB Correct answer: answer = 4
2 Correct 0 ms 204 KB Correct answer: answer = 4
3 Correct 0 ms 204 KB Correct answer: answer = 4
4 Correct 1 ms 204 KB Correct answer: answer = 12
5 Correct 1 ms 204 KB Correct answer: answer = 52
6 Correct 1 ms 204 KB Correct answer: answer = 210
7 Correct 1 ms 204 KB Correct answer: answer = 88
8 Correct 1 ms 204 KB Correct answer: answer = 7696
9 Correct 1 ms 204 KB Correct answer: answer = 1
10 Correct 1 ms 204 KB Correct answer: answer = 2374
11 Correct 1 ms 204 KB Correct answer: answer = 9502
12 Correct 1 ms 204 KB Correct answer: answer = 49
13 Correct 1 ms 204 KB Correct answer: answer = 151
14 Correct 1 ms 204 KB Correct answer: answer = 7550
15 Correct 1 ms 204 KB Correct answer: answer = 7220
16 Correct 1 ms 204 KB Correct answer: answer = 7550
17 Correct 1 ms 204 KB Correct answer: answer = 10000
18 Correct 0 ms 204 KB Correct answer: answer = 10000
19 Correct 1 ms 204 KB Correct answer: answer = 624
20 Correct 1 ms 204 KB Correct answer: answer = 10000
21 Correct 0 ms 204 KB Correct answer: answer = 1
22 Correct 1 ms 204 KB Correct answer: answer = 4
23 Correct 1 ms 204 KB Correct answer: answer = 1
24 Correct 1 ms 204 KB Correct answer: answer = 5
25 Correct 0 ms 204 KB Correct answer: answer = 41
26 Correct 1 ms 204 KB Correct answer: answer = 71923
27 Correct 1 ms 204 KB Correct answer: answer = 77137
28 Correct 1 ms 332 KB Correct answer: answer = 764
29 Correct 1 ms 332 KB Correct answer: answer = 250000
30 Correct 1 ms 332 KB Correct answer: answer = 500
31 Correct 1 ms 204 KB Correct answer: answer = 32
32 Correct 2 ms 204 KB Correct answer: answer = 130050
33 Correct 2 ms 332 KB Correct answer: answer = 5110
34 Correct 1 ms 204 KB Correct answer: answer = 2626
35 Correct 1 ms 204 KB Correct answer: answer = 796
36 Correct 1 ms 332 KB Correct answer: answer = 7580
37 Correct 1 ms 332 KB Correct answer: answer = 1904
38 Correct 1 ms 332 KB Correct answer: answer = 996004
39 Correct 1 ms 204 KB Correct answer: answer = 38817
40 Correct 1 ms 332 KB Correct answer: answer = 4096
41 Correct 1 ms 204 KB Correct answer: answer = 1
42 Correct 1 ms 204 KB Correct answer: answer = 1
43 Correct 1 ms 332 KB Correct answer: answer = 2040
44 Correct 1 ms 204 KB Correct answer: answer = 2
45 Correct 1 ms 204 KB Correct answer: answer = 4
46 Correct 1 ms 204 KB Correct answer: answer = 9
47 Correct 1 ms 204 KB Correct answer: answer = 9
48 Correct 1 ms 204 KB Correct answer: answer = 21
49 Correct 1 ms 204 KB Correct answer: answer = 71
50 Correct 1 ms 204 KB Correct answer: answer = 77
51 Correct 1 ms 204 KB Correct answer: answer = 400
52 Correct 1 ms 204 KB Correct answer: answer = 996004
53 Correct 1 ms 204 KB Correct answer: answer = 997310
54 Correct 1 ms 204 KB Correct answer: answer = 990781
55 Correct 1 ms 204 KB Correct answer: answer = 996545
56 Correct 1 ms 204 KB Correct answer: answer = 484
57 Correct 1 ms 204 KB Correct answer: answer = 484
58 Correct 1 ms 204 KB Correct answer: answer = 63501
59 Correct 1 ms 332 KB Correct answer: answer = 323501
60 Correct 1 ms 332 KB Correct answer: answer = 752500
61 Correct 1 ms 204 KB Correct answer: answer = 761480
62 Correct 1 ms 204 KB Correct answer: answer = 758932
63 Correct 1 ms 204 KB Correct answer: answer = 1000000
64 Correct 1 ms 332 KB Correct answer: answer = 750500
65 Correct 1 ms 204 KB Correct answer: answer = 1000000
66 Correct 1 ms 204 KB Correct answer: answer = 250000
67 Correct 1 ms 204 KB Correct answer: answer = 250000
68 Correct 1 ms 204 KB Correct answer: answer = 1000000
69 Correct 1 ms 320 KB Correct answer: answer = 994009
70 Correct 1 ms 204 KB Correct answer: answer = 59315
71 Correct 1 ms 204 KB Correct answer: answer = 25454
72 Correct 1 ms 204 KB Correct answer: answer = 1504
73 Correct 1 ms 204 KB Correct answer: answer = 37486
74 Correct 1 ms 204 KB Correct answer: answer = 4284
75 Correct 1 ms 236 KB Correct answer: answer = 158008
76 Correct 1 ms 204 KB Correct answer: answer = 51860
77 Correct 1 ms 204 KB Correct answer: answer = 12985
78 Correct 2 ms 332 KB Correct answer: answer = 997864126212
79 Correct 2 ms 332 KB Correct answer: answer = 998608411647
80 Correct 2 ms 332 KB Correct answer: answer = 995265560477
81 Correct 5 ms 460 KB Correct answer: answer = 10125000
82 Correct 6 ms 456 KB Correct answer: answer = 2291668
83 Correct 3 ms 332 KB Correct answer: answer = 42388
84 Correct 3 ms 428 KB Correct answer: answer = 10318
85 Correct 3 ms 332 KB Correct answer: answer = 3416
86 Correct 6 ms 460 KB Correct answer: answer = 331708193881
87 Correct 6 ms 476 KB Correct answer: answer = 2861193756
88 Correct 7 ms 460 KB Correct answer: answer = 114646930
89 Correct 5 ms 460 KB Correct answer: answer = 9280921
90 Correct 5 ms 460 KB Correct answer: answer = 999984053400
91 Correct 6 ms 508 KB Correct answer: answer = 750935949134
92 Correct 2 ms 332 KB Correct answer: answer = 1000000000000
93 Correct 2 ms 332 KB Correct answer: answer = 998762383161
94 Correct 6 ms 460 KB Correct answer: answer = 23017412908
95 Correct 3 ms 332 KB Correct answer: answer = 728143410622
96 Correct 2 ms 332 KB Correct answer: answer = 2
97 Correct 6 ms 460 KB Correct answer: answer = 1824916
98 Correct 5 ms 460 KB Correct answer: answer = 10680029
99 Correct 6 ms 460 KB Correct answer: answer = 18351700
100 Correct 5 ms 460 KB Correct answer: answer = 16040026
101 Correct 2 ms 332 KB Correct answer: answer = 253968628325
102 Correct 3 ms 332 KB Correct answer: answer = 10267
103 Correct 6 ms 472 KB Correct answer: answer = 2582408
104 Correct 2 ms 332 KB Correct answer: answer = 78024964781
105 Correct 2 ms 332 KB Correct answer: answer = 9866346457
106 Correct 2 ms 332 KB Correct answer: answer = 3327720949
107 Correct 2 ms 332 KB Correct answer: answer = 86064128360
108 Correct 3 ms 332 KB Correct answer: answer = 12698259150
109 Correct 6 ms 464 KB Correct answer: answer = 1185259288
110 Correct 23 ms 1464 KB Correct answer: answer = 999889968863
111 Correct 18 ms 1472 KB Correct answer: answer = 999861384931
112 Correct 19 ms 1488 KB Correct answer: answer = 999811809929
113 Correct 19 ms 1484 KB Correct answer: answer = 999869756441
114 Correct 61 ms 2628 KB Correct answer: answer = 1700000000
115 Correct 72 ms 3196 KB Correct answer: answer = 131666670
116 Correct 20 ms 1184 KB Correct answer: answer = 89478486
117 Correct 20 ms 1288 KB Correct answer: answer = 4971040
118 Correct 23 ms 1220 KB Correct answer: answer = 2711494
119 Correct 71 ms 3288 KB Correct answer: answer = 25252530
120 Correct 59 ms 3256 KB Correct answer: answer = 62500000
121 Correct 74 ms 2240 KB Correct answer: answer = 333175097780
122 Correct 68 ms 2256 KB Correct answer: answer = 33121180179
123 Correct 69 ms 2256 KB Correct answer: answer = 9802314015
124 Correct 62 ms 3268 KB Correct answer: answer = 32567551
125 Correct 76 ms 3384 KB Correct answer: answer = 997525000000
126 Correct 68 ms 2124 KB Correct answer: answer = 752723538884
127 Correct 14 ms 1464 KB Correct answer: answer = 1000000000000
128 Correct 17 ms 1468 KB Correct answer: answer = 999978000121
129 Correct 18 ms 1460 KB Correct answer: answer = 745986144735
130 Correct 12 ms 1492 KB Correct answer: answer = 2
131 Correct 63 ms 3136 KB Correct answer: answer = 277966670
132 Correct 72 ms 2756 KB Correct answer: answer = 2500900082
133 Correct 24 ms 1484 KB Correct answer: answer = 301248349636
134 Correct 36 ms 1468 KB Correct answer: answer = 14118891
135 Correct 20 ms 1484 KB Correct answer: answer = 14384977265
136 Correct 22 ms 1484 KB Correct answer: answer = 3681368330
137 Correct 19 ms 1484 KB Correct answer: answer = 2720316816
# Verdict Execution time Memory Grader output
1 Correct 1 ms 204 KB Correct answer: answer = 4
2 Correct 0 ms 204 KB Correct answer: answer = 4
3 Correct 0 ms 204 KB Correct answer: answer = 4
4 Correct 1 ms 204 KB Correct answer: answer = 12
5 Correct 1 ms 204 KB Correct answer: answer = 52
6 Correct 1 ms 204 KB Correct answer: answer = 210
7 Correct 1 ms 204 KB Correct answer: answer = 88
8 Correct 1 ms 204 KB Correct answer: answer = 7696
9 Correct 1 ms 204 KB Correct answer: answer = 1
10 Correct 1 ms 204 KB Correct answer: answer = 2374
11 Correct 1 ms 204 KB Correct answer: answer = 9502
12 Correct 1 ms 204 KB Correct answer: answer = 49
13 Correct 1 ms 204 KB Correct answer: answer = 151
14 Correct 1 ms 204 KB Correct answer: answer = 7550
15 Correct 1 ms 204 KB Correct answer: answer = 7220
16 Correct 1 ms 204 KB Correct answer: answer = 7550
17 Correct 1 ms 204 KB Correct answer: answer = 10000
18 Correct 0 ms 204 KB Correct answer: answer = 10000
19 Correct 1 ms 204 KB Correct answer: answer = 624
20 Correct 1 ms 204 KB Correct answer: answer = 10000
21 Correct 0 ms 204 KB Correct answer: answer = 1
22 Correct 1 ms 204 KB Correct answer: answer = 4
23 Correct 1 ms 204 KB Correct answer: answer = 1
24 Correct 1 ms 204 KB Correct answer: answer = 5
25 Correct 0 ms 204 KB Correct answer: answer = 41
26 Correct 1 ms 204 KB Correct answer: answer = 71923
27 Correct 1 ms 204 KB Correct answer: answer = 77137
28 Correct 1 ms 332 KB Correct answer: answer = 764
29 Correct 1 ms 332 KB Correct answer: answer = 250000
30 Correct 1 ms 332 KB Correct answer: answer = 500
31 Correct 1 ms 204 KB Correct answer: answer = 32
32 Correct 2 ms 204 KB Correct answer: answer = 130050
33 Correct 2 ms 332 KB Correct answer: answer = 5110
34 Correct 1 ms 204 KB Correct answer: answer = 2626
35 Correct 1 ms 204 KB Correct answer: answer = 796
36 Correct 1 ms 332 KB Correct answer: answer = 7580
37 Correct 1 ms 332 KB Correct answer: answer = 1904
38 Correct 1 ms 332 KB Correct answer: answer = 996004
39 Correct 1 ms 204 KB Correct answer: answer = 38817
40 Correct 1 ms 332 KB Correct answer: answer = 4096
41 Correct 1 ms 204 KB Correct answer: answer = 1
42 Correct 1 ms 204 KB Correct answer: answer = 1
43 Correct 1 ms 332 KB Correct answer: answer = 2040
44 Correct 1 ms 204 KB Correct answer: answer = 2
45 Correct 1 ms 204 KB Correct answer: answer = 4
46 Correct 1 ms 204 KB Correct answer: answer = 9
47 Correct 1 ms 204 KB Correct answer: answer = 9
48 Correct 1 ms 204 KB Correct answer: answer = 21
49 Correct 1 ms 204 KB Correct answer: answer = 71
50 Correct 1 ms 204 KB Correct answer: answer = 77
51 Correct 1 ms 204 KB Correct answer: answer = 400
52 Correct 1 ms 204 KB Correct answer: answer = 996004
53 Correct 1 ms 204 KB Correct answer: answer = 997310
54 Correct 1 ms 204 KB Correct answer: answer = 990781
55 Correct 1 ms 204 KB Correct answer: answer = 996545
56 Correct 1 ms 204 KB Correct answer: answer = 484
57 Correct 1 ms 204 KB Correct answer: answer = 484
58 Correct 1 ms 204 KB Correct answer: answer = 63501
59 Correct 1 ms 332 KB Correct answer: answer = 323501
60 Correct 1 ms 332 KB Correct answer: answer = 752500
61 Correct 1 ms 204 KB Correct answer: answer = 761480
62 Correct 1 ms 204 KB Correct answer: answer = 758932
63 Correct 1 ms 204 KB Correct answer: answer = 1000000
64 Correct 1 ms 332 KB Correct answer: answer = 750500
65 Correct 1 ms 204 KB Correct answer: answer = 1000000
66 Correct 1 ms 204 KB Correct answer: answer = 250000
67 Correct 1 ms 204 KB Correct answer: answer = 250000
68 Correct 1 ms 204 KB Correct answer: answer = 1000000
69 Correct 1 ms 320 KB Correct answer: answer = 994009
70 Correct 1 ms 204 KB Correct answer: answer = 59315
71 Correct 1 ms 204 KB Correct answer: answer = 25454
72 Correct 1 ms 204 KB Correct answer: answer = 1504
73 Correct 1 ms 204 KB Correct answer: answer = 37486
74 Correct 1 ms 204 KB Correct answer: answer = 4284
75 Correct 1 ms 236 KB Correct answer: answer = 158008
76 Correct 1 ms 204 KB Correct answer: answer = 51860
77 Correct 1 ms 204 KB Correct answer: answer = 12985
78 Correct 2 ms 332 KB Correct answer: answer = 997864126212
79 Correct 2 ms 332 KB Correct answer: answer = 998608411647
80 Correct 2 ms 332 KB Correct answer: answer = 995265560477
81 Correct 5 ms 460 KB Correct answer: answer = 10125000
82 Correct 6 ms 456 KB Correct answer: answer = 2291668
83 Correct 3 ms 332 KB Correct answer: answer = 42388
84 Correct 3 ms 428 KB Correct answer: answer = 10318
85 Correct 3 ms 332 KB Correct answer: answer = 3416
86 Correct 6 ms 460 KB Correct answer: answer = 331708193881
87 Correct 6 ms 476 KB Correct answer: answer = 2861193756
88 Correct 7 ms 460 KB Correct answer: answer = 114646930
89 Correct 5 ms 460 KB Correct answer: answer = 9280921
90 Correct 5 ms 460 KB Correct answer: answer = 999984053400
91 Correct 6 ms 508 KB Correct answer: answer = 750935949134
92 Correct 2 ms 332 KB Correct answer: answer = 1000000000000
93 Correct 2 ms 332 KB Correct answer: answer = 998762383161
94 Correct 6 ms 460 KB Correct answer: answer = 23017412908
95 Correct 3 ms 332 KB Correct answer: answer = 728143410622
96 Correct 2 ms 332 KB Correct answer: answer = 2
97 Correct 6 ms 460 KB Correct answer: answer = 1824916
98 Correct 5 ms 460 KB Correct answer: answer = 10680029
99 Correct 6 ms 460 KB Correct answer: answer = 18351700
100 Correct 5 ms 460 KB Correct answer: answer = 16040026
101 Correct 2 ms 332 KB Correct answer: answer = 253968628325
102 Correct 3 ms 332 KB Correct answer: answer = 10267
103 Correct 6 ms 472 KB Correct answer: answer = 2582408
104 Correct 2 ms 332 KB Correct answer: answer = 78024964781
105 Correct 2 ms 332 KB Correct answer: answer = 9866346457
106 Correct 2 ms 332 KB Correct answer: answer = 3327720949
107 Correct 2 ms 332 KB Correct answer: answer = 86064128360
108 Correct 3 ms 332 KB Correct answer: answer = 12698259150
109 Correct 6 ms 464 KB Correct answer: answer = 1185259288
110 Correct 23 ms 1464 KB Correct answer: answer = 999889968863
111 Correct 18 ms 1472 KB Correct answer: answer = 999861384931
112 Correct 19 ms 1488 KB Correct answer: answer = 999811809929
113 Correct 19 ms 1484 KB Correct answer: answer = 999869756441
114 Correct 61 ms 2628 KB Correct answer: answer = 1700000000
115 Correct 72 ms 3196 KB Correct answer: answer = 131666670
116 Correct 20 ms 1184 KB Correct answer: answer = 89478486
117 Correct 20 ms 1288 KB Correct answer: answer = 4971040
118 Correct 23 ms 1220 KB Correct answer: answer = 2711494
119 Correct 71 ms 3288 KB Correct answer: answer = 25252530
120 Correct 59 ms 3256 KB Correct answer: answer = 62500000
121 Correct 74 ms 2240 KB Correct answer: answer = 333175097780
122 Correct 68 ms 2256 KB Correct answer: answer = 33121180179
123 Correct 69 ms 2256 KB Correct answer: answer = 9802314015
124 Correct 62 ms 3268 KB Correct answer: answer = 32567551
125 Correct 76 ms 3384 KB Correct answer: answer = 997525000000
126 Correct 68 ms 2124 KB Correct answer: answer = 752723538884
127 Correct 14 ms 1464 KB Correct answer: answer = 1000000000000
128 Correct 17 ms 1468 KB Correct answer: answer = 999978000121
129 Correct 18 ms 1460 KB Correct answer: answer = 745986144735
130 Correct 12 ms 1492 KB Correct answer: answer = 2
131 Correct 63 ms 3136 KB Correct answer: answer = 277966670
132 Correct 72 ms 2756 KB Correct answer: answer = 2500900082
133 Correct 24 ms 1484 KB Correct answer: answer = 301248349636
134 Correct 36 ms 1468 KB Correct answer: answer = 14118891
135 Correct 20 ms 1484 KB Correct answer: answer = 14384977265
136 Correct 22 ms 1484 KB Correct answer: answer = 3681368330
137 Correct 19 ms 1484 KB Correct answer: answer = 2720316816
138 Correct 39 ms 2628 KB Correct answer: answer = 999976000144
139 Correct 47 ms 2608 KB Correct answer: answer = 999856102410
140 Correct 37 ms 2632 KB Correct answer: answer = 999958401531
141 Correct 37 ms 2624 KB Correct answer: answer = 999769649944
142 Correct 36 ms 2656 KB Correct answer: answer = 999874525918
143 Correct 126 ms 5264 KB Correct answer: answer = 6050000000
144 Correct 124 ms 5820 KB Correct answer: answer = 1112500000
145 Correct 89 ms 3640 KB Correct answer: answer = 4294967296
146 Correct 81 ms 4276 KB Correct answer: answer = 87652406
147 Correct 87 ms 4400 KB Correct answer: answer = 6297664
148 Correct 78 ms 4416 KB Correct answer: answer = 196612
149 Correct 144 ms 6524 KB Correct answer: answer = 15015100
150 Correct 132 ms 6500 KB Correct answer: answer = 25000000
151 Correct 136 ms 4028 KB Correct answer: answer = 333230209550
152 Correct 137 ms 4292 KB Correct answer: answer = 917123769
153 Correct 160 ms 6336 KB Correct answer: answer = 95162
154 Correct 123 ms 6344 KB Correct answer: answer = 382616191
155 Correct 124 ms 6524 KB Correct answer: answer = 990033333400
156 Correct 124 ms 6468 KB Correct answer: answer = 990000100000
157 Correct 125 ms 5316 KB Correct answer: answer = 749998188180
158 Correct 29 ms 2548 KB Correct answer: answer = 1000000000000
159 Correct 36 ms 2628 KB Correct answer: answer = 999988000036
160 Correct 35 ms 2620 KB Correct answer: answer = 744929274393
161 Correct 23 ms 2636 KB Correct answer: answer = 2
162 Correct 125 ms 6656 KB Correct answer: answer = 1300024
163 Correct 124 ms 5492 KB Correct answer: answer = 5000700010
164 Correct 47 ms 2764 KB Correct answer: answer = 354997100800
165 Correct 73 ms 3020 KB Correct answer: answer = 257000
166 Correct 67 ms 3416 KB Correct answer: answer = 3765323
167 Correct 68 ms 3400 KB Correct answer: answer = 1525903
168 Correct 43 ms 2632 KB Correct answer: answer = 67618137730
169 Correct 38 ms 2628 KB Correct answer: answer = 12656680171
170 Correct 52 ms 2652 KB Correct answer: answer = 579831736
171 Correct 66 ms 3396 KB Correct answer: answer = 23605611
172 Correct 49 ms 2752 KB Correct answer: answer = 7052481200
173 Correct 47 ms 3028 KB Correct answer: answer = 1314039500
174 Correct 55 ms 3384 KB Correct answer: answer = 302484000
175 Correct 92 ms 4024 KB Correct answer: answer = 52348480