結果

問題 No.1994 Confusing Name
ユーザー asaringoasaringo
提出日時 2022-07-01 21:37:54
言語 C++17
(gcc 12.3.0 + boost 1.83.0)
結果
AC  
実行時間 386 ms / 2,000 ms
コード長 1,027 bytes
コンパイル時間 2,077 ms
コンパイル使用メモリ 209,468 KB
実行使用メモリ 30,592 KB
最終ジャッジ日時 2024-05-04 15:53:33
合計ジャッジ時間 7,479 ms
ジャッジサーバーID
(参考情報)
judge4 / judge5
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
6,812 KB
testcase_01 AC 2 ms
6,940 KB
testcase_02 AC 2 ms
6,940 KB
testcase_03 AC 2 ms
6,944 KB
testcase_04 AC 2 ms
6,940 KB
testcase_05 AC 3 ms
6,944 KB
testcase_06 AC 5 ms
6,940 KB
testcase_07 AC 3 ms
6,944 KB
testcase_08 AC 4 ms
6,940 KB
testcase_09 AC 5 ms
6,940 KB
testcase_10 AC 3 ms
6,940 KB
testcase_11 AC 3 ms
6,940 KB
testcase_12 AC 271 ms
20,736 KB
testcase_13 AC 351 ms
28,928 KB
testcase_14 AC 343 ms
30,080 KB
testcase_15 AC 283 ms
25,856 KB
testcase_16 AC 228 ms
23,296 KB
testcase_17 AC 264 ms
25,472 KB
testcase_18 AC 376 ms
30,208 KB
testcase_19 AC 370 ms
30,592 KB
testcase_20 AC 386 ms
30,592 KB
testcase_21 AC 55 ms
9,728 KB
testcase_22 AC 25 ms
7,296 KB
testcase_23 AC 293 ms
25,472 KB
testcase_24 AC 287 ms
24,448 KB
testcase_25 AC 174 ms
17,664 KB
testcase_26 AC 72 ms
11,392 KB
testcase_27 AC 264 ms
23,040 KB
testcase_28 AC 181 ms
18,816 KB
testcase_29 AC 20 ms
7,168 KB
testcase_30 AC 199 ms
20,096 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
using namespace std ;
#define fast_input_output ios::sync_with_stdio(false); cin.tie(nullptr);
typedef long long ll ;
typedef long double ld ;
typedef pair<ll,ll> P ;
typedef tuple<ll,ll,ll> TP ;
#define chmin(a,b) a = min(a,b)
#define chmax(a,b) a = max(a,b)
#define bit_count(x) __builtin_popcountll(x)
#define gcd(a,b) __gcd(a,b)
#define lcm(a,b) a / gcd(a,b) * b
#define rep(i,n) for(int i = 0 ; i < n ; i++)
#define rrep(i,a,b) for(int i = a ; i < b ; i++)
#define endl "\n"

int n ;
string S[50505] ;
map<string,ll> mp ;
map<string,ll> use ;

int main(){
    fast_input_output
    cin >> n ;
    rep(i,n) {
        cin >> S[i] ;
        int m = S[i].size() ;
        rep(j,m){
            string T = S[i] ;
            T[j] = '-' ;
            mp[T]++ ;
        }
    }
    rep(i,n){
        int m = S[i].size() ;
        ll res = 0 ;
        rep(j,m){
            string T = S[i] ;
            T[j] = '-' ;
            res += mp[T] ;
        }
        cout << res - S[i].size() << endl ;
    }
}
0