結果

問題 No.1994 Confusing Name
ユーザー yansi819yansi819
提出日時 2024-04-14 20:33:40
言語 C++17
(gcc 12.3.0 + boost 1.83.0)
結果
AC  
実行時間 637 ms / 2,000 ms
コード長 626 bytes
コンパイル時間 4,803 ms
コンパイル使用メモリ 262,668 KB
実行使用メモリ 30,464 KB
最終ジャッジ日時 2024-04-14 20:33:56
合計ジャッジ時間 14,270 ms
ジャッジサーバーID
(参考情報)
judge1 / judge5
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
6,816 KB
testcase_01 AC 2 ms
6,944 KB
testcase_02 AC 2 ms
6,940 KB
testcase_03 AC 2 ms
6,940 KB
testcase_04 AC 2 ms
6,944 KB
testcase_05 AC 4 ms
6,940 KB
testcase_06 AC 7 ms
6,940 KB
testcase_07 AC 3 ms
6,940 KB
testcase_08 AC 6 ms
6,940 KB
testcase_09 AC 6 ms
6,944 KB
testcase_10 AC 4 ms
6,940 KB
testcase_11 AC 5 ms
6,944 KB
testcase_12 AC 445 ms
20,608 KB
testcase_13 AC 606 ms
28,928 KB
testcase_14 AC 582 ms
29,696 KB
testcase_15 AC 486 ms
25,472 KB
testcase_16 AC 393 ms
22,656 KB
testcase_17 AC 464 ms
24,832 KB
testcase_18 AC 637 ms
30,080 KB
testcase_19 AC 612 ms
30,336 KB
testcase_20 AC 633 ms
30,464 KB
testcase_21 AC 81 ms
8,424 KB
testcase_22 AC 37 ms
6,940 KB
testcase_23 AC 503 ms
25,216 KB
testcase_24 AC 544 ms
24,192 KB
testcase_25 AC 284 ms
16,896 KB
testcase_26 AC 126 ms
10,240 KB
testcase_27 AC 455 ms
22,528 KB
testcase_28 AC 325 ms
18,048 KB
testcase_29 AC 29 ms
6,944 KB
testcase_30 AC 357 ms
19,456 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
#include <atcoder/all>
using namespace std;
using namespace atcoder;
using ll = long long;
using ld = long double;
using mint = modint998244353;

int main() {
  int n; cin >> n;
  vector<string> s(n);
  for (auto &x: s) cin >> x;
  map<string, int> mp;
  for (int i = 0; i < n; i++) {
    for (int j = 0; j < s[i].size(); j++) {
      string t = s[i];
      t[j] = '?';
      mp[t]++;
    }
  }
  for (int i = 0; i < n; i++) {
    int ans = 0;
    for (int j = 0; j < s[i].size(); j++) {
      string t = s[i];
      t[j] = '?';
      ans += mp[t] - 1;
    }
    cout << ans << endl;
  }
  return 0;
}
0