結果

問題 No.1994 Confusing Name
ユーザー 👑 kmjpkmjp
提出日時 2022-07-01 21:26:55
言語 C++17
(gcc 12.3.0 + boost 1.83.0)
結果
AC  
実行時間 1,735 ms / 2,000 ms
コード長 1,119 bytes
コンパイル時間 1,926 ms
コンパイル使用メモリ 208,944 KB
実行使用メモリ 23,168 KB
最終ジャッジ日時 2024-05-04 15:31:42
合計ジャッジ時間 24,540 ms
ジャッジサーバーID
(参考情報)
judge4 / judge2
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 13 ms
19,328 KB
testcase_01 AC 13 ms
19,328 KB
testcase_02 AC 12 ms
19,328 KB
testcase_03 AC 13 ms
19,200 KB
testcase_04 AC 13 ms
19,072 KB
testcase_05 AC 18 ms
19,328 KB
testcase_06 AC 27 ms
19,200 KB
testcase_07 AC 15 ms
19,200 KB
testcase_08 AC 23 ms
19,328 KB
testcase_09 AC 28 ms
19,200 KB
testcase_10 AC 20 ms
19,200 KB
testcase_11 AC 18 ms
19,200 KB
testcase_12 AC 1,432 ms
23,168 KB
testcase_13 AC 1,735 ms
23,168 KB
testcase_14 AC 1,549 ms
23,040 KB
testcase_15 AC 1,299 ms
22,272 KB
testcase_16 AC 1,055 ms
22,016 KB
testcase_17 AC 1,241 ms
22,272 KB
testcase_18 AC 1,673 ms
23,168 KB
testcase_19 AC 1,629 ms
23,168 KB
testcase_20 AC 1,661 ms
23,040 KB
testcase_21 AC 265 ms
20,096 KB
testcase_22 AC 124 ms
19,712 KB
testcase_23 AC 1,406 ms
22,784 KB
testcase_24 AC 1,497 ms
23,040 KB
testcase_25 AC 899 ms
21,632 KB
testcase_26 AC 385 ms
20,608 KB
testcase_27 AC 1,373 ms
22,656 KB
testcase_28 AC 916 ms
21,632 KB
testcase_29 AC 95 ms
19,456 KB
testcase_30 AC 1,023 ms
22,144 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
using namespace std;
typedef signed long long ll;

#define _P(...) (void)printf(__VA_ARGS__)
#define FOR(x,to) for(x=0;x<(to);x++)
#define FORR(x,arr) for(auto& x:arr)
#define FORR2(x,y,arr) for(auto& [x,y]:arr)
#define ALL(a) (a.begin()),(a.end())
#define ZERO(a) memset(a,0,sizeof(a))
#define MINUS(a) memset(a,0xff,sizeof(a))
template<class T> bool chmax(T &a, const T &b) { if(a<b){a=b;return 1;}return 0;}
template<class T> bool chmin(T &a, const T &b) { if(a>b){a=b;return 1;}return 0;}
//-------------------------------------------------------


int N;
string S[505050];
set<string> SS;

void solve() {
	int i,j,k,l,r,x,y; string s;
	
	cin>>N;
	FOR(i,N) {
		cin>>S[i];
		SS.insert(S[i]);
	}
	FOR(i,N) {
		int ret=0;
		FOR(j,S[i].size()) {
			FOR(x,26) if(S[i][j]!='a'+x) {
				string T=S[i];
				T[j]='a'+x;
				ret+=SS.count(T);
			}
		}
		cout<<ret<<endl;
	}
}


int main(int argc,char** argv){
	string s;int i;
	if(argc==1) ios::sync_with_stdio(false), cin.tie(0);
	FOR(i,argc-1) s+=argv[i+1],s+='\n'; FOR(i,s.size()) ungetc(s[s.size()-1-i],stdin);
	cout.tie(0); solve(); return 0;
}
0