結果

問題 No.279 木の数え上げ
ユーザー Haijinn
提出日時 2017-08-05 16:17:56
言語 C90
(gcc 12.3.0)
結果
CE  
(最新)
AC  
(最初)
実行時間 -
コード長 474 bytes
コンパイル時間 486 ms
コンパイル使用メモリ 26,752 KB
最終ジャッジ日時 2025-03-18 14:26:50
合計ジャッジ時間 1,580 ms
ジャッジサーバーID
(参考情報)
judge5 / judge2
このコードへのチャレンジ
(要ログイン)
コンパイルエラー時のメッセージ・ソースコードは、提出者また管理者しか表示できないようにしております。(リジャッジ後のコンパイルエラーは公開されます)
ただし、clay言語の場合は開発者のデバッグのため、公開されます。

コンパイルメッセージ
main.c: In function 'main':
main.c:14:1: error: C++ style comments are not allowed in ISO C90
   14 | //printf("!%s\n",s);
      | ^
main.c:14:1: note: (this will be reported only once per input file)

ソースコード

diff #

#include<stdio.h>
#include<string.h>
#include<stdlib.h>
#include<time.h>
int main(){
	int a=0;
	int c=0;
	int b=0;
	int d=0;
	int i;
	
char s[1000010];
scanf("%s",s);
//printf("!%s\n",s);
for(i=0;i<strlen(s);i++){
	
		if(s[i]=='t'){
			
			a++;
		}
		if(s[i]=='r'){
			
			b++;
			
		}
		if(s[i]=='e'){
			
			
			c++;
			
		}
		
	
}
for(i=0;i<strlen(s);i++){
	if(a>=1&&b>=1&&c>=2){
		a--;
		b--;
		c-=2;
		
		d++;
		
		
		
		
	}
	
	
	
	
	
	
}
printf("%d\n",d);
	return 0;
}
0