답안 #1041411

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
1041411 2024-08-02T03:22:17 Z Muhammad_Aneeq Segway (COI19_segway) C++17
0 / 100
18 ms 600 KB
/*
بسم الله الرحمن الرحيم
Author:
                          (:Muhammad Aneeq:)
*/

#include <iostream>
#include <queue>
#include <map>
#include <vector>
using namespace std;
int const M=400,N=2e4+10;
int sp[N]={};
bool acc[M]={};
inline void solve()
{
	int n;
	cin>>n;
	int s[n][3];
	for (auto& i:s)
		cin>>i[0]>>i[1]>>i[2];
	int m;
	cin>>m;
	for (int i=0;i<m;i++)
	{
		int x;cin>>x;acc[x-1]=1;
	}
	map<int,vector<int>>d,z;
	for (int i=0;i<n;i++)
		d[0].push_back(i);
	for (int i=0;i<300;i++)
	{
		int cnt=0;
		for (auto j:d)
		{
			for (auto k:j.second)
			{
				if (sp[k])
				{
					z[j.first+1].push_back(k);
					sp[k]--;
				}
				else
				{
					z[j.first+s[k][i/100]].push_back(k);
					if (acc[i])
					{
						sp[k]+=cnt%20;
					}
				}
			}
			cnt+=j.second.size();
		}
			d=z;
			z.clear();
	}
	int ans[n]={};
	for (auto i:d)
	{
		for(auto j:i.second)
			ans[j]=i.first;
	}
	for (auto i:ans)
		cout<<i<<endl;
}
int main()
{
    ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);
        solve();
}
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 348 KB Output is correct
2 Correct 5 ms 348 KB Output is correct
3 Incorrect 18 ms 600 KB Output isn't correct
4 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 1 ms 348 KB Output isn't correct
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 348 KB Output is correct
2 Correct 5 ms 348 KB Output is correct
3 Incorrect 18 ms 600 KB Output isn't correct
4 Halted 0 ms 0 KB -