結果
問題 |
No.279 木の数え上げ
|
ユーザー |
![]() |
提出日時 | 2016-10-31 22:38:13 |
言語 | C90 (gcc 12.3.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 451 bytes |
コンパイル時間 | 704 ms |
コンパイル使用メモリ | 20,864 KB |
実行使用メモリ | 6,824 KB |
最終ジャッジ日時 | 2024-11-25 00:15:33 |
合計ジャッジ時間 | 2,467 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 1 WA * 18 RE * 2 |
コンパイルメッセージ
main.c: In function ‘main’: main.c:17:9: warning: ignoring return value of ‘scanf’ declared with attribute ‘warn_unused_result’ [-Wunused-result] 17 | scanf("%s",s); | ^~~~~~~~~~~~~
ソースコード
#include <stdio.h> #include<string.h> int main(void) { int i=0; int o=0; int k=0; int d=0; int g; int f; int ip=0; int w=0; char s[1000000]; scanf("%s",s); d=strlen(s); for(i;i<d;i++){ if(s[i]=='t'){ o++; } if(s[i]=='r'){ k++; } if(s[i]=='e'){ d++; } } f=d/2; g=f+k+o; g=g/3; for(ip=0;ip<g;ip++){ if(f>0&&k>0&&o>0){ w++; } f--; k--; o--; } printf("%d",w); return 0; }