답안 #611644

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
611644 2022-07-29T06:15:22 Z 장태환(#8498) Segway (COI19_segway) C++17
100 / 100
369 ms 48084 KB
#include <bits/stdc++.h>
using namespace std;
int arr[301][20100];
int rp[301][20100];
bool a[310];
int inp[20100][3];
int main()
{
	int N, M;
	ios_base::sync_with_stdio(false);
	cin.tie(NULL);
	cin >> N;
	int i;
	for (i = 0; i < N; i++)
	{
		cin >> inp[i][0] >> inp[i][1] >> inp[i][2];
	}
	cin >> M;
	for (i = 0; i < M; i++)
	{
		int x;
		cin >> x;
		a[x] = 1;
	}
	for (i = 0; i < 300; i++)
	{
		vector<int>x;
		int j;
		for (j = 0; j < N; j++)
		{
			arr[i + 1][j] = arr[i][j] + (rp[i][j] ? 1 : inp[j][i/100]);
			rp[i+1][j] = max(0, rp[i][j] -1);
			x.push_back(arr[i + 1][j]);
			
		}
		sort(x.begin(), x.end());
		for (j = 0; j < N; j++)
		{
			if (rp[i + 1][j] == 0 && a[i + 1])
			{
				rp[i + 1][j] = (lower_bound(x.begin(), x.end(), arr[i + 1][j])-x.begin())%20;
			}
		}
		
	}
	for (i = 0; i < N; i++)
	{
		cout << arr[300][i] << '\n';
	}
}
# 결과 실행 시간 메모리 Grader output
1 Correct 2 ms 2772 KB Output is correct
2 Correct 5 ms 3284 KB Output is correct
3 Correct 12 ms 4604 KB Output is correct
4 Correct 52 ms 9872 KB Output is correct
5 Correct 303 ms 48020 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 2772 KB Output is correct
2 Correct 1 ms 2772 KB Output is correct
3 Correct 1 ms 2772 KB Output is correct
4 Correct 1 ms 2772 KB Output is correct
5 Correct 2 ms 2900 KB Output is correct
6 Correct 2 ms 2900 KB Output is correct
7 Correct 2 ms 2900 KB Output is correct
8 Correct 4 ms 3156 KB Output is correct
9 Correct 4 ms 3284 KB Output is correct
10 Correct 5 ms 3540 KB Output is correct
11 Correct 6 ms 3284 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 2 ms 2772 KB Output is correct
2 Correct 5 ms 3284 KB Output is correct
3 Correct 12 ms 4604 KB Output is correct
4 Correct 52 ms 9872 KB Output is correct
5 Correct 303 ms 48020 KB Output is correct
6 Correct 1 ms 2772 KB Output is correct
7 Correct 1 ms 2772 KB Output is correct
8 Correct 1 ms 2772 KB Output is correct
9 Correct 1 ms 2772 KB Output is correct
10 Correct 2 ms 2900 KB Output is correct
11 Correct 2 ms 2900 KB Output is correct
12 Correct 2 ms 2900 KB Output is correct
13 Correct 4 ms 3156 KB Output is correct
14 Correct 4 ms 3284 KB Output is correct
15 Correct 5 ms 3540 KB Output is correct
16 Correct 6 ms 3284 KB Output is correct
17 Correct 16 ms 5176 KB Output is correct
18 Correct 33 ms 7516 KB Output is correct
19 Correct 165 ms 23620 KB Output is correct
20 Correct 183 ms 29132 KB Output is correct
21 Correct 265 ms 38536 KB Output is correct
22 Correct 369 ms 47904 KB Output is correct
23 Correct 275 ms 48084 KB Output is correct