結果
問題 | No.495 (^^*) Easy |
ユーザー | yagi2 |
提出日時 | 2017-04-14 10:26:38 |
言語 | Java21 (openjdk 21) |
結果 |
AC
|
実行時間 | 353 ms / 2,000 ms |
コード長 | 637 bytes |
コンパイル時間 | 2,450 ms |
コンパイル使用メモリ | 74,084 KB |
実行使用メモリ | 66,008 KB |
最終ジャッジ日時 | 2023-09-25 19:14:59 |
合計ジャッジ時間 | 4,257 ms |
ジャッジサーバーID (参考情報) |
judge12 / judge14 |
(要ログイン)
テストケース
テストケース表示入力 | 結果 | 実行時間 実行使用メモリ |
---|---|---|
testcase_00 | AC | 144 ms
57,140 KB |
testcase_01 | AC | 152 ms
56,808 KB |
testcase_02 | AC | 148 ms
56,868 KB |
testcase_03 | AC | 148 ms
57,044 KB |
testcase_04 | AC | 151 ms
56,884 KB |
testcase_05 | AC | 209 ms
57,984 KB |
testcase_06 | AC | 353 ms
66,008 KB |
ソースコード
import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); String S = sc.next(); long right = 0; long left = 0; String[] sp = S.split(""); for (int i = 0; i < sp.length; i++) { if (i != sp.length - 1) { if (sp[i].equals("^") && sp[i+1].equals("*")) { left++; } if (sp[i].equals("(") && sp[i+1].equals("*")) { right++; } } } System.out.println(left + " " + right); } }