답안 #146312

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
146312 2019-08-23T12:33:10 Z MvC Genetics (BOI18_genetics) C++11
46 / 100
2000 ms 22804 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<4105>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")
# 결과 실행 시간 메모리 Grader output
1 Correct 5 ms 632 KB Output is correct
2 Correct 5 ms 760 KB Output is correct
3 Correct 5 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 760 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 632 KB Output is correct
10 Correct 5 ms 764 KB Output is correct
11 Correct 5 ms 612 KB Output is correct
12 Correct 6 ms 760 KB Output is correct
13 Correct 5 ms 764 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
# 결과 실행 시간 메모리 Grader output
1 Correct 364 ms 8628 KB Output is correct
2 Correct 242 ms 10232 KB Output is correct
3 Correct 548 ms 9848 KB Output is correct
4 Correct 117 ms 6140 KB Output is correct
5 Correct 98 ms 10104 KB Output is correct
6 Correct 169 ms 10104 KB Output is correct
7 Correct 78 ms 4728 KB Output is correct
8 Correct 74 ms 4600 KB Output is correct
9 Correct 69 ms 9720 KB Output is correct
10 Correct 349 ms 9720 KB Output is correct
11 Correct 122 ms 8572 KB Output is correct
12 Correct 67 ms 8696 KB Output is correct
13 Correct 115 ms 8628 KB Output is correct
14 Correct 189 ms 7416 KB Output is correct
15 Correct 97 ms 7544 KB Output is correct
16 Correct 121 ms 8412 KB Output is correct
17 Correct 222 ms 9900 KB Output is correct
18 Correct 81 ms 9592 KB Output is correct
19 Correct 230 ms 9848 KB Output is correct
20 Correct 152 ms 9560 KB Output is correct
21 Correct 338 ms 9848 KB Output is correct
22 Correct 497 ms 9720 KB Output is correct
23 Correct 501 ms 9720 KB Output is correct
24 Correct 305 ms 9720 KB Output is correct
25 Correct 94 ms 9592 KB Output is correct
26 Correct 250 ms 9720 KB Output is correct
27 Correct 168 ms 9592 KB Output is correct
28 Correct 152 ms 9592 KB Output is correct
29 Correct 328 ms 9720 KB Output is correct
30 Correct 63 ms 10104 KB Output is correct
31 Correct 61 ms 10104 KB Output is correct
32 Correct 76 ms 10104 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
# 결과 실행 시간 메모리 Grader output
1 Correct 364 ms 8628 KB Output is correct
2 Correct 242 ms 10232 KB Output is correct
3 Correct 548 ms 9848 KB Output is correct
4 Correct 117 ms 6140 KB Output is correct
5 Correct 98 ms 10104 KB Output is correct
6 Correct 169 ms 10104 KB Output is correct
7 Correct 78 ms 4728 KB Output is correct
8 Correct 74 ms 4600 KB Output is correct
9 Correct 69 ms 9720 KB Output is correct
10 Correct 349 ms 9720 KB Output is correct
11 Correct 122 ms 8572 KB Output is correct
12 Correct 67 ms 8696 KB Output is correct
13 Correct 115 ms 8628 KB Output is correct
14 Correct 189 ms 7416 KB Output is correct
15 Correct 97 ms 7544 KB Output is correct
16 Correct 121 ms 8412 KB Output is correct
17 Correct 222 ms 9900 KB Output is correct
18 Correct 81 ms 9592 KB Output is correct
19 Correct 230 ms 9848 KB Output is correct
20 Correct 152 ms 9560 KB Output is correct
21 Correct 338 ms 9848 KB Output is correct
22 Correct 497 ms 9720 KB Output is correct
23 Correct 501 ms 9720 KB Output is correct
24 Correct 305 ms 9720 KB Output is correct
25 Correct 94 ms 9592 KB Output is correct
26 Correct 250 ms 9720 KB Output is correct
27 Correct 168 ms 9592 KB Output is correct
28 Correct 152 ms 9592 KB Output is correct
29 Correct 328 ms 9720 KB Output is correct
30 Correct 63 ms 10104 KB Output is correct
31 Correct 61 ms 10104 KB Output is correct
32 Correct 76 ms 10104 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 Correct 1299 ms 20064 KB Output is correct
37 Correct 762 ms 22804 KB Output is correct
38 Execution timed out 2087 ms 22140 KB Time limit exceeded
39 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 5 ms 632 KB Output is correct
2 Correct 5 ms 760 KB Output is correct
3 Correct 5 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 760 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 632 KB Output is correct
10 Correct 5 ms 764 KB Output is correct
11 Correct 5 ms 612 KB Output is correct
12 Correct 6 ms 760 KB Output is correct
13 Correct 5 ms 764 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 364 ms 8628 KB Output is correct
19 Correct 242 ms 10232 KB Output is correct
20 Correct 548 ms 9848 KB Output is correct
21 Correct 117 ms 6140 KB Output is correct
22 Correct 98 ms 10104 KB Output is correct
23 Correct 169 ms 10104 KB Output is correct
24 Correct 78 ms 4728 KB Output is correct
25 Correct 74 ms 4600 KB Output is correct
26 Correct 69 ms 9720 KB Output is correct
27 Correct 349 ms 9720 KB Output is correct
28 Correct 122 ms 8572 KB Output is correct
29 Correct 67 ms 8696 KB Output is correct
30 Correct 115 ms 8628 KB Output is correct
31 Correct 189 ms 7416 KB Output is correct
32 Correct 97 ms 7544 KB Output is correct
33 Correct 121 ms 8412 KB Output is correct
34 Correct 222 ms 9900 KB Output is correct
35 Correct 81 ms 9592 KB Output is correct
36 Correct 230 ms 9848 KB Output is correct
37 Correct 152 ms 9560 KB Output is correct
38 Correct 338 ms 9848 KB Output is correct
39 Correct 497 ms 9720 KB Output is correct
40 Correct 501 ms 9720 KB Output is correct
41 Correct 305 ms 9720 KB Output is correct
42 Correct 94 ms 9592 KB Output is correct
43 Correct 250 ms 9720 KB Output is correct
44 Correct 168 ms 9592 KB Output is correct
45 Correct 152 ms 9592 KB Output is correct
46 Correct 328 ms 9720 KB Output is correct
47 Correct 63 ms 10104 KB Output is correct
48 Correct 61 ms 10104 KB Output is correct
49 Correct 76 ms 10104 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 Correct 1299 ms 20064 KB Output is correct
54 Correct 762 ms 22804 KB Output is correct
55 Execution timed out 2087 ms 22140 KB Time limit exceeded
56 Halted 0 ms 0 KB -