Submission #917407

# Submission time Handle Problem Language Result Execution time Memory
917407 2024-01-28T05:40:30 Z PM1 PIN (CEOI10_pin) C++17
0 / 100
415 ms 16584 KB
#include <bits/stdc++.h>
using namespace std;
#define ll long long
const int mxn=5e4+5;
int n,d;
string s[mxn];
map<vector<char>,int>mp[(1<<4)];
ll ans[4];
int main(){
	cin>>n>>d;
	for(int i=1;i<=n;i++){
		cin>>s[i];
		for(int j=0;j<(1<<4)-1;j++){
			int cnt=0;
			vector<char>v;
			for(int k=0;k<4;k++){
				if(j&(1<<k)){
					cnt++;
					v.push_back(s[i][k]);
				}
			}
			ans[3-cnt]+=mp[j][v];
			mp[j][v]++;
			//cout<<j<<" "<<mp[j][v]<<endl;
		}//cout<<endl;
	}
	for(int j=0;j<4;j++)
		cout<<ans[j]<<" ";
	ans[1]-=(ans[0]*3);
	ans[2]-=(ans[1]*2+ans[3]*3);
	ans[3]-=ans[1]+ans[2]+ans[0];
	cout<<ans[d-1]<<'\n';
}
# Verdict Execution time Memory Grader output
1 Incorrect 8 ms 2588 KB Output isn't correct
2 Incorrect 8 ms 2516 KB Output isn't correct
3 Incorrect 6 ms 2396 KB Output isn't correct
4 Incorrect 77 ms 3908 KB Output isn't correct
5 Incorrect 93 ms 4072 KB Output isn't correct
6 Incorrect 94 ms 4028 KB Output isn't correct
7 Incorrect 79 ms 3972 KB Output isn't correct
8 Incorrect 103 ms 4052 KB Output isn't correct
9 Incorrect 154 ms 4056 KB Output isn't correct
10 Incorrect 204 ms 4188 KB Output isn't correct
11 Incorrect 131 ms 3920 KB Output isn't correct
12 Incorrect 160 ms 4180 KB Output isn't correct
13 Incorrect 105 ms 4088 KB Output isn't correct
14 Incorrect 133 ms 4072 KB Output isn't correct
15 Incorrect 173 ms 4176 KB Output isn't correct
16 Incorrect 169 ms 13472 KB Output isn't correct
17 Incorrect 303 ms 16504 KB Output isn't correct
18 Incorrect 224 ms 14368 KB Output isn't correct
19 Incorrect 251 ms 15708 KB Output isn't correct
20 Incorrect 415 ms 16584 KB Output isn't correct