QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#73301#1297. Hard DrivexinchengoWA 2ms3328kbC++14637b2023-01-23 16:53:272023-01-23 16:53:29

Judging History

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

  • [2023-08-10 23:21:45]
  • System Update: QOJ starts to keep a history of the judgings of all the submissions.
  • [2023-01-23 16:53:29]
  • 评测
  • 测评结果:WA
  • 用时:2ms
  • 内存:3328kb
  • [2023-01-23 16:53:27]
  • 提交

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