记录详情

Time Exceeded


  
# 状态 耗时 内存占用
#1 Accepted 1ms 212.0 KiB
#2 Accepted 1ms 228.0 KiB
#3 Accepted 21ms 1.059 MiB
#4 Accepted 2ms 228.0 KiB
#5 Accepted 2ms 344.0 KiB
#6 Wrong Answer 1ms 216.0 KiB
#7 Wrong Answer 1ms 216.0 KiB
#8 Accepted 36ms 1.707 MiB
#9 Accepted 63ms 3.184 MiB
#10 Accepted 615ms 33.102 MiB
#11 Accepted 744ms 33.164 MiB
#12 Time Exceeded ≥1001ms ≥33.164 MiB
#13 Time Exceeded ≥1001ms ≥62.273 MiB
#14 Time Exceeded ≥1003ms ≥65.125 MiB
#15 Wrong Answer 5ms 580.0 KiB
#16 Wrong Answer 5ms 632.0 KiB
#17 Wrong Answer 9ms 1008.0 KiB
#18 Wrong Answer 9ms 1.012 MiB
#19 Wrong Answer 10ms 972.0 KiB
#20 Wrong Answer 8ms 1020.0 KiB

代码

#include<bits/stdc++.h>
#include<algorithm>
using namespace std;
const int maxn=100010,maxm=7e6+10;
long long int u,v,q,a[maxn],t,n,m;

inline int read(){
	int x=0,f=1;
	char c=getchar();
	while(c>'9'||c<'0'){
		if(c=='-')f=-1;
		c=getchar();
	}
	while(c>='0'&&c<='9'){
		x=((x<<1)+(x<<3))+c-'0';
		c=getchar();
	}
	return x*f;
}

inline void Init(){
	n=read(),m=read(),q=read(),u=read(),v=read(),t=read();
	for(int i=1;i<=n;i++)a[i]=read();
}

inline void Work(){
	priority_queue<long long int> p;
	if(m==0){
		sort(a+1,a+1+n);
		printf("\n");
		for(int i=n;i>=1;i--){
			printf("%lld ",a[i]);
		}
	}
	else if(q==0){
		for(int i=1;i<=n;i++)p.push(a[i]);
		for(int i=1;i<=m;i++){
			long long int x=p.top();p.pop();
			p.push(x*u/v),p.push(x-x*u/v);
			if(i%t==0){
				printf("%lld ",x);
			}
		}
		int i=1;
		printf("\n");
		while(p.size()){
			long long int x=p.top();p.pop();
			if(i%t==0){
				printf("%lld ",x);
			}
			i++;
		}
	}
	else{
		
	}
}

int main(){
	Init();
	Work();
	return 0;
}

信息

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