Submission #322663


Source Code Expand

import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.util.InputMismatchException;

/**
 * Created by hama_du
 */
public class Main {
    public static void main(String[] args) {
        InputReader in = new InputReader(System.in);
        PrintWriter out = new PrintWriter(System.out);
        int n = in.nextInt();
        int x = in.nextInt();
        out.println((n - x) * 525 + x * 540);
        out.flush();
    }

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

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

        public int next() {
            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 nextInt() {
            int c = next();
            while (isSpaceChar(c))
                c = next();
            int sgn = 1;
            if (c == '-') {
                sgn = -1;
                c = next();
            }
            int res = 0;
            do {
                if (c < '0' || c > '9')
                    throw new InputMismatchException();
                res *= 10;
                res += c - '0';
                c = next();
            } while (!isSpaceChar(c));
            return res * sgn;
        }

        public boolean isSpaceChar(int c) {
            if (filter != null)
                return filter.isSpaceChar(c);
            return c == ' ' || c == '\n' || c == '\r' || c == '\t' || c == -1;
        }

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

Submission Info

Submission Time
Task A - プレミアム会員
User hamadu
Language Java (OpenJDK 1.7.0)
Score 100
Code Size 2207 Byte
Status AC
Exec Time 476 ms
Memory 20808 KB

Judge Result

Set Name Sample All
Score / Max Score 0 / 0 100 / 100
Status
AC × 4
AC × 22
Set Name Test Cases
Sample subtask0_sample_01.txt, subtask0_sample_02.txt, subtask0_sample_03.txt, subtask0_sample_04.txt
All subtask0_sample_01.txt, subtask0_sample_02.txt, subtask0_sample_03.txt, subtask0_sample_04.txt, subtask1_random01.txt, subtask1_random02.txt, subtask1_random03.txt, subtask1_random04.txt, subtask1_random05.txt, subtask1_random06.txt, subtask1_random07.txt, subtask1_random08.txt, subtask1_random09.txt, subtask1_random10.txt, subtask1_random11.txt, subtask1_random12.txt, subtask1_random13.txt, subtask1_random14.txt, subtask1_random15.txt, subtask1_random16.txt, subtask1_random17.txt, subtask1_random18.txt
Case Name Status Exec Time Memory
subtask0_sample_01.txt AC 455 ms 20808 KB
subtask0_sample_02.txt AC 465 ms 20692 KB
subtask0_sample_03.txt AC 455 ms 20628 KB
subtask0_sample_04.txt AC 451 ms 20672 KB
subtask1_random01.txt AC 456 ms 20732 KB
subtask1_random02.txt AC 456 ms 20580 KB
subtask1_random03.txt AC 460 ms 20748 KB
subtask1_random04.txt AC 455 ms 20688 KB
subtask1_random05.txt AC 464 ms 20588 KB
subtask1_random06.txt AC 461 ms 20652 KB
subtask1_random07.txt AC 476 ms 20656 KB
subtask1_random08.txt AC 457 ms 20644 KB
subtask1_random09.txt AC 460 ms 20620 KB
subtask1_random10.txt AC 450 ms 20584 KB
subtask1_random11.txt AC 468 ms 20628 KB
subtask1_random12.txt AC 451 ms 20680 KB
subtask1_random13.txt AC 462 ms 20588 KB
subtask1_random14.txt AC 461 ms 20688 KB
subtask1_random15.txt AC 457 ms 20700 KB
subtask1_random16.txt AC 458 ms 20644 KB
subtask1_random17.txt AC 465 ms 20700 KB
subtask1_random18.txt AC 457 ms 20652 KB