QOJ.ac
QOJ
ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#463553 | #7302. Walk of Length 6 | Lynkcat | Compile Error | / | / | C++20 | 1.8kb | 2024-07-05 00:09:06 | 2024-07-05 00:09:08 |
Judging History
answer
先睡觉了,你妈的#include<bits/stdc++.h>
#define poly vector<int>
#define IOS ios::sync_with_stdio(false)
#define ll long long
#define mp make_pair
#define mt make_tuple
#define pa pair < int,int >
#define fi first
#define se second
#define inf 1e18
#define mod 998244353
#define sz(x) (int)((x).size())
#define int ll
//#define N
using namespace std;
const int N=1005;
int n;
bitset<N>a[N];
int du[N];
void BellaKira()
{
for (int i=1;i<=n;i++) du[i]=0;
int ans=0;
for (int i=1;i<=n;i++)
for (int j=1;j<=n;j++)
{
char c;
cin>>c;
a[i][j]=c-'0';
}
for (int i=1;i<=n;i++)
for (int j=1;j<=n;j++)
du[i]+=a[i][j];
//(1,5) -(1,5) (2,4)
for (int i=1;i<=n;i++)
{
int t=0,p=0;
for (int j=1;j<=n;j++)
if (a[i][j])
{
int x=(a[i]&a[j]).count();
ans+=x*(x-1)*du[i];
}
}
// cout<<"?"<<ans<<endl;
//(1,3)+(3,5)+(2,4) -(1,3)(2,4) -(2,4)(3,5)
for (int i=1;i<=n;i++)
{
int t=0,p=0;
for (int j=1;j<=n;j++)
{
int tp=(a[i]&a[j]).count();
ans=(ans+du[j]*tp*tp*3);
ans=(ans-tp*tp*2);
}
}
// cout<<"?"<<ans<<endl;
//-2*(1,3)(1,5)(3,5)
for (int i=1;i<=n;i++)
{
for (int j=1;j<=n;j++)
if (a[i][j])
{
ans-=2*du[j]*du[j];
}
}
// cout<<"?"<<ans<<endl;
//(1,4)+(2,5)
for (int i=1;i<=n;i++)
{
int t=0;
for (int j=1;j<=n;j++)
if (a[i][j])
{
int tp=(a[i]&a[j]).count();
t+=tp;
}
ans+=t*t*2;
}
// cout<<"?"<<ans<<endl;
//-(1,4)(3,5)*3
for (int i=1;i<=n;i++)
{
int t=0;
for (int j=1;j<=n;j++)
if (a[i][j])
{
int tp=(a[i]&a[j]).count();
ans-=tp*tp*3;
}
}
// cout<<"?"<<ans<<endl;
cout<<ans<<'\n';
}
signed main()
{
IOS;
cin.tie(0);
int T=1;
while (cin>>n)
{
BellaKira();
}
}
详细
answer.code:1:17: error: stray ‘#’ in program 1 | 先睡觉了,你妈的#include<bits/stdc++.h> | ^ answer.code:1:1: error: ‘先睡觉了,你妈的’ does not name a type 1 | 先睡觉了,你妈的#include<bits/stdc++.h> | ^~~~~~~~~~~~~~~~ answer.code:18:1: error: ‘bitset’ does not name a type 18 | bitset<N>a[N]; | ^~~~~~ answer.code: In function ‘void BellaKira()’: answer.code:28:25: error: ‘cin’ was not declared in this scope 28 | cin>>c; | ^~~ answer.code:29:25: error: ‘a’ was not declared in this scope 29 | a[i][j]=c-'0'; | ^ answer.code:33:32: error: ‘a’ was not declared in this scope 33 | du[i]+=a[i][j]; | ^ answer.code:39:29: error: ‘a’ was not declared in this scope 39 | if (a[i][j]) | ^ answer.code:52:33: error: ‘a’ was not declared in this scope 52 | int tp=(a[i]&a[j]).count(); | ^ answer.code:62:29: error: ‘a’ was not declared in this scope 62 | if (a[i][j]) | ^ answer.code:73:29: error: ‘a’ was not declared in this scope 73 | if (a[i][j]) | ^ answer.code:87:29: error: ‘a’ was not declared in this scope 87 | if (a[i][j]) | ^ answer.code:95:9: error: ‘cout’ was not declared in this scope 95 | cout<<ans<<'\n'; | ^~~~ answer.code: In function ‘int main()’: answer.code:3:13: error: ‘ios’ has not been declared 3 | #define IOS ios::sync_with_stdio(false) | ^~~ answer.code:100:9: note: in expansion of macro ‘IOS’ 100 | IOS; | ^~~ answer.code:101:9: error: ‘cin’ was not declared in this scope 101 | cin.tie(0); | ^~~