結果

問題 No.495 (^^*) Easy
ユーザー TwinkleStar74TwinkleStar74
提出日時 2017-10-08 22:01:26
言語 Java21
(openjdk 21)
結果
AC  
実行時間 101 ms / 2,000 ms
コード長 717 bytes
コンパイル時間 2,143 ms
コンパイル使用メモリ 75,600 KB
実行使用メモリ 53,028 KB
最終ジャッジ日時 2024-04-28 13:36:57
合計ジャッジ時間 2,929 ms
ジャッジサーバーID
(参考情報)
judge2 / judge4
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 72 ms
50,764 KB
testcase_01 AC 72 ms
51,240 KB
testcase_02 AC 71 ms
50,872 KB
testcase_03 AC 72 ms
50,876 KB
testcase_04 AC 70 ms
51,052 KB
testcase_05 AC 85 ms
51,044 KB
testcase_06 AC 101 ms
53,028 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;

class No495{
	public static void main(String[] args) {
		try{
			BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
			int left = 0; int right = 0;
			Hantei(br,left,right);
		}
		catch(IOException e){
			e.getStackTrace();
		}
	}
	public static void Hantei(BufferedReader br, int left, int right)  throws IOException{
		String str = br.readLine();
		boolean bln = true;
		int i = 0;
		while(bln){
			if(str.charAt(5*i) == '#'){
				bln = false;
			}
			else if(str.charAt(5*i+3) == '*'){
				left++;
				i++;
			}
			else {
				right++;
				i++;
			}
		}
		System.out.println(left +" "+ right);
	}
}
0