結果
| 問題 |
No.150 "良問"(良問とは言っていない
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2015-02-13 00:20:19 |
| 言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 1,600 bytes |
| コンパイル時間 | 453 ms |
| コンパイル使用メモリ | 63,324 KB |
| 実行使用メモリ | 6,944 KB |
| 最終ジャッジ日時 | 2024-06-23 19:31:37 |
| 合計ジャッジ時間 | 1,211 ms |
|
ジャッジサーバーID (参考情報) |
judge4 / judge1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 1 |
| other | AC * 4 WA * 16 |
ソースコード
//The ごり押し★
#include <iostream>
#include <algorithm>
#include <cstring>
#include <climits>
#include <string>
#include <sstream>
#include <vector>
#define T_MAX 100
#define S_LEN 100
using namespace std;
typedef unsigned long long ULL;
typedef long long LL;
int main()
{
int T;
string S[T_MAX];
cin >> T;
for (int i = 0; i < T; ++i)
cin >> S[i];
for (int s = 0; s < T; ++s)
{
int len = S[s].size();
int goodscore = 0;
int problemscore = 0;
for (int i = 0; i <= len - 11; ++i)
{
int score = 0;
/*if (i >= 7)
{
if (S[s][i - 7] == 'p')
if (S[s][j - 6] == 'r')
}
if (S[s][j - 5] == 'o')
if (S[s][j - 4] == 'b')
if (S[s][j - 3] == 'l')
if (S[s][j - 2] == 'e')
if (S[s][j - 1] == 'm')
}*/
if (S[s][i] == 'g')
{
++score;
}
if (S[s][i + 1] == 'o')
{
++score;
}
if (S[s][i + 2] == 'o')
{
++score;
}
if (S[s][i + 3] == 'd')
{
++score;
}
if (score > goodscore)
goodscore = score;
for (int j = i + 4; j <= len - 7; ++j)
{
score = 0;
if (S[s][j] == 'p')
{
++score;
}
if (S[s][j + 1] == 'r')
{
++score;
}
if (S[s][j + 2] == 'o')
{
++score;
}
if (S[s][j + 3] == 'b')
{
++score;
}
if (S[s][j + 4] == 'l')
{
++score;
}
if (S[s][j + 5] == 'e')
{
++score;
}
if (S[s][j + 6] == 'm')
{
++score;
}
if (score > problemscore)
problemscore = score;
}
}
cout << 11 - goodscore - problemscore << endl;
}
return 0;
}