結果

問題 No.1994 Confusing Name
ユーザー nyuminyusupenyuminyusupe
提出日時 2022-07-20 20:15:57
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
AC  
実行時間 613 ms / 2,000 ms
コード長 690 bytes
コンパイル時間 1,790 ms
コンパイル使用メモリ 174,536 KB
実行使用メモリ 30,232 KB
最終ジャッジ日時 2023-09-15 10:15:54
合計ジャッジ時間 10,579 ms
ジャッジサーバーID
(参考情報)
judge11 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
4,380 KB
testcase_01 AC 2 ms
4,380 KB
testcase_02 AC 2 ms
4,376 KB
testcase_03 AC 1 ms
4,376 KB
testcase_04 AC 2 ms
4,384 KB
testcase_05 AC 3 ms
4,376 KB
testcase_06 AC 6 ms
4,380 KB
testcase_07 AC 3 ms
4,380 KB
testcase_08 AC 5 ms
4,380 KB
testcase_09 AC 7 ms
4,380 KB
testcase_10 AC 4 ms
4,380 KB
testcase_11 AC 4 ms
4,380 KB
testcase_12 AC 430 ms
20,564 KB
testcase_13 AC 571 ms
28,416 KB
testcase_14 AC 559 ms
29,428 KB
testcase_15 AC 444 ms
25,180 KB
testcase_16 AC 372 ms
22,316 KB
testcase_17 AC 446 ms
24,664 KB
testcase_18 AC 577 ms
29,924 KB
testcase_19 AC 587 ms
29,960 KB
testcase_20 AC 613 ms
30,232 KB
testcase_21 AC 83 ms
8,048 KB
testcase_22 AC 35 ms
5,616 KB
testcase_23 AC 521 ms
25,004 KB
testcase_24 AC 490 ms
24,172 KB
testcase_25 AC 275 ms
16,704 KB
testcase_26 AC 120 ms
10,008 KB
testcase_27 AC 454 ms
22,316 KB
testcase_28 AC 312 ms
17,812 KB
testcase_29 AC 27 ms
5,368 KB
testcase_30 AC 357 ms
19,236 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include<bits/stdc++.h>
#define rep(i,n) for(int i=0; i< (n); i++)
using namespace std;
typedef long long ll;
typedef pair<int , int> P;
const ll inf = (1ll<<60);
//const int mod = 998244353;
const int mod = 1000000007;

int main(){
    int n; cin>>n;
    map<string,int> sum;
    vector<string> s(n);
    rep(i,n){
        cin>>s[i];
        rep(j,s[i].size()){
            char k=s[i][j];
            s[i][j]='0';
            sum[s[i]]++;
            s[i][j]=k;
        }
    }

    rep(i,n){
        int res=0;
        rep(j,s[i].size()){
            char k=s[i][j];
            s[i][j]='0';
            res+=sum[s[i]]-1;
            s[i][j]=k;
        }
        cout<<res<<endl;
    }
}
0