結果
| 問題 |
No.279 木の数え上げ
|
| コンテスト | |
| ユーザー |
syakebanana832
|
| 提出日時 | 2017-06-12 17:30:06 |
| 言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
| 結果 |
TLE
|
| 実行時間 | - |
| コード長 | 334 bytes |
| コンパイル時間 | 136 ms |
| コンパイル使用メモリ | 23,168 KB |
| 実行使用メモリ | 13,756 KB |
| 最終ジャッジ日時 | 2024-09-24 16:47:20 |
| 合計ジャッジ時間 | 3,710 ms |
|
ジャッジサーバーID (参考情報) |
judge3 / judge5 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 10 TLE * 1 -- * 10 |
コンパイルメッセージ
main.cpp: In function ‘int main()’:
main.cpp:7:17: warning: format ‘%s’ expects argument of type ‘char*’, but argument 2 has type ‘char (*)[1000000]’ [-Wformat=]
7 | scanf("%s",&s);
| ~^ ~~
| | |
| | char (*)[1000000]
| char*
main.cpp:7:14: warning: ignoring return value of ‘int scanf(const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
7 | scanf("%s",&s);
| ~~~~~^~~~~~~~~
ソースコード
#include<stdio.h>
#include<string.h>
char s[1000000];
int n,i,t,r,e;
int main()
{
scanf("%s",&s);
for(i=0;i<strlen(s);i++){
if(s[i]=='t'){
t++;
}
if(s[i]=='r'){
r++;
}
if(s[i]=='e'){
e++;
}
}
while(1){
if(t==0||r==0||e<=1){
break;
}
n++;
t--;
r--;
e-=2;
}
printf("%d\n",n);
return 0;
}
syakebanana832