結果

問題 No.1994 Confusing Name
ユーザー mmn15277198mmn15277198
提出日時 2022-07-31 13:28:19
言語 C++14
(gcc 13.2.0 + boost 1.83.0)
結果
AC  
実行時間 1,800 ms / 2,000 ms
コード長 579 bytes
コンパイル時間 1,651 ms
コンパイル使用メモリ 174,472 KB
実行使用メモリ 8,720 KB
最終ジャッジ日時 2023-09-28 04:05:25
合計ジャッジ時間 26,293 ms
ジャッジサーバーID
(参考情報)
judge12 / judge15
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 1 ms
4,380 KB
testcase_01 AC 2 ms
4,380 KB
testcase_02 AC 1 ms
4,380 KB
testcase_03 AC 2 ms
4,376 KB
testcase_04 AC 1 ms
4,380 KB
testcase_05 AC 7 ms
4,376 KB
testcase_06 AC 15 ms
4,380 KB
testcase_07 AC 4 ms
4,380 KB
testcase_08 AC 12 ms
4,376 KB
testcase_09 AC 18 ms
4,380 KB
testcase_10 AC 9 ms
4,380 KB
testcase_11 AC 7 ms
4,376 KB
testcase_12 AC 1,564 ms
8,720 KB
testcase_13 AC 1,800 ms
8,564 KB
testcase_14 AC 1,604 ms
8,348 KB
testcase_15 AC 1,282 ms
7,616 KB
testcase_16 AC 1,069 ms
7,032 KB
testcase_17 AC 1,241 ms
7,508 KB
testcase_18 AC 1,739 ms
8,568 KB
testcase_19 AC 1,753 ms
8,612 KB
testcase_20 AC 1,768 ms
8,580 KB
testcase_21 AC 263 ms
4,456 KB
testcase_22 AC 117 ms
4,376 KB
testcase_23 AC 1,587 ms
8,256 KB
testcase_24 AC 1,530 ms
8,580 KB
testcase_25 AC 855 ms
6,452 KB
testcase_26 AC 398 ms
5,080 KB
testcase_27 AC 1,449 ms
8,140 KB
testcase_28 AC 944 ms
6,876 KB
testcase_29 AC 84 ms
4,376 KB
testcase_30 AC 1,041 ms
7,376 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]);
  }
  vector<int> ans(n, 0);
  for (int i = 0; i < n; i++) {
    for (int j = 0; j < s[i].size(); j++) {
      for (char c = 'a'; c <= 'z'; c++) {
        if (s[i][j] == c) continue;
        string t = s[i];
        t[j] = c;
        ans[i] += st.count(t);
      }
    }
  }
  for (int i = 0; i < n; i++) {
    cout << ans[i] << endl;
  }
  return 0;
}
0