Submission #1417484
Source Code Expand
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 Info
Submission Time | |
---|---|
Task | B - 雨上がり |
User | RYOSKATE |
Language | Java8 (OpenJDK 1.8.0) |
Score | 0 |
Code Size | 993 Byte |
Status | RE |
Exec Time | 113 ms |
Memory | 23764 KB |
Judge Result
Set Name | All | ||
---|---|---|---|
Score / Max Score | 0 / 50 | ||
Status |
|
Set Name | Test Cases |
---|---|
All | 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 |
Case Name | Status | Exec Time | Memory |
---|---|---|---|
case_000.txt | RE | 103 ms | 20052 KB |
case_001.txt | RE | 102 ms | 21844 KB |
case_002.txt | RE | 99 ms | 19412 KB |
case_003.txt | RE | 95 ms | 21588 KB |
case_004.txt | RE | 99 ms | 21844 KB |
case_005.txt | RE | 99 ms | 20560 KB |
case_006.txt | RE | 97 ms | 21844 KB |
case_007.txt | RE | 95 ms | 18644 KB |
case_008.txt | RE | 100 ms | 21844 KB |
case_009.txt | RE | 97 ms | 20948 KB |
case_010.txt | RE | 107 ms | 19540 KB |
case_011.txt | RE | 113 ms | 21716 KB |
case_012.txt | RE | 95 ms | 19796 KB |
case_013.txt | RE | 106 ms | 21844 KB |
case_014.txt | RE | 104 ms | 20692 KB |
case_015.txt | RE | 102 ms | 18900 KB |
case_016.txt | RE | 110 ms | 21844 KB |
case_017.txt | RE | 97 ms | 19924 KB |
case_018.txt | RE | 99 ms | 21844 KB |
case_019.txt | RE | 108 ms | 19796 KB |
case_020.txt | RE | 111 ms | 20692 KB |
case_021.txt | RE | 100 ms | 18772 KB |
case_022.txt | RE | 101 ms | 23636 KB |
case_023.txt | RE | 98 ms | 21716 KB |
case_024.txt | RE | 99 ms | 21716 KB |
case_025.txt | RE | 108 ms | 18640 KB |
case_026.txt | RE | 99 ms | 19668 KB |
case_027.txt | RE | 98 ms | 19796 KB |
case_028.txt | RE | 101 ms | 23124 KB |
case_029.txt | RE | 99 ms | 18644 KB |
case_030.txt | RE | 99 ms | 23764 KB |
case_031.txt | RE | 97 ms | 21844 KB |
case_032.txt | RE | 95 ms | 19796 KB |
case_033.txt | RE | 98 ms | 21716 KB |
case_034.txt | RE | 98 ms | 18644 KB |
case_035.txt | RE | 97 ms | 18900 KB |
case_036.txt | RE | 99 ms | 21716 KB |
case_037.txt | RE | 98 ms | 21844 KB |
case_038.txt | RE | 97 ms | 19924 KB |
case_039.txt | RE | 95 ms | 21844 KB |
case_040.txt | RE | 97 ms | 20684 KB |
case_041.txt | RE | 97 ms | 19412 KB |
case_042.txt | RE | 99 ms | 20692 KB |