QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#438367#5475. Make a Loopgrass8cow#WA 1ms4140kbC++17393b2024-06-10 16:43:122024-06-10 16:43:13

Judging History

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

  • [2024-06-10 16:43:13]
  • 评测
  • 测评结果:WA
  • 用时:1ms
  • 内存:4140kb
  • [2024-06-10 16:43:12]
  • 提交

answer

#include<bits/stdc++.h>
using namespace std;
int n,a[110];
const int V=1e6;
bitset<501000>f[110];
int main(){
    scanf("%d",&n);int h=0;
    for(int i=1;i<=n;i++)scanf("%d",&a[i]),h+=a[i];
    f[0][0]=1;
    int t=(n/4)*2;
    for(int i=1;i<=n;i++)
        for(int j=min(i-1,t);j>=0;j--)f[j+1]|=(f[j]<<a[i]);
    if(!(h&1)&&f[t][h/2])puts("Yes");else puts("No");
    return 0;
}

詳細信息

Test #1:

score: 100
Accepted
time: 1ms
memory: 4140kb

input:

4
1 1 1 1

output:

Yes

result:

ok single line: 'Yes'

Test #2:

score: 0
Accepted
time: 1ms
memory: 3968kb

input:

6
1 3 1 3 1 3

output:

Yes

result:

ok single line: 'Yes'

Test #3:

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

input:

6
2 2 1 1 1 1

output:

Yes

result:

wrong answer 1st lines differ - expected: 'No', found: 'Yes'