第2回早稲田大学プログラミングコンテスト

Submission #1417484

Source codeソースコード

import java.util.*;

public class Main {
    static int len;
    static String[] s;
    static int table[];

    static int min(int a, int b, int c){
        if(Math.min(a, b) > c) return c;
        else if(Math.min(a, c) > b) return b;
        else if(Math.min(b, c) > a) return a;
        else return 0;
    }

    static int search(int k){
        if(k == 0) return 0;
        if(s[k] == "X") table[k] += 1;
        return table[k] = min(search(k-1), search(k-2), search(k-3));
    }

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        len = sc.nextInt();
        String _s = sc.next();
        System.out.println(_s);
        s = new String[len];
        s = _s.split("");
        table = new int[len];

        for (int i = 0; i < len; i++){
            table[i] = 0;
        }

        search(len - 1);
        for (int i = 0; i <= len; i++){
            System.out.println(table[i]);
        }
    }
}

Submission

Task問題 B - 雨上がり
User nameユーザ名 RYOSKATE
Created time投稿日時
Language言語 Java8 (OpenJDK 1.8.0)
Status状態 RE
Score得点 0
Source lengthソースコード長 993 Byte
File nameファイル名
Exec time実行時間 ms
Memory usageメモリ使用量 -

Test case

Set

Set name Score得点 / Max score Cases
All 0 / 50 case_000.txt,case_001.txt,case_002.txt,case_003.txt,case_004.txt,case_005.txt,case_006.txt,case_007.txt,case_008.txt,case_009.txt,case_010.txt,case_011.txt,case_012.txt,case_013.txt,case_014.txt,case_015.txt,case_016.txt,case_017.txt,case_018.txt,case_019.txt,case_020.txt,case_021.txt,case_022.txt,case_023.txt,case_024.txt,case_025.txt,case_026.txt,case_027.txt,case_028.txt,case_029.txt,case_030.txt,case_031.txt,case_032.txt,case_033.txt,case_034.txt,case_035.txt,case_036.txt,case_037.txt,case_038.txt,case_039.txt,case_040.txt,case_041.txt,case_042.txt

Test case

Case name Status状態 Exec time実行時間 Memory usageメモリ使用量
case_000.txt RE
case_001.txt RE
case_002.txt RE
case_003.txt RE
case_004.txt RE
case_005.txt RE
case_006.txt RE
case_007.txt RE
case_008.txt RE
case_009.txt RE
case_010.txt RE
case_011.txt RE
case_012.txt RE
case_013.txt RE
case_014.txt RE
case_015.txt RE
case_016.txt RE
case_017.txt RE
case_018.txt RE
case_019.txt RE
case_020.txt RE
case_021.txt RE
case_022.txt RE
case_023.txt RE
case_024.txt RE
case_025.txt RE
case_026.txt RE
case_027.txt RE
case_028.txt RE
case_029.txt RE
case_030.txt RE
case_031.txt RE
case_032.txt RE
case_033.txt RE
case_034.txt RE
case_035.txt RE
case_036.txt RE
case_037.txt RE
case_038.txt RE
case_039.txt RE
case_040.txt RE
case_041.txt RE
case_042.txt RE