Submission #2527571


Source Code Expand

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.StringTokenizer;

public class Main {
    int n, q;

    public static void main(String args[]) {
        new Main().run();
    }

    void run() {
        FastReader sc = new FastReader();
        n = sc.nextInt();
        q = sc.nextInt();
        int[] series = new int[n];
        for (int i = 0; i < q; i++) {
            int l = sc.nextInt() - 1;
            int r = sc.nextInt();
            int t = sc.nextInt();
            for (int j = l; j < r; j++) {
                series[j] = t;
            }
        }
        for (int i = 0;i < n; i++) {
            System.out.println(series[i]);
        }
    }

    static class FastReader {
        BufferedReader br;
        StringTokenizer st;

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

        String next() {
            while (st == null || !st.hasMoreElements())
            {
                try
                {
                    st = new StringTokenizer(br.readLine());
                }
                catch (IOException e)
                {
                    e.printStackTrace();
                }
            }
            return st.nextToken();
        }

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

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

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

        String nextLine() {
            String str = "";
            try
            {
                str = br.readLine();
            }
            catch (IOException e)
            {
                e.printStackTrace();
            }
            return str;
        }
    }
}

Submission Info

Submission Time
Task B - 編集
User ynish
Language Java8 (OpenJDK 1.8.0)
Score 100
Code Size 1963 Byte
Status AC
Exec Time 86 ms
Memory 22612 KB

Judge Result

Set Name sample All
Score / Max Score 0 / 0 100 / 100
Status
AC × 2
AC × 24
Set Name Test Cases
sample sample01.txt, sample02.txt
All 00.txt, 01.txt, 02.txt, 03.txt, 04.txt, 05.txt, 06.txt, 07.txt, 08.txt, 09.txt, 10.txt, 11.txt, 12.txt, 13.txt, 14.txt, 15.txt, 16.txt, 17.txt, 18.txt, 19.txt, sample01.txt, sample02.txt, sample01.txt, sample02.txt
Case Name Status Exec Time Memory
00.txt AC 69 ms 21332 KB
01.txt AC 79 ms 19284 KB
02.txt AC 72 ms 21332 KB
03.txt AC 70 ms 20564 KB
04.txt AC 72 ms 18644 KB
05.txt AC 74 ms 18260 KB
06.txt AC 71 ms 18132 KB
07.txt AC 82 ms 18388 KB
08.txt AC 76 ms 22612 KB
09.txt AC 72 ms 18900 KB
10.txt AC 78 ms 20692 KB
11.txt AC 77 ms 18644 KB
12.txt AC 85 ms 19796 KB
13.txt AC 76 ms 21332 KB
14.txt AC 77 ms 18260 KB
15.txt AC 79 ms 19412 KB
16.txt AC 77 ms 20308 KB
17.txt AC 79 ms 18388 KB
18.txt AC 77 ms 21332 KB
19.txt AC 86 ms 18388 KB
sample01.txt AC 69 ms 17748 KB
sample02.txt AC 71 ms 21204 KB