QOJ.ac
QOJ
ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#537403 | #5252. Deforestation | UESTC_DECAYALI# | WA | 11ms | 3768kb | C++20 | 615b | 2024-08-30 12:47:24 | 2024-08-30 12:47:24 |
Judging History
answer
#include<cstdio>
#include<iostream>
#include<vector>
#include<algorithm>
#define RI register int
#define CI const int&
using namespace std;
int W,ans;
inline int DFS(void)
{
int x,y; scanf("%d%d",&x,&y);
vector <int> vec(y);
for (RI i=0;i<y;++i)
{
int tmp=DFS(); ans+=tmp/W; vec[i]=tmp%W;
}
sort(vec.begin(),vec.end());
int sum=0;
for (RI i=0;i<y;++i)
if (sum+vec[i]<=W) sum+=vec[i]; else ++ans;
if (sum!=0) ++ans,x=max(0,x-(W-sum));
return x;
}
int main()
{
scanf("%d",&W);
ans+=(DFS()+W-1)/W;
return printf("%d",ans),0;
}
詳細信息
Test #1:
score: 0
Wrong Answer
time: 11ms
memory: 3768kb
input:
999900000 7339 3 14947 2 12850 3 8986 10 11599 9 8889 10 10711 4 8015 1 11626 0 9492 1 7017 0 8863 0 8632 0 5321 5 9906 0 11687 0 9845 0 10469 0 11708 0 14950 5 11934 0 11922 0 13101 0 12000 0 9082 0 9273 5 12296 0 6119 0 9201 0 12652 0 12957 0 7454 5 12515 0 12976 0 10358 0 13997 0 8371 0 10181 5 8...
output:
31899
result:
wrong answer 1st lines differ - expected: '1', found: '31899'