QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#325928#5590. Exponent Exchangeanpans#WA 0ms3596kbC++14427b2024-02-12 04:39:242024-02-12 04:39:24

Judging History

This is the latest submission verdict.

  • [2024-02-12 04:39:24]
  • Judged
  • Verdict: WA
  • Time: 0ms
  • Memory: 3596kb
  • [2024-02-12 04:39:24]
  • Submitted

answer

#include <iostream>
#include <vector>
#include <algorithm>
#include <cstdio>

using namespace std;

int b, p, x;

int main() {
    cin >> b >> p;
    int min = 0;
    while (p-- > 0) {
        cin >> x;
        if (p == 0) {
            if (x > b / 2) min += b - x;
        } else 
        if (x > (b - 1) / 2) min += b - 1 - x;
        else min += x;
    }
    cout << min / 2 +1 << endl;
    return 0;
}

詳細信息

Test #1:

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

input:

10 5
4 2 7 8 6

output:

7

result:

ok single line: '7'

Test #2:

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

input:

2 100
1 1 1 1 0 0 1 1 1 0 1 1 1 0 0 1 0 0 1 0 0 1 1 1 0 1 1 0 1 1 1 1 0 1 0 0 1 0 1 0 1 0 1 0 1 0 1 0 0 1 0 1 0 1 0 1 1 0 1 0 0 1 1 0 1 0 0 0 1 0 1 0 1 0 0 1 1 0 0 0 0 1 0 1 1 1 1 0 1 1 0 1 1 0 0 0 0 1 1 1

output:

1

result:

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