結果

問題 No.495 (^^*) Easy
ユーザー tentententen
提出日時 2020-11-12 08:19:44
言語 Java21
(openjdk 21)
結果
AC  
実行時間 234 ms / 2,000 ms
コード長 522 bytes
コンパイル時間 2,221 ms
コンパイル使用メモリ 73,608 KB
実行使用メモリ 58,100 KB
最終ジャッジ日時 2023-09-30 01:04:23
合計ジャッジ時間 4,156 ms
ジャッジサーバーID
(参考情報)
judge12 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 147 ms
56,676 KB
testcase_01 AC 148 ms
56,792 KB
testcase_02 AC 146 ms
56,748 KB
testcase_03 AC 147 ms
56,836 KB
testcase_04 AC 154 ms
56,700 KB
testcase_05 AC 163 ms
56,528 KB
testcase_06 AC 234 ms
58,100 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.*;

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