結果

問題 No.1994 Confusing Name
ユーザー atjh16atjh16
提出日時 2022-08-11 23:33:43
言語 C++17
(gcc 12.3.0 + boost 1.83.0)
結果
AC  
実行時間 673 ms / 2,000 ms
コード長 544 bytes
コンパイル時間 3,686 ms
コンパイル使用メモリ 209,924 KB
実行使用メモリ 30,800 KB
最終ジャッジ日時 2023-10-22 04:46:38
合計ジャッジ時間 11,874 ms
ジャッジサーバーID
(参考情報)
judge10 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 3 ms
5,256 KB
testcase_01 AC 3 ms
5,256 KB
testcase_02 AC 3 ms
5,260 KB
testcase_03 AC 4 ms
5,252 KB
testcase_04 AC 3 ms
5,256 KB
testcase_05 AC 5 ms
5,436 KB
testcase_06 AC 8 ms
5,644 KB
testcase_07 AC 4 ms
5,336 KB
testcase_08 AC 7 ms
5,548 KB
testcase_09 AC 8 ms
5,688 KB
testcase_10 AC 6 ms
5,456 KB
testcase_11 AC 5 ms
5,436 KB
testcase_12 AC 468 ms
21,000 KB
testcase_13 AC 626 ms
29,104 KB
testcase_14 AC 622 ms
30,220 KB
testcase_15 AC 486 ms
26,104 KB
testcase_16 AC 407 ms
23,508 KB
testcase_17 AC 482 ms
25,672 KB
testcase_18 AC 651 ms
30,572 KB
testcase_19 AC 673 ms
30,724 KB
testcase_20 AC 654 ms
30,800 KB
testcase_21 AC 86 ms
10,020 KB
testcase_22 AC 38 ms
7,564 KB
testcase_23 AC 528 ms
25,724 KB
testcase_24 AC 524 ms
24,756 KB
testcase_25 AC 292 ms
17,964 KB
testcase_26 AC 122 ms
11,696 KB
testcase_27 AC 488 ms
23,192 KB
testcase_28 AC 326 ms
19,024 KB
testcase_29 AC 29 ms
7,260 KB
testcase_30 AC 377 ms
20,296 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
using namespace std;

int n, m;
string s[50000];
string t;
map<string, int> Mp;

int main() {    
    cin >> n;

    for (int i = 0; i < n; i++) {
        cin >> s[i];

        for (int j = 0; j < s[i].size(); j++) {
            t = s[i];
            t[j] = '#';
            Mp[t]++;
        }
    }

    for (int i = 0; i < n; i++) {
        m = 0;

        for (int j = 0; j < s[i].size(); j++) {
            t = s[i];
            t[j] = '#';
            m += Mp[t] - 1;
        }

        cout << m << endl;
    }
}
0