結果
| 問題 | No.203 ゴールデン・ウィーク(1) |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2025-12-06 06:42:51 |
| 言語 | Java (openjdk 23) |
| 結果 |
AC
|
| 実行時間 | 63 ms / 1,000 ms |
| コード長 | 1,282 bytes |
| 記録 | |
| コンパイル時間 | 2,287 ms |
| コンパイル使用メモリ | 82,724 KB |
| 実行使用メモリ | 44,108 KB |
| 最終ジャッジ日時 | 2025-12-06 06:42:57 |
| 合計ジャッジ時間 | 5,723 ms |
|
ジャッジサーバーID (参考情報) |
judge5 / judge6 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| 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();
}
}