Submission #1868122


Source Code Expand

import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.util.Arrays;

public class Main {
    private static final int[] dr8 = new int[] { 0, -1, -1, -1, 0, 1, 1, 1, };
    private static final int[] dc8 = new int[] { -1, -1, 0, 1, 1, 1, 0, -1, };

    static final Watch watch = new Watch();
    static final XorShift rng = new XorShift(System.nanoTime());

    private static final int EMPTY = (1 << 10) - 1;

    private int NV;
    private int S0;
    private int S;

    private IntArray[] connectedVs;
    private IntArray[] connectedVsEmb;

    private boolean[][] isConnected;
    private int[][] isConnectedEmb;
    private int[][] inverseEmb;

    private int score;
    private int bestScore = (int) -1e9;
    private int scoreBase = 5000;
    private int scoreAdd = 0;
    private int scoreBonus = 0;
    private int scoreLoss = 0;

    private int sumScores() {
        return scoreBase + scoreAdd + scoreBonus - scoreLoss;
    }

    private IntArray[] embVSets;
    private int preservedEdges;
    private int NE;

    private String[] run(int NV, int NE, int[] u, int[] v, int NEmbV, int NEmbE, int[] a, int[] b) {
        init(NV, NE, u, v, NEmbV, NEmbE, a, b);
        solve();
        String[] solution = makeSolution();
        return solution;
    }

    private void init(int NV, int NE, int[] u, int[] v, int NEmbV, int NEmbE, int[] a, int[] b) {
        this.NV = NV;
        this.NE = NE;

        for (int i = 0; i < u.length; i++) {
            u[i]--;
        }
        for (int i = 0; i < v.length; i++) {
            v[i]--;
        }

        preservedEdges = 0;
        this.isConnected = new boolean[NV][NV];
        for (int i = 0; i < u.length; i++) {
            isConnected[u[i]][v[i]] = true;
            isConnected[v[i]][u[i]] = true;
        }

        connectedVs = new IntArray[NV];
        for (int i = 0; i < connectedVs.length; i++) {
            connectedVs[i] = new IntArray(1 << 9);
        }
        for (int i = 0; i < u.length; i++) {
            connectedVs[u[i]].add(v[i]);
            connectedVs[v[i]].add(u[i]);
        }
        this.isConnectedEmb = new int[NV][NV];
        for (int i = 0; i < NV; i++) {
            Arrays.fill(isConnectedEmb[i], -1);
        }
        connectedVsEmb = new IntArray[NV];
        for (int i = 0; i < connectedVsEmb.length; i++) {
            connectedVsEmb[i] = new IntArray(1 << 9);
        }
        for (int i = 0; i < a.length; i++) {
            a[i]--;
        }
        for (int i = 0; i < b.length; i++) {
            b[i]--;
        }

        S0 = (int) Math.sqrt(NEmbV + 1e-9);
        S = S0;
        if (S >= NV) {
            S = NV;
        }
        embVSets = new IntArray[NV];
        for (int i = 0; i < embVSets.length; i++) {
            embVSets[i] = new IntArray(1 << 9);
        }
        bestEmbVSets = new IntArray[NV];
        for (int i = 0; i < bestEmbVSets.length; i++) {
            bestEmbVSets[i] = new IntArray(1 << 9);
        }

        inverseEmb = new int[S][S];
        for (int r = 0; r < S; r++) {
            for (int c = 0; c < S; c++) {
                inverseEmb[r][c] = EMPTY;
            }
        }

        scoreLoss -= NV;
    }

    private void solve() {

        greedy();

        score = scoreAdd;
        saveBest();
        SA();
    }

    private void greedy() {

        int v = 0;
        int usedPoints = 0;
        for (int r = 0; r < S; r++) {

            if (v >= NV) {
                break;
            }

            int length = (S * S - usedPoints) / (NV - v);

            for (int c = 0; c < S; c++) {
                if (inverseEmb[r][c] != EMPTY) {
                    continue;
                }

                int r2 = r;
                int c2 = c;
                for (int l = 0; l < length; l++) {
                    if (inverseEmb[r2][c2] != EMPTY) {
                        break;
                    }

                    if (v >= NV) {
                        int r3;
                        int c3;
                        if (isLowerRightDirection(r2, c2)) {
                            r3 = r2 - dr8[5];
                            c3 = c2 - dc8[5];
                        } else {
                            r3 = r2 - dr8[7];
                            c3 = c2 - dc8[7];
                        }
                        if (!isValid(r3, 0, S)) {
                            break;
                        }
                        if (!isValid(c3, 0, S)) {
                            if (c3 < 0) {
                                c3 = 0;
                            } else if (c3 >= S) {
                                c3 = S - 1;
                            }
                        }
                        add(toEmbV(r2, c2), inverseEmb[r3][c3]);
                    } else {
                        add(toEmbV(r2, c2), v);
                    }
                    usedPoints++;

                    if (isLowerRightDirection(r2, c2)) {
                        r2 += dr8[5];
                        c2 += dc8[5];
                    } else {
                        r2 += dr8[7];
                        c2 += dc8[7];
                    }

                    if (!isValid(r2, 0, S)) {
                        break;
                    } else if (!isValid(c2, 0, S)) {
                        if (c2 < 0) {
                            c2 = 0;
                        } else if (c2 >= S) {
                            c2 = S - 1;
                        }
                    }
                }

                v++;
            }
        }

    }

    private boolean isLowerRightDirection(int r2, int c2) {
        return (r2 + c2) % 2 == 0;
    }

    private boolean add(int embV, int v) {
        int embR = toEmbR(embV);
        int embC = toEmbC(embV);
        assert inverseEmb[embR][embC] == EMPTY;
        assert checkCanAdd(v, embR, embC);

        inverseEmb[embR][embC] = v;
        embVSets[v].add(embV);
        scoreLoss++;
        for (int d = 0; d < dr8.length; d++) {
            int embNextR = embR + dr8[d];
            int embNextC = embC + dc8[d];
            if (!isValid(embNextR, 0, S)) {
                continue;
            }
            if (!isValid(embNextC, 0, S)) {
                continue;
            }
            if (inverseEmb[embNextR][embNextC] == EMPTY) {
                continue;
            }
            int nextV = inverseEmb[embNextR][embNextC];
            assert nextV >= 0 && nextV < NV;
            if (!isConnected[nextV][v]) {
                continue;
            }
            if (isConnectedEmb[nextV][v] >= 0) {
                continue;
            }

            isConnectedEmb[v][nextV] = connectedVsEmb[v].length;
            connectedVsEmb[v].add(nextV);

            isConnectedEmb[nextV][v] = connectedVsEmb[nextV].length;
            connectedVsEmb[nextV].add(v);
            scoreAdd += 100;
            preservedEdges++;
            if (preservedEdges == NE) {
                scoreBonus += 100000;
            }

        }
        return true;
    }

    private boolean adds(int[] embVs, int start, int end, int v) {
        for (int i = start; i < end; i++) {
            int embV = embVs[i];
            int embR = toEmbR(embV);
            int embC = toEmbC(embV);
            assert inverseEmb[embR][embC] == EMPTY;
            inverseEmb[embR][embC] = v;
            embVSets[v].add(embV);
            scoreLoss++;
            for (int d = 0; d < dr8.length; d++) {
                int embNextR = embR + dr8[d];
                int embNextC = embC + dc8[d];
                if (!isValid(embNextR, 0, S)) {
                    continue;
                }
                if (!isValid(embNextC, 0, S)) {
                    continue;
                }
                if (inverseEmb[embNextR][embNextC] == EMPTY) {
                    continue;
                }
                int nextV = inverseEmb[embNextR][embNextC];
                assert nextV >= 0 && nextV < NV;
                if (!isConnected[v][nextV]) {
                    continue;
                }
                if (isConnectedEmb[v][nextV] >= 0) {
                    continue;
                }
                isConnectedEmb[v][nextV] = connectedVsEmb[v].length;
                connectedVsEmb[v].add(nextV);
                isConnectedEmb[nextV][v] = connectedVsEmb[nextV].length;
                connectedVsEmb[nextV].add(v);
                scoreAdd += 100;
                preservedEdges++;
                if (preservedEdges == NE) {
                    scoreBonus += 100000;
                }
            }
        }
        return true;
    }

    private IntArray change = new IntArray();

    private int simulateAdds(int[] embVs, int start, int end, int v) {
        countUsed++;

        update(embVs, start, end, v);

        int score = 0;

        for (int i = start; i < end; i++) {
            int embV = embVs[i];
            int embR = toEmbR(embV);
            int embC = toEmbC(embV);
            for (int d = 0; d < dr8.length; d++) {
                int embNextR = embR + dr8[d];
                int embNextC = embC + dc8[d];
                if (!isValid(embNextR, 0, S)) {
                    continue;
                }
                if (!isValid(embNextC, 0, S)) {
                    continue;
                }
                if (inverseEmb[embNextR][embNextC] == EMPTY) {
                    continue;
                }
                int nextV = inverseEmb[embNextR][embNextC];
                assert nextV >= 0 && nextV < NV;
                if (!isConnected[nextV][v]) {
                    continue;
                }

                if (used[nextV] == countUsed) {
                    continue;
                }
                used[nextV] = countUsed;
                score += 100;
            }
        }
        return score;

    }

    private void update(int[] embVs, int start, int end, int v) {
        for (int i = start; i < end; i++) {
            int embV = embVs[i];
            int embR = toEmbR(embV);
            int embC = toEmbC(embV);
            change.add((embR << 20) | (embC << 10) | (inverseEmb[embR][embC]));
            inverseEmb[embR][embC] = v;
        }
    }

    private boolean checkCanAdd(int v, int embR, int embC) {
        boolean b = embVSets[v].length == 0;
        boolean b2 = false;
        if (!b) {
            for (int d = 0; d < dr8.length; d++) {
                int embNextR = embR + dr8[d];
                int embNextC = embC + dc8[d];
                if (!isValid(embNextR, 0, S)) {
                    continue;
                }
                if (!isValid(embNextC, 0, S)) {
                    continue;
                }
                if (inverseEmb[embNextR][embNextC] == EMPTY) {
                    continue;
                }
                int nextV = inverseEmb[embNextR][embNextC];
                if (nextV == v) {
                    b2 = true;
                    break;
                }
            }
        }
        boolean b3 = b || b2;
        return b3;
    }

    private boolean removeAll(int v) {

        for (int i = 0; i < embVSets[v].length; i++) {
            int embV = embVSets[v].values[i];

            int embR = toEmbR(embV);
            int embC = toEmbC(embV);
            inverseEmb[embR][embC] = EMPTY;

        }
        scoreLoss -= embVSets[v].length;
        embVSets[v].clear();

        for (int i = connectedVsEmb[v].length - 1; i >= 0; i--) {
            int nextV = connectedVsEmb[v].values[i];
            remove(v, nextV);
            remove(nextV, v);
            scoreAdd -= 100;
            preservedEdges--;
            if (preservedEdges + 1 == NE) {
                scoreBonus -= 100000;
            }
        }
        return true;

    }

    private void remove(int v, int nextV) {
        int index = isConnectedEmb[v][nextV];
        IntArray vs = connectedVsEmb[v];
        if (index != vs.length - 1) {
            int otherV = vs.values[vs.length - 1];
            vs.values[vs.length - 1] = vs.values[index];
            vs.values[index] = otherV;
            isConnectedEmb[v][otherV] = index;
        }
        vs.remove();
        isConnectedEmb[v][nextV] = -1;
    }

    private int[] used = new int[1 << 9];
    private int countUsed = 0;
    private SAState sa = new SAState();

    private void SA() {
        int mask = (1 << 10) - 1;

        sa.init();
        for (;; sa.loop++) {
            if ((sa.loop & mask) == 0) {
                sa.updateTime();

                if (sa.isTLE()) {
                    loadBest();
                    break;
                }

                sa.updateTemperature();
            }

            change();
        }
    }

    private void change() {
        int random = (int) (3 * rng.nextDouble());
        if (random == 0) {
            swap();
        } else if (random == 1) {
            changeLength();
        } else {
            moveLine();
        }
    }

    private IntArray embVs1 = new IntArray();
    private IntArray embVs2 = new IntArray();
    private IntArray embVs3 = new IntArray();

    private void moveLine() {
        int v = (int) (NV * rng.nextDouble());

        boolean isUpper = rng.nextDouble() < 0.5;

        int embV0;
        {
            assert checkOrder(v);
            IntArray embVSet = embVSets[v];
            embV0 = embVSet.values[isUpper ? 0 : embVSet.length - 1];
            int embR0 = toEmbR(embV0);
            if (embR0 == 0) {
                isUpper = false;
                embV0 = embVSet.values[isUpper ? 0 : embVSet.length - 1];
            } else if (embR0 == S - 1) {
                isUpper = true;
                embV0 = embVSet.values[isUpper ? 0 : embVSet.length - 1];
            }
        }

        int sameLineV = EMPTY;
        int embR0 = toEmbR(embV0);
        int embC0 = toEmbC(embV0);
        if (isLowerRightDirection(embR0, embC0)) {
            if (isUpper) {
                int r1 = embR0 + dr8[1];
                int c1 = embC0 + dc8[1];
                if (c1 < 0) {
                    c1 = 0;
                } else if (c1 >= S) {
                    c1 = S - 1;
                }
                if (isValid(r1, 0, S)) {
                    assert inverseEmb[r1][c1] != v;
                    assert inverseEmb[r1][c1] != EMPTY;
                    sameLineV = inverseEmb[r1][c1];
                }
            } else {
                int r5 = embR0 + dr8[5];
                int c5 = embC0 + dc8[5];
                if (c5 < 0) {
                    c5 = 0;
                } else if (c5 >= S) {
                    c5 = S - 1;
                }
                if (isValid(r5, 0, S)) {
                    assert inverseEmb[r5][c5] != v;
                    assert inverseEmb[r5][c5] != EMPTY;
                    sameLineV = inverseEmb[r5][c5];
                }
            }
        } else {
            if (isUpper) {
                int r3 = embR0 + dr8[3];
                int c3 = embC0 + dc8[3];
                if (c3 < 0) {
                    c3 = 0;
                } else if (c3 >= S) {
                    c3 = S - 1;
                }
                if (isValid(r3, 0, S)) {
                    assert inverseEmb[r3][c3] != v;
                    assert inverseEmb[r3][c3] != EMPTY;
                    sameLineV = inverseEmb[r3][c3];
                }
            } else {
                int r7 = embR0 + dr8[7];
                int c7 = embC0 + dc8[7];
                if (c7 < 0) {
                    c7 = 0;
                } else if (c7 >= S) {
                    c7 = S - 1;
                }
                if (isValid(r7, 0, S)) {
                    assert inverseEmb[r7][c7] != v;
                    assert inverseEmb[r7][c7] != EMPTY;
                    sameLineV = inverseEmb[r7][c7];
                }
            }
        }

        if (sameLineV == EMPTY) {
            return;
        }

        int toV = (int) (NV * rng.nextDouble());
        for (int k = 0; k < NV; k++) {
            if (toV == v || toV == sameLineV || embVSets[toV].length <= 1) {
                toV = (int) (NV * rng.nextDouble());
            } else {
                break;
            }
        }
        if (toV == v || toV == sameLineV || embVSets[toV].length <= 1) {
            return;
        }

        int currentLengthToV = embVSets[toV].length;
        boolean vIsUpperAtToV = rng.nextDouble() < 0.5;

        if (isUpper) {
            embVs1.clear();
            for (int i = 0; i < embVSets[sameLineV].length; i++) {
                embVs1.add(embVSets[sameLineV].values[i]);
            }
            for (int i = 0; i < embVSets[v].length; i++) {
                embVs1.add(embVSets[v].values[i]);
            }
        } else {
            embVs1.clear();
            for (int i = 0; i < embVSets[v].length; i++) {
                embVs1.add(embVSets[v].values[i]);
            }
            for (int i = 0; i < embVSets[sameLineV].length; i++) {
                embVs1.add(embVSets[sameLineV].values[i]);
            }
        }
        embVs3.clear();
        for (int i = 0; i < embVSets[toV].length; i++) {
            embVs3.add(embVSets[toV].values[i]);
        }

        int newLengthV = 1 + (int) ((currentLengthToV - 1) * rng.nextDouble());
        int newLengthToV = currentLengthToV - newLengthV;
        assert newLengthV > 0;
        assert newLengthToV > 0;

        int beforeV = -100 * connectedVsEmb[v].length;
        int beforeSameLineV = -100 * connectedVsEmb[sameLineV].length;
        if (isConnectedEmb[sameLineV][v] >= 0) {
            beforeSameLineV += 100;
        }
        int beforeToV = -100 * connectedVsEmb[toV].length;
        if (isConnectedEmb[toV][v] >= 0) {
            beforeToV += 100;
        }
        if (isConnectedEmb[toV][sameLineV] >= 0) {
            beforeToV += 100;
        }

        if (vIsUpperAtToV) {
            update(embVs3.values, 0, newLengthV, EMPTY);
            update(embVs3.values, newLengthV, newLengthV + newLengthToV, EMPTY);
        } else {
            update(embVs3.values, 0, newLengthToV, EMPTY);
            update(embVs3.values, newLengthToV, newLengthToV + newLengthV, EMPTY);
        }

        int afterSameLineV = simulateAdds(embVs1.values, 0, embVs1.length, sameLineV);
        int afterV;
        int afterToV;
        if (vIsUpperAtToV) {
            afterV = simulateAdds(embVs3.values, 0, newLengthV, v);
            afterToV = simulateAdds(embVs3.values, newLengthV, newLengthV + newLengthToV, toV);
        } else {
            afterToV = simulateAdds(embVs3.values, 0, newLengthToV, toV);
            afterV = simulateAdds(embVs3.values, newLengthToV, newLengthToV + newLengthV, v);
        }

        int newScore = score + beforeV + beforeToV + beforeSameLineV + afterV + afterToV + afterSameLineV;

        for (int i = change.length - 1; i >= 0; i--) {
            int value = change.values[i];
            int embR = (value >>> 20) & ((1 << 10) - 1);
            int embC = (value >>> 10) & ((1 << 10) - 1);
            int v3 = (value >>> 0) & ((1 << 10) - 1);
            inverseEmb[embR][embC] = v3;
        }
        change.clear();
        if (newScore >= score || sa.accept(newScore, score)) {
            removeAll(v);
            removeAll(sameLineV);
            removeAll(toV);

            adds(embVs1.values, 0, embVs1.length, sameLineV);
            if (vIsUpperAtToV) {
                adds(embVs3.values, 0, newLengthV, v);
                adds(embVs3.values, newLengthV, newLengthV + newLengthToV, toV);
            } else {
                adds(embVs3.values, 0, newLengthToV, toV);
                adds(embVs3.values, newLengthToV, newLengthToV + newLengthV, v);
            }

            score = newScore;

            saveBest();
        }

    }

    private void changeLength() {
        int v = (int) (NV * rng.nextDouble());

        boolean isUpper = rng.nextDouble() < 0.5;

        int embV0;
        {
            assert checkOrder(v);
            IntArray embVSet = embVSets[v];
            embV0 = embVSet.values[isUpper ? 0 : embVSet.length - 1];
            int embR0 = toEmbR(embV0);
            if (embR0 == 0) {
                isUpper = false;
                embV0 = embVSet.values[isUpper ? 0 : embVSet.length - 1];
            } else if (embR0 == S - 1) {
                isUpper = true;
                embV0 = embVSet.values[isUpper ? 0 : embVSet.length - 1];
            }
        }

        int sameLineV = EMPTY;
        int embR0 = toEmbR(embV0);
        int embC0 = toEmbC(embV0);
        if (isLowerRightDirection(embR0, embC0)) {
            if (isUpper) {
                int r1 = embR0 + dr8[1];
                int c1 = embC0 + dc8[1];
                if (c1 < 0) {
                    c1 = 0;
                } else if (c1 >= S) {
                    c1 = S - 1;
                }
                if (isValid(r1, 0, S)) {
                    assert inverseEmb[r1][c1] != v;
                    assert inverseEmb[r1][c1] != EMPTY;
                    sameLineV = inverseEmb[r1][c1];
                }
            } else {
                int r5 = embR0 + dr8[5];
                int c5 = embC0 + dc8[5];
                if (c5 < 0) {
                    c5 = 0;
                } else if (c5 >= S) {
                    c5 = S - 1;
                }
                if (isValid(r5, 0, S)) {
                    assert inverseEmb[r5][c5] != v;
                    assert inverseEmb[r5][c5] != EMPTY;
                    sameLineV = inverseEmb[r5][c5];
                }
            }
        } else {
            if (isUpper) {
                int r3 = embR0 + dr8[3];
                int c3 = embC0 + dc8[3];
                if (c3 < 0) {
                    c3 = 0;
                } else if (c3 >= S) {
                    c3 = S - 1;
                }
                if (isValid(r3, 0, S)) {
                    assert inverseEmb[r3][c3] != v;
                    assert inverseEmb[r3][c3] != EMPTY;
                    sameLineV = inverseEmb[r3][c3];
                }
            } else {
                int r7 = embR0 + dr8[7];
                int c7 = embC0 + dc8[7];
                if (c7 < 0) {
                    c7 = 0;
                } else if (c7 >= S) {
                    c7 = S - 1;
                }
                if (isValid(r7, 0, S)) {
                    assert inverseEmb[r7][c7] != v;
                    assert inverseEmb[r7][c7] != EMPTY;
                    sameLineV = inverseEmb[r7][c7];
                }
            }
        }

        if (sameLineV == EMPTY) {
            return;
        }

        embVs1.clear();
        if (isUpper) {
            for (int i = 0; i < embVSets[sameLineV].length; i++) {
                embVs1.add(embVSets[sameLineV].values[i]);
            }
            for (int i = 0; i < embVSets[v].length; i++) {
                embVs1.add(embVSets[v].values[i]);
            }
        } else {
            for (int i = 0; i < embVSets[v].length; i++) {
                embVs1.add(embVSets[v].values[i]);
            }
            for (int i = 0; i < embVSets[sameLineV].length; i++) {
                embVs1.add(embVSets[sameLineV].values[i]);
            }
        }

        int currentLengthV = embVSets[v].length;
        int currentLengthV2 = embVSets[sameLineV].length;

        int beforeV = -100 * connectedVsEmb[v].length;
        int beforeSameLineV = -100 * connectedVsEmb[sameLineV].length;
        if (isConnectedEmb[sameLineV][v] >= 0) {
            beforeSameLineV += 100;
        }

        int newLengthV = 1 + (int) ((currentLengthV + currentLengthV2 - 1) * rng.nextDouble());
        int newLengthV2 = currentLengthV + currentLengthV2 - newLengthV;
        assert newLengthV > 0;
        assert newLengthV2 > 0;

        int afterV;
        int afterSameLineV;
        if (isUpper) {
            update(embVs1.values, newLengthV2, newLengthV + newLengthV2, EMPTY);
            afterSameLineV = simulateAdds(embVs1.values, 0, newLengthV2, sameLineV);
            afterV = simulateAdds(embVs1.values, newLengthV2, newLengthV + newLengthV2, v);
        } else {
            update(embVs1.values, newLengthV, newLengthV + newLengthV2, EMPTY);
            afterV = simulateAdds(embVs1.values, 0, newLengthV, v);
            afterSameLineV = simulateAdds(embVs1.values, newLengthV, newLengthV + newLengthV2, sameLineV);
        }

        int newScore = score + beforeV + beforeSameLineV + afterV + afterSameLineV;

        for (int i = change.length - 1; i >= 0; i--) {
            int value = change.values[i];
            int embR = (value >>> 20) & ((1 << 10) - 1);
            int embC = (value >>> 10) & ((1 << 10) - 1);
            int v3 = (value >>> 0) & ((1 << 10) - 1);
            inverseEmb[embR][embC] = v3;
        }
        change.clear();
        if (newScore >= score || sa.accept(newScore, score)) {
            removeAll(v);
            removeAll(sameLineV);

            if (isUpper) {
                adds(embVs1.values, 0, newLengthV2, sameLineV);
                adds(embVs1.values, newLengthV2, newLengthV + newLengthV2, v);
            } else {
                adds(embVs1.values, 0, newLengthV, v);
                adds(embVs1.values, newLengthV, newLengthV + newLengthV2, sameLineV);
            }

            score = newScore;
            saveBest();
        }
    }

    private boolean checkOrder(int v) {
        IntArray embVSet = embVSets[v];
        for (int i = 1; i < embVSet.length; i++) {
            if (toEmbR(embVSet.values[i - 1]) >= toEmbR(embVSet.values[i])) {
                return false;
            }
        }
        return true;
    }

    private void swap() {
        int v0 = (int) (NV * rng.nextDouble());
        int embV0 = embVSets[v0].values[(int) (embVSets[v0].length * rng.nextDouble())];
        int embR0 = toEmbR(embV0);
        int embC0 = toEmbC(embV0);

        int embNextR = -1;
        int embNextC = -1;
        while (!isValid(embNextR, 0, S) || !isValid(embNextC, 0, S) || inverseEmb[embNextR][embNextC] == v0) {
            int d = (int) (dr8.length * rng.nextDouble());
            embNextR = embR0 + dr8[d];
            embNextC = embC0 + dc8[d];
        }

        int v = inverseEmb[embNextR][embNextC];

        int v2 = connectedVs[v0].values[(int) (connectedVs[v0].length * rng.nextDouble())];
        for (int k = 0; k < 3; k++) {
            if (v2 != v) {
                break;
            }
            v2 = connectedVs[v0].values[(int) (connectedVs[v0].length * rng.nextDouble())];
        }
        if (v2 == v) {
            return;
        }

        embVs1.clear();
        for (int i = 0; i < embVSets[v].length; i++) {
            embVs1.add(embVSets[v].values[i]);
        }
        embVs2.clear();
        for (int i = 0; i < embVSets[v2].length; i++) {
            embVs2.add(embVSets[v2].values[i]);
        }

        int beforeV = -100 * connectedVsEmb[v].length;
        int beforeV2 = -100 * connectedVsEmb[v2].length;
        if (isConnectedEmb[v2][v] >= 0) {
            beforeV2 += 100;
        }

        update(embVs2.values, 0, embVs2.length, EMPTY);
        int afterV2 = simulateAdds(embVs1.values, 0, embVs1.length, v2);
        int afterV = simulateAdds(embVs2.values, 0, embVs2.length, v);

        int newScore = score + beforeV + beforeV2 + afterV + afterV2;

        for (int i = change.length - 1; i >= 0; i--) {
            int value = change.values[i];
            int embR = (value >>> 20) & ((1 << 10) - 1);
            int embC = (value >>> 10) & ((1 << 10) - 1);
            int v3 = (value >>> 0) & ((1 << 10) - 1);
            inverseEmb[embR][embC] = v3;
        }
        change.clear();
        if (newScore >= score || sa.accept(newScore, score)) {
            removeAll(v);
            removeAll(v2);

            adds(embVs1.values, 0, embVs1.length, v2);
            adds(embVs2.values, 0, embVs2.length, v);

            score = newScore;
            saveBest();

        }
    }

    private IntArray[] bestEmbVSets;

    private void saveBest() {
        if (score > bestScore) {
            bestScore = score;
            for (int v = 0; v < NV; v++) {
                System.arraycopy(embVSets[v].values, 0, bestEmbVSets[v].values, 0, embVSets[v].length);
                bestEmbVSets[v].length = embVSets[v].length;
            }
        }
    }

    private void loadBest() {
        score = bestScore;
        for (int v = 0; v < NV; v++) {
            System.arraycopy(bestEmbVSets[v].values, 0, embVSets[v].values, 0, bestEmbVSets[v].length);
            embVSets[v].length = bestEmbVSets[v].length;
        }
    }

    private String[] makeSolution() {
        String[] res = new String[NV];
        for (int v = 0; v < NV; v++) {

            IntArray embVSet = embVSets[v];

            StringBuilder resV = new StringBuilder();
            resV.append(embVSet.length);
            for (int i = 0; i < embVSet.length; i++) {
                int embV = embVSet.values[i];
                resV.append(" " + (embV + 1));
            }
            res[v] = resV.toString();
        }
        return res;
    }

    private boolean isValid(int v, int min, int sup) {
        return v >= min && v < sup;
    }

    private int toEmbV(int embR, int embC) {
        return embR * S0 + embC;
    }

    private int toEmbC(int embV) {
        return embV % S0;
    }

    private int toEmbR(int embV) {
        return embV / S0;
    }

    public static void main(String[] args) {
        try (BufferedReader br = new BufferedReader(new InputStreamReader(System.in))) {

            String line = br.readLine();
            String[] split = line.split(" ");
            int NV = Integer.parseInt(split[0]);
            int NE = Integer.parseInt(split[1]);

            int[] u = new int[NE];
            int[] v = new int[NE];
            for (int i = 0; i < NE; i++) {
                line = br.readLine();
                split = line.split(" ");
                u[i] = Integer.parseInt(split[0]);
                v[i] = Integer.parseInt(split[1]);
            }

            line = br.readLine();
            split = line.split(" ");
            int NEmbV = Integer.parseInt(split[0]);
            int NEmbE = Integer.parseInt(split[1]);

            int[] a = new int[NEmbE];
            int[] b = new int[NEmbE];
            for (int i = 0; i < NEmbE; i++) {
                line = br.readLine();
                split = line.split(" ");
                a[i] = Integer.parseInt(split[0]);
                b[i] = Integer.parseInt(split[1]);
            }

            Main main = new Main();
            String[] ret = main.run(NV, NE, u, v, NEmbV, NEmbE, a, b);
            for (int i = 0; i < ret.length; ++i) {
                System.out.println(ret[i]);
            }
            System.out.flush();
        } catch (Exception e) {
            e.printStackTrace();
        }
    }

}

class Watch {
    private long start;

    public Watch() {
        init();
    }

    public double getSecond() {
        return (System.nanoTime() - start) * 1e-9;
    }

    public void init() {
        init(System.nanoTime());
    }

    private void init(long start) {
        this.start = start;
    }

    public String getSecondString() {
        return toString(getSecond());
    }

    public static final String toString(double second) {
        if (second < 60) {
            return String.format("%5.2fs", second);
        } else if (second < 60 * 60) {
            int minute = (int) (second / 60);
            return String.format("%2dm%2ds", minute, (int) (second % 60));
        } else {
            int hour = (int) (second / (60 * 60));
            int minute = (int) (second / 60);
            return String.format("%2dh%2dm%2ds", hour, minute % (60), (int) (second % 60));
        }
    }

}

class XorShift {
    private int w = 88675123;
    private int x = 123456789;
    private int y = 362436069;
    private int z = 521288629;

    public XorShift(long l) {
        x = (int) l;
    }

    public int nextInt() {
        final int t = x ^ (x << 11);
        x = y;
        y = z;
        z = w;
        w = w ^ (w >>> 19) ^ (t ^ (t >>> 8));
        return w;
    }

    public long nextLong() {
        return ((long) nextInt() << 32) ^ (long) nextInt();
    }

    public double nextDouble() {
        return (nextInt() >>> 1) * 4.6566128730773926E-10;
    }

    public int nextInt(int n) {
        return (int) (n * nextDouble());
    }

}

class Edge {
    int u;
    int v;

    public Edge(int u, int v) {
        super();
        this.u = u;
        this.v = v;
    }

}

class IntArray {
    public int[] values;
    public int length;

    public IntArray() {
        this(new int[4], 0);
    }

    public IntArray(int capacity) {
        this(new int[capacity], 0);
    }

    public IntArray(int[] values) {
        this(values, values.length);
    }

    public IntArray(int[] values, int length) {
        this.values = values;
        this.length = length;
    }

    public void add(int value) {
        if (length == values.length) {
            values = Arrays.copyOf(values, values.length << 1);
        }
        values[length++] = value;
    }

    public int remove() {
        return values[--length];
    }

    public boolean contains(int value) {
        for (int i = 0; i < length; i++) {
            if (values[i] == value) {
                return true;
            }
        }
        return false;
    }

    public void clear() {
        length = 0;
    }

    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append("{");
        for (int i = 0; i < length; i++) {
            sb.append(values[i] + ",");
        }
        sb.append("}");
        return sb.toString();
    }

    public boolean isEmpty() {
        return length == 0;
    }

    public int remove(int index) {
        if (index >= length) {
            throw new AssertionError();
        }

        if (index == length - 1) {
            return remove();
        }

        int res = values[index];
        System.arraycopy(values, index + 1, values, index, length - (index + 1));
        length--;

        return res;
    }

    public void set(int index, int value) {
        if (index == length) {
            add(value);
            return;
        }

        if (index >= length) {
            throw new AssertionError();
        }

        if (length >= values.length - 1) {
            values = Arrays.copyOf(values, values.length << 1);
        }
        System.arraycopy(values, index, values, index + 1, length - index);
        length++;

        values[index] = value;
    }

    public IntArray copy() {
        return new IntArray(Arrays.copyOf(values, length), length);
    }

    public int[] toArray() {
        return Arrays.copyOf(values, length);
    }

}

class SAState {

    public static final boolean useTime = true;

    public double startTime = 0;
    public double endTime = 29.5;
    public double time = startTime;

    public double startTemperature = 50;
    public double endTemperature = 5;
    public double temperature = startTemperature;
    public double lastAcceptTemperature = startTemperature;

    public double startRange = 1 << 20;
    public double endRange = 1 << 20;
    public double range = startRange;

    public int loop;
    public int countChange;
    public int countAccept;

    public void init() {
        loop = 0;
        countChange = 0;
        countAccept = 0;
        lastAcceptTemperature = startTemperature;
        startTime = useTime ? Main.watch.getSecond() : loop;

        updateTime();
        updateTemperature();
        updateRange();
    }

    public void updateTemperature() {
        temperature = endTemperature + (startTemperature - endTemperature) * Math.pow((endTime - time) / (endTime - startTime), 1.0);
    }

    public void updateRange() {
        range = endRange + (startRange - endRange) * Math.pow((endTime - time) / (endTime - startTime), 1.0);
    }

    public void updateTime() {
        time = useTime ? Main.watch.getSecond() : loop;
    }

    public boolean isTLE() {
        return time >= endTime;
    }

    public boolean accept(double newScore, double currentScore) {
        assert newScore - currentScore < 0;
        assert temperature >= 0;
        return Main.rng.nextDouble() < Math.exp((newScore - currentScore) / (temperature));
    }

}

Submission Info

Submission Time
Task A - Problem 2
User C7BMkOO7Qbmcwck7
Language Java8 (OpenJDK 1.8.0)
Score 19302195
Code Size 37600 Byte
Status AC
Exec Time 29684 ms
Memory 62788 KB

Judge Result

Set Name random_000 random_001 random_002 random_003 random_004 random_005 random_006 random_007 random_008 random_009 random_010 random_011 random_012 random_013 random_014 random_015 random_016 random_017 random_018 random_019 random_020 random_021 random_022 random_023 random_024 random_025 random_026 random_027 random_028 random_029 random_030 random_031 random_032 random_033 random_034 random_035 random_036 random_037 random_038 random_039 random_040 random_041 random_042 random_043 random_044 random_045 random_046 random_047 random_048 random_049 random_050 random_051 random_052 random_053 random_054 random_055 random_056 random_057 random_058 random_059 random_060 random_061 random_062 random_063 random_064 random_065 random_066 random_067 random_068 random_069 random_070 random_071 random_072 random_073 random_074 random_075 random_076 random_077 random_078 random_079 random_080 random_081 random_082 random_083 random_084 random_085 random_086 random_087 random_088 random_089 random_090 random_091 random_092 random_093 random_094 random_095 random_096 random_097 random_098 random_099 random_100 random_101 random_102 random_103 random_104 random_105 random_106 random_107 random_108 random_109 random_110 random_111 random_112 random_113 random_114 random_115 random_116 random_117 random_118 random_119 random_120 random_121 random_122 random_123 random_124 random_125 random_126 random_127 random_128 random_129 random_130 random_131 random_132 random_133 random_134 random_135 random_136 random_137 random_138 random_139 random_140 random_141 random_142 random_143 random_144 random_145 random_146 random_147 random_148 random_149
Score / Max Score 120115 / 1000000 73043 / 1000000 110972 / 1000000 121146 / 1000000 112456 / 1000000 131968 / 1000000 157382 / 1000000 183594 / 1000000 35165 / 1000000 24460 / 1000000 199035 / 1000000 177732 / 1000000 60536 / 1000000 120000 / 1000000 40442 / 1000000 159754 / 1000000 90169 / 1000000 145243 / 1000000 133947 / 1000000 126809 / 1000000 205951 / 1000000 97455 / 1000000 178001 / 1000000 93011 / 1000000 86570 / 1000000 161748 / 1000000 109245 / 1000000 127438 / 1000000 39821 / 1000000 146104 / 1000000 47638 / 1000000 219658 / 1000000 191919 / 1000000 178581 / 1000000 62940 / 1000000 193013 / 1000000 162254 / 1000000 145781 / 1000000 126816 / 1000000 244467 / 1000000 61332 / 1000000 83121 / 1000000 170177 / 1000000 66064 / 1000000 120846 / 1000000 219825 / 1000000 177758 / 1000000 152721 / 1000000 122308 / 1000000 81685 / 1000000 118408 / 1000000 85283 / 1000000 35219 / 1000000 113653 / 1000000 164745 / 1000000 116151 / 1000000 101516 / 1000000 214526 / 1000000 170682 / 1000000 152261 / 1000000 134704 / 1000000 92982 / 1000000 90341 / 1000000 167839 / 1000000 130452 / 1000000 193473 / 1000000 129339 / 1000000 131342 / 1000000 112023 / 1000000 152261 / 1000000 80811 / 1000000 65010 / 1000000 175917 / 1000000 163677 / 1000000 170718 / 1000000 121857 / 1000000 123995 / 1000000 181524 / 1000000 183857 / 1000000 180433 / 1000000 176939 / 1000000 81881 / 1000000 115264 / 1000000 147681 / 1000000 105644 / 1000000 112576 / 1000000 110576 / 1000000 147553 / 1000000 175962 / 1000000 30192 / 1000000 112424 / 1000000 95626 / 1000000 145677 / 1000000 226564 / 1000000 93629 / 1000000 74687 / 1000000 118463 / 1000000 168132 / 1000000 70468 / 1000000 119567 / 1000000 76602 / 1000000 201888 / 1000000 87663 / 1000000 137244 / 1000000 141897 / 1000000 85525 / 1000000 179534 / 1000000 164953 / 1000000 95210 / 1000000 142160 / 1000000 123300 / 1000000 174572 / 1000000 139924 / 1000000 184543 / 1000000 95741 / 1000000 110379 / 1000000 191016 / 1000000 201789 / 1000000 148420 / 1000000 29231 / 1000000 76606 / 1000000 59580 / 1000000 91851 / 1000000 182101 / 1000000 207236 / 1000000 65572 / 1000000 24670 / 1000000 82230 / 1000000 110044 / 1000000 217975 / 1000000 60775 / 1000000 86096 / 1000000 110025 / 1000000 132974 / 1000000 161514 / 1000000 150003 / 1000000 129415 / 1000000 137462 / 1000000 193252 / 1000000 104558 / 1000000 220722 / 1000000 32137 / 1000000 65300 / 1000000 119524 / 1000000 119475 / 1000000 178480 / 1000000 173467 / 1000000 35094 / 1000000 191390 / 1000000 188356 / 1000000
Status
AC × 1
AC × 1
AC × 1
AC × 1
AC × 1
AC × 1
AC × 1
AC × 1
AC × 1
AC × 1
AC × 1
AC × 1
AC × 1
AC × 1
AC × 1
AC × 1
AC × 1
AC × 1
AC × 1
AC × 1
AC × 1
AC × 1
AC × 1
AC × 1
AC × 1
AC × 1
AC × 1
AC × 1
AC × 1
AC × 1
AC × 1
AC × 1
AC × 1
AC × 1
AC × 1
AC × 1
AC × 1
AC × 1
AC × 1
AC × 1
AC × 1
AC × 1
AC × 1
AC × 1
AC × 1
AC × 1
AC × 1
AC × 1
AC × 1
AC × 1
AC × 1
AC × 1
AC × 1
AC × 1
AC × 1
AC × 1
AC × 1
AC × 1
AC × 1
AC × 1
AC × 1
AC × 1
AC × 1
AC × 1
AC × 1
AC × 1
AC × 1
AC × 1
AC × 1
AC × 1
AC × 1
AC × 1
AC × 1
AC × 1
AC × 1
AC × 1
AC × 1
AC × 1
AC × 1
AC × 1
AC × 1
AC × 1
AC × 1
AC × 1
AC × 1
AC × 1
AC × 1
AC × 1
AC × 1
AC × 1
AC × 1
AC × 1
AC × 1
AC × 1
AC × 1
AC × 1
AC × 1
AC × 1
AC × 1
AC × 1
AC × 1
AC × 1
AC × 1
AC × 1
AC × 1
AC × 1
AC × 1
AC × 1
AC × 1
AC × 1
AC × 1
AC × 1
AC × 1
AC × 1
AC × 1
AC × 1
AC × 1
AC × 1
AC × 1
AC × 1
AC × 1
AC × 1
AC × 1
AC × 1
AC × 1
AC × 1
AC × 1
AC × 1
AC × 1
AC × 1
AC × 1
AC × 1
AC × 1
AC × 1
AC × 1
AC × 1
AC × 1
AC × 1
AC × 1
AC × 1
AC × 1
AC × 1
AC × 1
AC × 1
AC × 1
AC × 1
AC × 1
AC × 1
AC × 1
AC × 1
Set Name Test Cases
random_000 10_random_000
random_001 10_random_001
random_002 10_random_002
random_003 10_random_003
random_004 10_random_004
random_005 10_random_005
random_006 10_random_006
random_007 10_random_007
random_008 10_random_008
random_009 10_random_009
random_010 10_random_010
random_011 10_random_011
random_012 10_random_012
random_013 10_random_013
random_014 10_random_014
random_015 10_random_015
random_016 10_random_016
random_017 10_random_017
random_018 10_random_018
random_019 10_random_019
random_020 10_random_020
random_021 10_random_021
random_022 10_random_022
random_023 10_random_023
random_024 10_random_024
random_025 10_random_025
random_026 10_random_026
random_027 10_random_027
random_028 10_random_028
random_029 10_random_029
random_030 10_random_030
random_031 10_random_031
random_032 10_random_032
random_033 10_random_033
random_034 10_random_034
random_035 10_random_035
random_036 10_random_036
random_037 10_random_037
random_038 10_random_038
random_039 10_random_039
random_040 10_random_040
random_041 10_random_041
random_042 10_random_042
random_043 10_random_043
random_044 10_random_044
random_045 10_random_045
random_046 10_random_046
random_047 10_random_047
random_048 10_random_048
random_049 10_random_049
random_050 10_random_050
random_051 10_random_051
random_052 10_random_052
random_053 10_random_053
random_054 10_random_054
random_055 10_random_055
random_056 10_random_056
random_057 10_random_057
random_058 10_random_058
random_059 10_random_059
random_060 10_random_060
random_061 10_random_061
random_062 10_random_062
random_063 10_random_063
random_064 10_random_064
random_065 10_random_065
random_066 10_random_066
random_067 10_random_067
random_068 10_random_068
random_069 10_random_069
random_070 10_random_070
random_071 10_random_071
random_072 10_random_072
random_073 10_random_073
random_074 10_random_074
random_075 10_random_075
random_076 10_random_076
random_077 10_random_077
random_078 10_random_078
random_079 10_random_079
random_080 10_random_080
random_081 10_random_081
random_082 10_random_082
random_083 10_random_083
random_084 10_random_084
random_085 10_random_085
random_086 10_random_086
random_087 10_random_087
random_088 10_random_088
random_089 10_random_089
random_090 10_random_090
random_091 10_random_091
random_092 10_random_092
random_093 10_random_093
random_094 10_random_094
random_095 10_random_095
random_096 10_random_096
random_097 10_random_097
random_098 10_random_098
random_099 10_random_099
random_100 10_random_100
random_101 10_random_101
random_102 10_random_102
random_103 10_random_103
random_104 10_random_104
random_105 10_random_105
random_106 10_random_106
random_107 10_random_107
random_108 10_random_108
random_109 10_random_109
random_110 10_random_110
random_111 10_random_111
random_112 10_random_112
random_113 10_random_113
random_114 10_random_114
random_115 10_random_115
random_116 10_random_116
random_117 10_random_117
random_118 10_random_118
random_119 10_random_119
random_120 10_random_120
random_121 10_random_121
random_122 10_random_122
random_123 10_random_123
random_124 10_random_124
random_125 10_random_125
random_126 10_random_126
random_127 10_random_127
random_128 10_random_128
random_129 10_random_129
random_130 10_random_130
random_131 10_random_131
random_132 10_random_132
random_133 10_random_133
random_134 10_random_134
random_135 10_random_135
random_136 10_random_136
random_137 10_random_137
random_138 10_random_138
random_139 10_random_139
random_140 10_random_140
random_141 10_random_141
random_142 10_random_142
random_143 10_random_143
random_144 10_random_144
random_145 10_random_145
random_146 10_random_146
random_147 10_random_147
random_148 10_random_148
random_149 10_random_149
Case Name Status Exec Time Memory
10_random_000 AC 29633 ms 48484 KB
10_random_001 AC 29579 ms 33188 KB
10_random_002 AC 29569 ms 27448 KB
10_random_003 AC 29590 ms 54476 KB
10_random_004 AC 29587 ms 39472 KB
10_random_005 AC 29575 ms 37512 KB
10_random_006 AC 29596 ms 40260 KB
10_random_007 AC 29580 ms 56612 KB
10_random_008 AC 29571 ms 42564 KB
10_random_009 AC 29570 ms 32480 KB
10_random_010 AC 29592 ms 40836 KB
10_random_011 AC 29596 ms 43916 KB
10_random_012 AC 29684 ms 42244 KB
10_random_013 AC 29571 ms 29132 KB
10_random_014 AC 29587 ms 32016 KB
10_random_015 AC 29591 ms 38708 KB
10_random_016 AC 29589 ms 52976 KB
10_random_017 AC 29591 ms 48388 KB
10_random_018 AC 29571 ms 38916 KB
10_random_019 AC 29594 ms 45252 KB
10_random_020 AC 29591 ms 47472 KB
10_random_021 AC 29591 ms 40764 KB
10_random_022 AC 29605 ms 52700 KB
10_random_023 AC 29587 ms 42632 KB
10_random_024 AC 29595 ms 50692 KB
10_random_025 AC 29576 ms 28004 KB
10_random_026 AC 29597 ms 46328 KB
10_random_027 AC 29577 ms 46072 KB
10_random_028 AC 29571 ms 37712 KB
10_random_029 AC 29588 ms 42280 KB
10_random_030 AC 29591 ms 46384 KB
10_random_031 AC 29599 ms 62788 KB
10_random_032 AC 29588 ms 39700 KB
10_random_033 AC 29582 ms 53880 KB
10_random_034 AC 29590 ms 39020 KB
10_random_035 AC 29592 ms 43640 KB
10_random_036 AC 29589 ms 53680 KB
10_random_037 AC 29596 ms 51668 KB
10_random_038 AC 29594 ms 49688 KB
10_random_039 AC 29587 ms 54640 KB
10_random_040 AC 29588 ms 41284 KB
10_random_041 AC 29577 ms 33772 KB
10_random_042 AC 29593 ms 42348 KB
10_random_043 AC 29592 ms 33324 KB
10_random_044 AC 29585 ms 47624 KB
10_random_045 AC 29591 ms 54288 KB
10_random_046 AC 29592 ms 41468 KB
10_random_047 AC 29597 ms 46824 KB
10_random_048 AC 29573 ms 29448 KB
10_random_049 AC 29576 ms 35688 KB
10_random_050 AC 29587 ms 38364 KB
10_random_051 AC 29587 ms 31648 KB
10_random_052 AC 29584 ms 40716 KB
10_random_053 AC 29578 ms 43448 KB
10_random_054 AC 29594 ms 56152 KB
10_random_055 AC 29598 ms 55276 KB
10_random_056 AC 29589 ms 31992 KB
10_random_057 AC 29588 ms 58216 KB
10_random_058 AC 29598 ms 51456 KB
10_random_059 AC 29585 ms 44392 KB
10_random_060 AC 29590 ms 40524 KB
10_random_061 AC 29575 ms 50556 KB
10_random_062 AC 29578 ms 47420 KB
10_random_063 AC 29587 ms 33756 KB
10_random_064 AC 29599 ms 46956 KB
10_random_065 AC 29589 ms 45200 KB
10_random_066 AC 29594 ms 40632 KB
10_random_067 AC 29598 ms 47336 KB
10_random_068 AC 29587 ms 46072 KB
10_random_069 AC 29592 ms 55708 KB
10_random_070 AC 29575 ms 42896 KB
10_random_071 AC 29572 ms 46292 KB
10_random_072 AC 29577 ms 35356 KB
10_random_073 AC 29593 ms 56812 KB
10_random_074 AC 29570 ms 32240 KB
10_random_075 AC 29592 ms 50784 KB
10_random_076 AC 29582 ms 51848 KB
10_random_077 AC 29593 ms 54740 KB
10_random_078 AC 29601 ms 45416 KB
10_random_079 AC 29589 ms 52880 KB
10_random_080 AC 29601 ms 55408 KB
10_random_081 AC 29584 ms 46196 KB
10_random_082 AC 29584 ms 40076 KB
10_random_083 AC 29599 ms 55156 KB
10_random_084 AC 29570 ms 25224 KB
10_random_085 AC 29589 ms 48080 KB
10_random_086 AC 29578 ms 47556 KB
10_random_087 AC 29581 ms 51296 KB
10_random_088 AC 29592 ms 44308 KB
10_random_089 AC 29572 ms 39396 KB
10_random_090 AC 29610 ms 48104 KB
10_random_091 AC 29589 ms 49196 KB
10_random_092 AC 29595 ms 42468 KB
10_random_093 AC 29595 ms 53608 KB
10_random_094 AC 29586 ms 44220 KB
10_random_095 AC 29585 ms 41888 KB
10_random_096 AC 29582 ms 48524 KB
10_random_097 AC 29593 ms 46400 KB
10_random_098 AC 29581 ms 38456 KB
10_random_099 AC 29596 ms 41736 KB
10_random_100 AC 29593 ms 46604 KB
10_random_101 AC 29595 ms 46140 KB
10_random_102 AC 29589 ms 42356 KB
10_random_103 AC 29571 ms 29972 KB
10_random_104 AC 29588 ms 36436 KB
10_random_105 AC 29575 ms 47136 KB
10_random_106 AC 29592 ms 55396 KB
10_random_107 AC 29581 ms 58188 KB
10_random_108 AC 29587 ms 38464 KB
10_random_109 AC 29584 ms 44192 KB
10_random_110 AC 29602 ms 28384 KB
10_random_111 AC 29599 ms 55296 KB
10_random_112 AC 29594 ms 46044 KB
10_random_113 AC 29596 ms 54996 KB
10_random_114 AC 29588 ms 47088 KB
10_random_115 AC 29591 ms 43768 KB
10_random_116 AC 29587 ms 40668 KB
10_random_117 AC 29591 ms 51672 KB
10_random_118 AC 29592 ms 41932 KB
10_random_119 AC 29579 ms 46816 KB
10_random_120 AC 29587 ms 39832 KB
10_random_121 AC 29584 ms 44380 KB
10_random_122 AC 29587 ms 37512 KB
10_random_123 AC 29584 ms 55272 KB
10_random_124 AC 29585 ms 56008 KB
10_random_125 AC 29597 ms 35624 KB
10_random_126 AC 29572 ms 40168 KB
10_random_127 AC 29572 ms 42900 KB
10_random_128 AC 29568 ms 24840 KB
10_random_129 AC 29592 ms 54208 KB
10_random_130 AC 29588 ms 37592 KB
10_random_131 AC 29586 ms 51804 KB
10_random_132 AC 29588 ms 47428 KB
10_random_133 AC 29585 ms 46740 KB
10_random_134 AC 29599 ms 49328 KB
10_random_135 AC 29596 ms 46060 KB
10_random_136 AC 29586 ms 43604 KB
10_random_137 AC 29600 ms 43124 KB
10_random_138 AC 29595 ms 50532 KB
10_random_139 AC 29585 ms 33260 KB
10_random_140 AC 29593 ms 53216 KB
10_random_141 AC 29573 ms 41000 KB
10_random_142 AC 29588 ms 37868 KB
10_random_143 AC 29584 ms 30816 KB
10_random_144 AC 29597 ms 48224 KB
10_random_145 AC 29591 ms 40680 KB
10_random_146 AC 29579 ms 43912 KB
10_random_147 AC 29571 ms 44060 KB
10_random_148 AC 29585 ms 43344 KB
10_random_149 AC 29594 ms 58536 KB