結果

問題 No.1994 Confusing Name
ユーザー keisuke6keisuke6
提出日時 2022-07-01 21:46:30
言語 C++23(draft)
(gcc 13.2.0 + boost 1.83.0)
結果
TLE  
(最新)
AC  
(最初)
実行時間 -
コード長 513 bytes
コンパイル時間 3,331 ms
コンパイル使用メモリ 255,068 KB
実行使用メモリ 10,304 KB
最終ジャッジ日時 2023-08-17 09:17:02
合計ジャッジ時間 31,924 ms
ジャッジサーバーID
(参考情報)
judge11 / judge14
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
4,376 KB
testcase_01 AC 2 ms
4,376 KB
testcase_02 AC 2 ms
4,376 KB
testcase_03 AC 2 ms
4,376 KB
testcase_04 AC 2 ms
4,380 KB
testcase_05 AC 8 ms
4,376 KB
testcase_06 AC 18 ms
4,380 KB
testcase_07 AC 4 ms
4,380 KB
testcase_08 AC 13 ms
4,380 KB
testcase_09 AC 20 ms
4,380 KB
testcase_10 AC 10 ms
4,376 KB
testcase_11 AC 8 ms
4,376 KB
testcase_12 TLE -
testcase_13 TLE -
testcase_14 AC 1,889 ms
9,588 KB
testcase_15 AC 1,489 ms
8,588 KB
testcase_16 AC 1,315 ms
7,924 KB
testcase_17 AC 1,490 ms
8,720 KB
testcase_18 TLE -
testcase_19 TLE -
testcase_20 TLE -
testcase_21 AC 319 ms
4,624 KB
testcase_22 AC 137 ms
4,376 KB
testcase_23 AC 1,920 ms
9,584 KB
testcase_24 AC 1,921 ms
9,908 KB
testcase_25 AC 1,023 ms
7,312 KB
testcase_26 AC 469 ms
5,436 KB
testcase_27 AC 1,805 ms
9,400 KB
testcase_28 AC 1,180 ms
7,576 KB
testcase_29 AC 106 ms
4,376 KB
testcase_30 AC 1,330 ms
8,192 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
using namespace std;
#define int int
signed main(){
  int N;
  cin>>N;
  map<string,int> s;
  vector<string> S(N);
  for(int i=0;i<N;i++){
      cin>>S[i];
      s[S[i]]++;
  }
  vector<string> T=S;
  for(int i=0;i<N;i++){
      int ans = 0;
      for(int k=0;k<S[i].size();k++)for(int j=0;j<26;j++){
          if(S[i][k] == (char)('a'+j)) continue;
          S[i][k] = (char)('a'+j);
          if(s.count(S[i])) ans += s[S[i]];
          S[i] = T[i];
      }
      cout<<ans<<endl;
  }
}
0