Submission #52094808


Source Code Expand

Copy
#include<bits/stdc++.h>
#define Withers using
#define AK namespace
#define IOI std
Withers AK IOI;typedef long long ll;typedef pair<int,int>pii;int n,m,u,v,w,x,y,z,l,r,minn=INT_MAX,maxx=INT_MIN,k;int tst;int a[200010];char s[200010];mt19937 rnd(chrono::steady_clock::now().time_since_epoch().count());char t[200010];
#define infll 0x3f3f3f3f3f3f3f3f
#define inf 0x3f3f3f3f
#define endl '\n'
static char buf[1<<18],*paa=buf,*pddd=buf;static char buf2[1<<18],*pppp=buf2;
#define getchar()paa==pddd&&(pddd=(paa=buf)+fread(buf,1,1<<18,stdin),paa==pddd)?EOF:*paa++
inline void pc(char ch){if(pppp-buf2==1<<18)fwrite(buf2,1,1<<18,stdout),pppp=buf2;*pppp++=ch;}inline void pcc(){fwrite(buf2,1,pppp-buf2,stdout);pppp=buf2;}inline void rd(int&n){int w=1;register int x(0);register char c(getchar());while(c<'0'||c>'9'){if(c=='-')w=-1;c=getchar();}while(c>='0'&&c<='9')x=(x<<1)+(x<<3)+(c^48),c=getchar();n=w*x;return;}inline void write(int x){if(x<0)pc('-'),x=-x;static int sta[20];int top=0;do{sta[top++]=x%10,x/=10;}while(x);while(top)pc(sta[--top]+48);}inline void we(int x){write(x);pc('\n');}inline void ws(int x){write(x);pc(' ');}
#define YES cout<<"YES"<<endl
#define NO cout<<"NO"<<endl
#define deb(x)cout<<#x<<"="<<x<<" ";
#define pb push_back
#define fi first
#define se second
#define mx3(a,b,c)((a>b?a:b)>c?(a>b?a:b):c)
#define mn3(a,b,c)((a<b?a:b)<c?(a<b?a:b):c)
#define mem(a,b)memset(a,b,sizeof(a))
#define rep(i,a,b)for(int i=a;i<=b;i++)
 
 
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
#include<bits/stdc++.h>
#define Withers using
#define AK namespace
#define IOI std
Withers AK IOI;typedef long long ll;typedef pair<int,int>pii;int n,m,u,v,w,x,y,z,l,r,minn=INT_MAX,maxx=INT_MIN,k;int tst;int a[200010];char s[200010];mt19937 rnd(chrono::steady_clock::now().time_since_epoch().count());char t[200010];
#define infll 0x3f3f3f3f3f3f3f3f
#define inf 0x3f3f3f3f
#define endl '\n'
static char buf[1<<18],*paa=buf,*pddd=buf;static char buf2[1<<18],*pppp=buf2;
#define getchar()paa==pddd&&(pddd=(paa=buf)+fread(buf,1,1<<18,stdin),paa==pddd)?EOF:*paa++
inline void pc(char ch){if(pppp-buf2==1<<18)fwrite(buf2,1,1<<18,stdout),pppp=buf2;*pppp++=ch;}inline void pcc(){fwrite(buf2,1,pppp-buf2,stdout);pppp=buf2;}inline void rd(int&n){int w=1;register int x(0);register char c(getchar());while(c<'0'||c>'9'){if(c=='-')w=-1;c=getchar();}while(c>='0'&&c<='9')x=(x<<1)+(x<<3)+(c^48),c=getchar();n=w*x;return;}inline void write(int x){if(x<0)pc('-'),x=-x;static int sta[20];int top=0;do{sta[top++]=x%10,x/=10;}while(x);while(top)pc(sta[--top]+48);}inline void we(int x){write(x);pc('\n');}inline void ws(int x){write(x);pc(' ');}
#define YES cout<<"YES"<<endl
#define NO cout<<"NO"<<endl
#define deb(x)cout<<#x<<"="<<x<<" ";
#define pb push_back
#define fi first
#define se second
#define mx3(a,b,c)((a>b?a:b)>c?(a>b?a:b):c)
#define mn3(a,b,c)((a<b?a:b)<c?(a<b?a:b):c)
#define mem(a,b)memset(a,b,sizeof(a))
#define rep(i,a,b)for(int i=a;i<=b;i++)
map<tuple<int, int, int>, int> mp;
int c[2010][2010];
void solve()
{
	//do something
	rd(n),rd(m);
	rep(i,1,n) rep(j,1,m) rd(c[i][j]);
	int as=0;
	rep(i,1,n)
	{
		rep(j,i+1,n)
		{
			int cnt=0;
			rep(k,1,m) if(c[i][k]==c[j][k]) ++cnt;
			if(cnt%2==1) ++as;
		}
	}
	cout<<as<<endl;
}
void multi()
{
	//rd(tst);
	tst=1;
	while(tst--)
	{
		solve();
	}
	pcc();
}
signed main()
{
	ios::sync_with_stdio(false);cin.tie(0);cout.tie(0);
	multi();
}
// POWERED BY WITHERS
// THINK ONCE, CODE TWICE
/*things to check
1.  int overflow or long long memory need
2.  recursion/array/binary search/dp/loop bounds
3.  precision
4.  special cases(n=1,bounds)
5.  delete debug statements
6.  initialize(especially multi-tests)
7.  = or == , n or m ,++ or -- , i or j , > or >= , < or <= , - or =
8.  keep it simple and stupid
9.  do not delete, use // instead
10. operator priority
11. is there anything extra to output?
12. if you don't know where the bug is , try to clear some parts of the code
 and check each part seperately.
13. ...
*/
 
/* something to think about
1. greedy? dp? searching? dp with matrix/ segment tree? binary search?
2. If contains "not", why not 正难则反 or few affect?
*/
// lgvc bilibilitdasc zxx zy graygoo tt cyx wsc akioi!

Submission Info

Submission Time
Task F - Oddly Similar
User Withers
Language C++ 20 (gcc 12.2)
Score 0
Code Size 2763 Byte
Status TLE
Exec Time 2211 ms
Memory 19328 KB

Compile Error

Main.cpp: In function ‘void rd(int&)’:
Main.cpp:11:199: warning: ISO C++17 does not allow ‘register’ storage class specifier [-Wregister]
   11 | inline void pc(char ch){if(pppp-buf2==1<<18)fwrite(buf2,1,1<<18,stdout),pppp=buf2;*pppp++=ch;}inline void pcc(){fwrite(buf2,1,pppp-buf2,stdout);pppp=buf2;}inline void rd(int&n){int w=1;register int x(0);register char c(getchar());while(c<'0'||c>'9'){if(c=='-')w=-1;c=getchar();}while(c>='0'&&c<='9')x=(x<<1)+(x<<3)+(c^48),c=getchar();n=w*x;return;}inline void write(int x){if(x<0)pc('-'),x=-x;static int sta[20];int top=0;do{sta[top++]=x%10,x/=10;}while(x);while(top)pc(sta[--top]+48);}inline void we(int x){write(x);pc('\n');}inline void ws(int x){write(x);pc(' ');}
      |                                                                                                                                                                                                       ^
Main.cpp:11:218: warning: ISO C++17 does not allow ‘register’ storage class specifier [-Wregister]
   11 | inline void pc(char ch){if(pppp-buf2==1<<18)fwrite(buf2,1,1<<18,stdout),pppp=buf2;*pppp++=ch;}inline void pcc(){fwrite(buf2,1,pppp-buf2,stdout);pppp=buf2;}inline void rd(int&n){int w=1;register int x(0);register char c(getchar());while(c<'0'||c>'9'){if(c=='-')w=-1;c=getchar();}while(c>='0'&&c<='9')x=(x<<1)+(x<<3)+(c^48),c=getchar();n=w*x;return;}inline void write(int x){if(x<0)pc('-'),x=-x;static int sta[20];int top=0;do{sta[top++]=x%10,x/=10;}while(x);while(top)pc(sta[--top]+48);}inline void we(int x){write(x);pc('\n');}inline void ws(int x){write(x);pc(' ');}
      |                                                                                                                                                                                                                          ^

Judge Result

Set Name Sample All
Score / Max Score 0 / 0 0 / 550
Status
AC × 2
AC × 23
TLE × 30
Set Name Test Cases
Sample 00_sample_00.txt, 00_sample_01.txt
All 00_sample_00.txt, 00_sample_01.txt, 01_random_00.txt, 01_random_01.txt, 01_random_02.txt, 01_random_03.txt, 01_random_04.txt, 01_random_05.txt, 01_random_06.txt, 01_random_07.txt, 01_random_08.txt, 01_random_09.txt, 01_random_10.txt, 01_random_11.txt, 01_random_12.txt, 01_random_13.txt, 01_random_14.txt, 01_random_15.txt, 01_random_16.txt, 01_random_17.txt, 01_random_18.txt, 01_random_19.txt, 01_random_20.txt, 01_random_21.txt, 01_random_22.txt, 02_maximum_00.txt, 02_maximum_01.txt, 02_maximum_02.txt, 02_maximum_03.txt, 02_maximum_04.txt, 02_maximum_05.txt, 02_maximum_06.txt, 02_maximum_07.txt, 02_maximum_08.txt, 02_maximum_09.txt, 02_maximum_10.txt, 02_maximum_11.txt, 02_maximum_12.txt, 02_maximum_13.txt, 02_maximum_14.txt, 02_maximum_15.txt, 02_maximum_16.txt, 02_maximum_17.txt, 02_maximum_18.txt, 02_maximum_19.txt, 02_maximum_20.txt, 02_maximum_21.txt, 02_maximum_22.txt, 02_maximum_23.txt, 02_maximum_24.txt, 02_maximum_25.txt, 02_maximum_26.txt, 02_maximum_27.txt
Case Name Status Exec Time Memory
00_sample_00.txt AC 1 ms 3680 KB
00_sample_01.txt AC 1 ms 3568 KB
01_random_00.txt AC 48 ms 6444 KB
01_random_01.txt TLE 2208 ms 18488 KB
01_random_02.txt AC 41 ms 6528 KB
01_random_03.txt AC 18 ms 5056 KB
01_random_04.txt AC 1801 ms 15680 KB
01_random_05.txt AC 677 ms 12720 KB
01_random_06.txt AC 9 ms 4528 KB
01_random_07.txt AC 958 ms 16196 KB
01_random_08.txt AC 140 ms 10444 KB
01_random_09.txt AC 93 ms 6440 KB
01_random_10.txt AC 806 ms 11788 KB
01_random_11.txt AC 463 ms 11968 KB
01_random_12.txt AC 386 ms 9832 KB
01_random_13.txt AC 49 ms 6176 KB
01_random_14.txt AC 17 ms 5048 KB
01_random_15.txt AC 52 ms 6300 KB
01_random_16.txt AC 18 ms 5496 KB
01_random_17.txt TLE 2122 ms 19024 KB
01_random_18.txt AC 32 ms 5460 KB
01_random_19.txt AC 173 ms 7440 KB
01_random_20.txt AC 113 ms 7004 KB
01_random_21.txt AC 8 ms 4684 KB
01_random_22.txt AC 633 ms 12568 KB
02_maximum_00.txt TLE 2208 ms 19292 KB
02_maximum_01.txt TLE 2208 ms 19308 KB
02_maximum_02.txt TLE 2208 ms 19280 KB
02_maximum_03.txt TLE 2208 ms 19240 KB
02_maximum_04.txt TLE 2208 ms 19164 KB
02_maximum_05.txt TLE 2211 ms 19160 KB
02_maximum_06.txt TLE 2208 ms 19252 KB
02_maximum_07.txt TLE 2208 ms 19300 KB
02_maximum_08.txt TLE 2208 ms 19292 KB
02_maximum_09.txt TLE 2208 ms 19252 KB
02_maximum_10.txt TLE 2208 ms 19284 KB
02_maximum_11.txt TLE 2208 ms 19232 KB
02_maximum_12.txt TLE 2208 ms 19248 KB
02_maximum_13.txt TLE 2208 ms 19244 KB
02_maximum_14.txt TLE 2208 ms 19328 KB
02_maximum_15.txt TLE 2208 ms 19236 KB
02_maximum_16.txt TLE 2208 ms 19164 KB
02_maximum_17.txt TLE 2208 ms 19272 KB
02_maximum_18.txt TLE 2208 ms 19248 KB
02_maximum_19.txt TLE 2208 ms 19244 KB
02_maximum_20.txt TLE 2208 ms 19252 KB
02_maximum_21.txt TLE 2208 ms 19256 KB
02_maximum_22.txt TLE 2208 ms 19156 KB
02_maximum_23.txt TLE 2208 ms 19252 KB
02_maximum_24.txt TLE 2208 ms 19248 KB
02_maximum_25.txt TLE 2208 ms 19192 KB
02_maximum_26.txt TLE 2208 ms 19292 KB
02_maximum_27.txt TLE 2208 ms 19284 KB


2025-03-05 (Wed)
18:12:02 +00:00