結果

問題 No.279 木の数え上げ
ユーザー Mcpu3Mcpu3
提出日時 2018-04-26 22:20:57
言語 C
(gcc 12.3.0)
結果
AC  
実行時間 7 ms / 2,000 ms
コード長 443 bytes
コンパイル時間 567 ms
コンパイル使用メモリ 28,760 KB
実行使用メモリ 4,384 KB
最終ジャッジ日時 2023-09-10 05:41:41
合計ジャッジ時間 1,670 ms
ジャッジサーバーID
(参考情報)
judge11 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 1 ms
4,376 KB
testcase_01 AC 1 ms
4,376 KB
testcase_02 AC 0 ms
4,376 KB
testcase_03 AC 1 ms
4,380 KB
testcase_04 AC 1 ms
4,376 KB
testcase_05 AC 0 ms
4,380 KB
testcase_06 AC 1 ms
4,384 KB
testcase_07 AC 1 ms
4,380 KB
testcase_08 AC 1 ms
4,376 KB
testcase_09 AC 0 ms
4,380 KB
testcase_10 AC 7 ms
4,380 KB
testcase_11 AC 2 ms
4,380 KB
testcase_12 AC 5 ms
4,376 KB
testcase_13 AC 2 ms
4,380 KB
testcase_14 AC 7 ms
4,380 KB
testcase_15 AC 7 ms
4,380 KB
testcase_16 AC 6 ms
4,380 KB
testcase_17 AC 6 ms
4,380 KB
testcase_18 AC 4 ms
4,380 KB
testcase_19 AC 7 ms
4,380 KB
testcase_20 AC 7 ms
4,376 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <stdio.h>

int main(void)
{
	char s[1000001];
	scanf("%s", s);
	int i = 0, j[3] = { 0 };
	while (s[i] != '\0') {
		if (s[i] == 't') j[0]++;
		if (s[i] == 'r') j[1]++;
		if (s[i] == 'e') j[2]++;
		i++;
	}
	j[2] /= 2;
	for (int k = 0; k < 2; k++) {
		for (int l = 2; l > k; l--) {
			if (j[l] < j[l - 1]) {
				int t = j[l];
				j[l] = j[l - 1];
				j[l - 1] = t;
			}
		}
	}
	printf("%d\n", j[0]);
	return 0;
}
0