結果
問題 |
No.345 最小チワワ問題
|
ユーザー |
|
提出日時 | 2020-06-07 20:47:19 |
言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 266 bytes |
コンパイル時間 | 1,808 ms |
コンパイル使用メモリ | 192,808 KB |
最終ジャッジ日時 | 2025-01-10 23:57:21 |
ジャッジサーバーID (参考情報) |
judge5 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 10 WA * 19 |
ソースコード
#include<bits/stdc++.h> using namespace std; int main(){ string s; cin>>s; int c=0; while(c<s.size()&&s.at(c)!='c')++c; int w2=s.size()-1; while(w2>=0&&s.at(w2)!='w')--w2; int w1=w2-1; while(w1>=0&&s.at(w1)!='w')--w1; cout<<(c<w1&&w1<w2?w2-c+1:-1)<<"\n"s; }