結果

問題 No.1994 Confusing Name
ユーザー SSRSSSRS
提出日時 2022-07-01 21:24:12
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
TLE  
(最新)
AC  
(最初)
実行時間 -
コード長 563 bytes
コンパイル時間 1,625 ms
コンパイル使用メモリ 175,072 KB
実行使用メモリ 8,672 KB
最終ジャッジ日時 2023-08-17 08:32:59
合計ジャッジ時間 30,187 ms
ジャッジサーバーID
(参考情報)
judge15 / judge12
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 1 ms
4,376 KB
testcase_01 AC 2 ms
4,380 KB
testcase_02 AC 1 ms
4,376 KB
testcase_03 AC 2 ms
4,376 KB
testcase_04 AC 2 ms
4,380 KB
testcase_05 AC 8 ms
4,380 KB
testcase_06 AC 18 ms
4,376 KB
testcase_07 AC 4 ms
4,376 KB
testcase_08 AC 14 ms
4,376 KB
testcase_09 AC 20 ms
4,376 KB
testcase_10 AC 10 ms
4,376 KB
testcase_11 AC 9 ms
4,376 KB
testcase_12 AC 1,875 ms
8,672 KB
testcase_13 TLE -
testcase_14 TLE -
testcase_15 AC 1,566 ms
7,204 KB
testcase_16 AC 1,307 ms
6,796 KB
testcase_17 AC 1,518 ms
7,200 KB
testcase_18 TLE -
testcase_19 TLE -
testcase_20 TLE -
testcase_21 AC 330 ms
4,376 KB
testcase_22 AC 144 ms
4,376 KB
testcase_23 AC 1,932 ms
8,260 KB
testcase_24 AC 1,936 ms
8,360 KB
testcase_25 AC 1,070 ms
6,464 KB
testcase_26 AC 480 ms
4,860 KB
testcase_27 AC 1,767 ms
8,064 KB
testcase_28 AC 1,161 ms
6,484 KB
testcase_29 AC 109 ms
4,380 KB
testcase_30 AC 1,302 ms
7,244 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#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;
  }
}
0