結果
| 問題 |
No.279 木の数え上げ
|
| コンテスト | |
| ユーザー |
yamaken1343
|
| 提出日時 | 2015-11-05 21:36:25 |
| 言語 | C90 (gcc 12.3.0) |
| 結果 |
AC
|
| 実行時間 | 6 ms / 2,000 ms |
| コード長 | 324 bytes |
| コンパイル時間 | 240 ms |
| コンパイル使用メモリ | 21,120 KB |
| 実行使用メモリ | 6,944 KB |
| 最終ジャッジ日時 | 2024-09-13 12:51:16 |
| 合計ジャッジ時間 | 1,076 ms |
|
ジャッジサーバーID (参考情報) |
judge1 / judge3 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 21 |
コンパイルメッセージ
main.c: In function ‘main’:
main.c:8:9: warning: ignoring return value of ‘scanf’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
8 | scanf("%s",c);
| ^~~~~~~~~~~~~
ソースコード
#include<stdio.h>
#include<string.h>
int main(void){
int i,b=25000;
int a[3] = {};
char c[1000000];
scanf("%s",c);
for(i=0;i<strlen(c);i++){
if(c[i] == 'e') a[2]++;
else if(c[i] == 't') a[0]++;
else if(c[i] == 'r') a[1]++;
}
a[2] /=2;
for(i=0;i<3;i++){
if(b>a[i]) b=a[i];
}
printf("%d\n",b);
return 0;
}
yamaken1343