记录详情

Time Exceeded


  
# 状态 耗时 内存占用
#1 Accepted 1ms 224.0 KiB
#2 Accepted 1ms 228.0 KiB
#3 Accepted 29ms 1.367 MiB
#4 Accepted 1ms 224.0 KiB
#5 Accepted 2ms 216.0 KiB
#6 Accepted 1ms 216.0 KiB
#7 Accepted 1ms 216.0 KiB
#8 Accepted 34ms 1.418 MiB
#9 Accepted 58ms 2.418 MiB
#10 Accepted 552ms 32.422 MiB
#11 Accepted 668ms 32.316 MiB
#12 Accepted 966ms 32.316 MiB
#13 Time Exceeded ≥1001ms ≥64.418 MiB
#14 Time Exceeded ≥1001ms ≥64.34 MiB
#15 Accepted 35ms 1.426 MiB
#16 Accepted 58ms 2.414 MiB
#17 Accepted 56ms 2.367 MiB
#18 Accepted 128ms 4.348 MiB
#19 Time Exceeded ≥1001ms ≥32.379 MiB
#20 Time Exceeded ≥1004ms ≥64.336 MiB

代码

#include<bits/stdc++.h>
#define ll long long 
using namespace std;
const int maxn=100010;
int n,m,q,u,v,t;
ll s;
priority_queue<ll> Q;

long long read()
{
  ll x=0ll; char c=getchar();
  while(c<'0' || c>'9') c=getchar();
  while(c>='0' && c<='9')
    x=(x<<1)+(x<<3)+c-'0',c=getchar();
  return x;
} 

int main()
{
  scanf("%d %d %d %d %d %d",&n,&m,&q,&u,&v,&t);
  for(int i=1;i<=n;i++)
    Q.push(read());
  for(int i=1;i<=m;i++)
  {
  	ll x=Q.top()+s;
  	Q.pop();
  	ll xa=x*u/v;
  	ll xb=x-xa;
  	if(i%t==0) printf("%lld ",x);
  	xa-=s,xb-=s;
  	xa-=q,xb-=q;
  	Q.push(xa),Q.push(xb);
  	s+=q;
  }
  printf("\n");
  int i=1;
  while(!Q.empty())
  {
  	if(i%t==0) printf("%lld ",Q.top()+s);
  	Q.pop();
	i++;
  }
  printf("\n");
  return 0;
}

信息

递交者
类型
递交
题目
P1007 蚯蚓
比赛
随机真题赛第三轮(xhy&lfy讲题)
题目数据
下载
语言
C++
递交时间
2019-11-12 16:34:50
评测时间
2019-11-12 16:34:50
评测机
分数
80
总耗时
≥6608ms
峰值内存
≥64.418 MiB