답안 #150100

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
150100 2019-09-01T07:42:52 Z HSNU(#3687, joylintp, 147, wiwiho) King of Chairs (FXCUP4_chairs) C++17
95 / 100
290 ms 6212 KB
#include "king.h"

#include <bits/stdc++.h>

#define StarBurstStream ios_base::sync_with_stdio(false); cin.tie(0); cout.tie(0);
#define iter(a) a.begin(), a.end()
#define riter(a) a.rbegin(), a.rend()
#define lsort(a) sort(iter(a))
#define gsort(a) sort(riter(a))
#define mp(a, b) make_pair(a, b)
#define pb(a) push_back(a)
#define pf(a) push_front(a)
#define pob pop_back()
#define pof pop_front()
#define F first
#define S second
#define printv(a, b) {bool pvaspace=false; \
for(auto pva : a){ \
    if(pvaspace) b << " "; pvaspace=true;\
    b << pva;\
}\
b << "\n";}
#define pii pair<int, int>
#define pll pair<ll, ll>
#define modadd(a, b) (((a % MOD) + (b % MOD)) % MOD)
#define modtimes(a, b) (((a % MOD) * (b % MOD)) % MOD)

//#define TEST

typedef long long ll;
typedef unsigned long long ull;

using namespace std;

const ll MOD = 1000000007;
const ll MAX = 2147483647;

long long SendInfo(std::vector<int> W, std::vector<int> C) {
	lsort(W);
	lsort(C);

	int wp = 0, cp = 0;
	int ans = 0;
	int n = W.size();
	while(wp < n && cp < n){
		if(W[wp] < C[cp]){
			ans++;
			wp++;
		}
		cp++;
	}

	return ans;
}
#include "vassal.h"

#include <bits/stdc++.h>

#define StarBurstStream ios_base::sync_with_stdio(false); cin.tie(0); cout.tie(0);
#define iter(a) a.begin(), a.end()
#define riter(a) a.rbegin(), a.rend()
#define lsort(a) sort(iter(a))
#define gsort(a) sort(riter(a))
#define mp(a, b) make_pair(a, b)
#define pb(a) push_back(a)
#define pf(a) push_front(a)
#define pob pop_back()
#define pof pop_front()
#define F first
#define S second
#define printv(a, b) {bool pvaspace=false; \
for(auto pva : a){ \
    if(pvaspace) b << " "; pvaspace=true;\
    b << pva;\
}\
b << "\n";}
#define pii pair<int, int>
#define pll pair<ll, ll>
#define modadd(a, b) (((a % MOD) + (b % MOD)) % MOD)
#define modtimes(a, b) (((a % MOD) * (b % MOD)) % MOD)

//#define TEST

typedef long long ll;
typedef unsigned long long ull;

using namespace std;

const ll MOD = 1000000007;
const ll MAX = 2147483647;

long long BB;
std::vector<int> c;
int n;
vector<bool> b;
void Init(long long B, std::vector<int> C){
	BB = B;
	c = C;
	n = c.size();
	b.resize(n);
}

int Maid(int W){
	int s = upper_bound(iter(c), W) - c.begin();
	for(; s < n; s++){
		if(b[s]) continue;
		b[s] = true;
		return s;
	}
	return -1;
}
# 결과 실행 시간 메모리 Grader output
1 Correct 10 ms 1048 KB Correct
2 Correct 10 ms 1044 KB Correct
3 Correct 10 ms 1040 KB Correct
4 Correct 10 ms 1048 KB Correct
5 Correct 11 ms 1040 KB Correct
# 결과 실행 시간 메모리 Grader output
1 Correct 59 ms 3500 KB Correct
2 Correct 118 ms 5648 KB Correct
3 Correct 269 ms 6200 KB Correct
4 Correct 109 ms 6212 KB Correct
5 Correct 112 ms 6200 KB Correct
6 Correct 113 ms 6080 KB Correct
7 Correct 277 ms 6212 KB Correct
# 결과 실행 시간 메모리 Grader output
1 Partially correct 71 ms 3772 KB B = 50991
2 Partially correct 131 ms 5504 KB B = 91406
3 Partially correct 290 ms 6204 KB B = 49847
4 Partially correct 139 ms 6208 KB B = 99850
5 Partially correct 150 ms 6212 KB B = 99598
6 Partially correct 125 ms 6208 KB B = 99746
7 Partially correct 288 ms 6208 KB B = 49910
8 Correct 102 ms 6088 KB Correct