/ SB域 /

记录详情

Time Exceeded

foo.cc: In function 'int main()':
foo.cc:10:8: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
   10 |   scanf("%s",st);
      |   ~~~~~^~~~~~~~~
foo.cc:24:8: warning: 'time1' may be used uninitialized in this function [-Wmaybe-uninitialized]
   24 |   time1+=time;
      |   ~~~~~^~~~~~
正在同步测试数据,请稍后
[Hydro](https://hydro.ac)提供评测服务
# 状态 耗时 内存占用
#1 Time Exceeded ≥1100ms ≥384.0 KiB
#2 Wrong Answer Read 1131, expect 1095. 40ms 512.0 KiB
#3 Wrong Answer Read 1337, expect 980. 17ms 384.0 KiB
#4 Wrong Answer Read 2691, expect 1230. 36ms 384.0 KiB
#5 Time Exceeded ≥1101ms ≥384.0 KiB
#6 Time Exceeded ≥1101ms ≥384.0 KiB
#7 Time Exceeded ≥1100ms ≥384.0 KiB
#8 Wrong Answer Read 2606, expect 2855. 35ms 384.0 KiB
#9 Wrong Answer Read 2658, expect 640. 18ms 384.0 KiB
#10 Time Exceeded ≥1100ms ≥384.0 KiB

代码

#include <bits/stdc++.h>
using namespace std;
struct l{
	int  Q_num,Per_iod;
}x[10001];
int main(){
	char st[20];
	int b,t=0,m=0,time=100000000,time1;
	for(int i=1;i<=10001;i++){
		scanf("%s",st);
		if(st[0]=='#')
		{
			break; 
		}
		else
		{
			cin>>x[i].Q_num>>x[i].Per_iod;
			time=min(time,x[i].Per_iod);
			t++;
		}
	}
	cin>>b;
	while(m<b){
		time1+=time;
		for(int i=t;i>=1;i--){
			if(time1>=x[i].Per_iod){
				cout<<x[i].Q_num<<endl;
				x[i].Per_iod+=x[i].Per_iod;
				m++;
			}
		}
	}
	return 0;
}

信息

递交者
类型
递交
题目
桐桐的新闻系统
题目数据
下载
语言
C++
递交时间
2022-07-12 08:38:03
评测时间
2022-07-12 08:38:03
评测机
分数
0
总耗时
≥5653ms
峰值内存
≥512.0 KiB