/ SB域 /

记录详情

Wrong Answer

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' is used uninitialized in this function [-Wuninitialized]
   24 |   time1+=time;
      |   ~~~~~^~~~~~
[Hydro](https://hydro.ac)提供评测服务
# 状态 耗时 内存占用
#1 Wrong Answer 1a2,10000 > 1714 > 1541 > 17 3ms 384.0 KiB
#2 Wrong Answer 1a2,10000 > 1095 > 115 > 279 3ms 384.0 KiB
#3 Wrong Answer 1a2,10000 > 1507 > 2573 > 11 3ms 384.0 KiB
#4 Wrong Answer 2a3,10000 > 1230 > 2243 > 12 2ms 384.0 KiB
#5 Wrong Answer 1a2,10000 > 396 > 1474 > 117 6ms 384.0 KiB
#6 Wrong Answer 2a3,10000 > 2723 > 1094 > 26 5ms 384.0 KiB
#7 Wrong Answer 1a2,10000 > 364 > 2001 > 193 4ms 384.0 KiB
#8 Wrong Answer 1a2,10000 > 2855 > 2855 > 10 4ms 384.0 KiB
#9 Wrong Answer 1a2,10000 > 640 > 944 > 640 8ms 384.0 KiB
#10 Wrong Answer 0a1,4752 > 1330 > 2716 > 133 8ms 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:42:52
评测时间
2022-07-12 09:01:10
评测机
分数
0
总耗时
50ms
峰值内存
384.0 KiB