結果

問題 No.1994 Confusing Name
ユーザー Nzt3Nzt3
提出日時 2022-07-01 21:54:01
言語 C++17
(gcc 12.3.0 + boost 1.83.0)
結果
RE  
実行時間 -
コード長 630 bytes
コンパイル時間 2,728 ms
コンパイル使用メモリ 214,204 KB
実行使用メモリ 5,376 KB
最終ジャッジ日時 2024-05-04 16:18:34
合計ジャッジ時間 25,139 ms
ジャッジサーバーID
(参考情報)
judge2 / judge5
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
5,248 KB
testcase_01 AC 1 ms
5,376 KB
testcase_02 AC 2 ms
5,376 KB
testcase_03 AC 1 ms
5,376 KB
testcase_04 AC 2 ms
5,376 KB
testcase_05 RE -
testcase_06 AC 18 ms
5,376 KB
testcase_07 RE -
testcase_08 AC 13 ms
5,376 KB
testcase_09 AC 19 ms
5,376 KB
testcase_10 AC 9 ms
5,376 KB
testcase_11 AC 8 ms
5,376 KB
testcase_12 AC 1,365 ms
5,376 KB
testcase_13 AC 1,684 ms
5,376 KB
testcase_14 AC 1,621 ms
5,376 KB
testcase_15 AC 1,290 ms
5,376 KB
testcase_16 AC 1,112 ms
5,376 KB
testcase_17 AC 1,348 ms
5,376 KB
testcase_18 AC 1,644 ms
5,376 KB
testcase_19 AC 1,652 ms
5,376 KB
testcase_20 AC 1,660 ms
5,376 KB
testcase_21 AC 295 ms
5,376 KB
testcase_22 AC 129 ms
5,376 KB
testcase_23 AC 1,453 ms
5,376 KB
testcase_24 AC 1,428 ms
5,376 KB
testcase_25 AC 849 ms
5,376 KB
testcase_26 AC 411 ms
5,376 KB
testcase_27 AC 1,330 ms
5,376 KB
testcase_28 AC 925 ms
5,376 KB
testcase_29 AC 98 ms
5,376 KB
testcase_30 AC 1,045 ms
5,376 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include<bits/stdc++.h>
using namespace std;
//多分犯罪 通れ
int main(){
  ios::sync_with_stdio(false);
  cin.tie(nullptr);
  int N;
  cin>>N;
  vector<pair<string,int>>S(N);
  for(int i=0;i<N;i++)cin>>S[i].first,S[i].second=i;
  sort(S.begin(),S.end());
  vector<int>ans(N);
  for(int i=0;i<N;i++){
    string T=S[i].first;
    for(int j=0;j<S[i].first.size();j++){
      for(int k=0;k<26;k++){
        if(S[i].first[j]-'a'==k)continue;
        T[j]='a'+k;
        if((*lower_bound(S.begin(),S.end(),make_pair(T,-1))).first==T)++ans[S[i].second];
      }
      T[j]=S[i].first[j];
    }
  }
  for(int i:ans)cout<<i<<'\n';
}
0