結果

問題 No.1994 Confusing Name
ユーザー srjywrdnprktsrjywrdnprkt
提出日時 2023-05-14 00:09:20
言語 C++17
(gcc 12.3.0 + boost 1.83.0)
結果
TLE  
実行時間 -
コード長 814 bytes
コンパイル時間 1,138 ms
コンパイル使用メモリ 118,388 KB
実行使用メモリ 331,136 KB
最終ジャッジ日時 2024-11-29 15:09:56
合計ジャッジ時間 53,124 ms
ジャッジサーバーID
(参考情報)
judge4 / judge1
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
13,640 KB
testcase_01 AC 2 ms
195,104 KB
testcase_02 AC 2 ms
12,064 KB
testcase_03 AC 2 ms
198,564 KB
testcase_04 AC 2 ms
12,064 KB
testcase_05 AC 28 ms
248,192 KB
testcase_06 AC 70 ms
18,432 KB
testcase_07 AC 13 ms
254,112 KB
testcase_08 AC 49 ms
16,256 KB
testcase_09 AC 75 ms
254,976 KB
testcase_10 AC 32 ms
13,696 KB
testcase_11 AC 28 ms
255,744 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,665 ms
331,136 KB
testcase_22 AC 698 ms
65,120 KB
testcase_23 TLE -
testcase_24 TLE -
testcase_25 TLE -
testcase_26 TLE -
testcase_27 TLE -
testcase_28 TLE -
testcase_29 AC 479 ms
52,992 KB
testcase_30 TLE -
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <iostream>
#include <vector>
#include <cmath>
#include <map>
#include <set>
#include <iomanip>
#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);
    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