結果
| 問題 | No.1994 Confusing Name |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2022-07-01 22:38:48 |
| 言語 | C++17 (gcc 15.2.0 + boost 1.90.0) |
| 結果 |
AC
|
| 実行時間 | 1,351 ms / 2,000 ms |
| コード長 | 623 bytes |
| 記録 | |
| コンパイル時間 | 1,354 ms |
| コンパイル使用メモリ | 219,816 KB |
| 実行使用メモリ | 8,832 KB |
| 最終ジャッジ日時 | 2026-06-26 13:13:10 |
| 合計ジャッジ時間 | 18,979 ms |
|
ジャッジサーバーID (参考情報) |
judge3_0 / judge1_1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 28 |
ソースコード
#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;
}