QOJ.ac
QOJ
ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#697330 | #3837. The Matching System | yzj123# | WA | 4ms | 11460kb | C++20 | 1.3kb | 2024-11-01 13:12:43 | 2024-11-01 13:12:45 |
Judging History
answer
#include<bits/stdc++.h>
using namespace std;
#define ll long long
ll mod=1e9+7;
ll C[1005][1005];
int main()
{
ll n;cin>>n;
ll k=0;if(n%2==1)k=1;
else k=2;
ll temp=n+1;
ll ans=0;
if(n==1)
{
cout<<1<<endl;
cout<<0<<endl;
cout<<2<<endl;
cout<<1<<endl;
cout<<0<<endl;
cout<<2<<endl;
return 0;
}
if(n==2)
{
cout<<"*1"<<endl;
cout<<"01"<<endl;
cout<<3<<endl;
cout<<"*1"<<endl;
cout<<"01"<<endl;
cout<<4<<endl;
return 0;
}
C[0][0] = 1;
for (int i = 1; i <= 1000; i++)
{
C[i][0] = 1;
for (int j = 1; j <= 1000; j++)
C[i][j] = (C[i - 1][j - 1] + C[i - 1][j]) % mod;
}
for(int i= 1;i<=temp-3;++i)
{
ans=(ans+C[temp+i-1][i])%mod;
}
ans=ans+C[temp+temp-4][temp-3]-C[temp+temp-5][temp-4]+1;
for(int i=1;i<=n-2;++i)cout<<'*';
cout<<0<<'*'<<endl;
cout<<0;
for(int i=2;i<=n;++i)cout<<1;
cout<<endl;
cout<<ans<<endl;
//2
ll m=(n-k)/2;
ans=(m+k+1)*m%mod+m+m+k+k;
ans=ans%mod;
for(int i=1;i<=m+k;++i)cout<<'*';
for(int i=1;i<=m;++i)cout<<1;
cout<<endl;
for(int i=1;i<=n;++i)cout<<1;
cout<<endl;
cout<<ans<<endl;
}
詳細信息
Test #1:
score: 100
Accepted
time: 4ms
memory: 11460kb
input:
3
output:
*0* 011 8 **1 111 7
result:
ok Accepted
Test #2:
score: -100
Wrong Answer
time: 0ms
memory: 3684kb
input:
1
output:
1 0 2 1 0 2
result:
wrong answer The matching result in the maximum mathing method is not 'Yes'