結果
問題 |
No.150 "良問"(良問とは言っていない
|
ユーザー |
![]() |
提出日時 | 2015-07-07 19:01:59 |
言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 485 bytes |
コンパイル時間 | 1,113 ms |
コンパイル使用メモリ | 159,480 KB |
実行使用メモリ | 5,376 KB |
最終ジャッジ日時 | 2024-07-08 01:30:49 |
合計ジャッジ時間 | 1,768 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 1 |
other | AC * 4 WA * 16 |
ソースコード
#include <bits/stdc++.h> using namespace std; int main(){ int t; cin>>t; string good="good",problem="problem"; string s; while(t--){ cin>>s; int ans=11,length=(int)s.size(); for(int i=0;i<length-10;i++){ int temp1=0; for(int g=0;g<4;g++){ if(good[g]!=s[i+g]) temp1++; } for(int j=4;j<length-6;j++){ int temp2=0; for(int p=0;p<7;p++){ if(problem[p]!=s[j+p]) temp2++; } ans=min(ans,temp1+temp2); } } cout<<ans<<endl; } return 0; }