結果

問題 No.495 (^^*) Easy
ユーザー YamaKasa
提出日時 2018-05-06 17:32:36
言語 Java
(openjdk 23)
結果
AC  
実行時間 233 ms / 2,000 ms
コード長 517 bytes
コンパイル時間 2,429 ms
コンパイル使用メモリ 76,272 KB
実行使用メモリ 44,204 KB
最終ジャッジ日時 2024-06-28 02:10:35
合計ジャッジ時間 4,067 ms
ジャッジサーバーID
(参考情報)
judge4 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 7
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.Scanner;

public class Main {
	public static void main(String[] args) {
		Scanner scan = new Scanner(System.in);
		String S = scan.next();
		scan.close();
		if(S.length() == 1) {
			System.out.println(0 + " " + 0);
			System.exit(0);
		}
		int cnt1 = 0;
		int cnt2 = 0;
		for(int i = 0; i < S.length() / 5; i++) {
			String k = S.substring(5 * i, 5 *(i + 1));
			if(k.equals("(^^*)")) {
				cnt1 ++;
			}else if(k.equals("(*^^)")) {
				cnt2 ++;
			}
		}
		System.out.println(cnt1 + " " + cnt2);
	}
}
0