提交记录 47620
| 用户 | 题目 | 状态 | 得分 | 用时 | 内存 | 语言 | 代码长度 |
|---|---|---|---|---|---|---|---|
| jiegec | noi17e. 【NOI2017】蔬菜 | Accepted | 100 | 45.235 ms | 16268 KB | C++17 | 1.44 KB |
| 提交时间 | 评测时间 |
|---|---|
| 2026-09-13 00:45:44 | 2026-09-13 00:45:52 |
// This code is AI-generated. (AI 生成的代码)
#include<bits/stdc++.h>
#define LL long long
#define RG register
#define R RG int
#define G if(++ip==ie)fread(ip=buf,1,N,stdin)
using namespace std;
const int N=2e5+9,M=1e6+9;
char buf[N],*ie=buf+N,*ip=ie-1;
int p[N],f[M];LL ans[M];
inline int in(){
G;while(*ip<'-')G;
R x=*ip&15;G;
while(*ip>'-'){x*=10;x+=*ip&15;G;}
return x;
}
struct Veg{
int a,c,x;
inline bool operator<(RG Veg&b){
return a>b.a;
}
}v[N];
int getf(R x){
return x==f[x]?x:f[x]=getf(f[x]);
}
int main(){
R n=in(),m=in(),k=in(),i,l=0;
for(i=1;i<=n;++i){
v[i].a=in();v[i+n].a=v[i].a+in();
v[i].c=in()-1;v[i+n].c=1;
if((v[i].x=in()))v[i+n].x=-(v[i].c/v[i].x+1);
}
for(i=1;i<=k;++i)l=max(l,p[i]=in());
R tot=l*m,j=1,t=0,x;
for(i=1;i<=tot;++i)f[i]=i;
sort(v+1,v+(n*=2)+1);
for(i=1;i<=n;++i){
//printf("a%d c%d x%d\n",v[i].a,v[i].c,v[i].x);
while(v[i].c){
--v[i].c;
x=v[i].x==0?tot:min((v[i].x>0?(v[i].c/v[i].x+1):-v[i].x)*m,tot);
//printf("x%d ",x);
x=getf(x);
//printf("f%d\n",x);
if(!x)break;
//puts("get");
--f[f[x]];ans[j]+=v[i].a;
if(++t==m){
if(++j>tot)goto F;
t=0;ans[j]=ans[j-1];
}
}
}
F:for(++j;j<=tot;++j)ans[j]=ans[j-1];
for(i=1;i<=k;++i)printf("%lld\n",ans[p[i]]);
return 0;
}
| Compilation | N/A | N/A | Compile OK | Score: N/A | 显示更多 |
| Testcase #1 | 279.83 us | 184 KB | Accepted | Score: 4 | 显示更多 |
| Testcase #2 | 328.46 us | 188 KB | Accepted | Score: 4 | 显示更多 |
| Testcase #3 | 312.12 us | 188 KB | Accepted | Score: 4 | 显示更多 |
| Testcase #4 | 157.24 us | 104 KB | Accepted | Score: 4 | 显示更多 |
| Testcase #5 | 156.66 us | 104 KB | Accepted | Score: 4 | 显示更多 |
| Testcase #6 | 160.19 us | 104 KB | Accepted | Score: 4 | 显示更多 |
| Testcase #7 | 39.99 us | 56 KB | Accepted | Score: 4 | 显示更多 |
| Testcase #8 | 37.63 us | 56 KB | Accepted | Score: 4 | 显示更多 |
| Testcase #9 | 39.58 us | 56 KB | Accepted | Score: 4 | 显示更多 |
| Testcase #10 | 39.96 us | 56 KB | Accepted | Score: 4 | 显示更多 |
| Testcase #11 | 44.83 us | 56 KB | Accepted | Score: 4 | 显示更多 |
| Testcase #12 | 83.58 us | 68 KB | Accepted | Score: 4 | 显示更多 |
| Testcase #13 | 74.44 us | 68 KB | Accepted | Score: 4 | 显示更多 |
| Testcase #14 | 85.86 us | 72 KB | Accepted | Score: 4 | 显示更多 |
| Testcase #15 | 86.4 us | 72 KB | Accepted | Score: 4 | 显示更多 |
| Testcase #16 | 424.67 us | 228 KB | Accepted | Score: 4 | 显示更多 |
| Testcase #17 | 521.58 us | 228 KB | Accepted | Score: 4 | 显示更多 |
| Testcase #18 | 438.72 us | 236 KB | Accepted | Score: 4 | 显示更多 |
| Testcase #19 | 542.13 us | 240 KB | Accepted | Score: 4 | 显示更多 |
| Testcase #20 | 548 us | 240 KB | Accepted | Score: 4 | 显示更多 |
| Testcase #21 | 44.474 ms | 15 MB + 868 KB | Accepted | Score: 4 | 显示更多 |
| Testcase #22 | 43.256 ms | 15 MB + 908 KB | Accepted | Score: 4 | 显示更多 |
| Testcase #23 | 45.235 ms | 15 MB + 872 KB | Accepted | Score: 4 | 显示更多 |
| Testcase #24 | 44.78 ms | 15 MB + 880 KB | Accepted | Score: 4 | 显示更多 |
| Testcase #25 | 44.989 ms | 15 MB + 880 KB | Accepted | Score: 4 | 显示更多 |
Judge Duck Online | 评测鸭在线
Server Time: 2026-09-24 19:04:35 | Loaded in 1 ms | Server Status
个人娱乐项目,仅供学习交流使用 | 捐赠