結果

問題 No.279 木の数え上げ
ユーザー chankou0920chankou0920
提出日時 2017-10-26 17:41:32
言語 C#(csc)
(csc 3.9.0)
結果
AC  
実行時間 84 ms / 2,000 ms
コード長 515 bytes
コンパイル時間 802 ms
コンパイル使用メモリ 109,904 KB
実行使用メモリ 31,296 KB
最終ジャッジ日時 2024-05-01 15:12:59
合計ジャッジ時間 2,765 ms
ジャッジサーバーID
(参考情報)
judge5 / judge4
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 24 ms
22,320 KB
testcase_01 AC 24 ms
24,096 KB
testcase_02 AC 24 ms
24,344 KB
testcase_03 AC 24 ms
24,244 KB
testcase_04 AC 24 ms
24,348 KB
testcase_05 AC 25 ms
22,196 KB
testcase_06 AC 24 ms
26,648 KB
testcase_07 AC 24 ms
24,620 KB
testcase_08 AC 24 ms
26,768 KB
testcase_09 AC 24 ms
24,476 KB
testcase_10 AC 81 ms
29,084 KB
testcase_11 AC 36 ms
24,736 KB
testcase_12 AC 63 ms
27,296 KB
testcase_13 AC 30 ms
26,588 KB
testcase_14 AC 84 ms
29,720 KB
testcase_15 AC 75 ms
28,464 KB
testcase_16 AC 70 ms
29,800 KB
testcase_17 AC 80 ms
29,484 KB
testcase_18 AC 53 ms
26,296 KB
testcase_19 AC 79 ms
29,236 KB
testcase_20 AC 80 ms
31,296 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
Microsoft (R) Visual C# Compiler version 3.9.0-6.21124.20 (db94f4cc)
Copyright (C) Microsoft Corporation. All rights reserved.

ソースコード

diff #

using System;
using System.Linq;  // 追加

public class Program {
	public void Solve() {
		Char[] c = Console.ReadLine().ToCharArray();
		int t = c.Count(x=>x.Equals('t'));
		int r = c.Count(x=>x.Equals('r'));
		int e = c.Count(x=>x.Equals('e'));
		int count = 0;
		while (true) {
			t -= 1;
			r -= 1;
			e -= 2;
			if (t < 0 || r < 0 || e < 0) {
				break;
			}
			count++;
		}
		Console.WriteLine(count);
	}
	
	public static void Main(string[] args) {
		Program program = new Program();
		program.Solve();
	}
}
0