QOJ.ac
QOJ
ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#685038 | #8284. Cats and Fish | Joyeuse_Ordre# | WA | 0ms | 3892kb | C++14 | 1.2kb | 2024-10-28 17:14:45 | 2024-10-28 17:14:46 |
Judging History
answer
#include <bits/stdc++.h>
using namespace std;
inline int read() {
int x = 0, f = 1;
char ch = getchar();
while (!isdigit(ch)) {
if (ch == '-')
f = -1;
ch = getchar();
}
while (isdigit(ch)) {
x = x * 10 + ch - '0';
ch = getchar();
}
return x * f;
}
const int maxn = 1e5 + 5;
int n, m, x;
int c[maxn], nextfintime[maxn];
int main() {
m = read(); n = read(); x = read();
for (int i = 1; i <= n; i++)
c[i] = read();
sort(c + 1, c + n + 1);
for (int i = 0; i <= x; i++) {
for (int j = 1; j <= n; j++) {
if (nextfintime[j]) nextfintime[j]--;
if (!nextfintime[j] && m) {
nextfintime[j] = c[j];
m--;
}
}
// printf("time: %d\n", i);
// for (int j = 1; j <= n; j++) {
// printf("cat %d: %d\n", j, nextfintime[j]);
// }
}
int imcomcnt = 0;
for (int i = 1; i <= n; i++)
if (nextfintime[i]) {
imcomcnt++;
// cout << i << ' ' << nextfintime[i] << " ";
}
printf("%d %d\n", m, imcomcnt);
return 0;
}
详细
Test #1:
score: 0
Wrong Answer
time: 0ms
memory: 3892kb
input:
2 1 1 1
output:
0 1
result:
wrong answer 1st numbers differ - expected: '1', found: '0'