結果

問題 No.1994 Confusing Name
ユーザー umimelumimel
提出日時 2022-07-01 21:41:17
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
AC  
実行時間 1,911 ms / 2,000 ms
コード長 956 bytes
コンパイル時間 1,689 ms
コンパイル使用メモリ 176,348 KB
実行使用メモリ 8,724 KB
最終ジャッジ日時 2023-08-17 09:08:16
合計ジャッジ時間 26,546 ms
ジャッジサーバーID
(参考情報)
judge14 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
4,376 KB
testcase_01 AC 2 ms
4,380 KB
testcase_02 AC 2 ms
4,376 KB
testcase_03 AC 2 ms
4,376 KB
testcase_04 AC 2 ms
4,380 KB
testcase_05 AC 7 ms
4,376 KB
testcase_06 AC 16 ms
4,380 KB
testcase_07 AC 4 ms
4,380 KB
testcase_08 AC 11 ms
4,376 KB
testcase_09 AC 17 ms
4,380 KB
testcase_10 AC 8 ms
4,380 KB
testcase_11 AC 8 ms
4,380 KB
testcase_12 AC 1,618 ms
8,692 KB
testcase_13 AC 1,911 ms
8,656 KB
testcase_14 AC 1,766 ms
8,428 KB
testcase_15 AC 1,334 ms
7,412 KB
testcase_16 AC 1,117 ms
6,836 KB
testcase_17 AC 1,295 ms
7,264 KB
testcase_18 AC 1,796 ms
8,604 KB
testcase_19 AC 1,836 ms
8,524 KB
testcase_20 AC 1,858 ms
8,724 KB
testcase_21 AC 276 ms
4,460 KB
testcase_22 AC 121 ms
4,380 KB
testcase_23 AC 1,633 ms
8,404 KB
testcase_24 AC 1,700 ms
8,460 KB
testcase_25 AC 922 ms
6,436 KB
testcase_26 AC 413 ms
4,956 KB
testcase_27 AC 1,520 ms
7,764 KB
testcase_28 AC 992 ms
6,776 KB
testcase_29 AC 90 ms
4,380 KB
testcase_30 AC 1,106 ms
7,080 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using pll = pair<ll, ll>;
#define drep(i, cc, n) for (ll i = (cc); i <= (n); ++i)
#define rep(i, n) drep(i, 0, n - 1)
#define all(a) (a).begin(), (a).end()
#define pb push_back
#define fi first
#define se second

const ll MOD = 1000000007;
const ll MOD2 = 998244353;
const ll INF = 1LL << 60;
const ll N_MAX = 2e5;

int main(){
    ll n;
    cin >> n;

    vector<string> s(n);
    rep(i, n) cin >> s[i];
    
    map<string, ll> mp;
    rep(i, n) mp[s[i]] = i;

    rep(i, n){
        ll cnt = 0;
        string tmp = "";
        rep(j, (ll)s[i].size()) tmp+=s[i][j];

        rep(j, (ll)s[i].size()){
            rep(k, 26){
                if(s[i][j]-'a' == k) continue;
                tmp[j] = 'a'+k;
                if(mp.find(tmp) != mp.end()){
                    cnt++;
                }
            }
            tmp[j] = s[i][j];
        }

        cout << cnt << endl;
    }
}
0