結果
問題 |
No.346 チワワ数え上げ問題
|
ユーザー |
![]() |
提出日時 | 2016-07-11 12:27:09 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
TLE
|
実行時間 | - |
コード長 | 488 bytes |
コンパイル時間 | 1,375 ms |
コンパイル使用メモリ | 166,412 KB |
実行使用メモリ | 13,632 KB |
最終ジャッジ日時 | 2024-10-13 10:54:24 |
合計ジャッジ時間 | 5,141 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | -- * 3 |
other | AC * 10 TLE * 1 -- * 12 |
ソースコード
#include <bits/stdc++.h> #define REP(i,n) for(int i=0; i<(n); i++) #define REP2(i,x,n) for(int i=x; i<(n); i++) using namespace std; int main() { cin.tie(0); ios::sync_with_stdio(false); string S; cin >> S; int count{}; REP( i, (int)S.size() ) { if( S[i] == 'c' ) { REP2( j, i + 1, (int)S.size() ) { REP2( k, j, (int)S.size() ) { if( S[j] == 'w' && S[k] == 'w' && j != k ) { count++; } } } } } cout << count << endl; return 0; }