結果
問題 | No.345 最小チワワ問題 |
ユーザー |
|
提出日時 | 2024-11-13 09:19:58 |
言語 | C++23 (gcc 13.3.0 + boost 1.87.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 382 bytes |
コンパイル時間 | 1,007 ms |
コンパイル使用メモリ | 80,500 KB |
実行使用メモリ | 6,824 KB |
最終ジャッジ日時 | 2024-11-13 09:20:01 |
合計ジャッジ時間 | 2,705 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 2 WA * 1 |
other | AC * 12 WA * 17 |
ソースコード
#include <iostream>using namespace std;int main() {string s;cin >> s;int ans = 0;int w = 0;bool f = false;int l = s.size();for(int i = 0; i < l; i++) {if(s[i] == 'c') {if(f) {ans = 0;w = 0;}f = true;}if(f){ans++;if(s[i] == 'w') {w++;}if(w == 2)break;}}cout << ans;}