QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#817024#9870. ItemsCoffinsWA 1ms3620kbC++14529b2024-12-16 19:49:282024-12-16 19:49:28

Judging History

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

  • [2024-12-16 19:49:28]
  • 评测
  • 测评结果:WA
  • 用时:1ms
  • 内存:3620kb
  • [2024-12-16 19:49:28]
  • 提交

answer

#include<bits/stdc++.h>
using namespace std;
const int N=55;
int n,m;
int f[N][N*N];
void solve()
{
    cin>>n>>m;f[0][0]=1;
    for(int i=1;i<=n;i++)
    for(int j=0;j<=m;j++)
    f[i][j]=0;
    for(int i=1;i<=n;i++)
    {
        int c;cin>>c;
        for(int j=1;j<=i;j++)
        for(int t=c;t<=m;t++)
        f[j][t]|=f[j-1][t-c];
    }if(f[n][m])cout<<"Yes\n";
    else cout<<"No\n";
}
int main()
{
    ios::sync_with_stdio(0);cin.tie(0);cout.tie(0);
    int t;cin>>t;while(t--)solve();return 0;
}

详细

Test #1:

score: 100
Accepted
time: 0ms
memory: 3612kb

input:

4
5 25
0 0 0 0 5
5 11
4 4 4 5 5
5 0
1 2 3 4 5
5 25
0 1 2 3 4

output:

Yes
No
No
No

result:

ok 4 token(s): yes count is 1, no count is 3

Test #2:

score: -100
Wrong Answer
time: 1ms
memory: 3620kb

input:

1314
1 0
0
1 0
1
1 1
0
1 1
1
2 0
0 0
2 0
0 1
2 0
0 2
2 0
1 0
2 0
1 1
2 0
1 2
2 0
2 0
2 0
2 1
2 0
2 2
2 1
0 0
2 1
0 1
2 1
0 2
2 1
1 0
2 1
1 1
2 1
1 2
2 1
2 0
2 1
2 1
2 1
2 2
2 2
0 0
2 2
0 1
2 2
0 2
2 2
1 0
2 2
1 1
2 2
1 2
2 2
2 0
2 2
2 1
2 2
2 2
2 3
0 0
2 3
0 1
2 3
0 2
2 3
1 0
2 3
1 1
2 3
1 2
2 3
2 0...

output:

Yes
No
No
Yes
Yes
No
No
Yes
No
No
Yes
No
No
No
Yes
No
Yes
No
No
No
No
No
No
Yes
Yes
No
Yes
No
Yes
Yes
No
No
No
No
No
No
Yes
No
Yes
No
No
No
Yes
No
No
Yes
No
No
Yes
Yes
No
No
No
Yes
No
No
No
Yes
No
No
No
Yes
No
No
No
Yes
No
No
No
Yes
No
No
No
Yes
No
No
No
Yes
No
No
No
Yes
No
No
No
Yes
No
No
No
Yes
No...

result:

wrong answer expected YES, found NO [6th token]