# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
287526 | PeppaPig | PIN (CEOI10_pin) | C++14 | 783 ms | 12268 KiB |
This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#include <bits/stdc++.h>
#define long long long
using namespace std;
const int N = 5e4 + 5;
const int B = 98765431;
int n, d;
map<long, int> mp[1 << 4];
vector<int> bit[5];
char S[N][4];
long get_hash(char *s, int b) {
long ret = 0;
for(int i = 0; i < 4; i++) if(b >> i & 1)
ret = ret * B + s[i];
return ret;
}
int main() {
scanf("%d %d", &n, &d);
for(int i = 0; i < (1 << 4); i++)
bit[__builtin_popcount(i)].emplace_back(i);
for(int i = 1; i <= n; i++) {
scanf(" %s", S[i]);
for(int j = 0; j < (1 << 4); j++)
++mp[j][get_hash(S[i], j)];
}
Compilation message (stderr)
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |