結果

問題 No.495 (^^*) Easy
ユーザー TwinkleStar74
提出日時 2017-10-08 22:01:26
言語 Java
(openjdk 23)
結果
AC  
実行時間 98 ms / 2,000 ms
コード長 717 bytes
コンパイル時間 1,845 ms
コンパイル使用メモリ 74,312 KB
実行使用メモリ 40,168 KB
最終ジャッジ日時 2024-11-17 05:48:29
合計ジャッジ時間 2,913 ms
ジャッジサーバーID
(参考情報)
judge2 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 7
権限があれば一括ダウンロードができます

ソースコード

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