結果

問題 No.1994 Confusing Name
ユーザー Kanten4205Kanten4205
提出日時 2022-03-20 14:15:58
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
AC  
実行時間 458 ms / 2,000 ms
コード長 960 bytes
コンパイル時間 2,845 ms
コンパイル使用メモリ 192,960 KB
実行使用メモリ 30,336 KB
最終ジャッジ日時 2024-04-27 04:04:49
合計ジャッジ時間 9,464 ms
ジャッジサーバーID
(参考情報)
judge4 / judge3
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
6,816 KB
testcase_01 AC 1 ms
6,812 KB
testcase_02 AC 1 ms
6,940 KB
testcase_03 AC 1 ms
6,940 KB
testcase_04 AC 1 ms
6,940 KB
testcase_05 AC 4 ms
6,944 KB
testcase_06 AC 6 ms
6,944 KB
testcase_07 AC 2 ms
6,940 KB
testcase_08 AC 4 ms
6,944 KB
testcase_09 AC 6 ms
6,940 KB
testcase_10 AC 4 ms
6,944 KB
testcase_11 AC 3 ms
6,944 KB
testcase_12 AC 354 ms
20,480 KB
testcase_13 AC 458 ms
28,672 KB
testcase_14 AC 440 ms
29,696 KB
testcase_15 AC 345 ms
25,344 KB
testcase_16 AC 282 ms
22,656 KB
testcase_17 AC 344 ms
24,832 KB
testcase_18 AC 458 ms
30,080 KB
testcase_19 AC 455 ms
30,336 KB
testcase_20 AC 456 ms
30,336 KB
testcase_21 AC 67 ms
8,320 KB
testcase_22 AC 31 ms
6,940 KB
testcase_23 AC 377 ms
25,216 KB
testcase_24 AC 379 ms
24,192 KB
testcase_25 AC 218 ms
17,024 KB
testcase_26 AC 95 ms
10,112 KB
testcase_27 AC 329 ms
22,528 KB
testcase_28 AC 229 ms
18,176 KB
testcase_29 AC 25 ms
6,940 KB
testcase_30 AC 256 ms
19,456 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#pragma GCC target("avx2")
#pragma GCC optimize("O3")
#pragma GCC optimize("unroll-loops")
#include <bits/stdc++.h>
using namespace std;
const long long MOD1 = 1000000007;
const long long MOD2 = 998244353;
typedef long long ll;
typedef pair<ll, ll> P;
const long long INF = 1e17;
template <typename T>
void input_arr(vector<T>& A, ll N) {
    for (ll i = 0; i < N; i++) {
        cin >> A[i];
    }
}
void solve() {
    ll N; cin >> N;
    vector<string>S(N); input_arr(S,N);
    map<string, ll>MAP;
    for (ll i = 0; i < N; i++) {
        for (ll j = 0; j < S[i].size(); j++) {
            string T = S[i];
            T[j] = '.';
            MAP[T]++;
        }
    }
    for (ll i = 0; i < N; i++) {
        ll ans = 0;
        for (ll j = 0; j < S[i].size(); j++) {
            string T = S[i];
            T[j] = '.';
            ans += MAP[T] - 1;
        }
        cout << ans << endl;
    }
}
int main() {
    ll T=1;//cin>>T;
    while(T--)solve();
}
0