QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#697355#3837. The Matching System yzj123#WA 5ms11480kbC++201.3kb2024-11-01 13:29:062024-11-01 13:29:07

Judging History

你现在查看的是最新测评结果

  • [2024-11-01 13:29:07]
  • 评测
  • 测评结果:WA
  • 用时:5ms
  • 内存:11480kb
  • [2024-11-01 13:29:06]
  • 提交

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<<1<<endl;
        cout<<1<<endl;
        cout<<1<<endl;
        cout<<1<<endl;
        cout<<1<<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;
    ans=ans%mod;
    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: 5ms
memory: 11480kb

input:

3

output:

*0*
011
8
**1
111
7

result:

ok Accepted

Test #2:

score: -100
Wrong Answer
time: 0ms
memory: 3608kb

input:

1

output:

1
1
1
1
1
1

result:

wrong answer Your enery cost in the minimum mathing method is not the best