結果
| 問題 | No.1994 Confusing Name |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2022-07-01 22:38:48 |
| 言語 | C++17 (gcc 13.3.0 + boost 1.89.0) |
| 結果 |
TLE
(最新)
AC
(最初)
|
| 実行時間 | - |
| コード長 | 623 bytes |
| 記録 | |
| コンパイル時間 | 2,298 ms |
| コンパイル使用メモリ | 201,476 KB |
| 最終ジャッジ日時 | 2025-01-30 03:13:21 |
|
ジャッジサーバーID (参考情報) |
judge2 / judge1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 25 TLE * 3 |
ソースコード
#include <bits/stdc++.h>
using namespace std;
void solve() {
string alp = "abcdefghijklmnopqrstuvwxyz";
int n;
cin >> n;
vector<string> S(n);
set<string> st;
for (int i = 0; i < n; i++) {
string s;
cin >> s;
S[i] = s;
st.insert(s);
}
for (string &s : S) {
int ans = 0;
for (int i = 0; i < s.size(); i++) {
for (char &c : alp) {
if (s[i] == c) continue;
string t = s;
t[i] = c;
if (st.count(t)) ans++;
}
}
cout << ans << "\n";
}
return;
}
int main() {
ios::sync_with_stdio(false);
cin.tie(0);
solve();
return 0;
}