結果

問題 No.1994 Confusing Name
ユーザー umimelumimel
提出日時 2022-07-01 21:41:17
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
AC  
実行時間 1,685 ms / 2,000 ms
コード長 956 bytes
コンパイル時間 1,517 ms
コンパイル使用メモリ 177,496 KB
実行使用メモリ 8,832 KB
最終ジャッジ日時 2024-05-04 15:59:42
合計ジャッジ時間 22,912 ms
ジャッジサーバーID
(参考情報)
judge4 / judge3
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
5,248 KB
testcase_01 AC 1 ms
5,376 KB
testcase_02 AC 2 ms
5,376 KB
testcase_03 AC 1 ms
5,376 KB
testcase_04 AC 2 ms
5,376 KB
testcase_05 AC 7 ms
5,376 KB
testcase_06 AC 15 ms
5,376 KB
testcase_07 AC 4 ms
5,376 KB
testcase_08 AC 11 ms
5,376 KB
testcase_09 AC 15 ms
5,376 KB
testcase_10 AC 8 ms
5,376 KB
testcase_11 AC 7 ms
5,376 KB
testcase_12 AC 1,447 ms
8,704 KB
testcase_13 AC 1,685 ms
8,832 KB
testcase_14 AC 1,482 ms
8,448 KB
testcase_15 AC 1,189 ms
7,552 KB
testcase_16 AC 1,015 ms
6,912 KB
testcase_17 AC 1,154 ms
7,424 KB
testcase_18 AC 1,525 ms
8,832 KB
testcase_19 AC 1,566 ms
8,832 KB
testcase_20 AC 1,582 ms
8,704 KB
testcase_21 AC 258 ms
5,376 KB
testcase_22 AC 113 ms
5,376 KB
testcase_23 AC 1,427 ms
8,448 KB
testcase_24 AC 1,418 ms
8,448 KB
testcase_25 AC 801 ms
6,400 KB
testcase_26 AC 374 ms
5,376 KB
testcase_27 AC 1,303 ms
8,064 KB
testcase_28 AC 898 ms
6,784 KB
testcase_29 AC 82 ms
5,376 KB
testcase_30 AC 1,000 ms
7,168 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