QOJ.ac
QOJ
ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#876558 | #2325. Corns | panzy | Compile Error | / | / | C++20 | 371b | 2025-01-31 00:00:28 | 2025-01-31 00:00:28 |
Judging History
This is the latest submission verdict.
- [2025-01-31 00:00:28]
- Judged
- Verdict: Compile Error
- Time: 0ms
- Memory: 0kb
- [2025-01-31 00:00:28]
- Submitted
answer
#include <bits/stdc++.h>
using namespace std;
int main() {
int n, w; cin >> n >> W;
bitset<2e5+1> dp;
dp[0] = 1;
for (int i = 1; i <= n; i ++) {
int x; cin >> x;
dp |= (dp << x);
}
for (int i = 2e5; i >= 0; i --) {
if (dp[i]) {
return cout << i << "\n",0;
}
}
return 0;
}
詳細信息
answer.code: In function ‘int main()’: answer.code:5:29: error: ‘W’ was not declared in this scope 5 | int n, w; cin >> n >> W; | ^ answer.code:6:15: error: conversion from ‘double’ to ‘long unsigned int’ in a converted constant expression 6 | bitset<2e5+1> dp; | ~~~^~ answer.code:6:15: error: could not convert ‘(2.0e+5 + (double)1)’ from ‘double’ to ‘long unsigned int’ 6 | bitset<2e5+1> dp; | ~~~^~ | | | double answer.code:8:7: error: invalid types ‘int[int]’ for array subscript 8 | dp[0] = 1; | ^ answer.code:15:15: error: invalid types ‘int[int]’ for array subscript 15 | if (dp[i]) { | ^