Submission #114324

# Submission time Handle Problem Language Result Execution time Memory
114324 2019-05-31T22:19:27 Z caoash Nadan (COCI18_nadan) Java 11
0 / 50
531 ms 65536 KB
import java.io.*;
import java.util.*;

/*
Solution Sketch:
*/

public class nadan {

    static final boolean stdin = true;
    static final String filename = "";
    static FastScanner br;
    static PrintWriter pw;

    public static void main(String[] args) throws IOException {

        if (stdin) {
            br = new FastScanner();
            pw = new PrintWriter(new OutputStreamWriter(System.out));
        } else {
            br = new FastScanner(filename + ".in");
            pw = new PrintWriter(new FileWriter(filename + ".out"));
        }

        X solver = new X();
        solver.solve(br, pw);
    }

    static class X {
        public void solve(FastScanner br, PrintWriter pw) throws IOException {
            int N = br.nextInt(); int K = br.nextInt();
            for(int i = 1; i < N; i++){
                pw.println(i);
                K -= i;
            }
            pw.println(K);
            pw.close();
        }

    }

    //fastscanner class
    public static class FastScanner {
        BufferedReader br;
        StringTokenizer st;

        public FastScanner(String s) {
            try {
                br = new BufferedReader(new FileReader(s));
            } catch (FileNotFoundException e) {
                // TODO Auto-generated catch block
                e.printStackTrace();
            }
        }

        public FastScanner() {
            br = new BufferedReader(new InputStreamReader(System.in));
        }

        String nextToken() {
            while (st == null || !st.hasMoreElements()) {
                try {
                    st = new StringTokenizer(br.readLine());
                } catch (IOException e) {
                    // TODO Auto-generated catch block
                    e.printStackTrace();
                }
            }
            return st.nextToken();
        }

        int nextInt() {
            return Integer.parseInt(nextToken());
        }

        long nextLong() {
            return Long.parseLong(nextToken());
        }

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

}
 
# Verdict Execution time Memory Grader output
1 Incorrect 75 ms 9976 KB Output isn't correct
2 Incorrect 93 ms 10472 KB Output isn't correct
3 Incorrect 88 ms 10540 KB Output isn't correct
4 Incorrect 81 ms 9608 KB Output isn't correct
5 Incorrect 83 ms 9704 KB Output isn't correct
6 Incorrect 177 ms 17360 KB Output isn't correct
7 Incorrect 92 ms 10556 KB Output isn't correct
8 Incorrect 88 ms 10600 KB Output isn't correct
9 Incorrect 133 ms 13296 KB Output isn't correct
10 Runtime error 531 ms 65536 KB Execution killed with signal 9 (could be triggered by violating memory limits)