結果

問題 No.1994 Confusing Name
ユーザー みここみここ
提出日時 2022-07-01 21:35:19
言語 C++14
(gcc 13.2.0 + boost 1.83.0)
結果
AC  
実行時間 1,795 ms / 2,000 ms
コード長 683 bytes
コンパイル時間 623 ms
コンパイル使用メモリ 73,920 KB
実行使用メモリ 8,876 KB
最終ジャッジ日時 2023-08-17 08:57:36
合計ジャッジ時間 23,800 ms
ジャッジサーバーID
(参考情報)
judge11 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
4,976 KB
testcase_01 AC 3 ms
4,888 KB
testcase_02 AC 2 ms
5,044 KB
testcase_03 AC 3 ms
4,952 KB
testcase_04 AC 3 ms
4,876 KB
testcase_05 AC 8 ms
4,920 KB
testcase_06 AC 17 ms
4,956 KB
testcase_07 AC 5 ms
5,192 KB
testcase_08 AC 13 ms
4,932 KB
testcase_09 AC 18 ms
5,112 KB
testcase_10 AC 9 ms
4,920 KB
testcase_11 AC 8 ms
4,960 KB
testcase_12 AC 1,485 ms
8,824 KB
testcase_13 AC 1,795 ms
8,832 KB
testcase_14 AC 1,589 ms
8,592 KB
testcase_15 AC 1,277 ms
8,196 KB
testcase_16 AC 1,083 ms
7,740 KB
testcase_17 AC 1,245 ms
7,952 KB
testcase_18 AC 1,673 ms
8,832 KB
testcase_19 AC 1,729 ms
8,832 KB
testcase_20 AC 1,699 ms
8,876 KB
testcase_21 AC 277 ms
5,852 KB
testcase_22 AC 124 ms
5,400 KB
testcase_23 AC 1,525 ms
8,716 KB
testcase_24 AC 1,503 ms
8,752 KB
testcase_25 AC 870 ms
7,344 KB
testcase_26 AC 405 ms
6,196 KB
testcase_27 AC 1,386 ms
8,420 KB
testcase_28 AC 954 ms
7,488 KB
testcase_29 AC 91 ms
5,300 KB
testcase_30 AC 1,058 ms
7,756 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