結果

問題 No.1994 Confusing Name
ユーザー MasKoaTSMasKoaTS
提出日時 2022-02-23 16:49:42
言語 C++17
(gcc 12.3.0 + boost 1.83.0)
結果
TLE  
実行時間 -
コード長 655 bytes
コンパイル時間 717 ms
コンパイル使用メモリ 80,744 KB
実行使用メモリ 9,228 KB
最終ジャッジ日時 2023-09-17 05:07:42
合計ジャッジ時間 5,870 ms
ジャッジサーバーID
(参考情報)
judge13 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
9,228 KB
testcase_01 AC 1 ms
4,380 KB
testcase_02 AC 1 ms
4,380 KB
testcase_03 AC 2 ms
4,376 KB
testcase_04 AC 1 ms
4,376 KB
testcase_05 AC 2 ms
4,376 KB
testcase_06 AC 4 ms
4,380 KB
testcase_07 AC 2 ms
4,380 KB
testcase_08 AC 4 ms
4,380 KB
testcase_09 AC 5 ms
4,384 KB
testcase_10 AC 3 ms
4,376 KB
testcase_11 AC 2 ms
4,376 KB
testcase_12 TLE -
testcase_13 -- -
testcase_14 -- -
testcase_15 -- -
testcase_16 -- -
testcase_17 -- -
testcase_18 -- -
testcase_19 -- -
testcase_20 -- -
testcase_21 -- -
testcase_22 -- -
testcase_23 -- -
testcase_24 -- -
testcase_25 -- -
testcase_26 -- -
testcase_27 -- -
testcase_28 -- -
testcase_29 -- -
testcase_30 -- -
権限があれば一括ダウンロードができます

ソースコード

diff #

// TLE

#include <iostream>
#include <vector>
#include <map>
#define rep(i, l, n) for (int i = (l); i < (n); i++)
using namespace std;
using str = string;
template <class T>
using V = vector<T>;


int main(void) {
	int n;	cin >> n;
	V<str> s(n);
	rep(i, 0, n) {
		cin >> s[i];
	}

	V<int> ans(n);
	rep(i, 0, n - 1) {
		rep(j, i + 1, n) {
			if (s[i].size() != s[j].size()) {
				continue;
			}
			int cnt = 0;
			rep(k, 0, s[i].size()) {
				if (s[i][k] != s[j][k]) {
					cnt++;
				}
				if (cnt > 1) {
					break;
				}
			}
			if (cnt > 1) {
				continue;
			}
			ans[i]++;	ans[j]++;
		}
	}

	rep(i, 0, n) {
		cout << ans[i] << endl;
	}

	return 0;
}
0