結果

問題 No.1994 Confusing Name
ユーザー mmn15277198mmn15277198
提出日時 2022-07-31 13:43:31
言語 C++14
(gcc 13.2.0 + boost 1.83.0)
結果
AC  
実行時間 1,822 ms / 2,000 ms
コード長 493 bytes
コンパイル時間 2,570 ms
コンパイル使用メモリ 172,968 KB
実行使用メモリ 8,808 KB
最終ジャッジ日時 2023-09-28 04:07:15
合計ジャッジ時間 25,244 ms
ジャッジサーバーID
(参考情報)
judge14 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 1 ms
4,376 KB
testcase_01 AC 2 ms
4,376 KB
testcase_02 AC 2 ms
4,376 KB
testcase_03 AC 2 ms
4,380 KB
testcase_04 AC 2 ms
4,376 KB
testcase_05 AC 7 ms
4,376 KB
testcase_06 AC 15 ms
4,376 KB
testcase_07 AC 4 ms
4,376 KB
testcase_08 AC 12 ms
4,384 KB
testcase_09 AC 17 ms
4,380 KB
testcase_10 AC 8 ms
4,376 KB
testcase_11 AC 7 ms
4,376 KB
testcase_12 AC 1,513 ms
8,556 KB
testcase_13 AC 1,822 ms
8,500 KB
testcase_14 AC 1,687 ms
8,272 KB
testcase_15 AC 1,347 ms
7,244 KB
testcase_16 AC 1,101 ms
6,708 KB
testcase_17 AC 1,263 ms
7,352 KB
testcase_18 AC 1,731 ms
8,564 KB
testcase_19 AC 1,764 ms
8,800 KB
testcase_20 AC 1,765 ms
8,808 KB
testcase_21 AC 270 ms
4,388 KB
testcase_22 AC 117 ms
4,376 KB
testcase_23 AC 1,598 ms
8,508 KB
testcase_24 AC 1,517 ms
8,472 KB
testcase_25 AC 854 ms
6,448 KB
testcase_26 AC 392 ms
4,812 KB
testcase_27 AC 1,334 ms
8,148 KB
testcase_28 AC 908 ms
6,444 KB
testcase_29 AC 85 ms
4,376 KB
testcase_30 AC 997 ms
6,972 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  vector<string> s(n);
  set<string> st;
  for (int i = 0; i < n; i++) {
    cin >> s[i];
    st.insert(s[i]);
  }
  for (int i = 0; i < n; i++) {
    int ans = 0;
    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 += st.count(t);
      }
    }
    cout << ans << endl;
  }
  return 0;
}
0