結果
問題 | No.279 木の数え上げ |
ユーザー |
|
提出日時 | 2017-10-26 17:41:32 |
言語 | C#(csc) (csc 3.9.0) |
結果 |
AC
|
実行時間 | 86 ms / 2,000 ms |
コード長 | 515 bytes |
コンパイル時間 | 1,080 ms |
コンパイル使用メモリ | 111,356 KB |
実行使用メモリ | 23,552 KB |
最終ジャッジ日時 | 2024-11-21 20:06:11 |
合計ジャッジ時間 | 3,076 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 21 |
コンパイルメッセージ
Microsoft (R) Visual C# Compiler version 3.9.0-6.21124.20 (db94f4cc) Copyright (C) Microsoft Corporation. All rights reserved.
ソースコード
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(); } }