답안 #655680

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
655680 2022-11-05T09:22:45 Z ShirAriel 걷기 (NOI12_walking) C++17
17 / 25
1 ms 324 KB
#include <iostream>
#include <algorithm>
#include <vector>
#include <set>

using namespace std;

typedef long long ll;
typedef pair<ll, ll> pll;

int main()
{
	ios::sync_with_stdio(false); cin.tie(0); cout.tie(0);

	ll l, n;
	cin >> l >> n;

	vector<pll> persons(n);
	for (ll i = 0; i < n; i++)
		cin >> persons[i].first >> persons[i].second;

	sort(persons.begin(), persons.end());

	//lis
	set<ll> lis;
	for (ll i = 0; i < n; i++)
	{
		ll val = l / persons[i].second + persons[i].first;
		auto it = lis.upper_bound(val);
		if (it != lis.begin())
			lis.erase(--it);
		lis.insert(val);
	}

	cout << lis.size();

	return 0;
}
# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 212 KB Output is correct
2 Correct 0 ms 320 KB Output is correct
3 Correct 0 ms 324 KB Output is correct
4 Incorrect 0 ms 212 KB Output isn't correct
5 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 320 KB Output is correct
2 Correct 1 ms 316 KB Output is correct
3 Correct 1 ms 320 KB Output is correct
4 Correct 0 ms 212 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 212 KB Output is correct
2 Correct 0 ms 212 KB Output is correct
3 Incorrect 1 ms 212 KB Output isn't correct
4 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 324 KB Output is correct
2 Correct 1 ms 316 KB Output is correct
3 Correct 1 ms 320 KB Output is correct
4 Correct 1 ms 212 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 228 KB Output is correct
2 Correct 1 ms 212 KB Output is correct
3 Correct 1 ms 212 KB Output is correct
4 Correct 1 ms 212 KB Output is correct