답안 #298927

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
298927 2020-09-14T10:48:22 Z BlancaHM 팀들 (IOI15_teams) C++14
0 / 100
4000 ms 16376 KB
#include <iostream>
#include <fstream>
#include <cfloat>
#include <iomanip>
#include <vector>
#include <algorithm>
#include <queue>
#include <stack>
#include <cstring>
#include <cmath>
#include <climits>
#include <set>
#include <map>
#include <unordered_set>
#include <unordered_map>
using namespace std;
typedef pair<int, int> pii;
typedef long long int ll;
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef vector<vvi> vvvi;
typedef vector<vvvi> vvvvi;
typedef vector<pii> vpii;
typedef vector<vpii> vvpii;
typedef vector<ll> vl;
typedef vector<vl> vvl;
typedef vector<vvl> vvvl;
typedef vector<vvvl> vvvvl;
typedef vector<string> vs;
#define fir first
#define sec second
#define pb push_back
#define eb emplace_back
#define ppb pop_back
#define pf push_front
#define ppf pop_front
#define mp make_pair
#define len(v) ((int)v.size())
#define all(v) v.begin(), v.end()

int num;
vpii pref;

void init(int N, int* A, int* B) {
	num = N;
	pref = vpii(N);
	for (int i = 0; i < N; i++) {
		pref[i] = mp(A[i], B[i]);
	}
	sort(pref.begin(), pref.end());
}

int can(int M, int* K) {
	sort(K, K+M);
	int i = 0, j = 0, inc;
	bool pos;
	while(i < num && j < M) {
		if (pref[i].first > K[j]) return 0;
		if (pref[i].second >= K[j]) {
			pos = true;
			inc = i+1;
			for (int n = j+1; n < j+K[j]; n++) {
				if (pref[n].second >= K[j]) inc = n+1;
				else {
					pos = false;
					break;
				}
			}
			i = inc;
			if (pos) j++;
		} else i++;
	}
	return j == M;
}
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 256 KB Output is correct
2 Incorrect 1 ms 256 KB Output isn't correct
3 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 19 ms 3072 KB Output is correct
2 Correct 20 ms 3072 KB Output is correct
3 Correct 20 ms 3072 KB Output is correct
4 Correct 23 ms 3576 KB Output is correct
5 Incorrect 12 ms 2688 KB Output isn't correct
6 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 23 ms 3832 KB Output is correct
2 Execution timed out 4050 ms 3328 KB Time limit exceeded
3 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 103 ms 16376 KB Output is correct
2 Execution timed out 4051 ms 14968 KB Time limit exceeded
3 Halted 0 ms 0 KB -