結果
問題 | No.204 ゴールデン・ウィーク(2) |
ユーザー | htensai |
提出日時 | 2019-11-25 10:14:13 |
言語 | Java21 (openjdk 21) |
結果 |
WA
|
実行時間 | - |
コード長 | 790 bytes |
コンパイル時間 | 2,117 ms |
コンパイル使用メモリ | 74,948 KB |
実行使用メモリ | 56,160 KB |
最終ジャッジ日時 | 2024-04-20 22:30:58 |
合計ジャッジ時間 | 9,263 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge3 |
(要ログイン)
テストケース
テストケース表示入力 | 結果 | 実行時間 実行使用メモリ |
---|---|---|
testcase_00 | AC | 116 ms
53,568 KB |
testcase_01 | WA | - |
testcase_02 | WA | - |
testcase_03 | WA | - |
testcase_04 | AC | 119 ms
53,800 KB |
testcase_05 | AC | 119 ms
54,132 KB |
testcase_06 | AC | 121 ms
54,068 KB |
testcase_07 | WA | - |
testcase_08 | WA | - |
testcase_09 | WA | - |
testcase_10 | WA | - |
testcase_11 | WA | - |
testcase_12 | AC | 114 ms
54,020 KB |
testcase_13 | WA | - |
testcase_14 | WA | - |
testcase_15 | WA | - |
testcase_16 | AC | 110 ms
53,252 KB |
testcase_17 | AC | 119 ms
54,184 KB |
testcase_18 | WA | - |
testcase_19 | WA | - |
testcase_20 | WA | - |
testcase_21 | WA | - |
testcase_22 | WA | - |
testcase_23 | AC | 120 ms
54,236 KB |
testcase_24 | WA | - |
testcase_25 | WA | - |
testcase_26 | AC | 112 ms
53,528 KB |
testcase_27 | WA | - |
testcase_28 | WA | - |
testcase_29 | AC | 126 ms
54,040 KB |
testcase_30 | AC | 122 ms
53,852 KB |
testcase_31 | AC | 125 ms
54,168 KB |
testcase_32 | WA | - |
testcase_33 | WA | - |
testcase_34 | AC | 135 ms
54,108 KB |
testcase_35 | AC | 134 ms
54,032 KB |
testcase_36 | AC | 133 ms
54,404 KB |
testcase_37 | AC | 123 ms
53,888 KB |
testcase_38 | AC | 110 ms
52,932 KB |
testcase_39 | WA | - |
testcase_40 | AC | 127 ms
54,004 KB |
testcase_41 | AC | 112 ms
52,564 KB |
testcase_42 | WA | - |
testcase_43 | AC | 124 ms
53,840 KB |
testcase_44 | AC | 123 ms
54,272 KB |
testcase_45 | AC | 125 ms
53,888 KB |
testcase_46 | AC | 124 ms
53,932 KB |
testcase_47 | WA | - |
testcase_48 | AC | 124 ms
53,872 KB |
ソースコード
import java.util.*; public class Main { public static void main (String[] args) { Scanner sc = new Scanner(System.in); int d = sc.nextInt(); char[][] arrs = new char[2][]; arrs[0] = sc.next().toCharArray(); arrs[1] = sc.next().toCharArray(); boolean[] holidays = new boolean[14]; for (int i = 0; i < 2; i++) { for (int j = 0; j < 7; j++) { holidays[i * 7 + j] = arrs[i][j] == 'o'; } } int max = 0; for (int i = 0; i + d - 1 < 14; i++) { int count = 0; int idx = i - 1; while (idx >= 0 && holidays[idx]) { idx--; count++; } idx = i + d; while (idx < 14 && holidays[idx]) { idx++; count++; } max = Math.max(max, d + count); } System.out.println(max); } }