QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#510223#8646. Card CollectionMax_s_xaM0 3ms30280kbC++1415.9kb2024-08-08 23:41:172024-08-08 23:41:18

Judging History

你现在查看的是最新测评结果

  • [2024-08-08 23:41:18]
  • 评测
  • 测评结果:0
  • 用时:3ms
  • 内存:30280kb
  • [2024-08-08 23:41:17]
  • 提交

answer

#include <iostream>
#include <algorithm>
#include <cstring>

typedef long long ll;
typedef double lf;

// #define DEBUG 1
struct IO
{
    #define MAXSIZE (1 << 20)
    #define isdigit(x) (x >= '0' && x <= '9')
    char buf[MAXSIZE], *p1, *p2;
    char pbuf[MAXSIZE], *pp;
    #if DEBUG
    #else
    IO() : p1(buf), p2(buf), pp(pbuf) {}
    ~IO() {fwrite(pbuf, 1, pp - pbuf, stdout);}
    #endif
    #define gc() (p1 == p2 && (p2 = (p1 = buf) + fread(buf, 1, MAXSIZE, stdin), p1 == p2) ? ' ' : *p1++)
    #define blank(x) (x == ' ' || x == '\n' || x == '\r' || x == '\t')

    template <typename T>
    void Read(T &x)
    {
        #if DEBUG
        std::cin >> x;
        #else
        bool sign = 0; char ch = gc(); x = 0;
        for (; !isdigit(ch); ch = gc())
            if (ch == '-') sign = 1;
        for (; isdigit(ch); ch = gc()) x = x * 10 + (ch ^ 48);
        if (sign) x = -x;
        #endif
    }
    void Read(char *s)
    {
        #if DEBUG
        std::cin >> s;
        #else
        char ch = gc();
        for (; blank(ch); ch = gc());
        for (; !blank(ch); ch = gc()) *s++ = ch;
        *s = 0;
        #endif
    }
    void Read(char &c) {for (c = gc(); blank(c); c = gc());}

    void Push(const char &c)
    {
        #if DEBUG
        putchar(c);
        #else
        if (pp - pbuf == MAXSIZE) fwrite(pbuf, 1, MAXSIZE, stdout), pp = pbuf;
        *pp++ = c;
        #endif
    }
    template <typename T>
    void Write(T x)
    {
        if (x < 0) x = -x, Push('-');
        static T sta[35];
        int top = 0;
        do sta[top++] = x % 10, x /= 10; while (x);
        while (top) Push(sta[--top] ^ 48);
    }
    template <typename T>
    void Write(T x, char lst) {Write(x), Push(lst);}
} IO;
#define Read(x) IO.Read(x)
#define Write(x, y) IO.Write(x, y)
#define Put(x) IO.Push(x)

using namespace std;

const int MAXN = 2e5 + 10;

int n, m;
struct point
{
    int x, y;
}a[MAXN];
int m1, m2, b1[MAXN], b2[MAXN];
int X[2][MAXN], Y[2][MAXN];

struct qry
{
    int x, y, lp[2], rp[2], id;
    int d0[2], d1[2];
    int pcnt[2], scnt[2];
    int pre[2], suf[2];
    int mid[2][2];
}qt[MAXN];

int lg[MAXN];
struct RMQ
{
    int f[MAXN][19], g[MAXN][19];
    inline void Build(int *a)
    {
        for (int i = 1; i <= n; i++) f[i][0] = g[i][0] = a[i];
        for (int j = 1; j < lg[n]; j++)
            for (int i = 1; i + (1 << j) - 1 <= n; i++)
                f[i][j] = min(f[i][j - 1], f[i + (1 << j - 1)][j - 1]), g[i][j] = max(g[i][j - 1], g[i + (1 << j - 1)][j - 1]);
    }
    inline int qmin(int l, int r)
    {
        if (l > r) return 2e9;
        int s = lg[r - l + 1] - 1;
        return min(f[l][s], f[r - (1 << s) + 1][s]);
    }
    inline int qmax(int l, int r)
    {
        if (l > r) return -2e9;
        int s = lg[r - l + 1] - 1;
        return max(g[l][s], g[r - (1 << s) + 1][s]);
    }
}rx, ry;

int idx[MAXN], ai[MAXN];

int bit1[MAXN], bit2[MAXN];
inline void Add(int x, int k) { for (; x <= m2; x += (x & -x)) bit1[x] = min(bit1[x], k), bit2[x] = max(bit2[x], k); }
inline pair <int, int> Ask(int x) { int res1 = 2e9, res2 = -2e9; for (; x; x -= (x & -x)) res1 = min(res1, bit1[x]), res2 = max(res2, bit2[x]); return {res1, res2}; }

struct node
{
    int t, id, f, _;
    bool operator < (const node &u) const { return t < u.t; }
}h[MAXN << 2];
int tot, hr[MAXN << 2];

struct subqry
{
    int x, y, id;
}st[MAXN << 3];
int top;

int bit[MAXN];
inline void Upd(int x, int k) { for (; x <= m2; x += (x & -x)) bit[x] += k; }
inline int Qry(int x) { int res = 0; for (; x; x -= (x & -x)) res += bit[x]; return res; }

inline void Solve1(int l, int r, int ql, int qr)
{
    if (l > r || ql > qr) return;
    if (l == r)
    {
        for (int i = ql; i <= qr; i++) hr[i] += (a[l].x >= qt[h[i].id].x) && (a[l].y <= qt[h[i].id].y);
        return;
    }
    int mid = l + r >> 1, qmid = ql - 1;
    while (qmid < qr && h[qmid + 1].t <= mid) qmid++;
    top = 0;
    for (int i = l; i <= mid; i++) st[++top] = subqry{a[i].x, a[i].y, 0};
    for (int i = qmid + 1; i <= qr; i++) st[++top] = subqry{qt[h[i].id].x, qt[h[i].id].y, i};
    sort(st + 1, st + top + 1, [&](const subqry &u, const subqry &v) { return u.x == v.x ? (u.y == v.y ? u.id < v.id : u.y < v.y) : u.x > v.x; });
    for (int i = 1; i <= top; i++)
        if (st[i].id == 0) Upd(st[i].y, 1);
        else hr[st[i].id] += Qry(st[i].y);
    for (int i = 1; i <= top; i++)
        if (st[i].id == 0) Upd(st[i].y, -1);
    Solve1(l, mid, ql, qmid), Solve1(mid + 1, r, qmid + 1, qr);
}
inline void Solve2(int l, int r, int ql, int qr)
{
    if (l > r || ql > qr) return;
    if (l == r)
    {
        for (int i = ql; i <= qr; i++) hr[i] += (a[l].x <= qt[h[i].id].x) && (a[l].y >= qt[h[i].id].y);
        return;
    }
    int mid = l + r >> 1, qmid = ql - 1;
    while (qmid < qr && h[qmid + 1].t <= mid) qmid++;
    top = 0;
    for (int i = l; i <= mid; i++) st[++top] = subqry{a[i].x, a[i].y, 0};
    for (int i = qmid + 1; i <= qr; i++) st[++top] = subqry{qt[h[i].id].x, qt[h[i].id].y, i};
    sort(st + 1, st + top + 1, [&](const subqry &u, const subqry &v) { return u.x == v.x ? (u.y == v.y ? u.id < v.id : u.y > v.y) : u.x < v.x; });
    for (int i = 1; i <= top; i++)
        if (st[i].id == 0) Upd(m2 - st[i].y + 1, 1);
        else hr[st[i].id] += Qry(m2 - st[i].y + 1);
    for (int i = 1; i <= top; i++)
        if (st[i].id == 0) Upd(m2 - st[i].y + 1, -1);
    Solve2(l, mid, ql, qmid), Solve2(mid + 1, r, qmid + 1, qr);
}

int s, t, pre[9], suf[9];
int cx(int x) { return (x > s ? 2 : (x == s ? 1 : 0)); }
int cy(int y) { return (y > t ? 2 : (y == t ? 1 : 0)); }
int tr(int i) { return cx(a[i].x) * 3 + cy(a[i].y); }

int main()
{
    // freopen("A.in", "r", stdin);
    // freopen("A.out", "w", stdout);
    #if DEBUG
    #else
    ios::sync_with_stdio(0), cin.tie(0);
    #endif
    Read(n), Read(m);
    for (int i = 1; i <= n; i++) Read(a[i].x), Read(a[i].y), b1[++m1] = a[i].x, b2[++m2] = a[i].y;
    sort(b1 + 1, b1 + m1 + 1), m1 = unique(b1 + 1, b1 + m1 + 1) - b1 - 1;
    sort(b2 + 1, b2 + m2 + 1), m2 = unique(b2 + 1, b2 + m2 + 1) - b2 - 1;
    b1[m1 + 1] = b2[m2 + 1] = -1;
    for (int i = 1; i <= n; i++)
        a[i].x = lower_bound(b1 + 1, b1 + m1 + 1, a[i].x) - b1, 
        a[i].y = lower_bound(b2 + 1, b2 + m2 + 1, a[i].y) - b2;
    for (int i = 1, j = 1; i <= m; i++)
    {
        Read(qt[i].x), Read(qt[i].y), qt[i].id = j++;
        int xx = lower_bound(b1 + 1, b1 + m1 + 1, qt[i].x) - b1;
        int yy = lower_bound(b2 + 1, b2 + m2 + 1, qt[i].y) - b2;
        if (qt[i].x != b1[xx] || qt[i].y != b2[yy]) { i--, m--; continue; }
        qt[i].x = xx, qt[i].y = yy;
    }
    for (int i = 1; i <= n; i++) X[1][a[i].x] = i, Y[1][a[i].y] = i;
    for (int i = n; i >= 1; i--) X[0][a[i].x] = i, Y[0][a[i].y] = i;
    for (int i = 1; i <= m; i++)
    {
        qt[i].lp[0] = X[0][qt[i].x], qt[i].rp[0] = Y[1][qt[i].y];
        qt[i].lp[1] = Y[0][qt[i].y], qt[i].rp[1] = X[1][qt[i].x];
        if (!qt[i].lp[0]) qt[i].lp[0] = n + 1;
        if (!qt[i].lp[1]) qt[i].lp[1] = n + 1;
    }

    // for (int i = 1; i <= n; i++) cout << a[i].x << ' ' << a[i].y << '\n';
    // cout << '\n';
    // for (int i = 1; i <= m; i++) cout << qt[i].x << ' ' << qt[i].y << '\n';
    // cout << '\n';

    // for (int i = 1; i <= m; i++)
    //     cout << qt[i].lp[0] << ' ' << qt[i].rp[0] << ' ' << qt[i].lp[1] << ' ' << qt[i].rp[1] << '\n'; cout << "\n";

    for (int i = 1; i <= n; i++) b1[i] = a[i].x, b2[i] = a[i].y, lg[i] = lg[i >> 1] + 1;
    rx.Build(b1), ry.Build(b2);
    
    for (int i = 1; i <= m; i++)
        for (int _ = 0; _ < 2; _++)
        {
            int xx = a[i].x, yy = a[i].y;
            int l = 2, r = qt[i].lp[_] - 1, mid, cpos = r;
            while (l <= r)
            {
                mid = l + r >> 1;
                if ((xx > a[1].x ? rx.qmax(1, mid) < xx : (xx < a[1].x ? rx.qmin(1, mid) > xx : rx.qmin(1, mid) == rx.qmax(1, mid))) &&
                    (yy > a[1].y ? ry.qmax(1, mid) < yy : (yy < a[1].y ? ry.qmin(1, mid) > yy : ry.qmin(1, mid) == ry.qmax(1, mid))))
                    l = mid + 1;
                else r = mid - 1;
            }
            qt[i].d0[_] = l;
            if (cpos == 0) qt[i].pcnt[_] = 0;
            else if ((rx.qmax(1, cpos) < xx || rx.qmin(1, cpos) > xx || rx.qmax(1, cpos) == rx.qmin(1, cpos)) &&
                (ry.qmax(1, cpos) < yy || ry.qmin(1, cpos) > yy || ry.qmax(1, cpos) == ry.qmin(1, cpos)))
                    qt[i].pcnt[_] = 1;
            else qt[i].pcnt[_] = 2;
        }
    for (int i = 1; i <= m; i++)
        for (int _ = 0; _ < 2; _++)
        {
            int xx = a[i].x, yy = a[i].y;
            int l = qt[i].rp[_] + 1, r = n - 1, mid, cpos = l;
            while (l <= r)
            {
                mid = l + r >> 1;
                if ((xx > a[n].x ? rx.qmax(mid, n) < xx : (xx < a[n].x ? rx.qmin(mid, n) > xx : rx.qmin(mid, n) == rx.qmax(mid, n))) && 
                    (yy > a[n].y ? ry.qmax(mid, n) < yy : (yy < a[n].y ? ry.qmin(mid, n) > yy : ry.qmin(mid, n) == ry.qmax(mid, n))))
                    r = mid - 1;
                else l = mid + 1;
            }
            qt[i].d1[_] = r;
            if (cpos == n + 1) qt[i].scnt[_] = 0;
            else if ((rx.qmax(cpos, n) < xx || rx.qmin(cpos, n) > xx || rx.qmax(cpos, n) == rx.qmin(cpos, n)) &&
                (ry.qmax(cpos, n) < yy || ry.qmin(cpos, n) > yy || ry.qmax(cpos, n) == ry.qmin(cpos, n)))
                    qt[i].scnt[_] = 1;
            else qt[i].scnt[_] = 2;
        }

    // for (int i = 1; i <= m; i++)
    //     cout << qt[i].d0[0] << ' ' << qt[i].d1[0] << ' ' << qt[i].d0[1] << ' ' << qt[i].d1[1] << '\n'; cout << '\n';
    // for (int i = 1; i <= m; i++)
    //     cout << qt[i].pcnt[0] << ' ' << qt[i].pcnt[1] << ' ' << qt[i].scnt[0] << ' ' << qt[i].scnt[1] << "\n";

    for (int i = 0; i <= m2; i++) bit1[i] = 2e9, bit2[i] = -2e9;
    for (int i = 1; i <= m; i++) idx[i] = i;
    for (int i = 1; i <= n; i++) ai[i] = i;
    sort(idx + 1, idx + m + 1, [&](int x, int y) { return qt[x].x < qt[y].x; });
    sort(ai + 1, ai + n + 1, [&](int x, int y) { return a[x].x < a[y].x; });
    for (int i = 1, j = 1; i <= m; i++)
    {
        while (j <= n && a[ai[j]].x < qt[idx[i]].x) Add(m2 - a[ai[j]].y + 1, ai[j]), j++;
        auto cur = Ask(m2 - qt[idx[i]].y);
        qt[idx[i]].pre[0] = cur.first, qt[idx[i]].suf[0] = cur.second;
    }
    for (int i = 0; i <= m2; i++) bit1[i] = 2e9, bit2[i] = -2e9;
    for (int i = m, j = n; i >= 1; i--)
    {
        while (j >= 1 && a[ai[j]].x > qt[idx[i]].x) Add(a[ai[j]].y, ai[j]), j--;
        auto cur = Ask(qt[idx[i]].y - 1);
        qt[idx[i]].pre[1] = cur.first, qt[idx[i]].suf[1] = cur.second;
    }

    for (int i = 1; i <= m; i++)
        for (int _ = 0; _ < 2; _++)
            if (qt[i].lp[_] + 1 < qt[i].rp[_])
                h[++tot] = node{qt[i].lp[_], i, -1, _}, h[++tot] = node{qt[i].rp[_] - 1, i, 1, _};
    sort(h + 1, h + tot + 1);
    Solve1(1, n, 1, tot);
    // for (int i = 1; i <= tot; i++)
    // {
    //     cout << h[i].t << ' ' << h[i].id << ' ' << h[i]._ << ' ' << h[i].f << ' ' << hr[i] << '\n';
    // }
    for (int i = 1; i <= tot; i++) qt[h[i].id].mid[h[i]._][0] += h[i].f * hr[i], hr[i] = 0;
    Solve2(1, n, 1, tot);
    for (int i = 1; i <= tot; i++) qt[h[i].id].mid[h[i]._][1] += h[i].f * hr[i], hr[i] = 0;

    // for (int i = 1; i <= m; i++, cout << '\n')
    //     for (int _ = 0; _ < 2; _++)
    //         cout << qt[i].mid[_][0] << ' ' << qt[i].mid[_][1] << ' '; cout << "\n";

    // for (int i = 1; i <= m; i++) cout << qt[i].pre[0] << ' ' << qt[i].pre[1] << ' ' << qt[i].suf[0] << ' ' << qt[i].suf[1] << "\n";

    for (int k = 1; k <= m; k++)
    {
        s = qt[k].x, t = qt[k].y;
        bool flag = 0;
        int lp = qt[k].lp[0], rp = qt[k].rp[0];
        if (lp <= rp)
        {
            memset(pre, 0, sizeof(pre)), memset(suf, 0, sizeof(suf));
            int d0 = qt[k].d0[0], d1 = qt[k].d1[0], c0 = qt[k].pcnt[0], c1 = qt[k].scnt[0];
            bool a0[3] = {0}, a1[3] = {0};

            if (qt[k].pre[0] < lp) pre[2] = qt[k].pre[0];
            if (qt[k].pre[1] < lp) pre[6] = qt[k].pre[1];
            if (qt[k].suf[0] > rp) suf[2] = qt[k].suf[0];
            if (qt[k].suf[1] > rp) suf[6] = qt[k].suf[1];

            if (lp == rp) { flag |= (c0 != 1 || (tr(1) != 2 && tr(1) != 6)) && (c1 != 1 || (tr(n) != 2 && tr(n) != 6)); goto NXT; }

            if (cy(a[lp].y) == 1)
            {
                if (c0 != 1 || (tr(1) != 2 && tr(1) != 6)) { flag = 1; goto NXT; }
                a0[3 - tr(1) / 2] = 1;
            }
            else
            {
                a0[cy(a[lp].y)] = c0 != 1 || !pre[cy(a[lp].y) * 2 + 2];
                a0[2 - cy(a[lp].y)] = pre[cy(a[lp].y) * 2 + 2] && (pre[cy(a[lp].y) * 2 + 2] != d0 || tr(1) != 6 - 2 * cy(a[lp].y));
            }
            if (cx(a[rp].x) == 1)
            {
                if (c1 != 1 || (tr(n) != 2 && tr(n) != 6)) { flag = 1; goto NXT; }
                a1[tr(n) / 2 - 1] = 1;
            }
            else
            {
                a1[cx(a[rp].x)] = c1 != 1 || !suf[6 - 2 * cx(a[rp].x)];
                a1[2 - cx(a[rp].x)] = suf[6 - 2 * cx(a[rp].x)] && (suf[6 - 2 * cx(a[rp].x)] != d1 || tr(n) != cx(a[rp].x) * 2 + 2);
            }

            // cout << a0[0] << ' ' << a0[2] << ' ' << a1[0] << ' ' << a1[2] << '\n';
            if ((a0[0] && a1[0]) || (a0[2] && a1[2])) { flag = 1; goto NXT; }
            bool f1 = 1, f2 = 1;
            if (a0[0]) f1 = 0; if (a0[2]) f2 = 0;
            if (a1[0]) f2 = 0; if (a1[2]) f1 = 0;
            // cout << f1 << " " << f2 << "\n";
            if (lp + 1 < rp && qt[k].mid[0][0]) f1 = 0;
            if (lp + 1 < rp && qt[k].mid[0][1]) f2 = 0;
            // cout << f1 << ' ' << f2 << "\n";
            flag |= !(f1 || f2);
        }
        NXT:
        lp = qt[k].lp[1], rp = qt[k].rp[1];
        if (lp <= rp)
        {
            memset(pre, 0, sizeof(pre)), memset(suf, 0, sizeof(suf));
            int d0 = qt[k].d0[1], d1 = qt[k].d1[1], c0 = qt[k].pcnt[1], c1 = qt[k].scnt[1];
            bool a0[3] = {0}, a1[3] = {0};

            if (qt[k].pre[0] < lp) pre[2] = qt[k].pre[0];
            if (qt[k].pre[1] < lp) pre[6] = qt[k].pre[1];
            if (qt[k].suf[0] > rp) suf[2] = qt[k].suf[0];
            if (qt[k].suf[1] > rp) suf[6] = qt[k].suf[1];

            if (lp == rp) { flag |= (c0 != 1 || (tr(1) != 2 && tr(1) != 6)) && (c1 != 1 || (tr(n) != 2 && tr(n) != 6)); goto END; }

            if (cx(a[lp].x) == 1)
            {
                if (c0 != 1 || (tr(1) != 2 && tr(1) != 6)) { flag = 1; goto END; }
                a0[tr(1) / 2 - 1] = 1;
            }
            else
            {
                a0[cx(a[lp].x)] = c0 != 1 || !pre[6 - 2 * cx(a[lp].x)];
                a0[2 - cx(a[lp].x)] = pre[6 - 2 * cx(a[lp].x)] && (pre[6 - 2 * cx(a[lp].x)] != d0 || tr(1) != cx(a[lp].x) * 2 + 2);
            }
            if (cy(a[rp].y) == 1)
            {
                if (c1 != 1 || (tr(n) != 2 && tr(n) != 6)) { flag = 1; goto END; }
                a1[3 - tr(n) / 2] = 1;
            }
            else
            {
                a1[cy(a[rp].y)] = c1 != 1 || !suf[cy(a[rp].y) * 2 + 2];
                a1[2 - cy(a[rp].y)] = suf[cy(a[rp].y) * 2 + 2] && (suf[cy(a[rp].y) * 2 + 2] != d1 || tr(n) != 6 - 2 * cx(a[rp].y));
            }

            // cout << a0[0] << ' ' << a0[2] << ' ' << a1[0] << ' ' << a1[2] << '\n';
            if ((a0[0] && a1[0]) || (a0[2] && a1[2])) { flag = 1; goto END; }
            bool f1 = 1, f2 = 1;
            if (a0[0]) f2 = 0; if (a0[2]) f1 = 0;
            if (a1[0]) f1 = 0; if (a1[2]) f2 = 0;
            if (lp + 1 < rp && qt[k].mid[1][0]) f1 = 0;
            if (lp + 1 < rp && qt[k].mid[1][1]) f2 = 0;
            flag |= !(f1 || f2);
        }
        END:
        if (flag) cout << qt[k].id << ' ';
    }
    return 0;
}

詳細信息

Subtask #1:

score: 0
Wrong Answer

Test #1:

score: 11
Accepted
time: 0ms
memory: 24212kb

input:

2 10
171631799 561094698
171631799 867698918
126573648 561094698
171631799 867698918
171631799 561094698
126573648 561094698
126573648 561094698
171631799 561094698
126573648 561094698
126573648 561094698
126573648 561094698
171631799 561094698

output:

2 3 6 10 

result:

ok 4 number(s): "2 3 6 10"

Test #2:

score: 11
Accepted
time: 0ms
memory: 30236kb

input:

3 10
713180371 43103927
713180371 136832929
853543805 251852293
892623928 251852293
713180371 136832929
713180371 43103927
853543805 43103927
892623928 136832929
713180371 43103927
853543805 43103927
892623928 136832929
713180371 43103927
892623928 251852293

output:

2 3 6 9 

result:

ok 4 number(s): "2 3 6 9"

Test #3:

score: 11
Accepted
time: 0ms
memory: 28188kb

input:

4 10
254412080 855555783
254412080 534954259
610506813 184822793
804271098 233942602
804271098 233942602
536633825 184822793
254412080 855555783
804271098 233942602
536633825 233942602
254412080 855555783
804271098 534954259
610506813 534954259
536633825 184822793
536633825 855555783

output:

1 3 4 6 7 8 

result:

ok 6 numbers

Test #4:

score: 11
Accepted
time: 3ms
memory: 26176kb

input:

5 10
148547041 170447714
617759855 170447714
617759855 963162312
148547041 948767426
423489361 460053818
423489361 460053818
817714720 948767426
617759855 673099807
617759855 963162312
617759855 673099807
423489361 460053818
423489361 460053818
817714720 948767426
817714720 170447714
148547041 67309...

output:

1 4 6 7 

result:

ok 4 number(s): "1 4 6 7"

Test #5:

score: 11
Accepted
time: 0ms
memory: 30280kb

input:

6 10
452189481 369706489
974106249 369706489
152471743 55874110
152471743 7767562
623180600 783682263
116778263 783682263
974106249 369706489
452189481 7767562
623180600 7767562
116778263 783682263
330861484 7767562
452189481 640079581
974106249 640079581
623180600 783682263
974106249 7767562
116778...

output:

1 4 8 

result:

ok 3 number(s): "1 4 8"

Test #6:

score: 11
Accepted
time: 0ms
memory: 26180kb

input:

7 10
546365360 29458595
459505526 682968936
892069847 113227141
892069847 682968936
459505526 895773339
436538726 29458595
892069847 29458595
892069847 21442381
200908509 682968936
84249914 782064261
691849455 682968936
691849455 682968936
691849455 21442381
691849455 682968936
691849455 21442381
84...

output:


result:

ok 0 number(s): ""

Test #7:

score: 11
Accepted
time: 0ms
memory: 28160kb

input:

8 10
53884460 816621582
931458006 534340303
53884460 621933704
317941616 487589985
53884460 793793344
831491668 487589985
53884460 816621582
53884460 417129074
831491668 417129074
317941616 534340303
395845824 793793344
395845824 417129074
317941616 166559933
100528187 487589985
83144683 816621582
8...

output:

2 10 

result:

ok 2 number(s): "2 10"

Test #8:

score: 11
Accepted
time: 0ms
memory: 28168kb

input:

9 10
703128946 628411749
703128946 876135124
678057110 783023566
563107567 908344997
255577987 177945114
703128946 177945114
519769912 951772210
678057110 470396423
703128946 470396423
563107567 783023566
813952930 470396423
230207898 177945114
230207898 628411749
519769912 555485281
703128946 78302...

output:

1 6 

result:

ok 2 number(s): "1 6"

Test #9:

score: 11
Accepted
time: 2ms
memory: 28308kb

input:

10 10
411828800 587312736
368564282 297078085
368564282 265187364
287645241 405039514
368564282 535066135
368564282 265187364
701629305 581674146
894581821 581674146
600278299 347261251
368564282 390901645
633230417 151902557
287645241 297078085
1782717 405039514
287645241 587312736
894581821 587312...

output:

2 5 7 

result:

ok 3 number(s): "2 5 7"

Test #10:

score: 11
Accepted
time: 0ms
memory: 28244kb

input:

11 10
594865443 637250974
223004376 637250974
785025296 887146590
120666718 887146590
31665956 652873089
594865443 887146590
1682073 112213166
31665956 121276446
785025296 121276446
28305142 652873089
28305142 661968377
1682073 120498688
938018458 887146590
120666718 112213166
28305142 112213166
223...

output:

10 

result:

ok 1 number(s): "10"

Test #11:

score: 0
Wrong Answer
time: 3ms
memory: 30276kb

input:

12 10
39186066 168002748
671722214 32295292
39186066 469855569
442075770 469855569
689698028 968471023
3489285 168002748
671722214 968471023
182809077 689539890
481317320 742954502
265274602 32295292
265274602 26013512
481317320 742954502
976556207 168425358
689698028 32295292
749415058 545907259
24...

output:


result:

wrong answer Answer contains longer sequence [length = 1], but output contains 0 elements

Subtask #2:

score: 0
Skipped

Dependency #1:

0%

Subtask #3:

score: 0
Skipped

Dependency #1:

0%

Subtask #4:

score: 0
Skipped

Dependency #1:

0%