結果
| 問題 |
No.1994 Confusing Name
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2022-07-02 13:53:07 |
| 言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
AC
|
| 実行時間 | 1,702 ms / 2,000 ms |
| コード長 | 730 bytes |
| コンパイル時間 | 943 ms |
| コンパイル使用メモリ | 91,636 KB |
| 実行使用メモリ | 8,704 KB |
| 最終ジャッジ日時 | 2024-11-27 07:28:02 |
| 合計ジャッジ時間 | 21,202 ms |
|
ジャッジサーバーID (参考情報) |
judge1 / judge2 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 28 |
ソースコード
#include <iostream>
#include <vector>
#include <algorithm>
#include <iomanip>
#include <map>
using namespace std;
int main() {
int n;cin>>n;
vector<string> s(n);
vector<map<string,int>> mp(11);
for(int i=0;i<n;i++){
cin >> s[i];
mp[s[i].size()][s[i]]++;
}
for(int i=0;i<n;i++){
long long ans = 0;
for(int j=0;j<s[i].size();j++){
string t = s[i];
for(char k = 'a';k<='z';k++){
if(s[i][j]==k) continue;
int sz = (int)s[i].size();
t[j] = k;
auto itr = mp[sz].find(t);
if(itr!=mp[sz].end()) ans+=mp[sz][t];
}
}
cout << ans << endl;
}
}