Submission #146311

# Submission time Handle Problem Language Result Execution time Memory
146311 2019-08-23T12:32:29 Z MvC Genetics (BOI18_genetics) C++11
46 / 100
301 ms 18916 KB
#pragma GCC target("avx2")
#pragma GCC optimization("O3")
#pragma GCC optimization("unroll-loops")
#include<bits/stdc++.h>
//#include "boxes.h"
#define rc(x) return cout<<x<<endl,0
#define pb push_back
#define mkp make_pair
#define in insert
#define er erase
#define fd find
#define fr first
#define sc second
typedef long long ll;
typedef long double ld;
const ll INF=0x3f3f3f3f3f3f3f3f;
const ll llinf=(1LL<<62);
const int inf=(1<<30);
const int nmax=5e3+50;
const int mod=1e9+7;
using namespace std;
int n,m,k,i,j,bl,nr,t;
char a[nmax][nmax];
bitset<1805>bs[nmax];
int main()
{
	//freopen("sol.in","r",stdin);
	//freopen("sol.out","w",stdout);
	//mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());
	ios_base::sync_with_stdio(false);cin.tie(0);cerr.tie(0);cout.tie(0);
	cin>>n>>m>>k;
	for(i=1;i<=n;i++)for(j=1;j<=m;j++)cin>>a[i][j];
	if(n<=100 && m<=100)
	{
		for(i=1;i<=n;i++)
		{
			bl=0;
			for(j=1;j<=n;j++)
			{
				if(i==j)continue;
				nr=0;
				for(t=1;t<=m;t++)if(a[i][t]!=a[j][t])nr++;
				if(nr!=k)
				{
					bl=1;
					break;
				}
			}
			if(!bl)rc(i);
		}
	}
	for(i=1;i<=n;i++)
	{
		for(j=1;j<=m;j++)
		{
			if(a[i][j]=='C')bs[i][j]=1;
		}
	}
	for(i=1;i<=n;i++)
	{
		bl=0;
		for(j=1;j<=n;j++)
		{
			if(i==j)continue;
			nr=(bs[i]^bs[j]).count();
			if(nr!=k)
			{
				bl=1;
				break;
			}
		}
		if(!bl)rc(i);
	}
	return 0;
}

Compilation message

genetics.cpp:2:0: warning: ignoring #pragma GCC optimization [-Wunknown-pragmas]
 #pragma GCC optimization("O3")
 
genetics.cpp:3:0: warning: ignoring #pragma GCC optimization [-Wunknown-pragmas]
 #pragma GCC optimization("unroll-loops")
# Verdict Execution time Memory Grader output
1 Correct 5 ms 632 KB Output is correct
2 Correct 5 ms 760 KB Output is correct
3 Correct 4 ms 376 KB Output is correct
4 Correct 5 ms 632 KB Output is correct
5 Correct 5 ms 760 KB Output is correct
6 Correct 5 ms 764 KB Output is correct
7 Correct 5 ms 504 KB Output is correct
8 Correct 5 ms 376 KB Output is correct
9 Correct 5 ms 636 KB Output is correct
10 Correct 5 ms 760 KB Output is correct
11 Correct 6 ms 632 KB Output is correct
12 Correct 6 ms 760 KB Output is correct
13 Correct 5 ms 760 KB Output is correct
14 Correct 5 ms 760 KB Output is correct
15 Correct 5 ms 760 KB Output is correct
16 Correct 5 ms 760 KB Output is correct
17 Correct 5 ms 376 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 167 ms 8184 KB Output is correct
2 Correct 131 ms 9592 KB Output is correct
3 Correct 259 ms 9276 KB Output is correct
4 Correct 56 ms 5880 KB Output is correct
5 Correct 81 ms 9592 KB Output is correct
6 Correct 121 ms 9592 KB Output is correct
7 Correct 51 ms 4344 KB Output is correct
8 Correct 47 ms 4348 KB Output is correct
9 Correct 88 ms 9208 KB Output is correct
10 Correct 171 ms 9208 KB Output is correct
11 Correct 82 ms 8184 KB Output is correct
12 Correct 66 ms 8184 KB Output is correct
13 Correct 91 ms 8188 KB Output is correct
14 Correct 103 ms 7032 KB Output is correct
15 Correct 69 ms 7160 KB Output is correct
16 Correct 102 ms 8024 KB Output is correct
17 Correct 126 ms 9208 KB Output is correct
18 Correct 77 ms 9208 KB Output is correct
19 Correct 133 ms 9208 KB Output is correct
20 Correct 101 ms 9208 KB Output is correct
21 Correct 172 ms 9212 KB Output is correct
22 Correct 229 ms 9208 KB Output is correct
23 Correct 236 ms 9208 KB Output is correct
24 Correct 169 ms 9368 KB Output is correct
25 Correct 87 ms 9080 KB Output is correct
26 Correct 134 ms 9208 KB Output is correct
27 Correct 110 ms 9208 KB Output is correct
28 Correct 113 ms 9208 KB Output is correct
29 Correct 163 ms 9336 KB Output is correct
30 Correct 102 ms 9592 KB Output is correct
31 Correct 71 ms 9592 KB Output is correct
32 Correct 111 ms 9592 KB Output is correct
33 Correct 5 ms 376 KB Output is correct
34 Correct 5 ms 760 KB Output is correct
35 Correct 5 ms 376 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 167 ms 8184 KB Output is correct
2 Correct 131 ms 9592 KB Output is correct
3 Correct 259 ms 9276 KB Output is correct
4 Correct 56 ms 5880 KB Output is correct
5 Correct 81 ms 9592 KB Output is correct
6 Correct 121 ms 9592 KB Output is correct
7 Correct 51 ms 4344 KB Output is correct
8 Correct 47 ms 4348 KB Output is correct
9 Correct 88 ms 9208 KB Output is correct
10 Correct 171 ms 9208 KB Output is correct
11 Correct 82 ms 8184 KB Output is correct
12 Correct 66 ms 8184 KB Output is correct
13 Correct 91 ms 8188 KB Output is correct
14 Correct 103 ms 7032 KB Output is correct
15 Correct 69 ms 7160 KB Output is correct
16 Correct 102 ms 8024 KB Output is correct
17 Correct 126 ms 9208 KB Output is correct
18 Correct 77 ms 9208 KB Output is correct
19 Correct 133 ms 9208 KB Output is correct
20 Correct 101 ms 9208 KB Output is correct
21 Correct 172 ms 9212 KB Output is correct
22 Correct 229 ms 9208 KB Output is correct
23 Correct 236 ms 9208 KB Output is correct
24 Correct 169 ms 9368 KB Output is correct
25 Correct 87 ms 9080 KB Output is correct
26 Correct 134 ms 9208 KB Output is correct
27 Correct 110 ms 9208 KB Output is correct
28 Correct 113 ms 9208 KB Output is correct
29 Correct 163 ms 9336 KB Output is correct
30 Correct 102 ms 9592 KB Output is correct
31 Correct 71 ms 9592 KB Output is correct
32 Correct 111 ms 9592 KB Output is correct
33 Correct 5 ms 376 KB Output is correct
34 Correct 5 ms 760 KB Output is correct
35 Correct 5 ms 376 KB Output is correct
36 Incorrect 301 ms 18916 KB Output isn't correct
37 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 5 ms 632 KB Output is correct
2 Correct 5 ms 760 KB Output is correct
3 Correct 4 ms 376 KB Output is correct
4 Correct 5 ms 632 KB Output is correct
5 Correct 5 ms 760 KB Output is correct
6 Correct 5 ms 764 KB Output is correct
7 Correct 5 ms 504 KB Output is correct
8 Correct 5 ms 376 KB Output is correct
9 Correct 5 ms 636 KB Output is correct
10 Correct 5 ms 760 KB Output is correct
11 Correct 6 ms 632 KB Output is correct
12 Correct 6 ms 760 KB Output is correct
13 Correct 5 ms 760 KB Output is correct
14 Correct 5 ms 760 KB Output is correct
15 Correct 5 ms 760 KB Output is correct
16 Correct 5 ms 760 KB Output is correct
17 Correct 5 ms 376 KB Output is correct
18 Correct 167 ms 8184 KB Output is correct
19 Correct 131 ms 9592 KB Output is correct
20 Correct 259 ms 9276 KB Output is correct
21 Correct 56 ms 5880 KB Output is correct
22 Correct 81 ms 9592 KB Output is correct
23 Correct 121 ms 9592 KB Output is correct
24 Correct 51 ms 4344 KB Output is correct
25 Correct 47 ms 4348 KB Output is correct
26 Correct 88 ms 9208 KB Output is correct
27 Correct 171 ms 9208 KB Output is correct
28 Correct 82 ms 8184 KB Output is correct
29 Correct 66 ms 8184 KB Output is correct
30 Correct 91 ms 8188 KB Output is correct
31 Correct 103 ms 7032 KB Output is correct
32 Correct 69 ms 7160 KB Output is correct
33 Correct 102 ms 8024 KB Output is correct
34 Correct 126 ms 9208 KB Output is correct
35 Correct 77 ms 9208 KB Output is correct
36 Correct 133 ms 9208 KB Output is correct
37 Correct 101 ms 9208 KB Output is correct
38 Correct 172 ms 9212 KB Output is correct
39 Correct 229 ms 9208 KB Output is correct
40 Correct 236 ms 9208 KB Output is correct
41 Correct 169 ms 9368 KB Output is correct
42 Correct 87 ms 9080 KB Output is correct
43 Correct 134 ms 9208 KB Output is correct
44 Correct 110 ms 9208 KB Output is correct
45 Correct 113 ms 9208 KB Output is correct
46 Correct 163 ms 9336 KB Output is correct
47 Correct 102 ms 9592 KB Output is correct
48 Correct 71 ms 9592 KB Output is correct
49 Correct 111 ms 9592 KB Output is correct
50 Correct 5 ms 376 KB Output is correct
51 Correct 5 ms 760 KB Output is correct
52 Correct 5 ms 376 KB Output is correct
53 Incorrect 301 ms 18916 KB Output isn't correct
54 Halted 0 ms 0 KB -