結果

問題 No.495 (^^*) Easy
ユーザー ohagi_1182ohagi_1182
提出日時 2017-10-12 21:04:03
言語 Java21
(openjdk 21)
結果
AC  
実行時間 230 ms / 2,000 ms
コード長 385 bytes
コンパイル時間 2,220 ms
コンパイル使用メモリ 76,212 KB
実行使用メモリ 44,372 KB
最終ジャッジ日時 2024-04-28 17:08:23
合計ジャッジ時間 4,049 ms
ジャッジサーバーID
(参考情報)
judge5 / judge4
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 156 ms
42,368 KB
testcase_01 AC 155 ms
42,332 KB
testcase_02 AC 154 ms
41,764 KB
testcase_03 AC 140 ms
42,072 KB
testcase_04 AC 143 ms
41,980 KB
testcase_05 AC 168 ms
42,372 KB
testcase_06 AC 230 ms
44,372 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		String s = sc.next();
		int n = s.length();
		int left = 0; int right = 0;
		for(int i = 0 ; i < n - 5; i += 5) {
			if(s.substring(i, i + 5).equals("(^^*)")) {
				left++;
			} else {
				right++;
			}
		}
		System.out.println(left + " " + right);
	}
}
0