結果

問題 No.495 (^^*) Easy
ユーザー uafr_csuafr_cs
提出日時 2017-03-24 22:30:01
言語 Java21
(openjdk 21)
結果
AC  
実行時間 215 ms / 2,000 ms
コード長 578 bytes
コンパイル時間 2,311 ms
コンパイル使用メモリ 71,868 KB
実行使用メモリ 56,940 KB
最終ジャッジ日時 2023-09-20 07:03:14
合計ジャッジ時間 4,186 ms
ジャッジサーバーID
(参考情報)
judge14 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 125 ms
55,576 KB
testcase_01 AC 124 ms
55,768 KB
testcase_02 AC 123 ms
56,300 KB
testcase_03 AC 126 ms
55,744 KB
testcase_04 AC 129 ms
55,768 KB
testcase_05 AC 153 ms
55,872 KB
testcase_06 AC 215 ms
56,940 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.Scanner;
import java.util.regex.Matcher;
import java.util.regex.Pattern;

public class Main {
	
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		
		final String str = sc.next();
		
		int left_count = 0, right_count = 0;
		final Matcher left_match  = Pattern.compile("(\\^\\^\\*)").matcher(str);
		final Matcher right_match = Pattern.compile("(\\*\\^\\^)").matcher(str);
		while(left_match.find()){ left_count++; }
		while(right_match.find()){ right_count++; }
		
		System.out.printf("%d %d\n", left_count, right_count);
		
	}
}
0