Submission #49166366


Source Code Expand

// LUOGU_RID: 142314844
#include<bits/stdc++.h>
using namespace std;

typedef long long ll;
typedef unsigned long long ull;
typedef double db;
typedef long double ldb;

#define rep(i,l,r) for(int i(l);i<=(r);++i)
#define per(i,r,l) for(int i(r);i>=(l);--i)
#define eb emplace_back
#define File(filename) freopen(filename ".in","r",stdin),freopen(filename ".out","w",stdout)

#ifdef EXODUS
	#define Debug(...) fprintf(stderr,__VA_ARGS__)
#else
	#define Debug(...) 0
#endif

//=========================================================================================================
// Something about IO

template<typename T>
void read(T &x){
	x=0;T flg=1;
	char ch=getchar();
	while(!isdigit(ch)){if(ch=='-')flg=-1;ch=getchar();}
	while(isdigit(ch))x=(x<<3)+(x<<1)+(ch^48),ch=getchar();
	x*=flg;
}
template<typename T,typename... Args>
void read(T &x,Args &...args){read(x),read(args...);}

//=========================================================================================================
// Define the global variables here.

bool membg=0;


constexpr int N=3e2+7;
int n,m;
bitset<N>s[N];

bool memed=0;

//=========================================================================================================
// Code here.

struct Basis{
	int size;
	bitset<N>bas[N];
	void insert(bitset<N>vec){
		for(int i=m-1;i>=0;i--){
			if(vec.test(i)){
				if(!bas[i].any())return bas[i]=vec,size++,void();
				else vec^=bas[i];
			}
		}
	}
}basis;

void solve(){
	read(n,m);
	for(int i=1;i<=n;i++)cin>>s[i];
	if(n==1)return printf("%d\n",s[1].any()),void();
	for(int i=1;i<=n;i++)
		basis.insert(s[i]^s[1]);
	printf("%d\n",basis.size);
	return;
}


//=========================================================================================================

int main(){
	Debug("%.3lfMB\n",fabs(&memed-&membg)/1024.0/1024.0);
	int timbg=clock();
	int T=1;
	while(T--)solve();
	int timed=clock();
	Debug("%.3lfs\n",1.0*(timed-timbg)/CLOCKS_PER_SEC);
	fflush(stdout);
	return 0;
}

Submission Info

Submission Time
Task E - Split and Square
User EXODUS
Language C++ 20 (gcc 12.2)
Score 900
Code Size 2065 Byte
Status AC
Exec Time 3 ms
Memory 3944 KiB

Compile Error

Main.cpp: In function ‘int main()’:
Main.cpp:18:28: warning: statement has no effect [-Wunused-value]
   18 |         #define Debug(...) 0
      |                            ^
Main.cpp:77:9: note: in expansion of macro ‘Debug’
   77 |         Debug("%.3lfMB\n",fabs(&memed-&membg)/1024.0/1024.0);
      |         ^~~~~
Main.cpp:18:28: warning: statement has no effect [-Wunused-value]
   18 |         #define Debug(...) 0
      |                            ^
Main.cpp:82:9: note: in expansion of macro ‘Debug’
   82 |         Debug("%.3lfs\n",1.0*(timed-timbg)/CLOCKS_PER_SEC);
      |         ^~~~~
Main.cpp:78:13: warning: unused variable ‘timbg’ [-Wunused-variable]
   78 |         int timbg=clock();
      |             ^~~~~
Main.cpp:81:13: warning: unused variable ‘timed’ [-Wunused-variable]
   81 |         int timed=clock();
      |             ^~~~~

Judge Result

Set Name Sample All
Score / Max Score 0 / 0 900 / 900
Status
AC × 4
AC × 57
Set Name Test Cases
Sample 00_sample_01.txt, 00_sample_02.txt, 00_sample_03.txt, 00_sample_04.txt
All 00_sample_01.txt, 00_sample_02.txt, 00_sample_03.txt, 00_sample_04.txt, 01_rand_all_odd_01.txt, 01_rand_all_odd_02.txt, 01_rand_all_odd_03.txt, 01_rand_all_odd_04.txt, 01_rand_all_odd_05.txt, 01_rand_all_odd_06.txt, 01_rand_all_odd_07.txt, 01_rand_all_odd_08.txt, 01_rand_all_odd_09.txt, 01_rand_all_odd_10.txt, 01_rand_all_odd_11.txt, 01_rand_all_odd_12.txt, 02_rand_even_01.txt, 02_rand_even_02.txt, 02_rand_even_03.txt, 02_rand_even_04.txt, 02_rand_even_05.txt, 02_rand_even_06.txt, 02_rand_even_07.txt, 02_rand_even_08.txt, 02_rand_even_09.txt, 02_rand_even_10.txt, 02_rand_even_11.txt, 02_rand_even_12.txt, 03_maxi_01.txt, 03_maxi_02.txt, 03_maxi_03.txt, 03_maxi_04.txt, 03_maxi_05.txt, 03_maxi_06.txt, 03_maxi_07.txt, 03_maxi_08.txt, 03_maxi_09.txt, 03_maxi_10.txt, 03_maxi_11.txt, 03_maxi_12.txt, 03_maxi_13.txt, 03_maxi_14.txt, 03_maxi_15.txt, 03_maxi_16.txt, 03_maxi_17.txt, 03_maxi_18.txt, 03_maxi_19.txt, 03_maxi_20.txt, 04_all_base_01.txt, 04_all_base_02.txt, 04_all_base_03.txt, 05_test_01.txt, 05_test_02.txt, 05_test_03.txt, 05_test_04.txt, 05_test_05.txt, 05_test_06.txt
Case Name Status Exec Time Memory
00_sample_01.txt AC 1 ms 3936 KiB
00_sample_02.txt AC 1 ms 3708 KiB
00_sample_03.txt AC 1 ms 3740 KiB
00_sample_04.txt AC 1 ms 3836 KiB
01_rand_all_odd_01.txt AC 2 ms 3808 KiB
01_rand_all_odd_02.txt AC 2 ms 3704 KiB
01_rand_all_odd_03.txt AC 2 ms 3796 KiB
01_rand_all_odd_04.txt AC 2 ms 3740 KiB
01_rand_all_odd_05.txt AC 2 ms 3740 KiB
01_rand_all_odd_06.txt AC 2 ms 3716 KiB
01_rand_all_odd_07.txt AC 2 ms 3796 KiB
01_rand_all_odd_08.txt AC 2 ms 3808 KiB
01_rand_all_odd_09.txt AC 2 ms 3712 KiB
01_rand_all_odd_10.txt AC 2 ms 3892 KiB
01_rand_all_odd_11.txt AC 2 ms 3776 KiB
01_rand_all_odd_12.txt AC 2 ms 3760 KiB
02_rand_even_01.txt AC 2 ms 3720 KiB
02_rand_even_02.txt AC 2 ms 3856 KiB
02_rand_even_03.txt AC 2 ms 3668 KiB
02_rand_even_04.txt AC 2 ms 3776 KiB
02_rand_even_05.txt AC 2 ms 3880 KiB
02_rand_even_06.txt AC 2 ms 3808 KiB
02_rand_even_07.txt AC 2 ms 3880 KiB
02_rand_even_08.txt AC 2 ms 3704 KiB
02_rand_even_09.txt AC 2 ms 3876 KiB
02_rand_even_10.txt AC 2 ms 3716 KiB
02_rand_even_11.txt AC 3 ms 3736 KiB
02_rand_even_12.txt AC 2 ms 3792 KiB
03_maxi_01.txt AC 3 ms 3792 KiB
03_maxi_02.txt AC 2 ms 3880 KiB
03_maxi_03.txt AC 2 ms 3720 KiB
03_maxi_04.txt AC 2 ms 3868 KiB
03_maxi_05.txt AC 2 ms 3808 KiB
03_maxi_06.txt AC 3 ms 3884 KiB
03_maxi_07.txt AC 3 ms 3780 KiB
03_maxi_08.txt AC 3 ms 3804 KiB
03_maxi_09.txt AC 3 ms 3792 KiB
03_maxi_10.txt AC 3 ms 3804 KiB
03_maxi_11.txt AC 3 ms 3824 KiB
03_maxi_12.txt AC 2 ms 3804 KiB
03_maxi_13.txt AC 2 ms 3748 KiB
03_maxi_14.txt AC 2 ms 3816 KiB
03_maxi_15.txt AC 2 ms 3860 KiB
03_maxi_16.txt AC 3 ms 3884 KiB
03_maxi_17.txt AC 3 ms 3788 KiB
03_maxi_18.txt AC 3 ms 3668 KiB
03_maxi_19.txt AC 3 ms 3804 KiB
03_maxi_20.txt AC 3 ms 3748 KiB
04_all_base_01.txt AC 2 ms 3720 KiB
04_all_base_02.txt AC 2 ms 3752 KiB
04_all_base_03.txt AC 3 ms 3884 KiB
05_test_01.txt AC 1 ms 3724 KiB
05_test_02.txt AC 1 ms 3660 KiB
05_test_03.txt AC 1 ms 3944 KiB
05_test_04.txt AC 1 ms 3736 KiB
05_test_05.txt AC 1 ms 3728 KiB
05_test_06.txt AC 1 ms 3880 KiB