답안 #1112480

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
1112480 2024-11-14T08:42:08 Z vjudge1 Baloni (COCI15_baloni) C++17
0 / 100
50 ms 14160 KB
#include <bits/stdc++.h>
#define int long long
using namespace std;

int32_t main(){
	ios_base::sync_with_stdio(false);
	cin.tie(NULL);
	cout.tie(NULL);
	int n;
	cin >> n;
	vector<pair<int,bool>> v(n);
	for(int i=0;i<n;i++){
		cin >> v[i].first;
		v[i].second=false;
	}
	int ans=1;
	int res,resi;
	for(int i=0;i<n;i++){
		for(int j=0;j<n;j++){
			if(v[j].second==false){
				ans++;
				res=v[j].first-1;
				v[j].second=true;
				resi=j;
				break;
			}
			cout << ans << endl;
			return 0;
		}
		for(int j=resi+1;j<n;j++){
			if(v[j].first==res && v[j].second==false){
				res--;
				v[j].second=true;
			}
		}
	}
	return 0;
}
# 결과 실행 시간 메모리 Grader output
1 Incorrect 1 ms 336 KB Output isn't correct
2 Incorrect 1 ms 336 KB Output isn't correct
3 Incorrect 2 ms 336 KB Output isn't correct
4 Incorrect 1 ms 336 KB Output isn't correct
5 Incorrect 40 ms 12624 KB Output isn't correct
6 Incorrect 50 ms 14160 KB Output isn't correct
7 Incorrect 34 ms 11856 KB Output isn't correct
8 Incorrect 33 ms 11600 KB Output isn't correct
9 Incorrect 39 ms 12368 KB Output isn't correct
10 Incorrect 40 ms 12624 KB Output isn't correct