hiho week 308 register

Ended

Participants:29

Verdict:Accepted
Score:100 / 100
Submitted:2020-05-24 10:38:18

Lang:Java

Edit
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
import java.util.Scanner;
/**
 * @author 
 *
 * 2020523
 */
public class Main {
    static Scanner scanner = new Scanner(System.in);
    static int NM;
    static int n = -1sum;
    static int[] slot// 
    static int startend;
    static int curmid;
    static int last_startlast_midlast_cur = -1;
    public static void main(String[] args) {
        N = scanner.nextInt();
        M = scanner.nextInt();
        slot = new int[N + 1]; // [0..n], n+1
        for (int i = 1i <= N++i) {
            if (scanner.nextInt() == 1continue;
            slot[++n= i;
        }
        sum = n + 1;
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX