제출 #862262

#제출 시각아이디문제언어결과실행 시간메모리
862262Cyber_WolfSet (COCI21_set)C++17
10 / 110
1082 ms464 KiB
#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
#pragma GCC optimize("Ofast")

using namespace std;
using namespace __gnu_pbds;

#define lg long long
#define ordered_set	tree<int, null_type, less<int>, rb_tree_tag, tree_order_statistics_node_update>
#define fastio ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);


int main()
{
	fastio;
	lg n, k;
	cin >> n >> k;
	vector<string> v(n);
	for(int i = 0; i < n; i++)	cin >> v[i];
	lg ans = 0;
	for(int j = 0; j < n; j++)
	{
		for(int z = j+1; z < n; z++)
		{
			for(int l = z+1; l < n; l++)
			{
				lg b = 1;
				for(int h = 0; h < k; h++)
				{
					if(v[j][h] == v[z][h] && v[l][h] == v[z][h])	
					{
						continue;
					}
					if(v[j][h] != v[z][h] && v[z][h] != v[l][h] && v[j][h] != v[l][h])
					{
						continue;
					}
					b = 0;
					break;
				}
				ans += b;
			}
		}
	}
	cout << ans << '\n';

    return 0;
}
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...