結果

問題 No.1994 Confusing Name
ユーザー umezoumezo
提出日時 2022-07-02 01:42:48
言語 C++17
(gcc 13.2.0 + boost 1.83.0)
結果
TLE  
実行時間 -
コード長 573 bytes
コンパイル時間 2,455 ms
コンパイル使用メモリ 209,168 KB
実行使用メモリ 217,036 KB
最終ジャッジ日時 2023-08-17 13:37:05
合計ジャッジ時間 6,628 ms
ジャッジサーバーID
(参考情報)
judge14 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
8,756 KB
testcase_01 AC 2 ms
4,380 KB
testcase_02 AC 2 ms
4,376 KB
testcase_03 AC 1 ms
4,380 KB
testcase_04 AC 2 ms
4,380 KB
testcase_05 AC 27 ms
7,892 KB
testcase_06 AC 64 ms
13,060 KB
testcase_07 AC 12 ms
5,360 KB
testcase_08 AC 47 ms
10,680 KB
testcase_09 AC 71 ms
14,172 KB
testcase_10 AC 30 ms
8,324 KB
testcase_11 AC 27 ms
7,896 KB
testcase_12 TLE -
testcase_13 -- -
testcase_14 -- -
testcase_15 -- -
testcase_16 -- -
testcase_17 -- -
testcase_18 -- -
testcase_19 -- -
testcase_20 -- -
testcase_21 -- -
testcase_22 -- -
testcase_23 -- -
testcase_24 -- -
testcase_25 -- -
testcase_26 -- -
testcase_27 -- -
testcase_28 -- -
testcase_29 -- -
testcase_30 -- -
権限があれば一括ダウンロードができます

ソースコード

diff #

#define rep(i,n) for(int i=0;i<(int)(n);i++)
#define ALL(v) v.begin(),v.end()
typedef long long ll;
 
#include<bits/stdc++.h>
using namespace std;
 
int main(){
  ios::sync_with_stdio(false);
  std::cin.tie(nullptr);
  
  int n;
  cin>>n;
  vector<string> S(n);
  rep(i,n) cin>>S[i];
  map<string,int> M;
  rep(i,n) M[S[i]]++;
  
  rep(i,n){
    int a=S[i].size();
    int ans=0;
    rep(j,a){
      string s=S[i];
      rep(k,26){
        if(k==S[i][j]-'a') continue;
        s[j]=char('a'+k);
        ans+=M[s];
      }
    }
    cout<<ans<<endl;
  }
      
  return 0;
}
0