結果
問題 | No.495 (^^*) Easy |
ユーザー | losiz17 |
提出日時 | 2017-04-21 15:55:32 |
言語 | Java21 (openjdk 21) |
結果 |
AC
|
実行時間 | 198 ms / 2,000 ms |
コード長 | 534 bytes |
コンパイル時間 | 2,871 ms |
コンパイル使用メモリ | 74,744 KB |
実行使用メモリ | 57,996 KB |
最終ジャッジ日時 | 2023-09-27 10:53:05 |
合計ジャッジ時間 | 4,563 ms |
ジャッジサーバーID (参考情報) |
judge15 / judge11 |
(要ログイン)
テストケース
テストケース表示入力 | 結果 | 実行時間 実行使用メモリ |
---|---|---|
testcase_00 | AC | 134 ms
56,768 KB |
testcase_01 | AC | 137 ms
57,016 KB |
testcase_02 | AC | 135 ms
56,664 KB |
testcase_03 | AC | 135 ms
56,820 KB |
testcase_04 | AC | 148 ms
56,864 KB |
testcase_05 | AC | 145 ms
56,884 KB |
testcase_06 | AC | 198 ms
57,996 KB |
ソースコード
import java.util.Scanner; public class kaomoji { public static void main(String[] args) { // TODO Auto-generated method stub Scanner sc = new Scanner(System.in); char[] emotions = sc.next().toCharArray(); int CountLeft = 0; int CountRight = 0; for(int i=0; i<emotions.length; i++ ){ if(emotions[i] == '*'){ if(emotions[i+1] == ')'){ CountLeft++; }else if(emotions[i+1] == '^'){ CountRight++; } } } System.out.println(CountLeft + " " + CountRight); } }