結果

問題 No.495 (^^*) Easy
ユーザー htensaihtensai
提出日時 2019-11-17 21:41:10
言語 Java21
(openjdk 21)
結果
AC  
実行時間 224 ms / 2,000 ms
コード長 443 bytes
コンパイル時間 2,205 ms
コンパイル使用メモリ 76,884 KB
実行使用メモリ 58,756 KB
最終ジャッジ日時 2023-10-25 21:38:11
合計ジャッジ時間 4,359 ms
ジャッジサーバーID
(参考情報)
judge15 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 144 ms
58,124 KB
testcase_01 AC 144 ms
58,192 KB
testcase_02 AC 145 ms
58,124 KB
testcase_03 AC 144 ms
58,120 KB
testcase_04 AC 156 ms
58,144 KB
testcase_05 AC 160 ms
58,132 KB
testcase_06 AC 224 ms
58,756 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.*;

public class Main {
 	public static void main (String[] args) throws Exception {
		Scanner sc = new Scanner(System.in);
		char[] arr = sc.next().toCharArray();
		int left = 0;
		int right = 0;
		for (int i = 0; (i + 1) * 5 <= arr.length; i++) {
		    if (arr[i * 5 + 3] == '*') {
		        left++;
		    } else if (arr[i * 5 + 1] == '*') {
		        right++;
		    }
		} 
	    System.out.println(left + " " + right);
	}
}
0