QOJ.ac
QOJ
ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#73301 | #1297. Hard Drive | xinchengo | WA | 2ms | 3328kb | C++14 | 637b | 2023-01-23 16:53:27 | 2023-01-23 16:53:29 |
Judging History
answer
#include<iostream>
#include<algorithm>
using namespace std;
enum limits
{
maxn = 500'000
};
int n, c, b;
bool isb[maxn + 7];
char sta[maxn + 7];
int main()
{
cin.tie(nullptr)->sync_with_stdio(false);
cin >> n >> c >> b;
fill_n(sta+1, n, '0');
sta[n+1] = '\n', sta[n+2] = '\0';
for(int i=1; i<=b; i++)
{
int t;
cin >> t;
isb[t] = true;
}
int cnt = 0;
if(c & 1)
cnt = 1, sta[1] = '1';
int p = 2;
while(cnt < c)
{
while(isb[p])
p++;
sta[p] = '1', cnt += 2, p += 2;
}
cout << (sta + 1);
}
详细
Test #1:
score: 100
Accepted
time: 0ms
memory: 3328kb
input:
2 1 1 2
output:
10
result:
ok
Test #2:
score: -100
Wrong Answer
time: 2ms
memory: 3324kb
input:
9 7 3 4 5 9
output:
110001010
result:
wrong answer Wrong answer, expected entropy 7, but was 5