Submission #43852

# Submission time Handle Problem Language Result Execution time Memory
43852 2018-03-25T14:08:26 Z PowerOfNinjaGo Aliens (IOI16_aliens) C++14
25 / 100
531 ms 95024 KB
//Power Of Ninja Go
#include <bits/stdc++.h>
#ifdef atom
    #include "grader.cpp"
#else
    #include "aliens.h"
#endif
using namespace std;
typedef long long ll; typedef pair<int, int> ii;
#define X first
#define Y second
#define vi vector<int>
#define vii vector< ii >
#define pb push_back
struct line
{
    ll m, b;
    int k;
    line()
    {
        m = 0, b = 4e18; k = 0;
    }
    line(ll _m, ll _b, int _k)
    {
        m = _m; b = _b; k = _k;
    }
    ll f(int x){ return m*x+b; }
};
bool lessthan(line A, line B, int x)
{
    ll y1 = A.f(x), y2 = B.f(x);
    if(y1 != y2) return y1< y2;
    return A.k< B.k;
}
const int maxn = 1e5+5;
const int maxm = 1e6+5;
int n, m;
line st[4*maxm];
ll dp[maxn];
int opt[maxn];
void add(line t, int p = 1, int L = 0, int R = m-1)
{
    int M = (L+R)/2;
    bool lef = t.f(L) <= st[p].f(L);
    bool mid = t.f(M) <= st[p].f(M);
    if(mid) swap(t, st[p]);
    if(L == R) return;
    if(lef != mid) add(t, 2*p, L, M);
    else add(t, 2*p+1, M+1, R);
}
line ask(int x, int p = 1, int L = 0, int R = m-1)
{
    if(L == R) return st[p];
    int M = (L+R)/2;
    line h = st[p];
    line o;
    if(x<= M) o = ask(x, 2*p, L, M);
    else o = ask(x, 2*p+1, M+1, R);
    if(lessthan(h, o, x)) return h;
    return o;
}
vii vec, tmp;
vi r, c;
bool cmp(ii A, ii B)
{
    if(A.X != B.X) return A.X< B.X;
    return A.Y> B.Y;
}
pair<long long, int> trial(ll lambda)
{
    for(int i = 1; i< 4*maxm; i++) st[i] = line();
    add(line(-2LL*r[0], 1LL*r[0]*r[0]-2*r[0], 0));
    for(int i = 0; i< n; i++)
    {
        line res = ask(c[i]);
        //printf("use line %lld %lld\n", res.m, res.b);
        opt[i] = res.k+1;
        dp[i] = res.f(c[i])+1LL*c[i]*c[i]+2*c[i]+lambda+1;
        //printf("dp[%d] = %lld\n", i, dp[i]);
        //if(i+1< n) printf("push m = %lld b = %lld\n", -2LL*r[i+1], dp[i]+1LL*r[i+1]*r[i+1]-2*r[i+1]);
        if(i+1< n)
        {
            int mag = max(0, c[i]-r[i+1]+1);
            add(line(-2LL*r[i+1], dp[i]+1LL*r[i+1]*r[i+1]-2*r[i+1]-1LL*mag*mag, opt[i]));
        }
    }
    return make_pair(dp[n-1], opt[n-1]);
}
long long take_photos(int N, int M, int K, std::vector<int> R, std::vector<int> C)
{
    n = N; m = M;
    for(int i = 0; i< n; i++)
    {
        if(R[i]<= C[i]) vec.pb(ii(R[i], C[i]));
        else vec.pb(ii(C[i], R[i]));
    }
    tmp = vec;
    vec.clear();
    sort(tmp.begin(), tmp.end(), cmp);
    for(auto k : tmp)
    {
        if(vec.empty() || k.Y> vec.back().Y) vec.pb(k);
    }
    n = vec.size();
    for(int i = 0; i< n; i++) r.pb(vec[i].X), c.pb(vec[i].Y);
    //for(int i = 0; i< n; i++) printf("%d %d\n", r[i], c[i]);
    ll lo = 0, hi = m*m;
    while(lo< hi)
    {
        ll mid = (lo+hi)/2;
        auto res = trial(mid);
        //printf("%lld: (%lld %d)\n", mid, res.X, res.Y);
        if(res.Y<= K) hi = mid;
        else lo = mid+1;
    }
    //printf("0: %lld %d\n", trial(0).X, trial(0).Y);
    return trial(lo).X-1LL*K*lo;
}
# Verdict Execution time Memory Grader output
1 Correct 157 ms 94204 KB Correct answer: answer = 4
2 Correct 156 ms 94464 KB Correct answer: answer = 4
3 Correct 187 ms 94464 KB Correct answer: answer = 4
4 Correct 193 ms 94464 KB Correct answer: answer = 12
5 Correct 235 ms 94464 KB Correct answer: answer = 52
6 Correct 281 ms 94464 KB Correct answer: answer = 210
7 Correct 234 ms 94464 KB Correct answer: answer = 88
8 Correct 387 ms 94592 KB Correct answer: answer = 7696
9 Correct 109 ms 94592 KB Correct answer: answer = 1
10 Correct 344 ms 94624 KB Correct answer: answer = 2374
11 Correct 387 ms 94624 KB Correct answer: answer = 9502
12 Correct 220 ms 94624 KB Correct answer: answer = 49
13 Correct 342 ms 94624 KB Correct answer: answer = 151
14 Correct 379 ms 94624 KB Correct answer: answer = 7550
15 Correct 377 ms 94624 KB Correct answer: answer = 7220
16 Correct 388 ms 94624 KB Correct answer: answer = 7550
17 Correct 392 ms 94628 KB Correct answer: answer = 10000
18 Correct 391 ms 94628 KB Correct answer: answer = 10000
19 Correct 420 ms 94628 KB Correct answer: answer = 624
20 Correct 381 ms 94628 KB Correct answer: answer = 10000
# Verdict Execution time Memory Grader output
1 Correct 108 ms 94628 KB Correct answer: answer = 1
2 Correct 130 ms 94628 KB Correct answer: answer = 4
3 Correct 176 ms 94628 KB Correct answer: answer = 1
4 Correct 199 ms 94628 KB Correct answer: answer = 5
5 Correct 283 ms 94628 KB Correct answer: answer = 41
6 Correct 518 ms 94628 KB Correct answer: answer = 71923
7 Correct 509 ms 94628 KB Correct answer: answer = 77137
8 Correct 510 ms 94700 KB Correct answer: answer = 764
9 Correct 440 ms 94700 KB Correct answer: answer = 250000
10 Correct 472 ms 94736 KB Correct answer: answer = 500
11 Correct 234 ms 94736 KB Correct answer: answer = 32
12 Correct 460 ms 94736 KB Correct answer: answer = 130050
13 Correct 479 ms 94736 KB Correct answer: answer = 5110
14 Correct 431 ms 94736 KB Correct answer: answer = 2626
15 Correct 440 ms 94780 KB Correct answer: answer = 796
16 Correct 470 ms 94880 KB Correct answer: answer = 7580
17 Correct 477 ms 94880 KB Correct answer: answer = 1904
18 Correct 522 ms 94880 KB Correct answer: answer = 996004
19 Correct 505 ms 94880 KB Correct answer: answer = 38817
20 Correct 507 ms 94880 KB Correct answer: answer = 4096
21 Correct 109 ms 94880 KB Correct answer: answer = 1
22 Correct 508 ms 94880 KB Correct answer: answer = 1
23 Correct 462 ms 94880 KB Correct answer: answer = 2040
24 Correct 506 ms 94880 KB Correct answer: answer = 2
# Verdict Execution time Memory Grader output
1 Correct 157 ms 94204 KB Correct answer: answer = 4
2 Correct 156 ms 94464 KB Correct answer: answer = 4
3 Correct 187 ms 94464 KB Correct answer: answer = 4
4 Correct 193 ms 94464 KB Correct answer: answer = 12
5 Correct 235 ms 94464 KB Correct answer: answer = 52
6 Correct 281 ms 94464 KB Correct answer: answer = 210
7 Correct 234 ms 94464 KB Correct answer: answer = 88
8 Correct 387 ms 94592 KB Correct answer: answer = 7696
9 Correct 109 ms 94592 KB Correct answer: answer = 1
10 Correct 344 ms 94624 KB Correct answer: answer = 2374
11 Correct 387 ms 94624 KB Correct answer: answer = 9502
12 Correct 220 ms 94624 KB Correct answer: answer = 49
13 Correct 342 ms 94624 KB Correct answer: answer = 151
14 Correct 379 ms 94624 KB Correct answer: answer = 7550
15 Correct 377 ms 94624 KB Correct answer: answer = 7220
16 Correct 388 ms 94624 KB Correct answer: answer = 7550
17 Correct 392 ms 94628 KB Correct answer: answer = 10000
18 Correct 391 ms 94628 KB Correct answer: answer = 10000
19 Correct 420 ms 94628 KB Correct answer: answer = 624
20 Correct 381 ms 94628 KB Correct answer: answer = 10000
21 Correct 108 ms 94628 KB Correct answer: answer = 1
22 Correct 130 ms 94628 KB Correct answer: answer = 4
23 Correct 176 ms 94628 KB Correct answer: answer = 1
24 Correct 199 ms 94628 KB Correct answer: answer = 5
25 Correct 283 ms 94628 KB Correct answer: answer = 41
26 Correct 518 ms 94628 KB Correct answer: answer = 71923
27 Correct 509 ms 94628 KB Correct answer: answer = 77137
28 Correct 510 ms 94700 KB Correct answer: answer = 764
29 Correct 440 ms 94700 KB Correct answer: answer = 250000
30 Correct 472 ms 94736 KB Correct answer: answer = 500
31 Correct 234 ms 94736 KB Correct answer: answer = 32
32 Correct 460 ms 94736 KB Correct answer: answer = 130050
33 Correct 479 ms 94736 KB Correct answer: answer = 5110
34 Correct 431 ms 94736 KB Correct answer: answer = 2626
35 Correct 440 ms 94780 KB Correct answer: answer = 796
36 Correct 470 ms 94880 KB Correct answer: answer = 7580
37 Correct 477 ms 94880 KB Correct answer: answer = 1904
38 Correct 522 ms 94880 KB Correct answer: answer = 996004
39 Correct 505 ms 94880 KB Correct answer: answer = 38817
40 Correct 507 ms 94880 KB Correct answer: answer = 4096
41 Correct 109 ms 94880 KB Correct answer: answer = 1
42 Correct 508 ms 94880 KB Correct answer: answer = 1
43 Correct 462 ms 94880 KB Correct answer: answer = 2040
44 Correct 506 ms 94880 KB Correct answer: answer = 2
45 Correct 150 ms 94880 KB Correct answer: answer = 4
46 Correct 178 ms 94880 KB Correct answer: answer = 9
47 Correct 173 ms 94880 KB Correct answer: answer = 9
48 Correct 199 ms 94880 KB Correct answer: answer = 21
49 Correct 218 ms 94880 KB Correct answer: answer = 71
50 Correct 239 ms 94880 KB Correct answer: answer = 77
51 Correct 278 ms 94880 KB Correct answer: answer = 400
52 Correct 516 ms 94892 KB Correct answer: answer = 996004
53 Correct 517 ms 94896 KB Correct answer: answer = 997310
54 Correct 523 ms 94896 KB Correct answer: answer = 990781
55 Correct 512 ms 94896 KB Correct answer: answer = 996545
56 Correct 289 ms 94896 KB Correct answer: answer = 484
57 Correct 278 ms 94896 KB Correct answer: answer = 484
58 Correct 477 ms 94916 KB Correct answer: answer = 63501
59 Correct 504 ms 94920 KB Correct answer: answer = 323501
60 Correct 514 ms 94928 KB Correct answer: answer = 752500
61 Correct 523 ms 94928 KB Correct answer: answer = 761480
62 Correct 531 ms 94928 KB Correct answer: answer = 758932
63 Correct 513 ms 94928 KB Correct answer: answer = 1000000
64 Correct 524 ms 94940 KB Correct answer: answer = 750500
65 Correct 514 ms 94940 KB Correct answer: answer = 1000000
66 Correct 531 ms 94940 KB Correct answer: answer = 250000
67 Correct 506 ms 94940 KB Correct answer: answer = 250000
68 Correct 514 ms 94940 KB Correct answer: answer = 1000000
69 Correct 512 ms 94940 KB Correct answer: answer = 994009
70 Correct 500 ms 94940 KB Correct answer: answer = 59315
71 Correct 517 ms 94968 KB Correct answer: answer = 25454
72 Correct 450 ms 94972 KB Correct answer: answer = 1504
73 Correct 531 ms 94972 KB Correct answer: answer = 37486
74 Correct 527 ms 94972 KB Correct answer: answer = 4284
75 Correct 519 ms 94972 KB Correct answer: answer = 158008
76 Correct 526 ms 94972 KB Correct answer: answer = 51860
77 Correct 520 ms 94972 KB Correct answer: answer = 12985
# Verdict Execution time Memory Grader output
1 Correct 157 ms 94204 KB Correct answer: answer = 4
2 Correct 156 ms 94464 KB Correct answer: answer = 4
3 Correct 187 ms 94464 KB Correct answer: answer = 4
4 Correct 193 ms 94464 KB Correct answer: answer = 12
5 Correct 235 ms 94464 KB Correct answer: answer = 52
6 Correct 281 ms 94464 KB Correct answer: answer = 210
7 Correct 234 ms 94464 KB Correct answer: answer = 88
8 Correct 387 ms 94592 KB Correct answer: answer = 7696
9 Correct 109 ms 94592 KB Correct answer: answer = 1
10 Correct 344 ms 94624 KB Correct answer: answer = 2374
11 Correct 387 ms 94624 KB Correct answer: answer = 9502
12 Correct 220 ms 94624 KB Correct answer: answer = 49
13 Correct 342 ms 94624 KB Correct answer: answer = 151
14 Correct 379 ms 94624 KB Correct answer: answer = 7550
15 Correct 377 ms 94624 KB Correct answer: answer = 7220
16 Correct 388 ms 94624 KB Correct answer: answer = 7550
17 Correct 392 ms 94628 KB Correct answer: answer = 10000
18 Correct 391 ms 94628 KB Correct answer: answer = 10000
19 Correct 420 ms 94628 KB Correct answer: answer = 624
20 Correct 381 ms 94628 KB Correct answer: answer = 10000
21 Correct 108 ms 94628 KB Correct answer: answer = 1
22 Correct 130 ms 94628 KB Correct answer: answer = 4
23 Correct 176 ms 94628 KB Correct answer: answer = 1
24 Correct 199 ms 94628 KB Correct answer: answer = 5
25 Correct 283 ms 94628 KB Correct answer: answer = 41
26 Correct 518 ms 94628 KB Correct answer: answer = 71923
27 Correct 509 ms 94628 KB Correct answer: answer = 77137
28 Correct 510 ms 94700 KB Correct answer: answer = 764
29 Correct 440 ms 94700 KB Correct answer: answer = 250000
30 Correct 472 ms 94736 KB Correct answer: answer = 500
31 Correct 234 ms 94736 KB Correct answer: answer = 32
32 Correct 460 ms 94736 KB Correct answer: answer = 130050
33 Correct 479 ms 94736 KB Correct answer: answer = 5110
34 Correct 431 ms 94736 KB Correct answer: answer = 2626
35 Correct 440 ms 94780 KB Correct answer: answer = 796
36 Correct 470 ms 94880 KB Correct answer: answer = 7580
37 Correct 477 ms 94880 KB Correct answer: answer = 1904
38 Correct 522 ms 94880 KB Correct answer: answer = 996004
39 Correct 505 ms 94880 KB Correct answer: answer = 38817
40 Correct 507 ms 94880 KB Correct answer: answer = 4096
41 Correct 109 ms 94880 KB Correct answer: answer = 1
42 Correct 508 ms 94880 KB Correct answer: answer = 1
43 Correct 462 ms 94880 KB Correct answer: answer = 2040
44 Correct 506 ms 94880 KB Correct answer: answer = 2
45 Correct 150 ms 94880 KB Correct answer: answer = 4
46 Correct 178 ms 94880 KB Correct answer: answer = 9
47 Correct 173 ms 94880 KB Correct answer: answer = 9
48 Correct 199 ms 94880 KB Correct answer: answer = 21
49 Correct 218 ms 94880 KB Correct answer: answer = 71
50 Correct 239 ms 94880 KB Correct answer: answer = 77
51 Correct 278 ms 94880 KB Correct answer: answer = 400
52 Correct 516 ms 94892 KB Correct answer: answer = 996004
53 Correct 517 ms 94896 KB Correct answer: answer = 997310
54 Correct 523 ms 94896 KB Correct answer: answer = 990781
55 Correct 512 ms 94896 KB Correct answer: answer = 996545
56 Correct 289 ms 94896 KB Correct answer: answer = 484
57 Correct 278 ms 94896 KB Correct answer: answer = 484
58 Correct 477 ms 94916 KB Correct answer: answer = 63501
59 Correct 504 ms 94920 KB Correct answer: answer = 323501
60 Correct 514 ms 94928 KB Correct answer: answer = 752500
61 Correct 523 ms 94928 KB Correct answer: answer = 761480
62 Correct 531 ms 94928 KB Correct answer: answer = 758932
63 Correct 513 ms 94928 KB Correct answer: answer = 1000000
64 Correct 524 ms 94940 KB Correct answer: answer = 750500
65 Correct 514 ms 94940 KB Correct answer: answer = 1000000
66 Correct 531 ms 94940 KB Correct answer: answer = 250000
67 Correct 506 ms 94940 KB Correct answer: answer = 250000
68 Correct 514 ms 94940 KB Correct answer: answer = 1000000
69 Correct 512 ms 94940 KB Correct answer: answer = 994009
70 Correct 500 ms 94940 KB Correct answer: answer = 59315
71 Correct 517 ms 94968 KB Correct answer: answer = 25454
72 Correct 450 ms 94972 KB Correct answer: answer = 1504
73 Correct 531 ms 94972 KB Correct answer: answer = 37486
74 Correct 527 ms 94972 KB Correct answer: answer = 4284
75 Correct 519 ms 94972 KB Correct answer: answer = 158008
76 Correct 526 ms 94972 KB Correct answer: answer = 51860
77 Correct 520 ms 94972 KB Correct answer: answer = 12985
78 Incorrect 109 ms 95024 KB Wrong answer: output = 995163225163, expected = 997864126212
79 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 157 ms 94204 KB Correct answer: answer = 4
2 Correct 156 ms 94464 KB Correct answer: answer = 4
3 Correct 187 ms 94464 KB Correct answer: answer = 4
4 Correct 193 ms 94464 KB Correct answer: answer = 12
5 Correct 235 ms 94464 KB Correct answer: answer = 52
6 Correct 281 ms 94464 KB Correct answer: answer = 210
7 Correct 234 ms 94464 KB Correct answer: answer = 88
8 Correct 387 ms 94592 KB Correct answer: answer = 7696
9 Correct 109 ms 94592 KB Correct answer: answer = 1
10 Correct 344 ms 94624 KB Correct answer: answer = 2374
11 Correct 387 ms 94624 KB Correct answer: answer = 9502
12 Correct 220 ms 94624 KB Correct answer: answer = 49
13 Correct 342 ms 94624 KB Correct answer: answer = 151
14 Correct 379 ms 94624 KB Correct answer: answer = 7550
15 Correct 377 ms 94624 KB Correct answer: answer = 7220
16 Correct 388 ms 94624 KB Correct answer: answer = 7550
17 Correct 392 ms 94628 KB Correct answer: answer = 10000
18 Correct 391 ms 94628 KB Correct answer: answer = 10000
19 Correct 420 ms 94628 KB Correct answer: answer = 624
20 Correct 381 ms 94628 KB Correct answer: answer = 10000
21 Correct 108 ms 94628 KB Correct answer: answer = 1
22 Correct 130 ms 94628 KB Correct answer: answer = 4
23 Correct 176 ms 94628 KB Correct answer: answer = 1
24 Correct 199 ms 94628 KB Correct answer: answer = 5
25 Correct 283 ms 94628 KB Correct answer: answer = 41
26 Correct 518 ms 94628 KB Correct answer: answer = 71923
27 Correct 509 ms 94628 KB Correct answer: answer = 77137
28 Correct 510 ms 94700 KB Correct answer: answer = 764
29 Correct 440 ms 94700 KB Correct answer: answer = 250000
30 Correct 472 ms 94736 KB Correct answer: answer = 500
31 Correct 234 ms 94736 KB Correct answer: answer = 32
32 Correct 460 ms 94736 KB Correct answer: answer = 130050
33 Correct 479 ms 94736 KB Correct answer: answer = 5110
34 Correct 431 ms 94736 KB Correct answer: answer = 2626
35 Correct 440 ms 94780 KB Correct answer: answer = 796
36 Correct 470 ms 94880 KB Correct answer: answer = 7580
37 Correct 477 ms 94880 KB Correct answer: answer = 1904
38 Correct 522 ms 94880 KB Correct answer: answer = 996004
39 Correct 505 ms 94880 KB Correct answer: answer = 38817
40 Correct 507 ms 94880 KB Correct answer: answer = 4096
41 Correct 109 ms 94880 KB Correct answer: answer = 1
42 Correct 508 ms 94880 KB Correct answer: answer = 1
43 Correct 462 ms 94880 KB Correct answer: answer = 2040
44 Correct 506 ms 94880 KB Correct answer: answer = 2
45 Correct 150 ms 94880 KB Correct answer: answer = 4
46 Correct 178 ms 94880 KB Correct answer: answer = 9
47 Correct 173 ms 94880 KB Correct answer: answer = 9
48 Correct 199 ms 94880 KB Correct answer: answer = 21
49 Correct 218 ms 94880 KB Correct answer: answer = 71
50 Correct 239 ms 94880 KB Correct answer: answer = 77
51 Correct 278 ms 94880 KB Correct answer: answer = 400
52 Correct 516 ms 94892 KB Correct answer: answer = 996004
53 Correct 517 ms 94896 KB Correct answer: answer = 997310
54 Correct 523 ms 94896 KB Correct answer: answer = 990781
55 Correct 512 ms 94896 KB Correct answer: answer = 996545
56 Correct 289 ms 94896 KB Correct answer: answer = 484
57 Correct 278 ms 94896 KB Correct answer: answer = 484
58 Correct 477 ms 94916 KB Correct answer: answer = 63501
59 Correct 504 ms 94920 KB Correct answer: answer = 323501
60 Correct 514 ms 94928 KB Correct answer: answer = 752500
61 Correct 523 ms 94928 KB Correct answer: answer = 761480
62 Correct 531 ms 94928 KB Correct answer: answer = 758932
63 Correct 513 ms 94928 KB Correct answer: answer = 1000000
64 Correct 524 ms 94940 KB Correct answer: answer = 750500
65 Correct 514 ms 94940 KB Correct answer: answer = 1000000
66 Correct 531 ms 94940 KB Correct answer: answer = 250000
67 Correct 506 ms 94940 KB Correct answer: answer = 250000
68 Correct 514 ms 94940 KB Correct answer: answer = 1000000
69 Correct 512 ms 94940 KB Correct answer: answer = 994009
70 Correct 500 ms 94940 KB Correct answer: answer = 59315
71 Correct 517 ms 94968 KB Correct answer: answer = 25454
72 Correct 450 ms 94972 KB Correct answer: answer = 1504
73 Correct 531 ms 94972 KB Correct answer: answer = 37486
74 Correct 527 ms 94972 KB Correct answer: answer = 4284
75 Correct 519 ms 94972 KB Correct answer: answer = 158008
76 Correct 526 ms 94972 KB Correct answer: answer = 51860
77 Correct 520 ms 94972 KB Correct answer: answer = 12985
78 Incorrect 109 ms 95024 KB Wrong answer: output = 995163225163, expected = 997864126212
79 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 157 ms 94204 KB Correct answer: answer = 4
2 Correct 156 ms 94464 KB Correct answer: answer = 4
3 Correct 187 ms 94464 KB Correct answer: answer = 4
4 Correct 193 ms 94464 KB Correct answer: answer = 12
5 Correct 235 ms 94464 KB Correct answer: answer = 52
6 Correct 281 ms 94464 KB Correct answer: answer = 210
7 Correct 234 ms 94464 KB Correct answer: answer = 88
8 Correct 387 ms 94592 KB Correct answer: answer = 7696
9 Correct 109 ms 94592 KB Correct answer: answer = 1
10 Correct 344 ms 94624 KB Correct answer: answer = 2374
11 Correct 387 ms 94624 KB Correct answer: answer = 9502
12 Correct 220 ms 94624 KB Correct answer: answer = 49
13 Correct 342 ms 94624 KB Correct answer: answer = 151
14 Correct 379 ms 94624 KB Correct answer: answer = 7550
15 Correct 377 ms 94624 KB Correct answer: answer = 7220
16 Correct 388 ms 94624 KB Correct answer: answer = 7550
17 Correct 392 ms 94628 KB Correct answer: answer = 10000
18 Correct 391 ms 94628 KB Correct answer: answer = 10000
19 Correct 420 ms 94628 KB Correct answer: answer = 624
20 Correct 381 ms 94628 KB Correct answer: answer = 10000
21 Correct 108 ms 94628 KB Correct answer: answer = 1
22 Correct 130 ms 94628 KB Correct answer: answer = 4
23 Correct 176 ms 94628 KB Correct answer: answer = 1
24 Correct 199 ms 94628 KB Correct answer: answer = 5
25 Correct 283 ms 94628 KB Correct answer: answer = 41
26 Correct 518 ms 94628 KB Correct answer: answer = 71923
27 Correct 509 ms 94628 KB Correct answer: answer = 77137
28 Correct 510 ms 94700 KB Correct answer: answer = 764
29 Correct 440 ms 94700 KB Correct answer: answer = 250000
30 Correct 472 ms 94736 KB Correct answer: answer = 500
31 Correct 234 ms 94736 KB Correct answer: answer = 32
32 Correct 460 ms 94736 KB Correct answer: answer = 130050
33 Correct 479 ms 94736 KB Correct answer: answer = 5110
34 Correct 431 ms 94736 KB Correct answer: answer = 2626
35 Correct 440 ms 94780 KB Correct answer: answer = 796
36 Correct 470 ms 94880 KB Correct answer: answer = 7580
37 Correct 477 ms 94880 KB Correct answer: answer = 1904
38 Correct 522 ms 94880 KB Correct answer: answer = 996004
39 Correct 505 ms 94880 KB Correct answer: answer = 38817
40 Correct 507 ms 94880 KB Correct answer: answer = 4096
41 Correct 109 ms 94880 KB Correct answer: answer = 1
42 Correct 508 ms 94880 KB Correct answer: answer = 1
43 Correct 462 ms 94880 KB Correct answer: answer = 2040
44 Correct 506 ms 94880 KB Correct answer: answer = 2
45 Correct 150 ms 94880 KB Correct answer: answer = 4
46 Correct 178 ms 94880 KB Correct answer: answer = 9
47 Correct 173 ms 94880 KB Correct answer: answer = 9
48 Correct 199 ms 94880 KB Correct answer: answer = 21
49 Correct 218 ms 94880 KB Correct answer: answer = 71
50 Correct 239 ms 94880 KB Correct answer: answer = 77
51 Correct 278 ms 94880 KB Correct answer: answer = 400
52 Correct 516 ms 94892 KB Correct answer: answer = 996004
53 Correct 517 ms 94896 KB Correct answer: answer = 997310
54 Correct 523 ms 94896 KB Correct answer: answer = 990781
55 Correct 512 ms 94896 KB Correct answer: answer = 996545
56 Correct 289 ms 94896 KB Correct answer: answer = 484
57 Correct 278 ms 94896 KB Correct answer: answer = 484
58 Correct 477 ms 94916 KB Correct answer: answer = 63501
59 Correct 504 ms 94920 KB Correct answer: answer = 323501
60 Correct 514 ms 94928 KB Correct answer: answer = 752500
61 Correct 523 ms 94928 KB Correct answer: answer = 761480
62 Correct 531 ms 94928 KB Correct answer: answer = 758932
63 Correct 513 ms 94928 KB Correct answer: answer = 1000000
64 Correct 524 ms 94940 KB Correct answer: answer = 750500
65 Correct 514 ms 94940 KB Correct answer: answer = 1000000
66 Correct 531 ms 94940 KB Correct answer: answer = 250000
67 Correct 506 ms 94940 KB Correct answer: answer = 250000
68 Correct 514 ms 94940 KB Correct answer: answer = 1000000
69 Correct 512 ms 94940 KB Correct answer: answer = 994009
70 Correct 500 ms 94940 KB Correct answer: answer = 59315
71 Correct 517 ms 94968 KB Correct answer: answer = 25454
72 Correct 450 ms 94972 KB Correct answer: answer = 1504
73 Correct 531 ms 94972 KB Correct answer: answer = 37486
74 Correct 527 ms 94972 KB Correct answer: answer = 4284
75 Correct 519 ms 94972 KB Correct answer: answer = 158008
76 Correct 526 ms 94972 KB Correct answer: answer = 51860
77 Correct 520 ms 94972 KB Correct answer: answer = 12985
78 Incorrect 109 ms 95024 KB Wrong answer: output = 995163225163, expected = 997864126212
79 Halted 0 ms 0 KB -