結果

問題 No.495 (^^*) Easy
ユーザー kazapyon27kazapyon27
提出日時 2017-07-03 02:44:41
言語 Java21
(openjdk 21)
結果
AC  
実行時間 180 ms / 2,000 ms
コード長 608 bytes
コンパイル時間 3,940 ms
コンパイル使用メモリ 82,996 KB
実行使用メモリ 54,748 KB
最終ジャッジ日時 2024-04-15 12:50:58
合計ジャッジ時間 4,756 ms
ジャッジサーバーID
(参考情報)
judge3 / judge2
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 98 ms
52,920 KB
testcase_01 AC 87 ms
51,312 KB
testcase_02 AC 85 ms
51,044 KB
testcase_03 AC 86 ms
51,392 KB
testcase_04 AC 88 ms
51,440 KB
testcase_05 AC 107 ms
53,064 KB
testcase_06 AC 180 ms
54,748 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

/*No.495 (^^*) Easy*/
import java.io.*;
public class No495 {
	public static void main(String[] args) {
		try(BufferedReader input =new BufferedReader(new InputStreamReader(System.in))){
			int i=0,LeftFace=0,RightFace=0;
			String FaceLanguage=input.readLine().replaceAll("\\(\\^\\^\\*\\)", "L").replaceAll("\\(\\*\\^\\^\\)", "R");
			while(FaceLanguage.charAt(i)!='#'){
				if(FaceLanguage.charAt(i)=='L'){
					LeftFace++;
				}else if(FaceLanguage.charAt(i)=='R'){
					RightFace++;
				}
				i++;
			}
			System.out.println(LeftFace+" "+RightFace);
		}catch(Exception e){
			e.printStackTrace();
		}
	}
}
0