結果

問題 No.1994 Confusing Name
ユーザー 沙耶花沙耶花
提出日時 2022-07-01 21:29:11
言語 C++17
(gcc 13.2.0 + boost 1.83.0)
結果
AC  
実行時間 1,616 ms / 2,000 ms
コード長 617 bytes
コンパイル時間 4,604 ms
コンパイル使用メモリ 267,736 KB
実行使用メモリ 6,764 KB
最終ジャッジ日時 2023-08-17 08:45:28
合計ジャッジ時間 26,267 ms
ジャッジサーバーID
(参考情報)
judge15 / judge12
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 1 ms
4,380 KB
testcase_01 AC 2 ms
4,380 KB
testcase_02 AC 1 ms
4,380 KB
testcase_03 AC 1 ms
4,380 KB
testcase_04 AC 1 ms
4,380 KB
testcase_05 AC 8 ms
4,376 KB
testcase_06 AC 17 ms
4,380 KB
testcase_07 AC 4 ms
4,376 KB
testcase_08 AC 12 ms
4,376 KB
testcase_09 AC 18 ms
4,380 KB
testcase_10 AC 9 ms
4,380 KB
testcase_11 AC 8 ms
4,380 KB
testcase_12 AC 1,316 ms
6,732 KB
testcase_13 AC 1,616 ms
6,764 KB
testcase_14 AC 1,472 ms
6,548 KB
testcase_15 AC 1,195 ms
6,404 KB
testcase_16 AC 1,021 ms
6,204 KB
testcase_17 AC 1,169 ms
6,336 KB
testcase_18 AC 1,543 ms
6,764 KB
testcase_19 AC 1,560 ms
6,620 KB
testcase_20 AC 1,572 ms
6,704 KB
testcase_21 AC 275 ms
4,376 KB
testcase_22 AC 126 ms
4,380 KB
testcase_23 AC 1,396 ms
6,544 KB
testcase_24 AC 1,374 ms
6,652 KB
testcase_25 AC 819 ms
5,024 KB
testcase_26 AC 396 ms
4,380 KB
testcase_27 AC 1,272 ms
6,500 KB
testcase_28 AC 898 ms
5,116 KB
testcase_29 AC 95 ms
4,380 KB
testcase_30 AC 996 ms
6,336 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <stdio.h>
#include <bits/stdc++.h>
#include <atcoder/all>
using namespace atcoder;
using mint = modint998244353;
using namespace std;
#define rep(i,n) for (int i = 0; i < (n); ++i)
#define Inf 1000000001

int main(){
	
	int N;
	cin>>N;
	
	vector<string> S(N);
	vector<string> s;
	rep(i,N){
		cin>>S[i];
		s.push_back(S[i]);
	}
	sort(s.begin(),s.end());
	rep(i,N){
		int ans = 0;
		rep(j,S[i].size()){
			rep(k,26){
				char c = 'a' + k;
				if(c==S[i][j])continue;
				swap(S[i][j],c);
				if(binary_search(s.begin(),s.end(),S[i]))ans++;
				swap(S[i][j],c);
			}
		}
		cout<<ans<<endl;
	}
	
    return 0;
}
0