結果
| 問題 |
No.1994 Confusing Name
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2022-07-01 22:11:29 |
| 言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
TLE
|
| 実行時間 | - |
| コード長 | 723 bytes |
| コンパイル時間 | 2,216 ms |
| コンパイル使用メモリ | 202,308 KB |
| 最終ジャッジ日時 | 2025-01-30 02:55:48 |
|
ジャッジサーバーID (参考情報) |
judge4 / judge1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 12 TLE * 16 |
ソースコード
#include<bits/stdc++.h>
using namespace std;
#define int long long
#define all(xs) xs.begin(), xs.end()
#define make_unique(x) sort(all((x))); (x).resize(unique(all((x))) - (x).begin())
signed main() {
ios::sync_with_stdio(false);
cin.tie(0);
int n;
cin >> n;
map<string , int> mp;
vector<string> a(n);
for (int i = 0; i < n; i++) {
cin >> a[i];
mp[a[i]]++;
}
for (int i = 0; i < n; i++) {
int ans = 0;
string s = a[i];
for (int j = 0; j < a[i].size(); j++) {
for (char a = 'a'; a <= 'z'; a++) {
if (s[j] != a) {
char old = s[j];
s[j] = a;
ans += mp[s];
s[j] = old;
}
}
}
cout << ans << "\n";
}
}