結果
問題 | No.1994 Confusing Name |
ユーザー |
![]() |
提出日時 | 2022-07-01 21:24:12 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 1,968 ms / 2,000 ms |
コード長 | 563 bytes |
コンパイル時間 | 1,764 ms |
コンパイル使用メモリ | 175,628 KB |
実行使用メモリ | 8,832 KB |
最終ジャッジ日時 | 2024-11-26 03:38:32 |
合計ジャッジ時間 | 27,045 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 28 |
ソースコード
#include <bits/stdc++.h>using namespace std;int main(){int N;cin >> N;vector<string> S(N);for (int i = 0; i < N; i++){cin >> S[i];}set<string> st;for (int i = 0; i < N; i++){st.insert(S[i]);}for (int i = 0; i < N; i++){int ans = 0;int L = S[i].size();st.erase(S[i]);for (int j = 0; j < L; j++){for (int k = 0; k < 26; k++){string T = S[i];T[j] = 'a' + k;if (st.count(T) == 1){ans++;}}}st.insert(S[i]);cout << ans << endl;}}