QOJ.ac
QOJ
ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#572372 | #9308. World Cup | OIer_kzc | WA | 0ms | 1472kb | C++14 | 840b | 2024-09-18 14:03:15 | 2024-09-18 14:03:16 |
Judging History
answer
#include <stdio.h>
#include <string.h>
#include <bitset>
#include <vector>
#include <algorithm>
#define LOG(FMT...) fprintf(stderr, FMT)
#define eb emplace_back
using namespace std;
typedef long long LL;
constexpr int N = 1000005;
char gc() {
static char buf[1 << 21], *p1 = buf, *p2 = buf;
return (p1 == p2 && (p2 = (p1 = buf) + fread(buf, 1, 1 << 21, stdin), p1 == p2) ? -1 : *p1++);
}
int read() {
int x = 0; char c = gc();
while (c < 48 || c > 57) {
c = gc();
}
for (; c > 47 && c < 58; c = gc()) {
x = x * 10 + (c ^ 48);
}
return x;
}
int main() {
for (int task = read(); task--; ) {
int x = read(), c = 0;
for (int i = 1; i < 32; ++i) {
c += (read() < x);
}
printf("%d\n", (c >= 31 ? 1 : c >= 15 ? 2 : c >= 7 ? 4 : c >= 6 ? 8 : c >= 2 ? 16 : 32));
}
return 0;
}
详细
Test #1:
score: 100
Accepted
time: 0ms
memory: 1468kb
input:
1 32 31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1
output:
1
result:
ok 1 number(s): "1"
Test #2:
score: -100
Wrong Answer
time: 0ms
memory: 1472kb
input:
32 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 2 1 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 3 1 2 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 4 1 2 3 5 6 7 8 9 10 11 12 13 14 15 ...
output:
32 32 16 16 16 16 8 4 4 4 4 4 4 4 4 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 1
result:
wrong answer 8th numbers differ - expected: '8', found: '4'