| # | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 | 
|---|---|---|---|---|---|---|---|
| 763439 | KN200711 | Money (IZhO17_money) | C++14 | 1439 ms | 58008 KiB | 
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
# include <bits/stdc++.h>
using namespace std;
multiset<int> C;
int main() {
	int N;
	scanf("%d", &N);
	
	vector<int> arr(N);
	map<int, int> MM;
	for(int i=0;i<N;i++) {
		scanf("%d", &arr[i]);
		C.insert(arr[i]);
	}
	
	int ans = 0;
	for(int i=N-1;i>=0;i--) {
		auto p = C.lower_bound(arr[i]);
		
		int k = i - 1, cnt = 1;
		while(k >= 0 && arr[k] == arr[k + 1]) {
			cnt++;
			k--;
		}
		
	//	cout<<*p<<endl;
		
		bool ed = 0;
		if(p == C.begin()) ed = 1;
		else p--;
		
		while(cnt--) C.erase(C.find(arr[i]));
		
		if(ed) {
			ans++;
			i = k + 1;
			continue;
		}
		
		while(k >= 0 && *p == arr[k]) {
		//	cout<<k<<" "<<arr[k]<< endl;
			
			auto q = p;
			if(k != 0) q--;
			
			C.erase(p);
			if(k != 0) p = q;
			
			k--;
		//	cout<<*p<<endl;
		}
		
	//	cout<<k<<endl;
		
		i = k + 1;
		ans++;
	}
	printf("%d\n", ans);
}
컴파일 시 표준 에러 (stderr) 메시지
| # | Verdict | Execution time | Memory | Grader output | 
|---|---|---|---|---|
| Fetching results... | ||||
| # | Verdict | Execution time | Memory | Grader output | 
|---|---|---|---|---|
| Fetching results... | ||||
| # | Verdict | Execution time | Memory | Grader output | 
|---|---|---|---|---|
| Fetching results... | ||||
| # | Verdict | Execution time | Memory | Grader output | 
|---|---|---|---|---|
| Fetching results... | ||||
