結果
| 問題 | No.3802 Crossword Key |
| ユーザー |
|
| 提出日時 | 2026-11-14 15:06:03 |
| 言語 | C++23 (gcc 15.3.0 + boost 1.92.0 + ACL) |
| 結果 |
WA
不安定
|
| 実行時間 | - |
| コード長 | 1,120 bytes |
| 記録 | |
| コンパイル時間 | 2,487 ms |
| コンパイル使用メモリ | 351,360 KB |
| 実行使用メモリ | 9,928 KB |
| 最終ジャッジ日時 | 2026-11-14 15:06:09 |
| 合計ジャッジ時間 | 5,284 ms |
|
ジャッジサーバーID (参考情報) |
judge1_0 / judge2_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 2 WA * 1 |
| other | AC * 12 WA * 29 |
ソースコード
#include<bits/stdc++.h>
using namespace std;
using ll = long long;
int main(){
ios::sync_with_stdio(false);
cin.tie(0);
int h, w;
cin >> h >> w;
vector<string> A(h), B(w, string(h, '?'));
vector<pair<int,int>> ans;
for(int y = 0; y < h; y++){
auto &&ss = A[y];
cin >> ss;
for(int i = 0; i < w; ){
int p = i;
while(i < w && ss[i] == ss[p]) i++;
if(ss[p] == '#') continue;
if(i - p >= 2) ans.emplace_back(y, p);
}
}
for(int y = 0; y < h; y++){
for(int x = 0; x < w; x++){
B[x][y] = A[y][x];
}
}
for(int x = 0; x < w; x++){
auto &&ss = B[x];
cin >> ss;
for(int i = 0; i < w; ){
int p = i;
while(i < w && ss[i] == ss[p]) i++;
if(ss[p] == '#') continue;
if(i - p >= 2) ans.emplace_back(p, x);
}
}
sort(ans.begin(), ans.end());
ans.erase(unique(ans.begin(), ans.end()), ans.end());
cout << ans.size() << '\n';
for(auto [y, x] : ans) cout << y + 1 << ' ' << x + 1 << '\n';
}