結果

問題 No.495 (^^*) Easy
ユーザー cande398cande398
提出日時 2017-10-07 23:37:37
言語 Java21
(openjdk 21)
結果
AC  
実行時間 233 ms / 2,000 ms
コード長 446 bytes
コンパイル時間 2,252 ms
コンパイル使用メモリ 76,296 KB
実行使用メモリ 43,736 KB
最終ジャッジ日時 2024-04-28 12:54:03
合計ジャッジ時間 4,068 ms
ジャッジサーバーID
(参考情報)
judge2 / judge4
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 150 ms
42,428 KB
testcase_01 AC 148 ms
42,160 KB
testcase_02 AC 147 ms
42,044 KB
testcase_03 AC 159 ms
42,264 KB
testcase_04 AC 167 ms
42,384 KB
testcase_05 AC 170 ms
42,504 KB
testcase_06 AC 233 ms
43,736 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.*;

public class Main{
  public static void main(String[] args){
    String line = new Scanner(System.in).next();
    int count=0,right=0,left=0;
    while(true){
      if(line.indexOf("(^^*)", count) == count){
        count += 5;
        left++;
      }
      else if(line.indexOf("(*^^)", count) == count){
        count += 5;
        right++;
      }
      else break;
    }
    System.out.println(left + " " + right);
  }
}
0