結果
問題 | No.279 木の数え上げ |
ユーザー | y32M-71693993 |
提出日時 | 2015-09-27 20:15:57 |
言語 | C++11 (gcc 11.4.0) |
結果 |
AC
|
実行時間 | 9 ms / 2,000 ms |
コード長 | 3,518 bytes |
コンパイル時間 | 1,250 ms |
コンパイル使用メモリ | 157,956 KB |
実行使用メモリ | 6,820 KB |
最終ジャッジ日時 | 2024-10-14 15:14:09 |
合計ジャッジ時間 | 2,123 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge5 |
(要ログイン)
テストケース
テストケース表示入力 | 結果 | 実行時間 実行使用メモリ |
---|---|---|
testcase_00 | AC | 2 ms
6,820 KB |
testcase_01 | AC | 2 ms
6,816 KB |
testcase_02 | AC | 2 ms
6,816 KB |
testcase_03 | AC | 2 ms
6,820 KB |
testcase_04 | AC | 3 ms
6,820 KB |
testcase_05 | AC | 2 ms
6,816 KB |
testcase_06 | AC | 2 ms
6,816 KB |
testcase_07 | AC | 3 ms
6,820 KB |
testcase_08 | AC | 2 ms
6,816 KB |
testcase_09 | AC | 2 ms
6,816 KB |
testcase_10 | AC | 8 ms
6,820 KB |
testcase_11 | AC | 4 ms
6,816 KB |
testcase_12 | AC | 7 ms
6,816 KB |
testcase_13 | AC | 3 ms
6,816 KB |
testcase_14 | AC | 9 ms
6,816 KB |
testcase_15 | AC | 7 ms
6,820 KB |
testcase_16 | AC | 7 ms
6,816 KB |
testcase_17 | AC | 9 ms
6,816 KB |
testcase_18 | AC | 5 ms
6,820 KB |
testcase_19 | AC | 8 ms
6,816 KB |
testcase_20 | AC | 9 ms
6,820 KB |
コンパイルメッセージ
main.cpp: In function ‘int main()’: main.cpp:96:14: warning: ignoring return value of ‘int scanf(const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result] 96 | scanf("%s", str); | ~~~~~^~~~~~~~~~~
ソースコード
#include <bits/stdc++.h> using namespace std; // Macro Tools ///////////////////////////////////////////////////////////////// #define GET_MACRO_09(A1, A2, A3, A4, A5, A6, A7, A8, A9, NAME, ...) NAME #define EXPAND_01(FIRST, NEXT, A) \ FIRST(A) #define EXPAND_02(FIRST, NEXT, A, B) \ FIRST(A) NEXT(B) #define EXPAND_03(FIRST, NEXT, A, B, C) \ FIRST(A) NEXT(B) NEXT(C) #define EXPAND_04(FIRST, NEXT, A, B, C, D) \ FIRST(A) NEXT(B) NEXT(C) NEXT(D) #define EXPAND_05(FIRST, NEXT, A, B, C, D, E) \ FIRST(A) NEXT(B) NEXT(C) NEXT(D) NEXT(E) #define EXPAND_06(FIRST, NEXT, A, B, C, D, E, F) \ FIRST(A) NEXT(B) NEXT(C) NEXT(D) NEXT(E) NEXT(F) #define EXPAND_07(FIRST, NEXT, A, B, C, D, E, F, G) \ FIRST(A) NEXT(B) NEXT(C) NEXT(D) NEXT(E) NEXT(F) NEXT(G) #define EXPAND_08(FIRST, NEXT, A, B, C, D, E, F, G, H) \ FIRST(A) NEXT(B) NEXT(C) NEXT(D) NEXT(E) NEXT(F) NEXT(G) NEXT(H) #define EXPAND_09(FIRST, NEXT, A, B, C, D, E, F, G, H, I) \ FIRST(A) NEXT(B) NEXT(C) NEXT(D) NEXT(E) NEXT(F) NEXT(G) NEXT(H) NEXT(I) #define EXPAND_ADD(FIRST, NEXT, ...) \ GET_MACRO_09(__VA_ARGS__, EXPAND_09, EXPAND_08, EXPAND_07, EXPAND_06, \ EXPAND_05, EXPAND_04, EXPAND_03, EXPAND_02, EXPAND_01) \ (FIRST, NEXT, __VA_ARGS__) #define EXPAND(MACRO, ...) EXPAND_ADD(MACRO, MACRO, __VA_ARGS__) #define Q(x) #x #define QUOTE(x) Q(x) // Input /////////////////////////////////////////////////////////////////////// #define RIGHT_SHIFT_BEFORE(a) >>a #define CAMMA_AND_ADDRESS(a) , &a #define INT_FORMATTER(a) %d #define SCANF_INT(a) scanf("%d", &(a)); // #define SCANF_LL(a) scanf("%I64d", &(a)); #define I(...) int __VA_ARGS__; EXPAND(SCANF_INT, __VA_ARGS__); // #define L(...) long long __VA_ARGS__; EXPAND(SCANF_LL, __VA_ARGS__); #define input(t,v) t v;cin>>v; #define input2(t,v1,v2) t v1,v2;cin>>v1>>v2; #define input3(t,v1,v2,v3) t v1,v2,v3;cin>>v1>>v2>>v3; #if __cplusplus > 199711L //C++11 template<class T=int> #else template<class T> #endif T read() { T t; cin >> t; return t; } // Types /////////////////////////////////////////////////////////////////////// typedef long long ll; typedef pair<int, int> pii; typedef pair<ll, ll> pll; typedef set<int> si; typedef set<ll, ll> sll; typedef vector<int> vi; typedef vector<ll> vll; typedef list<int> li; typedef list<ll> lll; typedef map<int, int> mii; typedef map<int, ll> mil; typedef map<ll, int> mli; typedef map<ll, ll> mll; // Loop & Iteration //////////////////////////////////////////////////////////// #define FOR(i, a, b) for(int i = (a), loop_end_##i=(b); i < (loop_end_##i); i++) #define REP(i, n) FOR(i, 0, n) #define rep(v,n) for(int (v)=0;(v)<(n);(v)++) #define EACH(i,c) for(auto i=(c).begin(); i!=(c).end(); ++i) #define SORT(c) sort((c).begin(),(c).end()) #define EXIST(s,e) ((s).find(e)!=(s).end()) #define PB push_back // Range /////////////////////////////////////////////////////////////////////// #define IN(x, a, b) (a<=x && x<b) int dx[8] = { 1, 0, 0,-1, 1, 1,-1,-1}; int dy[8] = { 0,-1, 1, 0,-1, 1,-1, 1}; // Debug /////////////////////////////////////////////////////////////////////// #define dump(x) cout << #x << " = " << (x) << endl #define debug(x) cout << #x << " = " << (x) << " (L" << __LINE__ << ")" << " " << __FILE__ << endl //////////////////////////////////////////////////////////////////////////////// int main(){ char str[1000005]; scanf("%s", str); int t=0, r=0, e=0; REP(i, strlen(str)){ if(str[i]=='t') t++; if(str[i]=='r') r++; if(str[i]=='e') e++; } int ans = min(min(t, r), e/2); printf("%d\n", ans); }