Submission #23993

# Submission time Handle Problem Language Result Execution time Memory
23993 2017-05-28T18:00:55 Z gs14004 Aliens (IOI16_aliens) C++11
60 / 100
2000 ms 356976 KB
#include "aliens.h"
#include <bits/stdc++.h>
using namespace std;
typedef long long lint;
typedef pair<lint, lint> pi;

vector<pi> v;
vector<vector<lint>> dp;

struct cht{
    vector<pi> v;
    void clear(){ v.clear(); }
    long double cross(pi  a, pi b){
        return ((long double)(b.second - a.second) / (b.first - a.first));
    }
    void add_line(int x, lint y){
        while(v.size() >= 2 && cross(v[v.size()-2], v.back()) > cross(v.back(), pi(x, y))){
            v.pop_back();
        }
        v.push_back({x, y});
    }
    lint query(int x){
        int s = 0, e = v.size()-1;
        auto f = [&](int p){
            return v[p].first * x + v[p].second;
        };
        while(s != e){
            int m = (s+e)/2;
            if(f(m) <= f(m+1)) e = m;
            else s = m+1;
        }
        return f(s);
    }
}cht;

long long take_photos(int n, int m, int k, std::vector<int> r, std::vector<int> c) {
    vector<pi> w;
    for(int i=0; i<n; i++){
        if(r[i] > c[i]) swap(r[i], c[i]);
        w.push_back({r[i]-1, c[i]});
    }
    sort(w.begin(), w.end(), [&](const pi &a, const pi &b){
        return pi(a.first, -a.second) < pi(b.first, -b.second);
    });
    for(auto &i : w){
        if(v.empty() || v.back().second < i.second){
            v.push_back(i);
        }
    }
    dp.resize(k+1);
    for(auto &i : dp) i.resize(v.size() + 1);
    dp[0][0] = 0;
    for(int i=1; i<=v.size(); i++){
        dp[0][i] = 1e18;
    }
    for(int i=1; i<=k; i++){
        cht.clear();
        for(int j=1; j<=v.size(); j++){
            cht.add_line(2 * v[j-1].first, dp[i-1][j-1] + 1ll * v[j-1].first * v[j-1].first);
            dp[i][j] = cht.query(-v[j-1].second) + 1ll * v[j-1].second * v[j-1].second;
            if(j != v.size()){
                lint cost = max(0ll, v[j-1].second - v[j].first);
                dp[i][j] -= cost * cost;
            }
        }
    }
    return dp[k][v.size()];
}

Compilation message

aliens.cpp: In function 'long long int take_photos(int, int, int, std::vector<int>, std::vector<int>)':
aliens.cpp:53:19: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
     for(int i=1; i<=v.size(); i++){
                   ^
aliens.cpp:58:23: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
         for(int j=1; j<=v.size(); j++){
                       ^
aliens.cpp:61:18: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
             if(j != v.size()){
                  ^
# Verdict Execution time Memory Grader output
1 Correct 0 ms 2028 KB Correct answer: answer = 4
2 Correct 0 ms 2028 KB Correct answer: answer = 4
3 Correct 0 ms 2028 KB Correct answer: answer = 4
4 Correct 0 ms 2028 KB Correct answer: answer = 12
5 Correct 0 ms 2028 KB Correct answer: answer = 52
6 Correct 0 ms 2028 KB Correct answer: answer = 210
7 Correct 0 ms 2028 KB Correct answer: answer = 88
8 Correct 0 ms 2028 KB Correct answer: answer = 7696
9 Correct 0 ms 2028 KB Correct answer: answer = 1
10 Correct 0 ms 2028 KB Correct answer: answer = 2374
11 Correct 0 ms 2028 KB Correct answer: answer = 9502
12 Correct 0 ms 2028 KB Correct answer: answer = 49
13 Correct 0 ms 2028 KB Correct answer: answer = 151
14 Correct 0 ms 2028 KB Correct answer: answer = 7550
15 Correct 0 ms 2028 KB Correct answer: answer = 7220
16 Correct 0 ms 2028 KB Correct answer: answer = 7550
17 Correct 0 ms 2028 KB Correct answer: answer = 10000
18 Correct 0 ms 2028 KB Correct answer: answer = 10000
19 Correct 0 ms 2028 KB Correct answer: answer = 624
20 Correct 0 ms 2028 KB Correct answer: answer = 10000
# Verdict Execution time Memory Grader output
1 Correct 0 ms 2028 KB Correct answer: answer = 1
2 Correct 0 ms 2028 KB Correct answer: answer = 4
3 Correct 0 ms 2028 KB Correct answer: answer = 1
4 Correct 0 ms 2028 KB Correct answer: answer = 5
5 Correct 0 ms 2028 KB Correct answer: answer = 41
6 Correct 0 ms 2028 KB Correct answer: answer = 71923
7 Correct 0 ms 2028 KB Correct answer: answer = 77137
8 Correct 3 ms 2820 KB Correct answer: answer = 764
9 Correct 0 ms 2028 KB Correct answer: answer = 250000
10 Correct 9 ms 4008 KB Correct answer: answer = 500
11 Correct 0 ms 2028 KB Correct answer: answer = 32
12 Correct 0 ms 2028 KB Correct answer: answer = 130050
13 Correct 0 ms 2292 KB Correct answer: answer = 5110
14 Correct 0 ms 2160 KB Correct answer: answer = 2626
15 Correct 0 ms 2292 KB Correct answer: answer = 796
16 Correct 0 ms 2160 KB Correct answer: answer = 7580
17 Correct 3 ms 2556 KB Correct answer: answer = 1904
18 Correct 0 ms 2028 KB Correct answer: answer = 996004
19 Correct 0 ms 2160 KB Correct answer: answer = 38817
20 Correct 0 ms 2424 KB Correct answer: answer = 4096
21 Correct 0 ms 2028 KB Correct answer: answer = 1
22 Correct 0 ms 2028 KB Correct answer: answer = 1
23 Correct 3 ms 2556 KB Correct answer: answer = 2040
24 Correct 0 ms 2028 KB Correct answer: answer = 2
# Verdict Execution time Memory Grader output
1 Correct 0 ms 2028 KB Correct answer: answer = 4
2 Correct 0 ms 2028 KB Correct answer: answer = 4
3 Correct 0 ms 2028 KB Correct answer: answer = 4
4 Correct 0 ms 2028 KB Correct answer: answer = 12
5 Correct 0 ms 2028 KB Correct answer: answer = 52
6 Correct 0 ms 2028 KB Correct answer: answer = 210
7 Correct 0 ms 2028 KB Correct answer: answer = 88
8 Correct 0 ms 2028 KB Correct answer: answer = 7696
9 Correct 0 ms 2028 KB Correct answer: answer = 1
10 Correct 0 ms 2028 KB Correct answer: answer = 2374
11 Correct 0 ms 2028 KB Correct answer: answer = 9502
12 Correct 0 ms 2028 KB Correct answer: answer = 49
13 Correct 0 ms 2028 KB Correct answer: answer = 151
14 Correct 0 ms 2028 KB Correct answer: answer = 7550
15 Correct 0 ms 2028 KB Correct answer: answer = 7220
16 Correct 0 ms 2028 KB Correct answer: answer = 7550
17 Correct 0 ms 2028 KB Correct answer: answer = 10000
18 Correct 0 ms 2028 KB Correct answer: answer = 10000
19 Correct 0 ms 2028 KB Correct answer: answer = 624
20 Correct 0 ms 2028 KB Correct answer: answer = 10000
21 Correct 0 ms 2028 KB Correct answer: answer = 1
22 Correct 0 ms 2028 KB Correct answer: answer = 4
23 Correct 0 ms 2028 KB Correct answer: answer = 1
24 Correct 0 ms 2028 KB Correct answer: answer = 5
25 Correct 0 ms 2028 KB Correct answer: answer = 41
26 Correct 0 ms 2028 KB Correct answer: answer = 71923
27 Correct 0 ms 2028 KB Correct answer: answer = 77137
28 Correct 3 ms 2820 KB Correct answer: answer = 764
29 Correct 0 ms 2028 KB Correct answer: answer = 250000
30 Correct 9 ms 4008 KB Correct answer: answer = 500
31 Correct 0 ms 2028 KB Correct answer: answer = 32
32 Correct 0 ms 2028 KB Correct answer: answer = 130050
33 Correct 0 ms 2292 KB Correct answer: answer = 5110
34 Correct 0 ms 2160 KB Correct answer: answer = 2626
35 Correct 0 ms 2292 KB Correct answer: answer = 796
36 Correct 0 ms 2160 KB Correct answer: answer = 7580
37 Correct 3 ms 2556 KB Correct answer: answer = 1904
38 Correct 0 ms 2028 KB Correct answer: answer = 996004
39 Correct 0 ms 2160 KB Correct answer: answer = 38817
40 Correct 0 ms 2424 KB Correct answer: answer = 4096
41 Correct 0 ms 2028 KB Correct answer: answer = 1
42 Correct 0 ms 2028 KB Correct answer: answer = 1
43 Correct 3 ms 2556 KB Correct answer: answer = 2040
44 Correct 0 ms 2028 KB Correct answer: answer = 2
45 Correct 0 ms 2028 KB Correct answer: answer = 4
46 Correct 0 ms 2028 KB Correct answer: answer = 9
47 Correct 0 ms 2028 KB Correct answer: answer = 9
48 Correct 0 ms 2028 KB Correct answer: answer = 21
49 Correct 0 ms 2028 KB Correct answer: answer = 71
50 Correct 0 ms 2028 KB Correct answer: answer = 77
51 Correct 0 ms 2028 KB Correct answer: answer = 400
52 Correct 0 ms 2028 KB Correct answer: answer = 996004
53 Correct 0 ms 2028 KB Correct answer: answer = 997310
54 Correct 0 ms 2028 KB Correct answer: answer = 990781
55 Correct 0 ms 2028 KB Correct answer: answer = 996545
56 Correct 0 ms 2028 KB Correct answer: answer = 484
57 Correct 0 ms 2028 KB Correct answer: answer = 484
58 Correct 0 ms 2164 KB Correct answer: answer = 63501
59 Correct 0 ms 2160 KB Correct answer: answer = 323501
60 Correct 3 ms 2424 KB Correct answer: answer = 752500
61 Correct 0 ms 2160 KB Correct answer: answer = 761480
62 Correct 3 ms 2424 KB Correct answer: answer = 758932
63 Correct 0 ms 2028 KB Correct answer: answer = 1000000
64 Correct 9 ms 4008 KB Correct answer: answer = 750500
65 Correct 0 ms 2028 KB Correct answer: answer = 1000000
66 Correct 0 ms 2028 KB Correct answer: answer = 250000
67 Correct 0 ms 2028 KB Correct answer: answer = 250000
68 Correct 0 ms 2028 KB Correct answer: answer = 1000000
69 Correct 0 ms 2028 KB Correct answer: answer = 994009
70 Correct 0 ms 2160 KB Correct answer: answer = 59315
71 Correct 0 ms 2160 KB Correct answer: answer = 25454
72 Correct 0 ms 2424 KB Correct answer: answer = 1504
73 Correct 0 ms 2028 KB Correct answer: answer = 37486
74 Correct 0 ms 2292 KB Correct answer: answer = 4284
75 Correct 0 ms 2160 KB Correct answer: answer = 158008
76 Correct 0 ms 2160 KB Correct answer: answer = 51860
77 Correct 0 ms 2028 KB Correct answer: answer = 12985
# Verdict Execution time Memory Grader output
1 Correct 0 ms 2028 KB Correct answer: answer = 4
2 Correct 0 ms 2028 KB Correct answer: answer = 4
3 Correct 0 ms 2028 KB Correct answer: answer = 4
4 Correct 0 ms 2028 KB Correct answer: answer = 12
5 Correct 0 ms 2028 KB Correct answer: answer = 52
6 Correct 0 ms 2028 KB Correct answer: answer = 210
7 Correct 0 ms 2028 KB Correct answer: answer = 88
8 Correct 0 ms 2028 KB Correct answer: answer = 7696
9 Correct 0 ms 2028 KB Correct answer: answer = 1
10 Correct 0 ms 2028 KB Correct answer: answer = 2374
11 Correct 0 ms 2028 KB Correct answer: answer = 9502
12 Correct 0 ms 2028 KB Correct answer: answer = 49
13 Correct 0 ms 2028 KB Correct answer: answer = 151
14 Correct 0 ms 2028 KB Correct answer: answer = 7550
15 Correct 0 ms 2028 KB Correct answer: answer = 7220
16 Correct 0 ms 2028 KB Correct answer: answer = 7550
17 Correct 0 ms 2028 KB Correct answer: answer = 10000
18 Correct 0 ms 2028 KB Correct answer: answer = 10000
19 Correct 0 ms 2028 KB Correct answer: answer = 624
20 Correct 0 ms 2028 KB Correct answer: answer = 10000
21 Correct 0 ms 2028 KB Correct answer: answer = 1
22 Correct 0 ms 2028 KB Correct answer: answer = 4
23 Correct 0 ms 2028 KB Correct answer: answer = 1
24 Correct 0 ms 2028 KB Correct answer: answer = 5
25 Correct 0 ms 2028 KB Correct answer: answer = 41
26 Correct 0 ms 2028 KB Correct answer: answer = 71923
27 Correct 0 ms 2028 KB Correct answer: answer = 77137
28 Correct 3 ms 2820 KB Correct answer: answer = 764
29 Correct 0 ms 2028 KB Correct answer: answer = 250000
30 Correct 9 ms 4008 KB Correct answer: answer = 500
31 Correct 0 ms 2028 KB Correct answer: answer = 32
32 Correct 0 ms 2028 KB Correct answer: answer = 130050
33 Correct 0 ms 2292 KB Correct answer: answer = 5110
34 Correct 0 ms 2160 KB Correct answer: answer = 2626
35 Correct 0 ms 2292 KB Correct answer: answer = 796
36 Correct 0 ms 2160 KB Correct answer: answer = 7580
37 Correct 3 ms 2556 KB Correct answer: answer = 1904
38 Correct 0 ms 2028 KB Correct answer: answer = 996004
39 Correct 0 ms 2160 KB Correct answer: answer = 38817
40 Correct 0 ms 2424 KB Correct answer: answer = 4096
41 Correct 0 ms 2028 KB Correct answer: answer = 1
42 Correct 0 ms 2028 KB Correct answer: answer = 1
43 Correct 3 ms 2556 KB Correct answer: answer = 2040
44 Correct 0 ms 2028 KB Correct answer: answer = 2
45 Correct 0 ms 2028 KB Correct answer: answer = 4
46 Correct 0 ms 2028 KB Correct answer: answer = 9
47 Correct 0 ms 2028 KB Correct answer: answer = 9
48 Correct 0 ms 2028 KB Correct answer: answer = 21
49 Correct 0 ms 2028 KB Correct answer: answer = 71
50 Correct 0 ms 2028 KB Correct answer: answer = 77
51 Correct 0 ms 2028 KB Correct answer: answer = 400
52 Correct 0 ms 2028 KB Correct answer: answer = 996004
53 Correct 0 ms 2028 KB Correct answer: answer = 997310
54 Correct 0 ms 2028 KB Correct answer: answer = 990781
55 Correct 0 ms 2028 KB Correct answer: answer = 996545
56 Correct 0 ms 2028 KB Correct answer: answer = 484
57 Correct 0 ms 2028 KB Correct answer: answer = 484
58 Correct 0 ms 2164 KB Correct answer: answer = 63501
59 Correct 0 ms 2160 KB Correct answer: answer = 323501
60 Correct 3 ms 2424 KB Correct answer: answer = 752500
61 Correct 0 ms 2160 KB Correct answer: answer = 761480
62 Correct 3 ms 2424 KB Correct answer: answer = 758932
63 Correct 0 ms 2028 KB Correct answer: answer = 1000000
64 Correct 9 ms 4008 KB Correct answer: answer = 750500
65 Correct 0 ms 2028 KB Correct answer: answer = 1000000
66 Correct 0 ms 2028 KB Correct answer: answer = 250000
67 Correct 0 ms 2028 KB Correct answer: answer = 250000
68 Correct 0 ms 2028 KB Correct answer: answer = 1000000
69 Correct 0 ms 2028 KB Correct answer: answer = 994009
70 Correct 0 ms 2160 KB Correct answer: answer = 59315
71 Correct 0 ms 2160 KB Correct answer: answer = 25454
72 Correct 0 ms 2424 KB Correct answer: answer = 1504
73 Correct 0 ms 2028 KB Correct answer: answer = 37486
74 Correct 0 ms 2292 KB Correct answer: answer = 4284
75 Correct 0 ms 2160 KB Correct answer: answer = 158008
76 Correct 0 ms 2160 KB Correct answer: answer = 51860
77 Correct 0 ms 2028 KB Correct answer: answer = 12985
78 Correct 3 ms 2168 KB Correct answer: answer = 997864126212
79 Correct 0 ms 2168 KB Correct answer: answer = 998608411647
80 Correct 3 ms 2628 KB Correct answer: answer = 995265560477
81 Correct 0 ms 2516 KB Correct answer: answer = 10125000
82 Correct 3 ms 2672 KB Correct answer: answer = 2291668
83 Correct 13 ms 3752 KB Correct answer: answer = 42388
84 Correct 43 ms 8756 KB Correct answer: answer = 10318
85 Correct 156 ms 24156 KB Correct answer: answer = 3416
86 Correct 3 ms 2360 KB Correct answer: answer = 331708193881
87 Correct 69 ms 9676 KB Correct answer: answer = 2861193756
88 Correct 383 ms 44036 KB Correct answer: answer = 114646930
89 Correct 16 ms 4056 KB Correct answer: answer = 9280921
90 Correct 73 ms 11740 KB Correct answer: answer = 999984053400
91 Correct 279 ms 33404 KB Correct answer: answer = 750935949134
92 Correct 0 ms 2168 KB Correct answer: answer = 1000000000000
93 Correct 0 ms 2388 KB Correct answer: answer = 998762383161
94 Correct 9 ms 3564 KB Correct answer: answer = 23017412908
95 Correct 3 ms 2828 KB Correct answer: answer = 728143410622
96 Correct 0 ms 2168 KB Correct answer: answer = 2
97 Correct 3 ms 2648 KB Correct answer: answer = 1824916
98 Correct 129 ms 18384 KB Correct answer: answer = 10680029
99 Correct 76 ms 10476 KB Correct answer: answer = 18351700
100 Correct 0 ms 2516 KB Correct answer: answer = 16040026
101 Correct 0 ms 2168 KB Correct answer: answer = 253968628325
102 Correct 126 ms 17944 KB Correct answer: answer = 10267
103 Correct 439 ms 57372 KB Correct answer: answer = 2582408
104 Correct 0 ms 2168 KB Correct answer: answer = 78024964781
105 Correct 0 ms 2168 KB Correct answer: answer = 9866346457
106 Correct 3 ms 2564 KB Correct answer: answer = 3327720949
107 Correct 23 ms 5864 KB Correct answer: answer = 86064128360
108 Correct 106 ms 19484 KB Correct answer: answer = 12698259150
109 Correct 473 ms 64648 KB Correct answer: answer = 1185259288
# Verdict Execution time Memory Grader output
1 Correct 0 ms 2028 KB Correct answer: answer = 4
2 Correct 0 ms 2028 KB Correct answer: answer = 4
3 Correct 0 ms 2028 KB Correct answer: answer = 4
4 Correct 0 ms 2028 KB Correct answer: answer = 12
5 Correct 0 ms 2028 KB Correct answer: answer = 52
6 Correct 0 ms 2028 KB Correct answer: answer = 210
7 Correct 0 ms 2028 KB Correct answer: answer = 88
8 Correct 0 ms 2028 KB Correct answer: answer = 7696
9 Correct 0 ms 2028 KB Correct answer: answer = 1
10 Correct 0 ms 2028 KB Correct answer: answer = 2374
11 Correct 0 ms 2028 KB Correct answer: answer = 9502
12 Correct 0 ms 2028 KB Correct answer: answer = 49
13 Correct 0 ms 2028 KB Correct answer: answer = 151
14 Correct 0 ms 2028 KB Correct answer: answer = 7550
15 Correct 0 ms 2028 KB Correct answer: answer = 7220
16 Correct 0 ms 2028 KB Correct answer: answer = 7550
17 Correct 0 ms 2028 KB Correct answer: answer = 10000
18 Correct 0 ms 2028 KB Correct answer: answer = 10000
19 Correct 0 ms 2028 KB Correct answer: answer = 624
20 Correct 0 ms 2028 KB Correct answer: answer = 10000
21 Correct 0 ms 2028 KB Correct answer: answer = 1
22 Correct 0 ms 2028 KB Correct answer: answer = 4
23 Correct 0 ms 2028 KB Correct answer: answer = 1
24 Correct 0 ms 2028 KB Correct answer: answer = 5
25 Correct 0 ms 2028 KB Correct answer: answer = 41
26 Correct 0 ms 2028 KB Correct answer: answer = 71923
27 Correct 0 ms 2028 KB Correct answer: answer = 77137
28 Correct 3 ms 2820 KB Correct answer: answer = 764
29 Correct 0 ms 2028 KB Correct answer: answer = 250000
30 Correct 9 ms 4008 KB Correct answer: answer = 500
31 Correct 0 ms 2028 KB Correct answer: answer = 32
32 Correct 0 ms 2028 KB Correct answer: answer = 130050
33 Correct 0 ms 2292 KB Correct answer: answer = 5110
34 Correct 0 ms 2160 KB Correct answer: answer = 2626
35 Correct 0 ms 2292 KB Correct answer: answer = 796
36 Correct 0 ms 2160 KB Correct answer: answer = 7580
37 Correct 3 ms 2556 KB Correct answer: answer = 1904
38 Correct 0 ms 2028 KB Correct answer: answer = 996004
39 Correct 0 ms 2160 KB Correct answer: answer = 38817
40 Correct 0 ms 2424 KB Correct answer: answer = 4096
41 Correct 0 ms 2028 KB Correct answer: answer = 1
42 Correct 0 ms 2028 KB Correct answer: answer = 1
43 Correct 3 ms 2556 KB Correct answer: answer = 2040
44 Correct 0 ms 2028 KB Correct answer: answer = 2
45 Correct 0 ms 2028 KB Correct answer: answer = 4
46 Correct 0 ms 2028 KB Correct answer: answer = 9
47 Correct 0 ms 2028 KB Correct answer: answer = 9
48 Correct 0 ms 2028 KB Correct answer: answer = 21
49 Correct 0 ms 2028 KB Correct answer: answer = 71
50 Correct 0 ms 2028 KB Correct answer: answer = 77
51 Correct 0 ms 2028 KB Correct answer: answer = 400
52 Correct 0 ms 2028 KB Correct answer: answer = 996004
53 Correct 0 ms 2028 KB Correct answer: answer = 997310
54 Correct 0 ms 2028 KB Correct answer: answer = 990781
55 Correct 0 ms 2028 KB Correct answer: answer = 996545
56 Correct 0 ms 2028 KB Correct answer: answer = 484
57 Correct 0 ms 2028 KB Correct answer: answer = 484
58 Correct 0 ms 2164 KB Correct answer: answer = 63501
59 Correct 0 ms 2160 KB Correct answer: answer = 323501
60 Correct 3 ms 2424 KB Correct answer: answer = 752500
61 Correct 0 ms 2160 KB Correct answer: answer = 761480
62 Correct 3 ms 2424 KB Correct answer: answer = 758932
63 Correct 0 ms 2028 KB Correct answer: answer = 1000000
64 Correct 9 ms 4008 KB Correct answer: answer = 750500
65 Correct 0 ms 2028 KB Correct answer: answer = 1000000
66 Correct 0 ms 2028 KB Correct answer: answer = 250000
67 Correct 0 ms 2028 KB Correct answer: answer = 250000
68 Correct 0 ms 2028 KB Correct answer: answer = 1000000
69 Correct 0 ms 2028 KB Correct answer: answer = 994009
70 Correct 0 ms 2160 KB Correct answer: answer = 59315
71 Correct 0 ms 2160 KB Correct answer: answer = 25454
72 Correct 0 ms 2424 KB Correct answer: answer = 1504
73 Correct 0 ms 2028 KB Correct answer: answer = 37486
74 Correct 0 ms 2292 KB Correct answer: answer = 4284
75 Correct 0 ms 2160 KB Correct answer: answer = 158008
76 Correct 0 ms 2160 KB Correct answer: answer = 51860
77 Correct 0 ms 2028 KB Correct answer: answer = 12985
78 Correct 3 ms 2168 KB Correct answer: answer = 997864126212
79 Correct 0 ms 2168 KB Correct answer: answer = 998608411647
80 Correct 3 ms 2628 KB Correct answer: answer = 995265560477
81 Correct 0 ms 2516 KB Correct answer: answer = 10125000
82 Correct 3 ms 2672 KB Correct answer: answer = 2291668
83 Correct 13 ms 3752 KB Correct answer: answer = 42388
84 Correct 43 ms 8756 KB Correct answer: answer = 10318
85 Correct 156 ms 24156 KB Correct answer: answer = 3416
86 Correct 3 ms 2360 KB Correct answer: answer = 331708193881
87 Correct 69 ms 9676 KB Correct answer: answer = 2861193756
88 Correct 383 ms 44036 KB Correct answer: answer = 114646930
89 Correct 16 ms 4056 KB Correct answer: answer = 9280921
90 Correct 73 ms 11740 KB Correct answer: answer = 999984053400
91 Correct 279 ms 33404 KB Correct answer: answer = 750935949134
92 Correct 0 ms 2168 KB Correct answer: answer = 1000000000000
93 Correct 0 ms 2388 KB Correct answer: answer = 998762383161
94 Correct 9 ms 3564 KB Correct answer: answer = 23017412908
95 Correct 3 ms 2828 KB Correct answer: answer = 728143410622
96 Correct 0 ms 2168 KB Correct answer: answer = 2
97 Correct 3 ms 2648 KB Correct answer: answer = 1824916
98 Correct 129 ms 18384 KB Correct answer: answer = 10680029
99 Correct 76 ms 10476 KB Correct answer: answer = 18351700
100 Correct 0 ms 2516 KB Correct answer: answer = 16040026
101 Correct 0 ms 2168 KB Correct answer: answer = 253968628325
102 Correct 126 ms 17944 KB Correct answer: answer = 10267
103 Correct 439 ms 57372 KB Correct answer: answer = 2582408
104 Correct 0 ms 2168 KB Correct answer: answer = 78024964781
105 Correct 0 ms 2168 KB Correct answer: answer = 9866346457
106 Correct 3 ms 2564 KB Correct answer: answer = 3327720949
107 Correct 23 ms 5864 KB Correct answer: answer = 86064128360
108 Correct 106 ms 19484 KB Correct answer: answer = 12698259150
109 Correct 473 ms 64648 KB Correct answer: answer = 1185259288
110 Correct 26 ms 4432 KB Correct answer: answer = 999889968863
111 Correct 19 ms 4432 KB Correct answer: answer = 999861384931
112 Correct 16 ms 4432 KB Correct answer: answer = 999811809929
113 Correct 19 ms 4432 KB Correct answer: answer = 999869756441
114 Correct 23 ms 8168 KB Correct answer: answer = 1700000000
115 Correct 103 ms 14808 KB Correct answer: answer = 131666670
116 Correct 9 ms 3908 KB Correct answer: answer = 89478486
117 Correct 56 ms 10440 KB Correct answer: answer = 4971040
118 Correct 103 ms 16200 KB Correct answer: answer = 2711494
119 Correct 346 ms 46064 KB Correct answer: answer = 25252530
120 Correct 163 ms 23012 KB Correct answer: answer = 62500000
121 Correct 29 ms 6468 KB Correct answer: answer = 333175097780
122 Correct 146 ms 16764 KB Correct answer: answer = 33121180179
123 Correct 409 ms 43460 KB Correct answer: answer = 9802314015
124 Correct 313 ms 37468 KB Correct answer: answer = 32567551
125 Correct 399 ms 46452 KB Correct answer: answer = 997525000000
126 Correct 359 ms 40780 KB Correct answer: answer = 752723538884
127 Correct 16 ms 4432 KB Correct answer: answer = 1000000000000
128 Correct 19 ms 4432 KB Correct answer: answer = 999978000121
129 Correct 16 ms 4432 KB Correct answer: answer = 745986144735
130 Correct 3 ms 4432 KB Correct answer: answer = 2
131 Correct 46 ms 11292 KB Correct answer: answer = 277966670
132 Correct 23 ms 8168 KB Correct answer: answer = 2500900082
133 Correct 16 ms 4432 KB Correct answer: answer = 301248349636
134 Correct 229 ms 23768 KB Correct answer: answer = 14118891
135 Correct 23 ms 4432 KB Correct answer: answer = 14384977265
136 Correct 19 ms 4432 KB Correct answer: answer = 3681368330
137 Correct 26 ms 4448 KB Correct answer: answer = 2720316816
# Verdict Execution time Memory Grader output
1 Correct 0 ms 2028 KB Correct answer: answer = 4
2 Correct 0 ms 2028 KB Correct answer: answer = 4
3 Correct 0 ms 2028 KB Correct answer: answer = 4
4 Correct 0 ms 2028 KB Correct answer: answer = 12
5 Correct 0 ms 2028 KB Correct answer: answer = 52
6 Correct 0 ms 2028 KB Correct answer: answer = 210
7 Correct 0 ms 2028 KB Correct answer: answer = 88
8 Correct 0 ms 2028 KB Correct answer: answer = 7696
9 Correct 0 ms 2028 KB Correct answer: answer = 1
10 Correct 0 ms 2028 KB Correct answer: answer = 2374
11 Correct 0 ms 2028 KB Correct answer: answer = 9502
12 Correct 0 ms 2028 KB Correct answer: answer = 49
13 Correct 0 ms 2028 KB Correct answer: answer = 151
14 Correct 0 ms 2028 KB Correct answer: answer = 7550
15 Correct 0 ms 2028 KB Correct answer: answer = 7220
16 Correct 0 ms 2028 KB Correct answer: answer = 7550
17 Correct 0 ms 2028 KB Correct answer: answer = 10000
18 Correct 0 ms 2028 KB Correct answer: answer = 10000
19 Correct 0 ms 2028 KB Correct answer: answer = 624
20 Correct 0 ms 2028 KB Correct answer: answer = 10000
21 Correct 0 ms 2028 KB Correct answer: answer = 1
22 Correct 0 ms 2028 KB Correct answer: answer = 4
23 Correct 0 ms 2028 KB Correct answer: answer = 1
24 Correct 0 ms 2028 KB Correct answer: answer = 5
25 Correct 0 ms 2028 KB Correct answer: answer = 41
26 Correct 0 ms 2028 KB Correct answer: answer = 71923
27 Correct 0 ms 2028 KB Correct answer: answer = 77137
28 Correct 3 ms 2820 KB Correct answer: answer = 764
29 Correct 0 ms 2028 KB Correct answer: answer = 250000
30 Correct 9 ms 4008 KB Correct answer: answer = 500
31 Correct 0 ms 2028 KB Correct answer: answer = 32
32 Correct 0 ms 2028 KB Correct answer: answer = 130050
33 Correct 0 ms 2292 KB Correct answer: answer = 5110
34 Correct 0 ms 2160 KB Correct answer: answer = 2626
35 Correct 0 ms 2292 KB Correct answer: answer = 796
36 Correct 0 ms 2160 KB Correct answer: answer = 7580
37 Correct 3 ms 2556 KB Correct answer: answer = 1904
38 Correct 0 ms 2028 KB Correct answer: answer = 996004
39 Correct 0 ms 2160 KB Correct answer: answer = 38817
40 Correct 0 ms 2424 KB Correct answer: answer = 4096
41 Correct 0 ms 2028 KB Correct answer: answer = 1
42 Correct 0 ms 2028 KB Correct answer: answer = 1
43 Correct 3 ms 2556 KB Correct answer: answer = 2040
44 Correct 0 ms 2028 KB Correct answer: answer = 2
45 Correct 0 ms 2028 KB Correct answer: answer = 4
46 Correct 0 ms 2028 KB Correct answer: answer = 9
47 Correct 0 ms 2028 KB Correct answer: answer = 9
48 Correct 0 ms 2028 KB Correct answer: answer = 21
49 Correct 0 ms 2028 KB Correct answer: answer = 71
50 Correct 0 ms 2028 KB Correct answer: answer = 77
51 Correct 0 ms 2028 KB Correct answer: answer = 400
52 Correct 0 ms 2028 KB Correct answer: answer = 996004
53 Correct 0 ms 2028 KB Correct answer: answer = 997310
54 Correct 0 ms 2028 KB Correct answer: answer = 990781
55 Correct 0 ms 2028 KB Correct answer: answer = 996545
56 Correct 0 ms 2028 KB Correct answer: answer = 484
57 Correct 0 ms 2028 KB Correct answer: answer = 484
58 Correct 0 ms 2164 KB Correct answer: answer = 63501
59 Correct 0 ms 2160 KB Correct answer: answer = 323501
60 Correct 3 ms 2424 KB Correct answer: answer = 752500
61 Correct 0 ms 2160 KB Correct answer: answer = 761480
62 Correct 3 ms 2424 KB Correct answer: answer = 758932
63 Correct 0 ms 2028 KB Correct answer: answer = 1000000
64 Correct 9 ms 4008 KB Correct answer: answer = 750500
65 Correct 0 ms 2028 KB Correct answer: answer = 1000000
66 Correct 0 ms 2028 KB Correct answer: answer = 250000
67 Correct 0 ms 2028 KB Correct answer: answer = 250000
68 Correct 0 ms 2028 KB Correct answer: answer = 1000000
69 Correct 0 ms 2028 KB Correct answer: answer = 994009
70 Correct 0 ms 2160 KB Correct answer: answer = 59315
71 Correct 0 ms 2160 KB Correct answer: answer = 25454
72 Correct 0 ms 2424 KB Correct answer: answer = 1504
73 Correct 0 ms 2028 KB Correct answer: answer = 37486
74 Correct 0 ms 2292 KB Correct answer: answer = 4284
75 Correct 0 ms 2160 KB Correct answer: answer = 158008
76 Correct 0 ms 2160 KB Correct answer: answer = 51860
77 Correct 0 ms 2028 KB Correct answer: answer = 12985
78 Correct 3 ms 2168 KB Correct answer: answer = 997864126212
79 Correct 0 ms 2168 KB Correct answer: answer = 998608411647
80 Correct 3 ms 2628 KB Correct answer: answer = 995265560477
81 Correct 0 ms 2516 KB Correct answer: answer = 10125000
82 Correct 3 ms 2672 KB Correct answer: answer = 2291668
83 Correct 13 ms 3752 KB Correct answer: answer = 42388
84 Correct 43 ms 8756 KB Correct answer: answer = 10318
85 Correct 156 ms 24156 KB Correct answer: answer = 3416
86 Correct 3 ms 2360 KB Correct answer: answer = 331708193881
87 Correct 69 ms 9676 KB Correct answer: answer = 2861193756
88 Correct 383 ms 44036 KB Correct answer: answer = 114646930
89 Correct 16 ms 4056 KB Correct answer: answer = 9280921
90 Correct 73 ms 11740 KB Correct answer: answer = 999984053400
91 Correct 279 ms 33404 KB Correct answer: answer = 750935949134
92 Correct 0 ms 2168 KB Correct answer: answer = 1000000000000
93 Correct 0 ms 2388 KB Correct answer: answer = 998762383161
94 Correct 9 ms 3564 KB Correct answer: answer = 23017412908
95 Correct 3 ms 2828 KB Correct answer: answer = 728143410622
96 Correct 0 ms 2168 KB Correct answer: answer = 2
97 Correct 3 ms 2648 KB Correct answer: answer = 1824916
98 Correct 129 ms 18384 KB Correct answer: answer = 10680029
99 Correct 76 ms 10476 KB Correct answer: answer = 18351700
100 Correct 0 ms 2516 KB Correct answer: answer = 16040026
101 Correct 0 ms 2168 KB Correct answer: answer = 253968628325
102 Correct 126 ms 17944 KB Correct answer: answer = 10267
103 Correct 439 ms 57372 KB Correct answer: answer = 2582408
104 Correct 0 ms 2168 KB Correct answer: answer = 78024964781
105 Correct 0 ms 2168 KB Correct answer: answer = 9866346457
106 Correct 3 ms 2564 KB Correct answer: answer = 3327720949
107 Correct 23 ms 5864 KB Correct answer: answer = 86064128360
108 Correct 106 ms 19484 KB Correct answer: answer = 12698259150
109 Correct 473 ms 64648 KB Correct answer: answer = 1185259288
110 Correct 26 ms 4432 KB Correct answer: answer = 999889968863
111 Correct 19 ms 4432 KB Correct answer: answer = 999861384931
112 Correct 16 ms 4432 KB Correct answer: answer = 999811809929
113 Correct 19 ms 4432 KB Correct answer: answer = 999869756441
114 Correct 23 ms 8168 KB Correct answer: answer = 1700000000
115 Correct 103 ms 14808 KB Correct answer: answer = 131666670
116 Correct 9 ms 3908 KB Correct answer: answer = 89478486
117 Correct 56 ms 10440 KB Correct answer: answer = 4971040
118 Correct 103 ms 16200 KB Correct answer: answer = 2711494
119 Correct 346 ms 46064 KB Correct answer: answer = 25252530
120 Correct 163 ms 23012 KB Correct answer: answer = 62500000
121 Correct 29 ms 6468 KB Correct answer: answer = 333175097780
122 Correct 146 ms 16764 KB Correct answer: answer = 33121180179
123 Correct 409 ms 43460 KB Correct answer: answer = 9802314015
124 Correct 313 ms 37468 KB Correct answer: answer = 32567551
125 Correct 399 ms 46452 KB Correct answer: answer = 997525000000
126 Correct 359 ms 40780 KB Correct answer: answer = 752723538884
127 Correct 16 ms 4432 KB Correct answer: answer = 1000000000000
128 Correct 19 ms 4432 KB Correct answer: answer = 999978000121
129 Correct 16 ms 4432 KB Correct answer: answer = 745986144735
130 Correct 3 ms 4432 KB Correct answer: answer = 2
131 Correct 46 ms 11292 KB Correct answer: answer = 277966670
132 Correct 23 ms 8168 KB Correct answer: answer = 2500900082
133 Correct 16 ms 4432 KB Correct answer: answer = 301248349636
134 Correct 229 ms 23768 KB Correct answer: answer = 14118891
135 Correct 23 ms 4432 KB Correct answer: answer = 14384977265
136 Correct 19 ms 4432 KB Correct answer: answer = 3681368330
137 Correct 26 ms 4448 KB Correct answer: answer = 2720316816
138 Correct 49 ms 6752 KB Correct answer: answer = 999976000144
139 Correct 46 ms 6752 KB Correct answer: answer = 999856102410
140 Correct 46 ms 6752 KB Correct answer: answer = 999958401531
141 Correct 53 ms 6752 KB Correct answer: answer = 999769649944
142 Correct 89 ms 13892 KB Correct answer: answer = 999874525918
143 Correct 69 ms 14220 KB Correct answer: answer = 6050000000
144 Correct 119 ms 19688 KB Correct answer: answer = 1112500000
145 Correct 19 ms 6224 KB Correct answer: answer = 4294967296
146 Correct 269 ms 32856 KB Correct answer: answer = 87652406
147 Execution timed out 2000 ms 356976 KB Execution timed out
148 Halted 0 ms 0 KB -