Submission #1467483


Source Code Expand

Copy
import java.io.*;
import java.util.*;

public class Main {

	private static Scanner sc;
	private static Printer pr;

	private static void solve() {
		long k = sc.nextLong();

		long[] ans = new long[50];
		for (int i = 0; i < 50; i++) {
			ans[i] = 49;
		}

		int i = 0;
		while (k > 20_000_000_000_000_000L) {
			ans[i++] += 10_000_000_000_000_000L;
			ans[i++] += 10_000_000_000_000_000L;
			k -= 20_000_000_000_000_000L;
		}

		if (k > 0) {
			ans[i] += k / 2;
			ans[i + 1] += k / 2;
			if (k % 2 != 0) {
				ans[i] += 2;
				ans[i + 1] -= 1;
			}
		}

		pr.println(50);
		for (int j = 0; j < 50; j++) {
			if (j > 0) {
				pr.print(' ');
			}
			pr.print(ans[j]);
		}
		pr.println();
	}

	// ---------------------------------------------------
	public static void main(String[] args) {
		sc = new Scanner(System.in);
		pr = new Printer(System.out);

		solve();

		pr.close();
		sc.close();
	}

	@SuppressWarnings("unused")
	private static class Scanner {
		BufferedReader br;

		Scanner (InputStream in) {
			br = new BufferedReader(new InputStreamReader(in));
		}

		private boolean isPrintable(int ch) {
			return ch >= '!' && ch <= '~';
		}

		private boolean isCRLF(int ch) {
			return ch == '\n' || ch == '\r' || ch == -1;
		}

		private int nextPrintable() {
			try {
				int ch;
				while (!isPrintable(ch = br.read())) {
					if (ch == -1) {
						throw new NoSuchElementException();
					}
				}

				return ch;
			} catch (IOException e) {
				throw new NoSuchElementException();
			}
		}

		String next() {
			try {
				int ch = nextPrintable();
				StringBuilder sb = new StringBuilder();
				do {
					sb.appendCodePoint(ch);
				} while (isPrintable(ch = br.read()));

				return sb.toString();
			} catch (IOException e) {
				throw new NoSuchElementException();
			}
		}

		int nextInt() {
			try {
				// parseInt from Integer.parseInt()
				boolean negative = false;
				int res = 0;
				int limit = -Integer.MAX_VALUE;
				int radix = 10;

				int fc = nextPrintable();
				if (fc < '0') {
					if (fc == '-') {
						negative = true;
						limit = Integer.MIN_VALUE;
					} else if (fc != '+') {
						throw new NumberFormatException();
					}
					fc = br.read();
				}
				int multmin = limit / radix;

				int ch = fc;
				do {
					int digit = ch - '0';
					if (digit < 0 || digit >= radix) {
						throw new NumberFormatException();
					}
					if (res < multmin) {
						throw new NumberFormatException();
					}
					res *= radix;
					if (res < limit + digit) {
						throw new NumberFormatException();
					}
					res -= digit;

				} while (isPrintable(ch = br.read()));

				return negative ? res : -res;
			} catch (IOException e) {
				throw new NoSuchElementException();
			}
		}

		long nextLong() {
			try {
				// parseLong from Long.parseLong()
				boolean negative = false;
				long res = 0;
				long limit = -Long.MAX_VALUE;
				int radix = 10;

				int fc = nextPrintable();
				if (fc < '0') {
					if (fc == '-') {
						negative = true;
						limit = Long.MIN_VALUE;
					} else if (fc != '+') {
						throw new NumberFormatException();
					}
					fc = br.read();
				}
				long multmin = limit / radix;

				int ch = fc;
				do {
					int digit = ch - '0';
					if (digit < 0 || digit >= radix) {
						throw new NumberFormatException();
					}
					if (res < multmin) {
						throw new NumberFormatException();
					}
					res *= radix;
					if (res < limit + digit) {
						throw new NumberFormatException();
					}
					res -= digit;

				} while (isPrintable(ch = br.read()));

				return negative ? res : -res;
			} catch (IOException e) {
				throw new NoSuchElementException();
			}
		}

		float nextFloat() {
			return Float.parseFloat(next());
		}

		double nextDouble() {
			return Double.parseDouble(next());
		}

		String nextLine() {
			try {
				int ch;
				while (isCRLF(ch = br.read())) {
					if (ch == -1) {
						throw new NoSuchElementException();
					}
				}
				StringBuilder sb = new StringBuilder();
				do {
					sb.appendCodePoint(ch);
				} while (!isCRLF(ch = br.read()));

				return sb.toString();
			} catch (IOException e) {
				throw new NoSuchElementException();
			}
		}

		void close() {
			try {
				br.close();
			} catch (IOException e) {
//				throw new NoSuchElementException();
			}
		}
	}

	private static class Printer extends PrintWriter {
		Printer(PrintStream out) {
			super(out);
		}
	}
}

Submission Info

Submission Time
Task D - Decrease (Contestant ver.)
User garnacha
Language Java8 (OpenJDK 1.8.0)
Score 0
Code Size 4617 Byte
Status
Exec Time 86 ms
Memory 21460 KB

Test Cases

Set Name Score / Max Score Test Cases
Sample 0 / 0 example0, example1, example2, example3, example4
All 0 / 600 corner0, corner1, corner2, corner3, corner4, corner5, corner6, corner7, corner8, corner9, example0, example1, example2, example3, example4, rand0, rand1, rand2, rand3, rand4, rand5, rand6, rand7, rand8, rand9
Case Name Status Exec Time Memory
corner0 75 ms 17108 KB
corner1 75 ms 21204 KB
corner2 72 ms 21332 KB
corner3 78 ms 21204 KB
corner4 73 ms 21076 KB
corner5 71 ms 18260 KB
corner6 74 ms 21204 KB
corner7 72 ms 19924 KB
corner8 86 ms 21204 KB
corner9 73 ms 15956 KB
example0 84 ms 21076 KB
example1 71 ms 19924 KB
example2 73 ms 18004 KB
example3 83 ms 20436 KB
example4 73 ms 19284 KB
rand0 73 ms 19028 KB
rand1 72 ms 19540 KB
rand2 73 ms 19668 KB
rand3 75 ms 19412 KB
rand4 73 ms 18260 KB
rand5 72 ms 20180 KB
rand6 72 ms 17748 KB
rand7 73 ms 20436 KB
rand8 71 ms 21460 KB
rand9 74 ms 20820 KB