結果

問題 No.1994 Confusing Name
ユーザー みここみここ
提出日時 2022-07-01 21:35:19
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
AC  
実行時間 1,788 ms / 2,000 ms
コード長 683 bytes
コンパイル時間 680 ms
コンパイル使用メモリ 74,088 KB
実行使用メモリ 9,088 KB
最終ジャッジ日時 2024-05-04 15:48:34
合計ジャッジ時間 23,993 ms
ジャッジサーバーID
(参考情報)
judge3 / judge5
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 3 ms
5,248 KB
testcase_01 AC 2 ms
5,376 KB
testcase_02 AC 2 ms
5,376 KB
testcase_03 AC 3 ms
5,376 KB
testcase_04 AC 2 ms
5,376 KB
testcase_05 AC 8 ms
5,376 KB
testcase_06 AC 17 ms
5,376 KB
testcase_07 AC 5 ms
5,376 KB
testcase_08 AC 13 ms
5,376 KB
testcase_09 AC 18 ms
5,376 KB
testcase_10 AC 10 ms
5,376 KB
testcase_11 AC 8 ms
5,376 KB
testcase_12 AC 1,445 ms
9,088 KB
testcase_13 AC 1,788 ms
8,960 KB
testcase_14 AC 1,613 ms
8,576 KB
testcase_15 AC 1,296 ms
8,064 KB
testcase_16 AC 1,081 ms
7,808 KB
testcase_17 AC 1,224 ms
8,064 KB
testcase_18 AC 1,702 ms
8,960 KB
testcase_19 AC 1,720 ms
9,088 KB
testcase_20 AC 1,665 ms
9,088 KB
testcase_21 AC 271 ms
6,144 KB
testcase_22 AC 121 ms
5,632 KB
testcase_23 AC 1,736 ms
8,704 KB
testcase_24 AC 1,751 ms
8,704 KB
testcase_25 AC 875 ms
7,552 KB
testcase_26 AC 389 ms
6,400 KB
testcase_27 AC 1,373 ms
8,576 KB
testcase_28 AC 942 ms
7,424 KB
testcase_29 AC 86 ms
5,376 KB
testcase_30 AC 1,033 ms
7,808 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <iostream>
#include <set>
using namespace std;

int main()
{
    int n;
    cin >> n;
    set<string> st;
    string s[50005];
    for (int i = 0; i < n; i++)
    {
        cin >> s[i];
        st.insert(s[i]);
    }
    for (int i = 0; i < n; i++)
    {
        int k = s[i].size();
        int ans = -k;
        for (int j = 0; j < k; j++)
        {
            char c = s[i][j];
            for (int z = 0; z < 26; z++)
            {
                s[i][j] = char('a' + z);
                if (st.find(s[i]) != st.end())
                {
                    ans++;
                }
            }
            s[i][j] = c;
        }
        cout << ans << endl;
    }
}
0