結果

問題 No.1994 Confusing Name
ユーザー asaringoasaringo
提出日時 2022-07-01 21:37:54
言語 C++17
(gcc 13.2.0 + boost 1.83.0)
結果
AC  
実行時間 448 ms / 2,000 ms
コード長 1,027 bytes
コンパイル時間 2,075 ms
コンパイル使用メモリ 207,848 KB
実行使用メモリ 30,636 KB
最終ジャッジ日時 2023-08-17 09:02:18
合計ジャッジ時間 8,465 ms
ジャッジサーバーID
(参考情報)
judge11 / judge12
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 3 ms
4,968 KB
testcase_01 AC 2 ms
5,184 KB
testcase_02 AC 3 ms
4,924 KB
testcase_03 AC 3 ms
4,916 KB
testcase_04 AC 2 ms
4,992 KB
testcase_05 AC 4 ms
5,248 KB
testcase_06 AC 6 ms
5,400 KB
testcase_07 AC 3 ms
5,260 KB
testcase_08 AC 5 ms
5,212 KB
testcase_09 AC 6 ms
5,584 KB
testcase_10 AC 4 ms
5,184 KB
testcase_11 AC 4 ms
5,328 KB
testcase_12 AC 269 ms
20,896 KB
testcase_13 AC 368 ms
28,796 KB
testcase_14 AC 375 ms
29,896 KB
testcase_15 AC 298 ms
25,844 KB
testcase_16 AC 254 ms
23,208 KB
testcase_17 AC 296 ms
25,336 KB
testcase_18 AC 412 ms
30,252 KB
testcase_19 AC 445 ms
30,464 KB
testcase_20 AC 448 ms
30,636 KB
testcase_21 AC 59 ms
9,688 KB
testcase_22 AC 27 ms
7,228 KB
testcase_23 AC 361 ms
25,412 KB
testcase_24 AC 351 ms
24,504 KB
testcase_25 AC 195 ms
17,636 KB
testcase_26 AC 84 ms
11,592 KB
testcase_27 AC 328 ms
22,856 KB
testcase_28 AC 245 ms
18,772 KB
testcase_29 AC 22 ms
7,004 KB
testcase_30 AC 244 ms
20,016 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