結果
| 問題 |
No.1994 Confusing Name
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2022-07-01 21:35:20 |
| 言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
TLE
(最新)
AC
(最初)
|
| 実行時間 | - |
| コード長 | 804 bytes |
| コンパイル時間 | 2,221 ms |
| コンパイル使用メモリ | 204,800 KB |
| 最終ジャッジ日時 | 2025-01-30 02:28:57 |
|
ジャッジサーバーID (参考情報) |
judge4 / judge3 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 23 TLE * 5 |
ソースコード
#include <bits/stdc++.h>
using namespace std;
#ifdef _RUTHEN
#include "debug.hpp"
#else
#define show(...) true
#endif
using ll = long long;
#define rep(i, n) for (int i = 0; i < (n); i++)
template <class T> using V = vector<T>;
int main() {
ios::sync_with_stdio(false);
cin.tie(0);
int N;
cin >> N;
V<string> S(N);
rep(i, N) cin >> S[i];
set<string> st[11];
rep(i, N) st[S[i].size()].insert(S[i]);
rep(i, N) {
int res = 0;
rep(j, S[i].size()) {
for (char c = 'a'; c <= 'z'; c++) {
if (c != S[i][j]) {
string k = S[i].substr(0, j) + c + S[i].substr(j + 1);
res += st[S[i].size()].count(k);
}
}
}
cout << res << '\n';
}
return 0;
}