結果
| 問題 |
No.640 76本のトロンボーン
|
| コンテスト | |
| ユーザー |
e869120
|
| 提出日時 | 2018-01-26 22:32:41 |
| 言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 1,240 bytes |
| コンパイル時間 | 1,071 ms |
| コンパイル使用メモリ | 84,916 KB |
| 実行使用メモリ | 5,248 KB |
| 最終ジャッジ日時 | 2024-12-28 01:10:50 |
| 合計ジャッジ時間 | 1,647 ms |
|
ジャッジサーバーID (参考情報) |
judge2 / judge5 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 2 |
| other | AC * 13 WA * 2 |
ソースコード
#include <iostream>
#include <algorithm>
#include <string>
#include <vector>
#include <queue>
#include <map>
#include <functional>
#include <cmath>
#include <tuple>
using namespace std;
#pragma warning (disable: 4996)
string S[76]; int n, maxn;
bool check(string V) {
for (int i = 0; i < V.size(); i++) {
if (V[i] == '#') return false;
}
return true;
}
int count() {
int ret = 0;
for (int i = 0; i < n; i++) {
int F = 0;
for (int j = 0; j < n; j++) {
if (S[j][i] == '#') F = 0;
else F++;
if (F == n - 1) { ret++; F = 0; }
}
}
return ret;
}
int main() {
cin >> n;
for (int i = 0; i < n; i++) {
cin >> S[i];
}
for (int i = 0; i < 2; i++) {
maxn = max(maxn, count());
for (int j = 0; j < n; j++) {
if (check(S[j].substr(0, n - 1)) == true) {
for (int k = 0; k < n - 1; k++) S[j][k] = '#';
maxn = max(maxn, count() + 1);
for (int k = 0; k < n - 1; k++) S[j][k] = '.';
}
if (check(S[j].substr(1, n - 1)) == true) {
for (int k = 1; k < n; k++) S[j][k] = '#';
maxn = max(maxn, count() + 1);
for (int k = 1; k < n; k++) S[j][k] = '.';
}
}
for (int j = 0; j < n; j++) {
for (int k = j + 1; k < n; k++) swap(S[j][k], S[k][j]);
}
}
cout << maxn << endl;
return 0;
}
e869120