結果
| 問題 | No.203 ゴールデン・ウィーク(1) |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2025-12-06 06:42:51 |
| 言語 | Java (openjdk 25.0.2) |
| 結果 |
AC
|
| 実行時間 | 33 ms / 1,000 ms |
| + 852µs | |
| コード長 | 1,282 bytes |
| 記録 | |
| コンパイル時間 | 1,516 ms |
| コンパイル使用メモリ | 85,132 KB |
| 実行使用メモリ | 40,700 KB |
| 最終ジャッジ日時 | 2026-07-18 23:32:03 |
| 合計ジャッジ時間 | 4,312 ms |
|
ジャッジサーバーID (参考情報) |
judge2_0 / judge1_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 29 |
ソースコード
import java.io.*;
class Process {
private String[] S;
Process(String[] S) {
this.S = S;
}
int getResult() {
String days = S[0] + S[1];
int holidayCount = 0;
int maxHolidayCount = 0;
for(int i = 0; i < days.length(); i++) {
if(days.charAt(i) == 'o') {
holidayCount++;
} else {
if(holidayCount > maxHolidayCount) {
maxHolidayCount = holidayCount;
}
holidayCount = 0;
}
}
if(holidayCount > maxHolidayCount) {
maxHolidayCount = holidayCount;
}
return maxHolidayCount;
}
}
public class Main {
public static void main(String[] args) throws IOException {
var bufferedReader = new BufferedReader(new InputStreamReader(System.in));
var printWriter = new PrintWriter(new BufferedWriter(new OutputStreamWriter(System.out)));
// 入力
var S = new String[2];
for(int i = 0; i < 2; i++) {
S[i] = bufferedReader.readLine().trim();
}
// 処理および出力
printWriter.println((new Process(S)).getResult());
bufferedReader.close();
printWriter.close();
}
}