QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#674770#7744. ElevatorlselegiesWA 1ms3696kbC++14561b2024-10-25 17:24:582024-10-25 17:24:59

Judging History

你现在查看的是最新测评结果

  • [2024-10-25 17:24:59]
  • 评测
  • 测评结果:WA
  • 用时:1ms
  • 内存:3696kb
  • [2024-10-25 17:24:58]
  • 提交

answer

#include<bits/stdc++.h>
#define int long long
using namespace std;
const int N=1e5+1;
int f[N];
signed main()
{
	int t;
	cin>>t;
	int n,k,maxh=0;
	while(t--)
	{
		
		memset(f,0,maxh);
		maxh=0;
		cin>>n>>k;
		for (int i=1;i<=n;i++)
		{
			int s,v,h;
			cin>>s>>v>>h;
			f[h]+=s*v;
			maxh=max(maxh,h);
		}
		int res=0,ans=0;
		for (int i=maxh;i>=1;i--)
		{
			if (f[i])
			{
				if (f[i]>res)
				{
					f[i]-=res;
					ans+=(f[i]+k-1)/k*i;
					res=k-(f[i]%k);
				}
				else res-=f[i];
			}
		}
		cout<<ans<<endl;
	}
 } 

详细

Test #1:

score: 0
Wrong Answer
time: 1ms
memory: 3696kb

input:

2
4 6
1 1 8
7 2 5
1 1 7
3 2 6
8 1200000
100000 1 100000
100000 1 12345
100000 2 100000
100000 2 12345
100000 1 100000
100000 1 12345
100000 2 100000
100000 2 12345

output:

24
100008

result:

wrong answer 2nd lines differ - expected: '100000', found: '100008'