結果
| 問題 |
No.150 "良問"(良問とは言っていない
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2018-11-26 00:25:29 |
| 言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
| 結果 |
AC
|
| 実行時間 | 18 ms / 5,000 ms |
| コード長 | 885 bytes |
| コンパイル時間 | 781 ms |
| コンパイル使用メモリ | 83,688 KB |
| 実行使用メモリ | 5,248 KB |
| 最終ジャッジ日時 | 2024-10-11 02:15:02 |
| 合計ジャッジ時間 | 1,657 ms |
|
ジャッジサーバーID (参考情報) |
judge3 / judge5 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 1 |
| other | AC * 20 |
ソースコード
#define _USE_MATH_DEFINES
#define _CRT_SECURE_NO_WARNINGS
#include<stdio.h>
#include<string>
#include<iostream>
#include<iostream>
#include<cctype>
#include<cstdio>
#include<vector>
#include<stack>
#include<queue>
#include <algorithm>
#include<math.h>
#include<set>
#include<map>
#include <sstream>
#include<iomanip>
#include <ctype.h>
using namespace std;
//#include<bits/stdc++.h>
int main() {
int n;
cin >> n;
string p;
while (n--) {
int t = 99999;
cin >> p;
for (int i = 0; i < p.size()-10; i++) {
string y = p.substr(i, 4);
// cout << y<<" ";
for (int j = i + 4; j < p.size()-6; j++) {
string x = p.substr(j, 7);
string r = "goodproblem";
string w = y + x;
int a = 0;
// cout << w << endl;
for (int k = 0; k < r.size(); k++) {
if (r[k] != w[k])a++;
}
t = min(t, a);
}
}
cout << t << endl;
}
return 0;
}