Submission #1045895

# Submission time Handle Problem Language Result Execution time Memory
1045895 2024-08-06T08:22:59 Z Mher777 Toy (CEOI24_toy) C++17
100 / 100
245 ms 259720 KB
#define _CRT_SECURE_NO_WARNINGS
#include <iostream>
#include <iomanip>
#include <array>
#include <string>
#include <algorithm>
#include <cmath>
#include <set>
#include <map>
#include <unordered_set>
#include <unordered_map>
#include <vector>
#include <stack>
#include <queue>
#include <deque>
#include <bitset>
#include <list>
#include <iterator>
#include <numeric>
#include <complex>
#include <utility>
#include <random>
#include <cassert>
#include <fstream>
using namespace std;
mt19937_64 rnd(7069);

/* -------------------- Typedefs -------------------- */

typedef int itn;
typedef long long ll;
typedef unsigned long long ull;
typedef double db;
typedef float fl;
typedef long double ld;

/* -------------------- Usings -------------------- */

using vi = vector<int>;
using vll = vector<ll>;
using mii = map<int, int>;
using mll = map<ll, ll>;
using pii = pair<int, int>;
using pll = pair<ll, ll>;

/* -------------------- Defines -------------------- */

#define ff first
#define ss second
#define pub push_back
#define pob pop_back
#define puf push_front
#define pof pop_front
#define mpr make_pair
#define yes cout<<"YES\n"
#define no cout<<"NO\n"
#define all(x) (x).begin(), (x).end()
#define USACO freopen("feast.in", "r", stdin); freopen("feast.out", "w", stdout);

/* -------------------- Constants -------------------- */

const int dx[8] = { -1, 0, 1, 0, -1, -1, 1, 1 };
const int dy[8] = { 0, -1, 0, 1, -1, 1, -1, 1 };
const int MAX = int(1e9 + 5);
const ll MAXL = ll(1e18) + 5ll;
const ll MOD = ll(1000000007);
const ll MOD2 = ll(998244353);

/* -------------------- Functions -------------------- */

void fastio() {
    ios_base::sync_with_stdio(false);
    cin.tie(0);
    cout.tie(0);
}

void precision(int x) {
    cout.setf(ios::fixed | ios::showpoint);
    cout.precision(x);
}

ll gcd(ll a, ll b) {
    if (a == 0 || b == 0) return(max(a, b));
    while (b) {
        a %= b;
        swap(a, b);
    }
    return a;
}

ll lcm(ll a, ll b) {
    return a / gcd(a, b) * b;
}

ll range_sum(ll a, ll b) {
    if (a > b) return 0ll;
    ll dif = a - 1, cnt = b - a + 1;
    ll ans = ((b - a + 1) * (b - a + 2)) / 2;
    ans += ((b - a + 1) * dif);
    return ans;
}

string dec_to_bin(ll a) {
    string s = "";
    for (ll i = a; i > 0; ) {
        ll k = i % 2;
        i /= 2;
        char c = k + 48;
        s += c;
    }
    if (a == 0) {
        s = "0";
    }
    reverse(all(s));
    return s;
}

ll bin_to_dec(string s) {
    ll num = 0;
    for (int i = 0; i < s.size(); i++) {
        num *= 2ll;
        num += (s[i] - '0');
    }
    return num;
}

ll factorial_by_mod(ll n, ll mod) {
    ll ans = 1;
    ll num;
    for (ll i = 1; i <= n; ++i) {
        num = i % mod;
        ans *= num;
        ans %= mod;
    }
    return ans;
}

bool isPrime(ll a) {
    if (a == 1) return false;
    for (ll i = 2; i * i <= a; i++) {
        if (a % i == 0) return false;
    }
    return true;
}

ll binpow(ll a, ll b) {
    if (!a) return 0;
    ll ans = 1;
    while (b) {
        if (b & 1) {
            ans *= a;
        }
        b >>= 1;
        a *= a;
    }
    return ans;
}

ll binpow_by_mod(ll a, ll b, ll mod) {
    if (!a) return 0;
    ll ans = 1;
    while (b) {
        if (b & 1) {
            ans *= a;
            ans %= mod;
        }
        b >>= 1;
        a *= a;
        a %= mod;
    }
    return ans;
}

/* -------------------- Solution -------------------- */

const int N = 1505;
int can1[N][N], can2[N][N], used[N][N];
char a[N][N];
vi g[N], g1[N], col[N];
int n, m, k, l, tx, ty, x1, y1a, x2, y2;

void dfs(int i1, int j1, int i2, int j2) {
    int hx = i1, hy = j2;
    if (tx == hx && ty == hy) {
        yes;
        exit(0);
    }
    used[hx][hy] = 1;
    //right
    if (hy < m - 1 && !used[hx][hy + 1] && a[hx][hy + 1] != 'X') {
        int ind = lower_bound(all(g1[j2]), i2) - g1[j2].begin();
        int l_right = g1[j2][ind - 1] + 1, r_right = g1[j2][ind] - 1;
        ind = lower_bound(all(g1[j2 + 1]), hx) - g1[j2 + 1].begin();
        l_right = max(l_right, g1[j2 + 1][ind - 1] + 1);
        r_right = min(r_right, g1[j2 + 1][ind] - 1);
        if (r_right - l_right + 1 >= l) {
            int i3 = l_right, j3 = i3 + l - 1;
            if (j3 < hx) {
                i3 += (hx - j3);
                j3 = hx;
            }
            dfs(i1, j1, i3, j2 + 1);
        }
    }
    //left
    if (hy > 0 && !used[hx][hy - 1] && a[hx][hy - 1] != 'X') {
        int ind = lower_bound(all(g1[j2]), i2) - g1[j2].begin();
        int l_left = g1[j2][ind - 1] + 1, r_left = g1[j2][ind] - 1;
        ind = lower_bound(all(g1[j2 - 1]), hx) - g1[j2 - 1].begin();
        l_left = max(l_left, g1[j2 - 1][ind - 1] + 1);
        r_left = min(r_left, g1[j2 - 1][ind] - 1);
        if (r_left - l_left + 1 >= l) {
            int i3 = l_left, j3 = i3 + l - 1;
            if (j3 < hx) {
                i3 += (hx - j3);
                j3 = hx;
            }
            dfs(i1, j1, i3, j2 - 1);
        }
    }
    //up
    if (hx > 0 && !used[hx - 1][hy] && a[hx - 1][hy] != 'X') {
        int ind = lower_bound(all(g[i1]), j2) - g[i1].begin();
        int l_up = g[i1][ind - 1] + 1, r_up = g[i1][ind] - 1;
        ind = lower_bound(all(g[i1 - 1]), hy) - g[i1 - 1].begin();
        l_up = max(l_up, g[i1 - 1][ind - 1] + 1);
        r_up = min(r_up, g[i1 - 1][ind] - 1);
        if (r_up - l_up + 1 >= k) {
            int i3 = l_up, j3 = r_up;
            if (j3 < hy) {
                i3 += (hy - j3);
                j3 = hy;
            }
            dfs(i1 - 1, j3, i2, j2);
        }
    }
    //down
    if (hx < n - 1 && !used[hx + 1][hy] && a[hx + 1][hy] != 'X') {
        int ind = lower_bound(all(g[i1]), j2) - g[i1].begin();
        int l_up = g[i1][ind - 1] + 1, r_up = g[i1][ind] - 1;
        ind = lower_bound(all(g[i1 + 1]), hy) - g[i1 + 1].begin();
        l_up = max(l_up, g[i1 + 1][ind - 1] + 1);
        r_up = min(r_up, g[i1 + 1][ind] - 1);
        if (r_up - l_up + 1 >= k) {
            int i3 = l_up, j3 = r_up;
            if (j3 < hy) {
                i3 += (hy - j3);
                j3 = hy;
            }
            dfs(i1 + 1, j3, i2, j2);
        }
    }
}

void slv() {
    cin >> n >> m >> k >> l >> x1 >> y1a >> x2 >> y2;
    swap(x1, y1a);
    swap(x2, y2);
    swap(n, m);
    for (int i = 0; i < n; ++i) {
        g[i].pub(-1);
        for (int j = 0; j < m; ++j) {
            cin >> a[i][j];
            if (a[i][j] == 'X') {
                g[i].pub(j);
            }
            if (a[i][j] == '*') {
                tx = i, ty = j;
            }
        }
        g[i].pub(m);
    }
    for (int j = 0; j < m; ++j) {
        g1[j].pub(-1);
        for (int i = 0; i < n; ++i) {
            if (a[i][j] == 'X') {
                g1[j].pub(i);
            }
        }
        g1[j].pub(n);
    }
    dfs(x1, y1a, x2, y2);
    no;
}

void cs() {
    int tstc = 1;
    //cin >> tstc;
    while (tstc--) {
        slv();
    }
}

void precalc() {
    return;
}

int main() {
    fastio();
    precalc();
    //precision(0);
    cs();
    return 0;
}

Compilation message

Main.cpp: In function 'll range_sum(ll, ll)':
Main.cpp:97:21: warning: unused variable 'cnt' [-Wunused-variable]
   97 |     ll dif = a - 1, cnt = b - a + 1;
      |                     ^~~
Main.cpp: In function 'll bin_to_dec(std::string)':
Main.cpp:120:23: warning: comparison of integer expressions of different signedness: 'int' and 'std::__cxx11::basic_string<char>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
  120 |     for (int i = 0; i < s.size(); i++) {
      |                     ~~^~~~~~~~~~
# Verdict Execution time Memory Grader output
1 Correct 1 ms 2396 KB Output is correct
2 Correct 1 ms 2396 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 1 ms 2396 KB Output is correct
2 Correct 1 ms 2396 KB Output is correct
3 Correct 0 ms 2652 KB Output is correct
4 Correct 1 ms 4700 KB Output is correct
5 Correct 1 ms 4700 KB Output is correct
6 Correct 0 ms 2648 KB Output is correct
7 Correct 1 ms 4700 KB Output is correct
8 Correct 1 ms 4700 KB Output is correct
9 Correct 0 ms 2652 KB Output is correct
10 Correct 1 ms 4700 KB Output is correct
11 Correct 1 ms 4696 KB Output is correct
12 Correct 1 ms 2392 KB Output is correct
13 Correct 1 ms 4700 KB Output is correct
14 Correct 0 ms 4700 KB Output is correct
15 Correct 1 ms 4952 KB Output is correct
16 Correct 0 ms 2652 KB Output is correct
17 Correct 1 ms 2652 KB Output is correct
18 Correct 1 ms 4956 KB Output is correct
19 Correct 1 ms 4992 KB Output is correct
20 Correct 1 ms 4956 KB Output is correct
21 Correct 1 ms 4956 KB Output is correct
22 Correct 1 ms 4996 KB Output is correct
23 Correct 1 ms 4956 KB Output is correct
24 Correct 1 ms 4700 KB Output is correct
25 Correct 1 ms 4700 KB Output is correct
26 Correct 1 ms 4700 KB Output is correct
27 Correct 1 ms 4700 KB Output is correct
28 Correct 1 ms 4700 KB Output is correct
29 Correct 1 ms 4700 KB Output is correct
30 Correct 1 ms 2908 KB Output is correct
31 Correct 1 ms 4936 KB Output is correct
32 Correct 1 ms 2652 KB Output is correct
33 Correct 1 ms 4956 KB Output is correct
34 Correct 1 ms 4700 KB Output is correct
35 Correct 1 ms 4700 KB Output is correct
36 Correct 0 ms 4700 KB Output is correct
37 Correct 1 ms 2652 KB Output is correct
38 Correct 0 ms 4700 KB Output is correct
39 Correct 0 ms 2652 KB Output is correct
40 Correct 1 ms 4700 KB Output is correct
41 Correct 1 ms 4700 KB Output is correct
42 Correct 1 ms 4700 KB Output is correct
43 Correct 1 ms 4700 KB Output is correct
44 Correct 1 ms 4700 KB Output is correct
45 Correct 1 ms 4700 KB Output is correct
46 Correct 0 ms 604 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 1 ms 2396 KB Output is correct
2 Correct 1 ms 2396 KB Output is correct
3 Correct 0 ms 2652 KB Output is correct
4 Correct 1 ms 4700 KB Output is correct
5 Correct 1 ms 4700 KB Output is correct
6 Correct 0 ms 2648 KB Output is correct
7 Correct 1 ms 4700 KB Output is correct
8 Correct 1 ms 4700 KB Output is correct
9 Correct 0 ms 2652 KB Output is correct
10 Correct 1 ms 4700 KB Output is correct
11 Correct 1 ms 4696 KB Output is correct
12 Correct 1 ms 2392 KB Output is correct
13 Correct 1 ms 4700 KB Output is correct
14 Correct 0 ms 4700 KB Output is correct
15 Correct 1 ms 4952 KB Output is correct
16 Correct 0 ms 2652 KB Output is correct
17 Correct 1 ms 2652 KB Output is correct
18 Correct 1 ms 4956 KB Output is correct
19 Correct 1 ms 4992 KB Output is correct
20 Correct 1 ms 4956 KB Output is correct
21 Correct 1 ms 4956 KB Output is correct
22 Correct 1 ms 4996 KB Output is correct
23 Correct 1 ms 4956 KB Output is correct
24 Correct 1 ms 4700 KB Output is correct
25 Correct 1 ms 4700 KB Output is correct
26 Correct 1 ms 4700 KB Output is correct
27 Correct 1 ms 4700 KB Output is correct
28 Correct 1 ms 4700 KB Output is correct
29 Correct 1 ms 4700 KB Output is correct
30 Correct 1 ms 2908 KB Output is correct
31 Correct 1 ms 4936 KB Output is correct
32 Correct 1 ms 2652 KB Output is correct
33 Correct 1 ms 4956 KB Output is correct
34 Correct 1 ms 4700 KB Output is correct
35 Correct 1 ms 4700 KB Output is correct
36 Correct 0 ms 4700 KB Output is correct
37 Correct 1 ms 2652 KB Output is correct
38 Correct 0 ms 4700 KB Output is correct
39 Correct 0 ms 2652 KB Output is correct
40 Correct 1 ms 4700 KB Output is correct
41 Correct 1 ms 4700 KB Output is correct
42 Correct 1 ms 4700 KB Output is correct
43 Correct 1 ms 4700 KB Output is correct
44 Correct 1 ms 4700 KB Output is correct
45 Correct 1 ms 4700 KB Output is correct
46 Correct 0 ms 604 KB Output is correct
47 Correct 1 ms 2652 KB Output is correct
48 Correct 1 ms 4700 KB Output is correct
49 Correct 1 ms 4700 KB Output is correct
50 Correct 1 ms 4700 KB Output is correct
51 Correct 1 ms 4700 KB Output is correct
52 Correct 1 ms 4740 KB Output is correct
53 Correct 0 ms 4700 KB Output is correct
54 Correct 1 ms 4700 KB Output is correct
55 Correct 1 ms 4700 KB Output is correct
56 Correct 1 ms 4700 KB Output is correct
57 Correct 1 ms 4700 KB Output is correct
58 Correct 1 ms 4700 KB Output is correct
59 Correct 1 ms 4956 KB Output is correct
60 Correct 1 ms 4956 KB Output is correct
61 Correct 1 ms 4956 KB Output is correct
62 Correct 2 ms 5468 KB Output is correct
63 Correct 2 ms 5468 KB Output is correct
64 Correct 1 ms 5436 KB Output is correct
65 Correct 1 ms 5468 KB Output is correct
66 Correct 1 ms 5596 KB Output is correct
67 Correct 2 ms 5468 KB Output is correct
68 Correct 1 ms 4956 KB Output is correct
69 Correct 1 ms 5056 KB Output is correct
70 Correct 1 ms 5132 KB Output is correct
71 Correct 1 ms 5212 KB Output is correct
72 Correct 1 ms 5212 KB Output is correct
73 Correct 1 ms 5212 KB Output is correct
74 Correct 2 ms 5468 KB Output is correct
75 Correct 2 ms 5468 KB Output is correct
76 Correct 1 ms 4956 KB Output is correct
77 Correct 1 ms 5468 KB Output is correct
78 Correct 1 ms 4956 KB Output is correct
79 Correct 1 ms 5212 KB Output is correct
80 Correct 1 ms 4700 KB Output is correct
81 Correct 1 ms 4956 KB Output is correct
82 Correct 1 ms 4956 KB Output is correct
83 Correct 1 ms 4956 KB Output is correct
84 Correct 1 ms 4952 KB Output is correct
85 Correct 1 ms 4956 KB Output is correct
86 Correct 1 ms 4956 KB Output is correct
87 Correct 1 ms 5212 KB Output is correct
88 Correct 1 ms 4956 KB Output is correct
89 Correct 1 ms 5212 KB Output is correct
90 Correct 0 ms 2652 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 1 ms 2396 KB Output is correct
2 Correct 1 ms 2396 KB Output is correct
3 Correct 1 ms 2652 KB Output is correct
4 Correct 8 ms 10584 KB Output is correct
5 Correct 2 ms 4952 KB Output is correct
6 Correct 1 ms 4956 KB Output is correct
7 Correct 2 ms 6236 KB Output is correct
8 Correct 4 ms 9052 KB Output is correct
9 Correct 1 ms 4700 KB Output is correct
10 Correct 3 ms 4696 KB Output is correct
11 Correct 2 ms 4700 KB Output is correct
12 Correct 1 ms 4700 KB Output is correct
13 Correct 3 ms 4956 KB Output is correct
14 Correct 2 ms 4956 KB Output is correct
15 Correct 6 ms 13660 KB Output is correct
16 Correct 7 ms 11960 KB Output is correct
17 Correct 8 ms 12124 KB Output is correct
18 Correct 8 ms 14424 KB Output is correct
19 Correct 6 ms 14428 KB Output is correct
20 Correct 7 ms 14428 KB Output is correct
21 Correct 9 ms 14436 KB Output is correct
22 Correct 6 ms 14428 KB Output is correct
23 Correct 6 ms 14428 KB Output is correct
24 Correct 4 ms 9560 KB Output is correct
25 Correct 4 ms 9564 KB Output is correct
26 Correct 9 ms 11952 KB Output is correct
27 Correct 5 ms 11868 KB Output is correct
28 Correct 6 ms 11868 KB Output is correct
29 Correct 4 ms 11868 KB Output is correct
30 Correct 3 ms 5468 KB Output is correct
31 Correct 6 ms 13648 KB Output is correct
32 Correct 4 ms 6748 KB Output is correct
33 Correct 6 ms 13404 KB Output is correct
34 Correct 2 ms 5980 KB Output is correct
35 Correct 2 ms 6492 KB Output is correct
36 Correct 1 ms 4952 KB Output is correct
37 Correct 3 ms 7896 KB Output is correct
38 Correct 3 ms 7516 KB Output is correct
39 Correct 3 ms 7772 KB Output is correct
40 Correct 3 ms 7812 KB Output is correct
41 Correct 5 ms 7516 KB Output is correct
42 Correct 5 ms 11096 KB Output is correct
43 Correct 4 ms 11092 KB Output is correct
44 Correct 3 ms 7004 KB Output is correct
45 Correct 4 ms 9308 KB Output is correct
46 Correct 3 ms 3928 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 1 ms 2396 KB Output is correct
2 Correct 1 ms 2396 KB Output is correct
3 Correct 0 ms 2652 KB Output is correct
4 Correct 1 ms 4700 KB Output is correct
5 Correct 1 ms 4700 KB Output is correct
6 Correct 0 ms 2648 KB Output is correct
7 Correct 1 ms 4700 KB Output is correct
8 Correct 1 ms 4700 KB Output is correct
9 Correct 0 ms 2652 KB Output is correct
10 Correct 1 ms 4700 KB Output is correct
11 Correct 1 ms 4696 KB Output is correct
12 Correct 1 ms 2392 KB Output is correct
13 Correct 1 ms 4700 KB Output is correct
14 Correct 0 ms 4700 KB Output is correct
15 Correct 1 ms 4952 KB Output is correct
16 Correct 0 ms 2652 KB Output is correct
17 Correct 1 ms 2652 KB Output is correct
18 Correct 1 ms 4956 KB Output is correct
19 Correct 1 ms 4992 KB Output is correct
20 Correct 1 ms 4956 KB Output is correct
21 Correct 1 ms 4956 KB Output is correct
22 Correct 1 ms 4996 KB Output is correct
23 Correct 1 ms 4956 KB Output is correct
24 Correct 1 ms 4700 KB Output is correct
25 Correct 1 ms 4700 KB Output is correct
26 Correct 1 ms 4700 KB Output is correct
27 Correct 1 ms 4700 KB Output is correct
28 Correct 1 ms 4700 KB Output is correct
29 Correct 1 ms 4700 KB Output is correct
30 Correct 1 ms 2908 KB Output is correct
31 Correct 1 ms 4936 KB Output is correct
32 Correct 1 ms 2652 KB Output is correct
33 Correct 1 ms 4956 KB Output is correct
34 Correct 1 ms 4700 KB Output is correct
35 Correct 1 ms 4700 KB Output is correct
36 Correct 0 ms 4700 KB Output is correct
37 Correct 1 ms 2652 KB Output is correct
38 Correct 0 ms 4700 KB Output is correct
39 Correct 0 ms 2652 KB Output is correct
40 Correct 1 ms 4700 KB Output is correct
41 Correct 1 ms 4700 KB Output is correct
42 Correct 1 ms 4700 KB Output is correct
43 Correct 1 ms 4700 KB Output is correct
44 Correct 1 ms 4700 KB Output is correct
45 Correct 1 ms 4700 KB Output is correct
46 Correct 0 ms 604 KB Output is correct
47 Correct 1 ms 2652 KB Output is correct
48 Correct 1 ms 4700 KB Output is correct
49 Correct 1 ms 4700 KB Output is correct
50 Correct 1 ms 4700 KB Output is correct
51 Correct 1 ms 4700 KB Output is correct
52 Correct 1 ms 4740 KB Output is correct
53 Correct 0 ms 4700 KB Output is correct
54 Correct 1 ms 4700 KB Output is correct
55 Correct 1 ms 4700 KB Output is correct
56 Correct 1 ms 4700 KB Output is correct
57 Correct 1 ms 4700 KB Output is correct
58 Correct 1 ms 4700 KB Output is correct
59 Correct 1 ms 4956 KB Output is correct
60 Correct 1 ms 4956 KB Output is correct
61 Correct 1 ms 4956 KB Output is correct
62 Correct 2 ms 5468 KB Output is correct
63 Correct 2 ms 5468 KB Output is correct
64 Correct 1 ms 5436 KB Output is correct
65 Correct 1 ms 5468 KB Output is correct
66 Correct 1 ms 5596 KB Output is correct
67 Correct 2 ms 5468 KB Output is correct
68 Correct 1 ms 4956 KB Output is correct
69 Correct 1 ms 5056 KB Output is correct
70 Correct 1 ms 5132 KB Output is correct
71 Correct 1 ms 5212 KB Output is correct
72 Correct 1 ms 5212 KB Output is correct
73 Correct 1 ms 5212 KB Output is correct
74 Correct 2 ms 5468 KB Output is correct
75 Correct 2 ms 5468 KB Output is correct
76 Correct 1 ms 4956 KB Output is correct
77 Correct 1 ms 5468 KB Output is correct
78 Correct 1 ms 4956 KB Output is correct
79 Correct 1 ms 5212 KB Output is correct
80 Correct 1 ms 4700 KB Output is correct
81 Correct 1 ms 4956 KB Output is correct
82 Correct 1 ms 4956 KB Output is correct
83 Correct 1 ms 4956 KB Output is correct
84 Correct 1 ms 4952 KB Output is correct
85 Correct 1 ms 4956 KB Output is correct
86 Correct 1 ms 4956 KB Output is correct
87 Correct 1 ms 5212 KB Output is correct
88 Correct 1 ms 4956 KB Output is correct
89 Correct 1 ms 5212 KB Output is correct
90 Correct 0 ms 2652 KB Output is correct
91 Correct 1 ms 2652 KB Output is correct
92 Correct 8 ms 10584 KB Output is correct
93 Correct 2 ms 4952 KB Output is correct
94 Correct 1 ms 4956 KB Output is correct
95 Correct 2 ms 6236 KB Output is correct
96 Correct 4 ms 9052 KB Output is correct
97 Correct 1 ms 4700 KB Output is correct
98 Correct 3 ms 4696 KB Output is correct
99 Correct 2 ms 4700 KB Output is correct
100 Correct 1 ms 4700 KB Output is correct
101 Correct 3 ms 4956 KB Output is correct
102 Correct 2 ms 4956 KB Output is correct
103 Correct 6 ms 13660 KB Output is correct
104 Correct 7 ms 11960 KB Output is correct
105 Correct 8 ms 12124 KB Output is correct
106 Correct 8 ms 14424 KB Output is correct
107 Correct 6 ms 14428 KB Output is correct
108 Correct 7 ms 14428 KB Output is correct
109 Correct 9 ms 14436 KB Output is correct
110 Correct 6 ms 14428 KB Output is correct
111 Correct 6 ms 14428 KB Output is correct
112 Correct 4 ms 9560 KB Output is correct
113 Correct 4 ms 9564 KB Output is correct
114 Correct 9 ms 11952 KB Output is correct
115 Correct 5 ms 11868 KB Output is correct
116 Correct 6 ms 11868 KB Output is correct
117 Correct 4 ms 11868 KB Output is correct
118 Correct 3 ms 5468 KB Output is correct
119 Correct 6 ms 13648 KB Output is correct
120 Correct 4 ms 6748 KB Output is correct
121 Correct 6 ms 13404 KB Output is correct
122 Correct 2 ms 5980 KB Output is correct
123 Correct 2 ms 6492 KB Output is correct
124 Correct 1 ms 4952 KB Output is correct
125 Correct 3 ms 7896 KB Output is correct
126 Correct 3 ms 7516 KB Output is correct
127 Correct 3 ms 7772 KB Output is correct
128 Correct 3 ms 7812 KB Output is correct
129 Correct 5 ms 7516 KB Output is correct
130 Correct 5 ms 11096 KB Output is correct
131 Correct 4 ms 11092 KB Output is correct
132 Correct 3 ms 7004 KB Output is correct
133 Correct 4 ms 9308 KB Output is correct
134 Correct 3 ms 3928 KB Output is correct
135 Correct 1 ms 4700 KB Output is correct
136 Correct 2 ms 4700 KB Output is correct
137 Correct 2 ms 4696 KB Output is correct
138 Correct 1 ms 4700 KB Output is correct
139 Correct 1 ms 4700 KB Output is correct
140 Correct 3 ms 4700 KB Output is correct
141 Correct 1 ms 4700 KB Output is correct
142 Correct 2 ms 4700 KB Output is correct
143 Correct 2 ms 4816 KB Output is correct
144 Correct 1 ms 2652 KB Output is correct
145 Correct 3 ms 5452 KB Output is correct
146 Correct 3 ms 5212 KB Output is correct
147 Correct 6 ms 11356 KB Output is correct
148 Correct 12 ms 12636 KB Output is correct
149 Correct 6 ms 12892 KB Output is correct
150 Correct 11 ms 19036 KB Output is correct
151 Correct 10 ms 19036 KB Output is correct
152 Correct 10 ms 18988 KB Output is correct
153 Correct 9 ms 19032 KB Output is correct
154 Correct 9 ms 18844 KB Output is correct
155 Correct 8 ms 18776 KB Output is correct
156 Correct 5 ms 11868 KB Output is correct
157 Correct 6 ms 11868 KB Output is correct
158 Correct 6 ms 15144 KB Output is correct
159 Correct 10 ms 15192 KB Output is correct
160 Correct 7 ms 15196 KB Output is correct
161 Correct 6 ms 15196 KB Output is correct
162 Correct 12 ms 17752 KB Output is correct
163 Correct 9 ms 17432 KB Output is correct
164 Correct 3 ms 7772 KB Output is correct
165 Correct 14 ms 16924 KB Output is correct
166 Correct 6 ms 13148 KB Output is correct
167 Correct 11 ms 16216 KB Output is correct
168 Correct 2 ms 4956 KB Output is correct
169 Correct 4 ms 9052 KB Output is correct
170 Correct 6 ms 9052 KB Output is correct
171 Correct 5 ms 8796 KB Output is correct
172 Correct 5 ms 8584 KB Output is correct
173 Correct 7 ms 9052 KB Output is correct
174 Correct 3 ms 4748 KB Output is correct
175 Correct 5 ms 12636 KB Output is correct
176 Correct 5 ms 12124 KB Output is correct
177 Correct 6 ms 12812 KB Output is correct
178 Correct 2 ms 3932 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 1 ms 2396 KB Output is correct
2 Correct 1 ms 2396 KB Output is correct
3 Correct 0 ms 2652 KB Output is correct
4 Correct 1 ms 4700 KB Output is correct
5 Correct 1 ms 4700 KB Output is correct
6 Correct 0 ms 2648 KB Output is correct
7 Correct 1 ms 4700 KB Output is correct
8 Correct 1 ms 4700 KB Output is correct
9 Correct 0 ms 2652 KB Output is correct
10 Correct 1 ms 4700 KB Output is correct
11 Correct 1 ms 4696 KB Output is correct
12 Correct 1 ms 2392 KB Output is correct
13 Correct 1 ms 4700 KB Output is correct
14 Correct 0 ms 4700 KB Output is correct
15 Correct 1 ms 4952 KB Output is correct
16 Correct 0 ms 2652 KB Output is correct
17 Correct 1 ms 2652 KB Output is correct
18 Correct 1 ms 4956 KB Output is correct
19 Correct 1 ms 4992 KB Output is correct
20 Correct 1 ms 4956 KB Output is correct
21 Correct 1 ms 4956 KB Output is correct
22 Correct 1 ms 4996 KB Output is correct
23 Correct 1 ms 4956 KB Output is correct
24 Correct 1 ms 4700 KB Output is correct
25 Correct 1 ms 4700 KB Output is correct
26 Correct 1 ms 4700 KB Output is correct
27 Correct 1 ms 4700 KB Output is correct
28 Correct 1 ms 4700 KB Output is correct
29 Correct 1 ms 4700 KB Output is correct
30 Correct 1 ms 2908 KB Output is correct
31 Correct 1 ms 4936 KB Output is correct
32 Correct 1 ms 2652 KB Output is correct
33 Correct 1 ms 4956 KB Output is correct
34 Correct 1 ms 4700 KB Output is correct
35 Correct 1 ms 4700 KB Output is correct
36 Correct 0 ms 4700 KB Output is correct
37 Correct 1 ms 2652 KB Output is correct
38 Correct 0 ms 4700 KB Output is correct
39 Correct 0 ms 2652 KB Output is correct
40 Correct 1 ms 4700 KB Output is correct
41 Correct 1 ms 4700 KB Output is correct
42 Correct 1 ms 4700 KB Output is correct
43 Correct 1 ms 4700 KB Output is correct
44 Correct 1 ms 4700 KB Output is correct
45 Correct 1 ms 4700 KB Output is correct
46 Correct 0 ms 604 KB Output is correct
47 Correct 1 ms 2652 KB Output is correct
48 Correct 1 ms 4700 KB Output is correct
49 Correct 1 ms 4700 KB Output is correct
50 Correct 1 ms 4700 KB Output is correct
51 Correct 1 ms 4700 KB Output is correct
52 Correct 1 ms 4740 KB Output is correct
53 Correct 0 ms 4700 KB Output is correct
54 Correct 1 ms 4700 KB Output is correct
55 Correct 1 ms 4700 KB Output is correct
56 Correct 1 ms 4700 KB Output is correct
57 Correct 1 ms 4700 KB Output is correct
58 Correct 1 ms 4700 KB Output is correct
59 Correct 1 ms 4956 KB Output is correct
60 Correct 1 ms 4956 KB Output is correct
61 Correct 1 ms 4956 KB Output is correct
62 Correct 2 ms 5468 KB Output is correct
63 Correct 2 ms 5468 KB Output is correct
64 Correct 1 ms 5436 KB Output is correct
65 Correct 1 ms 5468 KB Output is correct
66 Correct 1 ms 5596 KB Output is correct
67 Correct 2 ms 5468 KB Output is correct
68 Correct 1 ms 4956 KB Output is correct
69 Correct 1 ms 5056 KB Output is correct
70 Correct 1 ms 5132 KB Output is correct
71 Correct 1 ms 5212 KB Output is correct
72 Correct 1 ms 5212 KB Output is correct
73 Correct 1 ms 5212 KB Output is correct
74 Correct 2 ms 5468 KB Output is correct
75 Correct 2 ms 5468 KB Output is correct
76 Correct 1 ms 4956 KB Output is correct
77 Correct 1 ms 5468 KB Output is correct
78 Correct 1 ms 4956 KB Output is correct
79 Correct 1 ms 5212 KB Output is correct
80 Correct 1 ms 4700 KB Output is correct
81 Correct 1 ms 4956 KB Output is correct
82 Correct 1 ms 4956 KB Output is correct
83 Correct 1 ms 4956 KB Output is correct
84 Correct 1 ms 4952 KB Output is correct
85 Correct 1 ms 4956 KB Output is correct
86 Correct 1 ms 4956 KB Output is correct
87 Correct 1 ms 5212 KB Output is correct
88 Correct 1 ms 4956 KB Output is correct
89 Correct 1 ms 5212 KB Output is correct
90 Correct 0 ms 2652 KB Output is correct
91 Correct 1 ms 2652 KB Output is correct
92 Correct 8 ms 10584 KB Output is correct
93 Correct 2 ms 4952 KB Output is correct
94 Correct 1 ms 4956 KB Output is correct
95 Correct 2 ms 6236 KB Output is correct
96 Correct 4 ms 9052 KB Output is correct
97 Correct 1 ms 4700 KB Output is correct
98 Correct 3 ms 4696 KB Output is correct
99 Correct 2 ms 4700 KB Output is correct
100 Correct 1 ms 4700 KB Output is correct
101 Correct 3 ms 4956 KB Output is correct
102 Correct 2 ms 4956 KB Output is correct
103 Correct 6 ms 13660 KB Output is correct
104 Correct 7 ms 11960 KB Output is correct
105 Correct 8 ms 12124 KB Output is correct
106 Correct 8 ms 14424 KB Output is correct
107 Correct 6 ms 14428 KB Output is correct
108 Correct 7 ms 14428 KB Output is correct
109 Correct 9 ms 14436 KB Output is correct
110 Correct 6 ms 14428 KB Output is correct
111 Correct 6 ms 14428 KB Output is correct
112 Correct 4 ms 9560 KB Output is correct
113 Correct 4 ms 9564 KB Output is correct
114 Correct 9 ms 11952 KB Output is correct
115 Correct 5 ms 11868 KB Output is correct
116 Correct 6 ms 11868 KB Output is correct
117 Correct 4 ms 11868 KB Output is correct
118 Correct 3 ms 5468 KB Output is correct
119 Correct 6 ms 13648 KB Output is correct
120 Correct 4 ms 6748 KB Output is correct
121 Correct 6 ms 13404 KB Output is correct
122 Correct 2 ms 5980 KB Output is correct
123 Correct 2 ms 6492 KB Output is correct
124 Correct 1 ms 4952 KB Output is correct
125 Correct 3 ms 7896 KB Output is correct
126 Correct 3 ms 7516 KB Output is correct
127 Correct 3 ms 7772 KB Output is correct
128 Correct 3 ms 7812 KB Output is correct
129 Correct 5 ms 7516 KB Output is correct
130 Correct 5 ms 11096 KB Output is correct
131 Correct 4 ms 11092 KB Output is correct
132 Correct 3 ms 7004 KB Output is correct
133 Correct 4 ms 9308 KB Output is correct
134 Correct 3 ms 3928 KB Output is correct
135 Correct 1 ms 4700 KB Output is correct
136 Correct 2 ms 4700 KB Output is correct
137 Correct 2 ms 4696 KB Output is correct
138 Correct 1 ms 4700 KB Output is correct
139 Correct 1 ms 4700 KB Output is correct
140 Correct 3 ms 4700 KB Output is correct
141 Correct 1 ms 4700 KB Output is correct
142 Correct 2 ms 4700 KB Output is correct
143 Correct 2 ms 4816 KB Output is correct
144 Correct 1 ms 2652 KB Output is correct
145 Correct 3 ms 5452 KB Output is correct
146 Correct 3 ms 5212 KB Output is correct
147 Correct 6 ms 11356 KB Output is correct
148 Correct 12 ms 12636 KB Output is correct
149 Correct 6 ms 12892 KB Output is correct
150 Correct 11 ms 19036 KB Output is correct
151 Correct 10 ms 19036 KB Output is correct
152 Correct 10 ms 18988 KB Output is correct
153 Correct 9 ms 19032 KB Output is correct
154 Correct 9 ms 18844 KB Output is correct
155 Correct 8 ms 18776 KB Output is correct
156 Correct 5 ms 11868 KB Output is correct
157 Correct 6 ms 11868 KB Output is correct
158 Correct 6 ms 15144 KB Output is correct
159 Correct 10 ms 15192 KB Output is correct
160 Correct 7 ms 15196 KB Output is correct
161 Correct 6 ms 15196 KB Output is correct
162 Correct 12 ms 17752 KB Output is correct
163 Correct 9 ms 17432 KB Output is correct
164 Correct 3 ms 7772 KB Output is correct
165 Correct 14 ms 16924 KB Output is correct
166 Correct 6 ms 13148 KB Output is correct
167 Correct 11 ms 16216 KB Output is correct
168 Correct 2 ms 4956 KB Output is correct
169 Correct 4 ms 9052 KB Output is correct
170 Correct 6 ms 9052 KB Output is correct
171 Correct 5 ms 8796 KB Output is correct
172 Correct 5 ms 8584 KB Output is correct
173 Correct 7 ms 9052 KB Output is correct
174 Correct 3 ms 4748 KB Output is correct
175 Correct 5 ms 12636 KB Output is correct
176 Correct 5 ms 12124 KB Output is correct
177 Correct 6 ms 12812 KB Output is correct
178 Correct 2 ms 3932 KB Output is correct
179 Correct 5 ms 5264 KB Output is correct
180 Correct 16 ms 6832 KB Output is correct
181 Correct 17 ms 6744 KB Output is correct
182 Correct 5 ms 4700 KB Output is correct
183 Correct 17 ms 7004 KB Output is correct
184 Correct 17 ms 7004 KB Output is correct
185 Correct 17 ms 6600 KB Output is correct
186 Correct 27 ms 9576 KB Output is correct
187 Correct 30 ms 7508 KB Output is correct
188 Correct 31 ms 9052 KB Output is correct
189 Correct 49 ms 18780 KB Output is correct
190 Correct 49 ms 18780 KB Output is correct
191 Correct 108 ms 120404 KB Output is correct
192 Correct 146 ms 181512 KB Output is correct
193 Correct 129 ms 165968 KB Output is correct
194 Correct 245 ms 258264 KB Output is correct
195 Correct 196 ms 259664 KB Output is correct
196 Correct 203 ms 259720 KB Output is correct
197 Correct 155 ms 259464 KB Output is correct
198 Correct 172 ms 259600 KB Output is correct
199 Correct 154 ms 259152 KB Output is correct
200 Correct 80 ms 132180 KB Output is correct
201 Correct 79 ms 132116 KB Output is correct
202 Correct 132 ms 195236 KB Output is correct
203 Correct 153 ms 195252 KB Output is correct
204 Correct 111 ms 195408 KB Output is correct
205 Correct 118 ms 195204 KB Output is correct
206 Correct 163 ms 227820 KB Output is correct
207 Correct 172 ms 229456 KB Output is correct
208 Correct 140 ms 208176 KB Output is correct
209 Correct 175 ms 232536 KB Output is correct
210 Correct 156 ms 218260 KB Output is correct
211 Correct 32 ms 15584 KB Output is correct
212 Correct 33 ms 11604 KB Output is correct
213 Correct 81 ms 83352 KB Output is correct
214 Correct 76 ms 79476 KB Output is correct
215 Correct 107 ms 84808 KB Output is correct
216 Correct 64 ms 78040 KB Output is correct
217 Correct 64 ms 79324 KB Output is correct
218 Correct 30 ms 34644 KB Output is correct
219 Correct 38 ms 44688 KB Output is correct
220 Correct 159 ms 217680 KB Output is correct
221 Correct 119 ms 159908 KB Output is correct
222 Correct 31 ms 25872 KB Output is correct