結果

問題 No.1994 Confusing Name
ユーザー srjywrdnprktsrjywrdnprkt
提出日時 2023-05-14 00:22:08
言語 C++17
(gcc 12.3.0 + boost 1.83.0)
結果
TLE  
実行時間 -
コード長 849 bytes
コンパイル時間 1,272 ms
コンパイル使用メモリ 124,860 KB
実行使用メモリ 439,488 KB
最終ジャッジ日時 2024-11-29 15:20:04
合計ジャッジ時間 51,206 ms
ジャッジサーバーID
(参考情報)
judge5 / judge3
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
10,496 KB
testcase_01 AC 2 ms
303,356 KB
testcase_02 AC 2 ms
10,496 KB
testcase_03 AC 2 ms
263,404 KB
testcase_04 AC 2 ms
10,496 KB
testcase_05 AC 16 ms
343,152 KB
testcase_06 AC 34 ms
17,540 KB
testcase_07 AC 7 ms
340,800 KB
testcase_08 AC 28 ms
15,820 KB
testcase_09 AC 38 ms
336,804 KB
testcase_10 AC 17 ms
13,120 KB
testcase_11 AC 15 ms
334,432 KB
testcase_12 TLE -
testcase_13 TLE -
testcase_14 TLE -
testcase_15 TLE -
testcase_16 TLE -
testcase_17 TLE -
testcase_18 TLE -
testcase_19 TLE -
testcase_20 TLE -
testcase_21 AC 1,173 ms
439,488 KB
testcase_22 AC 471 ms
70,020 KB
testcase_23 TLE -
testcase_24 TLE -
testcase_25 TLE -
testcase_26 AC 1,472 ms
157,396 KB
testcase_27 TLE -
testcase_28 TLE -
testcase_29 AC 318 ms
48,584 KB
testcase_30 TLE -
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <iostream>
#include <vector>
#include <cmath>
#include <map>
#include <set>
#include <iomanip>
#include <unordered_map>
#include <queue>
#include <algorithm>
#include <numeric>
#include <deque>
#include <complex>
#include <cassert>

using namespace std;
using ll = long long;

int main(){

    int N, ans;
    char c;
    cin >> N;
    vector<string> S(N);
    unordered_map<string, int> mp;

    for (int i=0; i<N; i++){
        cin >> S[i];
        mp[S[i]]++;
    }

    for (int i=0; i<N; i++){
        ans = 0;
        for (int j=0; j<S[i].size(); j++){
            for (int k=0; k<26; k++){
                c = S[i][j];
                if (c == 'a'+k) continue;
                S[i][j] = 'a'+k;
                ans += mp[S[i]];
                S[i][j] = c; 
            }
        }
        cout << ans << endl;
    }

    return 0;
}
0