結果
問題 |
No.279 木の数え上げ
|
ユーザー |
![]() |
提出日時 | 2019-06-27 13:35:43 |
言語 | C#(csc) (csc 3.9.0) |
結果 |
AC
|
実行時間 | 113 ms / 2,000 ms |
コード長 | 1,022 bytes |
コンパイル時間 | 3,012 ms |
コンパイル使用メモリ | 102,912 KB |
実行使用メモリ | 24,576 KB |
最終ジャッジ日時 | 2024-06-27 20:01:53 |
合計ジャッジ時間 | 5,630 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
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.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace yukicoderTest { class Program { static void Main(string[] args) { string input = Console.ReadLine(); int tcnt = 0; int rcnt = 0; int ecnt = 0; int tree = 0; for(int i=0;i<input.Length;i++) { string temp = input.Substring(i, 1); if (temp == "t") { tcnt++; } else if (temp == "r") { rcnt++; } else if (temp == "e") { ecnt++; } } while(tcnt>=1&&rcnt>=1&&ecnt>=2) { tcnt--; rcnt--; ecnt -= 2; tree++; } Console.WriteLine(tree); } } }