結果

問題 No.150 "良問"(良問とは言っていない
ユーザー Bantako
提出日時 2018-06-14 00:16:25
言語 C++14
(gcc 13.3.0 + boost 1.87.0)
結果
WA  
実行時間 -
コード長 702 bytes
コンパイル時間 1,529 ms
コンパイル使用メモリ 169,120 KB
実行使用メモリ 6,948 KB
最終ジャッジ日時 2024-06-30 14:15:15
合計ジャッジ時間 2,988 ms
ジャッジサーバーID
(参考情報)
judge2 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample WA * 1
other AC * 1 WA * 19
権限があれば一括ダウンロードができます
コンパイルメッセージ
main.cpp:7:1: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type]
    7 | main(){
      | ^~~~

ソースコード

diff #

#include<bits/stdc++.h>
#define rep(i,a,b) for(int i=int(a);i<int(b);++i)
using namespace std;
typedef long long ll;
int INF = (1LL << 30) - 1;
int MOD = 1e9+7;
main(){
    int N;
    cin >> N;
    rep(i,0,N){
        string S,str = "goodproblem";
        cin >> S;
        int maxlen = 0;
        rep(j,0,1 << str.size()){
            string ss;
            rep(k,0,str.size()){
                if(j & (1 << k))ss.push_back(str[k]);
            }
            ss.push_back('_');
            int ind = 0;
            for(auto c:S){
                if(c == ss[ind])ind++;
            }
            if(ind + 1 == ss.size())maxlen = max(maxlen, ind);
        }
        cout << 11 - maxlen << endl;
    }

}
0