結果

問題 No.1994 Confusing Name
ユーザー zawakasuzawakasu
提出日時 2022-07-20 19:47:05
言語 C++17
(gcc 12.3.0 + boost 1.83.0)
結果
TLE  
(最新)
AC  
(最初)
実行時間 -
コード長 1,661 bytes
コンパイル時間 3,678 ms
コンパイル使用メモリ 230,588 KB
実行使用メモリ 8,992 KB
最終ジャッジ日時 2023-09-15 10:07:53
合計ジャッジ時間 28,343 ms
ジャッジサーバーID
(参考情報)
judge13 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 1 ms
4,380 KB
testcase_01 AC 2 ms
4,380 KB
testcase_02 AC 2 ms
4,380 KB
testcase_03 AC 1 ms
4,376 KB
testcase_04 AC 1 ms
4,380 KB
testcase_05 AC 7 ms
4,384 KB
testcase_06 AC 16 ms
4,380 KB
testcase_07 AC 4 ms
4,380 KB
testcase_08 AC 12 ms
4,376 KB
testcase_09 AC 17 ms
4,380 KB
testcase_10 AC 9 ms
4,380 KB
testcase_11 AC 8 ms
4,380 KB
testcase_12 AC 1,690 ms
8,872 KB
testcase_13 TLE -
testcase_14 AC 1,619 ms
8,628 KB
testcase_15 AC 1,293 ms
7,812 KB
testcase_16 AC 1,092 ms
6,996 KB
testcase_17 AC 1,268 ms
7,544 KB
testcase_18 AC 1,716 ms
8,872 KB
testcase_19 AC 1,728 ms
8,832 KB
testcase_20 AC 1,722 ms
8,992 KB
testcase_21 AC 281 ms
4,616 KB
testcase_22 AC 124 ms
4,380 KB
testcase_23 AC 1,556 ms
8,564 KB
testcase_24 AC 1,553 ms
8,900 KB
testcase_25 AC 892 ms
6,756 KB
testcase_26 AC 417 ms
5,104 KB
testcase_27 AC 1,456 ms
8,380 KB
testcase_28 AC 983 ms
6,808 KB
testcase_29 AC 91 ms
4,376 KB
testcase_30 AC 1,084 ms
7,244 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#pragma GCC target("avx2")
#pragma GCC optimize("O3")
#pragma GCC optimize("unroll-loops")
#include <bits/stdc++.h>
// #include <atcoder/modint>
// #include <atcoder/fenwicktree>
// #include <atcoder/segtree>
// #include <atcoder/scc>

#define int long long
#define all(x) begin(x), end(x)

using namespace std;
// using namespace atcoder;
// using mint = modint998244353;
// using mint = modint1000000007;
using ld = long double;
using pii = pair<int, int>;
using vi = vector<int>;
using vvi = vector<vi>;
using vvvi = vector<vvi>;
using vp = vector<pii>;
using vvp = vector<vp>;
using vs = vector<string>;
using vvc = vector<vector<char>>;

void debug(vector<int> a) {
    for (auto x : a) cout << x << ' ';
    cout << endl;
}

void debug(vector<vector<int>> a) {
    for (auto y : a) debug(y);
}

template <typename T1, typename T2>
inline bool chmax(T1 &a, T2 b) {return a < b and (a = b, true);}

template <typename T1, typename T2>
inline bool chmin(T1 &a, T2 b) {return a > b and (a = b, true);}

const int supl = LONG_LONG_MAX - 100;

void main_() {
    int n; cin >> n;
    map<string, int> mp;
    vs ss(n);
    for (auto& s : ss) cin >> s;
    for (auto s : ss) mp[s]++;

    vi anses(n);
    for (int i = 0 ; i < n ; i++) {
        for (auto& c : ss[i]) {
            char origin = c;
            for (char t = 'a' ; t <= 'z' ; t++) if (t != origin) {
                c = t;
                if (mp.count(ss[i])) anses[i] += mp[ss[i]];
            }
            c = origin;
        }
    }

    for (auto ans : anses) cout << ans << endl;
}

signed main() {
    ios::sync_with_stdio(false);
    std::cin.tie(nullptr);

    main_();

    return 0;
}
0