差点点跑满了。。这他妈常数真的大

网上python解法一个都过不了

复制代码
 1 #include <bits/stdc++.h>
 2 using namespace std;
 3 using LL = long long;
 4 map<LL, int> mp;
 5 const LL comb[10][3] = {//combination
 6     {1,2,3},
 7     {1,2,4},
 8     {1,2,5},
 9     {1,3,4},
10     {1,3,5},
11     {1,4,5},
12     {2,3,4},
13     {2,3,5},
14     {2,4,5},
15     {3,4,5}
16 };
17 int main() {
18     int tt;
19     scanf("%d", &tt);
20     while (tt--) {
21         int n, p;
22         scanf("%d %d", &n, &p);
23         for (int i = 1; i <= n; i++) {
24             int tmp[10];
25             for (int j = 1; j <= 5; j++) {
26                 scanf("%d", &tmp[j]);
27             }
28             sort(tmp + 1, tmp + 1 + 5);
29             for (int d1 = 0; d1 < 10; d1++) {
30                 LL res = tmp[comb[d1][0]] * 61 + tmp[comb[d1][1]] * 67 + tmp[comb[d1][2]] * 71;
31                 mp[res] += 1;
32                 //printf("%lld = %d\n", res, mp[res]);
33             }
34         }
35         int flag = 0;
36         for (auto& i : mp) {
37             if (i.second * 100ll >= p * n * 1ll) {
38                 flag = 1;
39                 break;
40             }
41         }
42         if (flag) printf("yes\n");
43         else printf("no\n");
44         mp.clear();
45     }
46     
47     return 0;
48 }
复制代码