結果

問題 No.279 木の数え上げ
コンテスト
ユーザー AoiroFukurou
提出日時 2016-01-06 14:50:07
言語 Java
(openjdk 25.0.2)
コンパイル:
javac -encoding UTF8 _filename_
実行:
java -ea -Xmx700m -Xss256M -DONLINE_JUDGE=true _class_
結果
WA  
実行時間 -
コード長 575 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 3,652 ms
コンパイル使用メモリ 82,444 KB
実行使用メモリ 106,132 KB
最終ジャッジ日時 2026-04-07 23:09:40
合計ジャッジ時間 7,572 ms
ジャッジサーバーID
(参考情報)
judge1_0 / judge3_0
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other WA * 12 MLE * 9
権限があれば一括ダウンロードができます

ソースコード

diff #
raw source code

package yuki_coder;

import java.util.Scanner;

public class No_279 {
public static void main(String[] args) {
	Scanner sc = new Scanner(System.in);
	String S = sc.nextLine();
	sc.close();
	String[] str = new String[S.length()];
	int t = 0;
	int r = 0;
	int e = 0;
	int tree = 0;
	for(int i = 1; i <=S.length(); i++){
		str[i-1] = S.substring(i-1, i);
	}
	for(int i = 0; i < S.length(); i++){
		if(str[i].equals("t")){
			t++;
		}
		if(str[i].equals("r")){
			r++;
		}
		if(str[i].equals("e")){
			e++;
		}
	}
	if(t==r&&t==e/2){
		tree = t;
	}
	System.out.println(tree);
}
}
0