Submission #1158633


Source Code Expand

import java.io.OutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import java.io.PrintWriter;
import java.util.Arrays;
import java.util.Iterator;
import java.io.BufferedWriter;
import java.util.InputMismatchException;
import java.io.IOException;
import java.io.Writer;
import java.io.OutputStreamWriter;
import java.util.NoSuchElementException;
import java.io.InputStream;

/**
 * Built using CHelper plug-in
 * Actual solution is at the top
 *
 * @author Egor Kulikov (egor@egork.net)
 */
public class Main {
    public static void main(String[] args) {
        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        InputReader in = new InputReader(inputStream);
        OutputWriter out = new OutputWriter(outputStream);
        TaskF solver = new TaskF();
        solver.solve(1, in, out);
        out.close();
    }

    static class TaskF {
        long[] kk;
        long[] bb;
        int[] x;

        public void solve(int testNumber, InputReader in, OutputWriter out) {
            int n = in.readInt();
            int k = in.readInt();
            int[] a = new int[n];
            int[] b = new int[n];
            IOUtils.readIntArrays(in, a, b);
            for (int i = 0; i < n; i++) {
                if (2 * a[i] > k && b[i] == 1) {
                    out.printLine(-1);
                    return;
                }
            }
            int[] from = new int[n];
            int[] to = new int[n];
            int[] interesting = new int[n + 1];
            long current = 0;
            for (int i = 0; i < n; i++) {
                from[i] = (int) current;
                current += 2 * a[i];
                current %= k;
                to[i] = (int) current;
                interesting[i + 1] = to[i];
            }
            ArrayUtils.sort(interesting);
            x = ArrayUtils.unique(interesting);
            kk = new long[4 * x.length];
            bb = new long[4 * x.length];
            for (int i = n - 1; i >= 0; i--) {
                if (b[i] == 1) {
                    int ff = Arrays.binarySearch(x, from[i]);
                    int tt = Arrays.binarySearch(x, to[i]);
                    long val = getValue(0, 0, x.length - 1, ff);
                    if (ff < tt) {
                        update(0, 0, x.length - 1, ff, tt - 1, val - x[ff]);
                    } else {
                        update(0, 0, x.length - 1, ff, x.length - 1, val - x[ff]);
                        val += k - x[ff];
                        update(0, 0, x.length - 1, 0, tt - 1, val);
                    }
                }
            }
            long answer = Long.MAX_VALUE;
            for (int i = 0; i < x.length; i++) {
                answer = Math.min(answer, getValue(0, 0, x.length - 1, i));
            }
            answer += 2 * ArrayUtils.sumArray(a);
            out.printLine(answer);
        }

        private void update(int root, int left, int right, int from, int to, long nb) {
            if (left > to || right < from) {
                return;
            }
            if (left >= from && right <= to) {
                kk[root] = 1;
                bb[root] = nb;
                return;
            }
            if (kk[root] != -1) {
                kk[2 * root + 1] = kk[root];
                kk[2 * root + 2] = kk[root];
                bb[2 * root + 1] = bb[root];
                bb[2 * root + 2] = bb[root];
                kk[root] = -1;
            }
            int middle = (left + right) >> 1;
            update(2 * root + 1, left, middle, from, to, nb);
            update(2 * root + 2, middle + 1, right, from, to, nb);
        }

        private long getValue(int root, int left, int right, int at) {
            if (kk[root] != -1) {
                return kk[root] * x[at] + bb[root];
            }
            int middle = (left + right) >> 1;
            if (at <= middle) {
                return getValue(2 * root + 1, left, middle, at);
            } else {
                return getValue(2 * root + 2, middle + 1, right, at);
            }
        }

    }

    static interface IntReversableCollection extends IntCollection {
    }

    static class InputReader {
        private InputStream stream;
        private byte[] buf = new byte[1024];
        private int curChar;
        private int numChars;
        private InputReader.SpaceCharFilter filter;

        public InputReader(InputStream stream) {
            this.stream = stream;
        }

        public int read() {
            if (numChars == -1) {
                throw new InputMismatchException();
            }
            if (curChar >= numChars) {
                curChar = 0;
                try {
                    numChars = stream.read(buf);
                } catch (IOException e) {
                    throw new InputMismatchException();
                }
                if (numChars <= 0) {
                    return -1;
                }
            }
            return buf[curChar++];
        }

        public int readInt() {
            int c = read();
            while (isSpaceChar(c)) {
                c = read();
            }
            int sgn = 1;
            if (c == '-') {
                sgn = -1;
                c = read();
            }
            int res = 0;
            do {
                if (c < '0' || c > '9') {
                    throw new InputMismatchException();
                }
                res *= 10;
                res += c - '0';
                c = read();
            } while (!isSpaceChar(c));
            return res * sgn;
        }

        public boolean isSpaceChar(int c) {
            if (filter != null) {
                return filter.isSpaceChar(c);
            }
            return isWhitespace(c);
        }

        public static boolean isWhitespace(int c) {
            return c == ' ' || c == '\n' || c == '\r' || c == '\t' || c == -1;
        }

        public interface SpaceCharFilter {
            public boolean isSpaceChar(int ch);

        }

    }

    static interface IntStream extends Iterable<Integer>, Comparable<IntStream> {
        public IntIterator intIterator();

        default public Iterator<Integer> iterator() {
            return new Iterator<Integer>() {
                private IntIterator it = intIterator();

                public boolean hasNext() {
                    return it.isValid();
                }

                public Integer next() {
                    int result = it.value();
                    it.advance();
                    return result;
                }
            };
        }

        default public int compareTo(IntStream c) {
            IntIterator it = intIterator();
            IntIterator jt = c.intIterator();
            while (it.isValid() && jt.isValid()) {
                int i = it.value();
                int j = jt.value();
                if (i < j) {
                    return -1;
                } else if (i > j) {
                    return 1;
                }
                it.advance();
                jt.advance();
            }
            if (it.isValid()) {
                return 1;
            }
            if (jt.isValid()) {
                return -1;
            }
            return 0;
        }

        default public long sum() {
            long result = 0;
            for (IntIterator it = intIterator(); it.isValid(); it.advance()) {
                result += it.value();
            }
            return result;
        }

    }

    static class Sorter {
        private static final int INSERTION_THRESHOLD = 16;

        private Sorter() {
        }

        public static void sort(IntList list, IntComparator comparator) {
            quickSort(list, 0, list.size() - 1, (Integer.bitCount(Integer.highestOneBit(list.size()) - 1) * 5) >> 1,
                    comparator);
        }

        private static void quickSort(IntList list, int from, int to, int remaining, IntComparator comparator) {
            if (to - from < INSERTION_THRESHOLD) {
                insertionSort(list, from, to, comparator);
                return;
            }
            if (remaining == 0) {
                heapSort(list, from, to, comparator);
                return;
            }
            remaining--;
            int pivotIndex = (from + to) >> 1;
            int pivot = list.get(pivotIndex);
            list.swap(pivotIndex, to);
            int storeIndex = from;
            int equalIndex = to;
            for (int i = from; i < equalIndex; i++) {
                int value = comparator.compare(list.get(i), pivot);
                if (value < 0) {
                    list.swap(storeIndex++, i);
                } else if (value == 0) {
                    list.swap(--equalIndex, i--);
                }
            }
            quickSort(list, from, storeIndex - 1, remaining, comparator);
            for (int i = equalIndex; i <= to; i++) {
                list.swap(storeIndex++, i);
            }
            quickSort(list, storeIndex, to, remaining, comparator);
        }

        private static void heapSort(IntList list, int from, int to, IntComparator comparator) {
            for (int i = (to + from - 1) >> 1; i >= from; i--) {
                siftDown(list, i, to, comparator, from);
            }
            for (int i = to; i > from; i--) {
                list.swap(from, i);
                siftDown(list, from, i - 1, comparator, from);
            }
        }

        private static void siftDown(IntList list, int start, int end, IntComparator comparator, int delta) {
            int value = list.get(start);
            while (true) {
                int child = ((start - delta) << 1) + 1 + delta;
                if (child > end) {
                    return;
                }
                int childValue = list.get(child);
                if (child + 1 <= end) {
                    int otherValue = list.get(child + 1);
                    if (comparator.compare(otherValue, childValue) > 0) {
                        child++;
                        childValue = otherValue;
                    }
                }
                if (comparator.compare(value, childValue) >= 0) {
                    return;
                }
                list.swap(start, child);
                start = child;
            }
        }

        private static void insertionSort(IntList list, int from, int to, IntComparator comparator) {
            for (int i = from + 1; i <= to; i++) {
                int value = list.get(i);
                for (int j = i - 1; j >= from; j--) {
                    if (comparator.compare(list.get(j), value) <= 0) {
                        break;
                    }
                    list.swap(j, j + 1);
                }
            }
        }

    }

    static abstract class IntAbstractStream implements IntStream {

        public String toString() {
            StringBuilder builder = new StringBuilder();
            boolean first = true;
            for (IntIterator it = intIterator(); it.isValid(); it.advance()) {
                if (first) {
                    first = false;
                } else {
                    builder.append(' ');
                }
                builder.append(it.value());
            }
            return builder.toString();
        }


        public boolean equals(Object o) {
            if (!(o instanceof IntStream)) {
                return false;
            }
            IntStream c = (IntStream) o;
            IntIterator it = intIterator();
            IntIterator jt = c.intIterator();
            while (it.isValid() && jt.isValid()) {
                if (it.value() != jt.value()) {
                    return false;
                }
                it.advance();
                jt.advance();
            }
            return !it.isValid() && !jt.isValid();
        }


        public int hashCode() {
            int result = 0;
            for (IntIterator it = intIterator(); it.isValid(); it.advance()) {
                result *= 31;
                result += it.value();
            }
            return result;
        }

    }

    static class OutputWriter {
        private final PrintWriter writer;

        public OutputWriter(OutputStream outputStream) {
            writer = new PrintWriter(new BufferedWriter(new OutputStreamWriter(outputStream)));
        }

        public OutputWriter(Writer writer) {
            this.writer = new PrintWriter(writer);
        }

        public void close() {
            writer.close();
        }

        public void printLine(long i) {
            writer.println(i);
        }

        public void printLine(int i) {
            writer.println(i);
        }

    }

    static class IntArrayList extends IntAbstractStream implements IntList {
        private int size;
        private int[] data;

        public IntArrayList() {
            this(3);
        }

        public IntArrayList(int capacity) {
            data = new int[capacity];
        }

        public IntArrayList(IntCollection c) {
            this(c.size());
            addAll(c);
        }

        public IntArrayList(IntStream c) {
            this();
            if (c instanceof IntCollection) {
                ensureCapacity(((IntCollection) c).size());
            }
            addAll(c);
        }

        public IntArrayList(IntArrayList c) {
            size = c.size();
            data = c.data.clone();
        }

        public IntArrayList(int[] arr) {
            size = arr.length;
            data = arr.clone();
        }

        public int size() {
            return size;
        }

        public int get(int at) {
            if (at >= size) {
                throw new IndexOutOfBoundsException("at = " + at + ", size = " + size);
            }
            return data[at];
        }

        private void ensureCapacity(int capacity) {
            if (data.length >= capacity) {
                return;
            }
            capacity = Math.max(2 * data.length, capacity);
            data = Arrays.copyOf(data, capacity);
        }

        public void addAt(int index, int value) {
            ensureCapacity(size + 1);
            if (index > size || index < 0) {
                throw new IndexOutOfBoundsException("at = " + index + ", size = " + size);
            }
            if (index != size) {
                System.arraycopy(data, index, data, index + 1, size - index);
            }
            data[index] = value;
            size++;
        }

        public void removeAt(int index) {
            if (index >= size || index < 0) {
                throw new IndexOutOfBoundsException("at = " + index + ", size = " + size);
            }
            if (index != size - 1) {
                System.arraycopy(data, index + 1, data, index, size - index - 1);
            }
            size--;
        }

        public void set(int index, int value) {
            if (index >= size) {
                throw new IndexOutOfBoundsException("at = " + index + ", size = " + size);
            }
            data[index] = value;
        }

    }

    static class IOUtils {
        public static void readIntArrays(InputReader in, int[]... arrays) {
            for (int i = 0; i < arrays[0].length; i++) {
                for (int j = 0; j < arrays.length; j++) {
                    arrays[j][i] = in.readInt();
                }
            }
        }

    }

    static interface IntIterator {
        public int value() throws NoSuchElementException;

        public boolean advance();

        public boolean isValid();

    }

    static interface IntList extends IntReversableCollection {
        public abstract int get(int index);

        public abstract void set(int index, int value);

        public abstract void addAt(int index, int value);

        public abstract void removeAt(int index);

        default public void swap(int first, int second) {
            if (first == second) {
                return;
            }
            int temp = get(first);
            set(first, get(second));
            set(second, temp);
        }

        default public IntIterator intIterator() {
            return new IntIterator() {
                private int at;
                private boolean removed;

                public int value() {
                    if (removed) {
                        throw new IllegalStateException();
                    }
                    return get(at);
                }

                public boolean advance() {
                    at++;
                    removed = false;
                    return isValid();
                }

                public boolean isValid() {
                    return !removed && at < size();
                }

                public void remove() {
                    removeAt(at);
                    at--;
                    removed = true;
                }
            };
        }


        default public void add(int value) {
            addAt(size(), value);
        }

        default public IntList sort(IntComparator comparator) {
            Sorter.sort(this, comparator);
            return this;
        }

        default IntList unique() {
            int last = Integer.MIN_VALUE;
            IntList result = new IntArrayList();
            int size = size();
            for (int i = 0; i < size; i++) {
                int current = get(i);
                if (current != last) {
                    result.add(current);
                    last = current;
                }
            }
            return result;
        }

        default public IntList subList(final int from, final int to) {
            return new IntList() {
                private final int shift;
                private final int size;

                {
                    if (from < 0 || from > to || to > IntList.this.size()) {
                        throw new IndexOutOfBoundsException("from = " + from + ", to = " + to + ", size = " + size());
                    }
                    shift = from;
                    size = to - from;
                }

                public int size() {
                    return size;
                }

                public int get(int at) {
                    if (at < 0 || at >= size) {
                        throw new IndexOutOfBoundsException("at = " + at + ", size = " + size());
                    }
                    return IntList.this.get(at + shift);
                }

                public void addAt(int index, int value) {
                    throw new UnsupportedOperationException();
                }

                public void removeAt(int index) {
                    throw new UnsupportedOperationException();
                }

                public void set(int at, int value) {
                    if (at < 0 || at >= size) {
                        throw new IndexOutOfBoundsException("at = " + at + ", size = " + size());
                    }
                    IntList.this.set(at + shift, value);
                }

                public IntList compute() {
                    return new IntArrayList(this);
                }
            };
        }

    }

    static interface IntCollection extends IntStream {
        public int size();

        default public void add(int value) {
            throw new UnsupportedOperationException();
        }

        default public int[] toArray() {
            int size = size();
            int[] array = new int[size];
            int i = 0;
            for (IntIterator it = intIterator(); it.isValid(); it.advance()) {
                array[i++] = it.value();
            }
            return array;
        }

        default public IntCollection addAll(IntStream values) {
            for (IntIterator it = values.intIterator(); it.isValid(); it.advance()) {
                add(it.value());
            }
            return this;
        }

    }

    static interface IntComparator {
        public static final IntComparator DEFAULT = (first, second) -> {
            if (first < second) {
                return -1;
            }
            if (first > second) {
                return 1;
            }
            return 0;
        };

        public int compare(int first, int second);

    }

    static class ArrayUtils {
        public static long sumArray(int[] array) {
            return new IntArray(array).sum();
        }

        public static int[] sort(int[] array) {
            return sort(array, IntComparator.DEFAULT);
        }

        public static int[] sort(int[] array, IntComparator comparator) {
            return sort(array, 0, array.length, comparator);
        }

        public static int[] sort(int[] array, int from, int to, IntComparator comparator) {
            if (from == 0 && to == array.length) {
                new IntArray(array).sort(comparator);
            } else {
                new IntArray(array).subList(from, to).sort(comparator);
            }
            return array;
        }

        public static int[] unique(int[] array) {
            return new IntArray(array).unique().toArray();
        }

    }

    static class IntArray extends IntAbstractStream implements IntList {
        private int[] data;

        public IntArray(int[] arr) {
            data = arr;
        }

        public int size() {
            return data.length;
        }

        public int get(int at) {
            return data[at];
        }

        public void addAt(int index, int value) {
            throw new UnsupportedOperationException();
        }

        public void removeAt(int index) {
            throw new UnsupportedOperationException();
        }

        public void set(int index, int value) {
            data[index] = value;
        }

    }
}

Submission Info

Submission Time
Task F - Train Service Planning
User Egor
Language Java8 (OpenJDK 1.8.0)
Score 1700
Code Size 22622 Byte
Status AC
Exec Time 502 ms
Memory 40124 KB

Judge Result

Set Name Sample All subtask subtask2
Score / Max Score 0 / 0 700 / 700 500 / 500 500 / 500
Status
AC × 4
AC × 104
AC × 37
AC × 28
Set Name Test Cases
Sample sample1.txt, sample2.txt, sample3.txt, sample4.txt
All sample1.txt, sample2.txt, sample3.txt, sample4.txt, in1.txt, in10.txt, in101.txt, in102.txt, in103.txt, in104.txt, in105.txt, in106.txt, in107.txt, in108.txt, in109.txt, in11.txt, in110.txt, in12.txt, in13.txt, in14.txt, in15.txt, in16.txt, in17.txt, in18.txt, in19.txt, in2.txt, in20.txt, in21.txt, in22.txt, in23.txt, in24.txt, in25.txt, in26.txt, in27.txt, in28.txt, in3.txt, in4.txt, in5.txt, in6.txt, in7.txt, in8.txt, in9.txt, sample1.txt, sample2.txt, sample3.txt, sample4.txt, sub2in1.txt, sub2in10.txt, sub2in11.txt, sub2in12.txt, sub2in13.txt, sub2in14.txt, sub2in15.txt, sub2in16.txt, sub2in17.txt, sub2in18.txt, sub2in19.txt, sub2in2.txt, sub2in20.txt, sub2in21.txt, sub2in22.txt, sub2in23.txt, sub2in24.txt, sub2in3.txt, sub2in4.txt, sub2in5.txt, sub2in6.txt, sub2in7.txt, sub2in8.txt, sub2in9.txt, subin1.txt, subin10.txt, subin101.txt, subin102.txt, subin103.txt, subin104.txt, subin105.txt, subin106.txt, subin107.txt, subin108.txt, subin109.txt, subin11.txt, subin12.txt, subin13.txt, subin14.txt, subin15.txt, subin16.txt, subin17.txt, subin18.txt, subin19.txt, subin2.txt, subin20.txt, subin201.txt, subin21.txt, subin22.txt, subin23.txt, subin24.txt, subin3.txt, subin4.txt, subin5.txt, subin6.txt, subin7.txt, subin8.txt, subin9.txt
subtask sample1.txt, sample2.txt, sample3.txt, subin1.txt, subin10.txt, subin101.txt, subin102.txt, subin103.txt, subin104.txt, subin105.txt, subin106.txt, subin107.txt, subin108.txt, subin109.txt, subin11.txt, subin12.txt, subin13.txt, subin14.txt, subin15.txt, subin16.txt, subin17.txt, subin18.txt, subin19.txt, subin2.txt, subin20.txt, subin201.txt, subin21.txt, subin22.txt, subin23.txt, subin24.txt, subin3.txt, subin4.txt, subin5.txt, subin6.txt, subin7.txt, subin8.txt, subin9.txt
subtask2 sample1.txt, sample2.txt, sample3.txt, sample4.txt, sub2in1.txt, sub2in10.txt, sub2in11.txt, sub2in12.txt, sub2in13.txt, sub2in14.txt, sub2in15.txt, sub2in16.txt, sub2in17.txt, sub2in18.txt, sub2in19.txt, sub2in2.txt, sub2in20.txt, sub2in21.txt, sub2in22.txt, sub2in23.txt, sub2in24.txt, sub2in3.txt, sub2in4.txt, sub2in5.txt, sub2in6.txt, sub2in7.txt, sub2in8.txt, sub2in9.txt
Case Name Status Exec Time Memory
in1.txt AC 212 ms 26564 KB
in10.txt AC 364 ms 34940 KB
in101.txt AC 320 ms 27688 KB
in102.txt AC 328 ms 31148 KB
in103.txt AC 337 ms 26832 KB
in104.txt AC 383 ms 35460 KB
in105.txt AC 330 ms 32544 KB
in106.txt AC 330 ms 28564 KB
in107.txt AC 349 ms 33648 KB
in108.txt AC 347 ms 27816 KB
in109.txt AC 351 ms 33948 KB
in11.txt AC 353 ms 34692 KB
in110.txt AC 341 ms 34916 KB
in12.txt AC 378 ms 35524 KB
in13.txt AC 366 ms 32420 KB
in14.txt AC 386 ms 37500 KB
in15.txt AC 397 ms 36556 KB
in16.txt AC 377 ms 37792 KB
in17.txt AC 372 ms 35664 KB
in18.txt AC 379 ms 37992 KB
in19.txt AC 455 ms 37032 KB
in2.txt AC 369 ms 37660 KB
in20.txt AC 384 ms 37408 KB
in21.txt AC 374 ms 35768 KB
in22.txt AC 359 ms 33968 KB
in23.txt AC 369 ms 34980 KB
in24.txt AC 403 ms 35684 KB
in25.txt AC 262 ms 28104 KB
in26.txt AC 261 ms 26632 KB
in27.txt AC 248 ms 25752 KB
in28.txt AC 257 ms 28408 KB
in3.txt AC 364 ms 35156 KB
in4.txt AC 351 ms 34940 KB
in5.txt AC 437 ms 36008 KB
in6.txt AC 391 ms 37508 KB
in7.txt AC 360 ms 28088 KB
in8.txt AC 94 ms 18512 KB
in9.txt AC 364 ms 37020 KB
sample1.txt AC 153 ms 25044 KB
sample2.txt AC 76 ms 18644 KB
sample3.txt AC 157 ms 24132 KB
sample4.txt AC 151 ms 24916 KB
sub2in1.txt AC 157 ms 23508 KB
sub2in10.txt AC 159 ms 23620 KB
sub2in11.txt AC 156 ms 23764 KB
sub2in12.txt AC 162 ms 24532 KB
sub2in13.txt AC 159 ms 25532 KB
sub2in14.txt AC 153 ms 26452 KB
sub2in15.txt AC 155 ms 25156 KB
sub2in16.txt AC 152 ms 23892 KB
sub2in17.txt AC 150 ms 25812 KB
sub2in18.txt AC 154 ms 26068 KB
sub2in19.txt AC 149 ms 26452 KB
sub2in2.txt AC 164 ms 26448 KB
sub2in20.txt AC 154 ms 26068 KB
sub2in21.txt AC 160 ms 22852 KB
sub2in22.txt AC 155 ms 25544 KB
sub2in23.txt AC 154 ms 23632 KB
sub2in24.txt AC 161 ms 24532 KB
sub2in3.txt AC 160 ms 24148 KB
sub2in4.txt AC 162 ms 26692 KB
sub2in5.txt AC 148 ms 26324 KB
sub2in6.txt AC 152 ms 23124 KB
sub2in7.txt AC 71 ms 20436 KB
sub2in8.txt AC 151 ms 24276 KB
sub2in9.txt AC 156 ms 23380 KB
subin1.txt AC 394 ms 33988 KB
subin10.txt AC 398 ms 34744 KB
subin101.txt AC 410 ms 36608 KB
subin102.txt AC 404 ms 35360 KB
subin103.txt AC 502 ms 40124 KB
subin104.txt AC 401 ms 37400 KB
subin105.txt AC 368 ms 36044 KB
subin106.txt AC 384 ms 35628 KB
subin107.txt AC 405 ms 37388 KB
subin108.txt AC 388 ms 35600 KB
subin109.txt AC 383 ms 34664 KB
subin11.txt AC 360 ms 34940 KB
subin12.txt AC 422 ms 35608 KB
subin13.txt AC 406 ms 36160 KB
subin14.txt AC 404 ms 37844 KB
subin15.txt AC 423 ms 37520 KB
subin16.txt AC 380 ms 36812 KB
subin17.txt AC 374 ms 34776 KB
subin18.txt AC 398 ms 32992 KB
subin19.txt AC 423 ms 35288 KB
subin2.txt AC 383 ms 31952 KB
subin20.txt AC 382 ms 34712 KB
subin201.txt AC 152 ms 26452 KB
subin21.txt AC 256 ms 25120 KB
subin22.txt AC 278 ms 26396 KB
subin23.txt AC 257 ms 29100 KB
subin24.txt AC 263 ms 26644 KB
subin3.txt AC 423 ms 34328 KB
subin4.txt AC 391 ms 34156 KB
subin5.txt AC 401 ms 37724 KB
subin6.txt AC 386 ms 36312 KB
subin7.txt AC 96 ms 20816 KB
subin8.txt AC 104 ms 19272 KB
subin9.txt AC 418 ms 37032 KB