結果

問題 No.1994 Confusing Name
ユーザー 沙耶花沙耶花
提出日時 2022-07-01 21:27:06
言語 C++17
(gcc 12.3.0 + boost 1.83.0)
結果
AC  
実行時間 1,605 ms / 2,000 ms
コード長 563 bytes
コンパイル時間 3,658 ms
コンパイル使用メモリ 269,336 KB
実行使用メモリ 8,832 KB
最終ジャッジ日時 2024-05-04 15:32:27
合計ジャッジ時間 24,773 ms
ジャッジサーバーID
(参考情報)
judge4 / judge5
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 1 ms
6,812 KB
testcase_01 AC 1 ms
6,816 KB
testcase_02 AC 1 ms
6,816 KB
testcase_03 AC 1 ms
6,816 KB
testcase_04 AC 1 ms
6,940 KB
testcase_05 AC 6 ms
6,944 KB
testcase_06 AC 15 ms
6,944 KB
testcase_07 AC 4 ms
6,944 KB
testcase_08 AC 11 ms
6,944 KB
testcase_09 AC 16 ms
6,940 KB
testcase_10 AC 8 ms
6,940 KB
testcase_11 AC 7 ms
6,944 KB
testcase_12 AC 1,404 ms
8,832 KB
testcase_13 AC 1,605 ms
8,832 KB
testcase_14 AC 1,441 ms
8,576 KB
testcase_15 AC 1,160 ms
7,680 KB
testcase_16 AC 1,005 ms
7,168 KB
testcase_17 AC 1,140 ms
7,424 KB
testcase_18 AC 1,542 ms
8,704 KB
testcase_19 AC 1,541 ms
8,832 KB
testcase_20 AC 1,578 ms
8,832 KB
testcase_21 AC 249 ms
6,940 KB
testcase_22 AC 109 ms
6,944 KB
testcase_23 AC 1,391 ms
8,448 KB
testcase_24 AC 1,391 ms
8,704 KB
testcase_25 AC 797 ms
6,944 KB
testcase_26 AC 362 ms
6,940 KB
testcase_27 AC 1,263 ms
8,192 KB
testcase_28 AC 882 ms
6,944 KB
testcase_29 AC 80 ms
6,944 KB
testcase_30 AC 991 ms
7,296 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);
	set<string> s;
	rep(i,N){
		cin>>S[i];
		s.insert(S[i]);
	}
	
	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(s.count(S[i]))ans++;
				swap(S[i][j],c);
			}
		}
		cout<<ans<<endl;
	}
	
    return 0;
}
0