結果

問題 No.495 (^^*) Easy
ユーザー YamaKasaYamaKasa
提出日時 2018-05-06 17:32:36
言語 Java21
(openjdk 21)
結果
AC  
実行時間 233 ms / 2,000 ms
コード長 517 bytes
コンパイル時間 2,076 ms
コンパイル使用メモリ 74,368 KB
実行使用メモリ 59,816 KB
最終ジャッジ日時 2023-09-10 10:47:18
合計ジャッジ時間 3,962 ms
ジャッジサーバーID
(参考情報)
judge14 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 150 ms
56,576 KB
testcase_01 AC 150 ms
56,868 KB
testcase_02 AC 121 ms
55,568 KB
testcase_03 AC 150 ms
56,620 KB
testcase_04 AC 152 ms
56,828 KB
testcase_05 AC 168 ms
56,708 KB
testcase_06 AC 233 ms
59,816 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.Scanner;

public class Main {
	public static void main(String[] args) {
		Scanner scan = new Scanner(System.in);
		String S = scan.next();
		scan.close();
		if(S.length() == 1) {
			System.out.println(0 + " " + 0);
			System.exit(0);
		}
		int cnt1 = 0;
		int cnt2 = 0;
		for(int i = 0; i < S.length() / 5; i++) {
			String k = S.substring(5 * i, 5 *(i + 1));
			if(k.equals("(^^*)")) {
				cnt1 ++;
			}else if(k.equals("(*^^)")) {
				cnt2 ++;
			}
		}
		System.out.println(cnt1 + " " + cnt2);
	}
}
0